fix: exempt explicit pack targets from allow-directory#9756
Open
ychampion wants to merge 1 commit into
Open
Conversation
Constraint: allow-directory governs directory dependencies, not the package explicitly selected for pack or publish. Rejected: Override only in publish | leaves libnpmpack callers and npm pack inconsistent at the same policy boundary. Confidence: high Scope-risk: narrow Directive: Keep registry, remote, file, git, and dependency resolution subject to their configured fetch policies. Tested: node . run test; node . run test -w libnpmpack; publish and pack dry-run smoke for allow-directory=none|root; registry/file denial probes; git diff --check Not-tested: Manual CLI smoke on non-Linux platforms
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
npm packandnpm publishwhenallow-directoryisnoneorrootWhy
allow-directoryrestricts directory dependencies, but the local package selected for packing or publishing is the command target. The current flow applies the dependency policy to that target during manifest or tarball preparation.Closes #9755.
Validation
node . run test- passed (123 test files, 100% coverage)node . run test -w libnpmpack- passed (100% coverage)packandpublishsmokes withallow-directory=none|root- passed