voidzero-dev / voidzero-dev/vite-plus

Installation via mise-en-place

Đang mở
#943 10 bình luận 35 reaction 1 người được giao Được @fengmk2 nhận Xem trên GitHub
Ngôn ngữ chính
Rust
Star
5.8k
Fork
262
Merge trung bình
23 giờ 18 phút
Pull request đã merge (30 ngày)
139

Mô tả

### Description

I am using [mise](https://mise.jdx.dev/) to manage all my toolchain right now. Currently, [viteplus](https://mise.jdx.dev/registry.html#tools) does not show up in registry, nor is there an easy way to install without running an installation script.

### Suggested solution

It would be great if it’s possible to install the `vp` CLI via mise like `mise use -g vite-plus` or `mise use -g vp`.

The [recommended method](https://mise.jdx.dev/dev-tools/backends/aqua.html) would be to put it in the [aqua registry](https://github.com/aquaproj/aqua-registry). Alternatively, mise can also [install binaries from GitHub Releases](https://mise.jdx.dev/dev-tools/backends/http.html), however Vite+ doesn’t publish binaries via GitHub Releases yet (right now binaries seems to be published on npm, however, I would not recommend using [npm backend](https://mise.jdx.dev/dev-tools/backends/npm.html) because it depends on Node.js, which `vp` intends to manage).

### Alternative

### Additional context

I tried using the [http backend](https://mise.jdx.dev/dev-tools/backends/http.html) to install `vp` CLI directly from npm registry without going through npm CLI.

```toml
# ~/.config/mise/config.toml
[tools]
"http:vite-plus" = {
version = "0.1.11",
platforms = {
macos-arm64 = { url = "https://registry.npmjs.org/@voidzero-dev/vite-plus-cli-darwin-arm64/-/vite-plus-cli-darwin-arm64-{{version}}.tgz" },
macos-x64 = { url = "https://registry.npmjs.org/@voidzero-dev/vite-plus-cli-darwin-x64/-/vite-plus-cli-darwin-x64-{{version}}.tgz" },
linux-x64 = { url = "https://registry.npmjs.org/@voidzero-dev/vite-plus-cli-linux-x64-gnu/-/vite-plus-cli-linux-x64-gnu-{{version}}.tgz" },
linux-arm64 = { url = "https://registry.npmjs.org/@voidzero-dev/vite-plus-cli-linux-arm64-gnu/-/vite-plus-cli-linux-arm64-gnu-{{version}}.tgz" },
windows-x64 = { url = "https://registry.npmjs.org/@voidzero-dev/vite-plus-cli-win32-x64-msvc/-/vite-plus-cli-win32-x64-msvc-{{version}}.tgz" },
windows-arm64 = { url = "https://registry.npmjs.org/@voidzero-dev/vite-plus-cli-win32-arm64-msvc/-/vite-plus-cli-win32-arm64-msvc-{{version}}.tgz" }
}
}
```

This is based on [the description on the docs](https://viteplus.dev/guide/):

> Vite+ ships in two parts: `vp`, the global command-line tool, and `vite-plus`, the local package installed in each project.

```sh-session
$ mise install
http:vite-plus@0.1.11 generate checksum vite-plus-cli-darwin-arm64-0.1.11.tgz
✅ Installed successfully. Confirmed vp binary is installed on both Mac and Linux.

$ vp help
VITE+ - The Unified Toolchain for the Web
✅ `vp help` works

$ vp create
node:internal/modules/cjs/loader:1459
throw err;
^

Error: Cannot find module '/Users/dtinth/.local/share/mise/http-tarballs/node_modules/vite-plus/dist/bin.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1456:15)
at defaultResolveImpl (node:internal/modules/cjs/loader:1066:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1071:22)
at Module._load (node:internal/modules/cjs/loader:1242:25)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
at node:internal/main/run_main_module:33:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Node.js v24.14.0
❌ `vp create` installs Node v24.14.0 correctly, but then crashes

$ mise uninstall http:vite-plus
🧹 Uninstall the `vp` CLI managed by mise (manually remove the config afterwards after running)
```

It seems like the `vp` CLI also kinda [depends on the `vite-plus` npm package **being installed globally**](https://github.com/voidzero-dev/vite-plus/blob/3782ae1951e7fd7d98827d688905e2c4cb670961/crates/vite_global_cli/src/js_executor.rs#L200-L204) which prevented this setup from working.

### Validations

- [x] Read the [Contributing Guidelines](https://github.com/voidzero-dev/vite-plus/blob/main/CONTRIBUTING.md).
- [x] Confirm this request is for Vite+ itself and not for Vite, Vitest, tsdown, Rolldown, or Oxc.
- [x] Check that there isn't already an issue requesting the same feature.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.