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

build(package): use npmignore instead of files field #17

Merged
merged 2 commits into from
Oct 7, 2020

Conversation

nfantone
Copy link
Collaborator

@nfantone nfantone commented Oct 7, 2020

  • .npmignore rules are ignored by yarn if also defining a "files" fields in package.json. This made *.test.js files be included in the final package on publish or pack, while also generating inconsistent packages if using yarn vs. npm.
  • added "sideEffects": false to package.json.

@nfantone nfantone added the enhancement New feature or request label Oct 7, 2020
@nfantone nfantone requested a review from a team October 7, 2020 20:29
@nfantone nfantone self-assigned this Oct 7, 2020
@nfantone nfantone requested review from crash7, ivelazco and gaston-flores and removed request for a team October 7, 2020 20:29
@github-actions
Copy link

github-actions bot commented Oct 7, 2020

Code coverage

Filename Statements Branches Functions Lines
src/number-prop.js 100% 100% 100% 100%
src/cast-array.js 100% 100% 100% 100%
src/curry-n.js 100% 100% 100% 100%
src/utils/_arity.js 100% 100% 100% 100%
src/utils/_curry1.js 100% 100% 100% 100%
src/utils/is-placeholder.js 100% 100% 100% 100%
src/utils/copy-name.js 100% 100% 100% 100%
src/utils/_curry2.js 75% 53.85% 60% 75%
src/utils/_curry-n.js 100% 100% 100% 100%
src/curry.js 100% 100% 100% 100%
src/array-path.js 100% 100% 100% 100%
src/compact.js 100% 100% 100% 100%
src/is-nil-empty.js 100% 100% 100% 100%
src/array-prop.js 100% 100% 100% 100%
src/reject-nil.js 100% 100% 100% 100%
src/merge-into.js 100% 100% 100% 100%
src/sum-prop.js 100% 100% 100% 100%
src/round.js 100% 100% 100% 100%
src/utils/_math-constants.js 100% 100% 100% 100%
src/truncate.js 100% 100% 100% 100%
src/all-to-lower-upper.js 100% 100% 100% 100%
src/not-equals.js 100% 100% 100% 100%
src/interpolate.js 100% 100% 100% 100%
src/utils/escape-regex.js 100% 100% 100% 100%
src/apply-spec.js 100% 100% 100% 100%
src/merge-spec.js 100% 100% 100% 100%
src/is-one-of.js 100% 100% 100% 100%
src/compact-spec.js 100% 100% 100% 100%
src/coalesce.js 100% 100% 100% 100%
src/prop-of.js 100% 100% 100% 100%
src/join-from.js 100% 100% 100% 100%
src/lower-path-satisfies.js 100% 100% 100% 100%
src/utils/_curry3.js 38.1% 32.43% 16.67% 38.1%
src/lower-path.js 100% 100% 100% 100%
src/boolean-prop.js 100% 50% 100% 100%
src/lower-equals.js 100% 100% 100% 100%
src/lower-trim.js 100% 100% 100% 100%
src/capitalize-words.js 100% 100% 100% 100%
src/capitalize.js 100% 100% 100% 100%
src/spread-prop.js 100% 100% 100% 100%
src/rename-keys.js 100% 100% 100% 100%
src/throw-error.js 100% 100% 100% 100%
src/map-keys.js 100% 100% 100% 100%
src/always-new.js 100% 100% 100% 100%

"lint": "eslint index.js src/",
"prettier": "prettier --write src/ index.js",
"test": "jest --env=node --colors --bail --detectOpenHandles --errorOnDeprecated --noStackTrace src/",
"test.coverage": "run-s test --coverage --coverageDirectory .coverage",
"test.watch": "run-s test --watchAll",
"generate-docs": "jsdoc -c jsdoc.json"
"test.watch": "run-s test --watchAll"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actual changes here: just key sorting on package.json.

Copy link
Contributor

@crash7 crash7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember if semantic-release uses yarn or npm under the hood, but we should avoid packaging test files, so 👍

Thanks!

@@ -22,50 +22,68 @@
},
"license": "MIT",
"author": "Flybondi <dev@flybondi.com> (https://flybondi.com)",
"sideEffects": false,
Copy link
Contributor

@crash7 crash7 Oct 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gold plating? is this related with #16?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is. Harmless for now.

@nfantone
Copy link
Collaborator Author

nfantone commented Oct 7, 2020

@crash7 Regardless, test files are definitely being included in the tarball today.

❯ tree node_modules/@flybondi/ramda-land
node_modules/@flybondi/ramda-land
├── CHANGELOG.md
├── LICENSE
├── README.md
├── index.js
├── package.json
└── src
    ├── all-to-lower-upper.js
    ├── all-to-lower-upper.test.js
    ├── always-new.js
    ├── always-new.test.js
# ...

@nfantone nfantone changed the title chore(package): use npmignore instead of files field build(package): use npmignore instead of files field Oct 7, 2020
@nfantone nfantone merged commit 9f6d6ea into master Oct 7, 2020
@nfantone nfantone deleted the chore/remove-tests branch October 7, 2020 20:38
@flybondi-nelson
Copy link
Contributor

🎉 This PR is included in version 4.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Development

Successfully merging this pull request may close these issues.

3 participants