Skip to content

npm scripts: inline lifecycle pre/post hooks into their parents - #2726

Merged
chalin merged 7 commits into
google:mainfrom
chalin:chalin-m24-npm-lifecycle-hooks-2026-0818
Aug 19, 2026
Merged

npm scripts: inline lifecycle pre/post hooks into their parents#2726
chalin merged 7 commits into
google:mainfrom
chalin:chalin-m24-npm-lifecycle-hooks-2026-0818

Conversation

@chalin

@chalin chalin commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator
  • Inlines all npm pre*/post* run-hook scripts into their parent scripts as explicit && chains (otel.io precedent), so behavior no longer depends on npm's implicit hook mechanism.
  • Fixes a false-green in ignore-scripts environments (ignore-scripts=true suppresses npm run pre/post hooks, but not the script itself): check:links / check:links:internal silently skipped the site build and checked a stale or absent public/.
  • Where a caller passes extra args through a post-inlined parent (update:packages:not-hugo), routes them to the main step via the otel.io bash -c '… "$@" && …' - form (npm appends extras to the last && command).
  • Adds a manifest-wide guard test: no script in any workspace manifest may have a pre/post hook sibling (subsumes the previous root-only check-lane list).
  • Adds the changelog "For maintainers" entry.
  • Preview: changelog

chalin added 7 commits August 18, 2026 22:20
- Routes npm extra args past the inlined post-update step (otel.io
  bash -c form), fixing update:packages:not-hugo
- Widens the hook-sibling test to every script in all three manifests
- Adds the changelog "For maintainers" entry
- Replaces the bash -c arg-passthrough with the repo's underscore-payload
  idiom: :not-hugo puts its flag on _update:packages directly
@chalin
chalin marked this pull request as ready for review August 19, 2026 11:42
@chalin chalin added the CI/infra CI & infrastructure label Aug 19, 2026
@chalin chalin added this to the 0.17.0 milestone Aug 19, 2026
@chalin
chalin merged commit 97bfabe into google:main Aug 19, 2026
18 checks passed
@chalin
chalin deleted the chalin-m24-npm-lifecycle-hooks-2026-0818 branch August 19, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/infra CI & infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant