Conversation
✅ Deploy Preview for viteplus-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
27ed9cc to
259b9e6
Compare
resolves #1144 While comprehensive support for Nushell seems to be under development in #1305, that pull request has a large impact. Therefore, I have limited the scope of this change to env support to align with the existing issue. ```nushell # nushell # 1. Setup vp env setup source ~/.vite-plus/env.nu # or restart Nushell # 2. Set a specific version vp env use 20 # Using Node.js v20.20.2 (resolved from 20) $env.VP_NODE_VERSION # 20.20.2 # 3. Resolve from .node-version vp env use # Using Node.js v22.18.0 (resolved from .node-version) $env.VP_NODE_VERSION # 22.18.0 # 4. Completion (requires Fish) vp <Tab> # add Add packages to dependencies # build Build application # cache Manage the task cache # check Run format, lint, and type checks # ... (all subcommands shown) # 5. False detection regression (bash launched from Nushell) # NU_VERSION is inherited by child processes, but VP_SHELL_NU is not set, # so vp correctly uses POSIX eval mode inside bash. bash -c 'vp env use 20 && echo $VP_NODE_VERSION' ```
|
I think it support by #1312 |
|
This PR has broader scope than the one you mentioned, so I believe it'd be worth enough to keep this active. I'm just not having enough spare time to rebase over 😅 |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e2243ba7b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| #[cfg(windows)] | ||
| pub const ALL_SHELL_PROFILES: &[ShellProfile] = &[ | ||
| ShellProfile { | ||
| root: ShellProfileRoot::NushellConfig, | ||
| path: "nushell/config.nu", |
There was a problem hiding this comment.
Include POSIX profiles in Windows cleanup list
This Windows-specific ALL_SHELL_PROFILES list drops .bashrc/.bash_profile/.zsh*/fish paths, so vp implode will no longer clean those files on Windows. In this same commit, packages/cli/install.sh still supports MINGW/MSYS/CYGWIN as win32 and runs bash/zsh/fish profile configuration, which means Git Bash/MSYS installs can add source .../.vite-plus/env lines that now persist after uninstall. That leaves stale startup entries and a partially reverted uninstall for a supported install path.
Useful? React with 👍 / 👎.
|
|
||
| $autoloadFile = Join-Path $autoloadDir "vite-plus.nu" | ||
| $nuEnvRef= (Join-Path $InstallDir "env.nu") -replace [regex]::Escape($env:USERPROFILE), '~' | ||
| $content = "# Vite+ bin (https://viteplus.dev)`n" + ('source `'+ $nuEnvRef +'`') + "`n" |
There was a problem hiding this comment.
The Configure-Nushell function writes out the Nushell autoload file in the format "source ...". However, on the implode.rs side, it does not recognize the line as a Vite+ source line unless the path (.vite-plus/.../env.nu) is enclosed in double quotes.
Due to this inconsistency, I suspect that when running "vp implode" in a Windows environment, it fails to correctly detect and delete the written vite-plus.nu file, potentially leaving behind old Nushell settings. What do you think about this?
| println!(); | ||
| println!(" {}", "Then restart your terminal.".dimmed()); | ||
| } | ||
|
|
There was a problem hiding this comment.
Should we add Nushell guidance here as well?
| echo " - Zsh: ~/.zshrc" | ||
| echo " - Fish: source \"$INSTALL_DIR_REF/env.fish\" in ~/.config/fish/config.fish" | ||
| echo " Manual setup instructions:" | ||
| echo " - Bash/Zsh: add \"$INSTALL_DIR_REF_POSIX/env\" to your shell config (~/.bashrc, ~/.zshrc, etc.)" |
There was a problem hiding this comment.
Should be . "$INSTALL_DIR_REF_POSIX/env"
This PR adds more Nushell support to the Vite+ global CLI setup and environment commands.
It introduces:
vp env doctorIt also refactors shared shell/profile handling to keep setup, doctor, and cleanup behavior consistent across shells and platforms.