Skip to content

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

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

Jarred-Sumner
Copy link
Collaborator

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:

bunx create-t3-app@latest

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.

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
Copy link

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

Copy link
Collaborator Author

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

Copy link
Contributor

@mroyme mroyme Sep 14, 2023

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"

Copy link
Collaborator Author

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"

@github-actions
Copy link
Contributor

@Jarred-Sumner 3 files with test failures on bun-darwin-aarch64:

  • test/js/bun/test/test-test.test.ts
  • test/js/node/watch/fs.watch.test.ts
  • test/js/third_party/socket.io/socket.io-close.test.ts

View test output

#f59f8487a7bfde88f59ae1532b3993547b0c3ef0

@github-actions
Copy link
Contributor

@Jarred-Sumner 1 files with test failures on linux-x64:

  • test/bundler/esbuild/splitting.test.ts

View test output

#f59f8487a7bfde88f59ae1532b3993547b0c3ef0

@github-actions
Copy link
Contributor

@Jarred-Sumner 2 files with test failures on linux-x64-baseline:

  • test/cli/install/bun-add.test.ts
  • test/cli/install/bun-install.test.ts

View test output

#f59f8487a7bfde88f59ae1532b3993547b0c3ef0

@Jarred-Sumner Jarred-Sumner merged commit 92e95c8 into main Sep 14, 2023
@Jarred-Sumner Jarred-Sumner deleted the jarred/bunx-tag branch September 14, 2023 07:48
@github-actions
Copy link
Contributor

@Jarred-Sumner 4 files with test failures on bun-darwin-x64-baseline:

  • test/js/bun/sqlite/sqlite.test.js
  • test/js/node/fs/fs.test.ts
  • test/js/third_party/webpack/webpack.test.ts
  • test/js/web/timers/setTimeout.test.js

View test output

#f59f8487a7bfde88f59ae1532b3993547b0c3ef0

0masn

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants