Repository navigation
feat(cli): add Vite+ addon support - #1070
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf3ea56b0e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdd Vite+ as a mutually-exclusive task runner addon and wire it through schemas, CLI/web selection, generators, templates, package scripts, README/docs, post-install messaging, and tests. ChangesVite+ Task Runner Addon Integration
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
apps/cli/test/input-schemas.test.ts (1)
22-28: ⚡ Quick winExpand test coverage for all task-runner conflicts.
The test validates that
nx+vite-plusare mutually exclusive, but based on theTASK_RUNNER_ADDONSconstant defined inadd-handler.ts(line 67), all three task runners (turborepo,nx,vite-plus) should be mutually exclusive.Consider adding test cases for the other conflict pairs:
turborepo+vite-plusnx+turborepo(which was previously tested but removed)📋 Suggested test cases to add
it("rejects conflicting task-runner addon combinations", () => { - const result = AddInputSchema.safeParse({ + const nxVitePlus = AddInputSchema.safeParse({ addons: ["nx", "vite-plus"], }); + expect(nxVitePlus.success).toBe(false); - expect(result.success).toBe(false); + const turboVitePlus = AddInputSchema.safeParse({ + addons: ["turborepo", "vite-plus"], + }); + expect(turboVitePlus.success).toBe(false); + + const nxTurbo = AddInputSchema.safeParse({ + addons: ["nx", "turborepo"], + }); + expect(nxTurbo.success).toBe(false); });apps/cli/src/helpers/core/add-handler.ts (1)
102-119: Make the “hook stack refresh” intent explicit (and cover biome/oxlint ordering)
getSetupAddonsis explicitly designed to refresh the whole hook/linter integration set: whenaddonsToAddcontains any addon fromHOOK_ADDONS(husky,lefthook) orHOOK_LINTER_ADDONS(biome,oxlint,vite-plus), it adds all of those that already exist inupdatedAddonsto the setup list—so addingbiometo a project withhuskywill re-run both setups (apps/cli/src/helpers/core/add-handler.tslines 102-119).There are tests for the ordering behavior with
vite-plusand existing hooks (apps/cli/test/addons.test.tsaround the two “should refresh … Git hook addons” cases), but there isn’t an equivalent test forbiome/oxlintordering—adding one (or a short comment explaining the policy) would reduce confusion.packages/template-generator/src/post-process/package-configs.ts (1)
188-193: ⚡ Quick winCentralize Vite+ version strings to avoid drift.
These override versions duplicate values maintained in
dependencyVersionMap; a single source (shared constant or map lookup) will prevent silent mismatch across generators.Suggested diff
+const VITE_PLUS_CORE_VERSION = "0.1.24"; +const VITE_PLUS_TEST_VERSION = "0.1.24"; ... if (hasVitePlus) { pkgJson.overrides = { ...pkgJson.overrides, - vite: "npm:`@voidzero-dev/vite-plus-core`@0.1.24", - vitest: "npm:`@voidzero-dev/vite-plus-test`@0.1.24", + vite: `npm:`@voidzero-dev/vite-plus-core`@${VITE_PLUS_CORE_VERSION}`, + vitest: `npm:`@voidzero-dev/vite-plus-test`@${VITE_PLUS_TEST_VERSION}`, }; }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0c96dbf6-c84b-4cb3-9557-bed26589abe2
📒 Files selected for processing (43)
apps/cli/README.mdapps/cli/src/constants.tsapps/cli/src/helpers/addons/addons-setup.tsapps/cli/src/helpers/addons/fumadocs-setup.tsapps/cli/src/helpers/core/add-handler.tsapps/cli/src/helpers/core/post-installation.tsapps/cli/src/prompts/addons.tsapps/cli/src/utils/compatibility-rules.tsapps/cli/test/addon-options.test.tsapps/cli/test/addons.test.tsapps/cli/test/external-commands.test.tsapps/cli/test/input-schemas.test.tsapps/cli/test/nx-generator.test.tsapps/cli/test/readme.test.tsapps/cli/test/vite-plus-generator.test.tsapps/web/content/docs/cli/options.mdxapps/web/content/docs/index.mdxapps/web/content/docs/project-structure.mdxapps/web/src/app/(home)/new/_components/utils.tsapps/web/src/lib/constant.tsapps/web/src/lib/sanitize-stack-addons.tsapps/web/src/lib/stack-utils.tsapps/web/test/stack-builder-compatibility.test.tspackages/template-generator/src/index.tspackages/template-generator/src/post-process/package-configs.tspackages/template-generator/src/processors/addons-deps.tspackages/template-generator/src/processors/index.tspackages/template-generator/src/processors/nx-generator.tspackages/template-generator/src/processors/readme-generator.tspackages/template-generator/src/processors/vite-plus-generator.tspackages/template-generator/src/template-handlers/addons.tspackages/template-generator/src/templates.generated.tspackages/template-generator/src/utils/add-deps.tspackages/template-generator/src/utils/generated-ignore-patterns.tspackages/template-generator/templates/addons/electrobun/apps/desktop/package.json.hbspackages/template-generator/templates/addons/lefthook/lefthook.yml.hbspackages/template-generator/templates/base/_gitignorepackages/template-generator/templates/frontend/react/react-router/vite.config.ts.hbspackages/template-generator/templates/frontend/react/tanstack-router/vite.config.ts.hbspackages/template-generator/templates/frontend/react/tanstack-start/vite.config.ts.hbspackages/template-generator/templates/frontend/solid/vite.config.ts.hbspackages/template-generator/templates/frontend/svelte/vite.config.ts.hbspackages/types/src/schemas.ts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/cli/test/input-schemas.test.ts (1)
23-33: 💤 Low valueConsider
it.each()for clearer test failure reporting.The loop approach is correct and deterministic. However, using Bun's
it.each()would make test failures easier to diagnose by showing exactly which addon pair caused the failure in the test output.♻️ Optional refactor using it.each()
- it("rejects conflicting task-runner addon combinations", () => { - const conflictingAddonPairs = [ - ["nx", "vite-plus"], - ["turborepo", "vite-plus"], - ["nx", "turborepo"], - ]; - - for (const addons of conflictingAddonPairs) { - const result = AddInputSchema.safeParse({ addons }); - - expect(result.success).toBe(false); - } - }); + it.each([ + ["nx", "vite-plus"], + ["turborepo", "vite-plus"], + ["nx", "turborepo"], + ])("rejects conflicting task-runner addons: %s + %s", (addon1, addon2) => { + const result = AddInputSchema.safeParse({ addons: [addon1, addon2] }); + + expect(result.success).toBe(false); + });
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 60d84f78-bd7e-48ac-9d3c-3bdec73debbe
📒 Files selected for processing (4)
apps/cli/src/helpers/core/add-handler.tsapps/cli/test/addons.test.tsapps/cli/test/input-schemas.test.tspackages/template-generator/src/post-process/package-configs.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- apps/cli/src/helpers/core/add-handler.ts
- packages/template-generator/src/post-process/package-configs.ts
- apps/cli/test/addons.test.ts
Summary
vite-plusimports, and workspace task-runner behavior.addflows for Vite+, Nx, and Turborepo config generation, including refreshing hook/linter integrations when addons are added later.Validation
bun test apps/web/test/stack-builder-compatibility.test.tsbun test apps/cli/test/input-schemas.test.ts apps/cli/test/addons.test.tscd apps/cli && bun run test- 612 pass, 9 skip, 0 failbun run checkbun run buildgit diff --checkNotes
This PR intentionally excludes the Vercel deployment changes. Vite+ is kept as a separate review path.
Summary by CodeRabbit
New Features
Documentation
Tests
Chores