Skip to content

Commit a324dc4

Browse files
committed
docs: push docs
1 parent 1ba2be4 commit a324dc4

13 files changed

Lines changed: 1277 additions & 0 deletions

docs/cli-reference.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
id: cli-reference
3+
title: CLI Reference
4+
---
5+
6+
## tanstack create
7+
8+
Create a new TanStack Start project.
9+
10+
```bash
11+
tanstack create [project-name] [options]
12+
```
13+
14+
| Option | Description |
15+
|--------|-------------|
16+
| `--integrations <ids>` | Comma-separated integration IDs |
17+
| `--template <url>` | Template URL or local path |
18+
| `--package-manager <pm>` | `npm`, `pnpm`, `yarn`, `bun`, `deno` |
19+
| `--no-tailwind` | Skip Tailwind CSS |
20+
| `--no-git` | Skip git init |
21+
| `--no-install` | Skip dependency install |
22+
| `-y, --yes` | Use defaults, skip prompts |
23+
| `--target-dir <path>` | Custom output directory |
24+
| `--integrations-path <path>` | Local integrations (dev) |
25+
26+
```bash
27+
# Examples
28+
tanstack create my-app -y
29+
tanstack create my-app --integrations clerk,drizzle,tanstack-query
30+
tanstack create my-app --template https://example.com/template.json
31+
```
32+
33+
---
34+
35+
## tanstack integration
36+
37+
Create custom integrations from existing projects.
38+
39+
### init
40+
41+
Extract integration from current project:
42+
43+
```bash
44+
tanstack integration init
45+
```
46+
47+
Creates `.integration/` folder with `info.json` and `assets/`.
48+
49+
### compile
50+
51+
Rebuild after changes:
52+
53+
```bash
54+
tanstack integration compile
55+
```
56+
57+
See [Creating Integrations](./creating-integrations.md) for full guide.
58+
59+
---
60+
61+
## tanstack template
62+
63+
Create reusable project presets.
64+
65+
### init
66+
67+
```bash
68+
tanstack template init
69+
```
70+
71+
Creates `template-info.json` and `template.json`.
72+
73+
### compile
74+
75+
```bash
76+
tanstack template compile
77+
```
78+
79+
See [Templates](./templates.md) for full guide.
80+
81+
---
82+
83+
## tanstack mcp
84+
85+
Start MCP server for AI agents.
86+
87+
```bash
88+
tanstack mcp [options]
89+
```
90+
91+
| Option | Description |
92+
|--------|-------------|
93+
| `--sse` | HTTP/SSE mode (default: stdio) |
94+
| `--port <n>` | SSE port (default: 8080) |
95+
96+
See [MCP Server](./mcp/overview.md) for setup.
97+
98+
---
99+
100+
## Configuration
101+
102+
Projects include `.tanstack.json`:
103+
104+
```json
105+
{
106+
"version": 1,
107+
"projectName": "my-app",
108+
"framework": "react",
109+
"mode": "file-router",
110+
"typescript": true,
111+
"tailwind": true,
112+
"packageManager": "pnpm",
113+
"chosenIntegrations": ["tanstack-query", "clerk"]
114+
}
115+
```
116+
117+
Used by `integration init` and `template init` to detect changes.

docs/config.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/TanStack/tanstack.com/main/tanstack-docs-config.schema.json",
3+
"docSearch": {
4+
"appId": "FQ0DQ6MA3C",
5+
"apiKey": "10c34d6a5c89f6048cf644d601e65172",
6+
"indexName": "tanstack-test"
7+
},
8+
"sections": [
9+
{
10+
"label": "Getting Started",
11+
"children": [
12+
{
13+
"label": "Overview",
14+
"to": "overview"
15+
},
16+
{
17+
"label": "Installation",
18+
"to": "installation"
19+
},
20+
{
21+
"label": "Quick Start",
22+
"to": "quick-start"
23+
}
24+
]
25+
},
26+
{
27+
"label": "Usage",
28+
"children": [
29+
{
30+
"label": "CLI Reference",
31+
"to": "cli-reference"
32+
},
33+
{
34+
"label": "Integrations",
35+
"to": "integrations"
36+
},
37+
{
38+
"label": "Templates",
39+
"to": "templates"
40+
},
41+
{
42+
"label": "Examples",
43+
"to": "examples"
44+
}
45+
]
46+
},
47+
{
48+
"label": "Authoring",
49+
"children": [
50+
{
51+
"label": "Creating Integrations",
52+
"to": "creating-integrations"
53+
}
54+
]
55+
},
56+
{
57+
"label": "MCP Server",
58+
"children": [
59+
{
60+
"label": "Overview",
61+
"to": "mcp/overview"
62+
},
63+
{
64+
"label": "Connecting",
65+
"to": "mcp/connecting"
66+
},
67+
{
68+
"label": "Tools Reference",
69+
"to": "mcp/tools"
70+
}
71+
]
72+
},
73+
{
74+
"label": "Help",
75+
"children": [
76+
{
77+
"label": "Troubleshooting",
78+
"to": "troubleshooting"
79+
}
80+
]
81+
}
82+
]
83+
}

