Skip to content

Commit 1b4e6fc

Browse files
committed
chore: extract custom add-on code
1 parent d1a0b78 commit 1b4e6fc

File tree

15 files changed

+567
-10
lines changed

15 files changed

+567
-10
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"create-tsrouter-app": "workspace:*",
3131
"@tanstack/cta-cli": "workspace:*",
3232
"@tanstack/cta-core": "workspace:*",
33+
"@tanstack/cta-custom-add-on": "workspace:*",
3334
"@tanstack/cta-engine": "workspace:*",
3435
"@tanstack/cta-mcp": "workspace:*",
3536
"@tanstack/cta-ui": "workspace:*",

packages/cta-cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"dependencies": {
3232
"@tanstack/cta-core": "workspace:*",
3333
"@tanstack/cta-engine": "workspace:*",
34+
"@tanstack/cta-custom-add-on": "workspace:*",
3435
"@tanstack/cta-mcp": "workspace:*",
3536
"@tanstack/cta-ui": "workspace:*",
3637
"@clack/prompts": "^0.10.0",

packages/cta-cli/src/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import chalk from 'chalk'
55
import {
66
SUPPORTED_PACKAGE_MANAGERS,
77
SUPPORTED_TOOLCHAINS,
8-
createDefaultEnvironment,
98
getAllAddOns,
109
getFrameworkById,
1110
getFrameworkByName,
1211
getFrameworks,
1312
} from '@tanstack/cta-core'
14-
import { addToApp, createApp, initAddOn } from '@tanstack/cta-engine'
13+
import { addToApp, createApp } from '@tanstack/cta-engine'
14+
import { initAddOn } from '@tanstack/cta-custom-add-on'
1515

1616
import { runMCPServer } from '@tanstack/cta-mcp'
1717

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "@tanstack/cta-custom-add-on",
3+
"version": "0.10.0-alpha.15",
4+
"description": "Tanstack Application Builder Custom Add-On Support",
5+
"type": "module",
6+
"main": "./dist/index.js",
7+
"types": "./dist/types/index.d.ts",
8+
"scripts": {
9+
"build": "tsc",
10+
"dev": "tsc --watch",
11+
"test": "eslint ./src"
12+
},
13+
"repository": {
14+
"type": "git",
15+
"url": "https://github.com/TanStack/create-tsrouter-app.git"
16+
},
17+
"homepage": "https://tanstack.com/router",
18+
"funding": {
19+
"type": "github",
20+
"url": "https://github.com/sponsors/tannerlinsley"
21+
},
22+
"keywords": [
23+
"tanstack",
24+
"router",
25+
"create-tsrouter-app"
26+
],
27+
"author": "Jack Herrington <[email protected]>",
28+
"license": "MIT",
29+
"packageManager": "[email protected]",
30+
"dependencies": {
31+
"@tanstack/cta-engine": "workspace:*",
32+
"@tanstack/cta-core": "workspace:*"
33+
},
34+
"devDependencies": {
35+
"@tanstack/config": "^0.16.2",
36+
"@types/node": "^22.13.4",
37+
"eslint": "^9.20.0",
38+
"typescript": "^5.6.3"
39+
}
40+
}

packages/cta-engine/src/custom-add-on.ts renamed to packages/cta-custom-add-on/src/custom-add-on.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import {
99
readConfigFile,
1010
readFileHelper,
1111
} from '@tanstack/cta-core'
12-
import { createApp } from './create-app.js'
12+
13+
import { createApp } from '@tanstack/cta-engine'
1314

1415
import type { Environment, Options, PersistedOptions } from '@tanstack/cta-core'
1516

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { createAppOptionsFromPersisted, initAddOn } from './custom-add-on.js'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2020",
4+
"module": "ES2020",
5+
"outDir": "./dist",
6+
"rootDir": "./src",
7+
"strict": true,
8+
"esModuleInterop": true,
9+
"skipLibCheck": true,
10+
"forceConsistentCasingInFileNames": true,
11+
"moduleResolution": "node",
12+
"declaration": true,
13+
"declarationDir": "./dist/types"
14+
},
15+
"include": ["./src/**/*.ts"],
16+
"exclude": ["node_modules", "dist"]
17+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { Environment, Options } from '@tanstack/cta-core';
2+
export declare function createApp(options: Options, { silent, environment, cwd, appName, }: {
3+
silent?: boolean;
4+
environment: Environment;
5+
cwd?: string;
6+
name?: string;
7+
appName?: string;
8+
}): Promise<void>;

0 commit comments

Comments
 (0)