diff --git a/frameworks/solid/hosts/cloudflare/assets/wrangler.jsonc b/frameworks/solid/hosts/cloudflare/assets/wrangler.jsonc new file mode 100644 index 00000000..810654d3 --- /dev/null +++ b/frameworks/solid/hosts/cloudflare/assets/wrangler.jsonc @@ -0,0 +1,9 @@ +{ + "$schema": "node_modules/wrangler/config-schema.json", + "name": "tanstack-start-app", + "compatibility_date": "2025-09-02", + "compatibility_flags": [ + "nodejs_compat" + ], + "main": "@tanstack/solid-start/server-entry" +} \ No newline at end of file diff --git a/frameworks/solid/hosts/cloudflare/info.json b/frameworks/solid/hosts/cloudflare/info.json new file mode 100644 index 00000000..512312ac --- /dev/null +++ b/frameworks/solid/hosts/cloudflare/info.json @@ -0,0 +1,16 @@ +{ + "name": "Cloudflare", + "description": "Cloudflare deployment setup", + "link": "https://developers.cloudflare.com/workers/vite-plugin/", + "phase": "add-on", + "modes": ["file-router", "code-router"], + "type": "host", + "priority": 200, + "integrations": [ + { + "type": "vite-plugin", + "import": "import { cloudflare } from '@cloudflare/vite-plugin'", + "code": "cloudflare({ viteEnvironment: { name: 'ssr' } })" + } + ] +} diff --git a/frameworks/solid/hosts/cloudflare/package.json b/frameworks/solid/hosts/cloudflare/package.json new file mode 100644 index 00000000..109d0729 --- /dev/null +++ b/frameworks/solid/hosts/cloudflare/package.json @@ -0,0 +1,11 @@ +{ + "scripts": { + "deploy": "wrangler deploy" + }, + "dependencies": { + "@cloudflare/vite-plugin": "^1.13.8" + }, + "devDependencies": { + "wrangler": "^4.40.3" + } +} diff --git a/frameworks/solid/hosts/cloudflare/small-logo.svg b/frameworks/solid/hosts/cloudflare/small-logo.svg new file mode 100644 index 00000000..0d601bff --- /dev/null +++ b/frameworks/solid/hosts/cloudflare/small-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frameworks/solid/hosts/netlify/assets/netlify.toml b/frameworks/solid/hosts/netlify/assets/netlify.toml new file mode 100644 index 00000000..5b73675b --- /dev/null +++ b/frameworks/solid/hosts/netlify/assets/netlify.toml @@ -0,0 +1,6 @@ +[build] + command = "vite build" + dir = "dist/client" +[dev] + command = "vite dev" + port = 3000 diff --git a/frameworks/solid/hosts/netlify/info.json b/frameworks/solid/hosts/netlify/info.json new file mode 100644 index 00000000..9a91235c --- /dev/null +++ b/frameworks/solid/hosts/netlify/info.json @@ -0,0 +1,16 @@ +{ + "name": "Netlify", + "description": "Netlify deployment setup", + "link": "https://docs.netlify.com", + "phase": "add-on", + "modes": ["file-router", "code-router"], + "type": "host", + "priority": 180, + "integrations": [ + { + "type": "vite-plugin", + "import": "import netlify from '@netlify/vite-plugin-tanstack-start'", + "code": "netlify()" + } + ] +} diff --git a/frameworks/solid/hosts/netlify/package.json b/frameworks/solid/hosts/netlify/package.json new file mode 100644 index 00000000..d0e29861 --- /dev/null +++ b/frameworks/solid/hosts/netlify/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@netlify/vite-plugin-tanstack-start": "^1.0.2" + } +} diff --git a/frameworks/solid/hosts/netlify/small-logo.svg b/frameworks/solid/hosts/netlify/small-logo.svg new file mode 100644 index 00000000..24ea4c4b --- /dev/null +++ b/frameworks/solid/hosts/netlify/small-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frameworks/solid/hosts/nitro/package.json b/frameworks/solid/hosts/nitro/package.json index 2fe4bd39..684e0523 100644 --- a/frameworks/solid/hosts/nitro/package.json +++ b/frameworks/solid/hosts/nitro/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "@tanstack/nitro-v2-vite-plugin": "^1.132.31" + "@tanstack/nitro-v2-vite-plugin": "^1.133.19" } } diff --git a/frameworks/solid/project/base/package.json b/frameworks/solid/project/base/package.json index ec262776..f937166d 100644 --- a/frameworks/solid/project/base/package.json +++ b/frameworks/solid/project/base/package.json @@ -9,13 +9,13 @@ "test": "vitest run" }, "dependencies": { - "@tanstack/solid-router": "^1.132.25", - "@tanstack/solid-router-devtools": "^1.132.25", - "@tanstack/solid-start": "^1.132.25", - "solid-js": "^1.9.5" + "@tanstack/solid-router": "^1.133.20", + "@tanstack/solid-router-devtools": "^1.133.20", + "@tanstack/solid-start": "^1.133.20", + "solid-js": "^1.9.9" }, "devDependencies": { - "vite-plugin-solid": "^2.11.2", + "vite-plugin-solid": "^2.11.10", "typescript": "^5.7.2", "vite": "^7.1.7" } diff --git a/frameworks/solid/project/base/src/routes/__root.tsx.ejs b/frameworks/solid/project/base/src/routes/__root.tsx.ejs index d579ba9f..e565c365 100644 --- a/frameworks/solid/project/base/src/routes/__root.tsx.ejs +++ b/frameworks/solid/project/base/src/routes/__root.tsx.ejs @@ -11,6 +11,7 @@ import "@fontsource/inter" for(const init of addOn.main?.initialize || []) { %> <%- init %> <% } } %> +import { HydrationScript } from 'solid-js/web' import styleCss from "../styles.css?url"; @@ -23,23 +24,30 @@ export const Route = createRootRouteWithContext()({ function RootComponent() { return ( - <> - <% for(const integration of integrations.filter(i => i.type === 'provider')) { %> - <<%= integration.jsName %>> - <% } %> - - <% if (addOns.length || integrations.length || routes.length) { %> -
- <% } %> - - - <% for(const integration of integrations.filter(i => i.type === 'layout')) { %> - <<%= integration.jsName %> /> - <% } %> - <% for(const integration of integrations.filter(i => i.type === 'provider').reverse()) { %> - > - <% } %> - - + + + + + + + + <% for(const integration of integrations.filter(i => i.type === 'provider')) { %> + <<%= integration.jsName %>> + <% } %> + <% if (addOns.length || integrations.length || routes.length) { %> +
+ <% } %> + + + <% for(const integration of integrations.filter(i => i.type === 'layout')) { %> + <<%= integration.jsName %> /> + <% } %> + <% for(const integration of integrations.filter(i => i.type === 'provider').reverse()) { %> + > + <% } %> + + + + ) } diff --git a/frameworks/solid/project/packages.json b/frameworks/solid/project/packages.json index b2cb3be2..f92711fb 100644 --- a/frameworks/solid/project/packages.json +++ b/frameworks/solid/project/packages.json @@ -12,7 +12,7 @@ }, "file-router": { "dependencies": { - "@tanstack/router-plugin": "^1.121.3" + "@tanstack/router-plugin": "^1.133.21" } } } diff --git a/frameworks/solid/tests/snapshots/solid/solid-cr-js-npm.json b/frameworks/solid/tests/snapshots/solid/solid-cr-js-npm.json index bbebf781..803ecaa6 100644 --- a/frameworks/solid/tests/snapshots/solid/solid-cr-js-npm.json +++ b/frameworks/solid/tests/snapshots/solid/solid-cr-js-npm.json @@ -12,7 +12,7 @@ "/src/styles.css": "@import \"tailwindcss\";\n\nbody {\n @apply m-0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n}\n", "README.md": "Welcome to your new TanStack app! \n\n# Getting Started\n\nTo run this application:\n\n```bash\nnpm install\nnpm run start\n```\n\n# Building For Production\n\nTo build this application for production:\n\n```bash\nnpm run build\n```\n\n## Styling\n\nThis project uses [Tailwind CSS](https://tailwindcss.com/) for styling.\n\n\n\n## Routing\nThis 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.\n\n### Adding A Route\n\nTo 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.\n\n```tsx\nconst aboutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/about\",\n component: () =>

About

,\n});\n```\n\nYou will also need to add the route to the `routeTree` in the `./src/main.jsx` file.\n\n```tsx\nconst routeTree = rootRoute.addChildren([indexRoute, aboutRoute]);\n```\n\nWith this set up you should be able to navigate to `/about` and see the about page.\n\nOf 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:\n\n```tsx\nimport About from \"./components/About.jsx\";\n\nconst aboutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/about\",\n component: About,\n});\n```\n\nThat is how we have the `App` component set up with the home page.\n\nFor 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.\n\nNow that you have two routes you can use a `Link` component to navigate between them.\n\n### Adding Links\n\nTo use SPA (Single Page Application) navigation you will need to import the `Link` component from `@tanstack/solid-router`.\n\n```tsx\nimport { Link } from \"@tanstack/solid-router\";\n```\n\nThen anywhere in your JSX you can use it like so:\n\n```tsx\nAbout\n```\n\nThis will create a link that will navigate to the `/about` route.\n\nMore information on the `Link` component can be found in the [Link documentation](https://tanstack.com/router/v1/docs/framework/solid/api/router/linkComponent).\n\n### Using A Layout\n\n\nLayouts can be used to wrap the contents of the routes in menus, headers, footers, etc.\n\nThere is already a layout in the `src/main.jsx` file:\n\n```tsx\nconst rootRoute = createRootRoute({\n component: () => (\n <>\n \n \n \n ),\n});\n```\n\nYou can use the Soliid component specified in the `component` property of the `rootRoute` to wrap the contents of the routes. The `` 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:\n\n```tsx\nimport { Link } from \"@tanstack/solid-router\";\n\nconst rootRoute = createRootRoute({\n component: () => (\n <>\n
\n \n
\n \n \n \n ),\n});\n```\n\nThe `` component is not required so you can remove it if you don't want it in your layout.\n\nMore information on layouts can be found in the [Layouts documentation](https://tanstack.com/router/latest/docs/framework/solid/guide/routing-concepts#layouts).\n\n## Data Fetching\n\nThere 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.\n\nFor example:\n\n```tsx\nconst peopleRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/people\",\n loader: async () => {\n const response = await fetch(\"https://swapi.dev/api/people\");\n return response.json();\n },\n component: () => {\n const data = peopleRoute.useLoaderData();\n return (\n
    \n {data.results.map((person) => (\n
  • {person.name}
  • \n ))}\n
