Skip to content

Commit 1156729

Browse files
committed
feat: moving to hosting provider options
1 parent 300518e commit 1156729

Some content is hidden

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

54 files changed

+457
-94
lines changed

frameworks/react-cra/ADD-ON-AUTHORING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,32 @@ Configuration in `info.json`:
136136
]
137137
```
138138

139+
## vite-plugin
140+
141+
The code is integrated into `src/vite.config.ts`
142+
143+
### Examples
144+
145+
Code in `assets/vite-plugins/netlify.ts`:
146+
147+
```ts
148+
import netlify from '@netlify/vite-plugin-tanstack-start'
149+
150+
export default netlify()
151+
```
152+
153+
Configuration in `info.json`:
154+
155+
```json
156+
"integrations": [
157+
{
158+
"type": "vite-plugin",
159+
"jsName": "netlify",
160+
"path": "vite-plugins/netlify.ts"
161+
},
162+
]
163+
```
164+
139165
# Routes
140166

141167
If your add-on creates routes you need to specify those in the `info.json` file.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import postgresPlugin from '@neondatabase/vite-plugin-postgres'
2+
3+
export default postgresPlugin({
4+
seed: {
5+
type: 'sql-script',
6+
path: 'db/init.sql',
7+
},
8+
referrer: 'create-tanstack',
9+
dotEnvKey: 'VITE_DATABASE_URL',
10+
})

frameworks/react-cra/add-ons/neon/info.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,12 @@
1313
"jsName": "NeonDemo"
1414
}
1515
],
16+
"integrations": [
17+
{
18+
"type": "vite-plugin",
19+
"jsName": "neon",
20+
"path": "vite-plugins/neon.ts"
21+
}
22+
],
1623
"dependsOn": ["start"]
1724
}

frameworks/react-cra/add-ons/netlify/README.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

frameworks/react-cra/add-ons/start/assets/vite.config.ts.ejs

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,19 @@ import viteTsConfigPaths from 'vite-tsconfig-paths'<% if (tailwind) { %>
55
import tailwindcss from "@tailwindcss/vite"
66
<% } %><% if (addOnEnabled.sentry) { %>
77
import { wrapVinxiConfigWithSentry } from "@sentry/tanstackstart-react";
8-
<% } %><% if (addOnEnabled.neon) { %>
9-
import postgresPlugin from "@neondatabase/vite-plugin-postgres";
8+
<% } %><% for(const integration of integrations.filter(i => i.type === 'vite-plugin')) { %>import <%= integration.jsName %> from "<%= relativePath(integration.path) %>";
109
<% } %>
1110
const config = defineConfig({
12-
plugins: [
13-
<% if (addOnEnabled.neon) { %>
14-
postgresPlugin({
15-
seed: {
16-
type: "sql-script",
17-
path: "db/init.sql"
18-
},
19-
referrer: 'create-tanstack',
20-
dotEnvKey: 'VITE_DATABASE_URL',
21-
}),
22-
<% } %>
23-
// this is the plugin that enables path aliases
24-
viteTsConfigPaths({
25-
projects: ['./tsconfig.json'],
26-
}),
27-
<% if (tailwind) { %>tailwindcss(),<% } %>
28-
tanstackStart(),
29-
viteReact(),
30-
],
11+
plugins: [<% for(const integration of integrations.filter(i => i.type === 'vite-plugin')) { %>
12+
<%= integration.jsName %>,<% } %>
13+
// this is the plugin that enables path aliases
14+
viteTsConfigPaths({
15+
projects: ['./tsconfig.json'],
16+
}),
17+
<% if (tailwind) { %>tailwindcss(),<% } %>
18+
tanstackStart(),
19+
viteReact(),
20+
],
3121
})
3222

3323
<% if (addOnEnabled.sentry) { %>

frameworks/react-cra/add-ons/start/info.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"link": "https://tanstack.com/start/latest",
66
"modes": ["file-router"],
77
"type": "add-on",
8-
"warning": "TanStack Start is not yet at 1.0 and may change significantly or not be compatible with other add-ons.\nMigrating to Start might require deleting node_modules and re-installing.",
98
"routes": [
109
{
1110
"url": "/demo/start/server-funcs",
@@ -20,10 +19,6 @@
2019
"jsName": "StartApiRequestDemo"
2120
}
2221
],
23-
"deletedFiles": [
24-
"./index.html",
25-
"./src/main.tsx",
26-
"./src/App.css"
27-
],
22+
"deletedFiles": ["./index.html", "./src/main.tsx", "./src/App.css"],
2823
"addOnSpecialSteps": ["rimraf-node-modules"]
2924
}

frameworks/react-cra/add-ons/start/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"scripts": {
33
"dev": "vite dev --port 3000",
4-
"build": "vite build",
5-
"start": "node .output/server/index.mjs"
4+
"build": "vite build"
65
},
76
"dependencies": {
87
"@tanstack/react-router-ssr-query": "^1.131.7",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { cloudflare } from '@cloudflare/vite-plugin'
2+
3+
export default cloudflare({ viteEnvironment: { name: 'ssr' } })
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "node_modules/wrangler/config-schema.json",
3+
"name": "tanstack-start-app",
4+
"compatibility_date": "2025-09-02",
5+
"compatibility_flags": ["nodejs_compat"],
6+
"main": "@tanstack/react-start/server-entry",
7+
"vars": {
8+
"MY_VAR": "Hello from Cloudflare"
9+
}
10+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "Cloudflare",
3+
"description": "Cloudflare deployment setup",
4+
"link": "https://developers.cloudflare.com/workers/vite-plugin/",
5+
"phase": "add-on",
6+
"modes": ["file-router", "code-router"],
7+
"type": "host",
8+
"integrations": [
9+
{
10+
"type": "vite-plugin",
11+
"jsName": "cloudflare",
12+
"path": "vite-plugins/cloudflare.ts"
13+
}
14+
]
15+
}

0 commit comments

Comments
 (0)