Skip to content

vite-plus: init at 0.1.18#500492

Closed
qweered wants to merge 1 commit into
NixOS:masterfrom
qweered:vite-plus-init
Closed

vite-plus: init at 0.1.18#500492
qweered wants to merge 1 commit into
NixOS:masterfrom
qweered:vite-plus-init

Conversation

@qweered

@qweered qweered commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Disclaimer: Co-authored by claude code

Adds vite-plus, the unified toolchain CLI (vp) for web development. It manages Node.js runtimes, package managers, and frontend tooling in one place.

Build workarounds

The upstream project has several build challenges that required workarounds:

  • Duplicate brush-parser crate: Cargo.lock has two brush-parser 0.3.0 entries (registry + git) with identical code. fetchCargoVendor cannot handle duplicate name+version pairs, so a patch deduplicates them
  • Unstable -Z bindeps: The vite-task git dependency uses artifact = "cdylib"/"bin" annotations requiring unstable cargo. Stripped in the vendor staging via depsExtraArgs.postBuild
  • Missing rolldown submodule: The workspace references ./rolldown/ which is synced externally. Removed from workspace members in postPatch. Every vp subcommand still works
  • Nightly Rust features: fspy uses #![feature(once_cell_try)]RUSTC_BOOTSTRAP=1. The fspy_preload_unix cdylib requires c_variadic (still unstable) → stub shared library provided
  • Version injection: Upstream CI replaces version = "0.0.0" at release time; replicated in postPatch

Limitations

  • fspy filesystem tracing (LD_PRELOAD interception) is non-functional due to the stub cdylib. All other vp commands work correctly
  • Commands that delegate to JS (e.g., vp create) require a local node_modules/vite-plus installation in the project, as this package only includes the Rust CLI binary

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@nixpkgs-ci nixpkgs-ci Bot added 8.has: package (new) This PR adds a new package 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Mar 16, 2026
@qweered qweered marked this pull request as ready for review March 16, 2026 21:01
@nixpkgs-ci nixpkgs-ci Bot added the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Mar 16, 2026
@qweered

This comment was marked as outdated.

@ryoppippi

Copy link
Copy Markdown
Member

does this include oxfmt and oxlint? it doesn't look include typescript cli implementation

@airone01

Copy link
Copy Markdown
Contributor

I get this when running

Error: Cannot find module '/nix/store/bg6pdyvyycavwabrk0mxn78959r83mi8-vite-plus-0.1.12/node_modules/vite-plus/dist/bin.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1421:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1059:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1064:22)
    at Module._load (node:internal/modules/cjs/loader:1227:37)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
    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: []
}

@ryoppippi

Copy link
Copy Markdown
Member

oh they stop including oxlint/oxfmt, so it's easier to make a nix pkg

@qweered qweered changed the title vite-plus: init at 0.1.12 vite-plus: init at 0.1.18 Apr 16, 2026
@qweered

qweered commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 500492
Commit: 1af3f381ec5456974338bc996e5b8714e1fab608 (subsequent changes)
Merge: 31495aef4fe35cab9b8b09f376e5d3338134199c

Logs: https://github.com/qweered/nixpkgs-review-gha/actions/runs/24905054819


x86_64-linux

✅ 1 package built:
  • vite-plus

aarch64-linux

✅ 1 package built:
  • vite-plus

aarch64-darwin (sandbox = false)

❌ 1 package failed to build:
  • vite-plus

