Skip to content

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

Open
github-actions[bot] wants to merge 1 commit into
release/v11from
backport/v11/9756
Open

fix: exempt explicit pack targets from allow-directory#9916
github-actions[bot] wants to merge 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)
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