feat(create): add Rsbuild as a bundler option #505
MergedSyMind(GitHub profile, opens in a new tab)merged 9 commits into
main fromrefs/pull/505/headmerged by schiller-manuel(GitHub profile, opens in a new tab) - packages/cli/skills/create-app-scaffold/SKILL.md lines 90 to 111OutdatedResolvedby SyMind(GitHub profile, opens in a new tab)@@ -76,0 +91,21 @@91+92+Wrong:93+94+```bash95+npx @tanstack/cli create my-app \96+ --bundler rsbuild \97+ --template ecommerce \98+ --deployment cloudflare \99+ --add-ons clerk \100+ -y101+```102+103+Correct:104+105+```bash106+npx @tanstack/cli create my-app --bundler rsbuild --toolchain eslint -y107+```108+109+The initial Rsbuild surface supports standard/blank scaffolds, built-in demo110+pages, Tailwind, and ESLint/Biome. The CLI rejects templates, deployments, and111+catalog business/example add-ons before writing the target directory.packages/cli/src/options.ts lines 77 to 95Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -68,3 +70,13 @@6870 }6971 }707273+ options.bundler = await selectBundler(options.framework, cliOptions.bundler)74+75+ if (options.bundler === 'rsbuild') {76+ if (forcedAddOns.length > 0) {77+ throw new Error('Rsbuild does not currently support forced add-ons.')78+ }79+ if (forcedDeployment) {80+ throw new Error('Rsbuild does not currently support deployments.')81+ }82+ }
- packages/cli/src/command-line.ts line 326OutdatedResolvedby SyMind(GitHub profile, opens in a new tab)@@ -321,3 +322,5 @@321322 const warnings: Array<string> = []322323 const legacyTemplate = getLegacyTemplateValue(cliOptions.template)323324325+ if (cliOptions.bundler?.toLowerCase() === 'rsbuild') {326+ if (cliOptions.starter || cliOptions.template || cliOptions.templateId) {@@ -289,3 +303,14 @@289303290304 const addOns: Set<string> = new Set()291305306+ const bundler = resolveBundler(framework, config.bundler).id307+308+ if (bundler === 'rsbuild') {309+ for (const addOn of await selectAddOns(310+ framework,311+ config.mode!,312+ 'toolchain',313+ 'Which toolchain would you like to add?',314+ config.chosenAddOns,315+ false,316+ bundler,
- @@ -0,0 +1,10 @@1+import type { AddOn, BundlerDefinition, Framework, Options } from './types.js'2+3+export const VITE_BUNDLER: BundlerDefinition = {4+ id: 'vite',5+ name: 'Vite',6+ description: 'Build with Vite',7+}8+9+export function getBundlers(framework: Framework): Array<BundlerDefinition> {10+ return framework.bundlers?.length ? framework.bundlers : [VITE_BUNDLER]packages/create/src/frameworks/solid/toolchains/biome/assets/biome.json.ejs line 11OutdatedResolvedby SyMind(GitHub profile, opens in a new tab)@@ -8,4 +8,4 @@88 "files": {99 "ignoreUnknown": false,1010 "ignore": ["src/routeTree.gen.ts"],11- "include": ["src/*", ".vscode/*", "index.html", "vite.config.ts"]11+ "include": ["src/*", ".vscode/*", <% if (bundler === 'vite') { %>"index.html", <% } %>"<%= bundler %>.config.ts"]
- packages/create/src/frameworks/solid/toolchains/biome/assets/biome.json.ejs line 2OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -1,2 +1,2 @@11 {2- "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",2+ "$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
- @@ -68,3 +71,10 @@6871 }6972 }707374+ options.bundler = await selectBundler(options.framework, cliOptions.bundler)75+76+ if (options.bundler === 'rsbuild') {77+ if (forcedAddOns.length > 0) {78+ throw new Error('Rsbuild does not currently support forced add-ons.')79+ }80+ if (forcedDeployment) {
- @@ -70,3 +71,4 @@7071 | -------------------- | ------------------------------------------------------- |7172 | `--add-ons <ids>` | Comma-separated add-on IDs |7273 | `--framework <name>` | React or Solid |74+| `--bundler <name>` | Vite (default) or Rsbuild |
schiller-manuel(GitHub profile, opens in a new tab) approved these changes
Sign in to join this conversation.
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_commitssetting.Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.Use the checkboxes below for quick actions:
📝 Walkthrough
Walkthrough#
The CLI and create packages add first-class Vite and Rsbuild selection. The change adds bundler validation, bundler-aware add-ons, React and Solid Rsbuild templates, package generation, telemetry, documentation, and automated coverage.
Changes#
Bundler-aware project creation
packages/create/src/bundlers.ts,packages/create/src/types.ts,packages/create/src/frameworks/*,packages/cli/src/*--bundler, resolves canonical bundler IDs, validates Rsbuild restrictions, updates telemetry, and exposes bundler selection APIs.packages/create/src/add-ons.ts,packages/create/src/*create*.ts,packages/create/src/edge-*.ts,packages/create/src/worker.tspackages/create/src/frameworks/react/*,packages/create/src/frameworks/solid/*,packages/create/src/package-json.ts,packages/create/src/edge-package-json.tsREADME.md,docs/*,packages/cli/skills/*,packages/cli/tests*/*,.changeset/*Estimated code review effort: 4 (Complex) | ~60 minutes
Merge Risk: 🟡 Moderate · up to
5c775Interactive Rsbuild creation may silently omit requested templates or add-ons, resulting in a project that differs from the user’s selected configuration; the Biome schema version mismatch can also produce misleading editor validation. The PR should receive explicit owner approval or corrective follow-up before merging.
Sequence Diagram(s)#
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 5.77% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 52 functions across 40 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches
🧪 Generate unit tests (beta)
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