feat(publish): add new option --remove-package-fields
before publish
#359
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.
Description
adding a new option
--remove-package-fields
which will remove any fields we wish to be removed from eachpackage.json
of every packages just before publishing them the registryremoving complex object(s) is also supported via the dot notation
would remove
{ script: { - "build": "tsc --project tsconfig.json", "build:dev": "tsc --incremental --watch" } }
Motivation and Context
I have certain fields that I would like to be removed from the final packages in the npm registry, fields like
devDependencies
andscripts
have no use for user of these npm packages. This new option will help a lot in cleaning fields that have no use for the external users (iescripts
will never be used outside of the project so there's no reason to keep it in the published package)How Has This Been Tested?
new unit tests
Types of changes
Checklist: