这是indexloc提供的服务,不要输入任何密码
Skip to content

feat: conditional update notifier message using package manager #10436

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 3 commits into from
May 5, 2025

Conversation

anthonyshew
Copy link
Contributor

@anthonyshew anthonyshew commented May 3, 2025

Description

Small bit of polish to make our update notifier be package manager aware. Defaults to npm.

Testing Instructions

Manually tested in a Bun repo.

▲ 👟 bun on main
  dt scan
╭───────────────────────────────────────────────────────────────────────────────────╮
│                                                                                   │
│                Update available v2.4.5-canary.5 ≫ v2.5.3-canary.1                 │
│    Changelog: https://github.com/vercel/turborepo/releases/tag/v2.5.3-canary.1    │
│                 Run "bunx @turbo/codemod@latest update" to update                 │
│                                                                                   │
│              Follow @turborepo for updates: https://x.com/turborepo               │
╰───────────────────────────────────────────────────────────────────────────────────╯
turbo 2.4.5-canary.5

...more logs...

@anthonyshew anthonyshew requested a review from a team as a code owner May 3, 2025 04:40
Copy link

vercel bot commented May 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2025 3:08pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2025 3:08pm
examples-gatsby-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2025 3:08pm
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2025 3:08pm
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2025 3:08pm
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2025 3:08pm
examples-svelte-web ❌ Failed (Inspect) May 5, 2025 3:08pm
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2025 3:08pm
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2025 3:08pm
turbo-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2025 3:08pm

@anthonyshew anthonyshew changed the title feat: make update notifier conditional on package manager feat: conditional update notifier message using package manager May 3, 2025
// TODO: make this package manager aware
let update_cmd = style("npx @turbo/codemod@latest update").cyan().bold();

let update_cmd = match package_manager {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking, but this will have to be undone down the road. Adding a package_manager.exec_command() would be preferred to avoid doing an explicit iteration over all supported package managers.

e.g.

fn exec_command(&self) -> &str {
    match self {
        PackageManager::Npm => "npx",
        PackageManager::Yarn | PackageManager::Berry => "yarn dlx",
        PackageManager::Pnpm | PackageManager::Pnpm6 | PackageManager::Pnpm9 => "pnpm dlx"
        PackageManager::Bun =>"bunx",
    }
}

@anthonyshew anthonyshew merged commit a227a75 into main May 5, 2025
53 of 56 checks passed
@anthonyshew anthonyshew deleted the shew/67082 branch May 5, 2025 15:43
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.

2 participants