@tanstack/create 0.63.8 → 0.64.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @tanstack/create
2
2
 
3
+ ## 0.64.0
4
+
5
+ ### Minor Changes
6
+
7
+ - feat(cli): auto-install TanStack Intent during scaffolding ([#442](https://github.com/TanStack/cli/pull/442))
8
+
9
+ `tanstack create` and `tanstack add` now run `npx @tanstack/intent install`
10
+ after dependency installation, wiring up skill mappings for coding agents.
11
+ The behavior is controlled by a new `--intent` / `--no-intent` flag (default
12
+ on) and persists to `.cta.json` so subsequent `add` invocations honor the
13
+ original choice. Failures are surfaced as warnings instead of aborting the
14
+ scaffold.
15
+
16
+ ## 0.63.9
17
+
18
+ ### Patch Changes
19
+
20
+ - fix(create): correct netlify.toml key, eslint scripts, and missing eslint dep ([`e38729f`](https://github.com/TanStack/cli/commit/e38729fe0b6a16e8d34417d2334baf2b2db94942))
21
+
22
+ - The generated `netlify.toml` for both React and Solid used `dir` under
23
+ `[build]`, which is not a valid Netlify configuration key. Per Netlify's
24
+ TanStack Start guide it must be `publish`. Closes #423.
25
+ - The eslint toolchain had `format` and `check` scripts swapped: `format`
26
+ ran prettier in read-only mode while `check` mutated files. Swap them so
27
+ `format` writes (`prettier --write . && eslint --fix`) and `check` is
28
+ read-only (`prettier --check .`). Closes #403.
29
+ - `@tanstack/eslint-config` lists `eslint` as a peer dependency, so eslint
30
+ was not installed by package managers that don't auto-install peers. Add
31
+ `eslint` to `devDependencies` in the eslint toolchain. Closes #417.
32
+
3
33
  ## 0.63.8
4
34
 
5
35
  ### Patch Changes
@@ -11,6 +11,7 @@ import { isBase64, recursivelyGatherFilesFromEnvironment, } from './file-helpers
11
11
  import { mergePackageJSON } from './package-json.js';
12
12
  import { runSpecialSteps } from './special-steps/index.js';
13
13
  import { loadStarter } from './custom-add-ons/starter.js';
14
+ import { setupIntent } from './integrations/intent.js';
14
15
  export async function hasPendingGitChanges(environment, cwd) {
15
16
  const { stdout } = await environment.execute('git', ['status', '--porcelain'], cwd);
16
17
  return stdout.length > 0;
@@ -29,6 +30,7 @@ async function createOptions(json, addOns, targetDir) {
29
30
  ]),
30
31
  targetDir,
31
32
  starter,
33
+ intent: json.intent ?? false,
32
34
  };
33
35
  }
34
36
  async function runCreateApp(options) {
@@ -203,6 +205,9 @@ export async function addToApp(environment, addOns, cwd, options) {
203
205
  }
204
206
  // Handle new commands
205
207
  await runNewCommands(environment, persistedOptions, cwd, output);
208
+ const intent = options?.intent ?? persistedOptions.intent ?? true;
209
+ newOptions.intent = intent;
210
+ await setupIntent(environment, cwd, newOptions);
206
211
  environment.startStep({
207
212
  id: 'write-config-file',
208
213
  type: 'file',
@@ -8,6 +8,7 @@ import { resolvePackageJSONLatest } from './npm-resolver.js';
8
8
  import { createTemplateFile } from './template-file.js';
9
9
  import { installShadcnComponents } from './integrations/shadcn.js';
10
10
  import { setupGit } from './integrations/git.js';
11
+ import { setupIntent } from './integrations/intent.js';
11
12
  import { runSpecialSteps } from './special-steps/index.js';
12
13
  function isDemoFilePath(path) {
13
14
  if (!path)
@@ -214,6 +215,7 @@ async function runCommandsAndInstallDependencies(environment, options) {
214
215
  s.stop(`${options.starter.name} commands complete`);
215
216
  }
216
217
  await installShadcnComponents(environment, options.targetDir, options);
218
+ await setupIntent(environment, options.targetDir, options);
217
219
  }
218
220
  async function seedEnvValues(environment, options) {
219
221
  const envVarValues = options.envVarValues || {};
@@ -60,6 +60,7 @@ export async function createAppOptionsFromPersisted(json) {
60
60
  starter: json.starter ? await loadStarter(json.starter) : undefined,
61
61
  chosenAddOns,
62
62
  addOnOptions: populateAddOnOptionsDefaults(chosenAddOns),
63
+ intent: json.intent ?? false,
63
64
  };
64
65
  }
65
66
  export function createSerializedOptionsFromPersisted(json) {
@@ -78,6 +79,7 @@ export function createSerializedOptionsFromPersisted(json) {
78
79
  framework: json.framework,
79
80
  starter: json.starter,
80
81
  addOnOptions: {},
82
+ intent: json.intent ?? false,
81
83
  };
82
84
  }
83
85
  export async function runCreateApp(options) {
@@ -1,6 +1,6 @@
1
1
  [build]
2
2
  command = "vite build"
3
- dir = "dist/client"
3
+ publish = "dist/client"
4
4
  [dev]
5
5
  command = "npm run dev"
6
6
  targetPort = 3000
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "scripts": {
3
3
  "lint": "eslint",
4
- "format": "prettier --check .",
5
- "check": "prettier --write . && eslint --fix"
4
+ "format": "prettier --write . && eslint --fix",
5
+ "check": "prettier --check ."
6
6
  },
7
7
  "devDependencies": {
8
8
  "@tanstack/eslint-config": "latest",
9
+ "eslint": "^9.20.0",
9
10
  "prettier": "^3.8.1"
10
11
  }
11
12
  }
@@ -1,6 +1,6 @@
1
1
  [build]
2
2
  command = "vite build"
3
- dir = "dist/client"
3
+ publish = "dist/client"
4
4
  [dev]
5
5
  command = "npm run dev"
6
6
  targetPort = 3000
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "scripts": {
3
3
  "lint": "eslint",
4
- "format": "prettier --check .",
5
- "check": "prettier --write . && eslint --fix"
4
+ "format": "prettier --write . && eslint --fix",
5
+ "check": "prettier --check ."
6
6
  },
7
7
  "devDependencies": {
8
8
  "@tanstack/eslint-config": "latest",
9
+ "eslint": "^9.20.0",
9
10
  "prettier": "^3.8.1"
10
11
  }
11
12
  }
@@ -0,0 +1,25 @@
1
+ import { resolve } from 'node:path';
2
+ import { packageManagerExecute } from '../package-manager.js';
3
+ export async function setupIntent(environment, targetDir, options) {
4
+ if (!options.intent) {
5
+ return;
6
+ }
7
+ const s = environment.spinner();
8
+ s.start('Setting up TanStack Intent skill mappings...');
9
+ environment.startStep({
10
+ id: 'setup-intent',
11
+ type: 'command',
12
+ message: 'Setting up TanStack Intent skill mappings...',
13
+ });
14
+ try {
15
+ await packageManagerExecute(environment, resolve(targetDir), options.packageManager, '@tanstack/intent', ['install']);
16
+ environment.finishStep('setup-intent', 'TanStack Intent configured');
17
+ s.stop('TanStack Intent configured');
18
+ }
19
+ catch (error) {
20
+ const message = error instanceof Error ? error.message : 'Unknown error';
21
+ environment.finishStep('setup-intent', `TanStack Intent setup skipped: ${message}`);
22
+ s.stop('TanStack Intent setup skipped');
23
+ environment.warn('TanStack Intent setup failed', `Continuing without it. You can run it later with: npx @tanstack/intent install\n\n${message}`);
24
+ }
25
+ }
@@ -14,4 +14,5 @@ export declare function runNewCommands(environment: Environment, originalOptions
14
14
  }): Promise<void>;
15
15
  export declare function addToApp(environment: Environment, addOns: Array<string>, cwd: string, options?: {
16
16
  forced?: boolean;
17
+ intent?: boolean;
17
18
  }): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import type { Environment, Options } from '../types.js';
2
+ export declare function setupIntent(environment: Environment, targetDir: string, options: Options): Promise<void>;
@@ -1461,6 +1461,7 @@ export interface Options {
1461
1461
  packageManager: PackageManager;
1462
1462
  git: boolean;
1463
1463
  install?: boolean;
1464
+ intent: boolean;
1464
1465
  chosenAddOns: Array<AddOn>;
1465
1466
  addOnOptions: Record<string, Record<string, any>>;
1466
1467
  starter?: Starter | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/create",
3
- "version": "0.63.8",
3
+ "version": "0.64.0",
4
4
  "description": "TanStack Application Builder Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/add-to-app.ts CHANGED
@@ -18,6 +18,7 @@ import {
18
18
  import { mergePackageJSON } from './package-json.js'
19
19
  import { runSpecialSteps } from './special-steps/index.js'
20
20
  import { loadStarter } from './custom-add-ons/starter.js'
21
+ import { setupIntent } from './integrations/intent.js'
21
22
 
22
23
  import type { Environment, Options } from './types.js'
23
24
  import type { PersistedOptions } from './config-file.js'
@@ -54,6 +55,7 @@ async function createOptions(
54
55
  ]),
55
56
  targetDir,
56
57
  starter,
58
+ intent: json.intent ?? false,
57
59
  } as Options
58
60
  }
59
61
 
@@ -230,6 +232,7 @@ export async function addToApp(
230
232
  cwd: string,
231
233
  options?: {
232
234
  forced?: boolean
235
+ intent?: boolean
233
236
  },
234
237
  ) {
235
238
  const persistedOptions = await getCurrentConfiguration(environment, cwd)
@@ -318,6 +321,10 @@ export async function addToApp(
318
321
 
319
322
  await runNewCommands(environment, persistedOptions, cwd, output)
320
323
 
324
+ const intent = options?.intent ?? persistedOptions.intent ?? true
325
+ newOptions.intent = intent
326
+ await setupIntent(environment, cwd, newOptions)
327
+
321
328
  environment.startStep({
322
329
  id: 'write-config-file',
323
330
  type: 'file',
package/src/create-app.ts CHANGED
@@ -13,6 +13,7 @@ import { resolvePackageJSONLatest } from './npm-resolver.js'
13
13
  import { createTemplateFile } from './template-file.js'
14
14
  import { installShadcnComponents } from './integrations/shadcn.js'
15
15
  import { setupGit } from './integrations/git.js'
16
+ import { setupIntent } from './integrations/intent.js'
16
17
  import { runSpecialSteps } from './special-steps/index.js'
17
18
 
18
19
  import type { Environment, FileBundleHandler, Options } from './types.js'
@@ -294,6 +295,8 @@ async function runCommandsAndInstallDependencies(
294
295
  }
295
296
 
296
297
  await installShadcnComponents(environment, options.targetDir, options)
298
+
299
+ await setupIntent(environment, options.targetDir, options)
297
300
  }
298
301
 
299
302
  async function seedEnvValues(environment: Environment, options: Options) {
@@ -82,6 +82,7 @@ export async function createAppOptionsFromPersisted(
82
82
  starter: json.starter ? await loadStarter(json.starter) : undefined,
83
83
  chosenAddOns,
84
84
  addOnOptions: populateAddOnOptionsDefaults(chosenAddOns),
85
+ intent: json.intent ?? false,
85
86
  }
86
87
  }
87
88
 
@@ -103,6 +104,7 @@ export function createSerializedOptionsFromPersisted(
103
104
  framework: json.framework,
104
105
  starter: json.starter,
105
106
  addOnOptions: {},
107
+ intent: json.intent ?? false,
106
108
  }
107
109
  }
108
110
 
@@ -1,6 +1,6 @@
1
1
  [build]
2
2
  command = "vite build"
3
- dir = "dist/client"
3
+ publish = "dist/client"
4
4
  [dev]
5
5
  command = "npm run dev"
6
6
  targetPort = 3000
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "scripts": {
3
3
  "lint": "eslint",
4
- "format": "prettier --check .",
5
- "check": "prettier --write . && eslint --fix"
4
+ "format": "prettier --write . && eslint --fix",
5
+ "check": "prettier --check ."
6
6
  },
7
7
  "devDependencies": {
8
8
  "@tanstack/eslint-config": "latest",
9
+ "eslint": "^9.20.0",
9
10
  "prettier": "^3.8.1"
10
11
  }
11
12
  }
@@ -1,6 +1,6 @@
1
1
  [build]
2
2
  command = "vite build"
3
- dir = "dist/client"
3
+ publish = "dist/client"
4
4
  [dev]
5
5
  command = "npm run dev"
6
6
  targetPort = 3000
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "scripts": {
3
3
  "lint": "eslint",
4
- "format": "prettier --check .",
5
- "check": "prettier --write . && eslint --fix"
4
+ "format": "prettier --write . && eslint --fix",
5
+ "check": "prettier --check ."
6
6
  },
7
7
  "devDependencies": {
8
8
  "@tanstack/eslint-config": "latest",
9
+ "eslint": "^9.20.0",
9
10
  "prettier": "^3.8.1"
10
11
  }
11
12
  }
@@ -0,0 +1,47 @@
1
+ import { resolve } from 'node:path'
2
+
3
+ import { packageManagerExecute } from '../package-manager.js'
4
+
5
+ import type { Environment, Options } from '../types.js'
6
+
7
+ export async function setupIntent(
8
+ environment: Environment,
9
+ targetDir: string,
10
+ options: Options,
11
+ ) {
12
+ if (!options.intent) {
13
+ return
14
+ }
15
+
16
+ const s = environment.spinner()
17
+ s.start('Setting up TanStack Intent skill mappings...')
18
+ environment.startStep({
19
+ id: 'setup-intent',
20
+ type: 'command',
21
+ message: 'Setting up TanStack Intent skill mappings...',
22
+ })
23
+
24
+ try {
25
+ await packageManagerExecute(
26
+ environment,
27
+ resolve(targetDir),
28
+ options.packageManager,
29
+ '@tanstack/intent',
30
+ ['install'],
31
+ )
32
+ environment.finishStep('setup-intent', 'TanStack Intent configured')
33
+ s.stop('TanStack Intent configured')
34
+ } catch (error) {
35
+ const message =
36
+ error instanceof Error ? error.message : 'Unknown error'
37
+ environment.finishStep(
38
+ 'setup-intent',
39
+ `TanStack Intent setup skipped: ${message}`,
40
+ )
41
+ s.stop('TanStack Intent setup skipped')
42
+ environment.warn(
43
+ 'TanStack Intent setup failed',
44
+ `Continuing without it. You can run it later with: npx @tanstack/intent install\n\n${message}`,
45
+ )
46
+ }
47
+ }
package/src/types.ts CHANGED
@@ -214,6 +214,7 @@ export interface Options {
214
214
  packageManager: PackageManager
215
215
  git: boolean
216
216
  install?: boolean
217
+ intent: boolean
217
218
 
218
219
  chosenAddOns: Array<AddOn>
219
220
  addOnOptions: Record<string, Record<string, any>>