@tanstack/cta-cli 0.16.2 → 0.16.4

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
@@ -4,7 +4,7 @@ import { Command, InvalidArgumentError } from 'commander';
4
4
  import { intro, log } from '@clack/prompts';
5
5
  import chalk from 'chalk';
6
6
  import semver from 'semver';
7
- import { SUPPORTED_PACKAGE_MANAGERS, addToApp, compileAddOn, compileStarter, createApp, createSerializedOptions, getAllAddOns, getFrameworkById, getFrameworks, initAddOn, initStarter, } from '@tanstack/cta-engine';
7
+ import { SUPPORTED_PACKAGE_MANAGERS, addToApp, compileAddOn, compileStarter, createApp, createSerializedOptions, getAllAddOns, getFrameworkByName, getFrameworks, initAddOn, initStarter, } from '@tanstack/cta-engine';
8
8
  import { launchUI } from '@tanstack/cta-ui';
9
9
  import { runMCPServer } from './mcp.js';
10
10
  import { promptForAddOns, promptForCreateOptions } from './options.js';
@@ -177,11 +177,11 @@ Remove your node_modules directory and package lock file and re-install.`);
177
177
  }
178
178
  if (!defaultFramework) {
179
179
  program.option('--framework <type>', `project framework (${availableFrameworks.join(', ')})`, (value) => {
180
- if (!availableFrameworks.includes(value)) {
180
+ if (!availableFrameworks.some((f) => f.toLowerCase() === value.toLowerCase())) {
181
181
  throw new InvalidArgumentError(`Invalid framework: ${value}. Only the following are allowed: ${availableFrameworks.join(', ')}`);
182
182
  }
183
183
  return value;
184
- }, defaultFramework || 'react-cra');
184
+ }, defaultFramework || 'React');
185
185
  }
186
186
  program
187
187
  .option('--starter [url]', 'initialize this project from a starter URL', false)
@@ -217,7 +217,7 @@ Remove your node_modules directory and package lock file and re-install.`);
217
217
  .option('--ui', 'Add with the UI');
218
218
  program.action(async (projectName, options) => {
219
219
  if (options.listAddOns) {
220
- const addOns = await getAllAddOns(getFrameworkById(options.framework || defaultFramework || 'react-cra'), defaultMode ||
220
+ const addOns = await getAllAddOns(getFrameworkByName(options.framework || defaultFramework || 'React'), defaultMode ||
221
221
  convertTemplateToMode(options.template || defaultTemplate));
222
222
  for (const addOn of addOns.filter((a) => !forcedAddOns.includes(a.id))) {
223
223
  console.log(`${chalk.bold(addOn.id)}: ${addOn.description}`);
@@ -236,7 +236,7 @@ Remove your node_modules directory and package lock file and re-install.`);
236
236
  projectName,
237
237
  ...options,
238
238
  };
239
- cliOptions.framework = getFrameworkById(options.framework || defaultFramework || 'react-cra').id;
239
+ cliOptions.framework = getFrameworkByName(options.framework || defaultFramework || 'React').id;
240
240
  if (defaultMode) {
241
241
  cliOptions.template = defaultMode;
242
242
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/cta-cli",
3
- "version": "0.16.2",
3
+ "version": "0.16.4",
4
4
  "description": "Tanstack Application Builder CLI",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -30,8 +30,8 @@
30
30
  "express": "^4.21.2",
31
31
  "semver": "^7.7.2",
32
32
  "zod": "^3.24.2",
33
- "@tanstack/cta-engine": "0.16.1",
34
- "@tanstack/cta-ui": "0.16.1"
33
+ "@tanstack/cta-ui": "0.16.4",
34
+ "@tanstack/cta-engine": "0.16.4"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@tanstack/config": "^0.16.2",
package/src/cli.ts CHANGED
@@ -14,6 +14,7 @@ import {
14
14
  createSerializedOptions,
15
15
  getAllAddOns,
16
16
  getFrameworkById,
17
+ getFrameworkByName,
17
18
  getFrameworks,
18
19
  initAddOn,
19
20
  initStarter,
@@ -258,14 +259,18 @@ Remove your node_modules directory and package lock file and re-install.`,
258
259
  '--framework <type>',
259
260
  `project framework (${availableFrameworks.join(', ')})`,
260
261
  (value) => {
261
- if (!availableFrameworks.includes(value)) {
262
+ if (
263
+ !availableFrameworks.some(
264
+ (f) => f.toLowerCase() === value.toLowerCase(),
265
+ )
266
+ ) {
262
267
  throw new InvalidArgumentError(
263
268
  `Invalid framework: ${value}. Only the following are allowed: ${availableFrameworks.join(', ')}`,
264
269
  )
265
270
  }
266
271
  return value
267
272
  },
268
- defaultFramework || 'react-cra',
273
+ defaultFramework || 'React',
269
274
  )
270
275
  }
271
276
 
@@ -334,7 +339,7 @@ Remove your node_modules directory and package lock file and re-install.`,
334
339
  program.action(async (projectName: string, options: CliOptions) => {
335
340
  if (options.listAddOns) {
336
341
  const addOns = await getAllAddOns(
337
- getFrameworkById(options.framework || defaultFramework || 'react-cra')!,
342
+ getFrameworkByName(options.framework || defaultFramework || 'React')!,
338
343
  defaultMode ||
339
344
  convertTemplateToMode(options.template || defaultTemplate),
340
345
  )
@@ -354,8 +359,8 @@ Remove your node_modules directory and package lock file and re-install.`,
354
359
  ...options,
355
360
  } as CliOptions
356
361
 
357
- cliOptions.framework = getFrameworkById(
358
- options.framework || defaultFramework || 'react-cra',
362
+ cliOptions.framework = getFrameworkByName(
363
+ options.framework || defaultFramework || 'React',
359
364
  )!.id
360
365
 
361
366
  if (defaultMode) {