Skip to content
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: allow version specification for deno #970

Merged
merged 6 commits into from
Oct 29, 2024

Conversation

sehnryr
Copy link
Contributor

@sehnryr sehnryr commented Oct 27, 2024

What does this PR do

Add config field for specifying deno version.

Standards checklist

  • The PR title is descriptive
  • I have read CONTRIBUTING.md
  • Optional: I have tested the code myself
  • If this PR introduces new user-facing messages they are translated

For new steps

  • Optional: Topgrade skips this step where needed
  • Optional: The --dry-run option works with this step
  • Optional: The --yes option works with this step if it is supported by
    the underlying command

If you developed a feature or a bug fix for someone else and you do not have the
means to test it, please tag this person here.

@SteveLauC
Copy link
Member

Add config field for specifying deno version.

What was the previous behavior?

@sehnryr
Copy link
Contributor Author

sehnryr commented Oct 28, 2024

Add config field for specifying deno version.

What was the previous behavior?

deno upgrades to "stable" channel by default and overwrites any other version.

@SteveLauC
Copy link
Member

and overwrites any other version.

Say I have all the 3 channels installed, deno upgrade will upgrade the "stable" channel to remove all the other installations? Or can I have 3 channels installed? (Rust allows you to do so, I am not sure about the case of Deno)

Stupid question, if I already have "1.45.0" installed, what will deno upgrade 1.45 do?

Copy link
Member

@SteveLauC SteveLauC left a comment

Choose a reason for hiding this comment

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

Just one tiny issue

config.example.toml Outdated Show resolved Hide resolved
@sehnryr
Copy link
Contributor Author

sehnryr commented Oct 28, 2024

Say I have all the 3 channels installed, deno upgrade will upgrade the "stable" channel to remove all the other installations? Or can I have 3 channels installed? (Rust allows you to do so, I am not sure about the case of Deno)

Stupid question, if I already have "1.45.0" installed, what will deno upgrade 1.45 do?

I don't think you can install multiple versions of Deno 🤔.

deno upgrade 1.45 won't work as it only recognize semver:

error: Invalid version passed (1.45)

Pass a semver, or a full 40 character git commit hash, or a release channel name.

Usage:
Latest
  deno upgrade

Specific version
  deno upgrade 1.45.0
  deno upgrade 1.46.0-rc.1
  deno upgrade 9bc2dd29ad6ba334fd57a20114e367d3c04763d4

Channel
  deno upgrade stable
  deno upgrade rc
  deno upgrade canary

And if we try upgrading to the same version, deno will recognize it and not replace it.

@sehnryr sehnryr marked this pull request as draft October 28, 2024 09:53
@sehnryr
Copy link
Contributor Author

sehnryr commented Oct 28, 2024

I just found out there's an issue with deno's v1 upgrade arguments as they don't match with v2:

  • v1: deno upgrade [--version <version>]/[--canary]
  • v2: deno upgrade [<version>]/[stable/rc/canary]

@sehnryr sehnryr marked this pull request as ready for review October 28, 2024 13:10
Copy link
Member

@SteveLauC SteveLauC left a comment

Choose a reason for hiding this comment

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

Just some trivial comments, the impl looks generally good

src/steps/node.rs Outdated Show resolved Hide resolved
src/steps/node.rs Outdated Show resolved Hide resolved
src/steps/node.rs Show resolved Hide resolved
Copy link
Member

@SteveLauC SteveLauC left a comment

Choose a reason for hiding this comment

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

Thanks!

@SteveLauC SteveLauC merged commit 444689c into topgrade-rs:main Oct 29, 2024
12 checks passed
@SteveLauC SteveLauC mentioned this pull request Oct 29, 2024
2 tasks
@sehnryr sehnryr deleted the deno-version-config branch November 3, 2024 16:09
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