nitro-nightly 3.0.1-20251108-010549-1ea01a41 → 3.0.1-20251108-165335-a649b96d

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 (80) hide show
  1. package/dist/_build/common.mjs +8 -13
  2. package/dist/_build/rolldown.mjs +5 -9
  3. package/dist/_build/rollup.mjs +5 -9
  4. package/dist/_build/vite.build.mjs +3 -3
  5. package/dist/_build/vite.plugin.mjs +5 -9
  6. package/dist/_chunks/{Dk8nyx2j.mjs → BSRrcCy4.mjs} +3 -11
  7. package/dist/_chunks/{BUUEtsO2.mjs → C1JU3Y0s.mjs} +1 -1
  8. package/dist/_chunks/{CtS_EIO5.mjs → CHmly697.mjs} +35 -50
  9. package/dist/_chunks/{Ba5tS9Y6.mjs → Dam2UXM-.mjs} +1 -1
  10. package/dist/_dev.mjs +1 -1
  11. package/dist/_libs/chokidar.mjs +1 -0
  12. package/dist/_libs/etag.mjs +5 -0
  13. package/dist/_presets.mjs +1 -2
  14. package/dist/builder.mjs +3 -3
  15. package/dist/cli/_chunks/dev.mjs +1 -1
  16. package/dist/presets/_nitro/runtime/nitro-dev.mjs +3 -2
  17. package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +1 -1
  18. package/dist/presets/_nitro/runtime/service-worker.mjs +1 -1
  19. package/dist/presets/aws-amplify/runtime/aws-amplify.mjs +1 -1
  20. package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.mjs +1 -1
  21. package/dist/presets/aws-lambda/runtime/aws-lambda.mjs +1 -1
  22. package/dist/presets/azure/runtime/azure-swa.mjs +1 -1
  23. package/dist/presets/bun/runtime/bun.mjs +3 -2
  24. package/dist/presets/cloudflare/runtime/_module-handler.mjs +2 -2
  25. package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +1 -1
  26. package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +1 -1
  27. package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +2 -2
  28. package/dist/presets/cloudflare/runtime/plugin.dev.mjs +1 -1
  29. package/dist/presets/deno/runtime/deno-deploy.d.mts +2 -1
  30. package/dist/presets/deno/runtime/deno-deploy.mjs +1 -1
  31. package/dist/presets/deno/runtime/deno-server.mjs +3 -2
  32. package/dist/presets/netlify/runtime/netlify-edge.mjs +1 -1
  33. package/dist/presets/netlify/runtime/netlify.mjs +1 -1
  34. package/dist/presets/node/runtime/node-middleware.mjs +2 -2
  35. package/dist/presets/node/runtime/node-server.mjs +3 -2
  36. package/dist/presets/standard/runtime/server.mjs +1 -1
  37. package/dist/presets/stormkit/runtime/stormkit.mjs +1 -1
  38. package/dist/presets/vercel/runtime/vercel.node.mjs +1 -1
  39. package/dist/presets/vercel/runtime/vercel.web.mjs +1 -1
  40. package/dist/presets/winterjs/runtime/winterjs.mjs +1 -1
  41. package/dist/presets/zeabur/runtime/zeabur.mjs +1 -1
  42. package/dist/runtime/app.d.mts +1 -0
  43. package/dist/runtime/app.mjs +1 -0
  44. package/dist/runtime/cache.d.mts +1 -0
  45. package/dist/runtime/cache.mjs +1 -0
  46. package/dist/runtime/config.d.mts +3 -0
  47. package/dist/runtime/config.mjs +4 -0
  48. package/dist/runtime/context.d.mts +1 -0
  49. package/dist/runtime/context.mjs +1 -0
  50. package/dist/runtime/database.d.mts +1 -0
  51. package/dist/runtime/database.mjs +1 -0
  52. package/dist/runtime/internal/cache.d.mts +1 -3
  53. package/dist/runtime/internal/cache.mjs +1 -3
  54. package/dist/runtime/internal/route-rules.mjs +2 -2
  55. package/dist/runtime/internal/vite/dev-entry.mjs +1 -1
  56. package/dist/runtime/internal/vite/ssr-renderer.mjs +1 -1
  57. package/{lib → dist}/runtime/meta.d.mts +1 -1
  58. package/dist/runtime/meta.mjs +25 -0
  59. package/dist/runtime/nitro.d.mts +1 -0
  60. package/dist/runtime/nitro.mjs +1 -0
  61. package/dist/runtime/runtime-config.d.mts +1 -0
  62. package/dist/runtime/runtime-config.mjs +1 -0
  63. package/dist/runtime/storage.d.mts +1 -0
  64. package/dist/runtime/storage.mjs +1 -0
  65. package/dist/runtime/task.d.mts +1 -0
  66. package/dist/runtime/task.mjs +1 -0
  67. package/dist/types/index.d.mts +6 -10
  68. package/dist/vite.mjs +3 -3
  69. package/package.json +19 -14
  70. package/dist/runtime/index.d.mts +0 -20
  71. package/dist/runtime/index.mjs +0 -20
  72. package/dist/runtime/internal/index.d.mts +0 -4
  73. package/dist/runtime/internal/index.mjs +0 -4
  74. package/lib/config.d.mts +0 -9
  75. package/lib/config.mjs +0 -5
  76. package/lib/meta.d.mts +0 -5
  77. package/lib/meta.mjs +0 -21
  78. package/lib/runtime/meta.mjs +0 -35
  79. /package/dist/runtime/{vite.d.mts → vite-runtime.d.mts} +0 -0
  80. /package/dist/runtime/{vite.mjs → vite-runtime.mjs} +0 -0
@@ -12,7 +12,7 @@ import { promises } from "node:fs";
12
12
  import { joinURL, withTrailingSlash } from "ufo";
13
13
  import { readFile } from "node:fs/promises";
14
14
  import { defu } from "defu";
15
- import { runtimeDependencies, runtimeDir } from "nitro/runtime/meta";
15
+ import { pkgDir, runtimeDependencies, runtimeDir } from "nitro/meta";
16
16
  import { hash } from "ohash";
17
17
  import { defineEnv } from "unenv";
18
18
  import { connectors } from "db0";
@@ -97,12 +97,7 @@ function baseBuildConfig(nitro) {
97
97
  staticFlags,
98
98
  replacements,
99
99
  env,
100
- aliases: resolveAliases({
101
- "#internal/nitro": runtimeDir,
102
- "nitro/runtime": runtimeDir,
103
- "nitropack/runtime": runtimeDir,
104
- ...env.alias
105
- })
100
+ aliases: resolveAliases({ ...env.alias })
106
101
  };
107
102
  }
108
103
  function resolveAliases(_aliases) {
@@ -198,7 +193,7 @@ function routing(nitro) {
198
193
  ...nitro.routing.globalMiddleware
199
194
  ], "_importHash");
200
195
  return `
201
- import * as __routeRules__ from "nitro/runtime/internal/route-rules";
196
+ import * as __routeRules__ from "nitro/~internal/runtime/route-rules";
202
197
  import * as srvxNode from "srvx/node"
203
198
  import * as h3 from "h3";
204
199
 
@@ -601,7 +596,7 @@ function rendererTemplate(nitro) {
601
596
  const html = await readFile(nitro.options.renderer?.template, "utf8");
602
597
  if (hasTemplateSyntax(html)) return `
603
598
  import { renderToResponse } from 'rendu'
604
- import { serverFetch } from 'nitro/runtime'
599
+ import { serverFetch } from 'nitro/app'
605
600
  const template = ${compileTemplateToString(html, { contextKeys: [...RENDER_CONTEXT_KEYS] })};
606
601
  export const rendererTemplate = (request) => renderToResponse(template, { request, context: { serverFetch } })
607
602
  `;
@@ -688,13 +683,13 @@ function baseBuildPlugins(nitro, base) {
688
683
  "~~",
689
684
  "@@/",
690
685
  "virtual:",
691
- "nitro/runtime",
686
+ "nitro",
687
+ pkgDir,
688
+ nitro.options.serverDir,
692
689
  dirname(nitro.options.entry),
693
690
  ...nitro.options.experimental.wasm ? [(id) => id?.endsWith(".wasm")] : [],
694
- runtimeDir,
695
- nitro.options.serverDir,
696
691
  ...nitro.options.handlers.map((m) => m.handler).filter((i) => typeof i === "string"),
697
- ...nitro.options.dev || nitro.options.preset === "nitro-prerender" || nitro.options.experimental.bundleRuntimeDependencies === false ? [] : runtimeDependencies
692
+ ...nitro.options.dev || nitro.options.preset === "nitro-prerender" ? [] : runtimeDependencies
698
693
  ].filter(Boolean),
699
694
  traceOptions: {
700
695
  base: "/",
@@ -13,8 +13,8 @@ import "../_libs/tinyglobby.mjs";
13
13
  import { t as formatCompatibilityDate } from "../_libs/compatx.mjs";
14
14
  import "../_libs/std-env.mjs";
15
15
  import "../_libs/dot-prop.mjs";
16
- import { n as writeBuildInfo } from "../_chunks/Ba5tS9Y6.mjs";
17
- import { i as scanHandlers, n as writeTypes } from "../_chunks/Dk8nyx2j.mjs";
16
+ import { n as writeBuildInfo } from "../_chunks/Dam2UXM-.mjs";
17
+ import { i as scanHandlers, n as writeTypes } from "../_chunks/BSRrcCy4.mjs";
18
18
  import "../_libs/mime.mjs";
19
19
  import "../_libs/pathe.mjs";
20
20
  import "../_libs/untyped.mjs";
@@ -27,14 +27,14 @@ import { n as baseBuildConfig, r as replace, t as baseBuildPlugins } from "./com
27
27
  import "../_libs/remapping.mjs";
28
28
  import "../_libs/unwasm.mjs";
29
29
  import "../_libs/etag.mjs";
30
- import { n as raw, t as generateFSTree } from "../_chunks/BUUEtsO2.mjs";
30
+ import { n as raw, t as generateFSTree } from "../_chunks/C1JU3Y0s.mjs";
31
31
  import "../_libs/duplexer.mjs";
32
32
  import "../_libs/gzip-size.mjs";
33
33
  import "../_libs/pretty-bytes.mjs";
34
34
  import { builtinModules } from "node:module";
35
35
  import { watch } from "node:fs";
36
36
  import { defu } from "defu";
37
- import { runtimeDir } from "nitro/runtime/meta";
37
+ import { runtimeDir } from "nitro/meta";
38
38
 
39
39
  //#region src/build/rolldown/config.ts
40
40
  const getRolldownConfig = (nitro) => {
@@ -83,11 +83,7 @@ const getRolldownConfig = (nitro) => {
83
83
  if (!["CIRCULAR_DEPENDENCY", "EVAL"].includes(warning.code || "") && !warning.message.includes("Unsupported source map comment")) warn(warning);
84
84
  },
85
85
  treeshake: { moduleSideEffects(id) {
86
- const normalizedId = normalize(id);
87
- const idWithoutNodeModules = normalizedId.split("node_modules/").pop();
88
- if (!idWithoutNodeModules) return false;
89
- if (normalizedId.startsWith(runtimeDir) || idWithoutNodeModules.startsWith(runtimeDir)) return true;
90
- return nitro.options.moduleSideEffects.some((m) => normalizedId.startsWith(m) || idWithoutNodeModules.startsWith(m));
86
+ return nitro.options.moduleSideEffects.some((p) => id.startsWith(p));
91
87
  } },
92
88
  output: {
93
89
  dir: nitro.options.output.serverDir,
@@ -13,8 +13,8 @@ import "../_libs/tinyglobby.mjs";
13
13
  import { t as formatCompatibilityDate } from "../_libs/compatx.mjs";
14
14
  import "../_libs/std-env.mjs";
15
15
  import "../_libs/dot-prop.mjs";
16
- import { n as writeBuildInfo } from "../_chunks/Ba5tS9Y6.mjs";
17
- import { i as scanHandlers, n as writeTypes } from "../_chunks/Dk8nyx2j.mjs";
16
+ import { n as writeBuildInfo } from "../_chunks/Dam2UXM-.mjs";
17
+ import { i as scanHandlers, n as writeTypes } from "../_chunks/BSRrcCy4.mjs";
18
18
  import "../_libs/mime.mjs";
19
19
  import "../_libs/pathe.mjs";
20
20
  import "../_libs/untyped.mjs";
@@ -29,7 +29,7 @@ import { n as baseBuildConfig, r as replace, t as baseBuildPlugins } from "./com
29
29
  import "../_libs/remapping.mjs";
30
30
  import "../_libs/unwasm.mjs";
31
31
  import "../_libs/etag.mjs";
32
- import { n as raw, t as generateFSTree } from "../_chunks/BUUEtsO2.mjs";
32
+ import { n as raw, t as generateFSTree } from "../_chunks/C1JU3Y0s.mjs";
33
33
  import "../_libs/duplexer.mjs";
34
34
  import "../_libs/gzip-size.mjs";
35
35
  import "../_libs/pretty-bytes.mjs";
@@ -45,7 +45,7 @@ import "../_libs/hasown.mjs";
45
45
  import "../_libs/is-core-module.mjs";
46
46
  import { watch } from "node:fs";
47
47
  import { defu } from "defu";
48
- import { runtimeDir } from "nitro/runtime/meta";
48
+ import { runtimeDir } from "nitro/meta";
49
49
  import { transform } from "esbuild";
50
50
 
51
51
  //#region src/build/plugins/esbuild.ts
@@ -188,11 +188,7 @@ const getRollupConfig = (nitro) => {
188
188
  ].includes(warning.code || "") && !warning.message.includes("Unsupported source map comment")) rollupWarn(warning);
189
189
  },
190
190
  treeshake: { moduleSideEffects(id) {
191
- const normalizedId = normalize(id);
192
- const idWithoutNodeModules = normalizedId.split("node_modules/").pop();
193
- if (!idWithoutNodeModules) return false;
194
- if (normalizedId.startsWith(runtimeDir) || idWithoutNodeModules.startsWith(runtimeDir)) return true;
195
- return nitro.options.moduleSideEffects.some((m) => normalizedId.startsWith(m) || idWithoutNodeModules.startsWith(m));
191
+ return nitro.options.moduleSideEffects.some((p) => id.startsWith(p));
196
192
  } },
197
193
  output: {
198
194
  dir: nitro.options.output.serverDir,
@@ -13,12 +13,12 @@ import "../_libs/tinyglobby.mjs";
13
13
  import "../_libs/compatx.mjs";
14
14
  import "../_libs/klona.mjs";
15
15
  import { r as a } from "../_libs/std-env.mjs";
16
- import "../_chunks/CtS_EIO5.mjs";
16
+ import "../_chunks/CHmly697.mjs";
17
17
  import "../_libs/escape-string-regexp.mjs";
18
18
  import "../_libs/tsconfck.mjs";
19
19
  import "../_libs/dot-prop.mjs";
20
- import "../_chunks/Ba5tS9Y6.mjs";
21
- import "../_chunks/Dk8nyx2j.mjs";
20
+ import "../_chunks/Dam2UXM-.mjs";
21
+ import "../_chunks/BSRrcCy4.mjs";
22
22
  import "../_libs/rou3.mjs";
23
23
  import "../_libs/mime.mjs";
24
24
  import "../_libs/pathe.mjs";
@@ -2,9 +2,9 @@ import { C as join$1, D as relative$1, O as resolve$1, S as isAbsolute$1, b as d
2
2
  import { f as sanitizeFilePath } from "../_libs/local-pkg.mjs";
3
3
  import { t as formatCompatibilityDate } from "../_libs/compatx.mjs";
4
4
  import { n as T, r as a } from "../_libs/std-env.mjs";
5
- import { a as createNitro, n as prepare, r as copyPublicAssets } from "../_chunks/CtS_EIO5.mjs";
6
- import { a as prettyPath, n as writeBuildInfo, t as getBuildInfo } from "../_chunks/Ba5tS9Y6.mjs";
7
- import { i as scanHandlers } from "../_chunks/Dk8nyx2j.mjs";
5
+ import { a as createNitro, n as prepare, r as copyPublicAssets } from "../_chunks/CHmly697.mjs";
6
+ import { a as prettyPath, n as writeBuildInfo, t as getBuildInfo } from "../_chunks/Dam2UXM-.mjs";
7
+ import { i as scanHandlers } from "../_chunks/BSRrcCy4.mjs";
8
8
  import { i as NodeDevWorker, r as NitroDevApp } from "../_dev.mjs";
9
9
  import { i as watch$1 } from "../_libs/chokidar.mjs";
10
10
  import { t as alias } from "../_libs/plugin-alias.mjs";
@@ -16,7 +16,7 @@ import { join, resolve } from "node:path";
16
16
  import { existsSync, watch } from "node:fs";
17
17
  import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
18
18
  import { defu } from "defu";
19
- import { runtimeDependencies, runtimeDir } from "nitro/runtime/meta";
19
+ import { runtimeDependencies, runtimeDir } from "nitro/meta";
20
20
  import { colors } from "consola/utils";
21
21
  import { NodeRequest, sendNodeResponse } from "srvx/node";
22
22
  import { DevEnvironment } from "vite";
@@ -63,11 +63,7 @@ const getViteRollupConfig = (ctx) => {
63
63
  ].filter(Boolean),
64
64
  ...ctx._isRolldown ? { transform: { inject: base.env.inject } } : {},
65
65
  treeshake: { moduleSideEffects(id) {
66
- const normalizedId = normalize$1(id);
67
- const idWithoutNodeModules = normalizedId.split("node_modules/").pop();
68
- if (!idWithoutNodeModules) return false;
69
- if (normalizedId.startsWith(runtimeDir) || idWithoutNodeModules.startsWith(runtimeDir)) return true;
70
- return nitro$1.options.moduleSideEffects.some((m) => normalizedId.startsWith(m) || idWithoutNodeModules.startsWith(m));
66
+ return nitro$1.options.moduleSideEffects.some((p) => id.startsWith(p));
71
67
  } },
72
68
  output: {
73
69
  dir: nitro$1.options.output.serverDir,
@@ -3,13 +3,13 @@ import { C as join, D as relative, O as resolve, S as isAbsolute, b as dirname,
3
3
  import { c as parseNodeModulePath, s as lookupNodeModuleSubpath } from "../_libs/local-pkg.mjs";
4
4
  import { s as toExports } from "../_libs/unimport.mjs";
5
5
  import { t as glob } from "../_libs/tinyglobby.mjs";
6
- import { i as isDirectory, o as resolveNitroPath, s as writeFile } from "./Ba5tS9Y6.mjs";
6
+ import { i as isDirectory, o as resolveNitroPath, s as writeFile } from "./Dam2UXM-.mjs";
7
7
  import { t as resolveAlias } from "../_libs/pathe.mjs";
8
8
  import { n as resolveSchema, t as generateTypes } from "../_libs/untyped.mjs";
9
9
  import { existsSync, promises } from "node:fs";
10
10
  import { withBase, withLeadingSlash, withoutTrailingSlash } from "ufo";
11
11
  import { defu } from "defu";
12
- import { runtimeDir } from "nitro/runtime/meta";
12
+ import { runtimeDir } from "nitro/meta";
13
13
 
14
14
  //#region src/scan.ts
15
15
  const GLOB_SCAN_PATTERN = "**/*.{js,mjs,cjs,ts,mts,cts,tsx,jsx}";
@@ -242,15 +242,7 @@ async function writeTypes(nitro) {
242
242
  jsx: "preserve",
243
243
  jsxFactory: "h",
244
244
  jsxFragmentFactory: "Fragment",
245
- paths: {
246
- "#imports": [relativeWithDot(tsconfigDir, join(generatedTypesDir, "nitro-imports"))],
247
- ...nitro.options.typescript.internalPaths ? {
248
- "nitro/runtime": [relativeWithDot(tsconfigDir, join(runtimeDir, "index"))],
249
- "#internal/nitro": [relativeWithDot(tsconfigDir, join(runtimeDir, "index"))],
250
- "nitro/runtime/*": [relativeWithDot(tsconfigDir, join(runtimeDir, "*"))],
251
- "#internal/nitro/*": [relativeWithDot(tsconfigDir, join(runtimeDir, "*"))]
252
- } : {}
253
- }
245
+ paths: { "#imports": [relativeWithDot(tsconfigDir, join(generatedTypesDir, "nitro-imports"))] }
254
246
  },
255
247
  include: [
256
248
  relativeWithDot(tsconfigDir, join(generatedTypesDir, "nitro.d.ts")).replace(/^(?=[^.])/, "./"),
@@ -1,7 +1,7 @@
1
1
  import { D as relative, O as resolve, b as dirname, x as extname } from "../_libs/c12.mjs";
2
2
  import { t as glob } from "../_libs/tinyglobby.mjs";
3
3
  import { r as a } from "../_libs/std-env.mjs";
4
- import { t as runParallel } from "./Dk8nyx2j.mjs";
4
+ import { t as runParallel } from "./BSRrcCy4.mjs";
5
5
  import { t as src_default } from "../_libs/mime.mjs";
6
6
  import { t as gzipSize } from "../_libs/gzip-size.mjs";
7
7
  import { t as prettyBytes } from "../_libs/pretty-bytes.mjs";
@@ -8,8 +8,8 @@ import { t as klona } from "../_libs/klona.mjs";
8
8
  import { i as d, r as a } from "../_libs/std-env.mjs";
9
9
  import { t as escapeStringRegexp } from "../_libs/escape-string-regexp.mjs";
10
10
  import { n as parse, t as TSConfckCache } from "../_libs/tsconfck.mjs";
11
- import { a as prettyPath, i as isDirectory, o as resolveNitroPath, s as writeFile$1 } from "./Ba5tS9Y6.mjs";
12
- import { i as scanHandlers, r as scanAndSyncOptions, t as runParallel } from "./Dk8nyx2j.mjs";
11
+ import { a as prettyPath, i as isDirectory, o as resolveNitroPath, s as writeFile$1 } from "./Dam2UXM-.mjs";
12
+ import { i as scanHandlers, r as scanAndSyncOptions, t as runParallel } from "./BSRrcCy4.mjs";
13
13
  import { a as findRoute, i as findAllRoutes, n as addRoute, r as createRouter, t as compileRouterToString } from "../_libs/rou3.mjs";
14
14
  import { t as src_default } from "../_libs/mime.mjs";
15
15
  import { n as z, t as P } from "../_libs/ultrahtml.mjs";
@@ -20,7 +20,7 @@ import { joinURL, parseURL, withBase, withLeadingSlash, withTrailingSlash, witho
20
20
  import { pathToFileURL } from "node:url";
21
21
  import fsp, { readFile } from "node:fs/promises";
22
22
  import { defu } from "defu";
23
- import { pkgDir, runtimeDir } from "nitro/runtime/meta";
23
+ import { pkgDir, runtimeDir } from "nitro/meta";
24
24
  import { colors } from "consola/utils";
25
25
  import { ofetch } from "ofetch";
26
26
  import { hash } from "ohash";
@@ -83,7 +83,7 @@ const NitroDefaults = {
83
83
  routes: []
84
84
  },
85
85
  builder: void 0,
86
- moduleSideEffects: ["unenv/polyfill/", resolve(runtimeDir, "polyfill/")],
86
+ moduleSideEffects: ["unenv/polyfill/"],
87
87
  replace: {},
88
88
  node: true,
89
89
  sourceMap: true,
@@ -93,7 +93,6 @@ const NitroDefaults = {
93
93
  generateRuntimeConfigTypes: false,
94
94
  generateTsConfig: false,
95
95
  tsconfigPath: "tsconfig.json",
96
- internalPaths: false,
97
96
  tsConfig: void 0
98
97
  },
99
98
  nodeModulesDirs: [],
@@ -144,7 +143,7 @@ async function resolveCompatibilityOptions(options) {
144
143
  async function resolveDatabaseOptions(options) {
145
144
  if (options.experimental.database && options.imports) {
146
145
  options.imports.presets.push({
147
- from: "nitro/runtime/internal/database",
146
+ from: "nitro/database",
148
147
  imports: ["useDatabase"]
149
148
  });
150
149
  if (options.dev && !options.database && !options.devDatabase) options.devDatabase = { default: {
@@ -204,51 +203,37 @@ async function resolveImportsOptions(options) {
204
203
  function getNitroImportsPreset() {
205
204
  return [
206
205
  {
207
- from: "nitro/runtime/internal/app",
206
+ from: "nitro/app",
208
207
  imports: ["useNitroApp"]
209
208
  },
210
209
  {
211
- from: "nitro/runtime/internal/runtime-config",
210
+ from: "nitro/runtime-config",
212
211
  imports: ["useRuntimeConfig"]
213
212
  },
214
213
  {
215
- from: "nitro/runtime/internal/plugin",
216
- imports: ["defineNitroPlugin", "nitroPlugin"]
214
+ from: "nitro",
215
+ imports: ["definePlugin"]
217
216
  },
218
217
  {
219
- from: "nitro/runtime/internal/cache",
220
- imports: [
221
- "defineCachedFunction",
222
- "defineCachedEventHandler",
223
- "defineCachedHandler",
224
- "cachedFunction",
225
- "cachedEventHandler"
226
- ]
218
+ from: "nitro/cache",
219
+ imports: ["defineCachedFunction", "defineCachedHandler"]
227
220
  },
228
221
  {
229
- from: "nitro/runtime/internal/storage",
222
+ from: "nitro/storage",
230
223
  imports: ["useStorage"]
231
224
  },
232
225
  {
233
- from: "nitro/runtime/internal/meta",
234
- imports: ["defineRouteMeta"]
226
+ from: "nitro",
227
+ imports: ["defineRouteMeta", "defineErrorHandler"]
235
228
  },
236
229
  {
237
- from: "nitro/runtime/internal/route-rules",
238
- imports: ["getRouteRules"]
239
- },
240
- {
241
- from: "nitro/runtime/internal/context",
230
+ from: "nitro/context",
242
231
  imports: ["useRequest"]
243
232
  },
244
233
  {
245
- from: "nitro/runtime/internal/task",
234
+ from: "nitro/task",
246
235
  imports: ["defineTask", "runTask"]
247
236
  },
248
- {
249
- from: "nitro/runtime/internal/error/utils",
250
- imports: ["defineNitroErrorHandler"]
251
- },
252
237
  {
253
238
  from: "nitro/deps/ofetch",
254
239
  imports: ["$fetch"]
@@ -873,39 +858,39 @@ function handlerWithImportHash(h) {
873
858
  };
874
859
  }
875
860
  var Router = class {
876
- #routes;
877
- #router;
878
- #compiled;
879
- #baseURL;
861
+ _routes;
862
+ _router;
863
+ _compiled;
864
+ _baseURL;
880
865
  constructor(baseURL) {
881
866
  this._update([]);
882
- this.#baseURL = baseURL || "";
883
- if (this.#baseURL.endsWith("/")) this.#baseURL = this.#baseURL.slice(0, -1);
867
+ this._baseURL = baseURL || "";
868
+ if (this._baseURL.endsWith("/")) this._baseURL = this._baseURL.slice(0, -1);
884
869
  }
885
870
  get routes() {
886
- return this.#routes;
871
+ return this._routes;
887
872
  }
888
873
  _update(routes, opts) {
889
- this.#routes = routes;
890
- this.#router = createRouter();
891
- this.#compiled = void 0;
892
- for (const route of routes) addRoute(this.#router, route.method, this.#baseURL + route.route, route.data);
893
- if (opts?.merge) mergeCatchAll(this.#router);
874
+ this._routes = routes;
875
+ this._router = createRouter();
876
+ this._compiled = void 0;
877
+ for (const route of routes) addRoute(this._router, route.method, this._baseURL + route.route, route.data);
878
+ if (opts?.merge) mergeCatchAll(this._router);
894
879
  }
895
880
  hasRoutes() {
896
- return this.#routes.length > 0;
881
+ return this._routes.length > 0;
897
882
  }
898
883
  compileToString(opts) {
899
- if (this.#compiled) return this.#compiled;
900
- this.#compiled = compileRouterToString(this.#router, void 0, opts);
901
- if (this.routes.length === 1 && this.routes[0].route === "/**" && this.routes[0].method === "") this.#compiled = `/* @__PURE__ */ (() => {const data=${(opts?.serialize || JSON.stringify)(this.routes[0].data)};return ((_m, p)=>{return {data,params:{"_":p.slice(1)}};})})()`;
902
- return this.#compiled;
884
+ if (this._compiled) return this._compiled;
885
+ this._compiled = compileRouterToString(this._router, void 0, opts);
886
+ if (this.routes.length === 1 && this.routes[0].route === "/**" && this.routes[0].method === "") this._compiled = `/* @__PURE__ */ (() => {const data=${(opts?.serialize || JSON.stringify)(this.routes[0].data)};return ((_m, p)=>{return {data,params:{"_":p.slice(1)}};})})()`;
887
+ return this._compiled;
903
888
  }
904
889
  match(method, path) {
905
- return findRoute(this.#router, method, path)?.data;
890
+ return findRoute(this._router, method, path)?.data;
906
891
  }
907
892
  matchAll(method, path) {
908
- return findAllRoutes(this.#router, method, path).map((route) => route.data);
893
+ return findAllRoutes(this._router, method, path).map((route) => route.data);
909
894
  }
910
895
  };
911
896
  function mergeCatchAll(router) {
@@ -3,8 +3,8 @@ import { t as getProperty } from "../_libs/dot-prop.mjs";
3
3
  import consola$1 from "consola";
4
4
  import { dirname } from "node:path";
5
5
  import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
6
- import { colors } from "consola/utils";
7
6
  import { version } from "nitro/meta";
7
+ import { colors } from "consola/utils";
8
8
 
9
9
  //#region src/utils/fs.ts
10
10
  function prettyPath(p, highlight = true) {
package/dist/_dev.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { C as join$1, O as resolve$1, n as debounce, x as extname$1 } from "./_libs/c12.mjs";
2
2
  import { n as T, r as a } from "./_libs/std-env.mjs";
3
- import { r as writeDevBuildInfo } from "./_chunks/Ba5tS9Y6.mjs";
3
+ import { r as writeDevBuildInfo } from "./_chunks/Dam2UXM-.mjs";
4
4
  import { t as src_default } from "./_libs/mime.mjs";
5
5
  import { n as createProxyServer } from "./_libs/httpxy.mjs";
6
6
  import { i as watch$1 } from "./_libs/chokidar.mjs";
@@ -940,6 +940,7 @@ var NodeFsHandler = class {
940
940
 
941
941
  //#endregion
942
942
  //#region node_modules/.pnpm/chokidar@4.0.3/node_modules/chokidar/esm/index.js
943
+ /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
943
944
  const SLASH = "/";
944
945
  const SLASH_SLASH = "//";
945
946
  const ONE_DOT = ".";
@@ -1,6 +1,11 @@
1
1
  import { n as __require, t as __commonJS } from "../_chunks/Bqks5huO.mjs";
2
2
 
3
3
  //#region node_modules/.pnpm/etag@1.8.1/node_modules/etag/index.js
4
+ /*!
5
+ * etag
6
+ * Copyright(c) 2014-2016 Douglas Christopher Wilson
7
+ * MIT Licensed
8
+ */
4
9
  var require_etag = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/etag@1.8.1/node_modules/etag/index.js": ((exports, module) => {
5
10
  /**
6
11
  * Module exports.
package/dist/_presets.mjs CHANGED
@@ -14,9 +14,8 @@ import { existsSync, promises } from "node:fs";
14
14
  import { hasProtocol, joinURL, withLeadingSlash, withTrailingSlash, withoutLeadingSlash } from "ufo";
15
15
  import fsp, { readFile, writeFile } from "node:fs/promises";
16
16
  import { defu } from "defu";
17
- import { presetsDir, runtimeDir } from "nitro/runtime/meta";
17
+ import { presetsDir, runtimeDir, version } from "nitro/meta";
18
18
  import { colors } from "consola/utils";
19
- import { version } from "nitro/meta";
20
19
 
21
20
  //#region src/presets/_utils/preset.ts
22
21
  function defineNitroPreset(preset, meta) {
package/dist/builder.mjs CHANGED
@@ -13,12 +13,12 @@ import "./_libs/tinyglobby.mjs";
13
13
  import "./_libs/compatx.mjs";
14
14
  import "./_libs/klona.mjs";
15
15
  import "./_libs/std-env.mjs";
16
- import { a as createNitro, c as loadOptions, i as build, n as prepare, o as listTasks, r as copyPublicAssets, s as runTask, t as prerender } from "./_chunks/CtS_EIO5.mjs";
16
+ import { a as createNitro, c as loadOptions, i as build, n as prepare, o as listTasks, r as copyPublicAssets, s as runTask, t as prerender } from "./_chunks/CHmly697.mjs";
17
17
  import "./_libs/escape-string-regexp.mjs";
18
18
  import "./_libs/tsconfck.mjs";
19
19
  import "./_libs/dot-prop.mjs";
20
- import { t as getBuildInfo } from "./_chunks/Ba5tS9Y6.mjs";
21
- import { n as writeTypes } from "./_chunks/Dk8nyx2j.mjs";
20
+ import { t as getBuildInfo } from "./_chunks/Dam2UXM-.mjs";
21
+ import { n as writeTypes } from "./_chunks/BSRrcCy4.mjs";
22
22
  import "./_libs/rou3.mjs";
23
23
  import "./_libs/mime.mjs";
24
24
  import "./_libs/pathe.mjs";
@@ -1,7 +1,7 @@
1
1
  import { O as resolve } from "../../_libs/c12.mjs";
2
2
  import "../../_libs/std-env.mjs";
3
3
  import "../../_libs/dot-prop.mjs";
4
- import "../../_chunks/Ba5tS9Y6.mjs";
4
+ import "../../_chunks/Dam2UXM-.mjs";
5
5
  import "../../_libs/mime.mjs";
6
6
  import "../../_libs/httpxy.mjs";
7
7
  import { t as NitroDevServer } from "../../_dev.mjs";
@@ -1,6 +1,7 @@
1
1
  import "#nitro-internal-pollyfills";
2
- import { useNitroApp, useNitroHooks } from "nitro/runtime";
3
- import { startScheduleRunner, trapUnhandledErrors } from "nitro/runtime/internal";
2
+ import { useNitroApp, useNitroHooks } from "nitro/app";
3
+ import { startScheduleRunner } from "nitro/~internal/runtime/task";
4
+ import { trapUnhandledErrors } from "nitro/~internal/runtime/error/hooks";
4
5
  import { Server } from "node:http";
5
6
  import { parentPort, threadId } from "node:worker_threads";
6
7
  import wsAdapter from "crossws/adapters/node";
@@ -1,6 +1,6 @@
1
1
  import "#nitro-internal-pollyfills";
2
2
  import consola from "consola";
3
- import { useNitroApp, useNitroHooks } from "nitro/runtime";
3
+ import { useNitroApp, useNitroHooks } from "nitro/app";
4
4
  const nitroApp = useNitroApp();
5
5
  const nitroHooks = useNitroHooks();
6
6
  export default {
@@ -1,5 +1,5 @@
1
1
  import "#nitro-internal-pollyfills";
2
- import { useNitroApp } from "nitro/runtime";
2
+ import { useNitroApp } from "nitro/app";
3
3
  import { isPublicAssetURL } from "#nitro-internal-virtual/public-assets";
4
4
  const nitroApp = useNitroApp();
5
5
  // @ts-expect-error
@@ -1,5 +1,5 @@
1
1
  import "#nitro-internal-pollyfills";
2
- import { useNitroApp } from "nitro/runtime";
2
+ import { useNitroApp } from "nitro/app";
3
3
  import { Server } from "node:http";
4
4
  import { toNodeHandler } from "srvx/node";
5
5
  const nitroApp = useNitroApp();
@@ -1,5 +1,5 @@
1
1
  import "#nitro-internal-pollyfills";
2
- import { useNitroApp } from "nitro/runtime";
2
+ import { useNitroApp } from "nitro/app";
3
3
  import { awsRequest, awsResponseHeaders } from "./_utils.mjs";
4
4
  const nitroApp = useNitroApp();
5
5
  export const handler = awslambda.streamifyResponse(async (event, responseStream, context) => {
@@ -1,5 +1,5 @@
1
1
  import "#nitro-internal-pollyfills";
2
- import { useNitroApp } from "nitro/runtime";
2
+ import { useNitroApp } from "nitro/app";
3
3
  import { awsRequest, awsResponseHeaders, awsResponseBody } from "./_utils.mjs";
4
4
  const nitroApp = useNitroApp();
5
5
  export async function handler(event, context) {
@@ -1,6 +1,6 @@
1
1
  import "#nitro-internal-pollyfills";
2
2
  import { parseURL } from "ufo";
3
- import { useNitroApp } from "nitro/runtime";
3
+ import { useNitroApp } from "nitro/app";
4
4
  import { getAzureParsedCookiesFromHeaders } from "./_utils.mjs";
5
5
  const nitroApp = useNitroApp();
6
6
  export async function handle(context, req) {
@@ -1,7 +1,8 @@
1
1
  import "#nitro-internal-pollyfills";
2
2
  import { serve } from "srvx/bun";
3
- import { useNitroApp } from "nitro/runtime";
4
- import { trapUnhandledErrors, startScheduleRunner } from "nitro/runtime/internal";
3
+ import { useNitroApp } from "nitro/app";
4
+ import { startScheduleRunner } from "nitro/~internal/runtime/task";
5
+ import { trapUnhandledErrors } from "nitro/~internal/runtime/error/hooks";
5
6
  const port = Number.parseInt(process.env.NITRO_PORT || process.env.PORT || "") || 3e3;
6
7
  const host = process.env.NITRO_HOST || process.env.HOST;
7
8
  const cert = process.env.NITRO_SSL_CERT;
@@ -1,6 +1,6 @@
1
1
  import "#nitro-internal-pollyfills";
2
- import { useNitroApp, useNitroHooks } from "nitro/runtime";
3
- import { runCronTasks } from "nitro/runtime/internal";
2
+ import { runCronTasks } from "nitro/~internal/runtime/task";
3
+ import { useNitroApp, useNitroHooks } from "nitro/app";
4
4
  export function createHandler(hooks) {
5
5
  const nitroApp = useNitroApp();
6
6
  const nitroHooks = useNitroHooks();
@@ -1,7 +1,7 @@
1
1
  import "#nitro-internal-pollyfills";
2
2
  import { DurableObject } from "cloudflare:workers";
3
3
  import wsAdapter from "crossws/adapters/cloudflare";
4
- import { useNitroApp, useNitroHooks } from "nitro/runtime";
4
+ import { useNitroApp, useNitroHooks } from "nitro/app";
5
5
  import { isPublicAssetURL } from "#nitro-internal-virtual/public-assets";
6
6
  import { createHandler, fetchHandler } from "./_module-handler.mjs";
7
7
  const DURABLE_BINDING = "$DurableObject";
@@ -1,6 +1,6 @@
1
1
  import "#nitro-internal-pollyfills";
2
2
  import wsAdapter from "crossws/adapters/cloudflare";
3
- import { useNitroApp } from "nitro/runtime";
3
+ import { useNitroApp } from "nitro/app";
4
4
  import { isPublicAssetURL } from "#nitro-internal-virtual/public-assets";
5
5
  import { createHandler } from "./_module-handler.mjs";
6
6
  const nitroApp = useNitroApp();
@@ -1,7 +1,7 @@
1
1
  import "#nitro-internal-pollyfills";
2
- import { useNitroApp } from "nitro/runtime";
3
- import { runCronTasks } from "nitro/runtime/internal";
2
+ import { useNitroApp } from "nitro/app";
4
3
  import { isPublicAssetURL } from "#nitro-internal-virtual/public-assets";
4
+ import { runCronTasks } from "nitro/~internal/runtime/task";
5
5
  import wsAdapter from "crossws/adapters/cloudflare";
6
6
  const nitroApp = useNitroApp();
7
7
  const ws = import.meta._websocket ? wsAdapter(nitroApp.h3App.websocket) : undefined;
@@ -1,3 +1,4 @@
1
+ import { useRuntimeConfig } from "nitro/runtime-config";
1
2
  const proxy = await _getPlatformProxy().catch((error) => {
2
3
  console.error("Failed to initialize wrangler bindings proxy", error);
3
4
  return _createStubProxy();
@@ -38,7 +39,6 @@ const cloudflareDevPlugin = function(nitroApp) {
38
39
  };
39
40
  export default cloudflareDevPlugin;
40
41
  async function _getPlatformProxy() {
41
- const { useRuntimeConfig } = await import("nitro/runtime");
42
42
  const pkg = "wrangler";
43
43
  const { getPlatformProxy } = await import(
44
44
  /* @vite-ignore */
@@ -1,4 +1,5 @@
1
1
  import "#nitro-internal-pollyfills";
2
+ import type { Deno as _Deno } from "@deno/types";
2
3
  declare global {
3
- const Deno: typeof import("@deno/types").Deno;
4
+ var Deno: typeof _Deno;
4
5
  }
@@ -1,5 +1,5 @@
1
1
  import "#nitro-internal-pollyfills";
2
- import { useNitroApp } from "nitro/runtime";
2
+ import { useNitroApp } from "nitro/app";
3
3
  import wsAdapter from "crossws/adapters/deno";
4
4
  const nitroApp = useNitroApp();
5
5
  const ws = import.meta._websocket ? wsAdapter(nitroApp.h3App.websocket) : undefined;