Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ npm run lint # run lint on source code and tests
npm run test # run tests
npm run coverage # run tests and serves coverage reports from localhost:8081
npm run docs # output documentation to `./docs` directory

npm version <patch|minor|major> --ignore-scripts=false # bump version (see note below)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The --ignore-scripts=false flag overrides the .npmrc setting globally for that invocation, which is exactly right. However, the inline comment # bump version (see note below) is the only forward-reference to the note in the code block — the note itself now appears immediately after, so the comment still works. One minor readability improvement: consider shortening the comment to just # see note below since "bump version" is already conveyed by the command itself, reducing redundancy.

```

> **Note:** `.npmrc` sets `ignore-scripts=true` for supply-chain safety, so lifecycle scripts (including husky's hook installation) do not run automatically on `npm install`. Run `npm run prepare` once after cloning to enable the `pre-push` lint hook.
> **Note:** `.npmrc` sets `ignore-scripts=true` for supply-chain safety, so lifecycle scripts do not run automatically. This affects two workflows:
> - **husky git hooks:** run `npm run prepare` once after cloning to enable the `pre-push` lint hook.
> - **`npm version`:** the `version` lifecycle script (which regenerates `src/version.js`, docs, and the `./dist` bundle and stages them into the release commit) is skipped. Always pass `--ignore-scripts=false` when bumping the version so these artifacts are regenerated.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: This is accurate and matches what package.json's version script actually does (node ./src/generateVersion.js && npm run docs && git add ./docs/* && npm run bundle && git add -A ./dist && git add ./src/version.js). For extra safety and discoverability, consider adding a note that --ignore-scripts=false only needs to be paired with npm version (not npm publish, which uses prepublish), so contributors aren't confused about whether they need the flag for other npm lifecycle events.

Loading