-
Notifications
You must be signed in to change notification settings - Fork 250
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
chore: use "files" instead of .npmignore #4405
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @regseb thanks for participating here.
I agree with all files, except maybe src
and src-generated
. I started including them when vscode started logging warnings for missing sources of sourcemaps (also in node_modules
). I'm pretty sure an issue was also raised, but I can't seem to find it.
What's your opinion on it?
I've added the It's a first step to replace |
Thanks! |
I noticed in the diff of v7.1.1 -> 7.2.0, which included this change, that there's actually a bunch of files newly included that don't need to be (even though the release line reads "ignore unused files"). Most notably test(/spec) files. Primarily I wanted to raise the above. But I also wanted to share my perspective on this matter. Personally, I tend to favor a whitelisted-style |
@ericcornelissen Thanks for the feedback. There's a problem in my pull request. The For
All
Here's the equivalent of your example with {
"files": [
"docs/",
"src/",
"CHANGELOG.md",
"index.cjs",
"index.d.cts",
"index.d.ts",
"index.js",
"package.json",
"LICENSE",
"README.md",
"SECURITY.md",
"testing.cjs",
"testing.d.cts",
"testing.d.ts",
"testing.js"
]
} |
Good to know the |
Use property
files
instead of.npmignore
file to publish only the files you need, lighten packages, and reduce the risk of publishing a useless file.List of files that will no longer be published with this PR:
api
, package reduced from 62.4ko to 34.2ko (54.8%)src-generated/
src/
.mocharc.cjs
, the file has been renamed from.mocharc.jsonc
to.mocharc.cjs
, but the name hasn't been changed in the.npmignore
. 051ec93CHANGELOG.md
, this file is no longer included by default since npm v7.12.0: Do not force include history, changelogs, noticecore
src/
.mocharc.cjs
CHANGELOG.md
cucumber-runner
src-generated/
src/
.editorconfig
.eslintignore
.mocharc.cjs
prettierrc
CHANGELOG.md
grunt-stryker
CHANGELOG.md
instrumenter
src/
.mocharc.cjs
CHANGELOG.md
jasmine-runner
src-generated/
src/
.mocharc.cjs
CHANGELOG.md
jest-runner
src-generated/
src/
.mocharc.cjs
CHANGELOG.md
karma-runner
src-generated/
src/
.mocharc.cjs
CHANGELOG.md
mocha-runner
src-generated/
src/
.mocharc.cjs
CHANGELOG.md
tap-runner
src-generated/
src/
.mocharc.cjs
CHANGELOG.md
typescript-checker
src-generated/
src/
.mocharc.cjs
CHANGELOG.md
util
src/
.mocharc.cjs
CHANGELOG.md
vitest-runner
src-generated/
src/
.mocharc.cjs
CHANGELOG.md