@tanstack/cta-engine 0.14.3 → 0.14.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/dist/add-ons.js +5 -91
- package/dist/add-to-app.js +171 -0
- package/dist/config-file.js +34 -11
- package/dist/constants.js +0 -2
- package/dist/create-app.js +142 -451
- package/dist/custom-add-ons/add-on.js +175 -0
- package/dist/custom-add-ons/shared.js +116 -0
- package/dist/custom-add-ons/starter.js +84 -0
- package/dist/environment.js +67 -44
- package/dist/file-helpers.js +165 -0
- package/dist/frameworks.js +92 -0
- package/dist/index.js +18 -1
- package/dist/integrations/git.js +4 -0
- package/dist/integrations/shadcn.js +33 -0
- package/dist/options.js +9 -333
- package/dist/package-json.js +48 -0
- package/dist/package-manager.js +51 -6
- package/dist/registry.js +56 -0
- package/dist/special-steps/index.js +24 -0
- package/dist/special-steps/rimraf-node-modules.js +16 -0
- package/dist/template-file.js +112 -0
- package/dist/types/add-ons.d.ts +3 -8
- package/dist/types/add-to-app.d.ts +17 -0
- package/dist/types/config-file.d.ts +7 -4
- package/dist/types/constants.d.ts +0 -3
- package/dist/types/create-app.d.ts +1 -7
- package/dist/types/custom-add-ons/add-on.d.ts +69 -0
- package/dist/types/custom-add-ons/shared.d.ts +15 -0
- package/dist/types/custom-add-ons/starter.d.ts +7 -0
- package/dist/types/environment.d.ts +2 -1
- package/dist/types/file-helpers.d.ts +15 -0
- package/dist/types/frameworks.d.ts +7 -0
- package/dist/types/index.d.ts +21 -1
- package/dist/types/integrations/git.d.ts +2 -0
- package/dist/types/integrations/shadcn.d.ts +2 -0
- package/dist/types/options.d.ts +2 -6
- package/dist/types/package-json.d.ts +7 -0
- package/dist/types/package-manager.d.ts +18 -1
- package/dist/types/registry.d.ts +25 -0
- package/dist/types/special-steps/index.d.ts +2 -0
- package/dist/types/special-steps/rimraf-node-modules.d.ts +2 -0
- package/dist/types/template-file.d.ts +2 -0
- package/dist/types/types.d.ts +788 -85
- package/dist/types/utils.d.ts +5 -0
- package/dist/types.js +65 -1
- package/dist/utils.js +9 -0
- package/package.json +9 -12
- package/src/add-ons.ts +7 -123
- package/src/add-to-app.ts +276 -0
- package/src/config-file.ts +51 -20
- package/src/constants.ts +0 -5
- package/src/create-app.ts +180 -730
- package/src/custom-add-ons/add-on.ts +261 -0
- package/src/custom-add-ons/shared.ts +160 -0
- package/src/custom-add-ons/starter.ts +126 -0
- package/src/environment.ts +80 -45
- package/src/file-helpers.ts +235 -0
- package/src/frameworks.ts +134 -0
- package/src/index.ts +85 -1
- package/src/integrations/git.ts +7 -0
- package/src/integrations/shadcn.ts +54 -0
- package/src/options.ts +8 -409
- package/src/package-json.ts +69 -0
- package/src/package-manager.ts +80 -9
- package/src/registry.ts +92 -0
- package/src/special-steps/index.ts +36 -0
- package/src/special-steps/rimraf-node-modules.ts +25 -0
- package/src/template-file.ts +150 -0
- package/src/types.ts +175 -87
- package/src/utils.ts +17 -0
- package/tests/add-ons.test.ts +67 -0
- package/tests/add-to-app.test.ts +358 -0
- package/tests/config-file.test.ts +105 -0
- package/tests/create-app.test.ts +120 -0
- package/tests/custom-add-ons/add-on.test.ts +12 -0
- package/tests/custom-add-ons/shared.test.ts +253 -0
- package/tests/custom-add-ons/starter.test.ts +58 -0
- package/tests/environment.test.ts +115 -0
- package/tests/file-helper.test.ts +90 -0
- package/tests/frameworks.test.ts +95 -0
- package/tests/index.test.ts +9 -0
- package/tests/integrations/git.test.ts +20 -0
- package/tests/integrations/shadcn.test.ts +91 -0
- package/tests/options.test.ts +42 -0
- package/tests/package-json.test.ts +63 -0
- package/tests/package-manager.test.ts +154 -0
- package/tests/setupVitest.ts +6 -0
- package/tests/template-file.test.ts +178 -0
- package/tests/utils.test.ts +23 -0
- package/vitest.config.ts +21 -0
- package/dist/add.js +0 -125
- package/dist/cli.js +0 -132
- package/dist/custom-add-on.js +0 -254
- package/dist/file-helper.js +0 -18
- package/dist/mcp.js +0 -229
- package/dist/templates.js +0 -6
- package/dist/toolchain.js +0 -6
- package/dist/types/add.d.ts +0 -3
- package/dist/types/cli.d.ts +0 -7
- package/dist/types/custom-add-on.d.ts +0 -3
- package/dist/types/file-helper.d.ts +0 -2
- package/dist/types/mcp.d.ts +0 -7
- package/dist/types/templates.d.ts +0 -1
- package/dist/types/toolchain.d.ts +0 -3
- package/src/add.ts +0 -186
- package/src/cli.ts +0 -210
- package/src/custom-add-on.ts +0 -325
- package/src/file-helper.ts +0 -20
- package/src/mcp.ts +0 -302
- package/src/templates.ts +0 -7
- package/src/toolchain.ts +0 -7
- package/templates/react/add-on/clerk/README.md +0 -3
- package/templates/react/add-on/clerk/assets/_dot_env.local.append +0 -2
- package/templates/react/add-on/clerk/assets/src/integrations/clerk/header-user.tsx +0 -19
- package/templates/react/add-on/clerk/assets/src/integrations/clerk/provider.tsx +0 -18
- package/templates/react/add-on/clerk/assets/src/routes/demo.clerk.tsx +0 -20
- package/templates/react/add-on/clerk/info.json +0 -13
- package/templates/react/add-on/clerk/package.json +0 -5
- package/templates/react/add-on/convex/README.md +0 -4
- package/templates/react/add-on/convex/assets/_dot_cursorrules.append +0 -93
- package/templates/react/add-on/convex/assets/_dot_env.local.append +0 -3
- package/templates/react/add-on/convex/assets/convex/products.ts +0 -8
- package/templates/react/add-on/convex/assets/convex/schema.ts +0 -10
- package/templates/react/add-on/convex/assets/src/integrations/convex/provider.tsx +0 -20
- package/templates/react/add-on/convex/assets/src/routes/demo.convex.tsx +0 -33
- package/templates/react/add-on/convex/info.json +0 -13
- package/templates/react/add-on/convex/package.json +0 -6
- package/templates/react/add-on/form/assets/src/components/demo.FormComponents.tsx.ejs +0 -300
- package/templates/react/add-on/form/assets/src/hooks/demo.form-context.ts +0 -4
- package/templates/react/add-on/form/assets/src/hooks/demo.form.ts +0 -22
- package/templates/react/add-on/form/assets/src/routes/demo.form.address.tsx.ejs +0 -213
- package/templates/react/add-on/form/assets/src/routes/demo.form.simple.tsx.ejs +0 -77
- package/templates/react/add-on/form/info.json +0 -26
- package/templates/react/add-on/form/package.json +0 -6
- package/templates/react/add-on/module-federation/assets/module-federation.config.js.ejs +0 -31
- package/templates/react/add-on/module-federation/assets/src/demo-mf-component.tsx +0 -3
- package/templates/react/add-on/module-federation/assets/src/demo-mf-self-contained.tsx +0 -11
- package/templates/react/add-on/module-federation/info.json +0 -7
- package/templates/react/add-on/module-federation/package.json +0 -5
- package/templates/react/add-on/netlify/README.md +0 -11
- package/templates/react/add-on/netlify/info.json +0 -7
- package/templates/react/add-on/sentry/assets/_dot_cursorrules.append +0 -22
- package/templates/react/add-on/sentry/assets/_dot_env.local.append +0 -11
- package/templates/react/add-on/sentry/assets/src/app/global-middleware.ts +0 -11
- package/templates/react/add-on/sentry/assets/src/routes/demo.sentry.testing.tsx +0 -489
- package/templates/react/add-on/sentry/info.json +0 -14
- package/templates/react/add-on/sentry/package.json +0 -5
- package/templates/react/add-on/shadcn/README.md +0 -7
- package/templates/react/add-on/shadcn/assets/_dot_cursorrules.append +0 -7
- package/templates/react/add-on/shadcn/assets/components.json +0 -21
- package/templates/react/add-on/shadcn/assets/src/lib/utils.ts +0 -6
- package/templates/react/add-on/shadcn/assets/src/styles.css +0 -138
- package/templates/react/add-on/shadcn/info.json +0 -7
- package/templates/react/add-on/shadcn/package.json +0 -9
- package/templates/react/add-on/start/assets/_dot_gitignore.append +0 -2
- package/templates/react/add-on/start/assets/app.config.ts.ejs +0 -32
- package/templates/react/add-on/start/assets/src/api.ts +0 -6
- package/templates/react/add-on/start/assets/src/client.tsx.ejs +0 -33
- package/templates/react/add-on/start/assets/src/router.tsx.ejs +0 -48
- package/templates/react/add-on/start/assets/src/routes/api.demo-names.ts +0 -11
- package/templates/react/add-on/start/assets/src/routes/demo.start.api-request.tsx.ejs +0 -33
- package/templates/react/add-on/start/assets/src/routes/demo.start.server-funcs.tsx +0 -50
- package/templates/react/add-on/start/assets/src/ssr.tsx.ejs +0 -30
- package/templates/react/add-on/start/info.json +0 -18
- package/templates/react/add-on/start/package.json +0 -13
- package/templates/react/add-on/store/assets/src/lib/demo-store.ts +0 -13
- package/templates/react/add-on/store/assets/src/routes/demo.store.tsx.ejs +0 -75
- package/templates/react/add-on/store/info.json +0 -13
- package/templates/react/add-on/store/package.json +0 -6
- package/templates/react/add-on/t3env/README.md +0 -16
- package/templates/react/add-on/t3env/assets/src/env.ts +0 -39
- package/templates/react/add-on/t3env/info.json +0 -10
- package/templates/react/add-on/t3env/package.json +0 -6
- package/templates/react/add-on/tRPC/assets/src/integrations/trpc/init.ts +0 -9
- package/templates/react/add-on/tRPC/assets/src/integrations/trpc/react.ts +0 -4
- package/templates/react/add-on/tRPC/assets/src/integrations/trpc/router.ts +0 -18
- package/templates/react/add-on/tRPC/assets/src/routes/api.trpc.$.tsx +0 -16
- package/templates/react/add-on/tRPC/info.json +0 -9
- package/templates/react/add-on/tRPC/package.json +0 -9
- package/templates/react/add-on/table/assets/src/data/demo-table-data.ts +0 -50
- package/templates/react/add-on/table/assets/src/routes/demo.table.tsx.ejs +0 -373
- package/templates/react/add-on/table/info.json +0 -13
- package/templates/react/add-on/table/package.json +0 -7
- package/templates/react/add-on/tanstack-query/assets/src/integrations/tanstack-query/layout.tsx +0 -5
- package/templates/react/add-on/tanstack-query/assets/src/integrations/tanstack-query/root-provider.tsx.ejs +0 -70
- package/templates/react/add-on/tanstack-query/assets/src/routes/demo.tanstack-query.tsx.ejs +0 -53
- package/templates/react/add-on/tanstack-query/info.json +0 -13
- package/templates/react/add-on/tanstack-query/package.json +0 -6
- package/templates/react/base/README.md.ejs +0 -558
- package/templates/react/base/_dot_gitignore +0 -5
- package/templates/react/base/_dot_vscode/settings.biome.json +0 -38
- package/templates/react/base/_dot_vscode/settings.json +0 -11
- package/templates/react/base/index.html.ejs +0 -20
- package/templates/react/base/package.biome.json +0 -10
- package/templates/react/base/package.eslintprettier.json +0 -11
- package/templates/react/base/package.json +0 -30
- package/templates/react/base/package.ts.json +0 -7
- package/templates/react/base/package.tw.json +0 -6
- package/templates/react/base/public/favicon.ico +0 -0
- package/templates/react/base/public/logo192.png +0 -0
- package/templates/react/base/public/logo512.png +0 -0
- package/templates/react/base/public/manifest.json +0 -25
- package/templates/react/base/public/robots.txt +0 -3
- package/templates/react/base/src/App.css +0 -38
- package/templates/react/base/src/App.test.tsx.ejs +0 -10
- package/templates/react/base/src/App.tsx.ejs +0 -74
- package/templates/react/base/src/components/Header.tsx.ejs +0 -27
- package/templates/react/base/src/logo.svg +0 -44
- package/templates/react/base/src/reportWebVitals.ts.ejs +0 -28
- package/templates/react/base/src/styles.css.ejs +0 -15
- package/templates/react/base/toolchain/.prettierignore +0 -3
- package/templates/react/base/toolchain/biome.json +0 -31
- package/templates/react/base/toolchain/eslint.config.js +0 -5
- package/templates/react/base/toolchain/prettier.config.js +0 -10
- package/templates/react/base/tsconfig.json.ejs +0 -29
- package/templates/react/base/vite.config.js.ejs +0 -23
- package/templates/react/code-router/src/main.tsx.ejs +0 -92
- package/templates/react/example/tanchat/README.md +0 -37
- package/templates/react/example/tanchat/assets/_dot_env.local.append +0 -2
- package/templates/react/example/tanchat/assets/public/example-guitar-flowers.jpg +0 -0
- package/templates/react/example/tanchat/assets/public/example-guitar-motherboard.jpg +0 -0
- package/templates/react/example/tanchat/assets/public/example-guitar-racing.jpg +0 -0
- package/templates/react/example/tanchat/assets/public/example-guitar-steamer-trunk.jpg +0 -0
- package/templates/react/example/tanchat/assets/public/example-guitar-superhero.jpg +0 -0
- package/templates/react/example/tanchat/assets/public/example-guitar-traveling.jpg +0 -0
- package/templates/react/example/tanchat/assets/public/example-guitar-video-games.jpg +0 -0
- package/templates/react/example/tanchat/assets/src/components/example-AIAssistant.tsx +0 -173
- package/templates/react/example/tanchat/assets/src/components/example-GuitarRecommendation.tsx +0 -47
- package/templates/react/example/tanchat/assets/src/data/example-guitars.ts +0 -83
- package/templates/react/example/tanchat/assets/src/demo.index.css +0 -220
- package/templates/react/example/tanchat/assets/src/integrations/tanchat/header-user.tsx +0 -5
- package/templates/react/example/tanchat/assets/src/routes/api.messages.ts +0 -24
- package/templates/react/example/tanchat/assets/src/routes/api.sse.ts +0 -23
- package/templates/react/example/tanchat/assets/src/routes/example.chat.tsx +0 -159
- package/templates/react/example/tanchat/assets/src/routes/example.guitars/$guitarId.tsx +0 -50
- package/templates/react/example/tanchat/assets/src/routes/example.guitars/index.tsx +0 -54
- package/templates/react/example/tanchat/assets/src/store/example-assistant.ts +0 -3
- package/templates/react/example/tanchat/assets/src/utils/demo.ai.ts +0 -62
- package/templates/react/example/tanchat/assets/src/utils/demo.sse.ts +0 -31
- package/templates/react/example/tanchat/assets/src/utils/demo.tools.ts +0 -47
- package/templates/react/example/tanchat/info.json +0 -19
- package/templates/react/example/tanchat/package.json +0 -16
- package/templates/react/file-router/package.fr.json +0 -5
- package/templates/react/file-router/src/main.tsx.ejs +0 -55
- package/templates/react/file-router/src/routes/__root.tsx.ejs +0 -82
- package/templates/solid/add-on/form/assets/src/routes/demo.form.tsx.ejs +0 -352
- package/templates/solid/add-on/form/info.json +0 -13
- package/templates/solid/add-on/form/package.json +0 -5
- package/templates/solid/add-on/module-federation/assets/module-federation.config.js.ejs +0 -27
- package/templates/solid/add-on/module-federation/assets/src/demo-mf-component.tsx +0 -3
- package/templates/solid/add-on/module-federation/assets/src/demo-mf-self-contained.tsx +0 -9
- package/templates/solid/add-on/module-federation/info.json +0 -7
- package/templates/solid/add-on/module-federation/package.json +0 -5
- package/templates/solid/add-on/sentry/assets/_dot_cursorrules.append +0 -22
- package/templates/solid/add-on/sentry/assets/_dot_env.local.append +0 -2
- package/templates/solid/add-on/sentry/assets/src/routes/demo.sentry.bad-event-handler.tsx +0 -20
- package/templates/solid/add-on/sentry/info.json +0 -13
- package/templates/solid/add-on/sentry/package.json +0 -5
- package/templates/solid/add-on/solid-ui/README.md +0 -9
- package/templates/solid/add-on/solid-ui/assets/src/lib/utils.ts +0 -6
- package/templates/solid/add-on/solid-ui/assets/src/styles.css +0 -138
- package/templates/solid/add-on/solid-ui/assets/ui.config.json +0 -13
- package/templates/solid/add-on/solid-ui/info.json +0 -11
- package/templates/solid/add-on/solid-ui/package.json +0 -9
- package/templates/solid/add-on/start/assets/app.config.ts +0 -16
- package/templates/solid/add-on/start/assets/src/api.ts +0 -6
- package/templates/solid/add-on/start/assets/src/client.tsx +0 -7
- package/templates/solid/add-on/start/assets/src/router.tsx.ejs +0 -24
- package/templates/solid/add-on/start/assets/src/routes/demo.start.server-funcs.tsx +0 -49
- package/templates/solid/add-on/start/assets/src/ssr.tsx +0 -12
- package/templates/solid/add-on/start/info.json +0 -14
- package/templates/solid/add-on/start/package.json +0 -12
- package/templates/solid/add-on/store/assets/src/lib/demo-store.ts +0 -13
- package/templates/solid/add-on/store/assets/src/routes/demo.store.tsx.ejs +0 -77
- package/templates/solid/add-on/store/info.json +0 -13
- package/templates/solid/add-on/store/package.json +0 -6
- package/templates/solid/add-on/t3env/README.md +0 -16
- package/templates/solid/add-on/t3env/assets/src/env.ts +0 -39
- package/templates/solid/add-on/t3env/info.json +0 -10
- package/templates/solid/add-on/t3env/package.json +0 -6
- package/templates/solid/add-on/tanstack-query/assets/src/integrations/tanstack-query/header-user.tsx +0 -5
- package/templates/solid/add-on/tanstack-query/assets/src/integrations/tanstack-query/provider.tsx +0 -15
- package/templates/solid/add-on/tanstack-query/assets/src/routes/demo.tanstack-query.tsx +0 -30
- package/templates/solid/add-on/tanstack-query/info.json +0 -13
- package/templates/solid/add-on/tanstack-query/package.json +0 -6
- package/templates/solid/base/README.md.ejs +0 -215
- package/templates/solid/base/_dot_cursorrules.append +0 -35
- package/templates/solid/base/_dot_gitignore +0 -5
- package/templates/solid/base/_dot_vscode/settings.biome.json +0 -38
- package/templates/solid/base/_dot_vscode/settings.json +0 -11
- package/templates/solid/base/index.html.ejs +0 -20
- package/templates/solid/base/package.biome.json +0 -10
- package/templates/solid/base/package.eslintprettier.json +0 -11
- package/templates/solid/base/package.json +0 -23
- package/templates/solid/base/package.ts.json +0 -5
- package/templates/solid/base/package.tw.json +0 -6
- package/templates/solid/base/public/favicon.ico +0 -0
- package/templates/solid/base/public/logo192.png +0 -0
- package/templates/solid/base/public/logo512.png +0 -0
- package/templates/solid/base/public/manifest.json +0 -25
- package/templates/solid/base/public/robots.txt +0 -3
- package/templates/solid/base/src/App.css +0 -0
- package/templates/solid/base/src/App.tsx.ejs +0 -47
- package/templates/solid/base/src/components/Header.tsx.ejs +0 -26
- package/templates/solid/base/src/logo.svg +0 -120
- package/templates/solid/base/src/styles.css.ejs +0 -15
- package/templates/solid/base/toolchain/.prettierignore +0 -3
- package/templates/solid/base/toolchain/biome.json +0 -31
- package/templates/solid/base/toolchain/eslint.config.js +0 -5
- package/templates/solid/base/toolchain/prettier.config.js +0 -10
- package/templates/solid/base/tsconfig.json.ejs +0 -31
- package/templates/solid/base/vite.config.js.ejs +0 -22
- package/templates/solid/code-router/src/main.tsx.ejs +0 -71
- package/templates/solid/example/tanchat/README.md +0 -52
- package/templates/solid/example/tanchat/assets/ai-streaming-server/README.md +0 -110
- package/templates/solid/example/tanchat/assets/ai-streaming-server/_dot_env.example +0 -1
- package/templates/solid/example/tanchat/assets/ai-streaming-server/package.json +0 -26
- package/templates/solid/example/tanchat/assets/ai-streaming-server/src/index.ts +0 -102
- package/templates/solid/example/tanchat/assets/ai-streaming-server/tsconfig.json +0 -15
- package/templates/solid/example/tanchat/assets/src/components/demo.SettingsDialog.tsx +0 -149
- package/templates/solid/example/tanchat/assets/src/demo.index.css +0 -227
- package/templates/solid/example/tanchat/assets/src/lib/demo-store.ts +0 -13
- package/templates/solid/example/tanchat/assets/src/routes/example.chat.tsx +0 -435
- package/templates/solid/example/tanchat/assets/src/store/demo.hooks.ts +0 -17
- package/templates/solid/example/tanchat/assets/src/store/demo.store.ts +0 -133
- package/templates/solid/example/tanchat/info.json +0 -14
- package/templates/solid/example/tanchat/package.json +0 -7
- package/templates/solid/file-router/package.fr.json +0 -5
- package/templates/solid/file-router/src/main.tsx.ejs +0 -47
- package/templates/solid/file-router/src/routes/__root.tsx.ejs +0 -41
- package/templates/solid/file-router/src/routes/index.tsx +0 -43
- package/tests/cra.test.ts +0 -293
- package/tests/snapshots/cra/cr-js-npm.json +0 -33
- package/tests/snapshots/cra/cr-ts-npm.json +0 -34
- package/tests/snapshots/cra/cr-ts-start-npm.json +0 -38
- package/tests/snapshots/cra/fr-ts-npm.json +0 -34
- package/tests/snapshots/cra/fr-ts-tw-npm.json +0 -33
- package/tests/snapshots/cra/solid-cr-js-npm.json +0 -31
- package/tests/snapshots/cra/solid-cr-ts-npm.json +0 -32
- package/tests/snapshots/cra/solid-cr-ts-start-npm.json +0 -36
- package/tests/snapshots/cra/solid-fr-ts-npm.json +0 -33
- package/tests/snapshots/cra/solid-fr-ts-tw-npm.json +0 -32
- package/tests/test-utilities.ts +0 -87
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from '@tanstack/solid-start/config'
|
|
2
|
-
import viteTsConfigPaths from 'vite-tsconfig-paths'
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
tsr: {
|
|
6
|
-
appDirectory: 'src',
|
|
7
|
-
},
|
|
8
|
-
vite: {
|
|
9
|
-
plugins: [
|
|
10
|
-
// this is the plugin that enables path aliases
|
|
11
|
-
viteTsConfigPaths({
|
|
12
|
-
projects: ['./tsconfig.json'],
|
|
13
|
-
}),
|
|
14
|
-
],
|
|
15
|
-
},
|
|
16
|
-
})
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { createRouter as createTanstackRouter } from '@tanstack/solid-router'
|
|
2
|
-
|
|
3
|
-
// Import the generated route tree
|
|
4
|
-
import { routeTree } from './routeTree.gen'
|
|
5
|
-
|
|
6
|
-
import './styles.css'
|
|
7
|
-
|
|
8
|
-
// Create a new router instance
|
|
9
|
-
export const createRouter = () => {
|
|
10
|
-
const router = createTanstackRouter({
|
|
11
|
-
routeTree,
|
|
12
|
-
scrollRestoration: true,
|
|
13
|
-
})
|
|
14
|
-
return router
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const router = createRouter()
|
|
18
|
-
|
|
19
|
-
// Register the router instance for type safety
|
|
20
|
-
declare module '@tanstack/solid-router' {
|
|
21
|
-
interface Register {
|
|
22
|
-
router: typeof router
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs'
|
|
2
|
-
import { createFileRoute, useRouter } from '@tanstack/solid-router'
|
|
3
|
-
import { createServerFn } from '@tanstack/solid-start'
|
|
4
|
-
|
|
5
|
-
const filePath = 'count.txt'
|
|
6
|
-
|
|
7
|
-
async function readCount() {
|
|
8
|
-
return parseInt(
|
|
9
|
-
await fs.promises.readFile(filePath, 'utf-8').catch(() => '0'),
|
|
10
|
-
)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const getCount = createServerFn({
|
|
14
|
-
method: 'GET',
|
|
15
|
-
}).handler(() => {
|
|
16
|
-
return readCount()
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
const updateCount = createServerFn({ method: 'POST' })
|
|
20
|
-
.validator((d: number) => d)
|
|
21
|
-
.handler(async ({ data }) => {
|
|
22
|
-
const count = await readCount()
|
|
23
|
-
await fs.promises.writeFile(filePath, `${count + data}`)
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
export const Route = createFileRoute('/demo/start/server-funcs')({
|
|
27
|
-
component: Home,
|
|
28
|
-
loader: async () => await getCount(),
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
function Home() {
|
|
32
|
-
const router = useRouter()
|
|
33
|
-
const state = Route.useLoaderData()
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<div class="p-4">
|
|
37
|
-
<button
|
|
38
|
-
onClick={() => {
|
|
39
|
-
updateCount({ data: 1 }).then(() => {
|
|
40
|
-
router.invalidate()
|
|
41
|
-
})
|
|
42
|
-
}}
|
|
43
|
-
claclassssName="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
|
|
44
|
-
>
|
|
45
|
-
Add 1 to {state}?
|
|
46
|
-
</button>
|
|
47
|
-
</div>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createStartHandler,
|
|
3
|
-
defaultStreamHandler,
|
|
4
|
-
} from '@tanstack/solid-start/server'
|
|
5
|
-
import { getRouterManifest } from '@tanstack/solid-start/router-manifest'
|
|
6
|
-
|
|
7
|
-
import { createRouter } from './router'
|
|
8
|
-
|
|
9
|
-
export default createStartHandler({
|
|
10
|
-
createRouter,
|
|
11
|
-
getRouterManifest,
|
|
12
|
-
})(defaultStreamHandler)
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Start",
|
|
3
|
-
"phase": "setup",
|
|
4
|
-
"description": "Add TanStack Start for SSR, API endpoints, and more.",
|
|
5
|
-
"link": "https://tanstack.com/start/latest",
|
|
6
|
-
"templates": ["file-router"],
|
|
7
|
-
"warning": "TanStack Start is not yet at 1.0 and may change significantly or not be compatible with other add-ons.",
|
|
8
|
-
"routes": [
|
|
9
|
-
{
|
|
10
|
-
"url": "/demo/start/server-funcs",
|
|
11
|
-
"name": "Start - Server Functions"
|
|
12
|
-
}
|
|
13
|
-
]
|
|
14
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
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()
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { <% if (fileRouter) { %>createFileRoute<% } else { %>createRoute<% } %> } from '@tanstack/solid-router'
|
|
2
|
-
import { useStore } from '@tanstack/solid-store'
|
|
3
|
-
|
|
4
|
-
import { fullName, store } from '../lib/demo-store'
|
|
5
|
-
|
|
6
|
-
<% if (codeRouter) { %>
|
|
7
|
-
import type { RootRoute } from '@tanstack/solid-router'
|
|
8
|
-
<% } else { %>
|
|
9
|
-
export const Route = createFileRoute('/demo/store')({
|
|
10
|
-
component: DemoStore,
|
|
11
|
-
})
|
|
12
|
-
<% } %>
|
|
13
|
-
|
|
14
|
-
function FirstName() {
|
|
15
|
-
const firstName = useStore(store, (state) => state.firstName)
|
|
16
|
-
return (
|
|
17
|
-
<input
|
|
18
|
-
type="text"
|
|
19
|
-
value={firstName()}
|
|
20
|
-
onInput={(e) =>
|
|
21
|
-
store.setState((state) => ({ ...state, firstName: e.target.value }))
|
|
22
|
-
}
|
|
23
|
-
class="bg-white/10 rounded-lg px-4 py-2 outline-none border border-white/20 hover:border-white/40 focus:border-white/60 transition-colors duration-200 placeholder-white/40"
|
|
24
|
-
/>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function LastName() {
|
|
29
|
-
const lastName = useStore(store, (state) => state.lastName)
|
|
30
|
-
return (
|
|
31
|
-
<input
|
|
32
|
-
type="text"
|
|
33
|
-
value={lastName()}
|
|
34
|
-
onInput={(e) =>
|
|
35
|
-
store.setState((state) => ({ ...state, lastName: e.target.value }))
|
|
36
|
-
}
|
|
37
|
-
class="bg-white/10 rounded-lg px-4 py-2 outline-none border border-white/20 hover:border-white/40 focus:border-white/60 transition-colors duration-200 placeholder-white/40"
|
|
38
|
-
/>
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function FullName() {
|
|
43
|
-
const fName = useStore(fullName)
|
|
44
|
-
return (
|
|
45
|
-
<div class="bg-white/10 rounded-lg px-4 py-2 outline-none ">
|
|
46
|
-
{fName}
|
|
47
|
-
</div>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function DemoStore() {
|
|
52
|
-
return (
|
|
53
|
-
<div
|
|
54
|
-
class="min-h-[calc(100vh-32px)] text-white p-8 flex items-center justify-center w-full h-full"
|
|
55
|
-
style={{
|
|
56
|
-
'background-image':
|
|
57
|
-
'radial-gradient(50% 50% at 80% 80%, #f4a460 0%, #8b4513 70%, #1a0f0a 100%)',
|
|
58
|
-
}}
|
|
59
|
-
>
|
|
60
|
-
<div class="bg-white/10 backdrop-blur-lg rounded-xl p-8 shadow-lg flex flex-col gap-4 text-3xl min-w-1/2">
|
|
61
|
-
<h1 class="text-4xl font-bold mb-5">Store Example</h1>
|
|
62
|
-
<FirstName />
|
|
63
|
-
<LastName />
|
|
64
|
-
<FullName />
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
<% if (codeRouter) { %>
|
|
71
|
-
export default (parentRoute: RootRoute) => createRoute({
|
|
72
|
-
path: '/demo/store',
|
|
73
|
-
component: DemoStore,
|
|
74
|
-
getParentRoute: () => parentRoute,
|
|
75
|
-
})
|
|
76
|
-
<% } %>
|
|
77
|
-
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Store",
|
|
3
|
-
"description": "Add TanStack Store to your application.",
|
|
4
|
-
"phase": "add-on",
|
|
5
|
-
"templates": ["file-router", "code-router"],
|
|
6
|
-
"link": "https://tanstack.com/store/latest",
|
|
7
|
-
"routes": [
|
|
8
|
-
{
|
|
9
|
-
"url": "/demo/store",
|
|
10
|
-
"name": "Store"
|
|
11
|
-
}
|
|
12
|
-
]
|
|
13
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
## T3Env
|
|
2
|
-
|
|
3
|
-
- You can use T3Env to add type safety to your environment variables.
|
|
4
|
-
- Add Environment variables to the `src/env.mjs` file.
|
|
5
|
-
- Use the environment variables in your code.
|
|
6
|
-
|
|
7
|
-
### Usage
|
|
8
|
-
|
|
9
|
-
```ts
|
|
10
|
-
import { env } from "@/env";
|
|
11
|
-
|
|
12
|
-
console.log(env.VITE_APP_TITLE);
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { createEnv } from "@t3-oss/env-core";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
export const env = createEnv({
|
|
5
|
-
server: {
|
|
6
|
-
SERVER_URL: z.string().url().optional(),
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* The prefix that client-side variables must have. This is enforced both at
|
|
11
|
-
* a type-level and at runtime.
|
|
12
|
-
*/
|
|
13
|
-
clientPrefix: "VITE_",
|
|
14
|
-
|
|
15
|
-
client: {
|
|
16
|
-
VITE_APP_TITLE: z.string().min(1).optional(),
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* What object holds the environment variables at runtime. This is usually
|
|
21
|
-
* `process.env` or `import.meta.env`.
|
|
22
|
-
*/
|
|
23
|
-
runtimeEnv: import.meta.env,
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* By default, this library will feed the environment variables directly to
|
|
27
|
-
* the Zod validator.
|
|
28
|
-
*
|
|
29
|
-
* This means that if you have an empty string for a value that is supposed
|
|
30
|
-
* to be a number (e.g. `PORT=` in a ".env" file), Zod will incorrectly flag
|
|
31
|
-
* it as a type mismatch violation. Additionally, if you have an empty string
|
|
32
|
-
* for a value that is supposed to be a string with a default value (e.g.
|
|
33
|
-
* `DOMAIN=` in an ".env" file), the default value will never be applied.
|
|
34
|
-
*
|
|
35
|
-
* In order to solve these issues, we recommend that all new projects
|
|
36
|
-
* explicitly specify this option as true.
|
|
37
|
-
*/
|
|
38
|
-
emptyStringAsUndefined: true,
|
|
39
|
-
});
|
package/templates/solid/add-on/tanstack-query/assets/src/integrations/tanstack-query/provider.tsx
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { QueryClient, QueryClientProvider } from '@tanstack/solid-query'
|
|
2
|
-
|
|
3
|
-
import type { JSX } from 'solid-js'
|
|
4
|
-
|
|
5
|
-
const queryClient = new QueryClient()
|
|
6
|
-
|
|
7
|
-
export default function AppTanstackQueryProvider(props: {
|
|
8
|
-
children: JSX.Element
|
|
9
|
-
}) {
|
|
10
|
-
return (
|
|
11
|
-
<QueryClientProvider client={queryClient}>
|
|
12
|
-
{props.children}
|
|
13
|
-
</QueryClientProvider>
|
|
14
|
-
)
|
|
15
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { createFileRoute } from '@tanstack/solid-router'
|
|
2
|
-
import { createQuery } from '@tanstack/solid-query'
|
|
3
|
-
|
|
4
|
-
export const Route = createFileRoute('/demo/tanstack-query')({
|
|
5
|
-
component: App,
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
function App() {
|
|
9
|
-
const peopleQuery = createQuery(() => ({
|
|
10
|
-
queryKey: ['people'],
|
|
11
|
-
queryFn: () =>
|
|
12
|
-
fetch('https://swapi.dev/api/people')
|
|
13
|
-
.then((res) => res.json())
|
|
14
|
-
.then((data) => data.results as Array<{ name: string }>),
|
|
15
|
-
initialData: [],
|
|
16
|
-
}))
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div class="p-4">
|
|
20
|
-
<h1 class="text-2xl mb-4">People list from Swapi</h1>
|
|
21
|
-
<ul>
|
|
22
|
-
{peopleQuery.data.map((person) => (
|
|
23
|
-
<li>{person.name}</li>
|
|
24
|
-
))}
|
|
25
|
-
</ul>
|
|
26
|
-
</div>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default App
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "TanStack Query",
|
|
3
|
-
"description": "Integrate TanStack Query into your application.",
|
|
4
|
-
"phase": "add-on",
|
|
5
|
-
"templates": ["file-router"],
|
|
6
|
-
"link": "https://tanstack.com/query/latest",
|
|
7
|
-
"routes": [
|
|
8
|
-
{
|
|
9
|
-
"url": "/demo/tanstack-query",
|
|
10
|
-
"name": "TanStack Query"
|
|
11
|
-
}
|
|
12
|
-
]
|
|
13
|
-
}
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
Welcome to your new TanStack app!
|
|
2
|
-
|
|
3
|
-
# Getting Started
|
|
4
|
-
|
|
5
|
-
To run this application:
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
<%= packageManager %> install
|
|
9
|
-
<%= getPackageManagerRunScript('start') %>
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
# Building For Production
|
|
13
|
-
|
|
14
|
-
To build this application for production:
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
<%= getPackageManagerRunScript('build') %>
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Styling
|
|
21
|
-
|
|
22
|
-
This project uses [Tailwind CSS](https://tailwindcss.com/) for styling.
|
|
23
|
-
|
|
24
|
-
<% for(const addon of addOns.filter(addon => addon.readme)) { %>
|
|
25
|
-
<%- addon.readme %>
|
|
26
|
-
<% } %>
|
|
27
|
-
|
|
28
|
-
## 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 fiels 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
|
-
|
|
47
|
-
You will also need to add the route to the `routeTree` in the `./src/main.<%= jsx %>` file.
|
|
48
|
-
|
|
49
|
-
```tsx
|
|
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 %>";
|
|
59
|
-
|
|
60
|
-
const aboutRoute = createRoute({
|
|
61
|
-
getParentRoute: () => rootRoute,
|
|
62
|
-
path: "/about",
|
|
63
|
-
component: About,
|
|
64
|
-
});
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
That is how we have the `App` component set up with the home page.
|
|
68
|
-
|
|
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
|
-
Now that you have two routes you can use a `Link` component to navigate between them.
|
|
72
|
-
|
|
73
|
-
### Adding Links
|
|
74
|
-
|
|
75
|
-
To use SPA (Single Page Application) navigation you will need to import the `Link` component from `@tanstack/solid-router`.
|
|
76
|
-
|
|
77
|
-
```tsx
|
|
78
|
-
import { Link } from "@tanstack/solid-router";
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
Then anywhere in your JSX you can use it like so:
|
|
82
|
-
|
|
83
|
-
```tsx
|
|
84
|
-
<Link to="/about">About</Link>
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
This will create a link that will navigate to the `/about` route.
|
|
88
|
-
|
|
89
|
-
More information on the `Link` component can be found in the [Link documentation](https://tanstack.com/router/v1/docs/framework/solid/api/router/linkComponent).
|
|
90
|
-
|
|
91
|
-
### Using A Layout
|
|
92
|
-
|
|
93
|
-
<% if (codeRouter) { %>
|
|
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:
|
|
110
|
-
|
|
111
|
-
```tsx
|
|
112
|
-
import { Link } from "@tanstack/solid-router";
|
|
113
|
-
|
|
114
|
-
const rootRoute = createRootRoute({
|
|
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.
|
|
130
|
-
|
|
131
|
-
Here is an example layout that includes a header:
|
|
132
|
-
|
|
133
|
-
```tsx
|
|
134
|
-
import { Outlet, createRootRoute } from '@tanstack/solid-router'
|
|
135
|
-
import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'
|
|
136
|
-
|
|
137
|
-
import { Link } from "@tanstack/solid-router";
|
|
138
|
-
|
|
139
|
-
export const Route = createRootRoute({
|
|
140
|
-
component: () => (
|
|
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
|
-
),
|
|
152
|
-
})
|
|
153
|
-
```
|
|
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
|
-
|
|
159
|
-
## Data Fetching
|
|
160
|
-
|
|
161
|
-
There are multiple ways to fetch data in your application. You can use TanStack Query to fetch data from a server. But you can also use the `loader` functionality built into TanStack Router to load the data for a route before it's rendered.
|
|
162
|
-
|
|
163
|
-
For example:
|
|
164
|
-
|
|
165
|
-
```tsx
|
|
166
|
-
const peopleRoute = createRoute({
|
|
167
|
-
getParentRoute: () => rootRoute,
|
|
168
|
-
path: "/people",
|
|
169
|
-
loader: async () => {
|
|
170
|
-
const response = await fetch("https://swapi.dev/api/people");<% if (typescript) { %>
|
|
171
|
-
return response.json() as Promise<{
|
|
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
|
-
);
|
|
188
|
-
},
|
|
189
|
-
});
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
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).
|
|
193
|
-
|
|
194
|
-
# Demo files
|
|
195
|
-
|
|
196
|
-
Files prefixed with `demo` can be safely deleted. They are there to provide a starting point for you to play around with the features you've installed.
|
|
197
|
-
|
|
198
|
-
<% if (toolchain && toolchain !== 'none') { %>
|
|
199
|
-
## Linting & Formatting
|
|
200
|
-
<% if (toolchain === 'biome') { %>
|
|
201
|
-
This project uses [Biome](https://biomejs.dev/) for linting and formatting. The following scripts are available:
|
|
202
|
-
<% } %>
|
|
203
|
-
<% if (toolchain === 'eslint+prettier') { %>
|
|
204
|
-
This project uses [eslint](https://eslint.org/) and [prettier](https://prettier.io/) for linting and formatting. Eslint is configured using [tanstack/eslint-config](https://tanstack.com/config/latest/docs/eslint). The following scripts are available:
|
|
205
|
-
<% } %>
|
|
206
|
-
```bash
|
|
207
|
-
<%= getPackageManagerRunScript('lint') %>
|
|
208
|
-
<%= getPackageManagerRunScript('format') %>
|
|
209
|
-
<%= getPackageManagerRunScript('check') %>
|
|
210
|
-
```
|
|
211
|
-
<% } %>
|
|
212
|
-
|
|
213
|
-
# Learn More
|
|
214
|
-
|
|
215
|
-
You can learn more about all of the offerings from TanStack in the [TanStack documentation](https://tanstack.com).
|