alchemy 0.69.0 → 0.69.1
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/bin/alchemy.js +14 -33
- package/bin/commands/init.ts +41 -55
- package/lib/cloudflare/bucket-object.d.ts +5 -0
- package/lib/cloudflare/bucket-object.d.ts.map +1 -1
- package/lib/cloudflare/bucket-object.js +1 -1
- package/lib/cloudflare/bucket-object.js.map +1 -1
- package/lib/cloudflare/bucket.d.ts +6 -3
- package/lib/cloudflare/bucket.d.ts.map +1 -1
- package/lib/cloudflare/bucket.js +60 -8
- package/lib/cloudflare/bucket.js.map +1 -1
- package/lib/cloudflare/container.js +1 -1
- package/lib/cloudflare/container.js.map +1 -1
- package/lib/cloudflare/miniflare/miniflare-worker-proxy.d.ts.map +1 -1
- package/lib/cloudflare/miniflare/miniflare-worker-proxy.js +44 -12
- package/lib/cloudflare/miniflare/miniflare-worker-proxy.js.map +1 -1
- package/lib/cloudflare/tanstack-start/plugin.d.ts +2 -15
- package/lib/cloudflare/tanstack-start/plugin.d.ts.map +1 -1
- package/lib/cloudflare/tanstack-start/plugin.js +5 -25
- package/lib/cloudflare/tanstack-start/plugin.js.map +1 -1
- package/lib/cloudflare/tanstack-start/tanstack-start.d.ts.map +1 -1
- package/lib/cloudflare/tanstack-start/tanstack-start.js +15 -4
- package/lib/cloudflare/tanstack-start/tanstack-start.js.map +1 -1
- package/lib/cloudflare/website.d.ts.map +1 -1
- package/lib/cloudflare/website.js +1 -0
- package/lib/cloudflare/website.js.map +1 -1
- package/lib/cloudflare/worker-metadata.d.ts +4 -1
- package/lib/cloudflare/worker-metadata.d.ts.map +1 -1
- package/lib/cloudflare/worker-metadata.js +2 -0
- package/lib/cloudflare/worker-metadata.js.map +1 -1
- package/lib/cloudflare/worker.d.ts +6 -0
- package/lib/cloudflare/worker.d.ts.map +1 -1
- package/lib/cloudflare/worker.js +1 -0
- package/lib/cloudflare/worker.js.map +1 -1
- package/lib/cloudflare/wrangler.json.d.ts +7 -1
- package/lib/cloudflare/wrangler.json.d.ts.map +1 -1
- package/lib/cloudflare/wrangler.json.js +9 -0
- package/lib/cloudflare/wrangler.json.js.map +1 -1
- package/lib/docker/api.d.ts +22 -1
- package/lib/docker/api.d.ts.map +1 -1
- package/lib/docker/api.js +64 -2
- package/lib/docker/api.js.map +1 -1
- package/lib/docker/container.d.ts +88 -0
- package/lib/docker/container.d.ts.map +1 -1
- package/lib/docker/container.js +36 -0
- package/lib/docker/container.js.map +1 -1
- package/package.json +1 -1
- package/src/cloudflare/bucket-object.ts +11 -1
- package/src/cloudflare/bucket.ts +72 -6
- package/src/cloudflare/container.ts +2 -2
- package/src/cloudflare/miniflare/miniflare-worker-proxy.ts +57 -13
- package/src/cloudflare/tanstack-start/plugin.ts +7 -28
- package/src/cloudflare/tanstack-start/tanstack-start.ts +15 -4
- package/src/cloudflare/website.ts +1 -0
- package/src/cloudflare/worker-metadata.ts +6 -1
- package/src/cloudflare/worker.ts +7 -0
- package/src/cloudflare/wrangler.json.ts +15 -1
- package/src/docker/api.ts +86 -2
- package/src/docker/container.ts +97 -0
- package/templates/tanstack-start/.cta.json +13 -0
- package/templates/tanstack-start/README.md +267 -49
- package/templates/tanstack-start/_gitignore +9 -18
- package/templates/tanstack-start/alchemy.run.ts +2 -2
- package/templates/tanstack-start/package.json +24 -19
- package/templates/tanstack-start/public/favicon.ico +0 -0
- package/templates/tanstack-start/public/logo192.png +0 -0
- package/templates/tanstack-start/public/logo512.png +0 -0
- package/templates/tanstack-start/public/manifest.json +25 -0
- package/templates/tanstack-start/public/robots.txt +3 -0
- package/templates/tanstack-start/src/components/Header.tsx +21 -0
- package/templates/tanstack-start/src/logo.svg +12 -0
- package/templates/tanstack-start/src/router.tsx +7 -16
- package/templates/tanstack-start/src/routes/__root.tsx +13 -114
- package/templates/tanstack-start/src/routes/api.demo-names.ts +15 -0
- package/templates/tanstack-start/src/routes/demo.start.api-request.tsx +44 -0
- package/templates/tanstack-start/src/routes/demo.start.server-funcs.tsx +97 -0
- package/templates/tanstack-start/src/routes/index.tsx +31 -4
- package/templates/tanstack-start/src/styles.css +15 -0
- package/templates/tanstack-start/tsconfig.json +19 -22
- package/templates/tanstack-start/types/env.d.ts +2 -2
- package/templates/tanstack-start/vite.config.ts +16 -25
- package/workers/tunnel-proxy.js +1 -1
- package/templates/tanstack-start/_prettierignore +0 -4
- package/templates/tanstack-start/public/android-chrome-192x192.png +0 -0
- package/templates/tanstack-start/public/android-chrome-512x512.png +0 -0
- package/templates/tanstack-start/public/apple-touch-icon.png +0 -0
- package/templates/tanstack-start/public/favicon-16x16.png +0 -0
- package/templates/tanstack-start/public/favicon-32x32.png +0 -0
- package/templates/tanstack-start/public/favicon.png +0 -0
- package/templates/tanstack-start/public/site.webmanifest +0 -19
- package/templates/tanstack-start/src/components/DefaultCatchBoundary.tsx +0 -53
- package/templates/tanstack-start/src/components/NotFound.tsx +0 -25
- package/templates/tanstack-start/src/components/PostError.tsx +0 -5
- package/templates/tanstack-start/src/components/UserError.tsx +0 -5
- package/templates/tanstack-start/src/routes/_pathlessLayout/_nested-layout/route-a.tsx +0 -10
- package/templates/tanstack-start/src/routes/_pathlessLayout/_nested-layout/route-b.tsx +0 -10
- package/templates/tanstack-start/src/routes/_pathlessLayout/_nested-layout.tsx +0 -34
- package/templates/tanstack-start/src/routes/_pathlessLayout.tsx +0 -16
- package/templates/tanstack-start/src/routes/api/users.$userId.ts +0 -28
- package/templates/tanstack-start/src/routes/api/users.ts +0 -59
- package/templates/tanstack-start/src/routes/customScript[.]js.ts +0 -10
- package/templates/tanstack-start/src/routes/deferred.tsx +0 -62
- package/templates/tanstack-start/src/routes/posts.$postId.tsx +0 -34
- package/templates/tanstack-start/src/routes/posts.index.tsx +0 -8
- package/templates/tanstack-start/src/routes/posts.tsx +0 -38
- package/templates/tanstack-start/src/routes/posts_.$postId.deep.tsx +0 -29
- package/templates/tanstack-start/src/routes/redirect.tsx +0 -9
- package/templates/tanstack-start/src/routes/users.$userId.tsx +0 -44
- package/templates/tanstack-start/src/routes/users.index.tsx +0 -18
- package/templates/tanstack-start/src/routes/users.tsx +0 -49
- package/templates/tanstack-start/src/styles/app.css +0 -12
- package/templates/tanstack-start/src/utils/loggingMiddleware.tsx +0 -41
- package/templates/tanstack-start/src/utils/posts.tsx +0 -40
- package/templates/tanstack-start/src/utils/seo.ts +0 -33
- package/templates/tanstack-start/src/utils/users.tsx +0 -5
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Scripts,
|
|
7
|
-
createRootRoute,
|
|
8
|
-
} from '@tanstack/react-router'
|
|
9
|
-
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
|
|
10
|
-
import * as React from 'react'
|
|
11
|
-
import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
|
|
12
|
-
import { NotFound } from '~/components/NotFound'
|
|
13
|
-
import appCss from '~/styles/app.css?url'
|
|
14
|
-
import { seo } from '~/utils/seo'
|
|
1
|
+
import { HeadContent, Scripts, createRootRoute } from '@tanstack/react-router'
|
|
2
|
+
|
|
3
|
+
import Header from '../components/Header'
|
|
4
|
+
|
|
5
|
+
import appCss from '../styles.css?url'
|
|
15
6
|
|
|
16
7
|
export const Route = createRootRoute({
|
|
17
8
|
head: () => ({
|
|
@@ -23,122 +14,30 @@ export const Route = createRootRoute({
|
|
|
23
14
|
name: 'viewport',
|
|
24
15
|
content: 'width=device-width, initial-scale=1',
|
|
25
16
|
},
|
|
26
|
-
...seo({
|
|
27
|
-
title:
|
|
28
|
-
'TanStack Start | Type-Safe, Client-First, Full-Stack React Framework',
|
|
29
|
-
description: `TanStack Start is a type-safe, client-first, full-stack React framework. `,
|
|
30
|
-
}),
|
|
31
|
-
],
|
|
32
|
-
links: [
|
|
33
|
-
{ rel: 'stylesheet', href: appCss },
|
|
34
|
-
{
|
|
35
|
-
rel: 'apple-touch-icon',
|
|
36
|
-
sizes: '180x180',
|
|
37
|
-
href: '/apple-touch-icon.png',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
rel: 'icon',
|
|
41
|
-
type: 'image/png',
|
|
42
|
-
sizes: '32x32',
|
|
43
|
-
href: '/favicon-32x32.png',
|
|
44
|
-
},
|
|
45
17
|
{
|
|
46
|
-
|
|
47
|
-
type: 'image/png',
|
|
48
|
-
sizes: '16x16',
|
|
49
|
-
href: '/favicon-16x16.png',
|
|
18
|
+
title: 'TanStack Start Starter',
|
|
50
19
|
},
|
|
51
|
-
{ rel: 'manifest', href: '/site.webmanifest', color: '#fffff' },
|
|
52
|
-
{ rel: 'icon', href: '/favicon.ico' },
|
|
53
20
|
],
|
|
54
|
-
|
|
21
|
+
links: [
|
|
55
22
|
{
|
|
56
|
-
|
|
57
|
-
|
|
23
|
+
rel: 'stylesheet',
|
|
24
|
+
href: appCss,
|
|
58
25
|
},
|
|
59
26
|
],
|
|
60
27
|
}),
|
|
61
|
-
errorComponent: (props) => {
|
|
62
|
-
return (
|
|
63
|
-
<RootDocument>
|
|
64
|
-
<DefaultCatchBoundary {...props} />
|
|
65
|
-
</RootDocument>
|
|
66
|
-
)
|
|
67
|
-
},
|
|
68
|
-
notFoundComponent: () => <NotFound />,
|
|
69
|
-
component: RootComponent,
|
|
70
|
-
})
|
|
71
28
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
<RootDocument>
|
|
75
|
-
<Outlet />
|
|
76
|
-
</RootDocument>
|
|
77
|
-
)
|
|
78
|
-
}
|
|
29
|
+
shellComponent: RootDocument,
|
|
30
|
+
})
|
|
79
31
|
|
|
80
32
|
function RootDocument({ children }: { children: React.ReactNode }) {
|
|
81
33
|
return (
|
|
82
|
-
<html>
|
|
34
|
+
<html lang="en">
|
|
83
35
|
<head>
|
|
84
36
|
<HeadContent />
|
|
85
37
|
</head>
|
|
86
38
|
<body>
|
|
87
|
-
<
|
|
88
|
-
<Link
|
|
89
|
-
to="/"
|
|
90
|
-
activeProps={{
|
|
91
|
-
className: 'font-bold',
|
|
92
|
-
}}
|
|
93
|
-
activeOptions={{ exact: true }}
|
|
94
|
-
>
|
|
95
|
-
Home
|
|
96
|
-
</Link>{' '}
|
|
97
|
-
<Link
|
|
98
|
-
to="/posts"
|
|
99
|
-
activeProps={{
|
|
100
|
-
className: 'font-bold',
|
|
101
|
-
}}
|
|
102
|
-
>
|
|
103
|
-
Posts
|
|
104
|
-
</Link>{' '}
|
|
105
|
-
<Link
|
|
106
|
-
to="/users"
|
|
107
|
-
activeProps={{
|
|
108
|
-
className: 'font-bold',
|
|
109
|
-
}}
|
|
110
|
-
>
|
|
111
|
-
Users
|
|
112
|
-
</Link>{' '}
|
|
113
|
-
<Link
|
|
114
|
-
to="/route-a"
|
|
115
|
-
activeProps={{
|
|
116
|
-
className: 'font-bold',
|
|
117
|
-
}}
|
|
118
|
-
>
|
|
119
|
-
Pathless Layout
|
|
120
|
-
</Link>{' '}
|
|
121
|
-
<Link
|
|
122
|
-
to="/deferred"
|
|
123
|
-
activeProps={{
|
|
124
|
-
className: 'font-bold',
|
|
125
|
-
}}
|
|
126
|
-
>
|
|
127
|
-
Deferred
|
|
128
|
-
</Link>{' '}
|
|
129
|
-
<Link
|
|
130
|
-
// @ts-expect-error
|
|
131
|
-
to="/this-route-does-not-exist"
|
|
132
|
-
activeProps={{
|
|
133
|
-
className: 'font-bold',
|
|
134
|
-
}}
|
|
135
|
-
>
|
|
136
|
-
This Route Does Not Exist
|
|
137
|
-
</Link>
|
|
138
|
-
</div>
|
|
139
|
-
<hr />
|
|
39
|
+
<Header />
|
|
140
40
|
{children}
|
|
141
|
-
<TanStackRouterDevtools position="bottom-right" />
|
|
142
41
|
<Scripts />
|
|
143
42
|
</body>
|
|
144
43
|
</html>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createFileRoute } from '@tanstack/react-router'
|
|
2
|
+
|
|
3
|
+
export const Route = createFileRoute('/api/demo-names')({
|
|
4
|
+
server: {
|
|
5
|
+
handlers: {
|
|
6
|
+
GET: () => {
|
|
7
|
+
return new Response(JSON.stringify(['Alice', 'Bob', 'Charlie']), {
|
|
8
|
+
headers: {
|
|
9
|
+
'Content-Type': 'application/json',
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
})
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { createFileRoute } from '@tanstack/react-router'
|
|
4
|
+
|
|
5
|
+
function getNames() {
|
|
6
|
+
return fetch('/api/demo-names').then((res) => res.json())
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const Route = createFileRoute('/demo/start/api-request')({
|
|
10
|
+
component: Home,
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
function Home() {
|
|
14
|
+
const [names, setNames] = useState<Array<string>>([])
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
getNames().then(setNames)
|
|
18
|
+
}, [])
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div
|
|
22
|
+
className="flex items-center justify-center min-h-screen p-4 text-white"
|
|
23
|
+
style={{
|
|
24
|
+
backgroundColor: '#000',
|
|
25
|
+
backgroundImage:
|
|
26
|
+
'radial-gradient(ellipse 60% 60% at 0% 100%, #444 0%, #222 60%, #000 100%)',
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
<div className="w-full max-w-2xl p-8 rounded-xl backdrop-blur-md bg-black/50 shadow-xl border-8 border-black/10">
|
|
30
|
+
<h1 className="text-2xl mb-4">Start API Request Demo - Names List</h1>
|
|
31
|
+
<ul className="mb-4 space-y-2">
|
|
32
|
+
{names.map((name) => (
|
|
33
|
+
<li
|
|
34
|
+
key={name}
|
|
35
|
+
className="bg-white/10 border border-white/20 rounded-lg p-3 backdrop-blur-sm shadow-md"
|
|
36
|
+
>
|
|
37
|
+
<span className="text-lg text-white">{name}</span>
|
|
38
|
+
</li>
|
|
39
|
+
))}
|
|
40
|
+
</ul>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import { useCallback, useState } from 'react'
|
|
3
|
+
import { createFileRoute, useRouter } from '@tanstack/react-router'
|
|
4
|
+
import { createServerFn } from '@tanstack/react-start'
|
|
5
|
+
|
|
6
|
+
const filePath = 'todos.json'
|
|
7
|
+
|
|
8
|
+
async function readTodos() {
|
|
9
|
+
return JSON.parse(
|
|
10
|
+
await fs.promises.readFile(filePath, 'utf-8').catch(() =>
|
|
11
|
+
JSON.stringify(
|
|
12
|
+
[
|
|
13
|
+
{ id: 1, name: 'Get groceries' },
|
|
14
|
+
{ id: 2, name: 'Buy a new phone' },
|
|
15
|
+
],
|
|
16
|
+
null,
|
|
17
|
+
2,
|
|
18
|
+
),
|
|
19
|
+
),
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const getTodos = createServerFn({
|
|
24
|
+
method: 'GET',
|
|
25
|
+
}).handler(async () => await readTodos())
|
|
26
|
+
|
|
27
|
+
const addTodo = createServerFn({ method: 'POST' })
|
|
28
|
+
.inputValidator((d: string) => d)
|
|
29
|
+
.handler(async ({ data }) => {
|
|
30
|
+
const todos = await readTodos()
|
|
31
|
+
todos.push({ id: todos.length + 1, name: data })
|
|
32
|
+
await fs.promises.writeFile(filePath, JSON.stringify(todos, null, 2))
|
|
33
|
+
return todos
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
export const Route = createFileRoute('/demo/start/server-funcs')({
|
|
37
|
+
component: Home,
|
|
38
|
+
loader: async () => await getTodos(),
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
function Home() {
|
|
42
|
+
const router = useRouter()
|
|
43
|
+
let todos = Route.useLoaderData()
|
|
44
|
+
|
|
45
|
+
const [todo, setTodo] = useState('')
|
|
46
|
+
|
|
47
|
+
const submitTodo = useCallback(async () => {
|
|
48
|
+
todos = await addTodo({ data: todo })
|
|
49
|
+
setTodo('')
|
|
50
|
+
router.invalidate()
|
|
51
|
+
}, [addTodo, todo])
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div
|
|
55
|
+
className="flex items-center justify-center min-h-screen bg-gradient-to-br from-zinc-800 to-black p-4 text-white"
|
|
56
|
+
style={{
|
|
57
|
+
backgroundImage:
|
|
58
|
+
'radial-gradient(50% 50% at 20% 60%, #23272a 0%, #18181b 50%, #000000 100%)',
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
<div className="w-full max-w-2xl p-8 rounded-xl backdrop-blur-md bg-black/50 shadow-xl border-8 border-black/10">
|
|
62
|
+
<h1 className="text-2xl mb-4">Start Server Functions - Todo Example</h1>
|
|
63
|
+
<ul className="mb-4 space-y-2">
|
|
64
|
+
{todos?.map((t) => (
|
|
65
|
+
<li
|
|
66
|
+
key={t.id}
|
|
67
|
+
className="bg-white/10 border border-white/20 rounded-lg p-3 backdrop-blur-sm shadow-md"
|
|
68
|
+
>
|
|
69
|
+
<span className="text-lg text-white">{t.name}</span>
|
|
70
|
+
</li>
|
|
71
|
+
))}
|
|
72
|
+
</ul>
|
|
73
|
+
<div className="flex flex-col gap-2">
|
|
74
|
+
<input
|
|
75
|
+
type="text"
|
|
76
|
+
value={todo}
|
|
77
|
+
onChange={(e) => setTodo(e.target.value)}
|
|
78
|
+
onKeyDown={(e) => {
|
|
79
|
+
if (e.key === 'Enter') {
|
|
80
|
+
submitTodo()
|
|
81
|
+
}
|
|
82
|
+
}}
|
|
83
|
+
placeholder="Enter a new todo..."
|
|
84
|
+
className="w-full px-4 py-3 rounded-lg border border-white/20 bg-white/10 backdrop-blur-sm text-white placeholder-white/60 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent"
|
|
85
|
+
/>
|
|
86
|
+
<button
|
|
87
|
+
disabled={todo.trim().length === 0}
|
|
88
|
+
onClick={submitTodo}
|
|
89
|
+
className="bg-blue-500 hover:bg-blue-600 disabled:bg-blue-500/50 disabled:cursor-not-allowed text-white font-bold py-3 px-4 rounded-lg transition-colors"
|
|
90
|
+
>
|
|
91
|
+
Add todo
|
|
92
|
+
</button>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
import { createFileRoute } from '@tanstack/react-router'
|
|
2
|
+
import logo from '../logo.svg'
|
|
3
|
+
|
|
2
4
|
export const Route = createFileRoute('/')({
|
|
3
|
-
component:
|
|
5
|
+
component: App,
|
|
4
6
|
})
|
|
5
7
|
|
|
6
|
-
function
|
|
8
|
+
function App() {
|
|
7
9
|
return (
|
|
8
|
-
<div className="
|
|
9
|
-
<
|
|
10
|
+
<div className="text-center">
|
|
11
|
+
<header className="min-h-screen flex flex-col items-center justify-center bg-[#282c34] text-white text-[calc(10px+2vmin)]">
|
|
12
|
+
<img
|
|
13
|
+
src={logo}
|
|
14
|
+
className="h-[40vmin] pointer-events-none animate-[spin_20s_linear_infinite]"
|
|
15
|
+
alt="logo"
|
|
16
|
+
/>
|
|
17
|
+
<p>
|
|
18
|
+
Edit <code>src/routes/index.tsx</code> and save to reload.
|
|
19
|
+
</p>
|
|
20
|
+
<a
|
|
21
|
+
className="text-[#61dafb] hover:underline"
|
|
22
|
+
href="https://reactjs.org"
|
|
23
|
+
target="_blank"
|
|
24
|
+
rel="noopener noreferrer"
|
|
25
|
+
>
|
|
26
|
+
Learn React
|
|
27
|
+
</a>
|
|
28
|
+
<a
|
|
29
|
+
className="text-[#61dafb] hover:underline"
|
|
30
|
+
href="https://tanstack.com"
|
|
31
|
+
target="_blank"
|
|
32
|
+
rel="noopener noreferrer"
|
|
33
|
+
>
|
|
34
|
+
Learn TanStack
|
|
35
|
+
</a>
|
|
36
|
+
</header>
|
|
10
37
|
</div>
|
|
11
38
|
)
|
|
12
39
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
body {
|
|
4
|
+
@apply m-0;
|
|
5
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
|
|
6
|
+
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
|
|
7
|
+
sans-serif;
|
|
8
|
+
-webkit-font-smoothing: antialiased;
|
|
9
|
+
-moz-osx-font-smoothing: grayscale;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
code {
|
|
13
|
+
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
|
14
|
+
monospace;
|
|
15
|
+
}
|
|
@@ -1,31 +1,28 @@
|
|
|
1
1
|
{
|
|
2
|
-
"include": [
|
|
3
|
-
"alchemy.run.ts",
|
|
4
|
-
"types/**/*.ts",
|
|
5
|
-
"**/*.ts",
|
|
6
|
-
"**/*.tsx"
|
|
7
|
-
],
|
|
2
|
+
"include": ["**/*.ts", "**/*.tsx"],
|
|
8
3
|
"compilerOptions": {
|
|
9
|
-
"
|
|
10
|
-
"esModuleInterop": true,
|
|
4
|
+
"target": "ES2022",
|
|
11
5
|
"jsx": "react-jsx",
|
|
12
6
|
"module": "ESNext",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
8
|
+
"types": ["vite/client", "@cloudflare/workers-types"],
|
|
9
|
+
|
|
10
|
+
/* Bundler mode */
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"verbatimModuleSyntax": false,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
|
|
16
|
+
/* Linting */
|
|
17
17
|
"skipLibCheck": true,
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
"noUncheckedSideEffectImports": true,
|
|
21
23
|
"baseUrl": ".",
|
|
22
24
|
"paths": {
|
|
23
|
-
"
|
|
24
|
-
}
|
|
25
|
-
"noEmit": true,
|
|
26
|
-
"types": [
|
|
27
|
-
"@cloudflare/workers-types",
|
|
28
|
-
"./types/env.d.ts"
|
|
29
|
-
]
|
|
25
|
+
"@/*": ["./src/*"],
|
|
26
|
+
}
|
|
30
27
|
}
|
|
31
28
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// This file infers types for the cloudflare:workers environment from your Alchemy Worker.
|
|
2
2
|
// @see https://alchemy.run/concepts/bindings/#type-safe-bindings
|
|
3
3
|
|
|
4
|
-
import type {
|
|
4
|
+
import type { website } from "../alchemy.run.ts";
|
|
5
5
|
|
|
6
|
-
export type CloudflareEnv = typeof
|
|
6
|
+
export type CloudflareEnv = typeof website.Env;
|
|
7
7
|
|
|
8
8
|
declare global {
|
|
9
9
|
type Env = CloudflareEnv;
|
|
@@ -1,30 +1,21 @@
|
|
|
1
|
-
import tailwindcss from
|
|
2
|
-
import { tanstackStart } from
|
|
3
|
-
import viteReact from
|
|
4
|
-
import alchemy from
|
|
5
|
-
import { defineConfig, PluginOption } from
|
|
6
|
-
import
|
|
1
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
2
|
+
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
|
|
3
|
+
import viteReact from '@vitejs/plugin-react'
|
|
4
|
+
import alchemy from 'alchemy/cloudflare/tanstack-start'
|
|
5
|
+
import { defineConfig, type PluginOption } from 'vite'
|
|
6
|
+
import viteTsConfigPaths from 'vite-tsconfig-paths'
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
server: {
|
|
10
|
-
port: 3000,
|
|
11
|
-
},
|
|
12
|
-
build: {
|
|
13
|
-
target: "esnext",
|
|
14
|
-
rollupOptions: {
|
|
15
|
-
external: ["node:async_hooks", "cloudflare:workers"],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
8
|
+
const config = defineConfig({
|
|
18
9
|
plugins: [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
projects: ["./tsconfig.json"],
|
|
23
|
-
}),
|
|
24
|
-
tanstackStart({
|
|
25
|
-
target: "cloudflare-module",
|
|
26
|
-
customViteReactPlugin: true,
|
|
10
|
+
// this is the plugin that enables path aliases
|
|
11
|
+
viteTsConfigPaths({
|
|
12
|
+
projects: ['./tsconfig.json'],
|
|
27
13
|
}),
|
|
14
|
+
tailwindcss(),
|
|
15
|
+
alchemy() as PluginOption,
|
|
16
|
+
tanstackStart(),
|
|
28
17
|
viteReact(),
|
|
29
18
|
],
|
|
30
|
-
})
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
export default config
|
package/workers/tunnel-proxy.js
CHANGED
|
@@ -34,7 +34,7 @@ var h={async fetch(e,r){let n=new URL(e.url);n.host=r.TUNNEL_HOST;let l=new Head
|
|
|
34
34
|
Alchemy</a>.</p>
|
|
35
35
|
</div>
|
|
36
36
|
<div class="bg-slate-200 px-5 py-3 flex flex-col w-full max-w-lg">
|
|
37
|
-
<p class="text-sm text-slate-500">Alchemy 0.69.
|
|
37
|
+
<p class="text-sm text-slate-500">Alchemy 0.69.1</p>
|
|
38
38
|
</div>
|
|
39
39
|
</div>
|
|
40
40
|
</body>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "",
|
|
3
|
-
"short_name": "",
|
|
4
|
-
"icons": [
|
|
5
|
-
{
|
|
6
|
-
"src": "/android-chrome-192x192.png",
|
|
7
|
-
"sizes": "192x192",
|
|
8
|
-
"type": "image/png"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"src": "/android-chrome-512x512.png",
|
|
12
|
-
"sizes": "512x512",
|
|
13
|
-
"type": "image/png"
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"theme_color": "#ffffff",
|
|
17
|
-
"background_color": "#ffffff",
|
|
18
|
-
"display": "standalone"
|
|
19
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ErrorComponent,
|
|
3
|
-
Link,
|
|
4
|
-
rootRouteId,
|
|
5
|
-
useMatch,
|
|
6
|
-
useRouter,
|
|
7
|
-
} from '@tanstack/react-router'
|
|
8
|
-
import type { ErrorComponentProps } from '@tanstack/react-router'
|
|
9
|
-
|
|
10
|
-
export function DefaultCatchBoundary({ error }: ErrorComponentProps) {
|
|
11
|
-
const router = useRouter()
|
|
12
|
-
const isRoot = useMatch({
|
|
13
|
-
strict: false,
|
|
14
|
-
select: (state) => state.id === rootRouteId,
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
console.error('DefaultCatchBoundary Error:', error)
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<div className="min-w-0 flex-1 p-4 flex flex-col items-center justify-center gap-6">
|
|
21
|
-
<ErrorComponent error={error} />
|
|
22
|
-
<div className="flex gap-2 items-center flex-wrap">
|
|
23
|
-
<button
|
|
24
|
-
onClick={() => {
|
|
25
|
-
router.invalidate()
|
|
26
|
-
}}
|
|
27
|
-
className={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded text-white uppercase font-extrabold`}
|
|
28
|
-
>
|
|
29
|
-
Try Again
|
|
30
|
-
</button>
|
|
31
|
-
{isRoot ? (
|
|
32
|
-
<Link
|
|
33
|
-
to="/"
|
|
34
|
-
className={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded text-white uppercase font-extrabold`}
|
|
35
|
-
>
|
|
36
|
-
Home
|
|
37
|
-
</Link>
|
|
38
|
-
) : (
|
|
39
|
-
<Link
|
|
40
|
-
to="/"
|
|
41
|
-
className={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded text-white uppercase font-extrabold`}
|
|
42
|
-
onClick={(e) => {
|
|
43
|
-
e.preventDefault()
|
|
44
|
-
window.history.back()
|
|
45
|
-
}}
|
|
46
|
-
>
|
|
47
|
-
Go Back
|
|
48
|
-
</Link>
|
|
49
|
-
)}
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
)
|
|
53
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Link } from '@tanstack/react-router'
|
|
2
|
-
|
|
3
|
-
export function NotFound({ children }: { children?: any }) {
|
|
4
|
-
return (
|
|
5
|
-
<div className="space-y-2 p-2">
|
|
6
|
-
<div className="text-gray-600 dark:text-gray-400">
|
|
7
|
-
{children || <p>The page you are looking for does not exist.</p>}
|
|
8
|
-
</div>
|
|
9
|
-
<p className="flex items-center gap-2 flex-wrap">
|
|
10
|
-
<button
|
|
11
|
-
onClick={() => window.history.back()}
|
|
12
|
-
className="bg-emerald-500 text-white px-2 py-1 rounded uppercase font-black text-sm"
|
|
13
|
-
>
|
|
14
|
-
Go back
|
|
15
|
-
</button>
|
|
16
|
-
<Link
|
|
17
|
-
to="/"
|
|
18
|
-
className="bg-cyan-600 text-white px-2 py-1 rounded uppercase font-black text-sm"
|
|
19
|
-
>
|
|
20
|
-
Start Over
|
|
21
|
-
</Link>
|
|
22
|
-
</p>
|
|
23
|
-
</div>
|
|
24
|
-
)
|
|
25
|
-
}
|