refactor: enforce Rust dead code and visibility lints - #2564
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
✅ Deploy Preview for viteplus-preview canceled.
|
Native binary sizes (
|
| Artifact | Format | Base | PR | Change |
|---|---|---|---|---|
vp (Linux x64) |
Binary | 10.74 MiB | 10.74 MiB | 0 B (0.00%) |
vp (Linux x64) |
gzip -9 | 4.64 MiB | 4.64 MiB | -22 B (-0.00%) |
| NAPI (Linux x64) | Binary | 32.21 MiB | 32.16 MiB | -56.00 KiB (-0.17%) |
| NAPI (Linux x64) | gzip -9 | 12.69 MiB | 12.67 MiB | -25.82 KiB (-0.20%) |
vp (macOS ARM64) |
Binary | 8.03 MiB | 8.03 MiB | 0 B (0.00%) |
vp (macOS ARM64) |
gzip -9 | 4.05 MiB | 4.05 MiB | +7 B (+0.00%) |
| NAPI (macOS ARM64) | Binary | 39.80 MiB | 39.76 MiB | -48.53 KiB (-0.12%) |
| NAPI (macOS ARM64) | gzip -9 | 16.99 MiB | 16.96 MiB | -27.39 KiB (-0.16%) |
vp (Windows x64) |
Binary | 8.64 MiB | 8.64 MiB | 0 B (0.00%) |
vp (Windows x64) |
gzip -9 | 3.77 MiB | 3.77 MiB | -68 B (-0.00%) |
| NAPI (Windows x64) | Binary | 27.05 MiB | 27.00 MiB | -48.00 KiB (-0.17%) |
| NAPI (Windows x64) | gzip -9 | 10.76 MiB | 10.73 MiB | -28.11 KiB (-0.26%) |
| Trampoline (Windows x64) | Binary | 14.00 KiB | 14.00 KiB | 0 B (0.00%) |
| Trampoline (Windows x64) | gzip -9 | 7.09 KiB | 7.09 KiB | 0 B (0.00%) |
| Installer (Windows x64) | Binary | 4.50 MiB | 4.50 MiB | 0 B (0.00%) |
| Installer (Windows x64) | gzip -9 | 2.11 MiB | 2.11 MiB | -1 B (-0.00%) |
Registry bridge build (
|
| Package | Version |
|---|---|
vite-plus |
0.0.0-commit.6eb1972f19ea9da149ba8796846cf5b8223ae3a0 |
@voidzero-dev/vite-plus-core |
0.0.0-commit.6eb1972f19ea9da149ba8796846cf5b8223ae3a0 |
Install the Vite+ CLI built from this commit, then migrate a project:
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/voidzero-dev/vite-plus/6eb1972f19ea9da149ba8796846cf5b8223ae3a0/packages/cli/install.sh | VP_PR_VERSION=2564 bash# Windows (PowerShell)
$env:VP_PR_VERSION="2564"; irm https://raw.githubusercontent.com/voidzero-dev/vite-plus/6eb1972f19ea9da149ba8796846cf5b8223ae3a0/packages/cli/install.ps1 | iexOr download the standalone Windows installer built from this commit:
| Architecture | Installer |
|---|---|
| x64 | vp-setup-x86_64-pc-windows-msvc.exe |
| Arm64 | vp-setup-aarch64-pc-windows-msvc.exe |
GitHub requires you to sign in and downloads each installer as a ZIP artifact. Extract vp-setup.exe, then run it against this preview build:
.\vp-setup.exe --version "0.0.0-commit.6eb1972f19ea9da149ba8796846cf5b8223ae3a0" --registry "https://registry-bridge.viteplus.dev/"After installing, upgrade the current project's vite-plus to this test build with:
vp migrateOr point your package manager at the bridge registry https://registry-bridge.viteplus.dev/:
| Package manager | Registry config |
|---|---|
| npm / pnpm / Bun | .npmrc: registry=https://registry-bridge.viteplus.dev/ |
| Yarn (v2+) | .yarnrc.yml: npmRegistryServer: "https://registry-bridge.viteplus.dev/" |
Then pin the build (vite aliases to vite-plus-core; pnpm can use a catalog, npm an overrides entry):
{
"devDependencies": {
"vite-plus": "0.0.0-commit.6eb1972f19ea9da149ba8796846cf5b8223ae3a0",
"vite": "npm:@voidzero-dev/vite-plus-core@0.0.0-commit.6eb1972f19ea9da149ba8796846cf5b8223ae3a0"
}
}
🐳 Docker preview imageBuilt from this PR's registry bridge build:
# remove any stale local copy from a previous run, then pull fresh
docker rmi ghcr.io/voidzero-dev/vite-plus:pr-2564 2>/dev/null; docker pull ghcr.io/voidzero-dev/vite-plus:pr-2564Quick check: docker run --rm ghcr.io/voidzero-dev/vite-plus:pr-2564 vp --versionSee docs/guide/docker.md for usage. |
Set
dead_codeandunreachable_pubtodenyfor the Rust workspace.Reduce internal visibility across the CLI, NAPI binding, runtime, migration, snapshot, installer, and trampoline crates. Remove unused APIs and public re-exports. Keep JavaScript NAPI entry points crate-local with narrow test expectations.
Exclude the pinned
rolldown/source tree from the workspace lint policy. Cargo still builds it as a path dependency. The release build still linksrolldown_bindinginto the same NAPI.nodefile. Read Cargo metadata from both workspace manifests so the toolchain build can still findoxc.Use Rolldown's dependency settings after the workspace split. This changes
inferfrom0.19.0to0.22.0. It also disables the default features. Rolldown usesinfer::get()only for in-memory asset MIME detection. The disabled features remove the unusedcfbdependency and reduce binary size. Version0.22.0also changes detection for some formats.Update CI and
cargo shearcommands for the workspace boundary. Add the Rust visibility rule toAGENTS.md.