Obvious Fix: Added "files" property to only include index.js / index.d.js / properties.json in npm package #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My project uses a CI/CD security scanning tool for our node apps. This tool flagged the encryption keys in the
test/
folder of this library and would not allow us to publish the app. Our workaround was torm -rf node_modules/njwt/test
afternpm install
as part of our build step in the pipeline.The security scanner is naive to the context of the encryption keys in
test/
and cannot see that those files won't actually be used by the apps that import this library.However, since the
test/
files are not necessary to be included for consumers of this library, I believe the best solution is to only declare the files that are necessary. npm allows us to do this via thefiles
property ofpackage.json
: https://docs.npmjs.com/cli/v6/configuring-npm/package-json#filesThis PR updates the
files
property ofpackage.json
to only includeindex.js
,index.d.ts
, andproperties.json
.These other files from the library will always be included as part of the npm package, regardless of settings: