Skip to content

fix: exempt explicit pack targets from allow-directory - #9916

Merged
martinrrm merged 1 commit into
release/v11from
backport/v11/9756
Aug 25, 2026
Merged

fix: exempt explicit pack targets from allow-directory#9916
martinrrm merged 1 commit into
release/v11from
backport/v11/9756

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Backport of #9756 to release/v11.

## Summary

- allow explicit directory targets through `npm pack` and `npm publish`
when `allow-directory` is `none` or `root`
- keep dependency fetch policies unchanged and cover the shared library
plus both CLI commands

## Why

`allow-directory` restricts 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)
- dry-run `pack` and `publish` smokes with `allow-directory=none|root` -
passed

Co-authored-by: ychampion <ychampion@users.noreply.github.com>
(cherry picked from commit 71915e8)
@martinrrm
martinrrm merged commit 83b750d into release/v11 Aug 25, 2026
50 checks passed
@martinrrm
martinrrm deleted the backport/v11/9756 branch August 25, 2026 20:28
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.

2 participants