alchemy 0.37.2 → 0.38.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/bin/alchemy.mjs +44306 -48055
- package/bin/alchemy.ts +80 -85
- package/bin/commands/create.ts +263 -0
- package/bin/constants.ts +13 -0
- package/bin/errors.ts +11 -0
- package/bin/services/dependencies.ts +47 -0
- package/bin/services/get-package-version.ts +11 -0
- package/bin/services/package-manager.ts +113 -0
- package/bin/services/template-manager.ts +137 -0
- package/bin/types.ts +83 -0
- package/lib/alchemy.d.ts.map +1 -1
- package/lib/alchemy.js +12 -3
- package/lib/alchemy.js.map +1 -1
- package/lib/apply.d.ts +2 -0
- package/lib/apply.d.ts.map +1 -1
- package/lib/apply.js +47 -12
- package/lib/apply.js.map +1 -1
- package/lib/build-date.d.ts +6 -0
- package/lib/build-date.d.ts.map +1 -0
- package/lib/build-date.js +8 -0
- package/lib/build-date.js.map +1 -0
- package/lib/cloudflare/api.d.ts.map +1 -1
- package/lib/cloudflare/api.js +2 -1
- package/lib/cloudflare/api.js.map +1 -1
- package/lib/cloudflare/pipeline.d.ts +1 -1
- package/lib/cloudflare/pipeline.d.ts.map +1 -1
- package/lib/cloudflare/pipeline.js +6 -1
- package/lib/cloudflare/pipeline.js.map +1 -1
- package/lib/cloudflare/worker-stub.d.ts +23 -2
- package/lib/cloudflare/worker-stub.d.ts.map +1 -1
- package/lib/cloudflare/worker-stub.js +16 -2
- package/lib/cloudflare/worker-stub.js.map +1 -1
- package/lib/cloudflare/worker.d.ts +4 -3
- package/lib/cloudflare/worker.d.ts.map +1 -1
- package/lib/cloudflare/worker.js +2 -1
- package/lib/cloudflare/worker.js.map +1 -1
- package/lib/context.d.ts +2 -2
- package/lib/context.d.ts.map +1 -1
- package/lib/destroy.d.ts +8 -2
- package/lib/destroy.d.ts.map +1 -1
- package/lib/destroy.js +19 -5
- package/lib/destroy.js.map +1 -1
- package/lib/scope.d.ts +26 -4
- package/lib/scope.d.ts.map +1 -1
- package/lib/scope.js +104 -9
- package/lib/scope.js.map +1 -1
- package/lib/sentry/project.js +1 -1
- package/lib/sentry/project.js.map +1 -1
- package/lib/util/logger.js +1 -1
- package/lib/util/logger.js.map +1 -1
- package/lib/util/mutex.d.ts +9 -0
- package/lib/util/mutex.d.ts.map +1 -0
- package/lib/util/mutex.js +35 -0
- package/lib/util/mutex.js.map +1 -0
- package/package.json +16 -6
- package/src/alchemy.ts +17 -5
- package/src/apply.ts +67 -17
- package/src/build-date.ts +8 -0
- package/src/cloudflare/api.ts +2 -1
- package/src/cloudflare/pipeline.ts +6 -0
- package/src/cloudflare/worker-stub.ts +31 -2
- package/src/cloudflare/worker.ts +4 -3
- package/src/context.ts +2 -2
- package/src/destroy.ts +30 -7
- package/src/scope.ts +145 -10
- package/src/sentry/project.ts +1 -1
- package/src/util/logger.ts +1 -1
- package/src/util/mutex.ts +33 -0
- package/templates/astro/.vscode/extensions.json +4 -0
- package/templates/astro/.vscode/launch.json +11 -0
- package/templates/astro/README.md +48 -0
- package/templates/astro/_env.example +1 -0
- package/templates/astro/_gitignore +27 -0
- package/templates/astro/alchemy.run.ts +16 -0
- package/templates/astro/astro.config.mjs +8 -0
- package/templates/astro/package.json +23 -0
- package/templates/astro/public/favicon.svg +9 -0
- package/templates/astro/src/assets/astro.svg +1 -0
- package/templates/astro/src/assets/background.svg +1 -0
- package/templates/astro/src/components/Welcome.astro +210 -0
- package/templates/astro/src/layouts/Layout.astro +22 -0
- package/templates/astro/src/pages/api/hello.ts +19 -0
- package/templates/astro/src/pages/index.astro +11 -0
- package/templates/astro/tsconfig.json +18 -0
- package/templates/astro/types/env.d.ts +16 -0
- package/templates/astro/wrangler.jsonc +6 -0
- package/templates/nuxt/README.md +75 -0
- package/templates/nuxt/_env +1 -0
- package/templates/nuxt/_env.example +1 -0
- package/templates/nuxt/_gitignore +27 -0
- package/templates/nuxt/alchemy.run.ts +16 -0
- package/templates/nuxt/app.vue +6 -0
- package/templates/nuxt/nuxt.config.ts +13 -0
- package/templates/nuxt/package.json +26 -0
- package/templates/nuxt/public/favicon.ico +0 -0
- package/templates/nuxt/public/robots.txt +2 -0
- package/templates/nuxt/server/api/hello.ts +7 -0
- package/templates/nuxt/server/middleware/auth.ts +5 -0
- package/templates/nuxt/server/middleware/hello.ts +5 -0
- package/templates/nuxt/server/tsconfig.json +3 -0
- package/templates/nuxt/tsconfig.json +15 -0
- package/templates/nuxt/types/env.d.ts +16 -0
- package/templates/react-router/.vscode/settings.json +5 -0
- package/templates/react-router/README.md +79 -0
- package/templates/react-router/_env +1 -0
- package/templates/react-router/_env.example +1 -0
- package/templates/react-router/_gitignore +15 -0
- package/templates/react-router/alchemy.run.ts +17 -0
- package/templates/react-router/app/app.css +15 -0
- package/templates/react-router/app/entry.server.tsx +43 -0
- package/templates/react-router/app/root.tsx +75 -0
- package/templates/react-router/app/routes/home.tsx +17 -0
- package/templates/react-router/app/routes.ts +3 -0
- package/templates/react-router/app/welcome/logo-dark.svg +23 -0
- package/templates/react-router/app/welcome/logo-light.svg +23 -0
- package/templates/react-router/app/welcome/welcome.tsx +90 -0
- package/templates/react-router/package.json +34 -0
- package/templates/react-router/public/favicon.ico +0 -0
- package/templates/react-router/react-router.config.ts +8 -0
- package/templates/react-router/tsconfig.cloudflare.json +27 -0
- package/templates/react-router/tsconfig.json +17 -0
- package/templates/react-router/tsconfig.node.json +20 -0
- package/templates/react-router/types/env.d.ts +16 -0
- package/templates/react-router/vite.config.ts +14 -0
- package/templates/react-router/workers/app.ts +23 -0
- package/templates/react-router/wrangler.jsonc +6 -0
- package/templates/rwsdk/.cursor/rules/rwsdk_rwsdk-interruptors.mdc +247 -0
- package/templates/rwsdk/.cursor/rules/rwsdk_rwsdk-middleware.mdc +75 -0
- package/templates/rwsdk/.cursor/rules/rwsdk_rwsdk-react.mdc +110 -0
- package/templates/rwsdk/.cursor/rules/rwsdk_rwsdk-request-response.mdc +213 -0
- package/templates/rwsdk/.devcontainer/Dockerfile +8 -0
- package/templates/rwsdk/.devcontainer/devcontainer.json +21 -0
- package/templates/rwsdk/README.md +62 -0
- package/templates/rwsdk/_env +5 -0
- package/templates/rwsdk/_env.example +5 -0
- package/templates/rwsdk/_gitignore +71 -0
- package/templates/rwsdk/alchemy.run.ts +29 -0
- package/templates/rwsdk/package.json +61 -0
- package/templates/rwsdk/prisma/schema.prisma +43 -0
- package/templates/rwsdk/src/app/Document.tsx +16 -0
- package/templates/rwsdk/src/app/headers.ts +32 -0
- package/templates/rwsdk/src/app/pages/Home.tsx +13 -0
- package/templates/rwsdk/src/app/pages/user/Login.tsx +79 -0
- package/templates/rwsdk/src/app/pages/user/functions.ts +171 -0
- package/templates/rwsdk/src/app/pages/user/routes.ts +17 -0
- package/templates/rwsdk/src/app/shared/links.ts +3 -0
- package/templates/rwsdk/src/client.tsx +3 -0
- package/templates/rwsdk/src/db.ts +26 -0
- package/templates/rwsdk/src/scripts/seed.ts +21 -0
- package/templates/rwsdk/src/session/durableObject.ts +63 -0
- package/templates/rwsdk/src/session/store.ts +13 -0
- package/templates/rwsdk/src/worker.tsx +63 -0
- package/templates/rwsdk/tsconfig.json +47 -0
- package/templates/rwsdk/types/env.d.ts +16 -0
- package/templates/rwsdk/types/rw.d.ts +5 -0
- package/templates/rwsdk/types/vite.d.ts +4 -0
- package/templates/rwsdk/vite.config.mts +6 -0
- package/templates/rwsdk/wrangler.jsonc +28 -0
- package/templates/sveltekit/README.md +38 -0
- package/templates/sveltekit/_env +1 -0
- package/templates/sveltekit/_env.example +1 -0
- package/templates/sveltekit/_gitignore +26 -0
- package/templates/sveltekit/_npmrc +1 -0
- package/templates/sveltekit/_prettierrc +3 -0
- package/templates/sveltekit/alchemy.run.ts +16 -0
- package/templates/sveltekit/bun.lock +1099 -0
- package/templates/sveltekit/package.json +33 -0
- package/templates/sveltekit/src/app.css +1 -0
- package/templates/sveltekit/src/app.d.ts +13 -0
- package/templates/sveltekit/src/app.html +12 -0
- package/templates/sveltekit/src/routes/+layout.svelte +7 -0
- package/templates/sveltekit/src/routes/+page.svelte +2 -0
- package/templates/sveltekit/static/favicon.png +0 -0
- package/templates/sveltekit/svelte.config.js +12 -0
- package/templates/sveltekit/tsconfig.json +27 -0
- package/templates/sveltekit/types/env.d.ts +16 -0
- package/templates/sveltekit/vite.config.ts +6 -0
- package/templates/sveltekit/wrangler.jsonc +7 -0
- package/templates/tanstack-start/.vscode/settings.json +11 -0
- package/templates/tanstack-start/README.md +72 -0
- package/templates/tanstack-start/_env +1 -0
- package/templates/tanstack-start/_env.example +1 -0
- package/templates/tanstack-start/_gitignore +22 -0
- package/templates/tanstack-start/_prettierignore +4 -0
- package/templates/tanstack-start/alchemy.run.ts +16 -0
- package/templates/tanstack-start/package.json +37 -0
- 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.ico +0 -0
- package/templates/tanstack-start/public/favicon.png +0 -0
- package/templates/tanstack-start/public/site.webmanifest +19 -0
- package/templates/tanstack-start/src/components/DefaultCatchBoundary.tsx +53 -0
- package/templates/tanstack-start/src/components/NotFound.tsx +25 -0
- package/templates/tanstack-start/src/components/PostError.tsx +5 -0
- package/templates/tanstack-start/src/components/UserError.tsx +5 -0
- package/templates/tanstack-start/src/router.tsx +22 -0
- package/templates/tanstack-start/src/routes/__root.tsx +146 -0
- package/templates/tanstack-start/src/routes/_pathlessLayout/_nested-layout/route-a.tsx +10 -0
- package/templates/tanstack-start/src/routes/_pathlessLayout/_nested-layout/route-b.tsx +10 -0
- package/templates/tanstack-start/src/routes/_pathlessLayout/_nested-layout.tsx +34 -0
- package/templates/tanstack-start/src/routes/_pathlessLayout.tsx +16 -0
- package/templates/tanstack-start/src/routes/api/users.$userId.ts +28 -0
- package/templates/tanstack-start/src/routes/api/users.ts +59 -0
- package/templates/tanstack-start/src/routes/customScript[.]js.ts +10 -0
- package/templates/tanstack-start/src/routes/deferred.tsx +62 -0
- package/templates/tanstack-start/src/routes/index.tsx +12 -0
- package/templates/tanstack-start/src/routes/posts.$postId.tsx +34 -0
- package/templates/tanstack-start/src/routes/posts.index.tsx +8 -0
- package/templates/tanstack-start/src/routes/posts.tsx +38 -0
- package/templates/tanstack-start/src/routes/posts_.$postId.deep.tsx +29 -0
- package/templates/tanstack-start/src/routes/redirect.tsx +9 -0
- package/templates/tanstack-start/src/routes/users.$userId.tsx +44 -0
- package/templates/tanstack-start/src/routes/users.index.tsx +18 -0
- package/templates/tanstack-start/src/routes/users.tsx +49 -0
- package/templates/tanstack-start/src/styles/app.css +12 -0
- package/templates/tanstack-start/src/utils/loggingMiddleware.tsx +41 -0
- package/templates/tanstack-start/src/utils/posts.tsx +40 -0
- package/templates/tanstack-start/src/utils/seo.ts +33 -0
- package/templates/tanstack-start/src/utils/users.tsx +5 -0
- package/templates/tanstack-start/tsconfig.json +31 -0
- package/templates/tanstack-start/types/env.d.ts +16 -0
- package/templates/tanstack-start/vite.config.ts +33 -0
- package/templates/tanstack-start/wrangler.jsonc +7 -0
- package/templates/typescript/README.md +15 -0
- package/templates/typescript/_gitignore +37 -0
- package/templates/typescript/alchemy.run.ts +15 -0
- package/templates/typescript/index.ts +1 -0
- package/templates/typescript/package.json +18 -0
- package/templates/typescript/src/worker.js +5 -0
- package/templates/typescript/src/worker.ts +7 -0
- package/templates/typescript/tsconfig.json +21 -0
- package/templates/typescript/types/env.d.ts +16 -0
- package/templates/vite/README.md +54 -0
- package/templates/vite/_env.example +1 -0
- package/templates/vite/_gitignore +27 -0
- package/templates/vite/alchemy.run.ts +17 -0
- package/templates/vite/eslint.config.js +28 -0
- package/templates/vite/index.html +13 -0
- package/templates/vite/package.json +35 -0
- package/templates/vite/public/vite.svg +1 -0
- package/templates/vite/src/App.css +42 -0
- package/templates/vite/src/App.tsx +35 -0
- package/templates/vite/src/assets/react.svg +1 -0
- package/templates/vite/src/index.css +68 -0
- package/templates/vite/src/main.tsx +10 -0
- package/templates/vite/src/vite-env.d.ts +1 -0
- package/templates/vite/tsconfig.json +34 -0
- package/templates/vite/types/env.d.ts +16 -0
- package/templates/vite/vite.config.ts +9 -0
- package/templates/vite/worker/index.ts +12 -0
- package/templates/vite/wrangler.jsonc +6 -0
- package/bin/create-alchemy.ts +0 -1220
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "module",
|
|
3
|
+
"name": "sveltekit",
|
|
4
|
+
"private": true,
|
|
5
|
+
"version": "0.0.1",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "vite build",
|
|
8
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
9
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
10
|
+
"deploy": "bun --env-file=./.env ./alchemy.run.ts",
|
|
11
|
+
"destroy": "bun --env-file=./.env ./alchemy.run.ts --destroy",
|
|
12
|
+
"dev": "vite dev",
|
|
13
|
+
"prepare": "svelte-kit sync || echo ''",
|
|
14
|
+
"preview": "vite preview"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"alchemy": "workspace:*",
|
|
18
|
+
"@cloudflare/workers-types": "^4.20250620.0",
|
|
19
|
+
"miniflare": "^4.20250617.3",
|
|
20
|
+
"@sveltejs/adapter-auto": "^6.0.0",
|
|
21
|
+
"@sveltejs/adapter-cloudflare": "^7.0.4",
|
|
22
|
+
"@sveltejs/kit": "^2.16.0",
|
|
23
|
+
"@sveltejs/vite-plugin-svelte": "^5.1.0",
|
|
24
|
+
"@tailwindcss/vite": "^4.0.0",
|
|
25
|
+
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
26
|
+
"svelte": "^5.0.0",
|
|
27
|
+
"svelte-check": "^4.0.0",
|
|
28
|
+
"tailwindcss": "^4.0.0",
|
|
29
|
+
"typescript": "^5.8.3",
|
|
30
|
+
"vite": "^6.2.6",
|
|
31
|
+
"vite-plugin-devtools-json": "^0.2.0"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// See https://svelte.dev/docs/kit/types#app.d.ts
|
|
2
|
+
// for information about these interfaces
|
|
3
|
+
declare global {
|
|
4
|
+
namespace App {
|
|
5
|
+
// interface Error {}
|
|
6
|
+
// interface Locals {}
|
|
7
|
+
// interface PageData {}
|
|
8
|
+
// interface PageState {}
|
|
9
|
+
// interface Platform {}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
+
%sveltekit.head%
|
|
8
|
+
</head>
|
|
9
|
+
<body data-sveltekit-preload-data="hover">
|
|
10
|
+
<div style="display: contents">%sveltekit.body%</div>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import adapter from '@sveltejs/adapter-cloudflare';
|
|
2
|
+
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
|
3
|
+
|
|
4
|
+
/** @type {import('@sveltejs/kit').Config} */
|
|
5
|
+
const config = {
|
|
6
|
+
preprocess: vitePreprocess(),
|
|
7
|
+
kit: {
|
|
8
|
+
adapter: adapter()
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default config;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./.svelte-kit/tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"allowJs": true,
|
|
5
|
+
"checkJs": true,
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"forceConsistentCasingInFileNames": true,
|
|
8
|
+
"resolveJsonModule": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"types": [
|
|
14
|
+
"@cloudflare/workers-types",
|
|
15
|
+
"./types/env.d.ts"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"include": [
|
|
19
|
+
"alchemy.run.ts",
|
|
20
|
+
"types/**/*.ts"
|
|
21
|
+
]
|
|
22
|
+
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
|
|
23
|
+
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
|
|
24
|
+
//
|
|
25
|
+
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
|
|
26
|
+
// from the referenced tsconfig.json - TypeScript does not merge them in
|
|
27
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// This file infers types for the cloudflare:workers environment from your Alchemy Worker.
|
|
2
|
+
// @see https://alchemy.run/docs/concepts/bindings.html#type-safe-bindings
|
|
3
|
+
|
|
4
|
+
import type { worker } from "../alchemy.run.ts";
|
|
5
|
+
|
|
6
|
+
export type CloudflareEnv = typeof worker.Env;
|
|
7
|
+
|
|
8
|
+
declare global {
|
|
9
|
+
type Env = CloudflareEnv;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare module "cloudflare:workers" {
|
|
13
|
+
namespace Cloudflare {
|
|
14
|
+
export interface Env extends CloudflareEnv {}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Welcome to TanStack.com!
|
|
2
|
+
|
|
3
|
+
This site is built with TanStack Router!
|
|
4
|
+
|
|
5
|
+
- [TanStack Router Docs](https://tanstack.com/router)
|
|
6
|
+
|
|
7
|
+
It's deployed automagically with Netlify!
|
|
8
|
+
|
|
9
|
+
- [Netlify](https://netlify.com/)
|
|
10
|
+
|
|
11
|
+
## Development
|
|
12
|
+
|
|
13
|
+
From your terminal:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
pnpm install
|
|
17
|
+
pnpm dev
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This starts your app in development mode, rebuilding assets on file changes.
|
|
21
|
+
|
|
22
|
+
## Editing and previewing the docs of TanStack projects locally
|
|
23
|
+
|
|
24
|
+
The documentations for all TanStack projects except for `React Charts` are hosted on [https://tanstack.com](https://tanstack.com), powered by this TanStack Router app.
|
|
25
|
+
In production, the markdown doc pages are fetched from the GitHub repos of the projects, but in development they are read from the local file system.
|
|
26
|
+
|
|
27
|
+
Follow these steps if you want to edit the doc pages of a project (in these steps we'll assume it's [`TanStack/form`](https://github.com/tanstack/form)) and preview them locally :
|
|
28
|
+
|
|
29
|
+
1. Create a new directory called `tanstack`.
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
mkdir tanstack
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. Enter the directory and clone this repo and the repo of the project there.
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
cd tanstack
|
|
39
|
+
git clone git@github.com:TanStack/tanstack.com.git
|
|
40
|
+
git clone git@github.com:TanStack/form.git
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
> [!NOTE]
|
|
44
|
+
> Your `tanstack` directory should look like this:
|
|
45
|
+
>
|
|
46
|
+
> ```
|
|
47
|
+
> tanstack/
|
|
48
|
+
> |
|
|
49
|
+
> +-- form/
|
|
50
|
+
> |
|
|
51
|
+
> +-- tanstack.com/
|
|
52
|
+
> ```
|
|
53
|
+
|
|
54
|
+
> [!WARNING]
|
|
55
|
+
> Make sure the name of the directory in your local file system matches the name of the project's repo. For example, `tanstack/form` must be cloned into `form` (this is the default) instead of `some-other-name`, because that way, the doc pages won't be found.
|
|
56
|
+
|
|
57
|
+
3. Enter the `tanstack/tanstack.com` directory, install the dependencies and run the app in dev mode:
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
cd tanstack.com
|
|
61
|
+
pnpm i
|
|
62
|
+
# The app will run on https://localhost:3000 by default
|
|
63
|
+
pnpm dev
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
4. Now you can visit http://localhost:3000/form/latest/docs/overview in the browser and see the changes you make in `tanstack/form/docs`.
|
|
67
|
+
|
|
68
|
+
> [!NOTE]
|
|
69
|
+
> The updated pages need to be manually reloaded in the browser.
|
|
70
|
+
|
|
71
|
+
> [!WARNING]
|
|
72
|
+
> You will need to update the `docs/config.json` file (in the project's repo) if you add a new doc page!
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALCHEMY_PASSWORD=change-me
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALCHEMY_PASSWORD=change-me
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
node_modules
|
|
2
|
+
package-lock.json
|
|
3
|
+
yarn.lock
|
|
4
|
+
|
|
5
|
+
.DS_Store
|
|
6
|
+
.cache
|
|
7
|
+
.env
|
|
8
|
+
.vercel
|
|
9
|
+
.output
|
|
10
|
+
.nitro
|
|
11
|
+
/build/
|
|
12
|
+
/api/
|
|
13
|
+
/server/build
|
|
14
|
+
/public/build# Sentry Config File
|
|
15
|
+
.env.sentry-build-plugin
|
|
16
|
+
/test-results/
|
|
17
|
+
/playwright-report/
|
|
18
|
+
/blob-report/
|
|
19
|
+
/playwright/.cache/
|
|
20
|
+
.tanstack
|
|
21
|
+
.alchemy/
|
|
22
|
+
.env
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="@types/node" />
|
|
2
|
+
|
|
3
|
+
import alchemy from "alchemy";
|
|
4
|
+
import { TanStackStart } from "alchemy/cloudflare";
|
|
5
|
+
|
|
6
|
+
const app = await alchemy("my-alchemy-app");
|
|
7
|
+
|
|
8
|
+
export const worker = await TanStackStart("website", {
|
|
9
|
+
command: "bun run build",
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
console.log({
|
|
13
|
+
url: worker.url,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
await app.finalize();
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "module",
|
|
3
|
+
"name": "tanstack-start",
|
|
4
|
+
"private": true,
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "vite build",
|
|
8
|
+
"deploy": "bun --env-file=./.env ./alchemy.run.ts",
|
|
9
|
+
"destroy": "bun --env-file=./.env ./alchemy.run.ts --destroy",
|
|
10
|
+
"dev": "vite dev",
|
|
11
|
+
"start": "node .output/server/index.mjs"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@tanstack/react-router": "^1.121.27",
|
|
15
|
+
"@tanstack/react-router-devtools": "^1.121.27",
|
|
16
|
+
"@tanstack/react-start": "^1.121.32",
|
|
17
|
+
"react": "^19.0.0",
|
|
18
|
+
"react-dom": "^19.0.0",
|
|
19
|
+
"tailwind-merge": "3",
|
|
20
|
+
"zod": "^3.24.2"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"alchemy": "workspace:*",
|
|
24
|
+
"@cloudflare/workers-types": "^4.20250620.0",
|
|
25
|
+
"@tailwindcss/vite": "^4.1.10",
|
|
26
|
+
"@types/node": "^22.5.4",
|
|
27
|
+
"@types/react": "^19.0.8",
|
|
28
|
+
"@types/react-dom": "^19.0.3",
|
|
29
|
+
"autoprefixer": "^10.4.20",
|
|
30
|
+
"miniflare": "^4.20250617.3",
|
|
31
|
+
"postcss": "^8.5.6",
|
|
32
|
+
"tailwindcss": "4",
|
|
33
|
+
"typescript": "^5.8.3",
|
|
34
|
+
"vite": "^6.3.5",
|
|
35
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createRouter as createTanStackRouter } from '@tanstack/react-router'
|
|
2
|
+
import { routeTree } from './routeTree.gen'
|
|
3
|
+
import { DefaultCatchBoundary } from './components/DefaultCatchBoundary'
|
|
4
|
+
import { NotFound } from './components/NotFound'
|
|
5
|
+
|
|
6
|
+
export function createRouter() {
|
|
7
|
+
const router = createTanStackRouter({
|
|
8
|
+
routeTree,
|
|
9
|
+
defaultPreload: 'intent',
|
|
10
|
+
defaultErrorComponent: DefaultCatchBoundary,
|
|
11
|
+
defaultNotFoundComponent: () => <NotFound />,
|
|
12
|
+
scrollRestoration: true,
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
return router
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare module '@tanstack/react-router' {
|
|
19
|
+
interface Register {
|
|
20
|
+
router: ReturnType<typeof createRouter>
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
import {
|
|
3
|
+
HeadContent,
|
|
4
|
+
Link,
|
|
5
|
+
Outlet,
|
|
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'
|
|
15
|
+
|
|
16
|
+
export const Route = createRootRoute({
|
|
17
|
+
head: () => ({
|
|
18
|
+
meta: [
|
|
19
|
+
{
|
|
20
|
+
charSet: 'utf-8',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'viewport',
|
|
24
|
+
content: 'width=device-width, initial-scale=1',
|
|
25
|
+
},
|
|
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
|
+
{
|
|
46
|
+
rel: 'icon',
|
|
47
|
+
type: 'image/png',
|
|
48
|
+
sizes: '16x16',
|
|
49
|
+
href: '/favicon-16x16.png',
|
|
50
|
+
},
|
|
51
|
+
{ rel: 'manifest', href: '/site.webmanifest', color: '#fffff' },
|
|
52
|
+
{ rel: 'icon', href: '/favicon.ico' },
|
|
53
|
+
],
|
|
54
|
+
scripts: [
|
|
55
|
+
{
|
|
56
|
+
src: '/customScript.js',
|
|
57
|
+
type: 'text/javascript',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
}),
|
|
61
|
+
errorComponent: (props) => {
|
|
62
|
+
return (
|
|
63
|
+
<RootDocument>
|
|
64
|
+
<DefaultCatchBoundary {...props} />
|
|
65
|
+
</RootDocument>
|
|
66
|
+
)
|
|
67
|
+
},
|
|
68
|
+
notFoundComponent: () => <NotFound />,
|
|
69
|
+
component: RootComponent,
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
function RootComponent() {
|
|
73
|
+
return (
|
|
74
|
+
<RootDocument>
|
|
75
|
+
<Outlet />
|
|
76
|
+
</RootDocument>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function RootDocument({ children }: { children: React.ReactNode }) {
|
|
81
|
+
return (
|
|
82
|
+
<html>
|
|
83
|
+
<head>
|
|
84
|
+
<HeadContent />
|
|
85
|
+
</head>
|
|
86
|
+
<body>
|
|
87
|
+
<div className="p-2 flex gap-2 text-lg">
|
|
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 />
|
|
140
|
+
{children}
|
|
141
|
+
<TanStackRouterDevtools position="bottom-right" />
|
|
142
|
+
<Scripts />
|
|
143
|
+
</body>
|
|
144
|
+
</html>
|
|
145
|
+
)
|
|
146
|
+
}
|