Skip to content

feat(dev): simplify local dev workflow#1102

Open
Salnika wants to merge 2 commits intovoidzero-dev:mainfrom
Salnika:fix/bootrap-cli
Open

feat(dev): simplify local dev workflow#1102
Salnika wants to merge 2 commits intovoidzero-dev:mainfrom
Salnika:fix/bootrap-cli

Conversation

@Salnika
Copy link
Contributor

@Salnika Salnika commented Mar 22, 2026

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:

pnpm install:dev
pnpm bootstrap:dev

It also keeps bootstrap-cli for the global install flow.

What changed

  • added pnpm install:dev to prepare local upstream checkouts and install dependencies
  • added pnpm bootstrap:dev to prepare the repo and build the local CLI
  • updated local CLI and test scripts to use repo-local artifacts
  • updated global snap test execution to use the repo-local binary instead of relying on ~/.vite-plus
  • updated just init and contributor docs to reflect the new workflow

Why

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.

@netlify
Copy link

netlify bot commented Mar 22, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 63da70a
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69c0699197d19f0008af2536

@fengmk2
Copy link
Member

fengmk2 commented Mar 23, 2026

@Salnika Thanks, look good. I will take a try before merge.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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:dev flows 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 init and 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.

Comment on lines +189 to +194
ensureExpectedRemote(name, dir, config.repo);

if (isDirty(dir)) {
log(`Keeping existing dirty ${name} checkout at ${dir}`);
return;
}
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
);
}
process.exit(1);
}
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
}
}
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);
}

Copilot uses AI. Check for mistakes.
"fast-string-width": "^1.1.0",
"fast-wrap-ansi": "^0.1.3",
"is-unicode-supported": "^1.3.0",
"rolldown": "workspace:*",
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
"rolldown": "workspace:*",

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants