feat(dev): simplify local dev workflow#1102
feat(dev): simplify local dev workflow#1102Salnika wants to merge 2 commits intovoidzero-dev:mainfrom
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
|
@Salnika Thanks, look good. I will take a try before merge. |
There was a problem hiding this comment.
Pull request overview
This PR streamlines the repo’s local CLI development workflow by introducing repo-local install/bootstrap scripts, building/using local CLI artifacts by default, and isolating snap tests from ~/.vite-plus state.
Changes:
- Added
pnpm install:dev/pnpm bootstrap:devflows to prepare upstream checkouts, install deps, and build the local CLI. - Switched tests and global snap tests to use repo-local artifacts (including a temp
VITE_PLUS_HOME) instead of~/.vite-plus. - Updated
just initand contributor docs to reflect the new local-dev-first workflow.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/setup-local-dev.mjs | New repo-local setup script that clones/syncs upstream checkouts and runs pnpm install. |
| pnpm-lock.yaml | Adds workspace link resolution for rolldown (lockfile update). |
| packages/tools/src/snap-test.ts | Uses a temp VITE_PLUS_HOME under the test temp dir for stability and isolation. |
| packages/tools/src/local-cli.ts | New tooling entrypoints for building and running repo-local CLI + local global snap tests. |
| packages/tools/src/index.ts | Registers new tool subcommands (build-local-cli, local-cli, snap-test-global-local). |
| packages/prompts/package.json | Adds rolldown as a devDependency (workspace). |
| packages/cli/package.json | Routes test and global snap tests through the repo-local tool entrypoints. |
| package.json | Adds install:dev, bootstrap:dev, build:cli, and updates test/bootstrap scripts to use local flow. |
| justfile | Updates just init to delegate to pnpm install:dev. |
| CONTRIBUTING.md | Documents the new local CLI workflow and updated initialization guidance. |
| CLAUDE.md | Updates build/snap-test guidance to emphasize repo-local artifacts. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ensureExpectedRemote(name, dir, config.repo); | ||
|
|
||
| if (isDirty(dir)) { | ||
| log(`Keeping existing dirty ${name} checkout at ${dir}`); | ||
| return; | ||
| } |
There was a problem hiding this comment.
ensureRolldownHostBindings() mutates rolldown/packages/rolldown/package.json, which makes the nested rolldown/ checkout permanently "dirty". That interacts poorly with syncCleanCheckout() below (it bails out early on dirty repos), so after the first run this script will stop updating rolldown/ to the pinned branch/hash. Consider avoiding modifying the upstream checkout (e.g., inject these optional deps via pnpm packageExtensions/patching) or adjust the dirty-check logic to ignore this known, script-managed change so pinned updates still apply.
| ); | ||
| } | ||
| process.exit(1); | ||
| } |
There was a problem hiding this comment.
ensureBuildWorkspaceReady() only checks for a local vite/ checkout, but runBuildLocalCli() also assumes rolldown/ exists (pnpm filters for rolldown, @rolldown/pluginutils, and materializeRolldownPackagedBindings() writes into rolldown/packages/rolldown/src). If rolldown/ is missing, this will fail later with less actionable errors. Add an explicit check for the rolldown/ checkout (and optionally the expected packages/rolldown paths) with the same actionable install hint.
| } | |
| } | |
| if (!existsSync(rolldownRepoDir)) { | |
| console.error(`Missing local rolldown checkout: ${rolldownRepoDir}`); | |
| console.error( | |
| `Run "${installHint}" to fetch the local upstream checkouts, or "${bootstrapHint}" to prepare and build the local CLI.`, | |
| ); | |
| process.exit(1); | |
| } |
| "fast-string-width": "^1.1.0", | ||
| "fast-wrap-ansi": "^0.1.3", | ||
| "is-unicode-supported": "^1.3.0", | ||
| "rolldown": "workspace:*", |
There was a problem hiding this comment.
Added rolldown as a devDependency here, but there are no references to rolldown anywhere under packages/prompts/src (and the build config doesn’t reference it either). If this isn’t needed for builds/tests, it’s extra dependency surface and forces a lockfile entry/update. Either remove it or add a short note (e.g., in a comment or PR description) explaining why prompts needs rolldown in devDependencies.
| "rolldown": "workspace:*", |
Summary
This PR simplifies local development of the CLI.
It adds a repo-local setup and bootstrap flow so a fresh clone can be prepared with:
It also keeps
bootstrap-clifor the global install flow.What changed
pnpm install:devto prepare local upstream checkouts and install dependenciespnpm bootstrap:devto prepare the repo and build the local CLI~/.vite-plusjust initand contributor docs to reflect the new workflowWhy
The local development workflow required extra manual setup before the CLI could be built and tested.
This PR makes the common development path more direct while keeping the existing global install flow available.