\n );\n },\n});\n```\n\nLoaders 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).\n\n# Demo files\n\nFiles 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.\n\n\n\n# Learn More\n\nYou can learn more about all of the offerings from TanStack in the [TanStack documentation](https://tanstack.com).\n", "index.html": "\n\n \n \n \n \n \n \n \n \n Create TanStack App - app-ts\n \n \n
\n \n \n\n", - "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite --port 3000\",\n \"build\": \"vite build && tsc\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\"\n },\n \"dependencies\": {\n \"@tanstack/solid-router\": \"^1.132.25\",\n \"@tanstack/solid-router-devtools\": \"^1.132.25\",\n \"@tanstack/solid-start\": \"^1.132.25\",\n \"solid-js\": \"^1.9.5\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^7.1.7\",\n \"vite-plugin-solid\": \"^2.11.2\"\n }\n}", + "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite --port 3000\",\n \"build\": \"vite build && tsc\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\"\n },\n \"dependencies\": {\n \"@tanstack/solid-router\": \"^1.133.20\",\n \"@tanstack/solid-router-devtools\": \"^1.133.20\",\n \"@tanstack/solid-start\": \"^1.133.20\",\n \"solid-js\": \"^1.9.9\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^7.1.7\",\n \"vite-plugin-solid\": \"^2.11.10\"\n }\n}", "vite.config.js": "import { defineConfig } from 'vite'\n\nimport solidPlugin from 'vite-plugin-solid'\nimport tailwindcss from '@tailwindcss/vite'\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [solidPlugin(), tailwindcss()],\n})\n" }, "commands": [ diff --git a/frameworks/solid/tests/snapshots/solid/solid-cr-ts-npm.json b/frameworks/solid/tests/snapshots/solid/solid-cr-ts-npm.json index 1350c5f5..d1095ff6 100644 --- a/frameworks/solid/tests/snapshots/solid/solid-cr-ts-npm.json +++ b/frameworks/solid/tests/snapshots/solid/solid-cr-ts-npm.json @@ -12,7 +12,7 @@ "/src/styles.css": "@import \"tailwindcss\";\n\nbody {\n @apply m-0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n}\n", "README.md": "Welcome to your new TanStack app! \n\n# Getting Started\n\nTo run this application:\n\n```bash\nnpm install\nnpm run start\n```\n\n# Building For Production\n\nTo build this application for production:\n\n```bash\nnpm run build\n```\n\n## Styling\n\nThis project uses [Tailwind CSS](https://tailwindcss.com/) for styling.\n\n\n\n## Routing\nThis 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.tsx` 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.\n\n### Adding A Route\n\nTo add a new route to your application just add another `createRoute` call to the `./src/main.tsx` file. The example below adds a new `/about`route to the root route.\n\n```tsx\nconst aboutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/about\",\n component: () =>

About

,\n});\n```\n\nYou will also need to add the route to the `routeTree` in the `./src/main.tsx` file.\n\n```tsx\nconst routeTree = rootRoute.addChildren([indexRoute, aboutRoute]);\n```\n\nWith this set up you should be able to navigate to `/about` and see the about page.\n\nOf course you don't need to implement the About page in the `main.tsx` file. You can create that component in another file and import it into the `main.tsx` file, then use it in the `component` property of the `createRoute` call, like so:\n\n```tsx\nimport About from \"./components/About.tsx\";\n\nconst aboutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/about\",\n component: About,\n});\n```\n\nThat is how we have the `App` component set up with the home page.\n\nFor 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.\n\nNow that you have two routes you can use a `Link` component to navigate between them.\n\n### Adding Links\n\nTo use SPA (Single Page Application) navigation you will need to import the `Link` component from `@tanstack/solid-router`.\n\n```tsx\nimport { Link } from \"@tanstack/solid-router\";\n```\n\nThen anywhere in your JSX you can use it like so:\n\n```tsx\nAbout\n```\n\nThis will create a link that will navigate to the `/about` route.\n\nMore information on the `Link` component can be found in the [Link documentation](https://tanstack.com/router/v1/docs/framework/solid/api/router/linkComponent).\n\n### Using A Layout\n\n\nLayouts can be used to wrap the contents of the routes in menus, headers, footers, etc.\n\nThere is already a layout in the `src/main.tsx` file:\n\n```tsx\nconst rootRoute = createRootRoute({\n component: () => (\n <>\n \n \n \n ),\n});\n```\n\nYou can use the Soliid component specified in the `component` property of the `rootRoute` to wrap the contents of the routes. The `` 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:\n\n```tsx\nimport { Link } from \"@tanstack/solid-router\";\n\nconst rootRoute = createRootRoute({\n component: () => (\n <>\n
\n \n
\n \n \n \n ),\n});\n```\n\nThe `` component is not required so you can remove it if you don't want it in your layout.\n\nMore information on layouts can be found in the [Layouts documentation](https://tanstack.com/router/latest/docs/framework/solid/guide/routing-concepts#layouts).\n\n## Data Fetching\n\nThere 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.\n\nFor example:\n\n```tsx\nconst peopleRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/people\",\n loader: async () => {\n const response = await fetch(\"https://swapi.dev/api/people\");\n return response.json() as Promise<{\n results: {\n name: string;\n }[];\n }>;\n },\n component: () => {\n const data = peopleRoute.useLoaderData();\n return (\n
    \n {data.results.map((person) => (\n
  • {person.name}
  • \n ))}\n
\n );\n },\n});\n```\n\nLoaders 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).\n\n# Demo files\n\nFiles 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.\n\n\n\n# Learn More\n\nYou can learn more about all of the offerings from TanStack in the [TanStack documentation](https://tanstack.com).\n", "index.html": "\n\n \n \n \n \n \n \n \n \n Create TanStack App - app-ts\n \n \n
\n \n \n\n", - "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite --port 3000\",\n \"build\": \"vite build && tsc\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\"\n },\n \"dependencies\": {\n \"@tanstack/solid-router\": \"^1.132.25\",\n \"@tanstack/solid-router-devtools\": \"^1.132.25\",\n \"@tanstack/solid-start\": \"^1.132.25\",\n \"solid-js\": \"^1.9.5\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^7.1.7\",\n \"vite-plugin-solid\": \"^2.11.2\"\n }\n}", + "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite --port 3000\",\n \"build\": \"vite build && tsc\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\"\n },\n \"dependencies\": {\n \"@tanstack/solid-router\": \"^1.133.20\",\n \"@tanstack/solid-router-devtools\": \"^1.133.20\",\n \"@tanstack/solid-start\": \"^1.133.20\",\n \"solid-js\": \"^1.9.9\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^7.1.7\",\n \"vite-plugin-solid\": \"^2.11.10\"\n }\n}", "tsconfig.json": "{\n \"include\": [\"**/*.ts\", \"**/*.tsx\"],\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"jsx\": \"preserve\",\n \"jsxImportSource\": \"solid-js\",\n \"module\": \"ESNext\",\n \"lib\": [\"ES2022\", \"DOM\", \"DOM.Iterable\"],\n \"types\": [\"vite/client\"],\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"verbatimModuleSyntax\": true,\n \"noEmit\": true,\n\n /* Linting */\n \"skipLibCheck\": true,\n \"strict\": true,\n \"noUnusedLocals\": true,\n \"noUnusedParameters\": true,\n \"noFallthroughCasesInSwitch\": true,\n \"noUncheckedSideEffectImports\": true\n }\n}\n", "vite.config.ts": "import { defineConfig } from 'vite'\n\nimport solidPlugin from 'vite-plugin-solid'\nimport tailwindcss from '@tailwindcss/vite'\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [solidPlugin(), tailwindcss()],\n})\n" }, diff --git a/frameworks/solid/tests/snapshots/solid/solid-cr-ts-start-npm.json b/frameworks/solid/tests/snapshots/solid/solid-cr-ts-start-npm.json index 8a78c681..efc65c48 100644 --- a/frameworks/solid/tests/snapshots/solid/solid-cr-ts-start-npm.json +++ b/frameworks/solid/tests/snapshots/solid/solid-cr-ts-start-npm.json @@ -8,12 +8,12 @@ "/public/robots.txt": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n", "/src/components/Header.tsx": "import { Link } from '@tanstack/solid-router'\n\nimport { createSignal } from 'solid-js'\nimport {\n ChevronDown,\n ChevronRight,\n Globe,\n Home,\n Layers,\n Menu,\n X,\n} from 'lucide-solid'\n\nexport default function Header() {\n const [isOpen, setIsOpen] = createSignal(false)\n const [groupedExpanded, setGroupedExpanded] = createSignal<\n Record\n >({})\n\n return (\n <>\n
\n setIsOpen(true)}\n class=\"p-2 hover:bg-gray-700 rounded-lg transition-colors\"\n aria-label=\"Open menu\"\n >\n \n \n

\n \n \n \n

\n
\n\n \n
\n

Navigation

\n setIsOpen(false)}\n class=\"p-2 hover:bg-gray-800 rounded-lg transition-colors\"\n aria-label=\"Close menu\"\n >\n \n \n
\n\n \n \n \n )\n}\n", "/src/router.tsx": "import { createRouter } from '@tanstack/solid-router'\n\n// Import the generated route tree\nimport { routeTree } from './routeTree.gen'\n\n// Create a new router instance\nexport const getRouter = () => {\n const router = createRouter({\n routeTree,\n scrollRestoration: true,\n })\n return router\n}\n", - "/src/routes/__root.tsx": "import {\n HeadContent,\n Outlet,\n Scripts,\n createRootRouteWithContext,\n} from '@tanstack/solid-router'\nimport { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'\n\nimport Header from '../components/Header'\n\nimport styleCss from '../styles.css?url'\n\nexport const Route = createRootRouteWithContext()({\n head: () => ({\n links: [{ rel: 'stylesheet', href: styleCss }],\n }),\n shellComponent: RootComponent,\n})\n\nfunction RootComponent() {\n return (\n <>\n \n\n
\n\n \n \n\n \n \n )\n}\n", + "/src/routes/__root.tsx": "import {\n HeadContent,\n Outlet,\n Scripts,\n createRootRouteWithContext,\n} from '@tanstack/solid-router'\nimport { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'\n\nimport Header from '../components/Header'\n\nimport { HydrationScript } from 'solid-js/web'\n\nimport styleCss from '../styles.css?url'\n\nexport const Route = createRootRouteWithContext()({\n head: () => ({\n links: [{ rel: 'stylesheet', href: styleCss }],\n }),\n shellComponent: RootComponent,\n})\n\nfunction RootComponent() {\n return (\n \n \n \n \n \n \n \n
\n\n \n \n \n \n \n \n )\n}\n", "/src/routes/demo.start.server-funcs.tsx": "import * as fs from 'fs'\nimport { createFileRoute, useRouter } from '@tanstack/solid-router'\nimport { createServerFn } from '@tanstack/solid-start'\n\nconst filePath = 'count.txt'\n\nasync function readCount() {\n return parseInt(\n await fs.promises.readFile(filePath, 'utf-8').catch(() => '0'),\n )\n}\n\nconst getCount = createServerFn({\n method: 'GET',\n}).handler(() => {\n return readCount()\n})\n\nconst updateCount = createServerFn({ method: 'POST' })\n .inputValidator((d: number) => d)\n .handler(async ({ data }) => {\n const count = await readCount()\n await fs.promises.writeFile(filePath, `${count + data}`)\n })\n\nexport const Route = createFileRoute('/demo/start/server-funcs')({\n component: Home,\n loader: async () => await getCount(),\n})\n\nfunction Home() {\n const router = useRouter()\n const state = Route.useLoaderData()\n\n return (\n
\n {\n updateCount({ data: 1 }).then(() => {\n router.invalidate()\n })\n }}\n class=\"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded\"\n >\n Add 1 to {state()}?\n \n
\n )\n}\n", "/src/routes/index.tsx": "import { createFileRoute } from '@tanstack/solid-router'\nimport { For } from 'solid-js'\nimport {\n Zap,\n Server,\n Route as RouteIcon,\n Shield,\n Waves,\n Sparkles,\n} from 'lucide-solid'\n\nexport const Route = createFileRoute('/')({ component: App })\n\nfunction App() {\n const features = [\n {\n icon: ,\n title: 'Powerful Server Functions',\n description:\n 'Write server-side code that seamlessly integrates with your client components. Type-safe, secure, and simple.',\n },\n {\n icon: ,\n title: 'Flexible Server Side Rendering',\n description:\n 'Full-document SSR, streaming, and progressive enhancement out of the box. Control exactly what renders where.',\n },\n {\n icon: ,\n title: 'API Routes',\n description:\n 'Build type-safe API endpoints alongside your application. No separate backend needed.',\n },\n {\n icon: ,\n title: 'Strongly Typed Everything',\n description:\n 'End-to-end type safety from server to client. Catch errors before they reach production.',\n },\n {\n icon: ,\n title: 'Full Streaming Support',\n description:\n 'Stream data from server to client progressively. Perfect for AI applications and real-time updates.',\n },\n {\n icon: ,\n title: 'Next Generation Ready',\n description:\n 'Built from the ground up for modern web applications. Deploy anywhere JavaScript runs.',\n },\n ]\n\n return (\n
\n
\n
\n
\n
\n \n

\n TANSTACK{' '}\n \n START\n \n

\n
\n

\n The framework for next generation AI applications\n

\n

\n Full-stack framework powered by TanStack Router for React and Solid.\n Build modern applications with server functions, streaming, and type\n safety.\n

\n
\n \n Documentation\n \n

\n Begin your TanStack Start journey by editing{' '}\n \n /src/routes/index.tsx\n \n

\n
\n
\n
\n\n
\n
\n \n {(feature) => (\n
\n
{feature.icon}
\n

\n {feature.title}\n

\n

\n {feature.description}\n

\n
\n )}\n
\n
\n
\n
\n )\n}\n", "/src/styles.css": "@import \"tailwindcss\";\n\nbody {\n @apply m-0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n}\n", "README.md": "Welcome to your new TanStack app! \n\n# Getting Started\n\nTo run this application:\n\n```bash\nnpm install\nnpm run start\n```\n\n# Building For Production\n\nTo build this application for production:\n\n```bash\nnpm run build\n```\n\n## Styling\n\nThis project uses [Tailwind CSS](https://tailwindcss.com/) for styling.\n\n\n\n## Routing\nThis 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`.\n\n### Adding A Route\n\nTo add a new route to your application just add another a new file in the `./src/routes` directory.\n\nTanStack will automatically generate the content of the route file for you.\n\nNow that you have two routes you can use a `Link` component to navigate between them.\n\n### Adding Links\n\nTo use SPA (Single Page Application) navigation you will need to import the `Link` component from `@tanstack/solid-router`.\n\n```tsx\nimport { Link } from \"@tanstack/solid-router\";\n```\n\nThen anywhere in your JSX you can use it like so:\n\n```tsx\nAbout\n```\n\nThis will create a link that will navigate to the `/about` route.\n\nMore information on the `Link` component can be found in the [Link documentation](https://tanstack.com/router/v1/docs/framework/solid/api/router/linkComponent).\n\n### Using A Layout\n\nIn 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 `` component.\n\nHere is an example layout that includes a header:\n\n```tsx\nimport { Outlet, createRootRoute } from '@tanstack/solid-router'\nimport { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'\n\nimport { Link } from \"@tanstack/solid-router\";\n\nexport const Route = createRootRoute({\n component: () => (\n <>\n
\n \n
\n \n \n \n ),\n})\n```\n\nThe `` component is not required so you can remove it if you don't want it in your layout.\n\nMore information on layouts can be found in the [Layouts documentation](https://tanstack.com/router/latest/docs/framework/solid/guide/routing-concepts#layouts).\n\n## Data Fetching\n\nThere 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.\n\nFor example:\n\n```tsx\nconst peopleRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/people\",\n loader: async () => {\n const response = await fetch(\"https://swapi.dev/api/people\");\n return response.json() as Promise<{\n results: {\n name: string;\n }[];\n }>;\n },\n component: () => {\n const data = peopleRoute.useLoaderData();\n return (\n
    \n {data.results.map((person) => (\n
  • {person.name}
  • \n ))}\n
\n );\n },\n});\n```\n\nLoaders 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).\n\n# Demo files\n\nFiles 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.\n\n\n\n# Learn More\n\nYou can learn more about all of the offerings from TanStack in the [TanStack documentation](https://tanstack.com).\n", - "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite dev --port 3000\",\n \"build\": \"vite build\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\",\n \"start\": \"node .output/server/index.mjs\"\n },\n \"dependencies\": {\n \"@tailwindcss/vite\": \"^4.0.6\",\n \"@tanstack/router-plugin\": \"^1.121.3\",\n \"@tanstack/solid-router\": \"^1.132.25\",\n \"@tanstack/solid-router-devtools\": \"^1.132.25\",\n \"@tanstack/solid-start\": \"^1.132.25\",\n \"lucide-solid\": \"^0.544.0\",\n \"solid-js\": \"^1.9.5\",\n \"tailwindcss\": \"^4.0.6\",\n \"vite\": \"^7.1.7\",\n \"vite-tsconfig-paths\": \"^5.1.4\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^7.1.7\",\n \"vite-plugin-solid\": \"^2.11.2\"\n }\n}", + "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite dev --port 3000\",\n \"build\": \"vite build\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\",\n \"start\": \"node .output/server/index.mjs\"\n },\n \"dependencies\": {\n \"@tailwindcss/vite\": \"^4.0.6\",\n \"@tanstack/router-plugin\": \"^1.133.21\",\n \"@tanstack/solid-router\": \"^1.133.20\",\n \"@tanstack/solid-router-devtools\": \"^1.133.20\",\n \"@tanstack/solid-start\": \"^1.132.25\",\n \"lucide-solid\": \"^0.544.0\",\n \"solid-js\": \"^1.9.9\",\n \"tailwindcss\": \"^4.0.6\",\n \"vite\": \"^7.1.7\",\n \"vite-tsconfig-paths\": \"^5.1.4\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^7.1.7\",\n \"vite-plugin-solid\": \"^2.11.10\"\n }\n}", "tsconfig.json": "{\n \"include\": [\"**/*.ts\", \"**/*.tsx\"],\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"jsx\": \"preserve\",\n \"jsxImportSource\": \"solid-js\",\n \"module\": \"ESNext\",\n \"lib\": [\"ES2022\", \"DOM\", \"DOM.Iterable\"],\n \"types\": [\"vite/client\"],\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"verbatimModuleSyntax\": true,\n \"noEmit\": true,\n\n /* Linting */\n \"skipLibCheck\": true,\n \"strict\": true,\n \"noUnusedLocals\": true,\n \"noUnusedParameters\": true,\n \"noFallthroughCasesInSwitch\": true,\n \"noUncheckedSideEffectImports\": true\n }\n}\n", "vite.config.ts": "import { defineConfig } from 'vite'\nimport viteTsConfigPaths from 'vite-tsconfig-paths'\nimport tailwindcss from '@tailwindcss/vite'\n\nimport { tanstackStart } from '@tanstack/solid-start/plugin/vite'\nimport solidPlugin from 'vite-plugin-solid'\n\nexport default defineConfig({\n plugins: [\n // this is the plugin that enables path aliases\n viteTsConfigPaths({\n projects: ['./tsconfig.json'],\n }),\n tailwindcss(),\n tanstackStart(),\n solidPlugin({ ssr: true }),\n ],\n})\n" }, diff --git a/frameworks/solid/tests/snapshots/solid/solid-fr-ts-npm.json b/frameworks/solid/tests/snapshots/solid/solid-fr-ts-npm.json index 23c6031d..4675a9ed 100644 --- a/frameworks/solid/tests/snapshots/solid/solid-fr-ts-npm.json +++ b/frameworks/solid/tests/snapshots/solid/solid-fr-ts-npm.json @@ -8,12 +8,12 @@ "/public/robots.txt": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n", "/src/App.css": ".App {\n text-align: center;\n}\n\n.App-logo {\n height: 40vmin;\n pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .App-logo {\n animation: App-logo-spin infinite 20s linear;\n }\n}\n\n.App-header {\n background-color: #282c34;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-size: calc(10px + 2vmin);\n color: white;\n}\n\n.App-link {\n color: #61dafb;\n}\n\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}", "/src/main.tsx": "import { RouterProvider, createRouter } from '@tanstack/solid-router'\nimport { render } from 'solid-js/web'\n\nimport { routeTree } from './routeTree.gen'\nimport './styles.css'\n\nconst router = createRouter({\n routeTree,\n defaultPreload: 'intent',\n scrollRestoration: true,\n defaultPreloadStaleTime: 0,\n})\n\ndeclare module '@tanstack/solid-router' {\n interface Register {\n router: typeof router\n }\n}\n\nfunction App() {\n return (\n <>\n \n \n )\n}\n\nconst rootElement = document.getElementById('app')\nif (rootElement) {\n render(() => , rootElement)\n}\n", - "/src/routes/__root.tsx": "import {\n HeadContent,\n Outlet,\n Scripts,\n createRootRouteWithContext,\n} from '@tanstack/solid-router'\nimport { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'\n\nimport styleCss from '../styles.css?url'\n\nexport const Route = createRootRouteWithContext()({\n head: () => ({\n links: [{ rel: 'stylesheet', href: styleCss }],\n }),\n shellComponent: RootComponent,\n})\n\nfunction RootComponent() {\n return (\n <>\n \n\n \n \n\n \n \n )\n}\n", + "/src/routes/__root.tsx": "import {\n HeadContent,\n Outlet,\n Scripts,\n createRootRouteWithContext,\n} from '@tanstack/solid-router'\nimport { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'\n\nimport { HydrationScript } from 'solid-js/web'\n\nimport styleCss from '../styles.css?url'\n\nexport const Route = createRootRouteWithContext()({\n head: () => ({\n links: [{ rel: 'stylesheet', href: styleCss }],\n }),\n shellComponent: RootComponent,\n})\n\nfunction RootComponent() {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n )\n}\n", "/src/routes/index.tsx": "import * as Solid from 'solid-js'\nimport { createFileRoute } from '@tanstack/solid-router'\n\nimport logo from '../logo.svg'\n\nexport const Route = createFileRoute('/')({\n component: IndexComponent,\n})\n\nfunction IndexComponent() {\n return (\n
\n
\n \n

\n Edit src/routes/index.tsx and save to reload.\n

\n \n Learn Solid\n \n \n Learn TanStack\n \n
\n
\n )\n}\n", "/src/styles.css": "@import \"tailwindcss\";\n\nbody {\n @apply m-0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n}\n", "README.md": "Welcome to your new TanStack app! \n\n# Getting Started\n\nTo run this application:\n\n```bash\nnpm install\nnpm run start\n```\n\n# Building For Production\n\nTo build this application for production:\n\n```bash\nnpm run build\n```\n\n## Styling\n\nThis project uses [Tailwind CSS](https://tailwindcss.com/) for styling.\n\n\n\n## Routing\nThis 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`.\n\n### Adding A Route\n\nTo add a new route to your application just add another a new file in the `./src/routes` directory.\n\nTanStack will automatically generate the content of the route file for you.\n\nNow that you have two routes you can use a `Link` component to navigate between them.\n\n### Adding Links\n\nTo use SPA (Single Page Application) navigation you will need to import the `Link` component from `@tanstack/solid-router`.\n\n```tsx\nimport { Link } from \"@tanstack/solid-router\";\n```\n\nThen anywhere in your JSX you can use it like so:\n\n```tsx\nAbout\n```\n\nThis will create a link that will navigate to the `/about` route.\n\nMore information on the `Link` component can be found in the [Link documentation](https://tanstack.com/router/v1/docs/framework/solid/api/router/linkComponent).\n\n### Using A Layout\n\nIn 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 `` component.\n\nHere is an example layout that includes a header:\n\n```tsx\nimport { Outlet, createRootRoute } from '@tanstack/solid-router'\nimport { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'\n\nimport { Link } from \"@tanstack/solid-router\";\n\nexport const Route = createRootRoute({\n component: () => (\n <>\n
\n \n
\n \n \n \n ),\n})\n```\n\nThe `` component is not required so you can remove it if you don't want it in your layout.\n\nMore information on layouts can be found in the [Layouts documentation](https://tanstack.com/router/latest/docs/framework/solid/guide/routing-concepts#layouts).\n\n## Data Fetching\n\nThere 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.\n\nFor example:\n\n```tsx\nconst peopleRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/people\",\n loader: async () => {\n const response = await fetch(\"https://swapi.dev/api/people\");\n return response.json() as Promise<{\n results: {\n name: string;\n }[];\n }>;\n },\n component: () => {\n const data = peopleRoute.useLoaderData();\n return (\n
    \n {data.results.map((person) => (\n
  • {person.name}
  • \n ))}\n
