-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[DOCS] Wiki: Files & Ignores -> better hint how to exclude from files
#6042
Comments
(Thanks for npm and all y'all do ❤️) |
I know |
hey, I am new and would like to help can anyone guide how and what to do? |
I would like to volunteer making the suggested changes, but I am new so I don't know where to update the docs. can anyone point out what I need to do? |
Seems like they locked down edit access on the wiki at some point, so I'd guess it has to be made by a npm team member. Those docs are more dev note than end user doc. End user docs should probably be on docs.npmjs.com. |
Agreed, but would still be good to get the facts corrected for those of us using Google 👍 |
Can i work on this ? |
I was messing around with some tests in t.test('files', async t => {
const { joinedOutput, npm, logs } = await loadMockNpm(t, {
config: {
json: true,
...auth,
},
prefixDir: {
'package.json': JSON.stringify({ ...pkgJson, files: ['open/dove.js', 'bar.js'] }, null, 2),
'foo.js': "console.log('meow')",
'bar.js': "console.log('meow')",
open: {
'dove.js': "console.log('coo')",
'.npmignore': 'dove.js',
},
'.npmignore': 'bar.js',
},
})
const registry = new MockRegistry({
tap: t,
registry: npm.config.get('registry'),
authorization: token,
})
registry.nock.put(`/${pkg}`).reply(200, {})
await npm.exec('publish', [])
t.matchSnapshot(logs.notice)
t.equal(joinedOutput().includes('"path": "open/dove.js"'), true)
t.equal(joinedOutput().includes('"path": "bar.js"'), true)
t.matchSnapshot(joinedOutput(), 'new package json')
}) As people have mentioned here the wiki is out of date and not really maintained anymore. I think this section of the Closing for now feel free to add a PR to that page here: https://github.com/npm/cli/edit/latest/docs/lib/content/configuring-npm/package-json.md |
Is there an existing issue for this?
This is a CLI Docs Enhancement, not another kind of Docs Enhancement.
Description of Problem
https://github.com/npm/cli/wiki/Files-&-Ignores
"Files" states:
To the casual observer this may seem to imply that you should stop using
files
and instead use only.npmignore
, however as commented by @iarna in npm/npm#11669 (comment):So we can solve some of this by e.g. putting a
.npmignore
intosrc/
orlib/
ordist/
or wherever.Potential Solution
Change the text to:
Further, in the "Known issues" section, the first bullet could be changed from:
to:
Docs URL
https://github.com/npm/cli/wiki/Files-&-Ignores
The text was updated successfully, but these errors were encountered: