Skip to content

feat: forward globalIgnoreFile option to npm-packlist#487

Merged
owlstronaut merged 1 commit into
npm:mainfrom
ljharb:feat/global-ignore-file
May 22, 2026
Merged

feat: forward globalIgnoreFile option to npm-packlist#487
owlstronaut merged 1 commit into
npm:mainfrom
ljharb:feat/global-ignore-file

Conversation

@ljharb

@ljharb ljharb commented May 13, 2026

Copy link
Copy Markdown
Contributor

DirFetcher is the entry point for packing a directory spec and calls npm-packlist directly. Pull globalIgnoreFile off the opts and pass it through to packlist so a user level ignore file (configured by callers such as the npm cli) actually reaches the walker that decides which files end up in the tarball.

Includes a test that mocks npm-packlist to confirm the option is forwarded, and a complementary test confirming that omitting the option passes undefined through. The behavior on the packlist side lands in a separate npm-packlist release; this commit only adds the plumbing on the pacote side.

Required for npm/cli#9351

`DirFetcher` is the entry point for packing a directory spec and calls `npm-packlist` directly.
Pull `globalIgnoreFile` off the opts and pass it through to packlist so a user level ignore file (configured by callers such as the npm cli) actually reaches the walker that decides which files end up in the tarball.

Includes a test that mocks `npm-packlist` to confirm the option is forwarded, and a complementary test confirming that omitting the option passes `undefined` through.
The behavior on the packlist side lands in a separate npm-packlist release; this commit only adds the plumbing on the pacote side.
@ljharb
ljharb requested a review from a team as a code owner May 13, 2026 19:41
@owlstronaut
owlstronaut merged commit 66e7ea7 into npm:main May 22, 2026
1 check passed
@github-actions github-actions Bot mentioned this pull request May 12, 2026
owlstronaut pushed a commit that referenced this pull request Jun 15, 2026
🤖 I have created a release *beep* *boop*
---


## [22.0.0](v21.5.0...v22.0.0)
(2026-06-15)
### ⚠️ BREAKING CHANGES
* `pacote` now supports node `^22.22.2 || ^24.15.0 || >=26.0.0`
* git specs using the `https` or `git+https` protocol now resolve to
`git+https` URLs instead of being switched to `git+ssh`. Shortcut specs
(e.g. `github:user/repo`, `user/repo`) and `git+ssh`/`git://` specs are
unchanged.
### Features
*
[`09316f5`](09316f5)
[#504](#504) bump to new node engine
range (@owlstronaut)
*
[`2ab74b0`](2ab74b0)
[#497](#497) strip patchedDependencies
from the packed package.json (#497) (@manzoorwanijk)
*
[`66e7ea7`](66e7ea7)
[#487](#487) forward globalIgnoreFile
option to npm-packlist (@ljharb)
### Bug Fixes
*
[`ce804fb`](ce804fb)
[#498](#498) avoid ReDoS in addGitSha
committish stripping (#498) (@owlstronaut)
*
[`1f5f131`](1f5f131)
[#494](#494) pass --global=false when
preparing git dependencies (@owlstronaut)
*
[`e0af7f6`](e0af7f6)
[#486](#486) respect ignoreScripts
option for git dependencies (@owlstronaut)
*
[`12c8c8f`](12c8c8f)
[#481](#481) fall back to git clone
when tarball response is not a valid archive (@babyhuey)
*
[`61f065a`](61f065a)
[#481](#481) use statusCode instead of
constructor name for tarball fallback in git fetcher (@j1mb0-1)
*
[`6d160c1`](6d160c1)
[#434](#434) do not switch to git+ssh
for https repository links (#434) (@oldium)
### Dependencies
*
[`371e8b0`](371e8b0)
[#504](#504) `ssri@14.0.0`
*
[`b68c6c2`](b68c6c2)
[#504](#504) `sigstore@5.0.0`
*
[`57793ab`](57793ab)
[#504](#504) `proc-log@7.0.0`
*
[`33eacc9`](33eacc9)
[#504](#504)
`npm-registry-fetch@20.0.1`
*
[`a131916`](a131916)
[#504](#504)
`npm-pick-manifest@12.0.0`
*
[`2b03527`](2b03527)
[#504](#504) `npm-packlist@11.2.0`
*
[`5f8ad42`](5f8ad42)
[#504](#504) `npm-package-arg@14.0.0`
*
[`ee3b96d`](ee3b96d)
[#504](#504) `cacache@21.0.1`
*
[`033f655`](033f655)
[#504](#504)
`@npmcli/run-script@11.0.0`
*
[`ddcc738`](ddcc738)
[#504](#504)
`@npmcli/promise-spawn@10.0.0`
*
[`6a28eb2`](6a28eb2)
[#504](#504)
`@npmcli/package-json@8.0.0`
*
[`5879416`](5879416)
[#504](#504)
`@npmcli/installed-package-contents@5.0.0`
*
[`41ea727`](41ea727)
[#504](#504) `@npmcli/git@8.0.0`
### Chores
*
[`3fc5fd4`](3fc5fd4)
[#504](#504)
`@npmcli/eslint-config@7.0.0` (@owlstronaut)
*
[`7350ab8`](7350ab8)
[#504](#504) `hosted-git-info@10.1.1`
(@owlstronaut)
*
[`c7c7d7f`](c7c7d7f)
[#504](#504) template-oss-apply
(@owlstronaut)
*
[`e9ac85e`](e9ac85e)
[#501](#501) template-oss-apply
(@owlstronaut)
*
[`e184356`](e184356)
[#501](#501) `template-oss@5.1.0`
(@owlstronaut)
*
[`644ebb6`](644ebb6)
[#479](#479) template-oss-apply
(@owlstronaut)
*
[`ee64bea`](ee64bea)
[#479](#479)
`@npmcli/template-oss@4.30.0` (@owlstronaut)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants