Repository navigation
fix: publish a runtime-only npm shrinkwrap - #83
Merged
Merged
Conversation
codex-unlock 0.4.1 published the repository lockfile as npm-shrinkwrap.json, including every development dependency. npm installs every entry of a dependency's shrinkwrap, so installing codex-unlock as a dependency added about 100 development packages under node_modules/codex-unlock. Restore package-lock.json as the repository lockfile and generate the published npm-shrinkwrap.json from it with only the runtime tree (scripts/consumer-shrinkwrap.mjs). The publish job generates it before npm publish, prepublishOnly rejects a missing, stale, or development-bearing shrinkwrap, and the generated file is git-ignored so it never overrides package-lock.json for local installs. Package smoke now installs the packed artifact as a regular dependency and requires exactly codex-unlock, fs-ext-extra-prebuilt, and nan. Closes #82
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[email protected]published the repository lockfile asnpm-shrinkwrap.json, including every development dependency. npm installs every entry of a dependency's shrinkwrap, sonpm install [email protected]added 105 packages (typescript, eslint, ajv, ... as extraneous) instead of 3. Global installs were unaffected.package-lock.jsonas the repository lockfile (rename only; the tree is unchanged).scripts/consumer-shrinkwrap.mjs, which generatesnpm-shrinkwrap.jsonfrompackage-lock.jsonwith only the runtime tree: entries markeddev/devOptionaland the rootdevDependenciesare removed.--checkverifies an existing file.npm publish.prepublishOnlyruns--check, so publication fails if the shrinkwrap is missing, stale, or contains development entries.npm-shrinkwrap.jsonis git-ignored so a generated copy never overridespackage-lock.jsonfor local installs.fs-ext-extra-prebuiltandnan, and it now installs the packed artifact as a regular dependency (previously--omit=dev, which hid this regression). That installation must contain exactlycodex-unlock,fs-ext-extra-prebuilt, andnan.AGENTS.md,docs/maintainer-release.md,docs/platform-support.md, and the Dependabot comment.Closes #82
Type
Safety impact
Packaging only. No change to lock probing, owner validation, signaling, or JSON output. Runtime pins for npm consumers are unchanged (
fs-ext-extra-prebuilt2.2.14,nan2.29.0).Checklist
npm run checkpassesnpm run lintpassesnpm testpasses (164 pass, 0 fail)npm run smoke:packagepassesNotes
npm publish --dry-runruns theprepublishOnlycheck and packs a 1.2 kB shrinkwrap with only the two runtime entries.node scripts/consumer-shrinkwrap.mjs --checkfails without a generated file, andassertConsumerShrinkwraprejects the full lockfile.npm ci,smoke:platform, and a clean working tree after package smoke were verified locally.package-lock.json, so version bumps need no configuration change.