\n );\n },\n});\n```\n\nLoaders 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).\n\n# Demo files\n\nFiles 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.\n\n\n\n# Learn More\n\nYou can learn more about all of the offerings from TanStack in the [TanStack documentation](https://tanstack.com).\n", "index.html": "\n\n \n \n \n \n \n \n \n \n Create TanStack App - app-ts\n \n \n
\n \n \n\n", - "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite --port 3000\",\n \"build\": \"vite build && tsc\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\"\n },\n \"dependencies\": {\n \"@tanstack/router-plugin\": \"^1.121.3\",\n \"@tanstack/solid-router\": \"^1.132.25\",\n \"@tanstack/solid-router-devtools\": \"^1.132.25\",\n \"@tanstack/solid-start\": \"^1.132.25\",\n \"solid-js\": \"^1.9.5\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^7.1.7\",\n \"vite-plugin-solid\": \"^2.11.2\"\n }\n}", + "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite --port 3000\",\n \"build\": \"vite build && tsc\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\"\n },\n \"dependencies\": {\n \"@tanstack/router-plugin\": \"^1.133.21\",\n \"@tanstack/solid-router\": \"^1.133.20\",\n \"@tanstack/solid-router-devtools\": \"^1.133.20\",\n \"@tanstack/solid-start\": \"^1.133.20\",\n \"solid-js\": \"^1.9.9\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^7.1.7\",\n \"vite-plugin-solid\": \"^2.11.10\"\n }\n}", "tsconfig.json": "{\n \"include\": [\"**/*.ts\", \"**/*.tsx\"],\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"jsx\": \"preserve\",\n \"jsxImportSource\": \"solid-js\",\n \"module\": \"ESNext\",\n \"lib\": [\"ES2022\", \"DOM\", \"DOM.Iterable\"],\n \"types\": [\"vite/client\"],\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"verbatimModuleSyntax\": true,\n \"noEmit\": true,\n\n /* Linting */\n \"skipLibCheck\": true,\n \"strict\": true,\n \"noUnusedLocals\": true,\n \"noUnusedParameters\": true,\n \"noFallthroughCasesInSwitch\": true,\n \"noUncheckedSideEffectImports\": true\n }\n}\n", "vite.config.ts": "import { defineConfig } from 'vite'\nimport { TanStackRouterVite } from '@tanstack/router-plugin/vite'\nimport solidPlugin from 'vite-plugin-solid'\nimport tailwindcss from '@tailwindcss/vite'\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [\n TanStackRouterVite({ target: 'solid', autoCodeSplitting: true }),\n solidPlugin(),\n tailwindcss(),\n ],\n})\n" }, diff --git a/frameworks/solid/tests/snapshots/solid/solid-fr-ts-tw-npm.json b/frameworks/solid/tests/snapshots/solid/solid-fr-ts-tw-npm.json index 7d7acbed..a2c5e23b 100644 --- a/frameworks/solid/tests/snapshots/solid/solid-fr-ts-tw-npm.json +++ b/frameworks/solid/tests/snapshots/solid/solid-fr-ts-tw-npm.json @@ -7,12 +7,12 @@ "/public/manifest.json": "{\n \"short_name\": \"TanStack App\",\n \"name\": \"Create TanStack App Sample\",\n \"icons\": [\n {\n \"src\": \"favicon.ico\",\n \"sizes\": \"64x64 32x32 24x24 16x16\",\n \"type\": \"image/x-icon\"\n },\n {\n \"src\": \"logo192.png\",\n \"type\": \"image/png\",\n \"sizes\": \"192x192\"\n },\n {\n \"src\": \"logo512.png\",\n \"type\": \"image/png\",\n \"sizes\": \"512x512\"\n }\n ],\n \"start_url\": \".\",\n \"display\": \"standalone\",\n \"theme_color\": \"#000000\",\n \"background_color\": \"#ffffff\"\n}\n", "/public/robots.txt": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n", "/src/main.tsx": "import { RouterProvider, createRouter } from '@tanstack/solid-router'\nimport { render } from 'solid-js/web'\n\nimport { routeTree } from './routeTree.gen'\nimport './styles.css'\n\nconst router = createRouter({\n routeTree,\n defaultPreload: 'intent',\n scrollRestoration: true,\n defaultPreloadStaleTime: 0,\n})\n\ndeclare module '@tanstack/solid-router' {\n interface Register {\n router: typeof router\n }\n}\n\nfunction App() {\n return (\n <>\n \n \n )\n}\n\nconst rootElement = document.getElementById('app')\nif (rootElement) {\n render(() => , rootElement)\n}\n", - "/src/routes/__root.tsx": "import {\n HeadContent,\n Outlet,\n Scripts,\n createRootRouteWithContext,\n} from '@tanstack/solid-router'\nimport { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'\n\nimport styleCss from '../styles.css?url'\n\nexport const Route = createRootRouteWithContext()({\n head: () => ({\n links: [{ rel: 'stylesheet', href: styleCss }],\n }),\n shellComponent: RootComponent,\n})\n\nfunction RootComponent() {\n return (\n <>\n \n\n \n \n\n \n \n )\n}\n", + "/src/routes/__root.tsx": "import {\n HeadContent,\n Outlet,\n Scripts,\n createRootRouteWithContext,\n} from '@tanstack/solid-router'\nimport { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'\n\nimport { HydrationScript } from 'solid-js/web'\n\nimport styleCss from '../styles.css?url'\n\nexport const Route = createRootRouteWithContext()({\n head: () => ({\n links: [{ rel: 'stylesheet', href: styleCss }],\n }),\n shellComponent: RootComponent,\n})\n\nfunction RootComponent() {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n )\n}\n", "/src/routes/index.tsx": "import * as Solid from 'solid-js'\nimport { createFileRoute } from '@tanstack/solid-router'\n\nimport logo from '../logo.svg'\n\nexport const Route = createFileRoute('/')({\n component: IndexComponent,\n})\n\nfunction IndexComponent() {\n return (\n
\n
\n \n

\n Edit src/routes/index.tsx and save to reload.\n

\n \n Learn Solid\n \n \n Learn TanStack\n \n
\n
\n )\n}\n", "/src/styles.css": "@import \"tailwindcss\";\n\nbody {\n @apply m-0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n}\n", "README.md": "Welcome to your new TanStack app! \n\n# Getting Started\n\nTo run this application:\n\n```bash\nnpm install\nnpm run start\n```\n\n# Building For Production\n\nTo build this application for production:\n\n```bash\nnpm run build\n```\n\n## Styling\n\nThis project uses [Tailwind CSS](https://tailwindcss.com/) for styling.\n\n\n\n## Routing\nThis 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`.\n\n### Adding A Route\n\nTo add a new route to your application just add another a new file in the `./src/routes` directory.\n\nTanStack will automatically generate the content of the route file for you.\n\nNow that you have two routes you can use a `Link` component to navigate between them.\n\n### Adding Links\n\nTo use SPA (Single Page Application) navigation you will need to import the `Link` component from `@tanstack/solid-router`.\n\n```tsx\nimport { Link } from \"@tanstack/solid-router\";\n```\n\nThen anywhere in your JSX you can use it like so:\n\n```tsx\nAbout\n```\n\nThis will create a link that will navigate to the `/about` route.\n\nMore information on the `Link` component can be found in the [Link documentation](https://tanstack.com/router/v1/docs/framework/solid/api/router/linkComponent).\n\n### Using A Layout\n\nIn 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 `` component.\n\nHere is an example layout that includes a header:\n\n```tsx\nimport { Outlet, createRootRoute } from '@tanstack/solid-router'\nimport { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'\n\nimport { Link } from \"@tanstack/solid-router\";\n\nexport const Route = createRootRoute({\n component: () => (\n <>\n
\n \n
\n \n \n \n ),\n})\n```\n\nThe `` component is not required so you can remove it if you don't want it in your layout.\n\nMore information on layouts can be found in the [Layouts documentation](https://tanstack.com/router/latest/docs/framework/solid/guide/routing-concepts#layouts).\n\n## Data Fetching\n\nThere 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.\n\nFor example:\n\n```tsx\nconst peopleRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: \"/people\",\n loader: async () => {\n const response = await fetch(\"https://swapi.dev/api/people\");\n return response.json() as Promise<{\n results: {\n name: string;\n }[];\n }>;\n },\n component: () => {\n const data = peopleRoute.useLoaderData();\n return (\n
    \n {data.results.map((person) => (\n
  • {person.name}
  • \n ))}\n
