feat: support to install the latest version - #147
Conversation
As this is a new feature
Because GitHub actions approval button is missing
This reverts commit f5f2ca2. we can revert the yarn changes and do it in a different PR
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
technically i think that i can just mutate the 'default' alias instead. because now that i think about it, it makes 0 sense to set current to 'default' every time a new shell is opened. so current _is_ default.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Sorry @Dargon789, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
@Mergifyio update |
☑️ Nothing to do, the required conditions are not metDetails
|
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces the ability to install the very latest Node.js version directly, enhancing convenience for users. It also provides a new option for managing Node.js versions globally rather than per-shell session, offering greater flexibility. Significant updates to both Rust and JavaScript dependencies have been performed to maintain project health and leverage newer features. Additionally, the internal archive extraction process has been refined, and command-line documentation has been regenerated to reflect these and other minor changes, ensuring accuracy and clarity for users. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
@Mergifyio refresh |
✅ Pull request refreshed |
There was a problem hiding this comment.
Code Review
This pull request introduces a new --global flag to the fnm env command, allowing users to manage a single global Node.js version across all shell sessions, utilizing a new two-phase symlinking mechanism to prevent race conditions. It also refines the fnm ls-remote command by ensuring remote Node.js versions are sorted before filtering for the latest version. However, the review comments highlight several issues: the package.json and pnpm-lock.yaml files appear to be incorrectly rebased, leading to version downgrades, authorship changes, and removal of important metadata and dev dependencies. Additionally, the fnm install command has lost its --progress and --use flags, along with associated hook and corepack enablement logic, which are considered significant feature regressions. The UserVersion enum has also removed the SemverRange variant, breaking support for semver ranges, likely due to an unintended change in the semver crate usage. The docs/commands.md file reflects these changes, showing reordered and simplified command help outputs, possibly due to an updated clap version. The src/archive module has been refactored to remove Box<dyn Extract> indirection and conditionally compile tar for Unix and zip for Windows, with new extraction tests added for tar archives.
I am having trouble creating individual review comments. Click here to see my feedback.
package.json (3)
This change reverts package.json to an older state, downgrading the package version, changing authorship, and removing several important fields like description, bugs, and homepage. Many dev dependencies are also downgraded in this file and in pnpm-lock.yaml. This looks like a rebase error. Please rebase your branch on top of the latest main to fix this.
src/commands/install.rs (33-41)
This change removes the --progress and --use flags from the install command. Further down in the file, the logic for hooks and corepack enablement is also removed. These are significant feature regressions. This was likely caused by an incorrect rebase. Please restore these features by rebasing your branch on the latest main.
src/commands/ls_remote.rs (59-66)
There's a logic error here for the --latest flag. The list of versions (all_versions) is truncated before it is sorted. Since remote_node_index::list no longer returns a sorted list, all_versions.truncate(1) will keep a random version, not the latest one.
To fix this, you should sort the versions before processing the --latest flag. Also, since the sort is ascending, you'll want to get the last element for --latest.
all_versions.sort_by_key(|v| v.version.clone());
if self.latest {
if let Some(latest) = all_versions.pop() {
all_versions.clear();
all_versions.push(latest);
}
}
if let SortingMethod::Descending = self.sort {
all_versions.reverse();
}src/user_version.rs (8)
The SemverRange variant has been removed from UserVersion. This is a significant breaking change that removes support for specifying versions using semver ranges (e.g., ^14.0.0). This seems to be a side-effect of switching from the node-semver crate back to semver in version.rs. This was likely unintentional and caused by an incorrect rebase. Please restore this functionality.
* feat: support to install the latest version * chore: test & fmt & clippy * docs: update command docs * docs: update command docs * Create warm-rice-appear.md * Update change set to be a minor release As this is a new feature * chore: update workflow to install pnpm * Remove `feat:` from changeset Because GitHub actions approval button is missing * run pnpm like other tasks * Revert "run pnpm like other tasks" This reverts commit f5f2ca2. we can revert the yarn changes and do it in a different PR * revert the changes in .github/workflows * feat: add remote version sorting and filtering * use `UserVersion` for filtering * add additional lts filter * refactor: use `Vec::retain` instead of filtering and collecting * fix docstring for sort option * change docstring for filter argument * refactor vec filtering Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com> * refactor to use `sort_by_key` and `reverse` Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com> * add latest flag * make filter an option as well * move sort into command as it is presentational * fix getting latest version * refactors * update docs/commands.md * sort upon installation * fix clippy * don't mention rust structs in the cli docs * test more stuff in archiving * fnm env --global: considering if this is a good idea technically i think that i can just mutate the 'default' alias instead. because now that i think about it, it makes 0 sense to set current to 'default' every time a new shell is opened. so current _is_ default. * chore(deps): update rust crate embed-resource to v2.5.2 * fix(deps): update rust crate tar to v0.4.44 * fix(deps): update rust crate thiserror to v1.0.69 * chore(deps): update clap-rs * chore(deps): update rust crate chrono to v0.4.44 * chore(deps): update all dev dependencies --------- Co-authored-by: Fred <nzhlfred@gmail.com> Co-authored-by: Gal Schlezinger <gal@spitfire.co.il> Co-authored-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* feat: support to install the latest version * chore: test & fmt & clippy * docs: update command docs * docs: update command docs * Create warm-rice-appear.md * Update change set to be a minor release As this is a new feature * chore: update workflow to install pnpm * Remove `feat:` from changeset Because GitHub actions approval button is missing * run pnpm like other tasks * Revert "run pnpm like other tasks" This reverts commit f5f2ca2. we can revert the yarn changes and do it in a different PR * revert the changes in .github/workflows * feat: add remote version sorting and filtering * use `UserVersion` for filtering * add additional lts filter * refactor: use `Vec::retain` instead of filtering and collecting * fix docstring for sort option * change docstring for filter argument * refactor vec filtering Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com> * refactor to use `sort_by_key` and `reverse` Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com> * add latest flag * make filter an option as well * move sort into command as it is presentational * fix getting latest version * refactors * update docs/commands.md * sort upon installation * fix clippy * don't mention rust structs in the cli docs * test more stuff in archiving * fnm env --global: considering if this is a good idea technically i think that i can just mutate the 'default' alias instead. because now that i think about it, it makes 0 sense to set current to 'default' every time a new shell is opened. so current _is_ default. * chore(deps): update rust crate embed-resource to v2.5.2 * fix(deps): update rust crate tar to v0.4.44 * fix(deps): update rust crate thiserror to v1.0.69 * chore(deps): update clap-rs * chore(deps): update rust crate chrono to v0.4.44 * chore(deps): update all dev dependencies --------- Co-authored-by: Fred <nzhlfred@gmail.com> Co-authored-by: Gal Schlezinger <gal@spitfire.co.il> Co-authored-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
No description provided.