@tanstack/create 0.49.2 → 0.59.4
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 +603 -0
- package/dist/add-ons.js +42 -2
- package/dist/add-to-app.js +36 -7
- package/dist/custom-add-ons/add-on.js +2 -26
- package/dist/custom-add-ons/starter.js +1 -2
- package/dist/file-helpers.js +11 -10
- package/dist/frameworks/react/add-ons/ai/assets/src/data/demo-guitars.ts +93 -0
- package/dist/frameworks/react/add-ons/ai/assets/src/hooks/demo-useAudioRecorder.ts +85 -0
- package/dist/frameworks/react/add-ons/ai/assets/src/hooks/demo-useTTS.ts +78 -0
- package/dist/frameworks/react/add-ons/ai/assets/src/lib/demo-ai-hook.ts +22 -0
- package/dist/frameworks/react/add-ons/ai/assets/src/lib/demo-guitar-tools.ts +40 -0
- package/dist/frameworks/react/add-ons/ai/assets/src/routes/demo/api.ai.chat.ts +99 -0
- package/dist/frameworks/react/add-ons/ai/assets/src/routes/demo/api.ai.image.ts +72 -0
- package/dist/frameworks/react/add-ons/ai/assets/src/routes/demo/api.ai.structured.ts +136 -0
- package/dist/frameworks/react/add-ons/ai/assets/src/routes/demo/api.ai.transcription.ts +89 -0
- package/dist/frameworks/react/add-ons/ai/assets/src/routes/demo/api.ai.tts.ts +81 -0
- package/dist/frameworks/react/add-ons/ai/info.json +1 -1
- package/dist/frameworks/react/add-ons/apollo-client/info.json +1 -1
- package/dist/frameworks/react/add-ons/better-auth/assets/src/lib/auth-client.ts +3 -0
- package/dist/frameworks/react/add-ons/better-auth/assets/src/lib/auth.ts +9 -0
- package/dist/frameworks/react/add-ons/better-auth/assets/src/routes/api/auth/$.ts +11 -0
- package/dist/frameworks/react/add-ons/better-auth/info.json +0 -2
- package/dist/frameworks/react/add-ons/clerk/info.json +0 -1
- package/dist/frameworks/react/add-ons/convex/assets/convex/schema.ts +14 -0
- package/dist/frameworks/react/add-ons/convex/assets/convex/todos.ts +43 -0
- package/dist/frameworks/react/add-ons/db/assets/src/db-collections/index.ts +20 -0
- package/dist/frameworks/react/add-ons/db/assets/src/hooks/demo.useChat.ts +62 -0
- package/dist/frameworks/react/add-ons/db/assets/src/routes/demo/db-chat-api.ts +83 -0
- package/dist/frameworks/react/add-ons/db/info.json +1 -1
- package/dist/frameworks/react/add-ons/drizzle/info.json +1 -1
- package/dist/frameworks/react/add-ons/drizzle/package.json.ejs +4 -0
- package/dist/frameworks/react/add-ons/form/assets/src/hooks/demo.form-context.ts +4 -0
- package/dist/frameworks/react/add-ons/form/assets/src/hooks/demo.form.ts +22 -0
- package/dist/frameworks/react/add-ons/mcp/assets/src/mcp-todos.ts +51 -0
- package/dist/frameworks/react/add-ons/mcp/assets/src/routes/demo/api.mcp-todos.ts +37 -0
- package/dist/frameworks/react/add-ons/mcp/assets/src/routes/mcp.ts +53 -0
- package/dist/frameworks/react/add-ons/mcp/assets/src/utils/mcp-handler.ts +61 -0
- package/dist/frameworks/react/add-ons/mcp/info.json +1 -2
- package/dist/frameworks/react/add-ons/neon/assets/neon-vite-plugin.ts +10 -0
- package/dist/frameworks/react/add-ons/neon/assets/src/db.ts +13 -0
- package/dist/frameworks/react/add-ons/neon/info.json +1 -2
- package/dist/frameworks/react/add-ons/oRPC/assets/src/orpc/client.ts +29 -0
- package/dist/frameworks/react/add-ons/oRPC/assets/src/orpc/router/index.ts +6 -0
- package/dist/frameworks/react/add-ons/oRPC/assets/src/orpc/router/todos.ts +20 -0
- package/dist/frameworks/react/add-ons/oRPC/assets/src/orpc/schema.ts +6 -0
- package/dist/frameworks/react/add-ons/oRPC/assets/src/polyfill.ts +21 -0
- package/dist/frameworks/react/add-ons/oRPC/assets/src/routes/api.$.ts +77 -0
- package/dist/frameworks/react/add-ons/oRPC/assets/src/routes/api.rpc.$.ts +29 -0
- package/dist/frameworks/react/add-ons/oRPC/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/prisma/package.json.ejs +4 -0
- package/dist/frameworks/react/add-ons/sentry/info.json +1 -2
- package/dist/frameworks/react/add-ons/shadcn/assets/src/lib/utils.ts +6 -0
- package/dist/frameworks/react/add-ons/store/assets/src/lib/demo-store.ts +13 -0
- package/dist/frameworks/react/add-ons/storybook/assets/_dot_storybook/main.ts +17 -0
- package/dist/frameworks/react/add-ons/storybook/assets/_dot_storybook/preview.ts +15 -0
- package/dist/frameworks/react/add-ons/storybook/assets/src/components/storybook/button.stories.ts +67 -0
- package/dist/frameworks/react/add-ons/storybook/assets/src/components/storybook/index.ts +14 -0
- package/dist/frameworks/react/add-ons/storybook/assets/src/components/storybook/input.stories.ts +43 -0
- package/dist/frameworks/react/add-ons/storybook/assets/src/components/storybook/radio-group.stories.ts +53 -0
- package/dist/frameworks/react/add-ons/storybook/assets/src/components/storybook/slider.stories.ts +55 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/lib/strapiClient.ts +7 -0
- package/dist/frameworks/react/add-ons/t3env/assets/src/env.ts +39 -0
- package/dist/frameworks/react/add-ons/tRPC/assets/src/integrations/trpc/init.ts +9 -0
- package/dist/frameworks/react/add-ons/tRPC/assets/src/integrations/trpc/react.ts +4 -0
- package/dist/frameworks/react/add-ons/tRPC/assets/src/integrations/trpc/router.ts +27 -0
- package/dist/frameworks/react/add-ons/tRPC/info.json +1 -1
- package/dist/frameworks/react/add-ons/table/assets/src/data/demo-table-data.ts +50 -0
- package/dist/frameworks/react/add-ons/tanstack-query/assets/src/integrations/tanstack-query/root-provider.tsx.ejs +1 -29
- package/dist/frameworks/react/add-ons/workos/info.json +0 -1
- package/dist/frameworks/react/examples/events/assets/content-collections.ts +56 -0
- package/dist/frameworks/react/examples/events/assets/src/lib/conference-ai-hook.ts +26 -0
- package/dist/frameworks/react/examples/events/assets/src/lib/conference-tools.ts +210 -0
- package/dist/frameworks/react/examples/events/assets/src/lib/utils.ts +6 -0
- package/dist/frameworks/react/examples/events/assets/src/routes/api.remy-chat.ts +121 -0
- package/dist/frameworks/react/examples/resume/assets/content-collections.ts +36 -0
- package/dist/frameworks/react/examples/resume/assets/src/lib/resume-ai-hook.ts +21 -0
- package/dist/frameworks/react/examples/resume/assets/src/lib/resume-tools.ts +165 -0
- package/dist/frameworks/react/examples/resume/assets/src/lib/utils.ts +6 -0
- package/dist/frameworks/react/examples/resume/assets/src/routes/api.resume-chat.ts +110 -0
- package/dist/frameworks/react/hosts/cloudflare/info.json +0 -1
- package/dist/frameworks/react/hosts/netlify/info.json +0 -1
- package/dist/frameworks/react/hosts/nitro/info.json +0 -1
- package/dist/frameworks/react/hosts/railway/info.json +0 -1
- package/dist/frameworks/react/index.js +1 -6
- package/dist/frameworks/react/project/base/README.md.ejs +86 -436
- package/dist/frameworks/react/project/base/_dot_gitignore +4 -0
- package/dist/frameworks/react/project/base/package.json +8 -5
- package/dist/frameworks/react/project/base/src/components/Header.tsx.ejs +2 -32
- package/dist/frameworks/react/project/base/src/routes/__root.tsx.ejs +4 -44
- package/dist/frameworks/react/project/base/src/routes/index.tsx.ejs +99 -61
- package/dist/frameworks/react/project/base/src/styles.css.ejs +3 -3
- package/dist/frameworks/react/project/base/tsconfig.json.ejs +1 -1
- package/dist/frameworks/react/project/base/vite.config.ts.ejs +33 -27
- package/dist/frameworks/react/project/packages.json +2 -2
- package/dist/frameworks/solid/add-ons/better-auth/assets/src/lib/auth-client.ts +3 -0
- package/dist/frameworks/solid/add-ons/better-auth/assets/src/lib/auth.ts +9 -0
- package/dist/frameworks/solid/add-ons/better-auth/assets/src/routes/api/auth/$.ts +11 -0
- package/dist/frameworks/solid/add-ons/better-auth/info.json +1 -1
- package/dist/frameworks/solid/add-ons/convex/assets/convex/schema.ts +14 -0
- package/dist/frameworks/solid/add-ons/convex/assets/convex/todos.ts +43 -0
- package/dist/frameworks/solid/add-ons/solid-ui/assets/src/lib/utils.ts +6 -0
- package/dist/frameworks/solid/add-ons/store/assets/src/lib/demo-store.ts +13 -0
- package/dist/frameworks/solid/add-ons/strapi/assets/src/lib/strapiClient.ts +7 -0
- package/dist/frameworks/solid/add-ons/t3env/assets/src/env.ts +39 -0
- package/dist/frameworks/solid/examples/tanchat/assets/ai-streaming-server/src/index.ts +102 -0
- package/dist/frameworks/solid/examples/tanchat/assets/src/lib/demo-store.ts +13 -0
- package/dist/frameworks/solid/examples/tanchat/assets/src/store/demo.hooks.ts +17 -0
- package/dist/frameworks/solid/examples/tanchat/assets/src/store/demo.store.ts +133 -0
- package/dist/frameworks/solid/hosts/cloudflare/info.json +0 -1
- package/dist/frameworks/solid/hosts/netlify/info.json +0 -1
- package/dist/frameworks/solid/hosts/nitro/info.json +0 -1
- package/dist/frameworks/solid/hosts/railway/info.json +0 -1
- package/dist/frameworks/solid/index.js +1 -6
- package/dist/frameworks/solid/project/base/README.md.ejs +43 -117
- package/dist/frameworks/solid/project/base/_dot_gitignore +4 -0
- package/dist/frameworks/solid/project/base/package.json +8 -3
- package/dist/frameworks/solid/project/base/src/components/Header.tsx.ejs +2 -25
- package/dist/frameworks/solid/project/base/src/routes/__root.tsx.ejs +3 -30
- package/dist/frameworks/solid/project/base/src/routes/index.tsx.ejs +97 -35
- package/dist/frameworks/solid/project/base/tsconfig.json.ejs +1 -1
- package/dist/frameworks/solid/project/base/vite.config.ts.ejs +15 -20
- package/dist/frameworks/solid/project/packages.json +2 -2
- package/dist/frameworks.js +0 -1
- package/dist/package-json.js +6 -10
- package/dist/template-file.js +21 -7
- package/dist/types/custom-add-ons/add-on.d.ts +1 -1
- package/dist/types/file-helpers.d.ts +0 -1
- package/dist/types/types.d.ts +12 -12
- package/dist/types.js +1 -2
- package/package.json +2 -2
- package/src/add-ons.ts +54 -2
- package/src/add-to-app.ts +42 -7
- package/src/custom-add-ons/add-on.ts +2 -33
- package/src/custom-add-ons/starter.ts +1 -2
- package/src/file-helpers.ts +11 -10
- package/src/frameworks/react/add-ons/ai/info.json +1 -1
- package/src/frameworks/react/add-ons/apollo-client/info.json +1 -1
- package/src/frameworks/react/add-ons/better-auth/info.json +0 -2
- package/src/frameworks/react/add-ons/clerk/info.json +0 -1
- package/src/frameworks/react/add-ons/db/info.json +1 -1
- package/src/frameworks/react/add-ons/drizzle/info.json +1 -1
- package/src/frameworks/react/add-ons/drizzle/package.json.ejs +4 -0
- package/src/frameworks/react/add-ons/mcp/info.json +1 -2
- package/src/frameworks/react/add-ons/neon/assets/neon-vite-plugin.ts +1 -1
- package/src/frameworks/react/add-ons/neon/info.json +1 -2
- package/src/frameworks/react/add-ons/oRPC/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/prisma/package.json.ejs +4 -0
- package/src/frameworks/react/add-ons/sentry/info.json +1 -2
- package/src/frameworks/react/add-ons/tRPC/info.json +1 -1
- package/src/frameworks/react/add-ons/tanstack-query/assets/src/integrations/tanstack-query/root-provider.tsx.ejs +1 -29
- package/src/frameworks/react/add-ons/workos/info.json +0 -1
- package/src/frameworks/react/hosts/cloudflare/info.json +0 -1
- package/src/frameworks/react/hosts/netlify/info.json +0 -1
- package/src/frameworks/react/hosts/nitro/info.json +0 -1
- package/src/frameworks/react/hosts/railway/info.json +0 -1
- package/src/frameworks/react/index.ts +1 -6
- package/src/frameworks/react/project/base/README.md.ejs +86 -436
- package/src/frameworks/react/project/base/_dot_gitignore +4 -0
- package/src/frameworks/react/project/base/package.json +8 -5
- package/src/frameworks/react/project/base/src/components/Header.tsx.ejs +2 -32
- package/src/frameworks/react/project/base/src/routes/__root.tsx.ejs +4 -44
- package/src/frameworks/react/project/base/src/routes/index.tsx.ejs +99 -61
- package/src/frameworks/react/project/base/src/styles.css.ejs +3 -3
- package/src/frameworks/react/project/base/tsconfig.json.ejs +1 -1
- package/src/frameworks/react/project/base/vite.config.ts.ejs +33 -27
- package/src/frameworks/react/project/packages.json +2 -2
- package/src/frameworks/solid/add-ons/better-auth/info.json +1 -1
- package/src/frameworks/solid/hosts/cloudflare/info.json +0 -1
- package/src/frameworks/solid/hosts/netlify/info.json +0 -1
- package/src/frameworks/solid/hosts/nitro/info.json +0 -1
- package/src/frameworks/solid/hosts/railway/info.json +0 -1
- package/src/frameworks/solid/index.ts +1 -6
- package/src/frameworks/solid/project/base/README.md.ejs +43 -117
- package/src/frameworks/solid/project/base/_dot_gitignore +4 -0
- package/src/frameworks/solid/project/base/package.json +8 -3
- package/src/frameworks/solid/project/base/src/components/Header.tsx.ejs +2 -25
- package/src/frameworks/solid/project/base/src/routes/__root.tsx.ejs +3 -30
- package/src/frameworks/solid/project/base/src/routes/index.tsx.ejs +97 -35
- package/src/frameworks/solid/project/base/tsconfig.json.ejs +1 -1
- package/src/frameworks/solid/project/base/vite.config.ts.ejs +15 -20
- package/src/frameworks/solid/project/packages.json +2 -2
- package/src/frameworks.ts +0 -1
- package/src/package-json.ts +6 -10
- package/src/template-file.ts +27 -8
- package/src/types.ts +1 -2
- package/tests/add-to-app.test.ts +37 -0
- package/tests/copy-assets.test.ts +53 -0
- package/tests/file-helper.test.ts +23 -2
- package/tests/package-json.test.ts +32 -0
- package/tests/template-file.test.ts +28 -0
- package/dist/frameworks/react/add-ons/module-federation/assets/module-federation.config.js.ejs +0 -31
- package/dist/frameworks/react/add-ons/module-federation/assets/src/demo-mf-component.tsx +0 -3
- package/dist/frameworks/react/add-ons/module-federation/assets/src/demo-mf-self-contained.tsx +0 -11
- package/dist/frameworks/react/add-ons/module-federation/info.json +0 -11
- package/dist/frameworks/react/add-ons/module-federation/package.json +0 -5
- package/dist/frameworks/react/add-ons/module-federation/small-logo.svg +0 -87
- package/dist/frameworks/react/add-ons/start/assets/_dot_gitignore.append +0 -3
- package/dist/frameworks/react/add-ons/start/assets/src/router.tsx.ejs +0 -77
- package/dist/frameworks/react/add-ons/start/assets/src/routes/demo/api.tq-todos.ts.ejs +0 -35
- package/dist/frameworks/react/add-ons/start/assets/src/routes/demo/start.api-request.tsx.ejs +0 -68
- package/dist/frameworks/react/add-ons/start/assets/src/routes/demo/start.css.ejs +0 -43
- package/dist/frameworks/react/add-ons/start/assets/src/routes/demo/start.server-funcs.tsx.ejs +0 -183
- package/dist/frameworks/react/add-ons/start/assets/src/routes/demo/start.ssr.data-only.tsx.ejs +0 -55
- package/dist/frameworks/react/add-ons/start/assets/src/routes/demo/start.ssr.full-ssr.tsx.ejs +0 -55
- package/dist/frameworks/react/add-ons/start/assets/src/routes/demo/start.ssr.index.tsx.ejs +0 -62
- package/dist/frameworks/react/add-ons/start/assets/src/routes/demo/start.ssr.spa-mode.tsx.ejs +0 -62
- package/dist/frameworks/react/add-ons/start/assets/src/routes/index.tsx.ejs +0 -142
- package/dist/frameworks/react/add-ons/start/assets/src/server.ts.ejs +0 -9
- package/dist/frameworks/react/add-ons/start/assets/vite.config.ts.ejs +0 -40
- package/dist/frameworks/react/add-ons/start/info.json +0 -61
- package/dist/frameworks/react/add-ons/start/package.json +0 -12
- package/dist/frameworks/react/add-ons/start/small-logo.svg +0 -1
- package/dist/frameworks/react/project/base/index.html.ejs +0 -20
- package/dist/frameworks/react/project/base/src/App.css.ejs +0 -38
- package/dist/frameworks/react/project/base/src/App.tsx.ejs +0 -63
- package/dist/frameworks/react/project/base/src/components/Header.css.ejs +0 -18
- package/dist/frameworks/react/project/base/src/logo.svg +0 -12
- package/dist/frameworks/react/project/base/src/main.tsx.ejs +0 -166
- package/dist/frameworks/react/project/base/src/reportWebVitals.ts.ejs +0 -28
- package/dist/frameworks/solid/add-ons/module-federation/assets/module-federation.config.js.ejs +0 -27
- package/dist/frameworks/solid/add-ons/module-federation/assets/src/demo-mf-component.tsx +0 -3
- package/dist/frameworks/solid/add-ons/module-federation/assets/src/demo-mf-self-contained.tsx +0 -9
- package/dist/frameworks/solid/add-ons/module-federation/info.json +0 -10
- package/dist/frameworks/solid/add-ons/module-federation/package.json +0 -5
- package/dist/frameworks/solid/add-ons/module-federation/small-logo.svg +0 -87
- package/dist/frameworks/solid/add-ons/start/assets/public/tanstack-circle-logo.png +0 -0
- package/dist/frameworks/solid/add-ons/start/assets/public/tanstack-word-logo-white.svg +0 -1
- package/dist/frameworks/solid/add-ons/start/assets/src/router.tsx.ejs +0 -30
- package/dist/frameworks/solid/add-ons/start/assets/src/routes/demo.start.server-funcs.tsx +0 -49
- package/dist/frameworks/solid/add-ons/start/assets/src/routes/index.tsx.ejs +0 -138
- package/dist/frameworks/solid/add-ons/start/assets/vite.config.ts.ejs +0 -22
- package/dist/frameworks/solid/add-ons/start/info.json +0 -18
- package/dist/frameworks/solid/add-ons/start/package.json +0 -15
- package/dist/frameworks/solid/add-ons/start/small-logo.svg +0 -1
- package/dist/frameworks/solid/project/base/index.html.ejs +0 -20
- package/dist/frameworks/solid/project/base/src/App.css.ejs +0 -38
- package/dist/frameworks/solid/project/base/src/App.tsx.ejs +0 -34
- package/dist/frameworks/solid/project/base/src/logo.svg +0 -120
- package/dist/frameworks/solid/project/base/src/main.tsx.ejs +0 -126
- package/src/frameworks/react/add-ons/module-federation/assets/module-federation.config.js.ejs +0 -31
- package/src/frameworks/react/add-ons/module-federation/assets/src/demo-mf-component.tsx +0 -3
- package/src/frameworks/react/add-ons/module-federation/assets/src/demo-mf-self-contained.tsx +0 -11
- package/src/frameworks/react/add-ons/module-federation/info.json +0 -11
- package/src/frameworks/react/add-ons/module-federation/package.json +0 -5
- package/src/frameworks/react/add-ons/module-federation/small-logo.svg +0 -87
- package/src/frameworks/react/add-ons/start/assets/_dot_gitignore.append +0 -3
- package/src/frameworks/react/add-ons/start/assets/src/data/demo.punk-songs.ts +0 -13
- package/src/frameworks/react/add-ons/start/assets/src/router.tsx.ejs +0 -77
- package/src/frameworks/react/add-ons/start/assets/src/routes/demo/api.names.ts +0 -10
- package/src/frameworks/react/add-ons/start/assets/src/routes/demo/api.tq-todos.ts.ejs +0 -35
- package/src/frameworks/react/add-ons/start/assets/src/routes/demo/start.api-request.tsx.ejs +0 -68
- package/src/frameworks/react/add-ons/start/assets/src/routes/demo/start.css.ejs +0 -43
- package/src/frameworks/react/add-ons/start/assets/src/routes/demo/start.server-funcs.tsx.ejs +0 -183
- package/src/frameworks/react/add-ons/start/assets/src/routes/demo/start.ssr.data-only.tsx.ejs +0 -55
- package/src/frameworks/react/add-ons/start/assets/src/routes/demo/start.ssr.full-ssr.tsx.ejs +0 -55
- package/src/frameworks/react/add-ons/start/assets/src/routes/demo/start.ssr.index.tsx.ejs +0 -62
- package/src/frameworks/react/add-ons/start/assets/src/routes/demo/start.ssr.spa-mode.tsx.ejs +0 -62
- package/src/frameworks/react/add-ons/start/assets/src/routes/index.tsx.ejs +0 -142
- package/src/frameworks/react/add-ons/start/assets/src/server.ts.ejs +0 -9
- package/src/frameworks/react/add-ons/start/assets/vite.config.ts.ejs +0 -40
- package/src/frameworks/react/add-ons/start/info.json +0 -61
- package/src/frameworks/react/add-ons/start/package.json +0 -12
- package/src/frameworks/react/add-ons/start/small-logo.svg +0 -1
- package/src/frameworks/react/project/base/index.html.ejs +0 -20
- package/src/frameworks/react/project/base/src/App.css.ejs +0 -38
- package/src/frameworks/react/project/base/src/App.tsx.ejs +0 -63
- package/src/frameworks/react/project/base/src/components/Header.css.ejs +0 -18
- package/src/frameworks/react/project/base/src/logo.svg +0 -12
- package/src/frameworks/react/project/base/src/main.tsx.ejs +0 -166
- package/src/frameworks/react/project/base/src/reportWebVitals.ts.ejs +0 -28
- package/src/frameworks/solid/add-ons/module-federation/assets/module-federation.config.js.ejs +0 -27
- package/src/frameworks/solid/add-ons/module-federation/assets/src/demo-mf-component.tsx +0 -3
- package/src/frameworks/solid/add-ons/module-federation/assets/src/demo-mf-self-contained.tsx +0 -9
- package/src/frameworks/solid/add-ons/module-federation/info.json +0 -10
- package/src/frameworks/solid/add-ons/module-federation/package.json +0 -5
- package/src/frameworks/solid/add-ons/module-federation/small-logo.svg +0 -87
- package/src/frameworks/solid/add-ons/start/assets/public/tanstack-circle-logo.png +0 -0
- package/src/frameworks/solid/add-ons/start/assets/public/tanstack-word-logo-white.svg +0 -1
- package/src/frameworks/solid/add-ons/start/assets/src/router.tsx.ejs +0 -30
- package/src/frameworks/solid/add-ons/start/assets/src/routes/demo.start.server-funcs.tsx +0 -49
- package/src/frameworks/solid/add-ons/start/assets/src/routes/index.tsx.ejs +0 -138
- package/src/frameworks/solid/add-ons/start/assets/vite.config.ts.ejs +0 -22
- package/src/frameworks/solid/add-ons/start/info.json +0 -18
- package/src/frameworks/solid/add-ons/start/package.json +0 -15
- package/src/frameworks/solid/add-ons/start/small-logo.svg +0 -1
- package/src/frameworks/solid/project/base/index.html.ejs +0 -20
- package/src/frameworks/solid/project/base/src/App.css.ejs +0 -38
- package/src/frameworks/solid/project/base/src/App.tsx.ejs +0 -34
- package/src/frameworks/solid/project/base/src/logo.svg +0 -120
- package/src/frameworks/solid/project/base/src/main.tsx.ejs +0 -126
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import express, { Request, Response } from 'express'
|
|
2
|
+
import cors from 'cors'
|
|
3
|
+
import dotenv from 'dotenv'
|
|
4
|
+
import Anthropic from '@anthropic-ai/sdk'
|
|
5
|
+
|
|
6
|
+
// Load environment variables
|
|
7
|
+
dotenv.config()
|
|
8
|
+
|
|
9
|
+
const app = express()
|
|
10
|
+
const port = process.env.PORT || 8080
|
|
11
|
+
|
|
12
|
+
// Middleware
|
|
13
|
+
app.use(cors())
|
|
14
|
+
app.use(express.json())
|
|
15
|
+
|
|
16
|
+
// Initialize Anthropic client
|
|
17
|
+
const anthropic = new Anthropic({
|
|
18
|
+
apiKey: process.env.ANTHROPIC_API_KEY,
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
// Define types for the request body
|
|
22
|
+
interface ChatMessage {
|
|
23
|
+
role: 'user' | 'assistant'
|
|
24
|
+
content: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface ChatRequest {
|
|
28
|
+
messages: ChatMessage[]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Streaming chat endpoint
|
|
32
|
+
app.post(
|
|
33
|
+
'/api/chat',
|
|
34
|
+
async (req: Request<{}, {}, ChatRequest>, res: Response) => {
|
|
35
|
+
try {
|
|
36
|
+
const { messages } = req.body
|
|
37
|
+
|
|
38
|
+
if (!messages || !Array.isArray(messages)) {
|
|
39
|
+
return res.status(400).json({ error: 'Messages array is required' })
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Validate message format
|
|
43
|
+
const isValidMessages = messages.every(
|
|
44
|
+
(msg): msg is ChatMessage =>
|
|
45
|
+
typeof msg === 'object' &&
|
|
46
|
+
(msg.role === 'user' || msg.role === 'assistant') &&
|
|
47
|
+
typeof msg.content === 'string',
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
if (!isValidMessages) {
|
|
51
|
+
return res.status(400).json({
|
|
52
|
+
error:
|
|
53
|
+
"Invalid message format. Each message must have 'role' and 'content'",
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Set up SSE headers
|
|
58
|
+
res.setHeader('Content-Type', 'text/event-stream')
|
|
59
|
+
res.setHeader('Cache-Control', 'no-cache')
|
|
60
|
+
res.setHeader('Connection', 'keep-alive')
|
|
61
|
+
|
|
62
|
+
// Create the message stream
|
|
63
|
+
const stream = await anthropic.messages.create({
|
|
64
|
+
messages: messages.map((msg) => ({
|
|
65
|
+
role: msg.role,
|
|
66
|
+
content: msg.content,
|
|
67
|
+
})),
|
|
68
|
+
model: 'claude-3-opus-20240229',
|
|
69
|
+
max_tokens: 4096,
|
|
70
|
+
stream: true,
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
// Stream the response
|
|
74
|
+
for await (const chunk of stream) {
|
|
75
|
+
if (chunk.type === 'content_block_delta') {
|
|
76
|
+
res.write(`data: ${JSON.stringify(chunk)}\n\n`)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// End the stream
|
|
81
|
+
res.write('data: [DONE]\n\n')
|
|
82
|
+
res.end()
|
|
83
|
+
} catch (error) {
|
|
84
|
+
console.error('Error:', error)
|
|
85
|
+
// If headers haven't been sent yet, send error response
|
|
86
|
+
if (!res.headersSent) {
|
|
87
|
+
res.status(500).json({ error: 'Internal server error' })
|
|
88
|
+
} else {
|
|
89
|
+
// If streaming has started, send error event
|
|
90
|
+
const errorMessage =
|
|
91
|
+
error instanceof Error ? error.message : 'Unknown error'
|
|
92
|
+
res.write(`data: ${JSON.stringify({ error: errorMessage })}\n\n`)
|
|
93
|
+
res.end()
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
// Start the server
|
|
100
|
+
app.listen(port, () => {
|
|
101
|
+
console.log(`Server is running on port ${port}`)
|
|
102
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Derived, Store } from '@tanstack/store'
|
|
2
|
+
|
|
3
|
+
export const store = new Store({
|
|
4
|
+
firstName: 'Jane',
|
|
5
|
+
lastName: 'Smith',
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
export const fullName = new Derived({
|
|
9
|
+
fn: () => `${store.state.firstName} ${store.state.lastName}`,
|
|
10
|
+
deps: [store],
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
fullName.mount()
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useStore } from '@tanstack/solid-store'
|
|
2
|
+
import { store, actions, selectors } from './demo.store'
|
|
3
|
+
|
|
4
|
+
export type { State, Prompt, Conversation } from './demo.store'
|
|
5
|
+
|
|
6
|
+
export function useAppState() {
|
|
7
|
+
const state = useStore(store)
|
|
8
|
+
return state;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function useAppActions() {
|
|
12
|
+
return actions
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function useAppSelectors() {
|
|
16
|
+
return selectors
|
|
17
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Store } from '@tanstack/store'
|
|
2
|
+
import type { Message } from '../utils/demo.ai'
|
|
3
|
+
|
|
4
|
+
// Types
|
|
5
|
+
export interface Prompt {
|
|
6
|
+
id: string
|
|
7
|
+
name: string
|
|
8
|
+
content: string
|
|
9
|
+
is_active: boolean
|
|
10
|
+
created_at: number
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface Conversation {
|
|
14
|
+
id: string
|
|
15
|
+
title: string
|
|
16
|
+
messages: Message[]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface State {
|
|
20
|
+
prompts: Prompt[]
|
|
21
|
+
conversations: Conversation[]
|
|
22
|
+
currentConversationId: string | null
|
|
23
|
+
isLoading: boolean
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const initialState: State = {
|
|
27
|
+
prompts: [],
|
|
28
|
+
conversations: [],
|
|
29
|
+
currentConversationId: null,
|
|
30
|
+
isLoading: false
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const store = new Store<State>(initialState)
|
|
34
|
+
|
|
35
|
+
export const actions = {
|
|
36
|
+
// Prompt actions
|
|
37
|
+
createPrompt: (name: string, content: string) => {
|
|
38
|
+
const id = Date.now().toString()
|
|
39
|
+
store.setState(state => {
|
|
40
|
+
const updatedPrompts = state.prompts.map(p => ({ ...p, is_active: false }))
|
|
41
|
+
return {
|
|
42
|
+
...state,
|
|
43
|
+
prompts: [
|
|
44
|
+
...updatedPrompts,
|
|
45
|
+
{
|
|
46
|
+
id,
|
|
47
|
+
name,
|
|
48
|
+
content,
|
|
49
|
+
is_active: true,
|
|
50
|
+
created_at: Date.now()
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
deletePrompt: (id: string) => {
|
|
58
|
+
store.setState(state => ({
|
|
59
|
+
...state,
|
|
60
|
+
prompts: state.prompts.filter(p => p.id !== id)
|
|
61
|
+
}))
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
setPromptActive: (id: string, shouldActivate: boolean) => {
|
|
65
|
+
store.setState(state => ({
|
|
66
|
+
...state,
|
|
67
|
+
prompts: state.prompts.map(p => ({
|
|
68
|
+
...p,
|
|
69
|
+
is_active: p.id === id ? shouldActivate : false
|
|
70
|
+
}))
|
|
71
|
+
}))
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
// Chat actions
|
|
75
|
+
setConversations: (conversations: Conversation[]) => {
|
|
76
|
+
store.setState(state => ({ ...state, conversations }))
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
setCurrentConversationId: (id: string | null) => {
|
|
80
|
+
store.setState(state => ({ ...state, currentConversationId: id }))
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
addConversation: (conversation: Conversation) => {
|
|
84
|
+
store.setState(state => ({
|
|
85
|
+
...state,
|
|
86
|
+
conversations: [...state.conversations, conversation],
|
|
87
|
+
currentConversationId: conversation.id
|
|
88
|
+
}))
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
updateConversationTitle: (id: string, title: string) => {
|
|
92
|
+
store.setState(state => ({
|
|
93
|
+
...state,
|
|
94
|
+
conversations: state.conversations.map(conv =>
|
|
95
|
+
conv.id === id ? { ...conv, title } : conv
|
|
96
|
+
)
|
|
97
|
+
}))
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
deleteConversation: (id: string) => {
|
|
101
|
+
store.setState(state => ({
|
|
102
|
+
...state,
|
|
103
|
+
conversations: state.conversations.filter(conv => conv.id !== id),
|
|
104
|
+
currentConversationId: state.currentConversationId === id ? null : state.currentConversationId
|
|
105
|
+
}))
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
addMessage: (conversationId: string, message: Message) => {
|
|
109
|
+
store.setState(state => ({
|
|
110
|
+
...state,
|
|
111
|
+
conversations: state.conversations.map(conv =>
|
|
112
|
+
conv.id === conversationId
|
|
113
|
+
? { ...conv, messages: [...conv.messages, message] }
|
|
114
|
+
: conv
|
|
115
|
+
)
|
|
116
|
+
}))
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
setLoading: (isLoading: boolean) => {
|
|
120
|
+
store.setState(state => ({ ...state, isLoading }))
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Selectors
|
|
125
|
+
export const selectors = {
|
|
126
|
+
getActivePrompt: (state: State) => state.prompts.find(p => p.is_active),
|
|
127
|
+
getCurrentConversation: (state: State) =>
|
|
128
|
+
state.conversations.find(c => c.id === state.currentConversationId),
|
|
129
|
+
getPrompts: (state: State) => state.prompts,
|
|
130
|
+
getConversations: (state: State) => state.conversations,
|
|
131
|
+
getCurrentConversationId: (state: State) => state.currentConversationId,
|
|
132
|
+
getIsLoading: (state: State) => state.isLoading
|
|
133
|
+
}
|
|
@@ -20,14 +20,9 @@ export function createFrameworkDefinition() {
|
|
|
20
20
|
basePackageJSON,
|
|
21
21
|
optionalPackages,
|
|
22
22
|
supportedModes: {
|
|
23
|
-
'code-router': {
|
|
24
|
-
displayName: 'Code Router',
|
|
25
|
-
description: 'TanStack Router using code to define the routes',
|
|
26
|
-
forceTypescript: true,
|
|
27
|
-
},
|
|
28
23
|
'file-router': {
|
|
29
24
|
displayName: 'File Router',
|
|
30
|
-
description: 'TanStack
|
|
25
|
+
description: 'TanStack Start with file-based routing',
|
|
31
26
|
forceTypescript: true,
|
|
32
27
|
},
|
|
33
28
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Welcome to your new TanStack app!
|
|
1
|
+
Welcome to your new TanStack Start app!
|
|
2
2
|
|
|
3
3
|
# Getting Started
|
|
4
4
|
|
|
@@ -21,53 +21,29 @@ To build this application for production:
|
|
|
21
21
|
|
|
22
22
|
This project uses [Tailwind CSS](https://tailwindcss.com/) for styling.
|
|
23
23
|
|
|
24
|
+
### Removing Tailwind CSS
|
|
25
|
+
|
|
26
|
+
If you prefer not to use Tailwind CSS:
|
|
27
|
+
|
|
28
|
+
1. Remove the demo pages in `src/routes/demo/`
|
|
29
|
+
2. Replace the Tailwind import in `src/styles.css` with your own styles
|
|
30
|
+
3. Remove `tailwindcss()` from the plugins array in `vite.config.ts`
|
|
31
|
+
4. Uninstall the packages: `<%= getPackageManagerAddScript('@tailwindcss/vite tailwindcss', true) %>`
|
|
32
|
+
|
|
24
33
|
<% for(const addon of addOns.filter(addon => addon.readme)) { %>
|
|
25
34
|
<%- addon.readme %>
|
|
26
35
|
<% } %>
|
|
27
36
|
|
|
28
37
|
## Routing
|
|
29
|
-
<% if (fileRouter) { %>This project uses [TanStack Router](https://tanstack.com/router). The initial setup is a file based router. Which means that the routes are managed as files in `src/routes`.<% } else { %>This project uses [TanStack Router](https://tanstack.com/router). The initial setup is a code based router. Which means that the routes are defined in code (in the `./src/main.<%= jsx %>` file). If you like you can also use a file based routing setup by following the [File Based Routing](https://tanstack.com/router/latest/docs/framework/solid/guide/file-based-routing) guide.<% } %>
|
|
30
|
-
|
|
31
|
-
### Adding A Route
|
|
32
|
-
<% if (fileRouter) { %>
|
|
33
|
-
To add a new route to your application just add another a new file in the `./src/routes` directory.
|
|
34
|
-
|
|
35
|
-
TanStack will automatically generate the content of the route file for you.
|
|
36
|
-
<% } else { %>
|
|
37
|
-
To add a new route to your application just add another `createRoute` call to the `./src/main.<%= jsx %>` file. The example below adds a new `/about`route to the root route.
|
|
38
|
-
|
|
39
|
-
```tsx
|
|
40
|
-
const aboutRoute = createRoute({
|
|
41
|
-
getParentRoute: () => rootRoute,
|
|
42
|
-
path: "/about",
|
|
43
|
-
component: () => <h1>About</h1>,
|
|
44
|
-
});
|
|
45
|
-
```
|
|
46
38
|
|
|
47
|
-
|
|
39
|
+
This project uses [TanStack Router](https://tanstack.com/router) with file-based routing. Routes are managed as files in `src/routes`.
|
|
48
40
|
|
|
49
|
-
|
|
50
|
-
const routeTree = rootRoute.addChildren([indexRoute, aboutRoute]);
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
With this set up you should be able to navigate to `/about` and see the about page.
|
|
54
|
-
|
|
55
|
-
Of course you don't need to implement the About page in the `main.<%= jsx %>` file. You can create that component in another file and import it into the `main.<%= jsx %>` file, then use it in the `component` property of the `createRoute` call, like so:
|
|
56
|
-
|
|
57
|
-
```tsx
|
|
58
|
-
import About from "./components/About.<%= jsx %>";
|
|
41
|
+
### Adding A Route
|
|
59
42
|
|
|
60
|
-
|
|
61
|
-
getParentRoute: () => rootRoute,
|
|
62
|
-
path: "/about",
|
|
63
|
-
component: About,
|
|
64
|
-
});
|
|
65
|
-
```
|
|
43
|
+
To add a new route to your application just add a new file in the `./src/routes` directory.
|
|
66
44
|
|
|
67
|
-
|
|
45
|
+
TanStack will automatically generate the content of the route file for you.
|
|
68
46
|
|
|
69
|
-
For more information on the options you have when you are creating code based routes check out the [Code Based Routing](https://tanstack.com/router/latest/docs/framework/solid/guide/code-based-routing) documentation.
|
|
70
|
-
<% } %>
|
|
71
47
|
Now that you have two routes you can use a `Link` component to navigate between them.
|
|
72
48
|
|
|
73
49
|
### Adding Links
|
|
@@ -90,71 +66,23 @@ More information on the `Link` component can be found in the [Link documentation
|
|
|
90
66
|
|
|
91
67
|
### Using A Layout
|
|
92
68
|
|
|
93
|
-
|
|
94
|
-
Layouts can be used to wrap the contents of the routes in menus, headers, footers, etc.
|
|
95
|
-
|
|
96
|
-
There is already a layout in the `src/main.<%= jsx %>` file:
|
|
97
|
-
|
|
98
|
-
```tsx
|
|
99
|
-
const rootRoute = createRootRoute({
|
|
100
|
-
component: () => (
|
|
101
|
-
<>
|
|
102
|
-
<Outlet />
|
|
103
|
-
<TanStackRouterDevtools />
|
|
104
|
-
</>
|
|
105
|
-
),
|
|
106
|
-
});
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
You can use the Soliid component specified in the `component` property of the `rootRoute` to wrap the contents of the routes. The `<Outlet />` component is used to render the current route within the body of the layout. For example you could add a header to the layout like so:
|
|
69
|
+
In the File Based Routing setup the layout is located in `src/routes/__root.tsx`. Anything you add to the root route will appear in all the routes.
|
|
110
70
|
|
|
111
|
-
|
|
112
|
-
import { Link } from "@tanstack/solid-router";
|
|
71
|
+
More information on layouts can be found in the [Layouts documentation](https://tanstack.com/router/latest/docs/framework/solid/guide/routing-concepts#layouts).
|
|
113
72
|
|
|
114
|
-
|
|
115
|
-
component: () => (
|
|
116
|
-
<>
|
|
117
|
-
<header>
|
|
118
|
-
<nav>
|
|
119
|
-
<Link to="/">Home</Link>
|
|
120
|
-
<Link to="/about">About</Link>
|
|
121
|
-
</nav>
|
|
122
|
-
</header>
|
|
123
|
-
<Outlet />
|
|
124
|
-
<TanStackRouterDevtools />
|
|
125
|
-
</>
|
|
126
|
-
),
|
|
127
|
-
});
|
|
128
|
-
```
|
|
129
|
-
<% } else { %>In the File Based Routing setup the layout is located in `src/routes/__root.tsx`. Anything you add to the root route will appear in all the routes. The route content will appear in the JSX where you use the `<Outlet />` component.
|
|
73
|
+
## Server Functions
|
|
130
74
|
|
|
131
|
-
|
|
75
|
+
TanStack Start provides server functions that allow you to write server-side code that seamlessly integrates with your client components.
|
|
132
76
|
|
|
133
77
|
```tsx
|
|
134
|
-
import {
|
|
135
|
-
import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'
|
|
78
|
+
import { createServerFn } from '@tanstack/solid-start'
|
|
136
79
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
<>
|
|
142
|
-
<header>
|
|
143
|
-
<nav>
|
|
144
|
-
<Link to="/">Home</Link>
|
|
145
|
-
<Link to="/about">About</Link>
|
|
146
|
-
</nav>
|
|
147
|
-
</header>
|
|
148
|
-
<Outlet />
|
|
149
|
-
<TanStackRouterDevtools />
|
|
150
|
-
</>
|
|
151
|
-
),
|
|
80
|
+
const getServerTime = createServerFn({
|
|
81
|
+
method: 'GET',
|
|
82
|
+
}).handler(async () => {
|
|
83
|
+
return new Date().toISOString()
|
|
152
84
|
})
|
|
153
85
|
```
|
|
154
|
-
<% } %>
|
|
155
|
-
The `<TanStackRouterDevtools />` component is not required so you can remove it if you don't want it in your layout.
|
|
156
|
-
|
|
157
|
-
More information on layouts can be found in the [Layouts documentation](https://tanstack.com/router/latest/docs/framework/solid/guide/routing-concepts#layouts).
|
|
158
86
|
|
|
159
87
|
## Data Fetching
|
|
160
88
|
|
|
@@ -163,30 +91,26 @@ There are multiple ways to fetch data in your application. You can use TanStack
|
|
|
163
91
|
For example:
|
|
164
92
|
|
|
165
93
|
```tsx
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
94
|
+
import { createFileRoute } from '@tanstack/solid-router'
|
|
95
|
+
|
|
96
|
+
export const Route = createFileRoute('/people')({
|
|
169
97
|
loader: async () => {
|
|
170
|
-
const response = await fetch(
|
|
171
|
-
return response.json()
|
|
172
|
-
results: {
|
|
173
|
-
name: string;
|
|
174
|
-
}[];
|
|
175
|
-
}>;
|
|
176
|
-
<% } else { %>
|
|
177
|
-
return response.json();
|
|
178
|
-
<% } %> },
|
|
179
|
-
component: () => {
|
|
180
|
-
const data = peopleRoute.useLoaderData();
|
|
181
|
-
return (
|
|
182
|
-
<ul>
|
|
183
|
-
{data.results.map((person) => (
|
|
184
|
-
<li key={person.name}>{person.name}</li>
|
|
185
|
-
))}
|
|
186
|
-
</ul>
|
|
187
|
-
);
|
|
98
|
+
const response = await fetch('https://swapi.dev/api/people')
|
|
99
|
+
return response.json()
|
|
188
100
|
},
|
|
189
|
-
|
|
101
|
+
component: PeopleComponent,
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
function PeopleComponent() {
|
|
105
|
+
const data = Route.useLoaderData()
|
|
106
|
+
return (
|
|
107
|
+
<ul>
|
|
108
|
+
<For each={data().results}>
|
|
109
|
+
{(person) => <li>{person.name}</li>}
|
|
110
|
+
</For>
|
|
111
|
+
</ul>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
190
114
|
```
|
|
191
115
|
|
|
192
116
|
Loaders simplify your data fetching logic dramatically. Check out more information in the [Loader documentation](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#loader-parameters).
|
|
@@ -213,3 +137,5 @@ This project uses [eslint](https://eslint.org/) and [prettier](https://prettier.
|
|
|
213
137
|
# Learn More
|
|
214
138
|
|
|
215
139
|
You can learn more about all of the offerings from TanStack in the [TanStack documentation](https://tanstack.com).
|
|
140
|
+
|
|
141
|
+
For TanStack Start specific documentation, visit [TanStack Start](https://tanstack.com/start).
|
|
@@ -3,19 +3,24 @@
|
|
|
3
3
|
"private": true,
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"dev": "vite --port 3000",
|
|
7
|
-
"build": "vite build
|
|
6
|
+
"dev": "vite dev --port 3000",
|
|
7
|
+
"build": "vite build",
|
|
8
|
+
"start": "node .output/server/index.mjs",
|
|
8
9
|
"preview": "vite preview",
|
|
9
10
|
"test": "vitest run"
|
|
10
11
|
},
|
|
11
12
|
"dependencies": {
|
|
12
13
|
"@tanstack/solid-router": "^1.133.20",
|
|
13
14
|
"@tanstack/solid-router-devtools": "^1.133.20",
|
|
15
|
+
"@tanstack/solid-router-ssr-query": "^1.132.25",
|
|
14
16
|
"@tanstack/solid-start": "^1.133.20",
|
|
15
|
-
"solid
|
|
17
|
+
"lucide-solid": "^0.544.0",
|
|
18
|
+
"solid-js": "^1.9.9",
|
|
19
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
16
20
|
},
|
|
17
21
|
"devDependencies": {
|
|
18
22
|
"@tanstack/devtools-vite": "^0.3.11",
|
|
23
|
+
"vite-plugin-lucide-preprocess": "^1.4.6",
|
|
19
24
|
"vite-plugin-solid": "^2.11.10",
|
|
20
25
|
"typescript": "^5.7.2",
|
|
21
26
|
"vite": "^7.1.7"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<% if (addOns.length === 0 && integrations.length === 0 && routes.length === 0) { ignoreFile() } %>import { Link } from '@tanstack/solid-router'
|
|
2
2
|
<% for(const integration of integrations.filter(i => i.type === 'header-user')) { %>
|
|
3
3
|
import <%= integration.jsName %> from "<%= relativePath(integration.path) %>";
|
|
4
|
-
<% } %><%
|
|
4
|
+
<% } %><%
|
|
5
5
|
const icons = new Set([
|
|
6
6
|
"Menu",
|
|
7
7
|
"X",
|
|
@@ -23,10 +23,9 @@ import { createSignal } from 'solid-js';
|
|
|
23
23
|
import {
|
|
24
24
|
<%= Array.from(icons).sort().join(", ") %>
|
|
25
25
|
} from "lucide-solid";
|
|
26
|
-
<% } %>
|
|
27
26
|
|
|
28
27
|
export default function Header() {
|
|
29
|
-
<%
|
|
28
|
+
<%
|
|
30
29
|
const menusWithChildren = addOns.filter(a => a.routes?.some(r => r.children));
|
|
31
30
|
const userHeaders = integrations.filter(i => i.type === 'header-user');
|
|
32
31
|
%>
|
|
@@ -151,26 +150,4 @@ const userHeaders = integrations.filter(i => i.type === 'header-user');
|
|
|
151
150
|
</aside>
|
|
152
151
|
</>
|
|
153
152
|
);
|
|
154
|
-
<% } else { %>
|
|
155
|
-
return (
|
|
156
|
-
<header class="p-2 flex gap-2 bg-white text-black justify-between">
|
|
157
|
-
<nav class="flex flex-row">
|
|
158
|
-
<div class="px-2 font-bold">
|
|
159
|
-
<Link to="/">Home</Link>
|
|
160
|
-
</div>
|
|
161
|
-
<% for(const addOn of addOns) {
|
|
162
|
-
for(const route of (addOn?.routes||[])?.filter(r => r.url && r.name)) { %>
|
|
163
|
-
<div class="px-2 font-bold"><Link to="<%= route.url %>"><%= route.name %></Link></div>
|
|
164
|
-
<% } } %>
|
|
165
|
-
</nav>
|
|
166
|
-
<% if (integrations.filter(i => i.type === 'header-user').length > 0) { %>
|
|
167
|
-
<div>
|
|
168
|
-
<% for(const integration of integrations.filter(i => i.type === 'header-user')) { %>
|
|
169
|
-
<<%= integration.jsName %> />
|
|
170
|
-
<% } %>
|
|
171
|
-
</div>
|
|
172
|
-
<% } %>
|
|
173
|
-
</header>
|
|
174
|
-
)
|
|
175
|
-
<% } %>
|
|
176
153
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { HeadContent, Outlet, Scripts, createRootRouteWithContext } from '@tanstack/solid-router'
|
|
2
2
|
import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'
|
|
3
3
|
|
|
4
4
|
<% if (addOnEnabled['solid-ui']) { %>
|
|
5
5
|
import "@fontsource/inter"
|
|
6
6
|
<% } %>
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { Suspense } from 'solid-js'
|
|
11
|
-
<% } %>
|
|
8
|
+
import { HydrationScript } from 'solid-js/web'
|
|
9
|
+
import { Suspense } from 'solid-js'
|
|
12
10
|
|
|
13
11
|
<% if (addOns.length || integrations.length || routes.length) { %>import Header from '../components/Header'
|
|
14
12
|
<% } %>
|
|
@@ -26,7 +24,6 @@ export const Route = createRootRouteWithContext()({
|
|
|
26
24
|
shellComponent: RootComponent,
|
|
27
25
|
})
|
|
28
26
|
|
|
29
|
-
<% if (addOnEnabled.start) { %>
|
|
30
27
|
function RootComponent() {
|
|
31
28
|
return (
|
|
32
29
|
<html>
|
|
@@ -50,27 +47,3 @@ function RootComponent() {
|
|
|
50
47
|
</html>
|
|
51
48
|
);
|
|
52
49
|
}
|
|
53
|
-
<% } else { %>
|
|
54
|
-
function RootComponent() {
|
|
55
|
-
return (
|
|
56
|
-
<>
|
|
57
|
-
<% for(const integration of integrations.filter(i => i.type === 'provider')) { %>
|
|
58
|
-
<<%= integration.jsName %>>
|
|
59
|
-
<% } %>
|
|
60
|
-
<HeadContent />
|
|
61
|
-
<% if (addOns.length || integrations.length || routes.length) { %>
|
|
62
|
-
<Header />
|
|
63
|
-
<% } %>
|
|
64
|
-
<Outlet />
|
|
65
|
-
<TanStackRouterDevtools />
|
|
66
|
-
<% for(const integration of integrations.filter(i => i.type === 'layout')) { %>
|
|
67
|
-
<<%= integration.jsName %> />
|
|
68
|
-
<% } %>
|
|
69
|
-
<% for(const integration of integrations.filter(i => i.type === 'provider').reverse()) { %>
|
|
70
|
-
</<%= integration.jsName %>>
|
|
71
|
-
<% } %>
|
|
72
|
-
<Scripts />
|
|
73
|
-
</>
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
<% } %>
|