@tanstack/create 0.63.9 → 0.65.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 +30 -0
- package/dist/add-to-app.js +5 -0
- package/dist/create-app.js +74 -16
- package/dist/custom-add-ons/shared.js +2 -0
- package/dist/file-helpers.js +14 -0
- package/dist/frameworks/react/add-ons/ai/info.json +1 -1
- package/dist/frameworks/react/add-ons/better-auth/info.json +1 -1
- package/dist/frameworks/react/add-ons/clerk/README.md +42 -1
- package/dist/frameworks/react/add-ons/clerk/assets/src/routes/demo/clerk.tsx +94 -11
- package/dist/frameworks/react/add-ons/clerk/info.json +1 -1
- package/dist/frameworks/react/add-ons/compiler/info.json +1 -1
- package/dist/frameworks/react/add-ons/convex/info.json +1 -1
- package/dist/frameworks/react/add-ons/drizzle/info.json +1 -1
- package/dist/frameworks/react/add-ons/mcp/info.json +1 -1
- package/dist/frameworks/react/add-ons/neon/info.json +1 -1
- package/dist/frameworks/react/add-ons/paraglide/info.json +1 -1
- package/dist/frameworks/react/add-ons/prisma/info.json +1 -1
- package/dist/frameworks/react/add-ons/shadcn/info.json +1 -1
- package/dist/frameworks/react/add-ons/strapi/info.json +1 -1
- package/dist/frameworks/react/add-ons/t3env/info.json +1 -1
- package/dist/frameworks/react/add-ons/workos/info.json +1 -1
- package/dist/frameworks/react/hosts/cloudflare/README.md +11 -0
- package/dist/frameworks/react/hosts/cloudflare/info.json +1 -1
- package/dist/frameworks/react/hosts/netlify/README.md +11 -0
- package/dist/frameworks/react/hosts/netlify/info.json +1 -1
- package/dist/frameworks/react/hosts/nitro/README.md +12 -0
- package/dist/frameworks/react/hosts/nitro/info.json +1 -1
- package/dist/frameworks/react/hosts/railway/README.md +10 -0
- package/dist/frameworks/react/hosts/railway/info.json +1 -1
- package/dist/frameworks/solid/add-ons/better-auth/info.json +1 -1
- package/dist/frameworks/solid/add-ons/convex/info.json +1 -1
- package/dist/frameworks/solid/add-ons/solid-ui/info.json +1 -1
- package/dist/frameworks/solid/add-ons/strapi/info.json +1 -1
- package/dist/frameworks/solid/add-ons/t3env/info.json +1 -1
- package/dist/frameworks/solid/hosts/cloudflare/README.md +11 -0
- package/dist/frameworks/solid/hosts/cloudflare/info.json +1 -1
- package/dist/frameworks/solid/hosts/netlify/README.md +11 -0
- package/dist/frameworks/solid/hosts/netlify/info.json +1 -1
- package/dist/frameworks/solid/hosts/nitro/README.md +12 -0
- package/dist/frameworks/solid/hosts/nitro/info.json +1 -1
- package/dist/frameworks/solid/hosts/railway/README.md +10 -0
- package/dist/frameworks/solid/hosts/railway/info.json +1 -1
- package/dist/index.js +1 -1
- package/dist/integrations/intent.js +25 -0
- package/dist/types/add-to-app.d.ts +1 -0
- package/dist/types/file-helpers.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/integrations/intent.d.ts +2 -0
- package/dist/types/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/add-to-app.ts +7 -0
- package/src/create-app.ts +89 -22
- package/src/custom-add-ons/shared.ts +2 -0
- package/src/file-helpers.ts +20 -0
- package/src/frameworks/react/add-ons/ai/info.json +1 -1
- package/src/frameworks/react/add-ons/better-auth/info.json +1 -1
- package/src/frameworks/react/add-ons/clerk/README.md +42 -1
- package/src/frameworks/react/add-ons/clerk/assets/src/routes/demo/clerk.tsx +94 -11
- package/src/frameworks/react/add-ons/clerk/info.json +1 -1
- package/src/frameworks/react/add-ons/compiler/info.json +1 -1
- package/src/frameworks/react/add-ons/convex/info.json +1 -1
- package/src/frameworks/react/add-ons/drizzle/info.json +1 -1
- package/src/frameworks/react/add-ons/mcp/info.json +1 -1
- package/src/frameworks/react/add-ons/neon/info.json +1 -1
- package/src/frameworks/react/add-ons/paraglide/info.json +1 -1
- package/src/frameworks/react/add-ons/prisma/info.json +1 -1
- package/src/frameworks/react/add-ons/shadcn/info.json +1 -1
- package/src/frameworks/react/add-ons/strapi/info.json +1 -1
- package/src/frameworks/react/add-ons/t3env/info.json +1 -1
- package/src/frameworks/react/add-ons/workos/info.json +1 -1
- package/src/frameworks/react/hosts/cloudflare/README.md +11 -0
- package/src/frameworks/react/hosts/cloudflare/info.json +1 -1
- package/src/frameworks/react/hosts/netlify/README.md +11 -0
- package/src/frameworks/react/hosts/netlify/info.json +1 -1
- package/src/frameworks/react/hosts/nitro/README.md +12 -0
- package/src/frameworks/react/hosts/nitro/info.json +1 -1
- package/src/frameworks/react/hosts/railway/README.md +10 -0
- package/src/frameworks/react/hosts/railway/info.json +1 -1
- package/src/frameworks/solid/add-ons/better-auth/info.json +1 -1
- package/src/frameworks/solid/add-ons/convex/info.json +1 -1
- package/src/frameworks/solid/add-ons/solid-ui/info.json +1 -1
- package/src/frameworks/solid/add-ons/strapi/info.json +1 -1
- package/src/frameworks/solid/add-ons/t3env/info.json +1 -1
- package/src/frameworks/solid/hosts/cloudflare/README.md +11 -0
- package/src/frameworks/solid/hosts/cloudflare/info.json +1 -1
- package/src/frameworks/solid/hosts/netlify/README.md +11 -0
- package/src/frameworks/solid/hosts/netlify/info.json +1 -1
- package/src/frameworks/solid/hosts/nitro/README.md +12 -0
- package/src/frameworks/solid/hosts/nitro/info.json +1 -1
- package/src/frameworks/solid/hosts/railway/README.md +10 -0
- package/src/frameworks/solid/hosts/railway/info.json +1 -1
- package/src/index.ts +1 -0
- package/src/integrations/intent.ts +47 -0
- package/src/types.ts +1 -0
- package/tests/create-app.test.ts +95 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "MCP",
|
|
3
3
|
"phase": "setup",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "Expose your app as an MCP server so AI clients (Claude, Cursor) can call into it.",
|
|
5
5
|
"link": "https://mcp.dev",
|
|
6
6
|
"modes": ["file-router"],
|
|
7
7
|
"type": "add-on",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Prisma",
|
|
3
|
-
"description": "
|
|
3
|
+
"description": "Type-safe database client with schema migrations (Postgres, MySQL, SQLite, MongoDB).",
|
|
4
4
|
"phase": "add-on",
|
|
5
5
|
"type": "add-on",
|
|
6
6
|
"category": "orm",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
## Deploy to Cloudflare Workers
|
|
2
|
+
|
|
3
|
+
This project uses the Cloudflare Vite plugin (configured in `vite.config.ts`) and `wrangler.jsonc`:
|
|
4
|
+
|
|
5
|
+
1. Install Wrangler: `npm install -g wrangler`
|
|
6
|
+
2. Authenticate: `wrangler login`
|
|
7
|
+
3. Deploy: `npx wrangler deploy`
|
|
8
|
+
|
|
9
|
+
For production env vars, run `wrangler secret put MY_VAR` for each secret listed in `.env.example`. Public (non-secret) vars go in `wrangler.jsonc` under `vars`.
|
|
10
|
+
|
|
11
|
+
KV, D1, R2, and Durable Object bindings are configured in `wrangler.jsonc` — see https://developers.cloudflare.com/workers/wrangler/configuration/.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Cloudflare",
|
|
3
|
-
"description": "Cloudflare
|
|
3
|
+
"description": "Deploy to Cloudflare Workers (edge runtime, KV/D1/R2 bindings).",
|
|
4
4
|
"link": "https://developers.cloudflare.com/workers/vite-plugin/",
|
|
5
5
|
"phase": "add-on",
|
|
6
6
|
"modes": ["file-router", "code-router"],
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
## Deploy to Netlify
|
|
2
|
+
|
|
3
|
+
This project ships with `netlify.toml` configured for a Netlify site:
|
|
4
|
+
|
|
5
|
+
1. Push this repo to GitHub
|
|
6
|
+
2. Visit https://app.netlify.com/start and import the repo
|
|
7
|
+
3. Netlify auto-detects the build (`vite build` → `dist/client`)
|
|
8
|
+
4. Open **Site settings → Environment variables** and add anything from `.env.example` that needs a real value in production
|
|
9
|
+
5. Trigger the first deploy
|
|
10
|
+
|
|
11
|
+
Server functions and API routes run on Netlify Functions. For lower-latency request handling, see Netlify Edge Functions: https://docs.netlify.com/edge-functions/overview.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
## Deploy with Nitro
|
|
2
|
+
|
|
3
|
+
This project uses Nitro as a generic server adapter, so it can run on any Node-compatible host.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm run build
|
|
7
|
+
node dist/server/index.mjs
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
The build output is a self-contained Node server. To deploy, push the `dist/` directory to your host (Render, Fly.io, your own VPS, etc.) and run the server command above.
|
|
11
|
+
|
|
12
|
+
For host-specific presets (Vercel, Netlify, Cloudflare, AWS Lambda, etc.) and tuning, see https://v3.nitro.build/deploy.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
## Deploy to Railway
|
|
2
|
+
|
|
3
|
+
This project ships with `nixpacks.toml` so Railway detects the build automatically:
|
|
4
|
+
|
|
5
|
+
1. Push this repo to GitHub
|
|
6
|
+
2. Visit https://railway.com/new and create a project from your repo
|
|
7
|
+
3. In the **Variables** tab, add the entries from `.env.example` with their production values
|
|
8
|
+
4. Railway runs `vite build` and serves from `dist/client`
|
|
9
|
+
|
|
10
|
+
Need a database? Click **+ New** in your project to provision Postgres, MySQL, or Redis directly into the same environment — the connection string is auto-injected as `DATABASE_URL`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Solid-UI",
|
|
3
|
-
"description": "
|
|
3
|
+
"description": "Copy-paste accessible UI components for Solid (Tailwind + Radix-style primitives).",
|
|
4
4
|
"phase": "add-on",
|
|
5
5
|
"link": "https://ui.shadcn.com/",
|
|
6
6
|
"modes": ["file-router", "code-router"],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "T3Env",
|
|
3
|
-
"description": "
|
|
3
|
+
"description": "Validate process.env at build time (catch missing/wrong env vars before runtime).",
|
|
4
4
|
"phase": "add-on",
|
|
5
5
|
"link": "https://github.com/t3-oss/t3-env",
|
|
6
6
|
"type": "add-on",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
## Deploy to Cloudflare Workers
|
|
2
|
+
|
|
3
|
+
This project uses the Cloudflare Vite plugin (configured in `vite.config.ts`) and `wrangler.jsonc`:
|
|
4
|
+
|
|
5
|
+
1. Install Wrangler: `npm install -g wrangler`
|
|
6
|
+
2. Authenticate: `wrangler login`
|
|
7
|
+
3. Deploy: `npx wrangler deploy`
|
|
8
|
+
|
|
9
|
+
For production env vars, run `wrangler secret put MY_VAR` for each secret listed in `.env.example`. Public (non-secret) vars go in `wrangler.jsonc` under `vars`.
|
|
10
|
+
|
|
11
|
+
KV, D1, R2, and Durable Object bindings are configured in `wrangler.jsonc` — see https://developers.cloudflare.com/workers/wrangler/configuration/.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Cloudflare",
|
|
3
|
-
"description": "Cloudflare
|
|
3
|
+
"description": "Deploy to Cloudflare Workers (edge runtime, KV/D1/R2 bindings).",
|
|
4
4
|
"link": "https://developers.cloudflare.com/workers/vite-plugin/",
|
|
5
5
|
"phase": "add-on",
|
|
6
6
|
"modes": ["file-router", "code-router"],
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
## Deploy to Netlify
|
|
2
|
+
|
|
3
|
+
This project ships with `netlify.toml` configured for a Netlify site:
|
|
4
|
+
|
|
5
|
+
1. Push this repo to GitHub
|
|
6
|
+
2. Visit https://app.netlify.com/start and import the repo
|
|
7
|
+
3. Netlify auto-detects the build (`vite build` → `dist/client`)
|
|
8
|
+
4. Open **Site settings → Environment variables** and add anything from `.env.example` that needs a real value in production
|
|
9
|
+
5. Trigger the first deploy
|
|
10
|
+
|
|
11
|
+
Server functions and API routes run on Netlify Functions. For lower-latency request handling, see Netlify Edge Functions: https://docs.netlify.com/edge-functions/overview.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
## Deploy with Nitro
|
|
2
|
+
|
|
3
|
+
This project uses Nitro as a generic server adapter, so it can run on any Node-compatible host.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm run build
|
|
7
|
+
node dist/server/index.mjs
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
The build output is a self-contained Node server. To deploy, push the `dist/` directory to your host (Render, Fly.io, your own VPS, etc.) and run the server command above.
|
|
11
|
+
|
|
12
|
+
For host-specific presets (Vercel, Netlify, Cloudflare, AWS Lambda, etc.) and tuning, see https://v3.nitro.build/deploy.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
## Deploy to Railway
|
|
2
|
+
|
|
3
|
+
This project ships with `nixpacks.toml` so Railway detects the build automatically:
|
|
4
|
+
|
|
5
|
+
1. Push this repo to GitHub
|
|
6
|
+
2. Visit https://railway.com/new and create a project from your repo
|
|
7
|
+
3. In the **Variables** tab, add the entries from `.env.example` with their production values
|
|
8
|
+
4. Railway runs `vite build` and serves from `dist/client`
|
|
9
|
+
|
|
10
|
+
Need a database? Click **+ New** in your project to provision Postgres, MySQL, or Redis directly into the same environment — the connection string is auto-injected as `DATABASE_URL`.
|
package/src/index.ts
CHANGED
|
@@ -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', '--map'],
|
|
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
package/tests/create-app.test.ts
CHANGED
|
@@ -194,4 +194,99 @@ describe('createApp', () => {
|
|
|
194
194
|
|
|
195
195
|
expect(output.files['/src/components/demo-AIAssistant.tsx']).toBeDefined()
|
|
196
196
|
})
|
|
197
|
+
|
|
198
|
+
it('writes .env.example from add-on envVars metadata', async () => {
|
|
199
|
+
const { environment, output } = createMemoryEnvironment()
|
|
200
|
+
|
|
201
|
+
await createApp(environment, {
|
|
202
|
+
...simpleOptions,
|
|
203
|
+
chosenAddOns: [
|
|
204
|
+
{
|
|
205
|
+
id: 'fake-auth',
|
|
206
|
+
name: 'Fake Auth',
|
|
207
|
+
type: 'add-on',
|
|
208
|
+
phase: 'add-on',
|
|
209
|
+
packageAdditions: { dependencies: {}, devDependencies: {} },
|
|
210
|
+
routes: [],
|
|
211
|
+
integrations: [],
|
|
212
|
+
envVars: [
|
|
213
|
+
{
|
|
214
|
+
name: 'AUTH_SECRET',
|
|
215
|
+
description: 'Random secret used to sign sessions',
|
|
216
|
+
required: true,
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: 'AUTH_URL',
|
|
220
|
+
description: 'Base URL for auth callbacks',
|
|
221
|
+
required: false,
|
|
222
|
+
},
|
|
223
|
+
],
|
|
224
|
+
getFiles: () => [],
|
|
225
|
+
getFileContents: () => '',
|
|
226
|
+
getDeletedFiles: () => [],
|
|
227
|
+
} as unknown as AddOn,
|
|
228
|
+
],
|
|
229
|
+
} as Options)
|
|
230
|
+
|
|
231
|
+
const envExample = output.files['/.env.example']
|
|
232
|
+
expect(envExample).toBeDefined()
|
|
233
|
+
expect(envExample).toContain('# Fake Auth')
|
|
234
|
+
expect(envExample).toContain(
|
|
235
|
+
'# Random secret used to sign sessions (required)',
|
|
236
|
+
)
|
|
237
|
+
expect(envExample).toContain('AUTH_SECRET=')
|
|
238
|
+
expect(envExample).toContain('# Base URL for auth callbacks')
|
|
239
|
+
expect(envExample).toContain('AUTH_URL=')
|
|
240
|
+
})
|
|
241
|
+
|
|
242
|
+
it('does not write .env.example when no add-on declares envVars', async () => {
|
|
243
|
+
const { environment, output } = createMemoryEnvironment()
|
|
244
|
+
|
|
245
|
+
await createApp(environment, {
|
|
246
|
+
...simpleOptions,
|
|
247
|
+
chosenAddOns: [],
|
|
248
|
+
} as Options)
|
|
249
|
+
|
|
250
|
+
expect(output.files['/.env.example']).toBeUndefined()
|
|
251
|
+
})
|
|
252
|
+
|
|
253
|
+
it('dedupes env vars across add-ons in .env.example', async () => {
|
|
254
|
+
const { environment, output } = createMemoryEnvironment()
|
|
255
|
+
|
|
256
|
+
await createApp(environment, {
|
|
257
|
+
...simpleOptions,
|
|
258
|
+
chosenAddOns: [
|
|
259
|
+
{
|
|
260
|
+
id: 'addon-a',
|
|
261
|
+
name: 'Addon A',
|
|
262
|
+
type: 'add-on',
|
|
263
|
+
phase: 'add-on',
|
|
264
|
+
packageAdditions: { dependencies: {}, devDependencies: {} },
|
|
265
|
+
routes: [],
|
|
266
|
+
integrations: [],
|
|
267
|
+
envVars: [{ name: 'SHARED_KEY', required: true }],
|
|
268
|
+
getFiles: () => [],
|
|
269
|
+
getFileContents: () => '',
|
|
270
|
+
getDeletedFiles: () => [],
|
|
271
|
+
} as unknown as AddOn,
|
|
272
|
+
{
|
|
273
|
+
id: 'addon-b',
|
|
274
|
+
name: 'Addon B',
|
|
275
|
+
type: 'add-on',
|
|
276
|
+
phase: 'add-on',
|
|
277
|
+
packageAdditions: { dependencies: {}, devDependencies: {} },
|
|
278
|
+
routes: [],
|
|
279
|
+
integrations: [],
|
|
280
|
+
envVars: [{ name: 'SHARED_KEY', required: true }],
|
|
281
|
+
getFiles: () => [],
|
|
282
|
+
getFileContents: () => '',
|
|
283
|
+
getDeletedFiles: () => [],
|
|
284
|
+
} as unknown as AddOn,
|
|
285
|
+
],
|
|
286
|
+
} as Options)
|
|
287
|
+
|
|
288
|
+
const envExample = output.files['/.env.example'] || ''
|
|
289
|
+
const occurrences = envExample.match(/^SHARED_KEY=/gm) || []
|
|
290
|
+
expect(occurrences.length).toBe(1)
|
|
291
|
+
})
|
|
197
292
|
})
|