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] README.md/LICENSE files etc are included recursively and cannot be excluded #6341

Closed
2 tasks done
XhmikosR opened this issue Apr 10, 2023 · 3 comments
Closed
2 tasks done
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 9.x work is associated with a specific npm 9 release

Comments

@XhmikosR
Copy link
Contributor

XhmikosR commented Apr 10, 2023

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

Up until some time ago, only the root README.md, LICENSE etc were included.

Now these files are included recursively and there doesn't seem to exist a way to exclude them.

I tried adding "!lib/**/README.md" in the files section in package.json but the issue persists.

Expected Behavior

The user should be able to exclude any files from subfolders like before.

Steps To Reproduce

  1. git clone https://github.com/stylelint/stylelint.git && cd stylelint && npm ci
  2. default config
  3. npm pack --dry
  4. See number of files is 588 and includes all README.md files from subfolders.

Environment

  • npm: 9.6.4
  • Node.js: 18.15.0
  • OS Name: Windows/Ubuntu via WSL
  • System Model Name: N/A
  • npm config:
; "builtin" config from C:\Program Files\nodejs\node_modules\npm\npmrc

prefix = "C:\\Users\\xmr\\AppData\\Roaming\\npm"

; "user" config from C:\Users\xmr\.npmrc

update-notifier = false

; node bin location = C:\Program Files\nodejs\node.exe
; node version = v18.15.0
; npm local prefix = C:\Users\xmr\Desktop
; npm version = 9.5.0
; cwd = C:\Users\xmr\Desktop
; HOME = C:\Users\xmr
; Run `npm config ls -l` to show all defaults.

If this change was intended, please at least allow people to exclude the non-ROOT files. Including hundreds of files increases the tarball size, time to extract, download time, disk health, etc.

It should be up to the package publishers to decide if they want to exclude these files, like it was up until some time ago. v8.19.4 that I tried has the previous behavior and doesn't include these files recursively. v9.0.0 and newer has the new behavior.

@XhmikosR XhmikosR 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 Apr 10, 2023
@XhmikosR XhmikosR changed the title [BUG] README.md is included from subfolders and cannot be excluded [BUG] README.md/LICENSE files etc are included recursively and cannot be excluded Apr 10, 2023
@wraithgar wraithgar added Priority 2 secondary priority issue and removed Needs Triage needs review for next steps labels Apr 11, 2023
@XhmikosR
Copy link
Contributor Author

Is there any news about this issue? I understand that it's not the highest priority, but it's a regression nonetheless.

@AaronHamilton965
Copy link
Contributor

Hello, I'm an intern at CodeDay Labs, and my teammate, Rahul, and we have been working on this issue. Hoping to put out a pull request soon.

@XhmikosR
Copy link
Contributor Author

XhmikosR commented Sep 5, 2023

This is supposed to be fixed in npm v10.

@XhmikosR XhmikosR closed this as completed Sep 5, 2023
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 2 secondary priority issue Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

No branches or pull requests

3 participants