Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Files directive breaks the "files" directive #5918

Closed
2 tasks done
MarshallOfSound opened this issue Dec 5, 2022 · 2 comments · Fixed by #5927
Closed
2 tasks done

[BUG] Files directive breaks the "files" directive #5918

MarshallOfSound opened this issue Dec 5, 2022 · 2 comments · Fixed by #5927
Labels
Bug thing that needs fixing Priority 0 will get attention right away regression:9.x Release 9.x work is associated with a specific npm 9 release

Comments

@MarshallOfSound
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

An entry in the files array in your package.json in the format foo/* does not include deeper files in nested directories

Expected Behavior

An entry in the files array in your package.json in the format foo/* includes all files inside the foo folder and its children

Steps To Reproduce

git clone https://github.com/MarshallOfSound/npm-files-bug.git
cd npm-files-bug
npx npm@8 pack
npx npm@9 pack

npm 8 output

npm notice === Tarball Contents ===
npm notice 0B   folder/one/file
npm notice 0B   folder/two/file2
npm notice 275B package.json
npm notice === Tarball Details ===

npm 9 output

npm notice === Tarball Contents ===
npm notice 275B package.json
npm notice === Tarball Details ===

Environment

  • npm: 9.1.3
  • Node.js: 16.17.0
  • OS Name: macOS 12.6
  • System Model Name: Macbook Pro M1 MAX
  • npm config:
; "user" config from /Users/samuel/.npmrc

@fortawesome:registry = "https://npm.fontawesome.com/"
//npm.fontawesome.com/:_authToken = (protected)
//registry.npmjs.org/:_authToken = (protected)

; "cli" config from command line options

location = "project"

; node bin location = /Users/samuel/.nvm/versions/node/v16.17.0/bin/node
; node version = v16.17.0
; npm local prefix = /Users/samuel/projects/electron/npm-demo
; npm version = 9.1.3
; cwd = /Users/samuel/projects/electron/npm-demo
; HOME = /Users/samuel
; Run `npm config ls -l` to show all defaults.
@MarshallOfSound MarshallOfSound added Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release labels Dec 5, 2022
@MarshallOfSound
Copy link
Author

Looks like this was broken in npm/npm-packlist#88 maybe unintentionally? Shout-out @JasonEtco for diving into npm internals to find that PR with me

cc @nlf

@lukekarrys lukekarrys added regression:9.x Priority 0 will get attention right away and removed Needs Triage needs review for next steps labels Dec 7, 2022
@lukekarrys
Copy link
Contributor

Thanks for the report @MarshallOfSound (and the help @JasonEtco).

Just dropping one note here while triaging, that both of the following work the same across npm 8 and 9: "files": ["folder"] and "files": ["folder/"].

lukekarrys added a commit to npm/npm-packlist that referenced this issue Dec 7, 2022
This makes `directory/*` work the same as `directory/**` to maintain backwards compatibility with previous versions of `npm pack`.

Ref: npm/cli#5918
lukekarrys added a commit that referenced this issue Dec 7, 2022
lukekarrys added a commit that referenced this issue Dec 7, 2022
hanazuki added a commit to hanazuki/node-jsonnet that referenced this issue Feb 25, 2023
npm/cli#5918 suggets that glob was not
necessary here.
hanazuki added a commit to hanazuki/node-jsonnet that referenced this issue Feb 25, 2023
npm@9 has an incompatibility around glob in files directive.
npm/cli#5918 suggets that glob was not
necessary here.
hanazuki added a commit to hanazuki/node-jsonnet that referenced this issue Feb 25, 2023
npm@9 has an incompatibility around glob in files directive.
npm/cli#5918 suggets that glob was not
necessary here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 0 will get attention right away regression:9.x Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants