@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,375 @@
|
|
|
1
|
+
# Cloudflare
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to Cloudflare.
|
|
4
|
+
|
|
5
|
+
## Cloudflare Workers
|
|
6
|
+
|
|
7
|
+
**Preset:** `cloudflare_module`
|
|
8
|
+
|
|
9
|
+
<read-more></read-more>
|
|
10
|
+
|
|
11
|
+
<note>
|
|
12
|
+
|
|
13
|
+
Integration with this provider is possible with [zero configuration](/deploy#zero-config-providers) supporting [workers builds (beta)](https://developers.cloudflare.com/workers/ci-cd/builds/).
|
|
14
|
+
</note>
|
|
15
|
+
|
|
16
|
+
<important>
|
|
17
|
+
|
|
18
|
+
To use Workers with Static Assets, you need a Nitro compatibility date set to `2024-09-19` or later.
|
|
19
|
+
</important>
|
|
20
|
+
|
|
21
|
+
The following shows an example `nitro.config.ts` file for deploying a Nitro app to Cloudflare Workers.
|
|
22
|
+
|
|
23
|
+
```ts [nitro.config.ts]
|
|
24
|
+
import { defineNitroConfig } from "nitro/config";
|
|
25
|
+
|
|
26
|
+
export default defineNitroConfig({
|
|
27
|
+
compatibilityDate: "2024-09-19",
|
|
28
|
+
preset: "cloudflare_module",
|
|
29
|
+
cloudflare: {
|
|
30
|
+
deployConfig: true,
|
|
31
|
+
nodeCompat: true
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
By setting `deployConfig: true`, Nitro will automatically generate a `wrangler.json` for you with the correct configuration.
|
|
37
|
+
If you need to add [Cloudflare Workers configuration](https://developers.cloudflare.com/workers/wrangler/configuration/), such as [bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/), you can either:
|
|
38
|
+
|
|
39
|
+
- Set these in your Nitro config under the `cloudflare: { wrangler : {} }`. This has the same type as `wrangler.json`.
|
|
40
|
+
- Provide your own `wrangler.json`. Nitro will merge your config with the appropriate settings, including pointing to the build output.
|
|
41
|
+
|
|
42
|
+
### Local Preview
|
|
43
|
+
You can use [Wrangler](https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler) to preview your app locally:
|
|
44
|
+
|
|
45
|
+
<pm-run></pm-run>
|
|
46
|
+
|
|
47
|
+
<pm-x></pm-x>
|
|
48
|
+
|
|
49
|
+
### Manual Deploy
|
|
50
|
+
|
|
51
|
+
After having built your application you can manually deploy it with Wrangler.
|
|
52
|
+
|
|
53
|
+
First make sure to be logged into your Cloudflare account:
|
|
54
|
+
|
|
55
|
+
<pm-x></pm-x>
|
|
56
|
+
|
|
57
|
+
Then you can deploy the application with:
|
|
58
|
+
|
|
59
|
+
<pm-x></pm-x>
|
|
60
|
+
|
|
61
|
+
### Runtime Hooks
|
|
62
|
+
|
|
63
|
+
You can use [runtime hooks](/docs/plugins#nitro-runtime-hooks) below in order to extend [Worker handlers](https://developers.cloudflare.com/workers/runtime-apis/handlers/).
|
|
64
|
+
|
|
65
|
+
<read-more></read-more>
|
|
66
|
+
|
|
67
|
+
- [`cloudflare:scheduled`](https://developers.cloudflare.com/workers/runtime-apis/handlers/scheduled/)
|
|
68
|
+
- [`cloudflare:email`](https://developers.cloudflare.com/email-routing/email-workers/runtime-api/)
|
|
69
|
+
- [`cloudflare:queue`](https://developers.cloudflare.com/queues/configuration/javascript-apis/#consumer)
|
|
70
|
+
- [`cloudflare:tail`](https://developers.cloudflare.com/workers/runtime-apis/handlers/tail/)
|
|
71
|
+
- `cloudflare:trace`
|
|
72
|
+
|
|
73
|
+
### Additional Exports
|
|
74
|
+
You can add a `exports.cloudflare.ts` file to your project root to export additional handlers or properties to the Cloudflare Worker entrypoint.
|
|
75
|
+
|
|
76
|
+
```ts [exports.cloudflare.ts]
|
|
77
|
+
export class MyWorkflow extends WorkflowEntrypoint {
|
|
78
|
+
async run(event: WorkflowEvent, step: WorkflowStep) {
|
|
79
|
+
// ...
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Nitro will automatically detect this file and include its exports in the final build.
|
|
85
|
+
|
|
86
|
+
<warning>
|
|
87
|
+
|
|
88
|
+
The `exports.cloudflare.ts` file must not have a default export.
|
|
89
|
+
</warning>
|
|
90
|
+
|
|
91
|
+
You can also customize the entrypoint file location using the `cloudflare.exports` option in your `nitro.config.ts`:
|
|
92
|
+
|
|
93
|
+
```ts [nitro.config.ts]
|
|
94
|
+
export default defineConfig({
|
|
95
|
+
cloudflare: {
|
|
96
|
+
exports: "custom-exports-entry.ts"
|
|
97
|
+
}
|
|
98
|
+
})
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Scheduled Tasks (Cron Triggers)
|
|
102
|
+
|
|
103
|
+
When using [Nitro tasks](/docs/tasks) with `scheduledTasks`, Nitro automatically generates [Cron Triggers](https://developers.cloudflare.com/workers/configuration/cron-triggers/) in the wrangler config at build time.
|
|
104
|
+
|
|
105
|
+
```ts [nitro.config.ts]
|
|
106
|
+
import { defineNitroConfig } from "nitro/config";
|
|
107
|
+
|
|
108
|
+
export default defineNitroConfig({
|
|
109
|
+
preset: "cloudflare_module",
|
|
110
|
+
experimental: {
|
|
111
|
+
tasks: true,
|
|
112
|
+
},
|
|
113
|
+
scheduledTasks: {
|
|
114
|
+
"* * * * *": ["cms:update"],
|
|
115
|
+
"0 15 1 * *": ["db:cleanup"],
|
|
116
|
+
},
|
|
117
|
+
cloudflare: {
|
|
118
|
+
deployConfig: true,
|
|
119
|
+
},
|
|
120
|
+
})
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
No manual Wrangler configuration is needed - Nitro handles it for you.
|
|
124
|
+
|
|
125
|
+
## Cloudflare Pages
|
|
126
|
+
|
|
127
|
+
**Preset:** `cloudflare_pages`
|
|
128
|
+
|
|
129
|
+
<read-more></read-more>
|
|
130
|
+
|
|
131
|
+
<note>
|
|
132
|
+
|
|
133
|
+
Integration with this provider is possible with [zero configuration](/deploy#zero-config-providers).
|
|
134
|
+
</note>
|
|
135
|
+
|
|
136
|
+
<warning>
|
|
137
|
+
|
|
138
|
+
Cloudflare [Workers Module](#cloudflare-workers) is the new recommended preset for deployments. Please consider using the pages only if you need specific features.
|
|
139
|
+
</warning>
|
|
140
|
+
|
|
141
|
+
The following shows an example `nitro.config.ts` file for deploying a Nitro app to Cloudflare Pages.
|
|
142
|
+
|
|
143
|
+
```ts [nitro.config.ts]
|
|
144
|
+
import { defineNitroConfig } from "nitro/config";
|
|
145
|
+
|
|
146
|
+
export default defineNitroConfig({
|
|
147
|
+
preset: "cloudflare_pages",
|
|
148
|
+
cloudflare: {
|
|
149
|
+
deployConfig: true,
|
|
150
|
+
nodeCompat:true
|
|
151
|
+
}
|
|
152
|
+
})
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Nitro automatically generates a `_routes.json` file that controls which routes get served from files and which are served from the Worker script. The auto-generated routes file can be overridden with the config option `cloudflare.pages.routes` ([read more](https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes)).
|
|
156
|
+
|
|
157
|
+
### Local Preview
|
|
158
|
+
|
|
159
|
+
You can use [Wrangler](https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler) to preview your app locally:
|
|
160
|
+
|
|
161
|
+
<pm-run></pm-run>
|
|
162
|
+
|
|
163
|
+
<pm-x></pm-x>
|
|
164
|
+
|
|
165
|
+
### Manual Deploy
|
|
166
|
+
|
|
167
|
+
After having built your application you can manually deploy it with Wrangler, in order to do so first make sure to be
|
|
168
|
+
logged into your Cloudflare account:
|
|
169
|
+
|
|
170
|
+
<pm-x></pm-x>
|
|
171
|
+
|
|
172
|
+
Then you can deploy the application with:
|
|
173
|
+
|
|
174
|
+
<pm-x></pm-x>
|
|
175
|
+
|
|
176
|
+
## Deploy within CI/CD using GitHub Actions
|
|
177
|
+
|
|
178
|
+
Regardless on whether you're using Cloudflare Pages or Cloudflare Workers, you can use the [Wrangler GitHub actions](https://github.com/marketplace/actions/deploy-to-cloudflare-workers-with-wrangler) to deploy your application.
|
|
179
|
+
|
|
180
|
+
<note>
|
|
181
|
+
|
|
182
|
+
**Note:** Remember to [instruct Nitro to use the correct preset](/deploy#changing-the-deployment-preset) (note that this is necessary for all presets including the `cloudflare_pages` one).
|
|
183
|
+
</note>
|
|
184
|
+
|
|
185
|
+
## Environment Variables
|
|
186
|
+
|
|
187
|
+
Nitro allows you to universally access environment variables using `process.env` or `import.meta.env` or the runtime config.
|
|
188
|
+
|
|
189
|
+
<note>
|
|
190
|
+
|
|
191
|
+
Make sure to only access environment variables **within the event lifecycle** and not in global contexts since Cloudflare only makes them available during the request lifecycle and not before.
|
|
192
|
+
</note>
|
|
193
|
+
|
|
194
|
+
**Example:** If you have set the `SECRET` and `NITRO_HELLO_THERE` environment variables set you can access them in the following way:
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
import { defineHandler } from "nitro";
|
|
198
|
+
import { useRuntimeConfig } from "nitro/runtime-config";
|
|
199
|
+
|
|
200
|
+
console.log(process.env.SECRET) // note that this is in the global scope! so it doesn't actually work and the variable is undefined!
|
|
201
|
+
|
|
202
|
+
export default defineHandler((event) => {
|
|
203
|
+
// note that all the below are valid ways of accessing the above mentioned variables
|
|
204
|
+
useRuntimeConfig().helloThere
|
|
205
|
+
useRuntimeConfig().secret
|
|
206
|
+
process.env.NITRO_HELLO_THERE
|
|
207
|
+
import.meta.env.SECRET
|
|
208
|
+
});
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Specify Variables in Development Mode
|
|
212
|
+
|
|
213
|
+
For development, you can use a `.env` or `.env.local` file to specify environment variables:
|
|
214
|
+
|
|
215
|
+
```ini
|
|
216
|
+
NITRO_HELLO_THERE="captain"
|
|
217
|
+
SECRET="top-secret"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
<note>
|
|
221
|
+
|
|
222
|
+
**Note:** Make sure you add `.env` and `.env.local` to the `.gitignore` file so that you don't commit it as it can contain sensitive information.
|
|
223
|
+
</note>
|
|
224
|
+
|
|
225
|
+
### Specify Variables for local previews
|
|
226
|
+
|
|
227
|
+
After build, when you try out your project locally with `wrangler dev` or `wrangler pages dev`, in order to have access to environment variables you will need to specify the in a `.dev.vars` file in the root of your project (as presented in the [Pages](https://developers.cloudflare.com/pages/functions/bindings/#interact-with-your-environment-variables-locally) and [Workers](https://developers.cloudflare.com/workers/configuration/environment-variables/#interact-with-environment-variables-locally) documentation).
|
|
228
|
+
|
|
229
|
+
If you are using a `.env` or `.env.local` file while developing, your `.dev.vars` should be identical to it.
|
|
230
|
+
|
|
231
|
+
<note>
|
|
232
|
+
|
|
233
|
+
**Note:** Make sure you add `.dev.vars` to the `.gitignore` file so that you don't commit it as it can contain sensitive information.
|
|
234
|
+
</note>
|
|
235
|
+
|
|
236
|
+
### Specify Variables for Production
|
|
237
|
+
|
|
238
|
+
For production, use the Cloudflare dashboard or the [`wrangler secret`](https://developers.cloudflare.com/workers/wrangler/commands/#secret) command to set environment variables and secrets.
|
|
239
|
+
|
|
240
|
+
### Specify Variables using `wrangler.toml`/`wrangler.json`
|
|
241
|
+
|
|
242
|
+
You can specify a custom `wrangler.toml`/`wrangler.json` file and define vars inside.
|
|
243
|
+
|
|
244
|
+
<warning>
|
|
245
|
+
|
|
246
|
+
Note that this isn't recommend for sensitive data like secrets.
|
|
247
|
+
</warning>
|
|
248
|
+
|
|
249
|
+
**Example:**
|
|
250
|
+
|
|
251
|
+
<code-group>
|
|
252
|
+
|
|
253
|
+
```ini [wrangler.toml]
|
|
254
|
+
# Shared
|
|
255
|
+
[vars]
|
|
256
|
+
NITRO_HELLO_THERE="general"
|
|
257
|
+
SECRET="secret"
|
|
258
|
+
|
|
259
|
+
# Override values for `--env production` usage
|
|
260
|
+
[env.production.vars]
|
|
261
|
+
NITRO_HELLO_THERE="captain"
|
|
262
|
+
SECRET="top-secret"
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
```json [wrangler.json]
|
|
266
|
+
{
|
|
267
|
+
"vars": {
|
|
268
|
+
"NITRO_HELLO_THERE": "general",
|
|
269
|
+
"SECRET": "secret"
|
|
270
|
+
},
|
|
271
|
+
"env": {
|
|
272
|
+
"production": {
|
|
273
|
+
"vars": {
|
|
274
|
+
"NITRO_HELLO_THERE": "captain",
|
|
275
|
+
"SECRET": "top-secret"
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
```
|
|
282
|
+
</code-group>
|
|
283
|
+
|
|
284
|
+
## Direct access to Cloudflare bindings
|
|
285
|
+
|
|
286
|
+
Bindings are what allows you to interact with resources from the Cloudflare platform, examples of such resources are key-value data storages ([KVs](https://developers.cloudflare.com/kv/)) and serverless SQL databases ([D1s](https://developers.cloudflare.com/d1/)).
|
|
287
|
+
|
|
288
|
+
<read-more>
|
|
289
|
+
|
|
290
|
+
For more details on Bindings and how to use them please refer to the Cloudflare [Pages](https://developers.cloudflare.com/pages/functions/bindings/) and [Workers](https://developers.cloudflare.com/workers/configuration/bindings/#bindings) documentation.
|
|
291
|
+
</read-more>
|
|
292
|
+
|
|
293
|
+
> [!TIP]
|
|
294
|
+
> Nitro provides high level API to interact with primitives such as [KV Storage](/docs/storage) and [Database](/docs/database) and you are highly recommended to prefer using them instead of directly depending on low-level APIs for usage stability.
|
|
295
|
+
|
|
296
|
+
<read-more></read-more>
|
|
297
|
+
|
|
298
|
+
<read-more></read-more>
|
|
299
|
+
|
|
300
|
+
In runtime, you can access bindings from the request event via `event.req.runtime.cloudflare.env`. This is for example how you can access a D1 binding:
|
|
301
|
+
|
|
302
|
+
<warning>
|
|
303
|
+
|
|
304
|
+
**Nitro v3 Breaking Change:** The `event.context.cloudflare.env` pattern from Nitro v2 no longer works in production. Use `event.req.runtime.cloudflare.env` instead. The old pattern may still appear to work in local dev (via the Wrangler proxy plugin) but will be `undefined` in production deployments.
|
|
305
|
+
</warning>
|
|
306
|
+
|
|
307
|
+
```ts
|
|
308
|
+
import { defineHandler } from "nitro";
|
|
309
|
+
|
|
310
|
+
defineHandler(async (event) => {
|
|
311
|
+
// Nitro v3: access Cloudflare bindings via event.req.runtime.cloudflare.env
|
|
312
|
+
const { env } = event.req.runtime.cloudflare
|
|
313
|
+
const stmt = await env.MY_D1.prepare('SELECT id FROM table')
|
|
314
|
+
const { results } = await stmt.all()
|
|
315
|
+
})
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Access to the bindings in local dev
|
|
319
|
+
|
|
320
|
+
To access bindings in dev mode, we first define them. You can do this in a `wrangler.jsonc`/`wrangler.json`/`wrangler.toml` file
|
|
321
|
+
|
|
322
|
+
For example, to define a variable and a KV namespace in `wrangler.toml`:
|
|
323
|
+
|
|
324
|
+
<code-group>
|
|
325
|
+
|
|
326
|
+
```ini [wrangler.toml]
|
|
327
|
+
[vars]
|
|
328
|
+
MY_VARIABLE="my-value"
|
|
329
|
+
|
|
330
|
+
[[kv_namespaces]]
|
|
331
|
+
binding = "MY_KV"
|
|
332
|
+
id = "xxx"
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
```json [wrangler.json]
|
|
336
|
+
{
|
|
337
|
+
"vars": {
|
|
338
|
+
"MY_VARIABLE": "my-value",
|
|
339
|
+
},
|
|
340
|
+
"kv_namespaces": [
|
|
341
|
+
{
|
|
342
|
+
"binding": "MY_KV",
|
|
343
|
+
"id": "xxx"
|
|
344
|
+
}
|
|
345
|
+
]
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
</code-group>
|
|
349
|
+
|
|
350
|
+
Next we install the required `wrangler` package (if not already installed):
|
|
351
|
+
|
|
352
|
+
<pm-install></pm-install>
|
|
353
|
+
|
|
354
|
+
From this moment, when running
|
|
355
|
+
|
|
356
|
+
<pm-run></pm-run>
|
|
357
|
+
|
|
358
|
+
you will be able to access the `MY_VARIABLE` and `MY_KV` from the request event just as illustrated above.
|
|
359
|
+
|
|
360
|
+
#### Wrangler environments
|
|
361
|
+
|
|
362
|
+
If you have multiple Wrangler environments, you can specify which Wrangler environment to use during Cloudflare dev emulation:
|
|
363
|
+
|
|
364
|
+
```ts [nitro.config.ts]
|
|
365
|
+
import { defineNitroConfig } from "nitro/config";
|
|
366
|
+
|
|
367
|
+
export default defineNitroConfig({
|
|
368
|
+
preset: 'cloudflare_module',
|
|
369
|
+
cloudflare: {
|
|
370
|
+
dev: {
|
|
371
|
+
environment: 'preview'
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
})
|
|
375
|
+
```
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Deno Deploy
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to [Deno Deploy](https://deno.com/deploy).
|
|
4
|
+
|
|
5
|
+
**Preset:** `deno_deploy`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
## Deploy with the CLI
|
|
10
|
+
|
|
11
|
+
You can use [deployctl](https://deno.com/deploy/docs/deployctl) to deploy your app.
|
|
12
|
+
|
|
13
|
+
Login to [Deno Deploy](https://dash.deno.com/account#access-tokens) to obtain a `DENO_DEPLOY_TOKEN` access token, and set it as an environment variable.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Build with the deno_deploy NITRO preset
|
|
17
|
+
NITRO_PRESET=deno_deploy npm run build
|
|
18
|
+
|
|
19
|
+
# Make sure to run the deployctl command from the output directory
|
|
20
|
+
cd .output
|
|
21
|
+
deployctl deploy --project=my-project server/index.ts
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Deploy within CI/CD using GitHub actions
|
|
25
|
+
|
|
26
|
+
You just need to include the deployctl GitHub Action as a step in your workflow.
|
|
27
|
+
|
|
28
|
+
You do not need to set up any secrets for this to work. You do need to link your GitHub repository to your Deno Deploy project and choose the "GitHub Actions" deployment mode. You can do this in your project settings on [Deno Deploy](https://dash.deno.com).
|
|
29
|
+
|
|
30
|
+
Create the following workflow file in your `.github/workflows` directory:
|
|
31
|
+
|
|
32
|
+
```yaml [.github/workflows/deno_deploy.yml]
|
|
33
|
+
name: deno-deploy
|
|
34
|
+
|
|
35
|
+
on:
|
|
36
|
+
push:
|
|
37
|
+
branches:
|
|
38
|
+
- main
|
|
39
|
+
pull_request:
|
|
40
|
+
branches:
|
|
41
|
+
- main
|
|
42
|
+
|
|
43
|
+
jobs:
|
|
44
|
+
deploy:
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v5
|
|
47
|
+
- run: corepack enable
|
|
48
|
+
- uses: actions/setup-node@v6
|
|
49
|
+
with:
|
|
50
|
+
node-version: 18
|
|
51
|
+
cache: pnpm
|
|
52
|
+
- run: pnpm install
|
|
53
|
+
- run: pnpm build
|
|
54
|
+
env:
|
|
55
|
+
NITRO_PRESET: deno_deploy
|
|
56
|
+
- name: Deploy to Deno Deploy
|
|
57
|
+
uses: denoland/deployctl@v1
|
|
58
|
+
with:
|
|
59
|
+
project: my-project
|
|
60
|
+
entrypoint: server/index.ts
|
|
61
|
+
root: .output
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Deno runtime
|
|
65
|
+
|
|
66
|
+
<read-more></read-more>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# DigitalOcean
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to DigitalOcean.
|
|
4
|
+
|
|
5
|
+
**Preset:** `digital_ocean`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
## Set up application
|
|
10
|
+
|
|
11
|
+
1. Create a new Digital Ocean app following the [guide](https://docs.digitalocean.com/products/app-platform/how-to/create-apps/).
|
|
12
|
+
|
|
13
|
+
2. Next, you'll need to configure environment variables. In your app settings, ensure the following app-level environment variables are set:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
NITRO_PRESET=digital_ocean
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
[More information](https://docs.digitalocean.com/products/app-platform/how-to/use-environment-variables/).
|
|
20
|
+
|
|
21
|
+
3. You will need to ensure you set an `engines.node` field in your app's `package.json` to ensure Digital Ocean uses a supported version of Node.js:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": "20.x"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
[See more information](https://docs.digitalocean.com/products/app-platform/languages-frameworks/nodejs/#node-version).
|
|
32
|
+
|
|
33
|
+
4. You'll also need to add a run command so Digital Ocean knows what command to run after a build. You can do so by adding a start script to your `package.json`:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"scripts": {
|
|
38
|
+
"start": "node .output/server/index.mjs"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
5. Finally, you'll need to add this start script to your Digital Ocean app's run command. Go to `Components > Settings > Commands`, click "Edit", then add `npm run start`
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
Your app should be live at a Digital Ocean generated URL and you can now follow [the rest of the Digital Ocean deployment guide](https://docs.digitalocean.com/products/app-platform/how-to/manage-deployments/).
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Firebase
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to Firebase.
|
|
4
|
+
|
|
5
|
+
<note>
|
|
6
|
+
|
|
7
|
+
You will need to be on the [**Blaze plan**](https://firebase.google.com/pricing) (Pay as you go) to get started.
|
|
8
|
+
</note>
|
|
9
|
+
|
|
10
|
+
## Firebase app hosting
|
|
11
|
+
|
|
12
|
+
Preset: `firebase_app_hosting`
|
|
13
|
+
|
|
14
|
+
<read-more></read-more>
|
|
15
|
+
|
|
16
|
+
<tip>
|
|
17
|
+
|
|
18
|
+
You can integrate with this provider using [zero configuration](/deploy/#zero-config-providers).
|
|
19
|
+
</tip>
|
|
20
|
+
|
|
21
|
+
### Project setup
|
|
22
|
+
|
|
23
|
+
1. Go to the Firebase [console](https://console.firebase.google.com/) and set up a new project.
|
|
24
|
+
2. Select **Build > App Hosting** from the sidebar. - You may need to upgrade your billing plan at this step.
|
|
25
|
+
|
|
26
|
+
- Click **Get Started**. - Choose a region.
|
|
27
|
+
- Import a GitHub repository (you’ll need to link your GitHub account).
|
|
28
|
+
- Configure deployment settings (project root directory and branch), and enable automatic rollouts.
|
|
29
|
+
- Choose a unique ID for your backend.
|
|
30
|
+
|
|
31
|
+
- Click Finish & Deploy to create your first rollout.
|
|
32
|
+
When you deploy with Firebase App Hosting, the App Hosting preset will be run automatically at build time.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Flightcontrol
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to AWS via Flightcontrol.
|
|
4
|
+
|
|
5
|
+
**Preset:** `flightcontrol`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
## Set Up your flightcontrol account
|
|
10
|
+
|
|
11
|
+
On a high level, the steps you will need to follow to deploy a project for the first time are:
|
|
12
|
+
|
|
13
|
+
1. Create an account at [Flightcontrol](https://app.flightcontrol.dev/signup?ref=nitro)
|
|
14
|
+
2. Create an account at [AWS](https://portal.aws.amazon.com/billing/signup) (if you don't already have one)
|
|
15
|
+
3. Link your AWS account to the Flightcontrol
|
|
16
|
+
4. Authorize the Flightcontrol GitHub App to access your chosen repositories, public or private.
|
|
17
|
+
5. Create a Flightcontrol project with configuration via the Dashboard or with configuration via `flightcontrol.json`.
|
|
18
|
+
|
|
19
|
+
### Create a project with configuration via the dashboard
|
|
20
|
+
|
|
21
|
+
1. Create a Flightcontrol project from the Dashboard. Select a repository for the source.
|
|
22
|
+
2. Select the `GUI` config type.
|
|
23
|
+
3. Select the Nuxt preset. This preset will also work for any Nitro-based applications.
|
|
24
|
+
4. Select your preferred AWS server size.
|
|
25
|
+
5. Submit the new project form.
|
|
26
|
+
|
|
27
|
+
### Create a project with configuration via `flightcontrol.json`
|
|
28
|
+
|
|
29
|
+
1. Create a Flightcontrol project from your dashboard. Select a repository for the source.
|
|
30
|
+
2. Select the `flightcontrol.json` config type.
|
|
31
|
+
3. Add a new file at the root of your repository called `flightcontrol.json`. Here is an example configuration that creates an AWS fargate service for your app:
|
|
32
|
+
|
|
33
|
+
```json [flightcontrol.json]
|
|
34
|
+
{
|
|
35
|
+
"$schema": "https://app.flightcontrol.dev/schema.json",
|
|
36
|
+
"environments": [
|
|
37
|
+
{
|
|
38
|
+
"id": "production",
|
|
39
|
+
"name": "Production",
|
|
40
|
+
"region": "us-west-2",
|
|
41
|
+
"source": {
|
|
42
|
+
"branch": "main"
|
|
43
|
+
},
|
|
44
|
+
"services": [
|
|
45
|
+
{
|
|
46
|
+
"id": "nitro",
|
|
47
|
+
"buildType": "nixpacks",
|
|
48
|
+
"name": "My Nitro site",
|
|
49
|
+
"type": "fargate",
|
|
50
|
+
"domain": "www.yourdomain.com",
|
|
51
|
+
"outputDirectory": ".output",
|
|
52
|
+
"startCommand": "node .output/server/index.mjs",
|
|
53
|
+
"cpu": 0.25,
|
|
54
|
+
"memory": 0.5
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
4. Submit the new project form.
|
|
63
|
+
|
|
64
|
+
<read-more>
|
|
65
|
+
|
|
66
|
+
Learn more about Flightcontrol's [configuration](https://www.flightcontrol.dev/docs?ref=nitro).
|
|
67
|
+
</read-more>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Genezio
|
|
2
|
+
|
|
3
|
+
> Deploy Nitro apps to Genezio.
|
|
4
|
+
|
|
5
|
+
**Preset:** `genezio`
|
|
6
|
+
|
|
7
|
+
<read-more></read-more>
|
|
8
|
+
|
|
9
|
+
> [!IMPORTANT]
|
|
10
|
+
> 🚧 This preset is currently experimental.
|
|
11
|
+
|
|
12
|
+
## 1. Project Setup
|
|
13
|
+
|
|
14
|
+
Create `genezio.yaml` file:
|
|
15
|
+
|
|
16
|
+
```yaml
|
|
17
|
+
# The name of the project.
|
|
18
|
+
name: nitro-app
|
|
19
|
+
# The version of the Genezio YAML configuration to parse.
|
|
20
|
+
yamlVersion: 2
|
|
21
|
+
backend:
|
|
22
|
+
# The root directory of the backend.
|
|
23
|
+
path: .output/
|
|
24
|
+
# Information about the backend's programming language.
|
|
25
|
+
language:
|
|
26
|
+
# The name of the programming language.
|
|
27
|
+
name: js
|
|
28
|
+
# The package manager used by the backend.
|
|
29
|
+
packageManager: npm
|
|
30
|
+
# Information about the backend's functions.
|
|
31
|
+
functions:
|
|
32
|
+
# The name (label) of the function.
|
|
33
|
+
- name: nitroServer
|
|
34
|
+
# The path to the function's code.
|
|
35
|
+
path: server/
|
|
36
|
+
# The name of the function handler
|
|
37
|
+
handler: handler
|
|
38
|
+
# The entry point for the function.
|
|
39
|
+
entry: index.mjs
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
<read-more>
|
|
43
|
+
|
|
44
|
+
To further customize the file to your needs, you can consult the
|
|
45
|
+
[official documentation](https://genezio.com/docs/project-structure/genezio-configuration-file/).
|
|
46
|
+
</read-more>
|
|
47
|
+
|
|
48
|
+
## 2. Deploy your project
|
|
49
|
+
|
|
50
|
+
Build with the genezio nitro preset:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
NITRO_PRESET=genezio npm run build
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Deploy with [`genezio`](https://npmjs.com/package/genezio) cli:
|
|
57
|
+
|
|
58
|
+
<pm-x></pm-x>
|
|
59
|
+
|
|
60
|
+
<read-more>
|
|
61
|
+
|
|
62
|
+
To set environment viarables, please check out [Genezio - Environment Variables](https://genezio.com/docs/project-structure/backend-environment-variables).
|
|
63
|
+
</read-more>
|
|
64
|
+
|
|
65
|
+
## 3. Monitor your project
|
|
66
|
+
|
|
67
|
+
You can monitor and manage your application through the [Genezio App Dashboard](https://app.genez.io/dashboard). The dashboard URL, also provided after deployment, allows you to access comprehensive views of your project's status and logs.
|