\n );\n },\n});\n```\n\nLoaders 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).\n\n# Demo files\n\nFiles 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.\n\n\n\n# Learn More\n\nYou can learn more about all of the offerings from TanStack in the [TanStack documentation](https://tanstack.com).\n", "index.html": "\n\n \n \n \n \n \n \n \n \n Create TanStack App - app-ts\n \n \n
\n \n \n\n", - "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite --port 3000\",\n \"build\": \"vite build && tsc\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\"\n },\n \"dependencies\": {\n \"@tailwindcss/vite\": \"^4.0.6\",\n \"@tanstack/router-plugin\": \"^1.121.3\",\n \"@tanstack/solid-router\": \"^1.132.25\",\n \"@tanstack/solid-router-devtools\": \"^1.132.25\",\n \"@tanstack/solid-start\": \"^1.132.25\",\n \"solid-js\": \"^1.9.5\",\n \"tailwindcss\": \"^4.0.6\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^7.1.7\",\n \"vite-plugin-solid\": \"^2.11.2\"\n }\n}", + "package.json": "{\n \"name\": \"TEST\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite --port 3000\",\n \"build\": \"vite build && tsc\",\n \"serve\": \"vite preview\",\n \"test\": \"vitest run\"\n },\n \"dependencies\": {\n \"@tailwindcss/vite\": \"^4.0.6\",\n \"@tanstack/router-plugin\": \"^1.133.21\",\n \"@tanstack/solid-router\": \"^1.133.20\",\n \"@tanstack/solid-router-devtools\": \"^1.133.20\",\n \"@tanstack/solid-start\": \"^1.133.20\",\n \"solid-js\": \"^1.9.9\",\n \"tailwindcss\": \"^4.0.6\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^7.1.7\",\n \"vite-plugin-solid\": \"^2.11.10\"\n }\n}", "tsconfig.json": "{\n \"include\": [\"**/*.ts\", \"**/*.tsx\"],\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"jsx\": \"preserve\",\n \"jsxImportSource\": \"solid-js\",\n \"module\": \"ESNext\",\n \"lib\": [\"ES2022\", \"DOM\", \"DOM.Iterable\"],\n \"types\": [\"vite/client\"],\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"verbatimModuleSyntax\": true,\n \"noEmit\": true,\n\n /* Linting */\n \"skipLibCheck\": true,\n \"strict\": true,\n \"noUnusedLocals\": true,\n \"noUnusedParameters\": true,\n \"noFallthroughCasesInSwitch\": true,\n \"noUncheckedSideEffectImports\": true\n }\n}\n", "vite.config.ts": "import { defineConfig } from 'vite'\nimport { TanStackRouterVite } from '@tanstack/router-plugin/vite'\nimport solidPlugin from 'vite-plugin-solid'\nimport tailwindcss from '@tailwindcss/vite'\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [\n TanStackRouterVite({ target: 'solid', autoCodeSplitting: true }),\n solidPlugin(),\n tailwindcss(),\n ],\n})\n" },