@depup/nitro 3.0.260311-beta-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +27 -0
- package/README.md +32 -0
- package/changes.json +14 -0
- package/dist/THIRD-PARTY-LICENSES.md +1646 -0
- package/dist/_build/common.mjs +29361 -0
- package/dist/_build/rolldown.mjs +173 -0
- package/dist/_build/rollup.mjs +194 -0
- package/dist/_build/vite.build.mjs +18 -0
- package/dist/_chunks/nitro.mjs +1159 -0
- package/dist/_chunks/nitro2.mjs +102 -0
- package/dist/_chunks/nitro3.mjs +129 -0
- package/dist/_chunks/utils.mjs +272 -0
- package/dist/_common.mjs +35 -0
- package/dist/_dev.d.mts +12 -0
- package/dist/_dev.mjs +519 -0
- package/dist/_libs/_.mjs +3 -0
- package/dist/_libs/_2.mjs +2 -0
- package/dist/_libs/_3.mjs +3 -0
- package/dist/_libs/_4.mjs +2 -0
- package/dist/_libs/_5.mjs +3 -0
- package/dist/_libs/_6.mjs +4 -0
- package/dist/_libs/_7.mjs +5 -0
- package/dist/_libs/c12+rc9.mjs +812 -0
- package/dist/_libs/c12+readdirp+chokidar.d.mts +230 -0
- package/dist/_libs/citty.mjs +361 -0
- package/dist/_libs/commondir+is-reference.mjs +1311 -0
- package/dist/_libs/compatx.d.mts +47 -0
- package/dist/_libs/compatx.mjs +45 -0
- package/dist/_libs/esbuild.d.mts +20 -0
- package/dist/_libs/escape-string-regexp.mjs +7 -0
- package/dist/_libs/estree+pluginutils.d.mts +241 -0
- package/dist/_libs/estree-walker.mjs +184 -0
- package/dist/_libs/exsolve.d.mts +1 -0
- package/dist/_libs/hasown+resolve+deepmerge.mjs +1949 -0
- package/dist/_libs/httpxy.d.mts +82 -0
- package/dist/_libs/httpxy.mjs +671 -0
- package/dist/_libs/js-tokens.d.mts +1 -0
- package/dist/_libs/klona.mjs +37 -0
- package/dist/_libs/magic-string.d.mts +220 -0
- package/dist/_libs/mlly.d.mts +57 -0
- package/dist/_libs/nypm+tinyexec.mjs +845 -0
- package/dist/_libs/perfect-debounce.mjs +88 -0
- package/dist/_libs/pkg-types.d.mts +23 -0
- package/dist/_libs/plugin-alias.mjs +64 -0
- package/dist/_libs/plugin-inject.mjs +131 -0
- package/dist/_libs/plugin-json.mjs +34 -0
- package/dist/_libs/pluginutils.mjs +646 -0
- package/dist/_libs/readdirp+chokidar.mjs +1606 -0
- package/dist/_libs/remapping.mjs +115 -0
- package/dist/_libs/resolve-uri+gen-mapping.mjs +442 -0
- package/dist/_libs/rou3.d.mts +44 -0
- package/dist/_libs/rou3.mjs +496 -0
- package/dist/_libs/std-env.d.mts +12 -0
- package/dist/_libs/strip-literal.d.mts +1 -0
- package/dist/_libs/tsconfck.mjs +813 -0
- package/dist/_libs/ultrahtml.mjs +127 -0
- package/dist/_libs/unimport+unplugin.mjs +1684 -0
- package/dist/_libs/unplugin+unimport.d.mts +423 -0
- package/dist/_libs/unwasm.d.mts +29 -0
- package/dist/_presets.mjs +1759 -0
- package/dist/builder.d.mts +64 -0
- package/dist/builder.mjs +15 -0
- package/dist/cli/_chunks/build.mjs +47 -0
- package/dist/cli/_chunks/common.mjs +14 -0
- package/dist/cli/_chunks/deploy.mjs +40 -0
- package/dist/cli/_chunks/dev.mjs +62 -0
- package/dist/cli/_chunks/docs.mjs +30 -0
- package/dist/cli/_chunks/list.mjs +25 -0
- package/dist/cli/_chunks/prepare.mjs +17 -0
- package/dist/cli/_chunks/preview.mjs +51 -0
- package/dist/cli/_chunks/run.mjs +53 -0
- package/dist/cli/_chunks/task.mjs +14 -0
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.mjs +22 -0
- package/dist/node_modules/@poppinss/colors/build/index.js +139 -0
- package/dist/node_modules/@poppinss/colors/package.json +118 -0
- package/dist/node_modules/@poppinss/dumper/build/chunk-26HALFTP.js +602 -0
- package/dist/node_modules/@poppinss/dumper/build/formatters/console/main.js +441 -0
- package/dist/node_modules/@poppinss/dumper/build/formatters/html/main.js +725 -0
- package/dist/node_modules/@poppinss/dumper/package.json +122 -0
- package/dist/node_modules/@poppinss/exception/build/index.js +44 -0
- package/dist/node_modules/@poppinss/exception/package.json +109 -0
- package/dist/node_modules/@sindresorhus/is/distribution/index.js +1354 -0
- package/dist/node_modules/@sindresorhus/is/distribution/utilities.js +3 -0
- package/dist/node_modules/@sindresorhus/is/package.json +81 -0
- package/dist/node_modules/@speed-highlight/core/dist/index.js +4 -0
- package/dist/node_modules/@speed-highlight/core/dist/terminal.js +2 -0
- package/dist/node_modules/@speed-highlight/core/package.json +94 -0
- package/dist/node_modules/cookie-es/dist/index.mjs +262 -0
- package/dist/node_modules/cookie-es/package.json +37 -0
- package/dist/node_modules/croner/dist/croner.js +1 -0
- package/dist/node_modules/croner/package.json +73 -0
- package/dist/node_modules/defu/dist/defu.mjs +69 -0
- package/dist/node_modules/defu/package.json +43 -0
- package/dist/node_modules/destr/dist/index.mjs +72 -0
- package/dist/node_modules/destr/package.json +47 -0
- package/dist/node_modules/error-stack-parser-es/dist/index.mjs +38 -0
- package/dist/node_modules/error-stack-parser-es/dist/lite.mjs +167 -0
- package/dist/node_modules/error-stack-parser-es/package.json +83 -0
- package/dist/node_modules/get-port-please/dist/index.mjs +430 -0
- package/dist/node_modules/get-port-please/package.json +39 -0
- package/dist/node_modules/kleur/index.mjs +110 -0
- package/dist/node_modules/kleur/package.json +51 -0
- package/dist/node_modules/rendu/dist/index.mjs +380 -0
- package/dist/node_modules/rendu/package.json +47 -0
- package/dist/node_modules/scule/dist/index.mjs +80 -0
- package/dist/node_modules/scule/package.json +43 -0
- package/dist/node_modules/source-map/lib/array-set.js +100 -0
- package/dist/node_modules/source-map/lib/base64-vlq.js +94 -0
- package/dist/node_modules/source-map/lib/base64.js +19 -0
- package/dist/node_modules/source-map/lib/binary-search.js +113 -0
- package/dist/node_modules/source-map/lib/mapping-list.js +83 -0
- package/dist/node_modules/source-map/lib/mappings.wasm +0 -0
- package/dist/node_modules/source-map/lib/read-wasm.js +27 -0
- package/dist/node_modules/source-map/lib/source-map-consumer.js +1081 -0
- package/dist/node_modules/source-map/lib/source-map-generator.js +439 -0
- package/dist/node_modules/source-map/lib/source-node.js +430 -0
- package/dist/node_modules/source-map/lib/url.js +13 -0
- package/dist/node_modules/source-map/lib/util.js +444 -0
- package/dist/node_modules/source-map/lib/wasm.js +138 -0
- package/dist/node_modules/source-map/package.json +79 -0
- package/dist/node_modules/source-map/source-map.js +10 -0
- package/dist/node_modules/supports-color/index.js +202 -0
- package/dist/node_modules/supports-color/package.json +64 -0
- package/dist/node_modules/ufo/dist/index.mjs +645 -0
- package/dist/node_modules/ufo/package.json +48 -0
- package/dist/node_modules/unctx/dist/index.mjs +131 -0
- package/dist/node_modules/unctx/package.json +67 -0
- package/dist/node_modules/youch/build/helpers-B9BQYaS6.js +23 -0
- package/dist/node_modules/youch/build/index.js +212 -0
- package/dist/node_modules/youch/build/public/error_cause/style.css +5 -0
- package/dist/node_modules/youch/build/public/error_info/script.js +13 -0
- package/dist/node_modules/youch/build/public/error_info/style.css +145 -0
- package/dist/node_modules/youch/build/public/error_metadata/style.css +3 -0
- package/dist/node_modules/youch/build/public/error_stack/script.js +72 -0
- package/dist/node_modules/youch/build/public/error_stack/style.css +219 -0
- package/dist/node_modules/youch/build/public/error_stack_source/style.css +123 -0
- package/dist/node_modules/youch/build/public/header/script.js +14 -0
- package/dist/node_modules/youch/build/public/header/style.css +56 -0
- package/dist/node_modules/youch/build/public/layout/script.js +12 -0
- package/dist/node_modules/youch/build/public/layout/style.css +435 -0
- package/dist/node_modules/youch/build/public_dir-C5bujZKB.js +25 -0
- package/dist/node_modules/youch/build/src/templates/error_cause/main.js +44 -0
- package/dist/node_modules/youch/build/src/templates/error_info/main.js +72 -0
- package/dist/node_modules/youch/build/src/templates/error_metadata/main.js +65 -0
- package/dist/node_modules/youch/build/src/templates/error_stack/main.js +152 -0
- package/dist/node_modules/youch/build/src/templates/error_stack_source/main.js +46 -0
- package/dist/node_modules/youch/build/src/templates/header/main.js +24 -0
- package/dist/node_modules/youch/build/src/templates/layout/main.js +27 -0
- package/dist/node_modules/youch/package.json +135 -0
- package/dist/node_modules/youch-core/build/index.js +316 -0
- package/dist/node_modules/youch-core/package.json +124 -0
- package/dist/presets/_nitro/runtime/nitro-dev.mjs +20 -0
- package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +15 -0
- package/dist/presets/_nitro/runtime/service-worker.mjs +23 -0
- package/dist/presets/aws-amplify/runtime/aws-amplify.mjs +14 -0
- package/dist/presets/aws-lambda/runtime/_utils.mjs +116 -0
- package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.mjs +31 -0
- package/dist/presets/aws-lambda/runtime/aws-lambda.mjs +13 -0
- package/dist/presets/azure/runtime/_utils.mjs +50 -0
- package/dist/presets/azure/runtime/azure-swa.mjs +30 -0
- package/dist/presets/bun/runtime/bun.mjs +40 -0
- package/dist/presets/cloudflare/runtime/_module-handler.mjs +87 -0
- package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +72 -0
- package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +17 -0
- package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +39 -0
- package/dist/presets/cloudflare/runtime/plugin.dev.mjs +96 -0
- package/dist/presets/cloudflare/runtime/shims/workers.dev.mjs +27 -0
- package/dist/presets/deno/runtime/deno-deploy.mjs +19 -0
- package/dist/presets/deno/runtime/deno-server.mjs +39 -0
- package/dist/presets/netlify/runtime/netlify-edge.mjs +20 -0
- package/dist/presets/netlify/runtime/netlify.mjs +20 -0
- package/dist/presets/node/runtime/node-cluster.mjs +54 -0
- package/dist/presets/node/runtime/node-middleware.mjs +14 -0
- package/dist/presets/node/runtime/node-server.mjs +47 -0
- package/dist/presets/standard/runtime/server.mjs +4 -0
- package/dist/presets/stormkit/runtime/stormkit.mjs +27 -0
- package/dist/presets/vercel/runtime/cron-handler.mjs +25 -0
- package/dist/presets/vercel/runtime/isr.mjs +19 -0
- package/dist/presets/vercel/runtime/vercel.node.mjs +24 -0
- package/dist/presets/vercel/runtime/vercel.web.mjs +23 -0
- package/dist/presets/winterjs/runtime/winterjs.mjs +91 -0
- package/dist/presets/zeabur/runtime/zeabur.mjs +4 -0
- package/dist/presets/zephyr/runtime/server.mjs +3 -0
- package/dist/runtime/app.d.mts +1 -0
- package/dist/runtime/app.mjs +1 -0
- package/dist/runtime/cache.d.mts +1 -0
- package/dist/runtime/cache.mjs +1 -0
- package/dist/runtime/config.d.mts +3 -0
- package/dist/runtime/config.mjs +4 -0
- package/dist/runtime/context.d.mts +1 -0
- package/dist/runtime/context.mjs +1 -0
- package/dist/runtime/database.d.mts +1 -0
- package/dist/runtime/database.mjs +1 -0
- package/dist/runtime/internal/app.d.mts +16 -0
- package/dist/runtime/internal/app.mjs +208 -0
- package/dist/runtime/internal/cache.d.mts +7 -0
- package/dist/runtime/internal/cache.mjs +41 -0
- package/dist/runtime/internal/context.d.mts +14 -0
- package/dist/runtime/internal/context.mjs +24 -0
- package/dist/runtime/internal/database.d.mts +2 -0
- package/dist/runtime/internal/database.mjs +12 -0
- package/dist/runtime/internal/empty.mjs +0 -0
- package/dist/runtime/internal/error/dev.d.mts +10 -0
- package/dist/runtime/internal/error/dev.mjs +121 -0
- package/dist/runtime/internal/error/hooks.d.mts +1 -0
- package/dist/runtime/internal/error/hooks.mjs +9 -0
- package/dist/runtime/internal/error/prod.d.mts +6 -0
- package/dist/runtime/internal/error/prod.mjs +40 -0
- package/dist/runtime/internal/error/utils.d.mts +8 -0
- package/dist/runtime/internal/error/utils.mjs +3 -0
- package/dist/runtime/internal/meta.d.mts +2 -0
- package/dist/runtime/internal/meta.mjs +3 -0
- package/dist/runtime/internal/plugin.d.mts +3 -0
- package/dist/runtime/internal/plugin.mjs +4 -0
- package/dist/runtime/internal/route-rules.d.mts +9 -0
- package/dist/runtime/internal/route-rules.mjs +72 -0
- package/dist/runtime/internal/routes/dev-tasks.d.mts +3 -0
- package/dist/runtime/internal/routes/dev-tasks.mjs +25 -0
- package/dist/runtime/internal/routes/openapi.d.mts +3 -0
- package/dist/runtime/internal/routes/openapi.mjs +94 -0
- package/dist/runtime/internal/routes/renderer-template.d.mts +2 -0
- package/dist/runtime/internal/routes/renderer-template.dev.d.mts +3 -0
- package/dist/runtime/internal/routes/renderer-template.dev.mjs +19 -0
- package/dist/runtime/internal/routes/renderer-template.mjs +4 -0
- package/dist/runtime/internal/routes/scalar.d.mts +3 -0
- package/dist/runtime/internal/routes/scalar.mjs +193 -0
- package/dist/runtime/internal/routes/swagger.d.mts +3 -0
- package/dist/runtime/internal/routes/swagger.mjs +42 -0
- package/dist/runtime/internal/runtime-config.d.mts +9 -0
- package/dist/runtime/internal/runtime-config.mjs +54 -0
- package/dist/runtime/internal/static.d.mts +3 -0
- package/dist/runtime/internal/static.mjs +67 -0
- package/dist/runtime/internal/storage.d.mts +2 -0
- package/dist/runtime/internal/storage.mjs +6 -0
- package/dist/runtime/internal/task.d.mts +19 -0
- package/dist/runtime/internal/task.mjs +69 -0
- package/dist/runtime/internal/vite/dev-entry.mjs +18 -0
- package/dist/runtime/internal/vite/dev-worker.mjs +264 -0
- package/dist/runtime/internal/vite/ssr-renderer.mjs +6 -0
- package/dist/runtime/meta.d.mts +5 -0
- package/dist/runtime/meta.mjs +27 -0
- package/dist/runtime/nitro.d.mts +11 -0
- package/dist/runtime/nitro.mjs +34 -0
- package/dist/runtime/runtime-config.d.mts +1 -0
- package/dist/runtime/runtime-config.mjs +1 -0
- package/dist/runtime/storage.d.mts +1 -0
- package/dist/runtime/storage.mjs +1 -0
- package/dist/runtime/task.d.mts +1 -0
- package/dist/runtime/task.mjs +1 -0
- package/dist/runtime/virtual/_runtime_warn.d.mts +1 -0
- package/dist/runtime/virtual/_runtime_warn.mjs +5 -0
- package/dist/runtime/virtual/database.d.mts +8 -0
- package/dist/runtime/virtual/database.mjs +2 -0
- package/dist/runtime/virtual/error-handler.d.mts +6 -0
- package/dist/runtime/virtual/error-handler.mjs +9 -0
- package/dist/runtime/virtual/feature-flags.d.mts +7 -0
- package/dist/runtime/virtual/feature-flags.mjs +7 -0
- package/dist/runtime/virtual/plugins.d.mts +3 -0
- package/dist/runtime/virtual/plugins.mjs +2 -0
- package/dist/runtime/virtual/polyfills.d.mts +3 -0
- package/dist/runtime/virtual/polyfills.mjs +2 -0
- package/dist/runtime/virtual/public-assets.d.mts +9 -0
- package/dist/runtime/virtual/public-assets.mjs +8 -0
- package/dist/runtime/virtual/renderer-template.d.mts +4 -0
- package/dist/runtime/virtual/renderer-template.mjs +7 -0
- package/dist/runtime/virtual/routing-meta.d.mts +7 -0
- package/dist/runtime/virtual/routing-meta.mjs +2 -0
- package/dist/runtime/virtual/routing.d.mts +8 -0
- package/dist/runtime/virtual/routing.mjs +11 -0
- package/dist/runtime/virtual/runtime-config.d.mts +3 -0
- package/dist/runtime/virtual/runtime-config.mjs +5 -0
- package/dist/runtime/virtual/server-assets.d.mts +7 -0
- package/dist/runtime/virtual/server-assets.mjs +12 -0
- package/dist/runtime/virtual/storage.d.mts +3 -0
- package/dist/runtime/virtual/storage.mjs +5 -0
- package/dist/runtime/virtual/tasks.d.mts +10 -0
- package/dist/runtime/virtual/tasks.mjs +3 -0
- package/dist/runtime/vite.d.mts +8 -0
- package/dist/runtime/vite.mjs +9 -0
- package/dist/types/index.d.mts +3010 -0
- package/dist/types/index.mjs +1 -0
- package/dist/vite.d.mts +52 -0
- package/dist/vite.mjs +740 -0
- package/lib/h3.d.mts +1 -0
- package/lib/h3.mjs +1 -0
- package/lib/tsconfig.json +27 -0
- package/lib/vite.types.d.mts +26 -0
- package/lib/vite.types.mjs +2 -0
- package/package.json +256 -0
- package/skills/nitro/SKILL.md +10 -0
- package/skills/nitro/docs/TOC.md +83 -0
- package/skills/nitro/docs/_navigation.json +679 -0
- package/skills/nitro/docs/config/index.md +1147 -0
- package/skills/nitro/docs/deploy/index.md +64 -0
- package/skills/nitro/docs/deploy/providers/alwaysdata.md +50 -0
- package/skills/nitro/docs/deploy/providers/aws-amplify.md +81 -0
- package/skills/nitro/docs/deploy/providers/aws.md +47 -0
- package/skills/nitro/docs/deploy/providers/azure.md +72 -0
- package/skills/nitro/docs/deploy/providers/cleavr.md +33 -0
- package/skills/nitro/docs/deploy/providers/cloudflare.md +375 -0
- package/skills/nitro/docs/deploy/providers/deno-deploy.md +66 -0
- package/skills/nitro/docs/deploy/providers/digitalocean.md +46 -0
- package/skills/nitro/docs/deploy/providers/firebase.md +32 -0
- package/skills/nitro/docs/deploy/providers/flightcontrol.md +67 -0
- package/skills/nitro/docs/deploy/providers/genezio.md +67 -0
- package/skills/nitro/docs/deploy/providers/github-pages.md +68 -0
- package/skills/nitro/docs/deploy/providers/gitlab-pages.md +37 -0
- package/skills/nitro/docs/deploy/providers/heroku.md +84 -0
- package/skills/nitro/docs/deploy/providers/iis.md +38 -0
- package/skills/nitro/docs/deploy/providers/koyeb.md +109 -0
- package/skills/nitro/docs/deploy/providers/netlify.md +47 -0
- package/skills/nitro/docs/deploy/providers/platform-sh.md +37 -0
- package/skills/nitro/docs/deploy/providers/render.md +37 -0
- package/skills/nitro/docs/deploy/providers/stormkit.md +24 -0
- package/skills/nitro/docs/deploy/providers/vercel.md +179 -0
- package/skills/nitro/docs/deploy/providers/zeabur.md +19 -0
- package/skills/nitro/docs/deploy/providers/zephyr.md +99 -0
- package/skills/nitro/docs/deploy/providers/zerops.md +102 -0
- package/skills/nitro/docs/deploy/runtimes/bun.md +15 -0
- package/skills/nitro/docs/deploy/runtimes/deno.md +19 -0
- package/skills/nitro/docs/deploy/runtimes/node.md +63 -0
- package/skills/nitro/docs/docs/assets.md +166 -0
- package/skills/nitro/docs/docs/cache.md +408 -0
- package/skills/nitro/docs/docs/configuration.md +256 -0
- package/skills/nitro/docs/docs/database.md +185 -0
- package/skills/nitro/docs/docs/index.md +56 -0
- package/skills/nitro/docs/docs/lifecycle.md +204 -0
- package/skills/nitro/docs/docs/migration.md +215 -0
- package/skills/nitro/docs/docs/nightly.md +31 -0
- package/skills/nitro/docs/docs/plugins.md +164 -0
- package/skills/nitro/docs/docs/quick-start.md +110 -0
- package/skills/nitro/docs/docs/renderer.md +322 -0
- package/skills/nitro/docs/docs/routing.md +711 -0
- package/skills/nitro/docs/docs/server-entry.md +239 -0
- package/skills/nitro/docs/docs/storage.md +261 -0
- package/skills/nitro/docs/docs/tasks.md +277 -0
- package/skills/nitro/docs/examples/api-routes.md +145 -0
- package/skills/nitro/docs/examples/auto-imports.md +93 -0
- package/skills/nitro/docs/examples/cached-handler.md +81 -0
- package/skills/nitro/docs/examples/custom-error-handler.md +98 -0
- package/skills/nitro/docs/examples/database.md +157 -0
- package/skills/nitro/docs/examples/elysia.md +70 -0
- package/skills/nitro/docs/examples/express.md +78 -0
- package/skills/nitro/docs/examples/fastify.md +79 -0
- package/skills/nitro/docs/examples/hello-world.md +68 -0
- package/skills/nitro/docs/examples/hono.md +74 -0
- package/skills/nitro/docs/examples/import-alias.md +100 -0
- package/skills/nitro/docs/examples/index.md +3 -0
- package/skills/nitro/docs/examples/middleware.md +91 -0
- package/skills/nitro/docs/examples/mono-jsx.md +68 -0
- package/skills/nitro/docs/examples/nano-jsx.md +70 -0
- package/skills/nitro/docs/examples/plugins.md +91 -0
- package/skills/nitro/docs/examples/renderer.md +113 -0
- package/skills/nitro/docs/examples/runtime-config.md +97 -0
- package/skills/nitro/docs/examples/server-fetch.md +87 -0
- package/skills/nitro/docs/examples/shiki.md +198 -0
- package/skills/nitro/docs/examples/virtual-routes.md +74 -0
- package/skills/nitro/docs/examples/vite-nitro-plugin.md +79 -0
- package/skills/nitro/docs/examples/vite-rsc.md +1041 -0
- package/skills/nitro/docs/examples/vite-ssr-html.md +217 -0
- package/skills/nitro/docs/examples/vite-ssr-preact.md +247 -0
- package/skills/nitro/docs/examples/vite-ssr-react.md +226 -0
- package/skills/nitro/docs/examples/vite-ssr-solid.md +256 -0
- package/skills/nitro/docs/examples/vite-ssr-tsr-react.md +442 -0
- package/skills/nitro/docs/examples/vite-ssr-tss-react.md +444 -0
- package/skills/nitro/docs/examples/vite-ssr-vue-router.md +616 -0
- package/skills/nitro/docs/examples/vite-trpc.md +335 -0
- package/skills/nitro/docs/examples/websocket.md +282 -0
- package/skills/nitro/docs/index.md +121 -0
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
# SSR with TanStack Start
|
|
2
|
+
|
|
3
|
+
> Full-stack React with TanStack Start in Nitro using Vite.
|
|
4
|
+
|
|
5
|
+
<code-tree>
|
|
6
|
+
|
|
7
|
+
```json [package.json]
|
|
8
|
+
{
|
|
9
|
+
"type": "module",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "vite build",
|
|
12
|
+
"dev": "vite dev",
|
|
13
|
+
"start": "node .output/server/index.mjs"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@tanstack/react-router": "^1.158.1",
|
|
17
|
+
"@tanstack/react-router-devtools": "^1.158.1",
|
|
18
|
+
"@tanstack/react-start": "^1.158.3",
|
|
19
|
+
"nitro": "latest",
|
|
20
|
+
"react": "^19.2.4",
|
|
21
|
+
"react-dom": "^19.2.4",
|
|
22
|
+
"tailwind-merge": "^3.4.0",
|
|
23
|
+
"zod": "^4.3.6"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
27
|
+
"@types/node": "latest",
|
|
28
|
+
"@types/react": "^19.2.13",
|
|
29
|
+
"@types/react-dom": "^19.2.3",
|
|
30
|
+
"@vitejs/plugin-react": "^5.1.3",
|
|
31
|
+
"tailwindcss": "^4.1.18",
|
|
32
|
+
"typescript": "^5.9.3",
|
|
33
|
+
"vite": "beta",
|
|
34
|
+
"vite-tsconfig-paths": "^6.0.5"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```ts [server.ts]
|
|
40
|
+
import handler, { createServerEntry } from "@tanstack/react-start/server-entry";
|
|
41
|
+
|
|
42
|
+
export default createServerEntry({
|
|
43
|
+
fetch(request) {
|
|
44
|
+
return handler.fetch(request);
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```json [tsconfig.json]
|
|
50
|
+
{
|
|
51
|
+
"extends": "nitro/tsconfig",
|
|
52
|
+
"compilerOptions": {
|
|
53
|
+
"baseUrl": ".",
|
|
54
|
+
"jsx": "react-jsx",
|
|
55
|
+
"paths": {
|
|
56
|
+
"~/*": ["./src/*"]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```js [vite.config.mjs]
|
|
63
|
+
import { defineConfig } from "vite";
|
|
64
|
+
import { nitro } from "nitro/vite";
|
|
65
|
+
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
|
|
66
|
+
import viteReact from "@vitejs/plugin-react";
|
|
67
|
+
import viteTsConfigPaths from "vite-tsconfig-paths";
|
|
68
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
69
|
+
|
|
70
|
+
export default defineConfig({
|
|
71
|
+
plugins: [
|
|
72
|
+
viteTsConfigPaths({ projects: ["./tsconfig.json"] }),
|
|
73
|
+
tanstackStart(),
|
|
74
|
+
viteReact(),
|
|
75
|
+
tailwindcss(),
|
|
76
|
+
nitro(),
|
|
77
|
+
],
|
|
78
|
+
environments: {
|
|
79
|
+
ssr: { build: { rollupOptions: { input: "./server.ts" } } },
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```tsx [src/router.tsx]
|
|
85
|
+
import { createRouter } from "@tanstack/react-router";
|
|
86
|
+
import { routeTree } from "./routeTree.gen.ts";
|
|
87
|
+
|
|
88
|
+
export function getRouter() {
|
|
89
|
+
const router = createRouter({
|
|
90
|
+
routeTree,
|
|
91
|
+
defaultPreload: "intent",
|
|
92
|
+
defaultErrorComponent: () => <div>Internal Server Error</div>,
|
|
93
|
+
defaultNotFoundComponent: () => <div>Not Found</div>,
|
|
94
|
+
scrollRestoration: true,
|
|
95
|
+
});
|
|
96
|
+
return router;
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```ts [src/routeTree.gen.ts]
|
|
101
|
+
/* eslint-disable */
|
|
102
|
+
|
|
103
|
+
// @ts-nocheck
|
|
104
|
+
|
|
105
|
+
// noinspection JSUnusedGlobalSymbols
|
|
106
|
+
|
|
107
|
+
// This file was automatically generated by TanStack Router.
|
|
108
|
+
// You should NOT make any changes in this file as it will be overwritten.
|
|
109
|
+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
110
|
+
|
|
111
|
+
import { Route as rootRouteImport } from './routes/__root'
|
|
112
|
+
import { Route as IndexRouteImport } from './routes/index'
|
|
113
|
+
import { Route as ApiTestRouteImport } from './routes/api/test'
|
|
114
|
+
|
|
115
|
+
const IndexRoute = IndexRouteImport.update({
|
|
116
|
+
id: '/',
|
|
117
|
+
path: '/',
|
|
118
|
+
getParentRoute: () => rootRouteImport,
|
|
119
|
+
} as any)
|
|
120
|
+
const ApiTestRoute = ApiTestRouteImport.update({
|
|
121
|
+
id: '/api/test',
|
|
122
|
+
path: '/api/test',
|
|
123
|
+
getParentRoute: () => rootRouteImport,
|
|
124
|
+
} as any)
|
|
125
|
+
|
|
126
|
+
export interface FileRoutesByFullPath {
|
|
127
|
+
'/': typeof IndexRoute
|
|
128
|
+
'/api/test': typeof ApiTestRoute
|
|
129
|
+
}
|
|
130
|
+
export interface FileRoutesByTo {
|
|
131
|
+
'/': typeof IndexRoute
|
|
132
|
+
'/api/test': typeof ApiTestRoute
|
|
133
|
+
}
|
|
134
|
+
export interface FileRoutesById {
|
|
135
|
+
__root__: typeof rootRouteImport
|
|
136
|
+
'/': typeof IndexRoute
|
|
137
|
+
'/api/test': typeof ApiTestRoute
|
|
138
|
+
}
|
|
139
|
+
export interface FileRouteTypes {
|
|
140
|
+
fileRoutesByFullPath: FileRoutesByFullPath
|
|
141
|
+
fullPaths: '/' | '/api/test'
|
|
142
|
+
fileRoutesByTo: FileRoutesByTo
|
|
143
|
+
to: '/' | '/api/test'
|
|
144
|
+
id: '__root__' | '/' | '/api/test'
|
|
145
|
+
fileRoutesById: FileRoutesById
|
|
146
|
+
}
|
|
147
|
+
export interface RootRouteChildren {
|
|
148
|
+
IndexRoute: typeof IndexRoute
|
|
149
|
+
ApiTestRoute: typeof ApiTestRoute
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare module '@tanstack/react-router' {
|
|
153
|
+
interface FileRoutesByPath {
|
|
154
|
+
'/': {
|
|
155
|
+
id: '/'
|
|
156
|
+
path: '/'
|
|
157
|
+
fullPath: '/'
|
|
158
|
+
preLoaderRoute: typeof IndexRouteImport
|
|
159
|
+
parentRoute: typeof rootRouteImport
|
|
160
|
+
}
|
|
161
|
+
'/api/test': {
|
|
162
|
+
id: '/api/test'
|
|
163
|
+
path: '/api/test'
|
|
164
|
+
fullPath: '/api/test'
|
|
165
|
+
preLoaderRoute: typeof ApiTestRouteImport
|
|
166
|
+
parentRoute: typeof rootRouteImport
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const rootRouteChildren: RootRouteChildren = {
|
|
172
|
+
IndexRoute: IndexRoute,
|
|
173
|
+
ApiTestRoute: ApiTestRoute,
|
|
174
|
+
}
|
|
175
|
+
export const routeTree = rootRouteImport
|
|
176
|
+
._addFileChildren(rootRouteChildren)
|
|
177
|
+
._addFileTypes<FileRouteTypes>()
|
|
178
|
+
|
|
179
|
+
import type { getRouter } from './router.tsx'
|
|
180
|
+
import type { createStart } from '@tanstack/react-start'
|
|
181
|
+
declare module '@tanstack/react-start' {
|
|
182
|
+
interface Register {
|
|
183
|
+
ssr: true
|
|
184
|
+
router: Awaited<ReturnType<typeof getRouter>>
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
```tsx [src/routes/__root.tsx]
|
|
190
|
+
/// <reference types="vite/client" />
|
|
191
|
+
import { HeadContent, Link, Scripts, createRootRoute } from "@tanstack/react-router";
|
|
192
|
+
import { TanStackRouterDevtools } from "@tanstack/react-router-devtools";
|
|
193
|
+
import * as React from "react";
|
|
194
|
+
import appCss from "~/styles/app.css?url";
|
|
195
|
+
|
|
196
|
+
export const Route = createRootRoute({
|
|
197
|
+
head: () => ({
|
|
198
|
+
meta: [
|
|
199
|
+
{ charSet: "utf8" },
|
|
200
|
+
{ name: "viewport", content: "width=device-width, initial-scale=1" },
|
|
201
|
+
],
|
|
202
|
+
links: [{ rel: "stylesheet", href: appCss }],
|
|
203
|
+
scripts: [{ src: "/customScript.js", type: "text/javascript" }],
|
|
204
|
+
}),
|
|
205
|
+
errorComponent: () => <h1>500: Internal Server Error</h1>,
|
|
206
|
+
notFoundComponent: () => <h1>404: Page Not Found</h1>,
|
|
207
|
+
shellComponent: RootDocument,
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
function RootDocument({ children }: { children: React.ReactNode }) {
|
|
211
|
+
return (
|
|
212
|
+
<html>
|
|
213
|
+
<head>
|
|
214
|
+
<HeadContent />
|
|
215
|
+
</head>
|
|
216
|
+
<body>
|
|
217
|
+
<div className="p-2 flex gap-2 text-lg">
|
|
218
|
+
<Link to="/" activeProps={{ className: "font-bold" }} activeOptions={{ exact: true }}>
|
|
219
|
+
Home
|
|
220
|
+
</Link>{" "}
|
|
221
|
+
<Link
|
|
222
|
+
// @ts-ignore
|
|
223
|
+
to="/this-route-does-not-exist"
|
|
224
|
+
activeProps={{ className: "font-bold" }}
|
|
225
|
+
>
|
|
226
|
+
404
|
|
227
|
+
</Link>
|
|
228
|
+
</div>
|
|
229
|
+
<hr />
|
|
230
|
+
{children}
|
|
231
|
+
<TanStackRouterDevtools position="bottom-right" />
|
|
232
|
+
<Scripts />
|
|
233
|
+
</body>
|
|
234
|
+
</html>
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
```tsx [src/routes/index.tsx]
|
|
240
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
241
|
+
|
|
242
|
+
export const Route = createFileRoute("/")({ component: Home });
|
|
243
|
+
|
|
244
|
+
function Home() {
|
|
245
|
+
return (
|
|
246
|
+
<div className="p-2">
|
|
247
|
+
<h3>Welcome Home!</h3>
|
|
248
|
+
<a href="/api/test">/api/test</a>
|
|
249
|
+
</div>
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
```css [src/styles/app.css]
|
|
255
|
+
@import "tailwindcss";
|
|
256
|
+
|
|
257
|
+
@layer base {
|
|
258
|
+
*,
|
|
259
|
+
::after,
|
|
260
|
+
::before,
|
|
261
|
+
::backdrop,
|
|
262
|
+
::file-selector-button {
|
|
263
|
+
border-color: var(--color-gray-200, currentcolor);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
@layer base {
|
|
268
|
+
html {
|
|
269
|
+
color-scheme: light dark;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
* {
|
|
273
|
+
@apply border-gray-200 dark:border-gray-800;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
html,
|
|
277
|
+
body {
|
|
278
|
+
@apply text-gray-900 bg-gray-50 dark:bg-gray-950 dark:text-gray-200;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.using-mouse * {
|
|
282
|
+
outline: none !important;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
</code-tree>
|
|
287
|
+
|
|
288
|
+
Set up TanStack Start with Nitro for a full-stack React framework experience with server-side rendering, file-based routing, and integrated API routes.
|
|
289
|
+
|
|
290
|
+
## Overview
|
|
291
|
+
|
|
292
|
+
1. Add the Nitro Vite plugin to your Vite config
|
|
293
|
+
2. Create a server entry using TanStack Start's server handler
|
|
294
|
+
3. Configure the router with default components
|
|
295
|
+
4. Define routes and API endpoints using file-based routing
|
|
296
|
+
|
|
297
|
+
## 1. Configure Vite
|
|
298
|
+
Add the Nitro, React, TanStack Start, and Tailwind plugins to your Vite config:
|
|
299
|
+
|
|
300
|
+
```js [vite.config.mjs]
|
|
301
|
+
import { defineConfig } from "vite";
|
|
302
|
+
import { nitro } from "nitro/vite";
|
|
303
|
+
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
|
|
304
|
+
import viteReact from "@vitejs/plugin-react";
|
|
305
|
+
import viteTsConfigPaths from "vite-tsconfig-paths";
|
|
306
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
307
|
+
|
|
308
|
+
export default defineConfig({
|
|
309
|
+
plugins: [
|
|
310
|
+
viteTsConfigPaths({ projects: ["./tsconfig.json"] }),
|
|
311
|
+
tanstackStart(),
|
|
312
|
+
viteReact(),
|
|
313
|
+
tailwindcss(),
|
|
314
|
+
nitro(),
|
|
315
|
+
],
|
|
316
|
+
environments: {
|
|
317
|
+
ssr: { build: { rollupOptions: { input: "./server.ts" } } },
|
|
318
|
+
},
|
|
319
|
+
});
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
The `tanstackStart()` plugin provides full SSR integration with automatic client entry handling. Use `viteTsConfigPaths()` to enable path aliases like `~/` from tsconfig. The `environments.ssr` option points to the server entry file.
|
|
323
|
+
|
|
324
|
+
## 2. Create the Server Entry
|
|
325
|
+
|
|
326
|
+
Create a server entry that uses TanStack Start's handler:
|
|
327
|
+
|
|
328
|
+
```ts [server.ts]
|
|
329
|
+
import handler, { createServerEntry } from "@tanstack/react-start/server-entry";
|
|
330
|
+
|
|
331
|
+
export default createServerEntry({
|
|
332
|
+
fetch(request) {
|
|
333
|
+
return handler.fetch(request);
|
|
334
|
+
},
|
|
335
|
+
});
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
TanStack Start handles SSR automatically. The `createServerEntry` wrapper integrates with Nitro's server entry format, and the `handler.fetch` processes all incoming requests.
|
|
339
|
+
|
|
340
|
+
## 3. Configure the Router
|
|
341
|
+
|
|
342
|
+
Create a router factory function with default error and not-found components:
|
|
343
|
+
|
|
344
|
+
```tsx [src/router.tsx]
|
|
345
|
+
import { createRouter } from "@tanstack/react-router";
|
|
346
|
+
import { routeTree } from "./routeTree.gen.ts";
|
|
347
|
+
|
|
348
|
+
export function getRouter() {
|
|
349
|
+
const router = createRouter({
|
|
350
|
+
routeTree,
|
|
351
|
+
defaultPreload: "intent",
|
|
352
|
+
defaultErrorComponent: () => <div>Internal Server Error</div>,
|
|
353
|
+
defaultNotFoundComponent: () => <div>Not Found</div>,
|
|
354
|
+
scrollRestoration: true,
|
|
355
|
+
});
|
|
356
|
+
return router;
|
|
357
|
+
}
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
The router factory configures preloading behavior, scroll restoration, and default error/not-found components.
|
|
361
|
+
|
|
362
|
+
## 4. Create the Root Route
|
|
363
|
+
|
|
364
|
+
The root route defines your HTML shell with head management and scripts:
|
|
365
|
+
|
|
366
|
+
```tsx [src/routes/__root.tsx]
|
|
367
|
+
/// <reference types="vite/client" />
|
|
368
|
+
import { HeadContent, Link, Scripts, createRootRoute } from "@tanstack/react-router";
|
|
369
|
+
import { TanStackRouterDevtools } from "@tanstack/react-router-devtools";
|
|
370
|
+
import * as React from "react";
|
|
371
|
+
import appCss from "~/styles/app.css?url";
|
|
372
|
+
|
|
373
|
+
export const Route = createRootRoute({
|
|
374
|
+
head: () => ({
|
|
375
|
+
meta: [
|
|
376
|
+
{ charSet: "utf8" },
|
|
377
|
+
{ name: "viewport", content: "width=device-width, initial-scale=1" },
|
|
378
|
+
],
|
|
379
|
+
links: [{ rel: "stylesheet", href: appCss }],
|
|
380
|
+
scripts: [{ src: "/customScript.js", type: "text/javascript" }],
|
|
381
|
+
}),
|
|
382
|
+
errorComponent: () => <h1>500: Internal Server Error</h1>,
|
|
383
|
+
notFoundComponent: () => <h1>404: Page Not Found</h1>,
|
|
384
|
+
shellComponent: RootDocument,
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
function RootDocument({ children }: { children: React.ReactNode }) {
|
|
388
|
+
return (
|
|
389
|
+
<html>
|
|
390
|
+
<head>
|
|
391
|
+
<HeadContent />
|
|
392
|
+
</head>
|
|
393
|
+
<body>
|
|
394
|
+
<div className="p-2 flex gap-2 text-lg">
|
|
395
|
+
<Link to="/" activeProps={{ className: "font-bold" }} activeOptions={{ exact: true }}>
|
|
396
|
+
Home
|
|
397
|
+
</Link>{" "}
|
|
398
|
+
<Link
|
|
399
|
+
// @ts-ignore
|
|
400
|
+
to="/this-route-does-not-exist"
|
|
401
|
+
activeProps={{ className: "font-bold" }}
|
|
402
|
+
>
|
|
403
|
+
404
|
|
404
|
+
</Link>
|
|
405
|
+
</div>
|
|
406
|
+
<hr />
|
|
407
|
+
{children}
|
|
408
|
+
<TanStackRouterDevtools position="bottom-right" />
|
|
409
|
+
<Scripts />
|
|
410
|
+
</body>
|
|
411
|
+
</html>
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
Define meta tags, stylesheets, and scripts in the `head()` function. The `shellComponent` provides the HTML document shell that wraps all pages. Use `HeadContent` to render the head configuration and `Scripts` to inject the client-side JavaScript for hydration.
|
|
417
|
+
|
|
418
|
+
## 5. Create Page Routes
|
|
419
|
+
|
|
420
|
+
Page routes define your application pages:
|
|
421
|
+
|
|
422
|
+
```tsx [src/routes/index.tsx]
|
|
423
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
424
|
+
|
|
425
|
+
export const Route = createFileRoute("/")({ component: Home });
|
|
426
|
+
|
|
427
|
+
function Home() {
|
|
428
|
+
return (
|
|
429
|
+
<div className="p-2">
|
|
430
|
+
<h3>Welcome Home!</h3>
|
|
431
|
+
<a href="/api/test">/api/test</a>
|
|
432
|
+
</div>
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
## API Routes
|
|
438
|
+
|
|
439
|
+
TanStack Start supports API routes alongside page routes. Create files in `src/routes/api/` to define server endpoints that Nitro serves automatically.
|
|
440
|
+
|
|
441
|
+
## Learn More
|
|
442
|
+
|
|
443
|
+
- [TanStack Start Documentation](https://tanstack.com/start)
|
|
444
|
+
- [Server Entry](/docs/server-entry)
|