arethetypeswrong / arethetypeswrong/arethetypeswrong.github.io

Support Running Without Triggering npm pack | postbuild support

Open
#253 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.6k
Forks
65
PR merge metrics
No merged PRs in 30d

Description

# Description:

It would be helpful to allow the tool to run directly on the current folder without automatically triggering `npm pack`.

# Use Case:

I want to use this tool as part of a `postbuild` script. However, the current behavior causes an infinite loop:

- `npm postbuild` triggers `attw`
- `attw` triggers `npm pack`
- `npm pack` triggers `npm build`
- `npm build` triggers `npm postbuild`
- ...and the cycle **repeats**

# Current Workaround:

To avoid this loop, I manually create a tarball and run `attw` on it:
```
"postbuild": "tar -czf dist/archive.tgz LICENSE README.md dist/cjs dist/esm dist/umd docs package.json && npx attw --format ascii dist/archive.tgz && rm dist/archive.tgz"
```

# Proposed Solution:

Introduce an option or flag to allow `attw` to operate directly on the current directory without invoking `npm pack`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the attw CLI path that invokes npm pack and review how command-line options are parsed. The change is complete when attw can analyze the current directory without invoking npm pack, so it can run from a postbuild script without triggering the build loop.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
build-system, cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.