nitro-nightly 3.0.1-20251108-010549-1ea01a41 → 3.0.1-20251108-180447-f148172c

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 (88) hide show
  1. package/dist/_build/common.mjs +23 -26
  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 +6 -10
  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/c12.mjs +2 -2
  12. package/dist/_libs/chokidar.mjs +1 -0
  13. package/dist/_libs/etag.mjs +5 -0
  14. package/dist/_libs/plugin-alias.mjs +1 -1
  15. package/dist/_libs/plugin-commonjs.mjs +2 -2
  16. package/dist/_libs/plugin-inject.mjs +1 -1
  17. package/dist/_libs/plugin-json.mjs +1 -1
  18. package/dist/_libs/plugin-node-resolve.mjs +1 -1
  19. package/dist/_libs/plugin-replace.mjs +1 -1
  20. package/dist/_libs/unwasm.mjs +1 -3
  21. package/dist/_presets.mjs +1 -2
  22. package/dist/builder.mjs +3 -3
  23. package/dist/cli/_chunks/dev.mjs +1 -1
  24. package/dist/presets/_nitro/runtime/nitro-dev.mjs +3 -2
  25. package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +1 -1
  26. package/dist/presets/_nitro/runtime/service-worker.mjs +1 -1
  27. package/dist/presets/aws-amplify/runtime/aws-amplify.mjs +1 -1
  28. package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.mjs +1 -1
  29. package/dist/presets/aws-lambda/runtime/aws-lambda.mjs +1 -1
  30. package/dist/presets/azure/runtime/azure-swa.mjs +1 -1
  31. package/dist/presets/bun/runtime/bun.mjs +3 -2
  32. package/dist/presets/cloudflare/runtime/_module-handler.mjs +2 -2
  33. package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +1 -1
  34. package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +1 -1
  35. package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +2 -2
  36. package/dist/presets/cloudflare/runtime/plugin.dev.mjs +1 -1
  37. package/dist/presets/deno/runtime/deno-deploy.d.mts +2 -1
  38. package/dist/presets/deno/runtime/deno-deploy.mjs +1 -1
  39. package/dist/presets/deno/runtime/deno-server.mjs +3 -2
  40. package/dist/presets/netlify/runtime/netlify-edge.mjs +1 -1
  41. package/dist/presets/netlify/runtime/netlify.mjs +1 -1
  42. package/dist/presets/node/runtime/node-middleware.mjs +2 -2
  43. package/dist/presets/node/runtime/node-server.mjs +3 -2
  44. package/dist/presets/standard/runtime/server.mjs +1 -1
  45. package/dist/presets/stormkit/runtime/stormkit.mjs +1 -1
  46. package/dist/presets/vercel/runtime/vercel.node.mjs +1 -1
  47. package/dist/presets/vercel/runtime/vercel.web.mjs +1 -1
  48. package/dist/presets/winterjs/runtime/winterjs.mjs +1 -1
  49. package/dist/presets/zeabur/runtime/zeabur.mjs +1 -1
  50. package/dist/runtime/app.d.mts +1 -0
  51. package/dist/runtime/app.mjs +1 -0
  52. package/dist/runtime/cache.d.mts +1 -0
  53. package/dist/runtime/cache.mjs +1 -0
  54. package/dist/runtime/config.d.mts +3 -0
  55. package/dist/runtime/config.mjs +4 -0
  56. package/dist/runtime/context.d.mts +1 -0
  57. package/dist/runtime/context.mjs +1 -0
  58. package/dist/runtime/database.d.mts +1 -0
  59. package/dist/runtime/database.mjs +1 -0
  60. package/dist/runtime/internal/cache.d.mts +1 -3
  61. package/dist/runtime/internal/cache.mjs +1 -3
  62. package/dist/runtime/internal/route-rules.mjs +2 -2
  63. package/dist/runtime/internal/vite/dev-entry.mjs +1 -1
  64. package/dist/runtime/internal/vite/ssr-renderer.mjs +1 -1
  65. package/{lib → dist}/runtime/meta.d.mts +1 -1
  66. package/dist/runtime/meta.mjs +25 -0
  67. package/dist/runtime/nitro.d.mts +1 -0
  68. package/dist/runtime/nitro.mjs +1 -0
  69. package/dist/runtime/runtime-config.d.mts +1 -0
  70. package/dist/runtime/runtime-config.mjs +1 -0
  71. package/dist/runtime/storage.d.mts +1 -0
  72. package/dist/runtime/storage.mjs +1 -0
  73. package/dist/runtime/task.d.mts +1 -0
  74. package/dist/runtime/task.mjs +1 -0
  75. package/dist/types/index.d.mts +6 -10
  76. package/dist/vite.mjs +3 -3
  77. package/package.json +24 -19
  78. package/dist/runtime/index.d.mts +0 -20
  79. package/dist/runtime/index.mjs +0 -20
  80. package/dist/runtime/internal/index.d.mts +0 -4
  81. package/dist/runtime/internal/index.mjs +0 -4
  82. package/lib/config.d.mts +0 -9
  83. package/lib/config.mjs +0 -5
  84. package/lib/meta.d.mts +0 -5
  85. package/lib/meta.mjs +0 -21
  86. package/lib/runtime/meta.mjs +0 -35
  87. /package/dist/runtime/{vite.d.mts → vite-runtime.d.mts} +0 -0
  88. /package/dist/runtime/{vite.mjs → vite-runtime.mjs} +0 -0
@@ -5,14 +5,14 @@ import { t as glob } from "../_libs/tinyglobby.mjs";
5
5
  import { t as src_default } from "../_libs/mime.mjs";
6
6
  import { i as genSafeVariableName, t as genImport } from "../_libs/knitwork.mjs";
7
7
  import { t as replace } from "../_libs/plugin-replace.mjs";
8
- import { t as rollup } from "../_libs/unwasm.mjs";
8
+ import { t as unwasm } from "../_libs/unwasm.mjs";
9
9
  import { t as require_etag } from "../_libs/etag.mjs";
10
10
  import { camelCase } from "scule";
11
11
  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";
@@ -82,6 +82,21 @@ function baseBuildConfig(nitro) {
82
82
  ...Object.fromEntries(Object.entries(staticFlags).map(([key, val]) => [`import.meta.${key}`, JSON.stringify(val)])),
83
83
  ...nitro.options.replace
84
84
  };
85
+ const noExternal = [
86
+ "#",
87
+ "~",
88
+ "@/",
89
+ "~~",
90
+ "@@/",
91
+ "virtual:",
92
+ "nitro",
93
+ pkgDir,
94
+ nitro.options.serverDir,
95
+ dirname(nitro.options.entry),
96
+ ...nitro.options.experimental.wasm ? [(id) => id?.endsWith(".wasm")] : [],
97
+ ...nitro.options.handlers.map((m) => m.handler).filter((i) => typeof i === "string"),
98
+ ...nitro.options.dev || nitro.options.preset === "nitro-prerender" ? [] : runtimeDependencies
99
+ ].filter(Boolean);
85
100
  const { env } = defineEnv({
86
101
  nodeCompat: isNodeless,
87
102
  npmShims: true,
@@ -97,12 +112,8 @@ function baseBuildConfig(nitro) {
97
112
  staticFlags,
98
113
  replacements,
99
114
  env,
100
- aliases: resolveAliases({
101
- "#internal/nitro": runtimeDir,
102
- "nitro/runtime": runtimeDir,
103
- "nitropack/runtime": runtimeDir,
104
- ...env.alias
105
- })
115
+ aliases: resolveAliases({ ...env.alias }),
116
+ noExternal
106
117
  };
107
118
  }
108
119
  function resolveAliases(_aliases) {
@@ -198,7 +209,7 @@ function routing(nitro) {
198
209
  ...nitro.routing.globalMiddleware
199
210
  ], "_importHash");
200
211
  return `
201
- import * as __routeRules__ from "nitro/runtime/internal/route-rules";
212
+ import * as __routeRules__ from "nitro/~internal/runtime/route-rules";
202
213
  import * as srvxNode from "srvx/node"
203
214
  import * as h3 from "h3";
204
215
 
@@ -601,7 +612,7 @@ function rendererTemplate(nitro) {
601
612
  const html = await readFile(nitro.options.renderer?.template, "utf8");
602
613
  if (hasTemplateSyntax(html)) return `
603
614
  import { renderToResponse } from 'rendu'
604
- import { serverFetch } from 'nitro/runtime'
615
+ import { serverFetch } from 'nitro/app'
605
616
  const template = ${compileTemplateToString(html, { contextKeys: [...RENDER_CONTEXT_KEYS] })};
606
617
  export const rendererTemplate = (request) => renderToResponse(template, { request, context: { serverFetch } })
607
618
  `;
@@ -655,7 +666,7 @@ function nitroResolveIds() {
655
666
  function baseBuildPlugins(nitro, base) {
656
667
  const plugins = [];
657
668
  if (nitro.options.imports) plugins.push(unplugin.rollup(nitro.options.imports));
658
- if (nitro.options.experimental.wasm) plugins.push(rollup(nitro.options.wasm || {}));
669
+ if (nitro.options.experimental.wasm) plugins.push(unwasm(nitro.options.wasm || {}));
659
670
  plugins.push(serverMain(nitro));
660
671
  const nitroPlugins = [...new Set(nitro.options.plugins)];
661
672
  plugins.push(virtual({ "#nitro-internal-virtual/plugins": `
@@ -681,21 +692,7 @@ function baseBuildPlugins(nitro, base) {
681
692
  outDir: nitro.options.output.serverDir,
682
693
  moduleDirectories: nitro.options.nodeModulesDirs,
683
694
  external: nitro.options.nodeModulesDirs,
684
- inline: [
685
- "#",
686
- "~",
687
- "@/",
688
- "~~",
689
- "@@/",
690
- "virtual:",
691
- "nitro/runtime",
692
- dirname(nitro.options.entry),
693
- ...nitro.options.experimental.wasm ? [(id) => id?.endsWith(".wasm")] : [],
694
- runtimeDir,
695
- nitro.options.serverDir,
696
- ...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
698
- ].filter(Boolean),
695
+ inline: [...base.noExternal],
699
696
  traceOptions: {
700
697
  base: "/",
701
698
  processCwd: nitro.options.rootDir,
@@ -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,
@@ -382,7 +378,7 @@ function createNitroEnvironment(ctx) {
382
378
  }
383
379
  },
384
380
  resolve: {
385
- noExternal: ctx.nitro.options.dev ? new RegExp(runtimeDependencies.join("|")) : true,
381
+ noExternal: ctx.nitro.options.dev ? [...ctx.rollupConfig.base.noExternal, ...runtimeDependencies] : true,
386
382
  conditions: ctx.nitro.options.exportConditions,
387
383
  externalConditions: ctx.nitro.options.exportConditions
388
384
  },
@@ -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";
@@ -2314,7 +2314,7 @@ var require_main = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/dotenv@17.2.
2314
2314
  }) });
2315
2315
 
2316
2316
  //#endregion
2317
- //#region node_modules/.pnpm/c12@3.3.1_magicast@0.3.5/node_modules/c12/dist/shared/c12.8GPsgFQh.mjs
2317
+ //#region node_modules/.pnpm/c12@3.3.1/node_modules/c12/dist/shared/c12.8GPsgFQh.mjs
2318
2318
  var import_main$1 = /* @__PURE__ */ __toESM(require_main(), 1);
2319
2319
  async function setupDotenv(options) {
2320
2320
  const targetEnvironment = options.env ?? process.env;
@@ -2728,7 +2728,7 @@ async function _applyPromised(fn, _this, args) {
2728
2728
  }
2729
2729
 
2730
2730
  //#endregion
2731
- //#region node_modules/.pnpm/c12@3.3.1_magicast@0.3.5/node_modules/c12/dist/index.mjs
2731
+ //#region node_modules/.pnpm/c12@3.3.1/node_modules/c12/dist/index.mjs
2732
2732
  var import_main = /* @__PURE__ */ __toESM(require_main(), 1);
2733
2733
  const eventMap = {
2734
2734
  add: "created",
@@ -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.
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
 
3
- //#region node_modules/.pnpm/@rollup+plugin-alias@6.0.0_rollup@4.52.5/node_modules/@rollup/plugin-alias/dist/index.js
3
+ //#region node_modules/.pnpm/@rollup+plugin-alias@6.0.0_rollup@4.53.1/node_modules/@rollup/plugin-alias/dist/index.js
4
4
  function matches(pattern, importee) {
5
5
  if (pattern instanceof RegExp) return pattern.test(importee);
6
6
  if (importee.length < pattern.length) return false;
@@ -8,7 +8,7 @@ import { t as require_is_reference } from "./is-reference.mjs";
8
8
  import { existsSync, readFileSync, statSync } from "fs";
9
9
  import { basename, dirname, extname, isAbsolute, join, posix, relative, resolve, sep, win32 } from "path";
10
10
 
11
- //#region node_modules/.pnpm/@rollup+pluginutils@5.3.0_rollup@4.52.5/node_modules/@rollup/pluginutils/dist/es/index.js
11
+ //#region node_modules/.pnpm/@rollup+pluginutils@5.3.0_rollup@4.53.1/node_modules/@rollup/pluginutils/dist/es/index.js
12
12
  var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
13
13
  const extractors = {
14
14
  ArrayPattern(names, param) {
@@ -243,7 +243,7 @@ const dataToEsm = function dataToEsm$1(data, options = {}) {
243
243
  };
244
244
 
245
245
  //#endregion
246
- //#region node_modules/.pnpm/@rollup+plugin-commonjs@29.0.0_rollup@4.52.5/node_modules/@rollup/plugin-commonjs/dist/es/index.js
246
+ //#region node_modules/.pnpm/@rollup+plugin-commonjs@29.0.0_rollup@4.53.1/node_modules/@rollup/plugin-commonjs/dist/es/index.js
247
247
  var import_commondir = /* @__PURE__ */ __toESM(require_commondir(), 1);
248
248
  var import_is_reference = /* @__PURE__ */ __toESM(require_is_reference(), 1);
249
249
  var version = "29.0.0";
@@ -3,7 +3,7 @@ import { n as walk } from "./estree-walker.mjs";
3
3
  import { a as makeLegalIdentifier, n as attachScopes, r as createFilter } from "./plugin-commonjs.mjs";
4
4
  import { sep } from "path";
5
5
 
6
- //#region node_modules/.pnpm/@rollup+plugin-inject@5.0.5_rollup@4.52.5/node_modules/@rollup/plugin-inject/dist/es/index.js
6
+ //#region node_modules/.pnpm/@rollup+plugin-inject@5.0.5_rollup@4.53.1/node_modules/@rollup/plugin-inject/dist/es/index.js
7
7
  var escape = function(str) {
8
8
  return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
9
9
  };
@@ -1,6 +1,6 @@
1
1
  import { i as dataToEsm, r as createFilter } from "./plugin-commonjs.mjs";
2
2
 
3
- //#region node_modules/.pnpm/@rollup+plugin-json@6.1.0_rollup@4.52.5/node_modules/@rollup/plugin-json/dist/es/index.js
3
+ //#region node_modules/.pnpm/@rollup+plugin-json@6.1.0_rollup@4.53.1/node_modules/@rollup/plugin-json/dist/es/index.js
4
4
  function json(options) {
5
5
  if (options === void 0) options = {};
6
6
  var filter = createFilter(options.include, options.exclude);
@@ -694,7 +694,7 @@ var require_resolve = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/resolve@1
694
694
  }) });
695
695
 
696
696
  //#endregion
697
- //#region node_modules/.pnpm/@rollup+plugin-node-resolve@16.0.3_rollup@4.52.5/node_modules/@rollup/plugin-node-resolve/dist/es/index.js
697
+ //#region node_modules/.pnpm/@rollup+plugin-node-resolve@16.0.3_rollup@4.53.1/node_modules/@rollup/plugin-node-resolve/dist/es/index.js
698
698
  var import_cjs = /* @__PURE__ */ __toESM(require_cjs(), 1);
699
699
  var import_is_module = /* @__PURE__ */ __toESM(require_is_module(), 1);
700
700
  var import_resolve = /* @__PURE__ */ __toESM(require_resolve(), 1);
@@ -1,7 +1,7 @@
1
1
  import { t as MagicString } from "./magic-string.mjs";
2
2
  import { r as createFilter } from "./plugin-commonjs.mjs";
3
3
 
4
- //#region node_modules/.pnpm/@rollup+plugin-replace@6.0.3_rollup@4.52.5/node_modules/@rollup/plugin-replace/dist/es/index.js
4
+ //#region node_modules/.pnpm/@rollup+plugin-replace@6.0.3_rollup@4.53.1/node_modules/@rollup/plugin-replace/dist/es/index.js
5
5
  function escape(str) {
6
6
  return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
7
7
  }
@@ -5831,8 +5831,6 @@ function unwasm(opts) {
5831
5831
  }
5832
5832
  };
5833
5833
  }
5834
- /** @deprecated use unwasm export */
5835
- const rollup = unwasm;
5836
5834
 
5837
5835
  //#endregion
5838
- export { rollup as t };
5836
+ export { unwasm as t };
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";