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

Doesn't include dist folder #719

Open
mahyarmirrashed opened this issue Nov 5, 2023 · 5 comments
Open

Doesn't include dist folder #719

mahyarmirrashed opened this issue Nov 5, 2023 · 5 comments

Comments

@mahyarmirrashed
Copy link

Description

It is not including the dist/ folder when it is specified to be ignored in .gitignore but not in .npmignore.

Steps to reproduce

  1. Ignore dist in your .gitignore file.
  2. Only ignore node_modules in .npmignore
  3. Run something like npx np@latest --preview even with --contents=dist doesn't mention that the dist folder will be included.

Expected behavior

It should follow the conventions

Environment

np - 8.0.4
Node.js - 16.20.2
pnpm - 8.10.0
Git - 2.42.0
OS - macOS Ventura 13.6.1

@jerone
Copy link

jerone commented Feb 29, 2024

I'm having a very similar issue with the dist folder.
Via npm there is no issue.

np --preview:

The following new files will be published for the first time:
- LICENSE
- package.json
- README.md

npm publish --dry-run:

npm notice === Tarball Contents ===
npm notice 35.1kB LICENSE
npm notice 1.3kB  README.md
npm notice 767B   dist/main.js
npm notice 919B   dist/main.js.map
npm notice 611B   dist/module.js
npm notice 915B   dist/module.js.map
npm notice 1.7kB  package.json

.npmignore:

*
!dist/**
!package.json
!LICENSE
!README.md

@tommy-mitchell
Copy link
Collaborator

What version of np are you on? Since #682 (np v8.0.0), we just use npm itself to figure out what files are included.

What's the output if you run npm pack --dry-run?

@jerone
Copy link

jerone commented Mar 1, 2024

@tommy-mitchell commented on Feb 29, 2024, 11:40 PM GMT+1:

What version of np are you on? Since #682 (np v8.0.0), we just use npm itself to figure out what files are included.

The latest version 10.

What's the output if you run npm pack --dry-run?

Exactly the same result as seen above with npm publish --dry-run.

npm notice === Tarball Contents ===
npm notice 35.1kB LICENSE
npm notice 1.3kB  README.md
npm notice 767B   dist/main.js
npm notice 919B   dist/main.js.map
npm notice 611B   dist/module.js
npm notice 915B   dist/module.js.map
npm notice 1.7kB  package.json

np - 10.0.0
node - 21.6.1
npm - 10.5.0
git - 2.44.0.windows.1
OS - Windows 10

@jerone
Copy link

jerone commented Mar 1, 2024

Yarn gives the same result as npm.

I tried running np with yarn via np --preview --package-manager=yarn and I got the same missing results.

What I do find surprising is that the files in the dist/ folder are also not mentioned in the ? The following new files will not be part of your published package: section.

@jerone
Copy link

jerone commented Mar 11, 2024

Finally had time to do a real publish to NPM and confirmed that the dist/ files are included in the package, while the message didn't mention them.

Maybe I do not understand the message correctly. It says The following new files will be published for the first time:. Keyword new, but the mentioned new files are definitely not new.

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

No branches or pull requests

3 participants