MCPcopy Create free account
hub / github.com/TanStack/cli / validateLegacyCreateFlags

Function validateLegacyCreateFlags

packages/cli/src/command-line.ts:317–398  ·  view source on GitHub ↗
(cliOptions: CliOptions)

Source from the content-addressed store, hash-verified

315}
316
317export function validateLegacyCreateFlags(cliOptions: CliOptions): {
318 warnings: Array<string>
319 error?: string
320} {
321 const warnings: Array<string> = []
322 const legacyTemplate = getLegacyTemplateValue(cliOptions.template)
323
324 if (cliOptions.starter) {
325 warnings.push(
326 'The --starter flag is deprecated; prefer --template instead. Backward compatibility remains for now.',
327 )
328 }
329
330 if (cliOptions.starter && cliOptions.template && !legacyTemplate) {
331 warnings.push(
332 'Both --starter and --template were provided. --template takes precedence.',
333 )
334 }
335
336 if (cliOptions.routerOnly) {
337 warnings.push(
338 'The --router-only flag enables router-only compatibility mode. Start-dependent add-ons, deployment adapters, and templates are disabled; only the base template and optional toolchain are supported.',
339 )
340 }
341
342 if (cliOptions.routerOnly && cliOptions.addOns) {
343 warnings.push(
344 'Ignoring --add-ons in router-only compatibility mode.',
345 )
346 }
347
348 if (cliOptions.routerOnly && cliOptions.deployment) {
349 warnings.push(
350 'Ignoring --deployment in router-only compatibility mode.',
351 )
352 }
353
354 if (cliOptions.routerOnly && cliOptions.starter) {
355 warnings.push('Ignoring --starter/--template in router-only compatibility mode.')
356 }
357
358 if (cliOptions.routerOnly && cliOptions.templateId) {
359 warnings.push('Ignoring --template-id in router-only compatibility mode.')
360 }
361
362 if (cliOptions.tailwind === true) {
363 warnings.push(
364 'The --tailwind flag is deprecated and ignored. Tailwind is always enabled in TanStack Start scaffolds.',
365 )
366 }
367
368 if (cliOptions.tailwind === false) {
369 warnings.push(
370 'The --no-tailwind flag is deprecated and ignored. Tailwind opt-out is intentionally unsupported to keep add-on permutations maintainable; remove Tailwind after scaffolding if needed.',
371 )
372 }
373
374 if (!legacyTemplate) {

Callers 2

handleCreateFunction · 0.85

Calls 1

getLegacyTemplateValueFunction · 0.85

Tested by

no test coverage detected