-
Notifications
You must be signed in to change notification settings - Fork 169
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
feat: download the latest version instead of a pinned one #134
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
88f6807
feat: download the latest version instead of a pinned one
aduh95 6c9e041
add `COREPACK_NO_LOOKUP` env flag
aduh95 0668fb0
Use KGR to cache the version
aduh95 c33fa1d
don't hardcode the registry
aduh95 12a91f9
Merge branch 'main'
aduh95 4ce5e2c
`COREPACK_NO_LOOKUP` -> `COREPACK_DEFAULT_TO_LATEST`
aduh95 9563bcd
Merge branch 'main' into dynamic-default-version
aduh95 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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.
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.
We should probably find a better name for this env variable, I don't think one could infer what it's doing from the name only. Does anyone has suggestions?
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.
I'm trying to understand the difference between
COREPACK_ENABLE_NETWORK=0
andCOREPACK_NO_LOOKUP=1
? In theory I would expect no network to behave the same since corepack ships with Known Good Versions but I must be overlooking a use case here.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.
When
COREPACK_NO_LOOKUP
is set, Corepack will use the version defined inconfig.json
instead of asking the npm registry for the most up-to-date version.COREPACK_ENABLE_NETWORK
can disable all access to the network, both for finding what's the most up-to-date version number and to download the tarball.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.
Is
config.json
available to configure by the user of corepack or is it just internals?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.
It's only internals, bundled in the corepack executable.
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.
How about COREPACK_IGNORE_LATEST?
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.
I went with
COREPACK_DEFAULT_TO_LATEST
which is true by default, and is set to0
to use the value inconfig.json
instead.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.
Not sure about using “default” as a verb here.
How about COREPACK_ENABLE_FETCH_LATEST=0
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.
I'd like the naming to make clear that it's only relevant if there's no local clue on what version to use.
ENABLE_FETCH_LATEST
could mean that the latest is always downloaded, or at least that's how I read it.I'm not a native english speaker, so genuine question: is it incorrect or something to use "default" as a verb?
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.
It’s not incorrect, just that “default” can be a verb or a noun. It’s probably fine 👍