generated from JS-DevTools/template-node-typescript
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Rewrite internals for v2 release #83
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
Work in progress!
This PR is a large-scale rewrite of the module, primarily concerned with fixing all outstanding (known) bugs, and grabbing a few easy features:
ignore-scripts
when publishing #47It will also lay the groundwork for #81, which can be tackled in its own PR.
Details
The core of this PR is a ground-up rewrite of how this module interacts with npm.
Previously, this action would read and then overwrite npm's user config (aka
~/.npmrc
). This is a harmful thing to do! It interferes with configuration written byactions/setup-node
, and if you happen to use the CLI version of the package, it would overwrite your own settings. See #15 for more details.This PR changes the logic to write (and delete when we're done) an isolated
.npmrc
file in temporary storage, specific to this package. The action will no longer interfere with other tools, and other tools won't be able to interfere with this action.Since the npm interaction code was being rewritten, it was easy to layer in some additional changes:
<package_spec>
argument instead of changing the working directory--ignore-scripts
to the CLIOn top of how the module calls
npm
, this PR also takes a top-down TDD approach to all internal interfaces and functions. A lot of the other fixes and changes fell out of that work, including:publishConfig
check-version
andgreater-version-only
options with a singlestrategy
option that can be set toupgrade
(default) orany
strategy: upgrade -> check-version: true, greater-version-only: true
strategy: any -> check-version: true, greater-version-only: false
check-version: false
, because you shouldn't be using this action if you don't want to check against published versions; you can just usenpm