Skip to content

Every package.json is a derived input: npm run runs its scripts - #38

Merged
ndbroadbent merged 1 commit into
mainfrom
inputs/package-json
Dec 4, 2026
Merged

ndbroadbent merged 1 commit into
mainfrom
inputs/package-json

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Fixes a false skip on main from the bootstrap field report: only package.json's packageManager field was a derived input, so a job running npm run test skipped after its test script changed.

What changed

  • Every job's hash now covers every tracked package.json (pattern **/package.json, which includes the root's since Match globs with :(glob) pathspecs: **/*.md now includes root files #28, resolved with git ls-files like module inputs). This is the same over-inclusive rule as lockfiles: cigen can't tell which job runs a package manager, or in which package.
  • package_manager moved to src/inputs/packages.rs, with the patterns, so src/inputs.rs stays under 300 lines.
  • Docs: the Inputs page lists every package.json. STATUS is updated.

Default hashes change once for projects that have a package.json.

Tests

  • tests/derived_inputs.rs changing_the_package_script_the_job_runs_makes_it_run, in mockci: a job runs npm run test. Changing the root's test script reruns it, and so does changing a sub-package's. It failed on main at the root change before the fix.
  • task ci passes with no warnings.

#26 will carry the same rule over: a narrowed job gets the package.json files only when it's in the node family or opaque.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Only package.json's packageManager field was an input, so a job running
`npm run test` skipped after its test script changed. Every job now gets
every tracked package.json, the same over-inclusive rule as lockfiles:
cigen can't tell which job runs a package manager, or in which package.
@ndbroadbent
ndbroadbent merged commit 3ac0e79 into main Dec 4, 2026
9 checks passed
ndbroadbent added a commit that referenced this pull request Dec 4, 2026
#38 made every package.json a derived input, through the same list as the
patterns modules contribute, so explain labelled `**/package.json` as coming
from a module. Derived patterns now carry a reason, `from a module` or
`every package.json`, like derived files do.
ndbroadbent added a commit that referenced this pull request Dec 4, 2026
#38 made every package.json a derived input, through the same list as the
patterns modules contribute, so explain labelled `**/package.json` as coming
from a module. Derived patterns now carry a reason, `from a module` or
`every package.json`, like derived files do.
ndbroadbent added a commit that referenced this pull request Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant