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] npm v9.0.0: src/, dist/ was not packed #5741

Closed
2 tasks done
aladdin-add opened this issue Oct 25, 2022 · 4 comments · Fixed by npm/npm-packlist#140
Closed
2 tasks done

[BUG] npm v9.0.0: src/, dist/ was not packed #5741

aladdin-add opened this issue Oct 25, 2022 · 4 comments · Fixed by npm/npm-packlist#140
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 9.x work is associated with a specific npm 9 release

Comments

@aladdin-add
Copy link
Contributor

aladdin-add commented Oct 25, 2022

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

  "files": [
    "./src/",
    "./dist/"
  ],
➜  dn git:(main) npm pack
npm notice 
npm notice 📦  @dian/[email protected]
npm notice === Tarball Contents === 
npm notice 2.6kB README.md   
npm notice 2.6kB package.json
npm notice === Tarball Details === 
npm notice name:          @dian/dn                                
npm notice version:       0.5.19                                  
npm notice filename:      @dian/dn-0.5.19.tgz                     
npm notice package size:  2.4 kB                                  
npm notice unpacked size: 5.2 kB                                  
npm notice shasum:        7da9625b31463f5fe420732e6e0d428a885a1ae2
npm notice integrity:     sha512-/FDJumc6JZIIl[...]I+P00TGf9VRPw==
npm notice total files:   2                                       
npm notice 
dian-dn-0.5.19.tgz

Expected Behavior

the files in "src/" and "dist/" should be packed.
I've confirmed it's working fine with npm v8.

Steps To Reproduce

  1. In this environment...
  2. With this config...
  3. Run '...'
  4. See error...

Environment

  • npm: 9.0.0
  • Node.js: v19.0.0
  • OS Name: macos
  • System Model Name:
  • npm config:
; copy and paste output from `npm config ls` here
@aladdin-add aladdin-add 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 Oct 25, 2022
@wraithgar
Copy link
Member

The files array does not support the leading ./, if you remove them it should work.

The entries in files are not paths, they are glob patterns. https://docs.npmjs.com/cli/configuring-npm/package-json#files

@wraithgar
Copy link
Member

~/D/n/s/pack $ cat package.json
{
  "name": "pack",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "files": [
    "src/",
    "dist/"
  ],
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "Gar <[email protected]>",
  "license": "ISC"
}
~/D/n/s/pack $ npm pack --dry-run
npm notice 
npm notice 📦  [email protected]
npm notice === Tarball Contents === 
npm notice 0B   dist/foo    
npm notice 289B package.json
npm notice 0B   src/bar     

@aladdin-add
Copy link
Contributor Author

aladdin-add commented Oct 26, 2022

sounds a regression: #4850 (comment)

I didn't see it was mentioned in the release note, if you want it to be a breaking change.

@wraithgar wraithgar reopened this Oct 26, 2022
@wraithgar wraithgar added Priority 1 high priority issue and removed Needs Triage needs review for next steps labels Oct 26, 2022
@wraithgar
Copy link
Member

wraithgar commented Oct 26, 2022

It was introduced in npm@9 w/ the packlist refactor. cc @nlf

@wraithgar wraithgar added Documentation documentation related issue Priority 2 secondary priority issue Bug thing that needs fixing Priority 1 high priority issue and removed Priority 1 high priority issue Bug thing that needs fixing Priority 2 secondary priority issue Documentation documentation related issue labels Oct 26, 2022
@wraithgar wraithgar self-assigned this Oct 26, 2022
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 1 high priority issue 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