Skip to content

Commit daade5f

Browse files
committed
checkpoint
1 parent e19fb8a commit daade5f

File tree

778 files changed

+1611
-3192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

778 files changed

+1611
-3192
lines changed

ARCHITECTURE.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
## Nomenclature
22

3-
- `cta` - Create Tanstack Application
4-
- CTA Framework - A framework that supports the creation of a TanStack Application using a specific technology (e.g. React, Solid, Vue, etc.)
3+
- TanStack CLI - The command line interface for creating and managing TanStack applications
4+
- Framework - A framework that supports the creation of a TanStack Application using a specific technology (e.g. React, Solid)
55
- `code-router` - One of two _modes_ of TanStack Application. The other is `file-router`. The code router is when the applications routes are defined in code.
66
- `file-router` - One of two _modes_ of TanStack Application. The other is `code-router`. The file router is when the applications routes are defined in files (usually in the `src/routes` directory).
77
- `add-on` - A plugin that extends the capabilities of a TanStack Application (e.g. the `tanstack-query` add-on integrates TanStack Query into the application).
88
- custom `add-on` - An externalized `add-on` contained in a single JSON file that can integate technologies that aren't covered with the built-in add-ons.
9-
- `starter` - An application template that is constructed from an existing CTA created application that has been modified to the customers needs. The advantage of a starter over a cloneable git repo is that when a starter is used the add-ons and project will be created using the latest version of the CTA framework and the add-ons. This reduces the versioning burden on the customer. This does come with a risk of potential breaking changes.
9+
- `starter` - An application template that is constructed from an existing application that has been modified to the customers needs. The advantage of a starter over a cloneable git repo is that when a starter is used the add-ons and project will be created using the latest version of the framework and the add-ons. This reduces the versioning burden on the customer. This does come with a risk of potential breaking changes.
1010

11-
## CLI applications
11+
## CLI Applications
1212

13-
- `create-tanstack` - The CLI application for creating a TanStack Application.
14-
- `create-start-app` - The CLI application for creating a TanStack Start Application.
15-
- `create-tsrouter-app` - The CLI application for creating a TanStack Router Application.
13+
- `tanstack` - The main CLI application (`@tanstack/cli`)
14+
- `create-tanstack` - Deprecated alias for `tanstack create`
15+
- `create-start-app` - Deprecated alias for `tanstack create`
16+
- `create-tsrouter-app` - Deprecated alias for `tanstack create`
1617

1718
## Packages
1819

19-
- `@tanstack/cta-cli` - The command line interface for TanStack CTA.
20-
- `@tanstack/cta-engine` - The core engine that powers TanStack CTA.
21-
- `@tanstack/cta-ui` - The UI components for TanStack CTA.
20+
- `@tanstack/cli` - The command line interface for TanStack
21+
- `@tanstack/create` - The core engine that powers app creation
22+
- `@tanstack/create-ui` - The UI components for the visual app creator
2223

2324
## Frameworks
2425

25-
- `@tanstack/cta-frameworks-react-cra` - The React (Create React App) framework for TanStack CTA.
26-
- `@tanstack/cta-frameworks-solid` - The Solid framework for TanStack CTA.
26+
Frameworks are now bundled within `@tanstack/create`:
27+
- React framework (`packages/create/src/frameworks/react`)
28+
- Solid framework (`packages/create/src/frameworks/solid`)
2729

2830
## File Templates
2931

30-
The CTA system uses EJS to render the files into the final application.
32+
The system uses EJS to render the files into the final application.
3133

3234
Below are all of the variables that are available to the file templates.
3335

@@ -48,4 +50,4 @@ Below are all of the variables that are available to the file templates.
4850
| `getPackageManagerAddScript` | A function that returns the script to add a dependency to the project. |
4951
| `getPackageManagerRunScript` | A function that returns the script to run a command in the project. |
5052
| `relativePath` | A function that returns the relative path from the current file to the specified target file. |
51-
| `ignoreFile` | A function that if called will tell CTA to not include this file in the application. |
53+
| `ignoreFile` | A function that if called will tell the engine to not include this file in the application. |

CLAUDE.md

Lines changed: 51 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,77 @@
1-
# TanStack Application Builders (CTA) - Claude Code Assistant
1+
# TanStack CLI - Claude Code Assistant
22

33
## Project Overview
44

5-
This monorepo contains the TanStack Application Builders (CTA - Create TanStack Application), a comprehensive tool for creating modern React and Solid applications with TanStack Router and TanStack Start.
5+
This monorepo contains the TanStack CLI (`@tanstack/cli`), a comprehensive tool for creating modern React and Solid applications with TanStack Router and TanStack Start.
66

77
## Quick Start
88

99
```bash
10-
# Create a new TanStack Router app
11-
npx create-tsrouter-app@latest my-app
10+
# Create a new TanStack app (recommended)
11+
npx @tanstack/cli@latest create my-app
1212

13-
# Create a new TanStack Start app (SSR)
13+
# Legacy CLI aliases (deprecated, will show warning)
14+
npx create-tsrouter-app@latest my-app
1415
npx create-start-app@latest my-app
15-
16-
# Alternative CLI names (all create TanStack Router apps)
1716
npx create-tanstack@latest my-app
1817
npx create-tanstack-app@latest my-app
1918
```
2019

20+
## CLI Commands
21+
22+
```bash
23+
tanstack create [project-name] [options] # Create a new TanStack app
24+
tanstack add [add-ons...] # Add add-ons to existing project
25+
tanstack add-on init|compile # Manage custom add-ons
26+
tanstack starter init|compile # Manage custom starters
27+
tanstack mcp [--sse] # Start MCP server
28+
tanstack pin-versions # Pin package versions
29+
tanstack --version # Show version
30+
```
31+
2132
## Monorepo Structure
2233

2334
```
2435
create-tsrouter-app/
25-
├── cli/ # CLI applications
26-
│ ├── create-start-app/ # TanStack Start CLI
27-
│ ├── create-tanstack/ # TanStack Router CLI (alias)
28-
│ ├── create-tanstack-app/ # TanStack Router CLI (alias)
29-
│ └── create-tsrouter-app/ # TanStack Router CLI (main)
30-
├── packages/ # Core packages
31-
│ ├── cta-cli/ # CLI interface
32-
│ ├── cta-engine/ # Core engine
33-
│ ├── cta-ui/ # Web UI components
34-
│ └── cta-ui-base/ # Base UI components
35-
├── frameworks/ # Framework implementations
36-
│ ├── react-cra/ # React CRA framework
37-
│ └── solid/ # Solid framework
38-
└── examples/ # Example projects and starters
36+
├── packages/
37+
│ ├── cli/ # @tanstack/cli - Main CLI with subcommands
38+
│ ├── create/ # @tanstack/create - Core engine + frameworks
39+
│ │ └── src/
40+
│ │ └── frameworks/
41+
│ │ ├── react-cra/ # React framework
42+
│ │ └── solid/ # Solid framework
43+
│ └── create-ui/ # @tanstack/create-ui - Web UI components
44+
├── cli-aliases/ # Deprecated thin wrapper CLIs
45+
│ ├── create-tsrouter-app/
46+
│ ├── create-start-app/
47+
│ ├── create-tanstack/
48+
│ ├── create-tanstack-app/
49+
│ └── ts-create-start/
50+
└── examples/ # Example projects and custom CLIs
3951
```
4052

4153
## Core Packages
4254

43-
### @tanstack/cta-cli
55+
### @tanstack/cli
4456

45-
- **Purpose**: Main CLI interface for the application builder
57+
- **Purpose**: Main CLI interface with subcommands
58+
- **Binary**: `tanstack`
4659
- **Key Dependencies**: `@clack/prompts`, `commander`, `express`, `chalk`
47-
- **Scripts**: `build`, `dev`, `test`, `test:watch`, `test:coverage`
60+
- **Features**: `create`, `add`, `add-on`, `starter`, `mcp`, `pin-versions` subcommands
4861

49-
### @tanstack/cta-engine
62+
### @tanstack/create
5063

51-
- **Purpose**: Core business logic and file generation engine
64+
- **Purpose**: Core engine, frameworks, add-ons, and starters
5265
- **Key Dependencies**: `ejs`, `execa`, `memfs`, `prettier`, `zod`
5366
- **Features**: Template processing, project generation, validation
67+
- **Contains**: React and Solid frameworks with all add-ons
5468

55-
### @tanstack/cta-ui
69+
### @tanstack/create-ui
5670

5771
- **Purpose**: Web interface for the application builder
5872
- **Key Dependencies**: `react`, `tailwindcss`, `next-themes`, `sonner`
5973
- **Scripts**: `build:ui`, `dev:ui` (React dev server)
6074

61-
## CLI Applications
62-
63-
### create-start-app
64-
65-
- **Purpose**: Creates TanStack Start applications (SSR)
66-
- **Features**: Server-side rendering, React/Solid support, Vite build system
67-
- **Usage**: `npx create-start-app@latest my-app`
68-
69-
### create-tsrouter-app (and aliases)
70-
71-
- **Purpose**: Creates TanStack Router applications (client-side routing)
72-
- **Features**: File-based routing, TypeScript/JavaScript, React/Solid support
73-
- **Usage**: `npx create-tsrouter-app@latest my-app`
74-
75-
## Framework Support
76-
77-
### React CRA Framework
78-
79-
- **Location**: `frameworks/react-cra/`
80-
- **Add-ons**: Clerk, Shadcn, Neon, TanStack Query, tRPC, Form, Store, etc.
81-
- **Toolchains**: Biome, ESLint + Prettier
82-
- **Examples**: Blog starter, E-commerce starter, TanChat
83-
84-
### Solid Framework
85-
86-
- **Location**: `frameworks/solid/`
87-
- **Add-ons**: Solid UI, TanStack Query, Form, Store, etc.
88-
- **Toolchains**: Biome, ESLint + Prettier
89-
- **Examples**: TanChat
90-
9175
## Development Scripts
9276

9377
```bash
@@ -113,23 +97,23 @@ pnpm cleanNodeModules
11397

11498
```bash
11599
# Build with CLI (outside monorepo)
116-
node cli/create-tsrouter-app/dist/index.js my-app
100+
node packages/cli/dist/index.js create my-app
117101

118102
# Test with local add-ons
119-
node cli/create-tsrouter-app/dist/index.js my-app --add-ons http://localhost:9080/add-on.json
103+
node packages/cli/dist/index.js create my-app --add-ons http://localhost:9080/add-on.json
120104

121105
# Test with local starters
122-
node cli/create-tsrouter-app/dist/index.js my-app --starter http://localhost:9080/starter.json
106+
node packages/cli/dist/index.js create my-app --starter http://localhost:9080/starter.json
123107
```
124108

125-
### Developing CTA UI
109+
### Developing Create UI
126110

127111
```bash
128112
# Start API server
129-
CTA_DISABLE_UI=true node cli/create-tsrouter-app/dist/index.js --ui
113+
CTA_DISABLE_UI=true node packages/cli/dist/index.js create --ui
130114

131115
# Start React dev server
132-
cd packages/cta-ui && pnpm dev:ui
116+
cd packages/create-ui && pnpm dev:ui
133117

134118
# Run monorepo in watch mode
135119
pnpm dev
@@ -149,10 +133,8 @@ pnpm dev
149133

150134
### Example Starters
151135

152-
- **Blog Starter**: TanStack Router blog with file-based routing
153-
- **E-commerce Starter**: AI-powered chat application
154-
- **Resume Starter**: Professional resume template
155-
- **TanChat**: AI chat application with Claude integration
136+
- **Events**: Conference/events website
137+
- **Resume**: Professional resume template
156138

157139
## EJS Template Variables
158140

@@ -174,8 +156,8 @@ The system uses EJS templates with these variables:
174156
# Run all tests
175157
pnpm test
176158

177-
# Test specific framework
178-
cd frameworks/react-cra && pnpm test
159+
# Test specific package
160+
cd packages/create && pnpm test
179161

180162
# Test with coverage
181163
pnpm test:coverage
@@ -196,7 +178,6 @@ pnpm test:coverage
196178
- **Node Version**: Requires Node.js (see .nvmrc if available)
197179
- **Build System**: TypeScript compilation, Vite for UI
198180
- **Testing**: Vitest for unit tests, ESLint for linting
199-
- **Versioning**: All packages share the same version (currently 0.16.5)
200181

201182
## Important Files
202183

CONTRIBUTING.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- Run the build
1515
- `pnpm build`
1616
- Build an example app with the builder:
17-
- `node [root of the monorepo]/cli/create-tsrouter-app/dist/index.js app-js`
17+
- `node [root of the monorepo]/packages/cli/dist/index.js create app-name`
1818
- Do not attempt to build an app within the monorepo because the dependencies will be hoisted into the monorepo.
1919
- Run `pnpm dev` at that top level to build everything in watch mode
2020
- Run `pnpm build` and `pnpm test` to make sure the changes work
@@ -27,15 +27,17 @@ When testing use `pnpm dev` at the top level of the `create-tsrouter-app` repo.
2727
Then from a peer directory use:
2828

2929
```bash
30-
node ../create-tsrouter-app/cli/create-start-app/dist/index.js
31-
```
30+
# Using the main CLI
31+
node ../create-tsrouter-app/packages/cli/dist/index.js create my-app
3232

33-
To test `create-start-app` (or any of the CLIs).
33+
# Or using a deprecated alias (will show deprecation warning)
34+
node ../create-tsrouter-app/cli-aliases/create-start-app/dist/index.js my-app
35+
```
3436

3537
You can also do:
3638

3739
```bash
38-
npm_config_user_agent=pnpm node ../create-tsrouter-app/cli/create-start-app/dist/index.js
40+
npm_config_user_agent=pnpm node ../create-tsrouter-app/packages/cli/dist/index.js create my-app
3941
```
4042

4143
If you want to specify a package manager.
@@ -49,7 +51,7 @@ The `--dev-watch` command provides real-time feedback while developing framework
4951
To start developing a framework with live rebuilding:
5052

5153
```bash
52-
node [root of the monorepo]/cli/create-tsrouter-app/dist/index.js --dev-watch ./frameworks/react-cra test-app --template typescript --package-manager bun --tailwind --add-ons shadcn
54+
node [root of the monorepo]/packages/cli/dist/index.js create --dev-watch ./packages/create/src/frameworks/react-cra test-app --template typescript --package-manager bun --tailwind --add-ons shadcn
5355
```
5456

5557
This command will:
@@ -64,7 +66,7 @@ This command will:
6466

6567
```bash
6668
pnpm dev # Build in watch mode
67-
rm -rf test-app && node cli/create-tsrouter-app/dist/index.js --dev-watch ./frameworks/react-cra test-app --template typescript --package-manager bun --tailwind --add-ons shadcn
69+
rm -rf test-app && node packages/cli/dist/index.js create --dev-watch ./packages/create/src/frameworks/react-cra test-app --template typescript --package-manager bun --tailwind --add-ons shadcn
6870
cd my-test-app && pnpm run dev # run the tsrouter vite app
6971
```
7072

@@ -79,25 +81,25 @@ Create the add-on or starter using the CLI. Then serve it locally from the proje
7981
Then, when creating apps with add-ons:
8082

8183
```bash
82-
node [root of the monorepo]/cli/create-tsrouter-app/dist/index.js app-js --add-ons http://localhost:9080/add-on.json
84+
node [root of the monorepo]/packages/cli/dist/index.js create app-name --add-ons http://localhost:9080/add-on.json
8385
```
8486

8587
And when creating apps with a starter:
8688

8789
```bash
88-
node [root of the monorepo]/cli/create-tsrouter-app/dist/index.js app-js --starter http://localhost:9080/starter.json
90+
node [root of the monorepo]/packages/cli/dist/index.js create app-name --starter http://localhost:9080/starter.json
8991
```
9092

91-
# Developing on the CTA UI
93+
# Developing on the Create UI
9294

93-
The CTA UI is somewhat tricky to develop on because it's both a web server and a React app. You need to run the CLI in "API" model and then the React app in dev mode, as well as the whole monorepo in watch mode.
95+
The Create UI is somewhat tricky to develop on because it's both a web server and a React app. You need to run the CLI in "API" model and then the React app in dev mode, as well as the whole monorepo in watch mode.
9496

9597
## Starting the API Server
9698

9799
Let's start off with how to run the CLI in "API" mode. Here we are running the CLI in an empty directory in app creation mode.
98100

99101
```bash
100-
CTA_DISABLE_UI=true node ../create-tsrouter-app/cli/create-tsrouter-app/dist/index.js --ui
102+
CTA_DISABLE_UI=true node ../create-tsrouter-app/packages/cli/dist/index.js create --ui
101103
```
102104

103105
If this is working you will see the following output:
@@ -111,15 +113,15 @@ Note that it say "Create TanStack **API**" and not "Create TanStack **App**". Th
111113
Here is the same command for the `add` mode:
112114

113115
```bash
114-
CTA_DISABLE_UI=true node ../create-tsrouter-app/cli/create-tsrouter-app/dist/index.js add --ui
116+
CTA_DISABLE_UI=true node ../create-tsrouter-app/packages/cli/dist/index.js add --ui
115117
```
116118

117119
## Starting the React App
118120

119121
Now that we have the API server running, we can start the React app in dev mode.
120122

121123
```bash
122-
cd packages/cta-ui
124+
cd packages/create-ui
123125
pnpm dev:ui
124126
```
125127

@@ -133,6 +135,6 @@ At the top level of the monorepo, run the following command to start the build i
133135
pnpm dev
134136
```
135137

136-
This will build the monorepo and watch for changes in any of the libraries. (It will **not** build changes for the React app within the `cta-ui` package.)
138+
This will build the monorepo and watch for changes in any of the libraries. (It will **not** build changes for the React app within the `create-ui` package.)
137139

138-
This is important because you might need to change API endpoints in the CTA library, or in the engine. If you do make those kinds of changes then the you will need to re-run the CLI in "API" mode to pick up the changes.
140+
This is important because you might need to change API endpoints in the CLI library, or in the engine. If you do make those kinds of changes then the you will need to re-run the CLI in "API" mode to pick up the changes.

0 commit comments

Comments
 (0)