You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"The following new files will be published the first time" list of files does not take into account .npmignore's precedence over .gitignore when a file is excluded in the latter but not the former.
Description
I want a dist/ folder to be included in the package, but excluded from git.
So I have a .gitignore file that ignores dist; an .npmignore that doesn't; and a "files" parameter that explicitly wants to include it.
.gitignore
node_modules/
npm-debug.log
env
.DS_Store
dist
.npmignore
node_modules/
npm-debug.log
env
.DS_Store
package.json
{
..."files": [
"dist",
"index.js"
]
}
However, the dist folder and all its contents are excluded from the "following new files will be published the first time" list in the UI. Seems like neither removing .npmignore nor "files" changes this - only removing dist from .gitignore (which is undesirable) displays the correct list of files.
Based on the above setup, npm pack creates a tar that does include the dist folder, so it appears the file list in the UI is incorrect (or I'm missing something obvious)
Steps to reproduce
Create a dist/ folder with some contents
Create a .gitignore that ignores the dist folder
Create a .npmignore that does not ignore the dist folder
Add "dist" into the "files" attrib in package.json
Run npm pack to generate a tar, which should contain the dist folder
Run np - the new file list will not contain dist
Expected behavior
The UI displaying the list of files should include the contents of the dist folder, to match the tar generated by npm pack under these circumstances.
"The following new files will be published the first time" list of files does not take into account
.npmignore
's precedence over.gitignore
when a file is excluded in the latter but not the former.Description
I want a
dist/
folder to be included in the package, but excluded from git.So I have a
.gitignore
file that ignoresdist
; an.npmignore
that doesn't; and a"files"
parameter that explicitly wants to include it..gitignore
.npmignore
package.json
However, the
dist
folder and all its contents are excluded from the "following new files will be published the first time" list in the UI. Seems like neither removing.npmignore
nor"files"
changes this - only removingdist
from.gitignore
(which is undesirable) displays the correct list of files.Based on the above setup,
npm pack
creates a tar that does include thedist
folder, so it appears the file list in the UI is incorrect (or I'm missing something obvious)Steps to reproduce
dist/
folder with some contents.gitignore
that ignores thedist
folder.npmignore
that does not ignore thedist
folder"dist"
into the"files"
attrib inpackage.json
npm pack
to generate a tar, which should contain thedist
foldernp
- the new file list will not containdist
Expected behavior
The UI displaying the list of files should include the contents of the
dist
folder, to match the tar generated bynpm pack
under these circumstances.Environment
np - 7.5.0
Node.js - 14.18.1
npm - 6.4.15
Git - 2.31.1
OS - macOS 11.6
The text was updated successfully, but these errors were encountered: