Skip to content

Commit 5a1913b

Browse files
authored
Merge branch 'main' into registry
2 parents 04fa5de + ae58db4 commit 5a1913b

207 files changed

Lines changed: 9837 additions & 2470 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/build-upstream/action.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ runs:
2525
id: cache-key
2626
shell: bash
2727
run: |
28-
echo "key=napi-binding-v3-${INPUTS_TARGET}-${RELEASE_BUILD}-${DEBUG}-${VERSION}-${NPM_TAG}-${{ hashFiles('packages/tools/.upstream-versions.json', 'Cargo.lock', 'crates/**/*.rs', 'crates/*/Cargo.toml', 'packages/cli/binding/**/*.rs', 'packages/cli/binding/Cargo.toml', 'Cargo.toml', '.cargo/config.toml', 'packages/cli/package.json', 'packages/cli/build.ts', 'packages/cli/tsdown.config.ts') }}" >> $GITHUB_OUTPUT
28+
echo "key=napi-binding-v3-${INPUTS_TARGET}-${RELEASE_BUILD}-${DEBUG}-${VERSION}-${NPM_TAG}-${{ hashFiles('packages/tools/.upstream-versions.json', 'rust-toolchain.toml', 'Cargo.lock', 'crates/**/*.rs', 'crates/*/Cargo.toml', 'packages/cli/binding/**/*.rs', 'packages/cli/binding/Cargo.toml', 'Cargo.toml', '.cargo/config.toml', 'packages/cli/package.json', 'packages/cli/build.ts', 'packages/cli/tsdown.config.ts') }}" >> $GITHUB_OUTPUT
2929
env:
3030
INPUTS_TARGET: ${{ inputs.target }}
3131

@@ -81,11 +81,15 @@ runs:
8181
with:
8282
version: 0.15.2
8383

84+
# Rust nightly-2026-06-10 passes --fix-cortex-a53-843419 to the linker for
85+
# aarch64-linux targets, which zig cc rejects. The filter for this arg
86+
# (rust-cross/cargo-zigbuild#452) is merged but unreleased, so install from
87+
# the pinned git commit. TODO: revert to taiki-e/install-action once
88+
# cargo-zigbuild > 0.22.3 is released.
8489
- name: Install cargo-zigbuild (musl)
8590
if: steps.cache-restore.outputs.cache-hit != 'true' && contains(inputs.target, 'musl')
86-
uses: taiki-e/install-action@4bc351f7f2614e48088386e2a0ad917ca3a7e4ba # v2.81.5
87-
with:
88-
tool: cargo-zigbuild
91+
shell: bash
92+
run: cargo install --locked --git https://github.com/rust-cross/cargo-zigbuild --rev 7e791b4be71b9870e0abccedf7885486803cd923 cargo-zigbuild
8993

9094
# NAPI builds - only run on cache miss (slow, especially on Windows)
9195
# Must run before vite-plus TypeScript builds which depend on the bindings

.github/renovate.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": ["github>Boshen/renovate"],
4+
"description": "Skip lockfile artifact updates (npm and cargo): they fail in Renovate's clone because vite/ and rolldown/ are gitignored. The renovate-lockfiles workflow regenerates lockfiles on renovate/** pushes; gitIgnoredAuthors keeps Renovate managing branches with its commits.",
5+
"gitIgnoredAuthors": ["278573678+voidzero-guard[bot]@users.noreply.github.com"],
6+
"skipArtifactsUpdate": true,
47
"ignorePaths": [
58
"packages/cli/snap-tests/**",
69
"packages/cli/snap-tests-global/**",
@@ -11,7 +14,7 @@
1114
],
1215
"packageRules": [
1316
{
14-
"description": "Ignore upstream toolchain npm packages (vendored via sync-remote or bumped by the proactive catalog workflow); everything else stays enabled so security alerts get fixed. Lockfile refresh fails because vite/ and rolldown/ are gitignored, so Renovate raises these PRs with an artifact-update warning and the lockfile is regenerated manually.",
17+
"description": "Ignore upstream toolchain npm packages (vendored via sync-remote or bumped by the proactive catalog workflow); everything else stays enabled so security alerts get fixed.",
1518
"matchManagers": ["npm"],
1619
"matchPackageNames": [
1720
"rolldown",

.github/workflows/ci.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,14 @@ jobs:
9999
with:
100100
save-cache: ${{ github.ref_name == 'main' }}
101101
cache-key: test
102+
tools: just
102103
target-dir: ${{ runner.os == 'Windows' && format('{0}/target', env.DEV_DRIVE) || '' }}
103104

104105
- run: cargo check --all-targets --all-features
105106
env:
106107
RUSTFLAGS: '-D warnings --cfg tokio_unstable' # also update .cargo/config.toml
107108

108-
# Test all crates/* packages. New crates are automatically included.
109-
# Also test vite-plus-cli (lives outside crates/) to catch type sync issues.
110-
- run: cargo test $(for d in crates/*/; do echo -n "-p $(basename $d) "; done) -p vite-plus-cli
111-
env:
112-
RUST_MIN_STACK: 8388608
109+
- run: just test
113110

114111
test-musl:
115112
needs: detect-changes
@@ -133,7 +130,7 @@ jobs:
133130
steps:
134131
- name: Install Alpine dependencies
135132
shell: sh {0}
136-
run: apk add --no-cache bash curl git musl-dev gcc g++ python3 cmake make
133+
run: apk add --no-cache bash curl git just musl-dev gcc g++ python3 cmake make
137134

138135
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
139136
- uses: ./.github/actions/clone
@@ -148,12 +145,8 @@ jobs:
148145
- name: Install Rust toolchain
149146
run: rustup show
150147

151-
# Test all crates/* packages. New crates are automatically included.
152-
# Also test vite-plus-cli (lives outside crates/) to catch type sync issues.
153148
# Skip separate cargo check — cargo test already compiles everything.
154-
- run: cargo test $(for d in crates/*/; do echo -n "-p $(basename $d) "; done) -p vite-plus-cli
155-
env:
156-
RUST_MIN_STACK: 8388608
149+
- run: just test
157150

158151
lint:
159152
needs: detect-changes
@@ -168,19 +161,13 @@ jobs:
168161
with:
169162
save-cache: ${{ github.ref_name == 'main' }}
170163
cache-key: lint
171-
tools: cargo-shear
164+
tools: just,cargo-shear
172165
components: clippy rust-docs rustfmt
173166

174167
- run: |
175168
cargo shear
176169
cargo fmt --check
177-
# Allow new clippy lints from the toolchain that fire in upstream
178-
# rolldown crates without a `[lints]` table.
179-
cargo clippy --all-targets --all-features -- -D warnings \
180-
-A clippy::byte_char_slices \
181-
-A clippy::manual_assert_eq \
182-
-A clippy::needless_return_with_question_mark \
183-
-A clippy::useless_borrows_in_formatting
170+
just lint
184171
# RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --document-private-items
185172
186173
- uses: crate-ci/typos@37bb98842b0d8c4ffebdb75301a13db0267cef89 # v1.47.2

.github/workflows/e2e-test.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ jobs:
4545
download-previous-rolldown-binaries:
4646
needs: detect-changes
4747
runs-on: ubuntu-latest
48-
# Run if: not a PR, OR PR has 'test: e2e' label, OR PR is from deps/upstream-update branch, OR build.ts files changed
48+
# Run if: not a PR, OR PR has 'test: e2e' label, OR PR is from the deps/upstream-update or a renovate/** dependency branch, OR build.ts files changed
4949
if: >-
5050
github.event_name != 'pull_request' ||
5151
contains(github.event.pull_request.labels.*.name, 'test: e2e') ||
5252
github.head_ref == 'deps/upstream-update' ||
53+
startsWith(github.head_ref, 'renovate/') ||
5354
needs.detect-changes.outputs.related-files-changed == 'true'
5455
permissions:
5556
contents: read
@@ -244,9 +245,9 @@ jobs:
244245
node-version: 24
245246
directory: web
246247
command: |
247-
vp run type-check:tsgo
248+
vp run type-check
248249
vp run build
249-
vp run test navigation-utils.test.ts real-browser-flicker.test.tsx workflow-parallel-limit.test.tsx
250+
vp run test navigation-utils.test.ts real-browser-flicker.test.tsx workflow-onboarding-integration.test.tsx
250251
- name: viteplus-ws-repro
251252
node-version: 24
252253
command: |
@@ -326,8 +327,10 @@ jobs:
326327
node-version: 22
327328
command: |
328329
# scripts/bootstrap.mjs spawns `pnpm build` via tinyexec and needs
329-
# pnpm on PATH (not exposed by the vp install itself).
330-
vp i -g pnpm
330+
# pnpm on PATH (not exposed by the vp install itself). corepack
331+
# enable creates a pnpm launcher in the vp bin dir that resolves
332+
# the project's pinned packageManager version (pnpm@9.15.9).
333+
corepack enable
331334
node scripts/bootstrap.mjs
332335
# Report-only: oxlint 1.68.0 surfaces ts1038 ("A 'declare' modifier
333336
# cannot be used in an already ambient context.") on varlet's
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Renovate Lockfiles
2+
3+
# Renovate cannot refresh lockfiles itself: pnpm-workspace.yaml and Cargo.toml
4+
# reference the gitignored vite/ and rolldown/ checkouts (patched dependencies,
5+
# workspace importers, path crates), so artifact updates fail in Renovate's
6+
# clone. This workflow checks out the vendored repos at their pinned hashes and
7+
# regenerates the lockfiles on every Renovate branch push instead. Renovate
8+
# ignores the resulting commits via gitIgnoredAuthors in .github/renovate.json.
9+
10+
permissions: {}
11+
12+
on:
13+
push:
14+
branches:
15+
- renovate/**
16+
17+
# Queue instead of cancel: this workflow's own lockfile push retriggers it in
18+
# the same group, and cancel-in-progress would cancel the effective run at its
19+
# final step, leaving a misleading "cancelled" conclusion.
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: false
23+
24+
jobs:
25+
update-lockfiles:
26+
# Skip the retriggered run for this workflow's own lockfile commit.
27+
if: github.event.repository.fork == false && github.actor != 'voidzero-guard[bot]'
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read
31+
steps:
32+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
33+
with:
34+
persist-credentials: false
35+
36+
- uses: ./.github/actions/clone
37+
38+
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
39+
40+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
41+
with:
42+
node-version-file: .node-version
43+
44+
# Not oxc-project/setup-node: it runs `pnpm install --frozen-lockfile`,
45+
# which fails on Renovate branches because the lockfile is stale here.
46+
- name: Update pnpm lockfiles
47+
env:
48+
# Resolution does not need lifecycle scripts; keep dependency scripts
49+
# from running in a workflow that later pushes with a write token.
50+
npm_config_ignore_scripts: 'true'
51+
run: |
52+
pnpm install --lockfile-only --no-frozen-lockfile
53+
pnpm dedupe --check || pnpm dedupe
54+
pnpm -C docs install --lockfile-only --no-frozen-lockfile
55+
56+
# cargo metadata syncs Cargo.lock to the bumped manifests without
57+
# compiling or running build scripts. rustup auto-installs the pinned
58+
# toolchain from rust-toolchain.toml.
59+
- name: Update Cargo.lock
60+
run: cargo metadata --format-version=1 > /dev/null
61+
62+
- name: Detect lockfile changes
63+
id: diff
64+
run: |
65+
git diff --stat -- pnpm-lock.yaml docs/pnpm-lock.yaml Cargo.lock
66+
if git diff --quiet -- pnpm-lock.yaml docs/pnpm-lock.yaml Cargo.lock; then
67+
echo "changed=false" >> "$GITHUB_OUTPUT"
68+
else
69+
echo "changed=true" >> "$GITHUB_OUTPUT"
70+
fi
71+
72+
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
73+
if: steps.diff.outputs.changed == 'true'
74+
id: app-token
75+
with:
76+
client-id: ${{ secrets.APP_ID }}
77+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
78+
79+
- name: Commit and push lockfiles
80+
if: steps.diff.outputs.changed == 'true'
81+
env:
82+
APP_TOKEN: ${{ steps.app-token.outputs.token }}
83+
BRANCH: ${{ github.ref_name }}
84+
run: |
85+
# Identity must stay in sync with gitIgnoredAuthors in
86+
# .github/renovate.json so Renovate keeps managing the branch.
87+
git config user.name "voidzero-guard[bot]"
88+
git config user.email "278573678+voidzero-guard[bot]@users.noreply.github.com"
89+
git add pnpm-lock.yaml docs/pnpm-lock.yaml Cargo.lock
90+
git commit -m "chore: update lockfiles"
91+
git push "https://x-access-token:${APP_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "HEAD:refs/heads/${BRANCH}"

.github/workflows/test-vp-create.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ jobs:
4646
download-previous-rolldown-binaries:
4747
needs: detect-changes
4848
runs-on: namespace-profile-linux-x64-default
49-
# Run if: not a PR, OR PR has 'test: create-e2e' label, OR PR is from deps/upstream-update branch, OR create-related files changed
49+
# Run if: not a PR, OR PR has 'test: create-e2e' label, OR PR is from the deps/upstream-update or a renovate/** dependency branch, OR create-related files changed
5050
if: >-
5151
github.event_name != 'pull_request' ||
5252
contains(github.event.pull_request.labels.*.name, 'test: create-e2e') ||
5353
github.head_ref == 'deps/upstream-update' ||
54+
startsWith(github.head_ref, 'renovate/') ||
5455
needs.detect-changes.outputs.related-files-changed == 'true'
5556
permissions:
5657
contents: read

.github/workflows/upgrade-deps.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ jobs:
8282
- Upgrade script: `./.github/scripts/upgrade-deps.ts`
8383
- Sync-remote tool: `pnpm tool sync-remote` (source in
8484
`packages/tools/src/sync-remote-deps.ts`) — clones rolldown/vite into the
85-
working tree and merges their pnpm-workspace catalogs into the root
86-
`pnpm-workspace.yaml`.
85+
working tree, merges their pnpm-workspace catalogs into the root
86+
`pnpm-workspace.yaml`, and syncs the root `Cargo.toml` oxc crate
87+
versions to match `rolldown/Cargo.toml`.
8788
- Build-upstream action: `./.github/actions/build-upstream/action.yml`
8889
- Package manager: `pnpm`. Do NOT downgrade any dep — we want the latest.
8990
@@ -105,7 +106,15 @@ jobs:
105106
then re-run `pnpm tool sync-remote` until it exits 0. Finish with
106107
`pnpm install --no-frozen-lockfile`.
107108
2. Re-run the steps in `./.github/actions/build-upstream/action.yml`; fix any
108-
non-zero exits.
109+
non-zero exits. If the Rust build fails inside a vendored `rolldown`
110+
crate with an oxc API mismatch (e.g. `oxc_ast::template_element` taking
111+
a different number of arguments, or any `oxc_*` type/signature error),
112+
the root `Cargo.toml` oxc pins are out of sync with the bumped rolldown.
113+
`pnpm tool sync-remote` should already reconcile them; if any `oxc_*`
114+
entry in the root `Cargo.toml [workspace.dependencies]` still differs
115+
from `rolldown/Cargo.toml`, bump it to match (the oxc same-version
116+
family follows rolldown's umbrella `oxc` version), run `cargo update`,
117+
and rebuild.
109118
3. If the rolldown hash changed, follow `.claude/agents/cargo-workspace-merger.md`
110119
to resync the workspace.
111120
4. Compare tsdown CLI options with `vp pack` and sync new/removed options per
@@ -182,6 +191,12 @@ jobs:
182191
pnpm dedupe
183192
184193
- name: Format code
194+
# `pnpm fmt` runs `vp fmt`, which loads the freshly built NAPI binding. When
195+
# `build-upstream` fails (e.g. an upstream rolldown/oxc desync the in-workflow
196+
# fixup could not resolve) the binding is never produced and `vp fmt` aborts.
197+
# Keep going so the PR is still created with the broken state surfaced for review,
198+
# matching the `continue-on-error` on the build steps above.
199+
continue-on-error: true
185200
run: pnpm fmt
186201

187202
- name: Enhance PR description with Claude

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,45 @@ vp --version
6262

6363
This builds all packages, compiles the Rust `vp` binary, and installs the CLI to `~/.vite-plus`.
6464

65+
## Validate the local build against a real project
66+
67+
Unit and snap tests don't cover everything. Interactive flows in particular (prompts, pickers, scaffolding) are easiest to validate by running your work-in-progress CLI inside a real Vite+ project.
68+
69+
First, understand how `vp` picks which `vite-plus` to run: for JS-backed commands (such as `vp create`), the global `vp` binary resolves `vite-plus` from the project's `node_modules` first and only falls back to the global installation in `~/.vite-plus`. If your test project has `vite-plus` installed from npm, `pnpm bootstrap-cli` alone will not make it run your local code.
70+
71+
Build the local CLI package after each change:
72+
73+
```bash
74+
pnpm -F vite-plus build # TypeScript + native NAPI binding
75+
pnpm -F vite-plus build-ts # faster, when only TypeScript changed
76+
```
77+
78+
### `pnpm link` the local package
79+
80+
Link your checkout into the test project. The global `vp` then delegates to the project-local CLI, and re-entrant `vp` sub-commands (for example `vp create` running `vp install` and `vp fmt` after scaffolding) resolve back to the same linked checkout:
81+
82+
```bash
83+
cd /path/to/test-project
84+
pnpm link /path/to/vite-plus/packages/cli
85+
86+
vp create # now runs your local checkout
87+
```
88+
89+
Verify the link with `ls -l node_modules/vite-plus` (it should be a symlink into your checkout). Notes:
90+
91+
- pnpm records the link as a `vite-plus: link:...` override (in `pnpm-workspace.yaml` for workspace projects, otherwise under `pnpm.overrides` in `package.json`), so it survives later installs. Don't commit that override in the test project.
92+
- `pnpm link` may also add a `packageManager` field to the test project's `package.json`; revert it if unwanted.
93+
- Undo with `pnpm unlink vite-plus`, or remove the override and run `pnpm install`.
94+
95+
### Global CLI (Rust) changes
96+
97+
`pnpm link` only swaps the JS side; the `vp` binary on `PATH` (and the Rust-backed commands it handles directly, such as package-manager commands) is still whatever is installed in `~/.vite-plus`. For changes to the Rust global CLI (`crates/`), install it from source, and combine with `pnpm link` when the change spans both layers:
98+
99+
```bash
100+
pnpm bootstrap-cli
101+
vp --version
102+
```
103+
65104
## Workflow for build and test
66105

67106
You can run this command to build, test and check if there are any snapshot changes:

0 commit comments

Comments
 (0)