-
Notifications
You must be signed in to change notification settings - Fork 3.1k
In bunx
, always get latest version when @latest is explicitly passed
#5346
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
Conversation
ctx.allocator, | ||
"{s}@{s}", | ||
.{ | ||
update_request.name, | ||
display_version, | ||
}, | ||
), | ||
// disable the manifest cache when a tag is specified | ||
// so that @latest is fetched from the registry |
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.
IMO you should still cache if it's @{specific-version}, just not for tagged releases
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.
dist_tag
refers to non-ascii npm tagged versions, like @1.0.0
would be cached but @latest
or @next
would not be cached
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.
Couldn't we fetch the version tag for @latest
and use that for cache? I'm not sure if we can do something similar in bun
:
# ~
; npm view create-t3-app dist-tags.latest --json
"7.20.2"
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.
this is basically like
package.json:
{"dependencies": {"create-t3-app": "latest"}}
Then, running:
bun update
--no-cache
says "ignore Cache-Control headers from npm when deciding whether to check for new versions of dependencies"
❌ @Jarred-Sumner 3 files with test failures on bun-darwin-aarch64:
|
❌ @Jarred-Sumner 1 files with test failures on linux-x64:
|
❌ @Jarred-Sumner 2 files with test failures on linux-x64-baseline:
|
❌ @Jarred-Sumner 4 files with test failures on bun-darwin-x64-baseline:
|
What does this PR do?
Previously,
bunx create-t3-app@latest
would use the/tmp/create-t3-app@latest...
folder and rely on the OS tmpdir cache removal mechanism to know when to re-download. That's not soon enough.This makes it so the following:
will always check versions from the registry, and possibly re-install it.
It does not change the scenario when you do
bunx create-t3-app
by itself. That will still be cached for 1-3 days.How did you verify your code works?
Manual. Would be nice to have a test for this.