Error logs: `aarch64-darwin`
vite-plus
   Compiling vite_error v0.0.0 (/nix/build/nix-11995-2507380074/source/crates/vite_error)
   Compiling oxc_str v0.123.0
   Compiling oxc_ast_macros v0.123.0
   Compiling fspy_shared_unix v0.0.0 (https://github.com/voidzero-dev/vite-task.git?rev=076cef486127e6cd1fefc58945f00dac316888ca#076cef48)
   Compiling rand v0.9.2
   Compiling directories v6.0.0
error: failed to run custom build command for `fspy v0.1.0 (https://github.com/voidzero-dev/vite-task.git?rev=076cef486127e6cd1fefc58945f00dac316888ca#076cef48)`

Caused by:
process didn't exit successfully: /nix/build/nix-11995-2507380074/source/target/release/build/fspy-5ec2a91c72104702/build-script-build (exit status: 1)
--- stdout
cargo:rerun-if-changed=build.rs

--- stderr
Error: Failed to fetch macOS binaries

Caused by:
0: Failed to get ok response from https://github.com/branchseer/oils-for-unix-build/releases/download/oils-for-unix-0.37.0/oils-for-unix-0.37.0-darwin-arm64.tar.gz
1: No such file or directory (os error 2)
warning: build failed, waiting for other jobs to finish...

@qweered

qweered commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

Cant fix darwin cause i dont have it

@iamanaws iamanaws left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

bump + darwin fix
tested on aarch64-darwin

Assisted-by: Cursor (GPT-5.5)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
version = "0.1.21";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
hash = "sha256-UrYaiilgj94PovTTnzSaTOUpEZCb8tn/Tgf2AjtK7z0=";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
cargoHash = "sha256-VYuP281uFYPvdMUHz6FpqDZtcTIXDhNqJ8aZRD5m0iM=";

Comment on lines 64 to 71

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
for f in $out/git/*/Cargo.toml $out/git/*/crates/*/Cargo.toml; do
if [ -f "$f" ]; then
sed -i \
-e 's/, artifact = "[^"]*"//g' \
-e 's/, target = "target"//g' \
-e 's|brush-parser = { git = "[^"]*", rev = "[^"]*" }|brush-parser = "0.3.0"|' \
"$f"
fi
done

Comment on lines 73 to 88

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

darwin fix

Suggested change
# fspy's preload libraries (fspy_preload_unix, fspy_preload_windows)
# use the nightly `c_variadic` feature and cannot be compiled with
# stable rustc. They are artifact deps that fspy embeds as bytes via
# include_bytes!(env!("CARGO_CDYLIB_FILE_...")). Remove them from
# fspy's dep list — we provide a stub cdylib instead (see preBuild).
# Also remove fspy_test_bin (dev-dep with artifact = "bin").
for f in $out/git/*/crates/fspy/Cargo.toml; do
if [ -f "$f" ]; then
sed -i \
-e '/fspy_preload_unix/d' \
-e '/fspy_preload_windows/d' \
-e '/fspy_test_bin/d' \
"$f"
fi
done
# fspy's macOS build script downloads helper binaries at build time.
# Avoid network access; fspy is already stubbed below for nixpkgs.
for f in $out/git/*/crates/fspy/build.rs; do
if [ -f "$f" ]; then
sed -i '/fn fetch_macos_binaries(out_dir: &Path) -> anyhow::Result<()> {/a\
if env::var("CARGO_CFG_TARGET_OS").unwrap() == "macos" {\
let stub = out_dir.join("nixpkgs-fspy-macos-stub");\
fs::write(&stub, b"#!/bin/sh\\nexit 127\\n")?;\
materialized_artifact_build::register("oils_for_unix", &stub);\
materialized_artifact_build::register("coreutils", &stub);\
return Ok(());\
}' "$f"
fi
done
'';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
homepage = "https://github.com/voidzero-dev/vite-plus";
changelog = "https://github.com/voidzero-dev/vite-plus/releases/tag/${finalAttrs.src.tag}";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
@@ -666,20 +666,6 @@

Comment on lines 24 to 25

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
@@ -7760,6 +7746,6 @@
source = "git+https://github.com/voidzero-dev/vite-task.git?rev=c63db22ff0258e4e45f03205104838ab795161ac#c63db22ff0258e4e45f03205104838ab795161ac"

Comment on lines 26 to 30

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
dependencies = [
- "brush-parser 0.3.0 (git+https://github.com/reubeno/brush?rev=dcb760933b10ee0433d7b740a5709b06f5c67c6b)",
+ "brush-parser 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"diff-struct",

@nixpkgs-ci nixpkgs-ci Bot removed the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label May 18, 2026
@luxaritas

Copy link
Copy Markdown

FYI voidzero-dev/vite-plus#976 was just merged to resolve the version injection handling

@nixos-discourse

Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/vite-in-a-flake-nix/76562/7

@qweered

qweered commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

I lost interest in frontend ecosystem so not going to work on this, feel free to pick up this pr, i'll review it

@qweered qweered closed this Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants