@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,68 @@
|
|
|
1
|
+
# GitHub Pages
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to GitHub Pages.
|
|
4
|
+
|
|
5
|
+
**Preset:** `github_pages`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
Follow the steps to [create a GitHub Pages site](https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site).
|
|
12
|
+
|
|
13
|
+
## Deployment
|
|
14
|
+
|
|
15
|
+
Here is an example GitHub Actions workflow to deploy your site to GitHub Pages using the `github_pages` preset:
|
|
16
|
+
|
|
17
|
+
```yaml [.github/workflows/deploy.yml]
|
|
18
|
+
# https://github.com/actions/deploy-pages#usage
|
|
19
|
+
name: Deploy to GitHub Pages
|
|
20
|
+
|
|
21
|
+
on:
|
|
22
|
+
workflow_dispatch:
|
|
23
|
+
push:
|
|
24
|
+
branches:
|
|
25
|
+
- main
|
|
26
|
+
|
|
27
|
+
jobs:
|
|
28
|
+
build:
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v5
|
|
32
|
+
- run: corepack enable
|
|
33
|
+
- uses: actions/setup-node@v6
|
|
34
|
+
with:
|
|
35
|
+
node-version: "18"
|
|
36
|
+
|
|
37
|
+
- run: npx nypm install
|
|
38
|
+
- run: npm run build
|
|
39
|
+
env:
|
|
40
|
+
NITRO_PRESET: github_pages
|
|
41
|
+
|
|
42
|
+
- name: Upload artifact
|
|
43
|
+
uses: actions/upload-pages-artifact@v1
|
|
44
|
+
with:
|
|
45
|
+
path: ./.output/public
|
|
46
|
+
|
|
47
|
+
# Deployment job
|
|
48
|
+
deploy:
|
|
49
|
+
# Add a dependency to the build job
|
|
50
|
+
needs: build
|
|
51
|
+
|
|
52
|
+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
|
|
53
|
+
permissions:
|
|
54
|
+
pages: write # to deploy to Pages
|
|
55
|
+
id-token: write # to verify the deployment originates from an appropriate source
|
|
56
|
+
|
|
57
|
+
# Deploy to the github_pages environment
|
|
58
|
+
environment:
|
|
59
|
+
name: github-pages
|
|
60
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
61
|
+
|
|
62
|
+
# Specify runner + deployment step
|
|
63
|
+
runs-on: ubuntu-latest
|
|
64
|
+
steps:
|
|
65
|
+
- name: Deploy to GitHub Pages
|
|
66
|
+
id: deployment
|
|
67
|
+
uses: actions/deploy-pages@v1
|
|
68
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# GitLab Pages
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to GitLab Pages.
|
|
4
|
+
|
|
5
|
+
**Preset:** `gitlab_pages`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
Follow the steps to [create a GitLab Pages site](https://docs.gitlab.com/ee/user/project/pages/#getting-started).
|
|
12
|
+
|
|
13
|
+
## Deployment
|
|
14
|
+
|
|
15
|
+
1. Here is an example GitLab Pages workflow to deploy your site to GitLab Pages:
|
|
16
|
+
|
|
17
|
+
```yaml [.gitlab-ci.yml]
|
|
18
|
+
image: node:lts
|
|
19
|
+
before_script:
|
|
20
|
+
- npx nypm install
|
|
21
|
+
pages:
|
|
22
|
+
cache:
|
|
23
|
+
paths:
|
|
24
|
+
- node_modules/
|
|
25
|
+
variables:
|
|
26
|
+
NITRO_PRESET: gitlab_pages
|
|
27
|
+
script:
|
|
28
|
+
- npm run build
|
|
29
|
+
artifacts:
|
|
30
|
+
paths:
|
|
31
|
+
- .output/public
|
|
32
|
+
publish: .output/public
|
|
33
|
+
rules:
|
|
34
|
+
# This ensures that only pushes to the default branch
|
|
35
|
+
# will trigger a pages deploy
|
|
36
|
+
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
|
37
|
+
```
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Heroku
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to Heroku.
|
|
4
|
+
|
|
5
|
+
**Preset:** `heroku`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
## Using the heroku CLI
|
|
10
|
+
|
|
11
|
+
1. Create a new Heroku app.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
heroku create myapp
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. Configure Heroku to use the nodejs buildpack.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
heroku buildpacks:set heroku/nodejs
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
3. Configure your app.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
heroku config:set NITRO_PRESET=heroku
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
4. Ensure you have `start` and `build` commands in your `package.json` file.
|
|
30
|
+
|
|
31
|
+
```json5
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "nitro build", // or `nuxt build` if using nuxt
|
|
34
|
+
"start": "node .output/server/index.mjs"
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## With nginx
|
|
40
|
+
|
|
41
|
+
1. Add the heroku Nginx buildpack [here](https://github.com/heroku/heroku-buildpack-nginx.git)
|
|
42
|
+
|
|
43
|
+
2. Change to the 'node' preset in your `nitro.config`
|
|
44
|
+
|
|
45
|
+
```json5
|
|
46
|
+
"nitro": {
|
|
47
|
+
"preset":"node",
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
3. From the **Existing app** section of buildpack doc, 2 key steps are required to get things running
|
|
52
|
+
|
|
53
|
+
Step 1: Listen on a socket at 'tmp/nginx.socket'
|
|
54
|
+
Step 2: Create a file '/tmp/app-initialized' when your app is ready to accept connections
|
|
55
|
+
|
|
56
|
+
4. Create custom app runner, eg: apprunner.mjs at the root of the project (or any other preferred location), in this file, create a server, using the listener generated by the node preset, then listen on the socket as detailed in the buildpack doc
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import { createServer } from 'node:http'
|
|
60
|
+
import { listener } from './.output/server/index.mjs'
|
|
61
|
+
|
|
62
|
+
const server = createServer(listener)
|
|
63
|
+
|
|
64
|
+
server.listen('/tmp/nginx.socket') //following the buildpack doc
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
5. To create the 'tmp/app-initialized' file, use a nitro plugin, create file 'initServer.ts' at the root of the project (or any other preferred location)
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import fs from "fs"
|
|
71
|
+
|
|
72
|
+
export default definePlugin((nitroApp) => {
|
|
73
|
+
if((process.env.NODE_ENV || 'development') != 'development') {
|
|
74
|
+
fs.openSync('/tmp/app-initialized', 'w')
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
6. Finally, create file 'Procfile' at the root of the project, with the Procfile, we tell heroku to start nginx and use the custom apprunner.mjs to start the server
|
|
80
|
+
|
|
81
|
+
web: bin/start-nginx node apprunner.mjs
|
|
82
|
+
|
|
83
|
+
7. Bonus: create file 'config/nginx.conf.erb' to customize your nginx config. With the node preset, by default, static files handlers will not be generated, you can use nginx to server static files, just add the right location rule to the server block(s), or, force the node preset to generate handlers for the static files by setting serveStatic to true.
|
|
84
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# IIS
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to IIS.
|
|
4
|
+
|
|
5
|
+
## Using [IISnode](https://github.com/Azure/iisnode)
|
|
6
|
+
|
|
7
|
+
**Preset:** `iis_node`
|
|
8
|
+
|
|
9
|
+
1. Install the latest LTS version of [Node.js](https://nodejs.org/en/) on your Windows Server.
|
|
10
|
+
2. Install [IISnode](https://github.com/azure/iisnode/releases)
|
|
11
|
+
3. Install [IIS `URLRewrite` Module](https://www.iis.net/downloads/microsoft/url-rewrite).
|
|
12
|
+
4. In IIS, add `.mjs` as a new mime type and set its content type to `application/javascript`.
|
|
13
|
+
5. Deploy the contents of your `.output` folder to your website in IIS.
|
|
14
|
+
|
|
15
|
+
## Using IIS handler
|
|
16
|
+
**Preset:** `iis_handler`
|
|
17
|
+
|
|
18
|
+
You can use IIS http handler directly.
|
|
19
|
+
|
|
20
|
+
1. Install the latest LTS version of [Node.js](https://nodejs.org/en/) on your Windows Server.
|
|
21
|
+
2. Install [IIS `HttpPlatformHandler` Module](https://www.iis.net/downloads/microsoft/httpplatformhandler)
|
|
22
|
+
3. Copy your `.output` directory into the Windows Server, and create a website on IIS pointing to that exact directory.
|
|
23
|
+
|
|
24
|
+
## IIS config options
|
|
25
|
+
|
|
26
|
+
```ts [nitro.config.ts]
|
|
27
|
+
import { defineNitroConfig } from "nitro/config";
|
|
28
|
+
|
|
29
|
+
export default defineNitroConfig({
|
|
30
|
+
// IIS options default
|
|
31
|
+
iis: {
|
|
32
|
+
// merges in a pre-existing web.config file to the nitro default file
|
|
33
|
+
mergeConfig: true,
|
|
34
|
+
// overrides the default nitro web.config file all together
|
|
35
|
+
overrideConfig: false,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
```
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Koyeb
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to Koyeb.
|
|
4
|
+
|
|
5
|
+
**Preset:** `koyeb`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
## Using the control panel
|
|
10
|
+
|
|
11
|
+
1. In the [Koyeb control panel](https://app.koyeb.com/), click **Create App**.
|
|
12
|
+
|
|
13
|
+
2. Choose **GitHub** as your deployment method.
|
|
14
|
+
|
|
15
|
+
3. Choose the GitHub **repository** and **branch** containing your application code.
|
|
16
|
+
|
|
17
|
+
4. Name your Service.
|
|
18
|
+
|
|
19
|
+
5. If you did not add a `start` command to your `package.json` file, under the **Build and deployment settings**, toggle the override switch associated with the run command field. In the **Run command** field, enter:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
node .output/server/index.mjs`
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
6. In the **Advanced** section, click **Add Variable** and add a `NITRO_PRESET` variable set to `koyeb`.
|
|
26
|
+
|
|
27
|
+
7. Name the App.
|
|
28
|
+
|
|
29
|
+
8. Click the **Deploy** button.
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## Using the Koyeb CLI
|
|
33
|
+
|
|
34
|
+
1. Follow the instructions targeting your operating system to [install the Koyeb CLI client](https://www.koyeb.com/docs/cli/installation) with an installer. Alternatively, visit the [releases page on GitHub](https://github.com/koyeb/koyeb-cli/releases) to directly download required files.
|
|
35
|
+
|
|
36
|
+
2. Create a Koyeb API access token by visiting the [API settings for your organization](https://app.koyeb.com/settings/api) in the Koyeb control panel.
|
|
37
|
+
|
|
38
|
+
3. Log into your account with the Koyeb CLI by typing:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
koyeb login
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Paste your API credentials when prompted.
|
|
45
|
+
|
|
46
|
+
4. Deploy your Nitro application from a GitHub repository with the following command. Be sure to substitute your own values for `<APPLICATION_NAME>`, `<YOUR_GITHUB_USERNAME>`, and `<YOUR_REPOSITORY_NAME>`:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
koyeb app init <APPLICATION_NAME> \
|
|
50
|
+
--git github.com/<YOUR_GITHUB_USERNAME>/<YOUR_REPOSITORY_NAME> \
|
|
51
|
+
--git-branch main \
|
|
52
|
+
--git-run-command "node .output/server/index.mjs" \
|
|
53
|
+
--ports 3000:http \
|
|
54
|
+
--routes /:3000 \
|
|
55
|
+
--env PORT=3000 \
|
|
56
|
+
--env NITRO_PRESET=koyeb
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## Using a docker container
|
|
61
|
+
|
|
62
|
+
1. Create a `.dockerignore` file in the root of your project and add the following lines:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
Dockerfile
|
|
66
|
+
.dockerignore
|
|
67
|
+
node_modules
|
|
68
|
+
npm-debug.log
|
|
69
|
+
.nitro
|
|
70
|
+
.output
|
|
71
|
+
.git
|
|
72
|
+
dist
|
|
73
|
+
README.md
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
2. Add a `Dockerfile` to the root of your project:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
FROM node:18-alpine AS base
|
|
80
|
+
|
|
81
|
+
FROM base AS deps
|
|
82
|
+
RUN apk add --no-cache libc6-compat
|
|
83
|
+
WORKDIR /app
|
|
84
|
+
COPY package.json package-lock.json ./
|
|
85
|
+
RUN npm ci
|
|
86
|
+
|
|
87
|
+
FROM base AS builder
|
|
88
|
+
WORKDIR /app
|
|
89
|
+
COPY --from=deps /app/node_modules ./node_modules
|
|
90
|
+
COPY . .
|
|
91
|
+
RUN npm run build && npm cache clean --force
|
|
92
|
+
|
|
93
|
+
FROM base AS runner
|
|
94
|
+
WORKDIR /app
|
|
95
|
+
RUN addgroup --system --gid 1001 nodejs
|
|
96
|
+
RUN adduser --system --uid 1001 nitro
|
|
97
|
+
COPY --from=builder /app .
|
|
98
|
+
USER nitro
|
|
99
|
+
EXPOSE 3000
|
|
100
|
+
ENV PORT 3000
|
|
101
|
+
CMD ["npm", "run", "start"]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
The Dockerfile above provides the minimum requirements to run the Nitro application. You can easily extend it depending on your needs.
|
|
106
|
+
You will then need to push your Docker image to a registry. You can use [Docker Hub](https://hub.docker.com/) or [GitHub Container Registry](https://docs.github.com/en/packages/guides/about-github-container-registry) for example.
|
|
107
|
+
In the Koyeb control panel, use the image and the tag field to specify the image you want to deploy.
|
|
108
|
+
You can also use the [Koyeb CLI](https://www.koyeb.com/docs/build-and-deploy/cli/installation)
|
|
109
|
+
Refer to the Koyeb [Docker documentation](https://www.koyeb.com/docs/build-and-deploy/prebuilt-docker-images) for more information.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Netlify
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to Netlify functions or edge.
|
|
4
|
+
|
|
5
|
+
**Preset:** `netlify`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
<note>
|
|
10
|
+
|
|
11
|
+
Integration with this provider is possible with [zero configuration](/deploy/#zero-config-providers).
|
|
12
|
+
</note>
|
|
13
|
+
|
|
14
|
+
Normally, the deployment to Netlify does not require any configuration.
|
|
15
|
+
Nitro will auto-detect that you are in a [Netlify](https://www.netlify.com) build environment and build the correct version of your server.
|
|
16
|
+
|
|
17
|
+
For new sites, Netlify will detect that you are using Nitro and set the publish directory to `dist` and build command to `npm run build`.
|
|
18
|
+
|
|
19
|
+
If you are upgrading an existing site you should check these and update them if needed.
|
|
20
|
+
|
|
21
|
+
If you want to add custom redirects, you can do so with [`routeRules`](/config#routerules) or by adding a [`_redirects`](https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file) file to your `public` directory.
|
|
22
|
+
|
|
23
|
+
For deployment, just push to your git repository [as you would normally do for Netlify](https://docs.netlify.com/configure-builds/get-started/).
|
|
24
|
+
|
|
25
|
+
<note>
|
|
26
|
+
|
|
27
|
+
Make sure the publish directory is set to `dist` when creating a new project.
|
|
28
|
+
</note>
|
|
29
|
+
|
|
30
|
+
## Netlify edge functions
|
|
31
|
+
|
|
32
|
+
**Preset:** `netlify_edge`
|
|
33
|
+
|
|
34
|
+
Netlify Edge Functions use Deno and the powerful V8 JavaScript runtime to let you run globally distributed functions for the fastest possible response times.
|
|
35
|
+
|
|
36
|
+
<read-more></read-more>
|
|
37
|
+
|
|
38
|
+
Nitro output can directly run the server at the edge. Closer to your users.
|
|
39
|
+
|
|
40
|
+
<note>
|
|
41
|
+
|
|
42
|
+
Make sure the publish directory is set to `dist` when creating a new project.
|
|
43
|
+
</note>
|
|
44
|
+
|
|
45
|
+
## Custom deploy configuration
|
|
46
|
+
|
|
47
|
+
You can provide additional deploy configuration using the `netlify` key inside `nitro.config`. It will be merged with built-in auto-generated config. Currently the only supported value is `images.remote_images`, for [configuring Netlify Image CDN](https://docs.netlify.com/image-cdn/create-integration/).
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Platform.sh
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to platform.sh
|
|
4
|
+
|
|
5
|
+
**Preset:** `platform_sh`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
First, create a new project on platform.sh and link it to the repository you want to auto-deploy with.
|
|
12
|
+
|
|
13
|
+
Then in repository create `.platform.app.yaml` file:
|
|
14
|
+
|
|
15
|
+
```yaml [.platform.app.yaml]
|
|
16
|
+
name: nitro-app
|
|
17
|
+
type: 'nodejs:20'
|
|
18
|
+
disk: 128
|
|
19
|
+
web:
|
|
20
|
+
commands:
|
|
21
|
+
start: "node .output/server/index.mjs"
|
|
22
|
+
build:
|
|
23
|
+
flavor: none
|
|
24
|
+
hooks:
|
|
25
|
+
build: |
|
|
26
|
+
corepack enable
|
|
27
|
+
npx nypm install
|
|
28
|
+
NITRO_PRESET=platform_sh npm run build
|
|
29
|
+
mounts:
|
|
30
|
+
'.data':
|
|
31
|
+
source: local
|
|
32
|
+
source_path: .data
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
<read-more></read-more>
|
|
36
|
+
|
|
37
|
+
<read-more></read-more>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Render.com
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to Render.com.
|
|
4
|
+
|
|
5
|
+
**Preset:** `render_com`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
## Set up application
|
|
10
|
+
|
|
11
|
+
1. [Create a new Web Service](https://dashboard.render.com/select-repo?type=web) and select the repository that contains your code.
|
|
12
|
+
2. Ensure the 'Node' environment is selected.
|
|
13
|
+
3. Update the start command to `node .output/server/index.mjs`
|
|
14
|
+
4. Click 'Advanced' and add an environment variable with `NITRO_PRESET` set to `render_com`. You may also need to add a `NODE_VERSION` environment variable set to `20` for the build to succeed ([docs](https://render.com/docs/node-version)).
|
|
15
|
+
5. Click 'Create Web Service'.
|
|
16
|
+
|
|
17
|
+
## Infrastructure as Code (IaC)
|
|
18
|
+
|
|
19
|
+
1. Create a file called `render.yaml` with following content at the root of your repository.
|
|
20
|
+
|
|
21
|
+
This file followed by [Infrastructure as Code](https://render.com/docs/infrastructure-as-code) on Render
|
|
22
|
+
|
|
23
|
+
```yaml
|
|
24
|
+
services:
|
|
25
|
+
- type: web
|
|
26
|
+
name: <PROJECTNAME>
|
|
27
|
+
env: node
|
|
28
|
+
branch: main
|
|
29
|
+
startCommand: node .output/server/index.mjs
|
|
30
|
+
buildCommand: npx nypm install && npm run build
|
|
31
|
+
envVars:
|
|
32
|
+
- key: NITRO_PRESET
|
|
33
|
+
value: render_com
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
1. [Create a new Blueprint Instance](https://dashboard.render.com/select-repo?type=blueprint) and select the repository containing your `render.yaml` file.
|
|
37
|
+
You should be good to go!
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# StormKit
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to StormKit.
|
|
4
|
+
|
|
5
|
+
**Preset:** `stormkit`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
<note>
|
|
10
|
+
|
|
11
|
+
Integration with [Stormkit](https://www.stormkit.io/) is possible with [zero configuration](/deploy#zero-config-providers).
|
|
12
|
+
</note>
|
|
13
|
+
|
|
14
|
+
## Setup
|
|
15
|
+
|
|
16
|
+
Follow the steps to [create a new app](https://app.stormkit.io/apps/new) on Stormkit.
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
## Deployment
|
|
21
|
+
|
|
22
|
+
By default, Stormkit will deploy your apps automatically when you push changes to your main branch. But to trigger a manual deploy (for example, you might do this for the very first deployment), you may click `Deploy now`.
|
|
23
|
+
|
|
24
|
+

|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# Vercel
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to Vercel.
|
|
4
|
+
|
|
5
|
+
**Preset:** `vercel`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
<note>
|
|
10
|
+
|
|
11
|
+
Integration with this provider is possible with [zero configuration](/deploy/#zero-config-providers).
|
|
12
|
+
</note>
|
|
13
|
+
|
|
14
|
+
## Getting started
|
|
15
|
+
|
|
16
|
+
Deploying to Vercel comes with the following features:
|
|
17
|
+
|
|
18
|
+
- [Preview deployments](https://vercel.com/docs/deployments/environments)
|
|
19
|
+
- [Fluid compute](https://vercel.com/docs/fluid-compute)
|
|
20
|
+
- [Observability](https://vercel.com/docs/observability)
|
|
21
|
+
- [Vercel Firewall](https://vercel.com/docs/vercel-firewall)
|
|
22
|
+
And much more. Learn more in [the Vercel documentation](https://vercel.com/docs).
|
|
23
|
+
|
|
24
|
+
### Deploy with Git
|
|
25
|
+
|
|
26
|
+
Vercel supports Nitro with zero-configuration. [Deploy Nitro to Vercel now](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fvercel%2Ftree%2Fmain%2Fexamples%2Fnitro).
|
|
27
|
+
|
|
28
|
+
## API routes
|
|
29
|
+
|
|
30
|
+
Nitro `/api` directory isn't compatible with Vercel. Instead, you should use:
|
|
31
|
+
|
|
32
|
+
- `routes/api/` for standalone usage
|
|
33
|
+
|
|
34
|
+
## Bun runtime
|
|
35
|
+
<read-more></read-more>
|
|
36
|
+
|
|
37
|
+
You can use [Bun](https://bun.com) instead of Node.js by specifying the runtime using the `vercel.functions` key inside `nitro.config`:
|
|
38
|
+
|
|
39
|
+
```ts [nitro.config.ts]
|
|
40
|
+
export default defineNitroConfig({
|
|
41
|
+
vercel: {
|
|
42
|
+
functions: {
|
|
43
|
+
runtime: "bun1.x"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Alternatively, Nitro also detects Bun automatically if you specify a `bunVersion` property in your `vercel.json`:
|
|
50
|
+
|
|
51
|
+
```json [vercel.json]
|
|
52
|
+
{
|
|
53
|
+
"$schema": "https://openapi.vercel.sh/vercel.json",
|
|
54
|
+
"bunVersion": "1.x"
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Proxy route rules
|
|
59
|
+
|
|
60
|
+
Nitro automatically optimizes `proxy` route rules on Vercel by generating [CDN-level rewrites](https://vercel.com/docs/rewrites) at build time. This means matching requests are proxied at the edge without invoking a serverless function, reducing latency and cost.
|
|
61
|
+
|
|
62
|
+
```ts [nitro.config.ts]
|
|
63
|
+
export default defineNitroConfig({
|
|
64
|
+
routeRules: {
|
|
65
|
+
// Proxied at CDN level — no function invocation
|
|
66
|
+
"/api/**": {
|
|
67
|
+
proxy: "https://api.example.com/**",
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### When CDN rewrites apply
|
|
74
|
+
|
|
75
|
+
A proxy rule is offloaded to a Vercel CDN rewrite when **all** of the following are true:
|
|
76
|
+
|
|
77
|
+
- The target is an **external URL** (starts with `http://` or `https://`).
|
|
78
|
+
- No advanced `ProxyOptions` are set on the rule.
|
|
79
|
+
|
|
80
|
+
### Fallback to runtime proxy
|
|
81
|
+
When the proxy rule uses any of the following `ProxyOptions`, Nitro keeps it as a runtime proxy handled by the serverless function:
|
|
82
|
+
|
|
83
|
+
- `headers` — custom headers on the outgoing request to the upstream
|
|
84
|
+
- `forwardHeaders` / `filterHeaders` — header filtering
|
|
85
|
+
- `fetchOptions` — custom fetch options
|
|
86
|
+
- `cookieDomainRewrite` / `cookiePathRewrite` — cookie manipulation
|
|
87
|
+
- `onResponse` — response callback
|
|
88
|
+
|
|
89
|
+
<note>
|
|
90
|
+
|
|
91
|
+
Response headers defined on the route rule via the `headers` option are still applied to CDN-level rewrites. Only request-level `ProxyOptions.headers` (sent to the upstream) require a runtime proxy.
|
|
92
|
+
</note>
|
|
93
|
+
|
|
94
|
+
## Scheduled tasks (Cron Jobs)
|
|
95
|
+
|
|
96
|
+
<read-more></read-more>
|
|
97
|
+
|
|
98
|
+
Nitro automatically converts your [`scheduledTasks`](/docs/tasks#scheduled-tasks) configuration into [Vercel Cron Jobs](https://vercel.com/docs/cron-jobs) at build time. Define your schedules in your Nitro config and deploy - no manual `vercel.json` cron configuration required.
|
|
99
|
+
|
|
100
|
+
```ts [nitro.config.ts]
|
|
101
|
+
import { defineNitroConfig } from "nitro/config";
|
|
102
|
+
|
|
103
|
+
export default defineNitroConfig({
|
|
104
|
+
experimental: {
|
|
105
|
+
tasks: true
|
|
106
|
+
},
|
|
107
|
+
scheduledTasks: {
|
|
108
|
+
// Run `cms:update` every hour
|
|
109
|
+
'0 * * * *': ['cms:update'],
|
|
110
|
+
// Run `db:cleanup` every day at midnight
|
|
111
|
+
'0 0 * * *': ['db:cleanup']
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Secure cron job endpoints
|
|
117
|
+
|
|
118
|
+
<read-more></read-more>
|
|
119
|
+
|
|
120
|
+
To prevent unauthorized access to the cron handler, set a `CRON_SECRET` environment variable in your Vercel project settings. When `CRON_SECRET` is set, Nitro validates the `Authorization` header on every cron invocation.
|
|
121
|
+
|
|
122
|
+
## Custom build output configuration
|
|
123
|
+
|
|
124
|
+
You can provide additional [build output configuration](https://vercel.com/docs/build-output-api/v3) using `vercel.config` key inside `nitro.config`. It will be merged with built-in auto-generated config.
|
|
125
|
+
|
|
126
|
+
## On-Demand incremental static regeneration (ISR)
|
|
127
|
+
|
|
128
|
+
On-demand revalidation allows you to purge the cache for an ISR route whenever you want, foregoing the time interval required with background revalidation.
|
|
129
|
+
|
|
130
|
+
To revalidate a page on demand:
|
|
131
|
+
|
|
132
|
+
1. Create an Environment Variable which will store a revalidation secret
|
|
133
|
+
- You can use the command `openssl rand -base64 32` or [Generate a Secret](https://generate-secret.vercel.app/32) to generate a random value.
|
|
134
|
+
|
|
135
|
+
- Update your configuration:
|
|
136
|
+
|
|
137
|
+
```ts [nitro.config.ts]
|
|
138
|
+
import { defineNitroConfig } from "nitro/config";
|
|
139
|
+
|
|
140
|
+
export default defineNitroConfig({
|
|
141
|
+
vercel: {
|
|
142
|
+
config: {
|
|
143
|
+
bypassToken: process.env.VERCEL_BYPASS_TOKEN
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
})
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
- To trigger "On-Demand Incremental Static Regeneration (ISR)" and revalidate a path to a Prerender Function, make a GET or HEAD request to that path with a header of x-prerender-revalidate: `bypassToken`. When that Prerender Function endpoint is accessed with this header set, the cache will be revalidated. The next request to that function should return a fresh response.
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
### Fine-grained ISR config via route rules
|
|
153
|
+
|
|
154
|
+
By default, query params affect cache keys but are not passed to the route handler unless specified.
|
|
155
|
+
|
|
156
|
+
You can pass an options object to `isr` route rule to configure caching behavior.
|
|
157
|
+
|
|
158
|
+
- `expiration`: Expiration time (in seconds) before the cached asset will be re-generated by invoking the Serverless Function. Setting the value to `false` (or `isr: true` route rule) means it will never expire.
|
|
159
|
+
- `group`: Group number of the asset. Prerender assets with the same group number will all be re-validated at the same time.
|
|
160
|
+
- `allowQuery`: List of query string parameter names that will be cached independently. - If an empty array, query values are not considered for caching.
|
|
161
|
+
- If `undefined` each unique query value is cached independently.
|
|
162
|
+
- For wildcard `/**` route rules, `url` is always added
|
|
163
|
+
|
|
164
|
+
- `passQuery`: When `true`, the query string will be present on the `request` argument passed to the invoked function. The `allowQuery` filter still applies.
|
|
165
|
+
- `exposeErrBody`: When `true`, expose the response body regardless of status code including error status codes. (default `false`
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
export default defineNitroConfig({
|
|
169
|
+
routeRules: {
|
|
170
|
+
"/products/**": {
|
|
171
|
+
isr: {
|
|
172
|
+
allowQuery: ["q"],
|
|
173
|
+
passQuery: true,
|
|
174
|
+
exposeErrBody: true
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Zeabur
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to [Zeabur](https://zeabur.com).
|
|
4
|
+
|
|
5
|
+
**Preset:** `zeabur`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
<note>
|
|
10
|
+
|
|
11
|
+
Integration with this provider is possible with [zero configuration](/deploy/#zero-config-providers).
|
|
12
|
+
</note>
|
|
13
|
+
|
|
14
|
+
## Deploy using git
|
|
15
|
+
|
|
16
|
+
1. Push your code to your git repository (Currently only GitHub supported).
|
|
17
|
+
2. [Import your project](https://zeabur.com/docs/get-started) into Zeabur.
|
|
18
|
+
3. Zeabur will detect that you are using Nitro and will enable the correct settings for your deployment.
|
|
19
|
+
4. Your application is deployed!
|