@tanstack/cli 0.48.4 → 0.48.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -187,6 +187,22 @@ export function cli({ name, appName, forcedMode, forcedAddOns = [], defaultTempl
187
187
  if (defaultMode) {
188
188
  cliOptions.template = defaultMode;
189
189
  }
190
+ // Default to Start unless --router-only is specified
191
+ // Skip this if forcedAddOns already includes 'start' (e.g., from cli-aliases)
192
+ if (!options.routerOnly && !forcedAddOns.includes('start')) {
193
+ if (Array.isArray(cliOptions.addOns)) {
194
+ if (!cliOptions.addOns.includes('start')) {
195
+ cliOptions.addOns = [...cliOptions.addOns, 'start'];
196
+ }
197
+ }
198
+ else if (cliOptions.addOns !== true) {
199
+ cliOptions.addOns = ['start'];
200
+ }
201
+ // Also set template to file-router for Start
202
+ if (!cliOptions.template) {
203
+ cliOptions.template = 'file-router';
204
+ }
205
+ }
190
206
  let finalOptions;
191
207
  if (cliOptions.interactive) {
192
208
  cliOptions.addOns = true;
@@ -300,6 +316,7 @@ export function cli({ name, appName, forcedMode, forcedAddOns = [], defaultTempl
300
316
  .option('--no-toolchain', 'skip toolchain selection');
301
317
  }
302
318
  cmd
319
+ .option('--router-only', 'create a Router-only SPA without TanStack Start (SSR)', false)
303
320
  .option('--interactive', 'interactive mode', false)
304
321
  .option('--tailwind', 'add Tailwind CSS')
305
322
  .option('--no-tailwind', 'skip Tailwind CSS')
@@ -320,9 +337,10 @@ export function cli({ name, appName, forcedMode, forcedAddOns = [], defaultTempl
320
337
  return cmd;
321
338
  }
322
339
  // === CREATE SUBCOMMAND ===
340
+ // By default creates a TanStack Start app. Use --router-only for SPA without Start.
323
341
  const createCommand = program
324
342
  .command('create')
325
- .description(`Create a new ${appName} application`);
343
+ .description(`Create a new TanStack Start application`);
326
344
  configureCreateCommand(createCommand);
327
345
  createCommand.action(handleCreate);
328
346
  // === MCP SUBCOMMAND ===
@@ -22,4 +22,5 @@ export interface CliOptions {
22
22
  install?: boolean;
23
23
  addOnConfig?: string;
24
24
  force?: boolean;
25
+ routerOnly?: boolean;
25
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/cli",
3
- "version": "0.48.4",
3
+ "version": "0.48.5",
4
4
  "description": "TanStack CLI",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/cli.ts CHANGED
@@ -289,6 +289,22 @@ export function cli({
289
289
  cliOptions.template = defaultMode as TemplateOptions
290
290
  }
291
291
 
292
+ // Default to Start unless --router-only is specified
293
+ // Skip this if forcedAddOns already includes 'start' (e.g., from cli-aliases)
294
+ if (!options.routerOnly && !forcedAddOns.includes('start')) {
295
+ if (Array.isArray(cliOptions.addOns)) {
296
+ if (!cliOptions.addOns.includes('start')) {
297
+ cliOptions.addOns = [...cliOptions.addOns, 'start']
298
+ }
299
+ } else if (cliOptions.addOns !== true) {
300
+ cliOptions.addOns = ['start']
301
+ }
302
+ // Also set template to file-router for Start
303
+ if (!cliOptions.template) {
304
+ cliOptions.template = 'file-router'
305
+ }
306
+ }
307
+
292
308
  let finalOptions: Options | undefined
293
309
  if (cliOptions.interactive) {
294
310
  cliOptions.addOns = true
@@ -470,6 +486,7 @@ export function cli({
470
486
  }
471
487
 
472
488
  cmd
489
+ .option('--router-only', 'create a Router-only SPA without TanStack Start (SSR)', false)
473
490
  .option('--interactive', 'interactive mode', false)
474
491
  .option('--tailwind', 'add Tailwind CSS')
475
492
  .option('--no-tailwind', 'skip Tailwind CSS')
@@ -509,9 +526,10 @@ export function cli({
509
526
  }
510
527
 
511
528
  // === CREATE SUBCOMMAND ===
529
+ // By default creates a TanStack Start app. Use --router-only for SPA without Start.
512
530
  const createCommand = program
513
531
  .command('create')
514
- .description(`Create a new ${appName} application`)
532
+ .description(`Create a new TanStack Start application`)
515
533
 
516
534
  configureCreateCommand(createCommand)
517
535
  createCommand.action(handleCreate)
package/src/types.ts CHANGED
@@ -24,4 +24,5 @@ export interface CliOptions {
24
24
  install?: boolean
25
25
  addOnConfig?: string
26
26
  force?: boolean
27
+ routerOnly?: boolean
27
28
  }