GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: exempt explicit pack targets from allow-directory by ychampion · Pull Request #9756 · npm/cli

Conversation

@ychampion

@ychampion ychampion commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ychampion
ychampion requested review from a team as code owners July 12, 2026 15:34
@ychampion
fix: exempt explicit pack targets from allow-directory
7455793
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
@ychampion
ychampion force-pushed the fix/allow-directory-pack-root branch from 78fd676 to 7455793 Compare July 28, 2026 02:56
martinrrm
martinrrm approved these changes Jul 30, 2026
View reviewed changes
@martinrrm martinrrm added the backport:v11 label Aug 24, 2026
@martinrrm
martinrrm merged commit 71915e8 into npm:latest Aug 24, 2026
47 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Aug 24, 2026
fix: exempt explicit pack targets from allow-directory #9916
Merged
@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🎉 Backport to release/v11 created: #9916

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Aug 24, 2026
chore: release 12.1.0 #9839
Merged
martinrrm pushed a commit that referenced this pull request Aug 25, 2026
@github-actions @ychampion
fix: exempt explicit pack targets from allow-directory (#9916)
83b750d
Backport of #9756 to `release/v11`.

Co-authored-by: Yashas Gunderia <[email protected]>
Co-authored-by: ychampion <[email protected]>
@npm-cli-bot npm-cli-bot mentioned this pull request Sep 22, 2026
deps: upgrade npm to 12.1.0 nodejs/node#66212
Merged
@lazerg lazerg mentioned this pull request Oct 20, 2026
fix: exempt explicit tarball targets from allow-file #10145
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@martinrrm martinrrm martinrrm approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

backport:v11

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[BUG] allow-directory=none|root breaks npm publish

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ychampion @martinrrm
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.