nitro 3.0.1-alpha.2 → 3.0.260415-beta

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.
Files changed (297) hide show
  1. package/LICENSE +6 -0
  2. package/README.md +2 -2
  3. package/dist/THIRD-PARTY-LICENSES.md +1646 -0
  4. package/dist/_build/common.mjs +7261 -3812
  5. package/dist/_build/rolldown.mjs +32 -42
  6. package/dist/_build/rollup.mjs +28 -48
  7. package/dist/_build/vite.build.mjs +10 -10
  8. package/dist/_chunks/nitro.mjs +102 -327
  9. package/dist/_chunks/nitro2.mjs +8 -9
  10. package/dist/_chunks/nitro3.mjs +136 -0
  11. package/dist/_chunks/nitro4.mjs +127 -0
  12. package/dist/_chunks/utils.mjs +40 -29
  13. package/dist/_common.mjs +13 -25
  14. package/dist/_dev.d.mts +0 -3
  15. package/dist/{_chunks/dev.mjs → _dev.mjs} +132 -330
  16. package/dist/_libs/_.mjs +2 -0
  17. package/dist/_libs/_2.mjs +2 -0
  18. package/dist/_libs/_3.mjs +2 -0
  19. package/dist/_libs/_4.mjs +2 -0
  20. package/dist/_libs/_5.mjs +2 -0
  21. package/dist/_libs/_6.mjs +2 -0
  22. package/dist/_libs/_7.mjs +2 -0
  23. package/dist/_libs/c12+rc9.mjs +814 -0
  24. package/dist/_libs/{c12+giget+readdirp+chokidar.d.mts → c12+readdirp+chokidar.d.mts} +49 -40
  25. package/dist/_libs/citty.mjs +142 -41
  26. package/dist/_libs/commondir+is-reference.mjs +60 -56
  27. package/dist/_libs/compatx.d.mts +0 -2
  28. package/dist/_libs/compatx.mjs +1 -4
  29. package/dist/_libs/esbuild.d.mts +0 -1
  30. package/dist/_libs/escape-string-regexp.mjs +1 -4
  31. package/dist/_libs/{pluginutils+plugin-commonjs.d.mts → estree+pluginutils.d.mts} +0 -5
  32. package/dist/_libs/estree-walker.mjs +4 -92
  33. package/dist/_libs/exsolve.d.mts +1 -0
  34. package/dist/_libs/hasown+resolve+deepmerge.mjs +160 -246
  35. package/dist/_libs/httpxy.d.mts +20 -13
  36. package/dist/_libs/httpxy.mjs +519 -95
  37. package/dist/_libs/js-tokens.d.mts +1 -0
  38. package/dist/_libs/klona.mjs +1 -4
  39. package/dist/_libs/magic-string.d.mts +0 -2
  40. package/dist/_libs/mlly.d.mts +0 -2
  41. package/dist/_libs/nypm+tinyexec.mjs +822 -0
  42. package/dist/_libs/perfect-debounce.mjs +68 -0
  43. package/dist/_libs/pkg-types.d.mts +0 -3
  44. package/dist/_libs/plugin-alias.mjs +1 -5
  45. package/dist/_libs/plugin-inject.mjs +1 -7
  46. package/dist/_libs/plugin-json.mjs +1 -5
  47. package/dist/_libs/pluginutils.mjs +3 -35
  48. package/dist/_libs/readdirp+chokidar.mjs +187 -365
  49. package/dist/_libs/remapping.mjs +1 -5
  50. package/dist/_libs/resolve-uri+gen-mapping.mjs +15 -53
  51. package/dist/_libs/rou3.d.mts +1 -4
  52. package/dist/_libs/rou3.mjs +223 -78
  53. package/dist/_libs/std-env.d.mts +8 -2
  54. package/dist/_libs/strip-literal.d.mts +1 -0
  55. package/dist/_libs/tsconfck.mjs +21 -334
  56. package/dist/_libs/ultrahtml.mjs +3 -16
  57. package/dist/_libs/unimport+unplugin.mjs +244 -388
  58. package/dist/_libs/unplugin+unimport.d.mts +5 -15
  59. package/dist/_libs/unwasm.d.mts +0 -3
  60. package/dist/_presets.mjs +576 -488
  61. package/dist/builder.d.mts +5 -25
  62. package/dist/builder.mjs +3 -8
  63. package/dist/cli/_chunks/build.mjs +22 -25
  64. package/dist/cli/_chunks/common.mjs +1 -4
  65. package/dist/cli/_chunks/deploy.mjs +37 -0
  66. package/dist/cli/_chunks/dev.mjs +6 -11
  67. package/dist/cli/_chunks/docs.mjs +28 -0
  68. package/dist/cli/_chunks/list.mjs +4 -8
  69. package/dist/cli/_chunks/prepare.mjs +2 -6
  70. package/dist/cli/_chunks/preview.mjs +48 -0
  71. package/dist/cli/_chunks/run.mjs +7 -11
  72. package/dist/cli/_chunks/task.mjs +1 -5
  73. package/dist/cli/index.mjs +5 -6
  74. package/dist/docs/0.docs/0.index/index.md +56 -0
  75. package/dist/docs/0.docs/1.quick-start.md +110 -0
  76. package/dist/docs/0.docs/10.lifecycle.md +204 -0
  77. package/dist/docs/0.docs/11.openapi.md +291 -0
  78. package/dist/docs/0.docs/12.plugins.md +164 -0
  79. package/dist/docs/0.docs/13.tasks.md +277 -0
  80. package/dist/docs/0.docs/14.websocket.md +386 -0
  81. package/dist/docs/0.docs/15.migration.md +213 -0
  82. package/dist/docs/0.docs/16.nightly.md +31 -0
  83. package/dist/docs/0.docs/2.renderer.md +322 -0
  84. package/dist/docs/0.docs/3.routing.md +711 -0
  85. package/dist/docs/0.docs/4.server-entry.md +239 -0
  86. package/dist/docs/0.docs/5.cache.md +408 -0
  87. package/dist/docs/0.docs/6.storage.md +261 -0
  88. package/dist/docs/0.docs/7.assets.md +166 -0
  89. package/dist/docs/0.docs/8.configuration.md +256 -0
  90. package/dist/docs/0.docs/9.database.md +185 -0
  91. package/dist/docs/1.deploy/0.index/index.md +64 -0
  92. package/dist/docs/1.deploy/1.runtimes/0.node.md +63 -0
  93. package/dist/docs/1.deploy/1.runtimes/1.bun.md +15 -0
  94. package/dist/docs/1.deploy/1.runtimes/2.deno.md +19 -0
  95. package/dist/docs/1.deploy/2.providers/0.alwaysdata.md +50 -0
  96. package/dist/docs/1.deploy/2.providers/1.aws.md +47 -0
  97. package/dist/docs/1.deploy/2.providers/10.flightcontrol.md +67 -0
  98. package/dist/docs/1.deploy/2.providers/11.genezio.md +67 -0
  99. package/dist/docs/1.deploy/2.providers/12.github-pages.md +68 -0
  100. package/dist/docs/1.deploy/2.providers/13.gitlab-pages.md +37 -0
  101. package/dist/docs/1.deploy/2.providers/14.heroku.md +84 -0
  102. package/dist/docs/1.deploy/2.providers/15.iis.md +38 -0
  103. package/dist/docs/1.deploy/2.providers/16.koyeb.md +109 -0
  104. package/dist/docs/1.deploy/2.providers/17.netlify.md +47 -0
  105. package/dist/docs/1.deploy/2.providers/18.platform-sh.md +37 -0
  106. package/dist/docs/1.deploy/2.providers/19.render.md +37 -0
  107. package/dist/docs/1.deploy/2.providers/2.aws-amplify.md +81 -0
  108. package/dist/docs/1.deploy/2.providers/20.stormkit.md +24 -0
  109. package/dist/docs/1.deploy/2.providers/21.vercel.md +270 -0
  110. package/dist/docs/1.deploy/2.providers/22.zeabur.md +19 -0
  111. package/dist/docs/1.deploy/2.providers/23.zephyr.md +99 -0
  112. package/dist/docs/1.deploy/2.providers/24.zerops.md +102 -0
  113. package/dist/docs/1.deploy/2.providers/3.azure.md +72 -0
  114. package/dist/docs/1.deploy/2.providers/4.cleavr.md +33 -0
  115. package/dist/docs/1.deploy/2.providers/5.cloudflare.md +369 -0
  116. package/dist/docs/1.deploy/2.providers/6.deno-deploy.md +66 -0
  117. package/dist/docs/1.deploy/2.providers/7.digitalocean.md +46 -0
  118. package/dist/docs/1.deploy/2.providers/8.edgeone.md +20 -0
  119. package/dist/docs/1.deploy/2.providers/9.firebase.md +32 -0
  120. package/dist/docs/2.config/0.index/index.md +1221 -0
  121. package/dist/docs/3.examples/0.index/index.md +3 -0
  122. package/dist/docs/3.examples/1.api-routes.md +145 -0
  123. package/dist/docs/3.examples/10.hono.md +74 -0
  124. package/dist/docs/3.examples/11.import-alias.md +97 -0
  125. package/dist/docs/3.examples/12.middleware.md +91 -0
  126. package/dist/docs/3.examples/13.mono-jsx.md +68 -0
  127. package/dist/docs/3.examples/14.nano-jsx.md +70 -0
  128. package/dist/docs/3.examples/15.plugins.md +91 -0
  129. package/dist/docs/3.examples/16.renderer.md +113 -0
  130. package/dist/docs/3.examples/17.runtime-config.md +97 -0
  131. package/dist/docs/3.examples/18.server-fetch.md +87 -0
  132. package/dist/docs/3.examples/19.shiki.md +198 -0
  133. package/dist/docs/3.examples/2.auto-imports.md +92 -0
  134. package/dist/docs/3.examples/20.virtual-routes.md +74 -0
  135. package/dist/docs/3.examples/21.vite-nitro-plugin.md +79 -0
  136. package/dist/docs/3.examples/22.vite-rsc.md +1041 -0
  137. package/dist/docs/3.examples/23.vite-ssr-html.md +217 -0
  138. package/dist/docs/3.examples/24.vite-ssr-preact.md +247 -0
  139. package/dist/docs/3.examples/25.vite-ssr-react.md +226 -0
  140. package/dist/docs/3.examples/26.vite-ssr-solid.md +256 -0
  141. package/dist/docs/3.examples/27.vite-ssr-tsr-react.md +442 -0
  142. package/dist/docs/3.examples/28.vite-ssr-tss-react.md +444 -0
  143. package/dist/docs/3.examples/29.vite-ssr-vue-router.md +617 -0
  144. package/dist/docs/3.examples/3.cached-handler.md +81 -0
  145. package/dist/docs/3.examples/30.vite-trpc.md +335 -0
  146. package/dist/docs/3.examples/31.websocket.md +282 -0
  147. package/dist/docs/3.examples/4.custom-error-handler.md +98 -0
  148. package/dist/docs/3.examples/5.database.md +157 -0
  149. package/dist/docs/3.examples/6.elysia.md +70 -0
  150. package/dist/docs/3.examples/7.express.md +78 -0
  151. package/dist/docs/3.examples/8.fastify.md +79 -0
  152. package/dist/docs/3.examples/9.hello-world.md +68 -0
  153. package/dist/docs/README.md +86 -0
  154. package/dist/docs/index.md +121 -0
  155. package/dist/node_modules/@poppinss/dumper/build/formatters/html/main.js +8 -0
  156. package/dist/node_modules/@poppinss/dumper/package.json +1 -1
  157. package/dist/node_modules/@speed-highlight/core/dist/index.js +4 -4
  158. package/dist/node_modules/@speed-highlight/core/dist/terminal.js +2 -2
  159. package/dist/node_modules/@speed-highlight/core/package.json +1 -1
  160. package/dist/node_modules/cookie-es/dist/index.mjs +299 -250
  161. package/dist/node_modules/cookie-es/package.json +26 -23
  162. package/dist/node_modules/croner/dist/croner.js +1 -1
  163. package/dist/node_modules/croner/package.json +11 -1
  164. package/dist/node_modules/defu/dist/defu.mjs +2 -2
  165. package/dist/node_modules/defu/package.json +33 -28
  166. package/dist/node_modules/rendu/dist/_chunks/libs/cookie-es.mjs +151 -0
  167. package/dist/node_modules/rendu/dist/index.mjs +5 -112
  168. package/dist/node_modules/rendu/package.json +25 -24
  169. package/dist/node_modules/youch/build/helpers-B9BQYaS6.js +23 -0
  170. package/dist/node_modules/youch/build/index.js +204 -351
  171. package/dist/node_modules/youch/build/public/error_info/script.js +1 -1
  172. package/dist/node_modules/youch/build/public_dir-C5bujZKB.js +25 -0
  173. package/dist/node_modules/youch/build/src/templates/error_cause/main.js +44 -0
  174. package/dist/node_modules/youch/build/src/templates/error_info/main.js +72 -0
  175. package/dist/node_modules/youch/build/src/templates/error_metadata/main.js +65 -0
  176. package/dist/node_modules/youch/build/src/templates/error_stack/main.js +152 -0
  177. package/dist/node_modules/youch/build/src/templates/error_stack_source/main.js +46 -0
  178. package/dist/node_modules/youch/build/src/templates/header/main.js +24 -0
  179. package/dist/node_modules/youch/build/src/templates/layout/main.js +27 -0
  180. package/dist/node_modules/youch/package.json +35 -32
  181. package/dist/presets/_nitro/runtime/nitro-dev.mjs +12 -57
  182. package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +1 -0
  183. package/dist/presets/_nitro/runtime/service-worker.mjs +1 -2
  184. package/dist/presets/aws-lambda/runtime/_utils.mjs +6 -6
  185. package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.mjs +3 -1
  186. package/dist/presets/azure/runtime/_utils.mjs +5 -5
  187. package/dist/presets/azure/runtime/azure-swa.mjs +5 -5
  188. package/dist/presets/bun/runtime/bun.mjs +9 -6
  189. package/dist/presets/cloudflare/runtime/_module-handler.mjs +1 -1
  190. package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +4 -4
  191. package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +3 -3
  192. package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +2 -2
  193. package/dist/presets/cloudflare/runtime/plugin.dev.mjs +10 -21
  194. package/dist/presets/deno/runtime/deno-deploy.mjs +4 -4
  195. package/dist/presets/deno/runtime/deno-server.mjs +9 -6
  196. package/dist/presets/edgeone/runtime/edgeone.mjs +10 -0
  197. package/dist/presets/netlify/runtime/netlify-edge.mjs +2 -3
  198. package/dist/presets/netlify/runtime/netlify.mjs +1 -1
  199. package/dist/presets/node/runtime/node-cluster.mjs +5 -4
  200. package/dist/presets/node/runtime/node-middleware.mjs +1 -1
  201. package/dist/presets/node/runtime/node-server.mjs +8 -5
  202. package/dist/presets/stormkit/runtime/stormkit.mjs +1 -2
  203. package/dist/presets/vercel/runtime/cron-handler.mjs +25 -0
  204. package/dist/presets/vercel/runtime/queue-handler.mjs +21 -0
  205. package/dist/presets/vercel/runtime/vercel.node.mjs +3 -3
  206. package/dist/presets/vercel/runtime/vercel.web.mjs +3 -5
  207. package/dist/presets/winterjs/runtime/winterjs.mjs +10 -10
  208. package/dist/presets/zephyr/runtime/server.mjs +3 -0
  209. package/dist/runtime/internal/app.mjs +12 -11
  210. package/dist/runtime/internal/cache.d.mts +0 -4
  211. package/dist/runtime/internal/cache.mjs +32 -256
  212. package/dist/runtime/internal/context.d.mts +3 -1
  213. package/dist/runtime/internal/context.mjs +1 -9
  214. package/dist/runtime/internal/error/dev.d.mts +5 -4
  215. package/dist/runtime/internal/error/dev.mjs +47 -49
  216. package/dist/runtime/internal/error/hooks.d.mts +1 -1
  217. package/dist/runtime/internal/error/prod.d.mts +2 -5
  218. package/dist/runtime/internal/error/prod.mjs +19 -33
  219. package/dist/runtime/internal/error/utils.d.mts +4 -4
  220. package/dist/runtime/internal/meta.d.mts +1 -1
  221. package/dist/runtime/internal/plugin.d.mts +2 -2
  222. package/dist/runtime/internal/route-rules.d.mts +11 -4
  223. package/dist/runtime/internal/route-rules.mjs +15 -5
  224. package/dist/runtime/internal/routes/dev-tasks.d.mts +3 -2
  225. package/dist/runtime/internal/routes/dev-tasks.mjs +15 -10
  226. package/dist/runtime/internal/routes/openapi.mjs +2 -2
  227. package/dist/runtime/internal/routes/renderer-template.d.mts +1 -1
  228. package/dist/runtime/internal/routes/renderer-template.dev.d.mts +2 -1
  229. package/dist/runtime/internal/routes/scalar.mjs +3 -3
  230. package/dist/runtime/internal/routes/swagger.mjs +7 -4
  231. package/dist/runtime/internal/runtime-config.d.mts +1 -1
  232. package/dist/runtime/internal/runtime-config.mjs +2 -2
  233. package/dist/runtime/internal/static.mjs +5 -4
  234. package/dist/runtime/internal/task.d.mts +3 -1
  235. package/dist/runtime/internal/task.mjs +7 -7
  236. package/dist/runtime/internal/vite/dev-entry.mjs +6 -3
  237. package/dist/runtime/internal/vite/dev-worker.mjs +264 -0
  238. package/dist/runtime/meta.d.mts +1 -0
  239. package/dist/runtime/meta.mjs +2 -0
  240. package/dist/runtime/nitro.d.mts +2 -0
  241. package/dist/runtime/nitro.mjs +4 -2
  242. package/dist/runtime/virtual/error-handler.mjs +1 -1
  243. package/dist/runtime/virtual/renderer-template.mjs +1 -1
  244. package/dist/runtime/virtual/server-assets.d.mts +2 -1
  245. package/dist/runtime/virtual/tracing.d.mts +5 -0
  246. package/dist/runtime/virtual/tracing.mjs +1 -0
  247. package/dist/runtime/vite.d.mts +1 -1
  248. package/dist/types/index.d.mts +215 -195
  249. package/dist/types/index.mjs +1 -11
  250. package/dist/vite.d.mts +3 -8
  251. package/dist/vite.mjs +285 -253
  252. package/lib/tsconfig.json +3 -5
  253. package/package.json +97 -80
  254. package/dist/_libs/confbox.mjs +0 -2509
  255. package/dist/_libs/nypm+giget+tinyexec.mjs +0 -3603
  256. package/dist/_libs/rc9+c12+dotenv.mjs +0 -972
  257. package/dist/node_modules/hookable/dist/index.mjs +0 -266
  258. package/dist/node_modules/hookable/package.json +0 -52
  259. package/dist/node_modules/youch/build/chunk-4L7RY2JA.js +0 -42
  260. package/dist/node_modules/youch/build/chunk-7QV3D5YX.js +0 -83
  261. package/dist/node_modules/youch/build/chunk-AUGPHE32.js +0 -39
  262. package/dist/node_modules/youch/build/chunk-CM7DWJNZ.js +0 -44
  263. package/dist/node_modules/youch/build/chunk-EJH674NB.js +0 -223
  264. package/dist/node_modules/youch/build/chunk-OIJ3WD7L.js +0 -81
  265. package/dist/node_modules/youch/build/chunk-P36L72PL.js +0 -87
  266. package/dist/node_modules/youch/build/chunk-PE3GG3TN.js +0 -65
  267. package/dist/node_modules/youch/build/chunk-X53OIOJH.js +0 -70
  268. package/dist/presets/_nitro/runtime/nitro-dev.d.mts +0 -2
  269. package/dist/presets/_nitro/runtime/nitro-prerenderer.d.mts +0 -3
  270. package/dist/presets/_nitro/runtime/service-worker.d.mts +0 -2
  271. package/dist/presets/aws-amplify/runtime/aws-amplify.d.mts +0 -2
  272. package/dist/presets/aws-lambda/runtime/_utils.d.mts +0 -8
  273. package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.d.mts +0 -2
  274. package/dist/presets/aws-lambda/runtime/aws-lambda.d.mts +0 -3
  275. package/dist/presets/azure/runtime/_utils.d.mts +0 -2
  276. package/dist/presets/azure/runtime/azure-swa.d.mts +0 -5
  277. package/dist/presets/bun/runtime/bun.d.mts +0 -3
  278. package/dist/presets/cloudflare/runtime/_module-handler.d.mts +0 -16
  279. package/dist/presets/cloudflare/runtime/cloudflare-durable.d.mts +0 -11
  280. package/dist/presets/cloudflare/runtime/cloudflare-module.d.mts +0 -3
  281. package/dist/presets/cloudflare/runtime/cloudflare-pages.d.mts +0 -20
  282. package/dist/presets/cloudflare/runtime/plugin.dev.d.mts +0 -3
  283. package/dist/presets/deno/runtime/deno-deploy.d.mts +0 -5
  284. package/dist/presets/deno/runtime/deno-server.d.mts +0 -3
  285. package/dist/presets/netlify/runtime/netlify-edge.d.mts +0 -3
  286. package/dist/presets/netlify/runtime/netlify.d.mts +0 -4
  287. package/dist/presets/node/runtime/node-cluster.d.mts +0 -3
  288. package/dist/presets/node/runtime/node-middleware.d.mts +0 -3
  289. package/dist/presets/node/runtime/node-server.d.mts +0 -3
  290. package/dist/presets/standard/runtime/server.d.mts +0 -3
  291. package/dist/presets/stormkit/runtime/stormkit.d.mts +0 -21
  292. package/dist/presets/vercel/runtime/isr.d.mts +0 -2
  293. package/dist/presets/vercel/runtime/vercel.node.d.mts +0 -3
  294. package/dist/presets/vercel/runtime/vercel.web.d.mts +0 -8
  295. package/dist/presets/winterjs/runtime/winterjs.d.mts +0 -2
  296. package/dist/presets/zeabur/runtime/zeabur.d.mts +0 -3
  297. package/dist/runtime/internal/vite/node-runner.mjs +0 -359
@@ -1,13 +1,13 @@
1
- import { proxyRequest, redirect as sendRedirect } from "h3";
1
+ import { proxyRequest, redirect as sendRedirect, requireBasicAuth } from "h3";
2
2
  import { joinURL, withQuery, withoutBase } from "ufo";
3
3
  import { defineCachedHandler } from "./cache.mjs";
4
- // Headers route rule
4
+
5
5
  export const headers = ((m) => function headersRouteRule(event) {
6
6
  for (const [key, value] of Object.entries(m.options || {})) {
7
7
  event.res.headers.set(key, value);
8
8
  }
9
9
  });
10
- // Redirect route rule
10
+
11
11
  export const redirect = ((m) => function redirectRouteRule(event) {
12
12
  let target = m.options?.to;
13
13
  if (!target) {
@@ -25,7 +25,7 @@ export const redirect = ((m) => function redirectRouteRule(event) {
25
25
  }
26
26
  return sendRedirect(target, m.options?.status);
27
27
  });
28
- // Proxy route rule
28
+
29
29
  export const proxy = ((m) => function proxyRouteRule(event) {
30
30
  let target = m.options?.to;
31
31
  if (!target) {
@@ -43,7 +43,7 @@ export const proxy = ((m) => function proxyRouteRule(event) {
43
43
  }
44
44
  return proxyRequest(event, target, { ...m.options });
45
45
  });
46
- // Cache route rule
46
+
47
47
  export const cache = ((m) => function cacheRouteRule(event, next) {
48
48
  if (!event.context.matchedRoute) {
49
49
  return next();
@@ -62,3 +62,13 @@ export const cache = ((m) => function cacheRouteRule(event, next) {
62
62
  }
63
63
  return cachedHandler(event);
64
64
  });
65
+
66
+
67
+
68
+ export const basicAuth = /* @__PURE__ */ Object.assign(((m) => async function authRouteRule(event, next) {
69
+ if (!m.options) {
70
+ return;
71
+ }
72
+ await requireBasicAuth(event, m.options);
73
+ return next();
74
+ }), { order: -1 });
@@ -1,2 +1,3 @@
1
- declare const _default;
2
- export default _default;
1
+ import { H3 } from "h3";
2
+ declare const app: H3;
3
+ export default app;
@@ -1,7 +1,19 @@
1
1
  import { H3 } from "h3";
2
2
  import { runTask } from "../task.mjs";
3
3
  import { scheduledTasks, tasks } from "#nitro/virtual/tasks";
4
- export default new H3().get("/_nitro/tasks", async () => {
4
+ const taskHandler = async (event) => {
5
+ const name = event.context.params?.name;
6
+ const body = await event.req.json().catch(() => ({}));
7
+ const payload = {
8
+ ...Object.fromEntries(event.url.searchParams.entries()),
9
+ ...body.payload ?? body
10
+ };
11
+ return await runTask(name, {
12
+ context: { waitUntil: event.req.waitUntil },
13
+ payload
14
+ });
15
+ };
16
+ const app = new H3().get("/_nitro/tasks", async () => {
5
17
  const _tasks = await Promise.all(Object.entries(tasks).map(async ([name, task]) => {
6
18
  const _task = await task.resolve?.();
7
19
  return [name, { description: _task?.meta?.description }];
@@ -10,12 +22,5 @@ export default new H3().get("/_nitro/tasks", async () => {
10
22
  tasks: Object.fromEntries(_tasks),
11
23
  scheduledTasks
12
24
  };
13
- }).get("/_nitro/tasks/:name", async (event) => {
14
- const name = event.context.params?.name;
15
- const body = await event.req.json().catch(() => ({}));
16
- const payload = {
17
- ...Object.fromEntries(event.url.searchParams.entries()),
18
- ...body
19
- };
20
- return await runTask(name, { payload });
21
- });
25
+ }).get("/_nitro/tasks/:name", taskHandler).post("/_nitro/tasks/:name", taskHandler);
26
+ export default app;
@@ -3,7 +3,7 @@ import { joinURL } from "ufo";
3
3
  import { defu } from "defu";
4
4
  import { handlersMeta } from "#nitro/virtual/routing-meta";
5
5
  import { useRuntimeConfig } from "../runtime-config.mjs";
6
- // Served as /_openapi.json
6
+
7
7
  export default defineHandler((event) => {
8
8
  const runtimeConfig = useRuntimeConfig();
9
9
  const base = runtimeConfig.app?.baseURL;
@@ -46,7 +46,7 @@ function getHandlersMeta() {
46
46
  ...openAPI
47
47
  } };
48
48
  if ($global) {
49
- // TODO: Warn on conflicting global definitions?
49
+
50
50
  globals = defu($global, globals);
51
51
  }
52
52
  if (paths[route] === undefined) {
@@ -1,2 +1,2 @@
1
1
  import type { H3Event } from "h3";
2
- export default function renderIndexHTML(event: H3Event);
2
+ export default function renderIndexHTML(event: H3Event): any;
@@ -1,2 +1,3 @@
1
1
  import type { H3Event } from "h3";
2
- export default function renderIndexHTML(event: H3Event);
2
+ import { HTTPResponse } from "h3";
3
+ export default function renderIndexHTML(event: H3Event): Promise<HTTPResponse | Response>;
@@ -1,12 +1,12 @@
1
1
  import { defineHandler } from "h3";
2
2
  import { useRuntimeConfig } from "../runtime-config.mjs";
3
- // Served as /_scalar
3
+
4
4
  export default defineHandler((event) => {
5
5
  const runtimeConfig = useRuntimeConfig();
6
6
  const title = runtimeConfig.nitro?.openAPI?.meta?.title || "API Reference";
7
7
  const description = runtimeConfig.nitro?.openAPI?.meta?.description || "";
8
8
  const openAPIEndpoint = runtimeConfig.nitro?.openAPI?.route || "./_openapi.json";
9
- // https://github.com/scalar/scalar
9
+
10
10
  const _config = runtimeConfig.nitro?.openAPI?.ui?.scalar;
11
11
  const scalarConfig = {
12
12
  ..._config,
@@ -16,7 +16,7 @@ export default defineHandler((event) => {
16
16
  ..._config?.spec
17
17
  }
18
18
  };
19
- // The default page title
19
+
20
20
  event.res.headers.set("Content-Type", "text/html");
21
21
  return `<!doctype html>
22
22
  <html lang="en">
@@ -1,11 +1,13 @@
1
1
  import { defineHandler } from "h3";
2
2
  import { useRuntimeConfig } from "../runtime-config.mjs";
3
- // https://github.com/swagger-api/swagger-ui
3
+
4
4
  export default defineHandler((event) => {
5
5
  const runtimeConfig = useRuntimeConfig();
6
6
  const title = runtimeConfig.nitro?.openAPI?.meta?.title || "API Reference";
7
7
  const description = runtimeConfig.nitro?.openAPI?.meta?.description || "";
8
8
  const openAPIEndpoint = runtimeConfig.nitro?.openAPI?.route || "./_openapi.json";
9
+ const { route: _route, ...swaggerConfig } = runtimeConfig.nitro?.openAPI?.ui?.swagger || {};
10
+ const safeSwaggerConfig = JSON.stringify(swaggerConfig).replace(/<\//g, "<\\/");
9
11
  const CDN_BASE = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@^5";
10
12
  event.res.headers.set("Content-Type", "text/html");
11
13
  return `<!doctype html>
@@ -27,13 +29,14 @@ export default defineHandler((event) => {
27
29
  <script>
28
30
  window.onload = () => {
29
31
  window.ui = SwaggerUIBundle({
30
- url: ${JSON.stringify(openAPIEndpoint)},
31
- dom_id: "#swagger-ui",
32
32
  presets: [
33
33
  SwaggerUIBundle.presets.apis,
34
34
  SwaggerUIStandalonePreset,
35
35
  ],
36
- layout2: "StandaloneLayout",
36
+ layout: "StandaloneLayout",
37
+ ...${safeSwaggerConfig},
38
+ url: ${JSON.stringify(openAPIEndpoint)},
39
+ dom_id: "#swagger-ui",
37
40
  });
38
41
  };
39
42
  <\/script>
@@ -5,5 +5,5 @@ type EnvOptions = {
5
5
  altPrefix?: string;
6
6
  envExpansion?: boolean;
7
7
  };
8
- export declare function applyEnv(obj: Record<string, any>, opts: EnvOptions, parentKey?: string);
8
+ export declare function applyEnv(obj: Record<string, any>, opts: EnvOptions, parentKey?: string): Record<string, any>;
9
9
  export {};
@@ -17,7 +17,7 @@ export function applyEnv(obj, opts, parentKey = "") {
17
17
  const subKey = parentKey ? `${parentKey}_${key}` : key;
18
18
  const envValue = getEnv(subKey, opts);
19
19
  if (_isObject(obj[key])) {
20
- // Same as before
20
+
21
21
  if (_isObject(envValue)) {
22
22
  obj[key] = {
23
23
  ...obj[key],
@@ -32,7 +32,7 @@ export function applyEnv(obj, opts, parentKey = "") {
32
32
  } else {
33
33
  obj[key] = envValue ?? obj[key];
34
34
  }
35
- // Experimental env expansion
35
+
36
36
  if (opts.envExpansion && typeof obj[key] === "string") {
37
37
  obj[key] = _expandFromEnv(obj[key]);
38
38
  }
@@ -4,7 +4,8 @@ import { getAsset, isPublicAssetURL, readAsset } from "#nitro/virtual/public-ass
4
4
  const METHODS = new Set(["HEAD", "GET"]);
5
5
  const EncodingMap = {
6
6
  gzip: ".gz",
7
- br: ".br"
7
+ br: ".br",
8
+ zstd: ".zst"
8
9
  };
9
10
  export default defineHandler((event) => {
10
11
  if (event.req.method && !METHODS.has(event.req.method)) {
@@ -14,9 +15,6 @@ export default defineHandler((event) => {
14
15
  let asset;
15
16
  const encodingHeader = event.req.headers.get("accept-encoding") || "";
16
17
  const encodings = [...encodingHeader.split(",").map((e) => EncodingMap[e.trim()]).filter(Boolean).sort(), ""];
17
- if (encodings.length > 1) {
18
- event.res.headers.append("Vary", "Accept-Encoding");
19
- }
20
18
  for (const encoding of encodings) {
21
19
  for (const _id of [id + encoding, joinURL(id, "index.html" + encoding)]) {
22
20
  const _asset = getAsset(_id);
@@ -34,6 +32,9 @@ export default defineHandler((event) => {
34
32
  }
35
33
  return;
36
34
  }
35
+ if (encodings.length > 1) {
36
+ event.res.headers.append("Vary", "Accept-Encoding");
37
+ }
37
38
  const ifNotMatch = event.req.headers.get("if-none-match") === asset.etag;
38
39
  if (ifNotMatch) {
39
40
  event.res.status = 304;
@@ -7,7 +7,9 @@ export declare function runTask<RT = unknown>(name: string, { payload, context }
7
7
  context?: TaskContext;
8
8
  }): Promise<TaskResult<RT>>;
9
9
  /** @experimental */
10
- export declare function startScheduleRunner();
10
+ export declare function startScheduleRunner({ waitUntil }?: {
11
+ waitUntil?: ((promise: Promise<unknown>) => void) | undefined;
12
+ }): void;
11
13
  /** @experimental */
12
14
  export declare function getCronTasks(cron: string): string[];
13
15
  /** @experimental */
@@ -1,7 +1,7 @@
1
1
  import { Cron } from "croner";
2
2
  import { HTTPError } from "h3";
3
3
  import { scheduledTasks, tasks } from "#nitro/virtual/tasks";
4
- /** @experimental */
4
+
5
5
  export function defineTask(def) {
6
6
  if (typeof def.run !== "function") {
7
7
  def.run = () => {
@@ -11,7 +11,7 @@ export function defineTask(def) {
11
11
  return def;
12
12
  }
13
13
  const __runningTasks__ = {};
14
- /** @experimental */
14
+
15
15
  export async function runTask(name, { payload = {}, context = {} } = {}) {
16
16
  if (__runningTasks__[name]) {
17
17
  return __runningTasks__[name];
@@ -42,8 +42,8 @@ export async function runTask(name, { payload = {}, context = {} } = {}) {
42
42
  delete __runningTasks__[name];
43
43
  }
44
44
  }
45
- /** @experimental */
46
- export function startScheduleRunner() {
45
+
46
+ export function startScheduleRunner({ waitUntil } = {}) {
47
47
  if (!scheduledTasks || scheduledTasks.length === 0 || process.env.TEST) {
48
48
  return;
49
49
  }
@@ -52,18 +52,18 @@ export function startScheduleRunner() {
52
52
  new Cron(schedule.cron, async () => {
53
53
  await Promise.all(schedule.tasks.map((name) => runTask(name, {
54
54
  payload,
55
- context: {}
55
+ context: { waitUntil }
56
56
  }).catch((error) => {
57
57
  console.error(`Error while running scheduled task "${name}"`, error);
58
58
  })));
59
59
  });
60
60
  }
61
61
  }
62
- /** @experimental */
62
+
63
63
  export function getCronTasks(cron) {
64
64
  return (scheduledTasks || []).find((task) => task.cron === cron)?.tasks || [];
65
65
  }
66
- /** @experimental */
66
+
67
67
  export function runCronTasks(cron, ctx) {
68
68
  return Promise.all(getCronTasks(cron).map((name) => runTask(name, ctx)));
69
69
  }
@@ -3,13 +3,16 @@ import wsAdapter from "crossws/adapters/node";
3
3
 
4
4
  import { useNitroApp } from "nitro/app";
5
5
  import { resolveWebsocketHooks } from "#nitro/runtime/app";
6
+ import { startScheduleRunner } from "#nitro/runtime/task";
6
7
 
7
8
  const nitroApp = useNitroApp();
8
9
 
9
10
  export const fetch = nitroApp.fetch;
10
11
 
11
- const ws = import.meta._websocket
12
- ? wsAdapter({ resolve: resolveWebsocketHooks })
13
- : undefined;
12
+ const ws = import.meta._websocket ? wsAdapter({ resolve: resolveWebsocketHooks }) : undefined;
13
+
14
+ if (import.meta._tasks) {
15
+ startScheduleRunner({});
16
+ }
14
17
 
15
18
  export const handleUpgrade = ws?.handleUpgrade;
@@ -0,0 +1,264 @@
1
+ import { ModuleRunner, ESModulesEvaluator } from "vite/module-runner";
2
+ import { createViteTransport } from "env-runner/vite";
3
+
4
+ // Custom evaluator for workerd where `new AsyncFunction()` is disallowed.
5
+ // Uses the unsafeEvalBinding exposed by the env-runner miniflare wrapper.
6
+ class WorkerdModuleEvaluator {
7
+ startOffset = 0;
8
+
9
+ async runInlinedModule(context, code) {
10
+ const unsafeEval = globalThis.__ENV_RUNNER_UNSAFE_EVAL__;
11
+ const keys = Object.keys(context);
12
+ const fn = unsafeEval.newAsyncFunction('"use strict";' + code, "runInlinedModule", ...keys);
13
+ await fn(...keys.map((k) => context[k]));
14
+ Object.seal(context[Object.keys(context)[0]]);
15
+ }
16
+
17
+ runExternalModule(filepath) {
18
+ return import(filepath);
19
+ }
20
+ }
21
+
22
+ // ----- IPC -----
23
+
24
+ let sendMessage;
25
+ const messageListeners = new Set();
26
+
27
+ // ----- Environment runners -----
28
+
29
+ const envs = (globalThis.__nitro_vite_envs__ ??= {
30
+ nitro: undefined,
31
+ ssr: undefined,
32
+ });
33
+
34
+ class ViteEnvRunner {
35
+ constructor({ name, entry }) {
36
+ this.name = name;
37
+ this.entryPath = entry;
38
+
39
+ this.entry = undefined;
40
+ this.entryError = undefined;
41
+
42
+ // Create Vite Module Runner
43
+ // https://vite.dev/guide/api-environment-runtimes.html#modulerunner
44
+ const onMessage = (listener) => messageListeners.add(listener);
45
+ const transport = createViteTransport((data) => sendMessage?.(data), onMessage, name);
46
+ const evaluator = globalThis.__ENV_RUNNER_UNSAFE_EVAL__
47
+ ? new WorkerdModuleEvaluator()
48
+ : new ESModulesEvaluator();
49
+ const debug =
50
+ typeof process !== "undefined" && process.env?.NITRO_DEBUG ? console.debug : undefined;
51
+ this.runner = new ModuleRunner({ transport }, evaluator, debug);
52
+
53
+ this.reload();
54
+ }
55
+
56
+ async reload() {
57
+ try {
58
+ this.entry = await this.runner.import(this.entryPath);
59
+ this.entryError = undefined;
60
+ } catch (error) {
61
+ console.error(error);
62
+ this.entryError = error;
63
+ }
64
+ }
65
+
66
+ async fetch(req, init) {
67
+ if (this.entryError) {
68
+ return renderError(req, this.entryError);
69
+ }
70
+ for (let i = 0; i < 5 && !(this.entry || this.entryError); i++) {
71
+ await new Promise((r) => setTimeout(r, 100 * Math.pow(2, i)));
72
+ }
73
+ if (this.entryError) {
74
+ return renderError(req, this.entryError);
75
+ }
76
+ if (!this.entry) {
77
+ throw httpError(503, `Vite environment "${this.name}" is unavailable`);
78
+ }
79
+ try {
80
+ const entryFetch = this.entry.fetch || this.entry.default?.fetch;
81
+ if (!entryFetch) {
82
+ throw httpError(500, `No fetch handler exported from ${this.entryPath}`);
83
+ }
84
+ return await entryFetch(req, init);
85
+ } catch (error) {
86
+ return renderError(req, error);
87
+ }
88
+ }
89
+ }
90
+
91
+ // ----- RPC -----
92
+
93
+ const rpcRequests = new Map();
94
+
95
+ function rpc(name, data, timeout = 3000) {
96
+ const id = Math.random().toString(36).slice(2);
97
+ return new Promise((resolve, reject) => {
98
+ const timer = setTimeout(() => {
99
+ rpcRequests.delete(id);
100
+ reject(new Error(`RPC "${name}" timed out`));
101
+ }, timeout);
102
+ rpcRequests.set(id, { resolve, reject, timer });
103
+ sendMessage?.({ __rpc: name, __rpc_id: id, data });
104
+ });
105
+ }
106
+
107
+ // Trap unhandled errors to avoid worker crash
108
+ if (typeof process !== "undefined" && typeof process.on === "function") {
109
+ process.on("unhandledRejection", (error) => console.error(error));
110
+ process.on("uncaughtException", (error) => console.error(error));
111
+ }
112
+
113
+ // ----- RSC Support -----
114
+
115
+ // define __VITE_ENVIRONMENT_RUNNER_IMPORT__ for RSC support
116
+ // https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-rsc/README.md#__vite_environment_runner_import__
117
+
118
+ globalThis.__VITE_ENVIRONMENT_RUNNER_IMPORT__ = async function (environmentName, id) {
119
+ const env = envs[environmentName];
120
+ if (!env) {
121
+ throw new Error(`Vite environment "${environmentName}" is not registered`);
122
+ }
123
+ return env.runner.import(id);
124
+ };
125
+
126
+ // ----- Reload -----
127
+
128
+ async function reload() {
129
+ try {
130
+ await Promise.all(Object.values(envs).map((env) => env?.reload()));
131
+ } catch (error) {
132
+ console.error(error);
133
+ }
134
+ }
135
+
136
+ // eslint-disable-next-line unicorn/prefer-top-level-await
137
+ reload();
138
+
139
+ // ----- HTML Transform -----
140
+
141
+ globalThis.__transform_html__ = async function (html) {
142
+ html = await rpc("transformHTML", html).catch((error) => {
143
+ console.warn("Failed to transform HTML via Vite:", error);
144
+ return html;
145
+ });
146
+ return html;
147
+ };
148
+
149
+ // ----- Exports (env-runner AppEntry) -----
150
+
151
+ export function fetch(req) {
152
+ const viteEnv = req?.headers.get("x-vite-env") || "nitro";
153
+ const env = envs[viteEnv];
154
+ if (!env) {
155
+ return renderError(req, httpError(500, `Unknown vite environment "${viteEnv}"`));
156
+ }
157
+ return env.fetch(req);
158
+ }
159
+
160
+ export function upgrade(context) {
161
+ const handleUpgrade = envs.nitro?.entry?.handleUpgrade;
162
+ if (handleUpgrade) {
163
+ handleUpgrade(context.node.req, context.node.socket, context.node.head);
164
+ }
165
+ }
166
+
167
+ export const ipc = {
168
+ onOpen(ctx) {
169
+ sendMessage = ctx.sendMessage;
170
+ },
171
+ onMessage(message) {
172
+ if (message?.__rpc_id) {
173
+ const req = rpcRequests.get(message.__rpc_id);
174
+ if (req) {
175
+ clearTimeout(req.timer);
176
+ rpcRequests.delete(message.__rpc_id);
177
+ if (message.error) {
178
+ req.reject(typeof message.error === "string" ? new Error(message.error) : message.error);
179
+ } else {
180
+ req.resolve(message.data);
181
+ }
182
+ }
183
+ return;
184
+ }
185
+ if (message?.type === "custom") {
186
+ if (message.event === "nitro:vite-env") {
187
+ const { name, entry } = message.data;
188
+ if (!envs[name]) {
189
+ envs[name] = new ViteEnvRunner({ name, entry });
190
+ }
191
+ return;
192
+ }
193
+ }
194
+ if (message?.type === "full-reload") {
195
+ reload();
196
+ return;
197
+ }
198
+ for (const listener of messageListeners) {
199
+ listener(message);
200
+ }
201
+ },
202
+ onClose() {},
203
+ };
204
+
205
+ // ----- Error handling -----
206
+
207
+ function httpError(status, message) {
208
+ const error = new Error(message || `HTTP Error ${status}`);
209
+ error.status = status;
210
+ error.name = "NitroViteError";
211
+ return error;
212
+ }
213
+
214
+ async function renderError(req, error) {
215
+ if (req.headers.get("accept")?.includes("application/json")) {
216
+ return new Response(
217
+ JSON.stringify(
218
+ {
219
+ status: error.status || 500,
220
+ name: error.name || "Error",
221
+ message: error.message,
222
+ stack: (error.stack || "")
223
+ .split("\n")
224
+ .splice(1)
225
+ .map((l) => l.trim()),
226
+ },
227
+ null,
228
+ 2
229
+ ),
230
+ {
231
+ status: error.status || 500,
232
+ headers: {
233
+ "Content-Type": "application/json",
234
+ "Cache-Control": "no-store, max-age=0, must-revalidate",
235
+ Pragma: "no-cache",
236
+ Expires: "0",
237
+ },
238
+ }
239
+ );
240
+ }
241
+ try {
242
+ const { Youch } = await import("youch");
243
+ const youch = new Youch();
244
+ return new Response(await youch.toHTML(error), {
245
+ status: error.status || 500,
246
+ headers: {
247
+ "Content-Type": "text/html",
248
+ "Cache-Control": "no-store, max-age=0, must-revalidate",
249
+ Pragma: "no-cache",
250
+ Expires: "0",
251
+ },
252
+ });
253
+ } catch {
254
+ return new Response(`<pre>${error.stack || error.message || error}</pre>`, {
255
+ status: error.status || 500,
256
+ headers: {
257
+ "Content-Type": "text/html",
258
+ "Cache-Control": "no-store, max-age=0, must-revalidate",
259
+ Pragma: "no-cache",
260
+ Expires: "0",
261
+ },
262
+ });
263
+ }
264
+ }
@@ -2,4 +2,5 @@ export declare const version: string;
2
2
  export declare const runtimeDir: string;
3
3
  export declare const presetsDir: string;
4
4
  export declare const pkgDir: string;
5
+ export declare const docsDir: string | undefined;
5
6
  export declare const runtimeDependencies: string[];
@@ -5,6 +5,7 @@ const resolve = (path) => fileURLToPath(new URL(path, import.meta.url));
5
5
  export const runtimeDir = /* @__PURE__ */ resolve("./");
6
6
  export const presetsDir = /* @__PURE__ */ resolve("../presets/");
7
7
  export const pkgDir = /* @__PURE__ */ resolve("../../");
8
+ export const docsDir = /* @__PURE__ */ resolve("../docs");
8
9
  export const runtimeDependencies = [
9
10
  "crossws",
10
11
  "croner",
@@ -15,6 +16,7 @@ export const runtimeDependencies = [
15
16
  "rou3",
16
17
  "hookable",
17
18
  "ofetch",
19
+ "ocache",
18
20
  "ohash",
19
21
  "rendu",
20
22
  "scule",
@@ -5,5 +5,7 @@ export declare function defineConfig(config: Omit<NitroConfig, "rootDir">): Omit
5
5
  export { defineNitroPlugin as definePlugin } from "./internal/plugin.mjs";
6
6
  export { defineRouteMeta } from "./internal/meta.mjs";
7
7
  export { defineNitroErrorHandler as defineErrorHandler } from "./internal/error/utils.mjs";
8
+ export { defineHandler, defineMiddleware, defineWebSocketHandler, html, HTTPError, HTTPResponse } from "h3";
9
+ export type { H3Event } from "h3";
8
10
  export declare function serverFetch(resource: string | URL | Request, init?: RequestInit, context?: ServerRequestContext | H3EventContext): Promise<Response>;
9
11
  export declare function fetch(resource: string | URL | Request, init?: RequestInit, context?: ServerRequestContext | H3EventContext): Promise<Response>;
@@ -2,11 +2,13 @@ import { toRequest } from "h3";
2
2
  export function defineConfig(config) {
3
3
  return config;
4
4
  }
5
- // Type (only) helpers
5
+
6
6
  export { defineNitroPlugin as definePlugin } from "./internal/plugin.mjs";
7
7
  export { defineRouteMeta } from "./internal/meta.mjs";
8
8
  export { defineNitroErrorHandler as defineErrorHandler } from "./internal/error/utils.mjs";
9
- // Runtime
9
+
10
+ export { defineHandler, defineMiddleware, defineWebSocketHandler, html, HTTPError, HTTPResponse } from "h3";
11
+
10
12
  export function serverFetch(resource, init, context) {
11
13
  const nitro = globalThis.__nitro__?.default || globalThis.__nitro__?.prerender || globalThis.__nitro_builder__;
12
14
  if (!nitro) {
@@ -1,5 +1,5 @@
1
1
  import "./_runtime_warn.mjs";
2
- import { toResponse } from "h3";
2
+ import { H3Event, toResponse } from "h3";
3
3
  const errorHandler = (error, event) => {
4
4
  if (error.status !== 404) {
5
5
  console.error(error);
@@ -2,6 +2,6 @@ import "./_runtime_warn.mjs";
2
2
  export function rendererTemplate(_req) {
3
3
  return `<!-- Renderer template not available -->`;
4
4
  }
5
- // dev only
5
+
6
6
  export const rendererTemplateFile = undefined;
7
7
  export const isStaticTemplate = undefined;
@@ -1,6 +1,7 @@
1
1
  import "./_runtime_warn.mjs";
2
+ import { type Storage } from "unstorage";
2
3
  import type { AssetMeta } from "nitro/types";
3
- export declare const assets: unknown;
4
+ export declare const assets: Storage;
4
5
  export declare function readAsset<T = any>(_id: string): Promise<T>;
5
6
  export declare function statAsset(_id: string): Promise<AssetMeta>;
6
7
  export declare function getKeys(): Promise<string[]>;
@@ -0,0 +1,5 @@
1
+ import "./_runtime_warn.mjs";
2
+ import type { NitroAppPlugin } from "nitro/types";
3
+ declare const plugin: NitroAppPlugin;
4
+ export default plugin;
5
+ export declare const tracingSrvxPlugins: Array<() => any>;
@@ -0,0 +1 @@
1
+ import "./_runtime_warn.mjs";