Skip to content

feat(cli): add Vite+ addon support - #1070

Merged
AmanVarshney01 merged 12 commits into
mainfrom
aman/add-vite-plus-only
Jun 8, 2026
Merged

AmanVarshney01 merged 12 commits into
mainfrom
aman/add-vite-plus-only

Conversation

@AmanVarshney01

@AmanVarshney01 AmanVarshney01 commented Jun 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add Vite+ as a mutually exclusive task-runner addon across CLI schemas, prompts, docs, and the web stack builder.
  • Generate Vite+ root config, stack-aware ignore patterns, dependency overrides, root scripts, frontend vite-plus imports, and workspace task-runner behavior.
  • Support add flows for Vite+, Nx, and Turborepo config generation, including refreshing hook/linter integrations when addons are added later.
  • Preserve Bun workspace catalogs when package scripts are refreshed during addon installs.
  • Keep the web stack builder aligned with CLI task-runner rules: users can swap Turborepo/Nx/Vite+, and generated commands keep only one runner.
  • Wire Husky/Lefthook staged checks and optional Vite+ native hooks without replacing existing hook addon choices silently.

Validation

  • bun test apps/web/test/stack-builder-compatibility.test.ts
  • bun test apps/cli/test/input-schemas.test.ts apps/cli/test/addons.test.ts
  • cd apps/cli && bun run test - 612 pass, 9 skip, 0 fail
  • bun run check
  • bun run build
  • git diff --check

Notes

This PR intentionally excludes the Vercel deployment changes. Vite+ is kept as a separate review path.

Summary by CodeRabbit

  • New Features

    • Added Vite+ as a CLI addon (unified toolchain, workspace task running, linting/formatting, optional native Git hooks)
    • Vite+ selectable as an alternative task-runner alongside Turborepo and Nx
    • Added llmgateway as an AI chat provider option for Fumadocs
  • Documentation

    • Updated CLI docs, quick start, and project structure guides with Vite+ usage and examples
  • Tests

    • Expanded test coverage for Vite+, task-runner conflicts, and README/CLI output cases
  • Chores

    • Bumped several dependency versions (tooling, linters, and runtime deps)

@vercel

vercel Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
create-better-t-stack-web Ready Ready Preview, Comment Jun 8, 2026 3:56pm

Request Review

@AmanVarshney01
AmanVarshney01 marked this pull request as ready for review June 8, 2026 11:07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

@coderabbitai

coderabbitai Bot commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2d5a12a8-7b8c-4124-9605-e08225333b4c

📥 Commits

Reviewing files that changed from the base of the PR and between ce29475 and 5216132.

📒 Files selected for processing (3)
  • apps/web/src/app/(home)/new/_components/stack-builder/index.tsx
  • apps/web/src/lib/stack-utils.ts
  • apps/web/test/stack-builder-compatibility.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/web/src/lib/stack-utils.ts
  • apps/web/test/stack-builder-compatibility.test.ts

Walkthrough

Add 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.

Changes

Vite+ Task Runner Addon Integration

Layer / File(s) Summary
Type system and addon constants
packages/types/src/schemas.ts, apps/cli/src/constants.ts
AddonsSchema and AddonsList exclusivity updated to include vite-plus; CLI compatibility mapping gains vite-plus.
Task runner mutual exclusion & sanitization
apps/cli/src/utils/compatibility-rules.ts, apps/cli/src/prompts/addons.ts, apps/web/src/lib/sanitize-stack-addons.ts, apps/web/src/app/(home)/new/_components/use-stack-builder.ts, apps/web/src/lib/stack-utils.ts
Task-runner group now includes turborepo, nx, and vite-plus; selection, validation, and CLI --addons generation are updated and web UI sanitization removes previous runners when a new one is selected.
Fumadocs linter selection
apps/cli/src/helpers/addons/fumadocs-setup.ts
Added helpers to merge persisted/current addons and derive the effective Fumadocs --linter value; llmgateway added as an AI chat provider.
CLI addon setup & Husky lint-staged
apps/cli/src/helpers/addons/addons-setup.ts
setupAddons recognizes vite-plus; setupHusky accepts vite-plus linter and writes lint-staged mapping to vp check --fix.
Add handler orchestration
apps/cli/src/helpers/core/add-handler.ts
Refactored to validate combined addon sets, preload more VFS files, run Nx/Turbo/Vite+ processors, refresh Lefthook templates, rewrite Vite imports, and persist updated config.
Shared ignore patterns & generators
packages/template-generator/src/utils/generated-ignore-patterns.ts, packages/template-generator/src/processors/nx-generator.ts, packages/template-generator/src/processors/vite-plus-generator.ts
New utility computes stack-generated ignore patterns; Nx generator uses these for production namedInputs exclusions; Vite+ processor writes vite.config.ts with lint/fmt/staged blocks using derived ignores.
Package post-processing and deps
packages/template-generator/src/post-process/package-configs.ts, packages/template-generator/src/processors/addons-deps.ts, packages/template-generator/src/utils/add-deps.ts
Root and app package scripts updated for vp commands when vite-plus is enabled; overrides pin vite/vitest to vite-plus packages; vite-plus and rolldown added to devDeps; various dependency versions bumped.
Templates and generated outputs
packages/template-generator/src/template-handlers/addons.ts, packages/template-generator/src/templates.generated.ts, packages/template-generator/templates/*/vite.config.ts.hbs, packages/template-generator/templates/addons/lefthook/lefthook.yml.hbs, packages/template-generator/templates/base/_gitignore
Generator-handled addons skip includes vite-plus; frontend Vite config templates import from vite-plus conditionally; lefthook gains vp staged job; gitignore adds generated route file.
Post-install instructions & README
apps/cli/src/helpers/core/post-installation.ts, packages/template-generator/src/processors/readme-generator.ts, apps/cli/README.md, apps/web/content/docs/*
Post-install output adds optional native Vite+ hooks instructions and adjusts lint/check wording; README and docs include Vite+ descriptions, vite.config.ts example, and vp script examples.
Tests
apps/cli/test/*, apps/web/test/*
Extensive tests added/updated: schema conflict tests, Nx generation tests, Vite+ ignore pattern tests, README hook docs, external commands/linter selection, package/script wiring, addon compatibility matrix, and web UI sanitizer behavior.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 1.69% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(cli): add Vite+ addon support' clearly and concisely describes the primary feature being added—Vite+ as a new addon option for the CLI.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
apps/cli/test/input-schemas.test.ts (1)

22-28: ⚡ Quick win

Expand test coverage for all task-runner conflicts.

The test validates that nx + vite-plus are mutually exclusive, but based on the TASK_RUNNER_ADDONS constant defined in add-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-plus
  • nx + 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)

getSetupAddons is explicitly designed to refresh the whole hook/linter integration set: when addonsToAdd contains any addon from HOOK_ADDONS (husky, lefthook) or HOOK_LINTER_ADDONS (biome, oxlint, vite-plus), it adds all of those that already exist in updatedAddons to the setup list—so adding biome to a project with husky will re-run both setups (apps/cli/src/helpers/core/add-handler.ts lines 102-119).

There are tests for the ordering behavior with vite-plus and existing hooks (apps/cli/test/addons.test.ts around the two “should refresh … Git hook addons” cases), but there isn’t an equivalent test for biome/oxlint ordering—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 win

Centralize 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

📥 Commits

Reviewing files that changed from the base of the PR and between a954bf9 and cf3ea56.

📒 Files selected for processing (43)
  • apps/cli/README.md
  • apps/cli/src/constants.ts
  • apps/cli/src/helpers/addons/addons-setup.ts
  • apps/cli/src/helpers/addons/fumadocs-setup.ts
  • apps/cli/src/helpers/core/add-handler.ts
  • apps/cli/src/helpers/core/post-installation.ts
  • apps/cli/src/prompts/addons.ts
  • apps/cli/src/utils/compatibility-rules.ts
  • apps/cli/test/addon-options.test.ts
  • apps/cli/test/addons.test.ts
  • apps/cli/test/external-commands.test.ts
  • apps/cli/test/input-schemas.test.ts
  • apps/cli/test/nx-generator.test.ts
  • apps/cli/test/readme.test.ts
  • apps/cli/test/vite-plus-generator.test.ts
  • apps/web/content/docs/cli/options.mdx
  • apps/web/content/docs/index.mdx
  • apps/web/content/docs/project-structure.mdx
  • apps/web/src/app/(home)/new/_components/utils.ts
  • apps/web/src/lib/constant.ts
  • apps/web/src/lib/sanitize-stack-addons.ts
  • apps/web/src/lib/stack-utils.ts
  • apps/web/test/stack-builder-compatibility.test.ts
  • packages/template-generator/src/index.ts
  • packages/template-generator/src/post-process/package-configs.ts
  • packages/template-generator/src/processors/addons-deps.ts
  • packages/template-generator/src/processors/index.ts
  • packages/template-generator/src/processors/nx-generator.ts
  • packages/template-generator/src/processors/readme-generator.ts
  • packages/template-generator/src/processors/vite-plus-generator.ts
  • packages/template-generator/src/template-handlers/addons.ts
  • packages/template-generator/src/templates.generated.ts
  • packages/template-generator/src/utils/add-deps.ts
  • packages/template-generator/src/utils/generated-ignore-patterns.ts
  • packages/template-generator/templates/addons/electrobun/apps/desktop/package.json.hbs
  • packages/template-generator/templates/addons/lefthook/lefthook.yml.hbs
  • packages/template-generator/templates/base/_gitignore
  • packages/template-generator/templates/frontend/react/react-router/vite.config.ts.hbs
  • packages/template-generator/templates/frontend/react/tanstack-router/vite.config.ts.hbs
  • packages/template-generator/templates/frontend/react/tanstack-start/vite.config.ts.hbs
  • packages/template-generator/templates/frontend/solid/vite.config.ts.hbs
  • packages/template-generator/templates/frontend/svelte/vite.config.ts.hbs
  • packages/types/src/schemas.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
apps/cli/test/input-schemas.test.ts (1)

23-33: 💤 Low value

Consider 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

📥 Commits

Reviewing files that changed from the base of the PR and between cf3ea56 and c816a52.

📒 Files selected for processing (4)
  • apps/cli/src/helpers/core/add-handler.ts
  • apps/cli/test/addons.test.ts
  • apps/cli/test/input-schemas.test.ts
  • packages/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

@AmanVarshney01
AmanVarshney01 merged commit f910948 into main Jun 8, 2026
3 checks passed
@AmanVarshney01
AmanVarshney01 deleted the aman/add-vite-plus-only branch June 8, 2026 16:20

This branch was successfully deployed

1 active deployment
Preview — 5216132b Deployed Jun 8, 2026 by vercel[bot]
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.

1 participant