docs/creating-integrations.md

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
---
2+
id: creating-integrations
3+
title: Creating Integrations
4+
---
5+
6+
Integrations add files, dependencies, and code hooks to generated projects.
7+
8+
## Quick Start
9+
10+
```bash
11+
# 1. Create base project
12+
tanstack create my-integration-dev -y
13+
14+
# 2. Add your code
15+
# - src/integrations/my-feature/
16+
# - src/routes/demo/my-feature.tsx
17+
# - Update package.json
18+
19+
# 3. Extract integration
20+
tanstack integration init
21+
22+
# 4. Edit .integration/info.json
23+
24+
# 5. Compile
25+
tanstack integration compile
26+
27+
# 6. Test
28+
tanstack create test --integrations my-feature --integrations-path ./.integration
29+
```
30+
31+
## Structure
32+
33+
```
34+
my-integration/
35+
├── info.json # Metadata (required)
36+
├── package.json # Dependencies (optional)
37+
└── assets/ # Files to copy
38+
└── src/
39+
├── integrations/my-feature/
40+
└── routes/demo/my-feature.tsx
41+
```
42+
43+
## info.json
44+
45+
Required fields:
46+
47+
```json
48+
{
49+
"name": "My Feature",
50+
"description": "What it does",
51+
"type": "integration",
52+
"phase": "integration",
53+
"category": "tooling",
54+
"modes": ["file-router"]
55+
}
56+
```
57+
58+
| Field | Values |
59+
|-------|--------|
60+
| `type` | `integration`, `toolchain`, `deployment`, `example` |
61+
| `phase` | `setup`, `integration`, `example` |
62+
| `category` | `tanstack`, `auth`, `database`, `orm`, `deploy`, `tooling`, `monitoring`, `api`, `i18n`, `cms`, `other` |
63+
64+
Optional fields:
65+
66+
```json
67+
{
68+
"dependsOn": ["tanstack-query"],
69+
"conflicts": ["other-feature"],
70+
"envVars": [{ "name": "API_KEY", "description": "...", "required": true }],
71+
"gitignorePatterns": ["*.cache"]
72+
}
73+
```
74+
75+
## Hooks
76+
77+
Inject code into generated projects:
78+
79+
```json
80+
{
81+
"hooks": [
82+
{
83+
"type": "root-provider",
84+
"jsName": "MyProvider",
85+
"path": "src/integrations/my-feature/provider.tsx"
86+
}
87+
]
88+
}
89+
```
90+
91+
| Type | Location | Use |
92+
|------|----------|-----|
93+
| `root-provider` | Wraps app in `__root.tsx` | Context providers |
94+
| `vite-plugin` | `vite.config.ts` | Vite plugins |
95+
| `devtools` | After app in `__root.tsx` | Devtools |
96+
| `entry-client` | `entry-client.tsx` | Client init |
97+
98+
## Demo Routes
99+
100+
```json
101+
{
102+
"routes": [
103+
{
104+
"url": "/demo/my-feature",
105+
"name": "My Feature Demo",
106+
"path": "src/routes/demo/my-feature.tsx"
107+
}
108+
]
109+
}
110+
```
111+
112+
## Integration Options
113+
114+
Let users configure the integration:
115+
116+
```json
117+
{
118+
"options": {
119+
"database": {
120+
"type": "select",
121+
"label": "Database",
122+
"options": [
123+
{ "value": "postgres", "label": "PostgreSQL" },
124+
{ "value": "sqlite", "label": "SQLite" }
125+
],
126+
"default": "postgres"
127+
}
128+
}
129+
}
130+
```
131+
132+
Access in EJS templates:
133+
134+
```ejs
135+
<% if (integrationOption['my-feature']?.database === 'postgres') { %>
136+
// PostgreSQL code
137+
<% } %>
138+
```
139+
140+
## EJS Templates
141+
142+
Files ending in `.ejs` are processed. Available variables:
143+
144+
| Variable | Type | Description |
145+
|----------|------|-------------|
146+
| `projectName` | string | Project name |
147+
| `typescript` | boolean | TS enabled |
148+
| `tailwind` | boolean | Tailwind enabled |
149+
| `integrationEnabled` | object | `{ [id]: boolean }` |
150+
| `integrationOption` | object | `{ [id]: options }` |
151+
152+
File patterns:
153+
154+
| Pattern | Result |
155+
|---------|--------|
156+
| `file.ts` | Copied as-is |
157+
| `file.ts.ejs` | EJS processed |
158+
| `_dot_gitignore` | Becomes `.gitignore` |
159+
| `file.ts.append` | Appended to existing |
160+
161+
## Distribution
162+
163+
Host on GitHub or npm, then:
164+
165+
```bash
166+
tanstack create my-app --integrations-path ./path/to/integrations
167+
```
168+
169+
To add to official catalog: PR to `integrations/` folder.

0 commit comments

Comments
 (0)