nitro-nightly 3.0.1-20260120-020848-6786d069 → 3.0.1-20260120-133849-ca1a9dee

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 (93) hide show
  1. package/dist/_build/common.mjs +24931 -0
  2. package/dist/_build/rolldown.mjs +6 -11
  3. package/dist/_build/rollup.mjs +201 -0
  4. package/dist/_build/vite.build.mjs +1 -1
  5. package/dist/_chunks/dev.mjs +4 -6
  6. package/dist/_chunks/nitro.mjs +1183 -24
  7. package/dist/_chunks/nitro2.mjs +91 -248
  8. package/dist/_chunks/utils.mjs +254 -0
  9. package/dist/_common.mjs +45 -0
  10. package/dist/_libs/c12+giget+readdirp+chokidar.d.mts +214 -0
  11. package/dist/_libs/citty.mjs +140 -110
  12. package/dist/_libs/commondir+is-reference.mjs +1300 -0
  13. package/dist/_libs/compatx.d.mts +47 -0
  14. package/dist/_libs/confbox.mjs +2488 -70
  15. package/dist/_libs/esbuild.d.mts +20 -0
  16. package/dist/_libs/escape-string-regexp.mjs +8 -0
  17. package/dist/_libs/estree-walker.mjs +187 -0
  18. package/dist/_libs/hasown+resolve+deepmerge.mjs +1972 -0
  19. package/dist/_libs/httpxy.d.mts +79 -0
  20. package/dist/_libs/httpxy.mjs +6 -1
  21. package/dist/_libs/klona.mjs +38 -0
  22. package/dist/_libs/magic-string.d.mts +220 -0
  23. package/dist/_libs/mlly.d.mts +57 -0
  24. package/dist/_libs/nypm+giget+tinyexec.mjs +3603 -0
  25. package/dist/_libs/pkg-types.d.mts +23 -0
  26. package/dist/_libs/plugin-alias.mjs +64 -0
  27. package/dist/_libs/{plugin-alias+plugin-inject.mjs → plugin-inject.mjs} +2 -65
  28. package/dist/_libs/plugin-json.mjs +36 -0
  29. package/dist/_libs/pluginutils+plugin-commonjs.d.mts +241 -0
  30. package/dist/_libs/pluginutils.mjs +652 -0
  31. package/dist/_libs/{c12+dotenv+rc9.mjs → rc9+c12+dotenv.mjs} +105 -12
  32. package/dist/_libs/{chokidar+readdirp.mjs → readdirp+chokidar.mjs} +8 -1
  33. package/dist/_libs/remapping.mjs +117 -0
  34. package/dist/_libs/resolve-uri+gen-mapping.mjs +448 -0
  35. package/dist/_libs/rou3.d.mts +43 -0
  36. package/dist/_libs/rou3.mjs +322 -0
  37. package/dist/_libs/std-env.d.mts +4 -0
  38. package/dist/_libs/tsconfck.mjs +832 -0
  39. package/dist/_libs/ultrahtml.mjs +138 -0
  40. package/dist/_libs/{gen-mapping+remapping+resolve-uri+trace-mapping+unimport+unplugin+unplugin-utils+webpack-virtual-modules.mjs → unimport+unplugin.mjs} +228 -593
  41. package/dist/_libs/unplugin+unimport.d.mts +426 -0
  42. package/dist/_libs/unwasm.d.mts +29 -0
  43. package/dist/_presets.mjs +3 -8
  44. package/dist/builder.mjs +6 -8
  45. package/dist/cli/_chunks/build.mjs +1 -1
  46. package/dist/cli/_chunks/dev.mjs +2 -3
  47. package/dist/cli/_chunks/list.mjs +1 -1
  48. package/dist/cli/_chunks/prepare.mjs +1 -1
  49. package/dist/cli/_chunks/run.mjs +1 -1
  50. package/dist/cli/_chunks/task.mjs +16 -0
  51. package/dist/cli/index.mjs +1 -1
  52. package/dist/presets/aws-lambda/runtime/_utils.d.mts +0 -5
  53. package/dist/presets/netlify/runtime/netlify-edge.d.mts +0 -1
  54. package/dist/presets/winterjs/runtime/winterjs.d.mts +0 -1
  55. package/dist/runtime/internal/error/dev.d.mts +0 -1
  56. package/dist/runtime/internal/route-rules.d.mts +0 -4
  57. package/dist/runtime/internal/routes/openapi.d.mts +0 -1
  58. package/dist/runtime/internal/routes/scalar.d.mts +0 -1
  59. package/dist/runtime/internal/routes/swagger.d.mts +0 -1
  60. package/dist/runtime/internal/runtime-config.d.mts +0 -1
  61. package/dist/runtime/nitro.d.mts +0 -3
  62. package/dist/runtime/virtual/renderer-template.d.mts +0 -1
  63. package/dist/types/index.d.mts +25 -1394
  64. package/dist/vite.mjs +18 -641
  65. package/package.json +5 -5
  66. package/dist/_chunks/nitro3.mjs +0 -2696
  67. package/dist/_chunks/nitro4.mjs +0 -176
  68. package/dist/_chunks/nitro5.mjs +0 -733
  69. package/dist/_chunks/nitro6.mjs +0 -1458
  70. package/dist/_chunks/nitro7.mjs +0 -7561
  71. package/dist/_chunks/nitro8.mjs +0 -3524
  72. package/dist/_chunks/nitro9.mjs +0 -1729
  73. package/dist/_libs/_.mjs +0 -3
  74. package/dist/_libs/_2.mjs +0 -3
  75. package/dist/_libs/_3.mjs +0 -4
  76. package/dist/_libs/_4.mjs +0 -6
  77. package/dist/_libs/_5.mjs +0 -3
  78. package/dist/_libs/_6.mjs +0 -3
  79. package/dist/_libs/acorn+confbox+js-tokens+magic-string+mlly+pkg-types+sourcemap-codec+strip-literal+unimport.mjs +0 -8900
  80. package/dist/_libs/confbox+exsolve+pkg-types.mjs +0 -1249
  81. package/dist/_libs/confbox2.mjs +0 -786
  82. package/dist/_libs/confbox3.mjs +0 -404
  83. package/dist/_libs/confbox4.mjs +0 -3
  84. package/dist/_libs/estree-walker+unimport.mjs +0 -378
  85. package/dist/_libs/fdir+picomatch+tinyglobby.mjs +0 -2471
  86. package/dist/_libs/giget+node-fetch-native.mjs +0 -2692
  87. package/dist/_libs/local-pkg+quansync+unimport.mjs +0 -1526
  88. package/dist/_libs/nypm+tinyexec.mjs +0 -858
  89. package/dist/_libs/pathe.mjs +0 -164
  90. package/dist/_libs/perfect-debounce.mjs +0 -89
  91. package/dist/_libs/std-env.mjs +0 -158
  92. package/dist/_libs/unimport.mjs +0 -9
  93. package/dist/_libs/vite-plugin-fullstack.mjs +0 -26
@@ -1,176 +0,0 @@
1
- import { l as relative, n as dirname, u as resolve } from "../_libs/pathe.mjs";
2
- import consola$1 from "consola";
3
- import { mkdir, stat, writeFile } from "node:fs/promises";
4
- import { colors } from "consola/utils";
5
-
6
- //#region node_modules/.pnpm/dot-prop@10.1.0/node_modules/dot-prop/index.js
7
- const isObject = (value) => {
8
- const type = typeof value;
9
- return value !== null && (type === "object" || type === "function");
10
- };
11
- const disallowedKeys = new Set([
12
- "__proto__",
13
- "prototype",
14
- "constructor"
15
- ]);
16
- const MAX_ARRAY_INDEX = 1e6;
17
- const isDigit = (character) => character >= "0" && character <= "9";
18
- function shouldCoerceToNumber(segment) {
19
- if (segment === "0") return true;
20
- if (/^[1-9]\d*$/.test(segment)) {
21
- const parsedNumber = Number.parseInt(segment, 10);
22
- return parsedNumber <= Number.MAX_SAFE_INTEGER && parsedNumber <= MAX_ARRAY_INDEX;
23
- }
24
- return false;
25
- }
26
- function processSegment(segment, parts) {
27
- if (disallowedKeys.has(segment)) return false;
28
- if (segment && shouldCoerceToNumber(segment)) parts.push(Number.parseInt(segment, 10));
29
- else parts.push(segment);
30
- return true;
31
- }
32
- function parsePath(path) {
33
- if (typeof path !== "string") throw new TypeError(`Expected a string, got ${typeof path}`);
34
- const parts = [];
35
- let currentSegment = "";
36
- let currentPart = "start";
37
- let isEscaping = false;
38
- let position = 0;
39
- for (const character of path) {
40
- position++;
41
- if (isEscaping) {
42
- currentSegment += character;
43
- isEscaping = false;
44
- continue;
45
- }
46
- if (character === "\\") {
47
- if (currentPart === "index") throw new Error(`Invalid character '${character}' in an index at position ${position}`);
48
- if (currentPart === "indexEnd") throw new Error(`Invalid character '${character}' after an index at position ${position}`);
49
- isEscaping = true;
50
- currentPart = currentPart === "start" ? "property" : currentPart;
51
- continue;
52
- }
53
- switch (character) {
54
- case ".":
55
- if (currentPart === "index") throw new Error(`Invalid character '${character}' in an index at position ${position}`);
56
- if (currentPart === "indexEnd") {
57
- currentPart = "property";
58
- break;
59
- }
60
- if (!processSegment(currentSegment, parts)) return [];
61
- currentSegment = "";
62
- currentPart = "property";
63
- break;
64
- case "[":
65
- if (currentPart === "index") throw new Error(`Invalid character '${character}' in an index at position ${position}`);
66
- if (currentPart === "indexEnd") {
67
- currentPart = "index";
68
- break;
69
- }
70
- if (currentPart === "property" || currentPart === "start") {
71
- if ((currentSegment || currentPart === "property") && !processSegment(currentSegment, parts)) return [];
72
- currentSegment = "";
73
- }
74
- currentPart = "index";
75
- break;
76
- case "]":
77
- if (currentPart === "index") {
78
- if (currentSegment === "") {
79
- currentSegment = (parts.pop() || "") + "[]";
80
- currentPart = "property";
81
- } else {
82
- const parsedNumber = Number.parseInt(currentSegment, 10);
83
- if (!Number.isNaN(parsedNumber) && Number.isFinite(parsedNumber) && parsedNumber >= 0 && parsedNumber <= Number.MAX_SAFE_INTEGER && parsedNumber <= MAX_ARRAY_INDEX && currentSegment === String(parsedNumber)) parts.push(parsedNumber);
84
- else parts.push(currentSegment);
85
- currentSegment = "";
86
- currentPart = "indexEnd";
87
- }
88
- break;
89
- }
90
- if (currentPart === "indexEnd") throw new Error(`Invalid character '${character}' after an index at position ${position}`);
91
- currentSegment += character;
92
- break;
93
- default:
94
- if (currentPart === "index" && !isDigit(character)) throw new Error(`Invalid character '${character}' in an index at position ${position}`);
95
- if (currentPart === "indexEnd") throw new Error(`Invalid character '${character}' after an index at position ${position}`);
96
- if (currentPart === "start") currentPart = "property";
97
- currentSegment += character;
98
- }
99
- }
100
- if (isEscaping) currentSegment += "\\";
101
- switch (currentPart) {
102
- case "property":
103
- if (!processSegment(currentSegment, parts)) return [];
104
- break;
105
- case "index": throw new Error("Index was not closed");
106
- case "start":
107
- parts.push("");
108
- break;
109
- }
110
- return parts;
111
- }
112
- function normalizePath(path) {
113
- if (typeof path === "string") return parsePath(path);
114
- if (Array.isArray(path)) {
115
- const normalized = [];
116
- for (const [index, segment] of path.entries()) {
117
- if (typeof segment !== "string" && typeof segment !== "number") throw new TypeError(`Expected a string or number for path segment at index ${index}, got ${typeof segment}`);
118
- if (typeof segment === "number" && !Number.isFinite(segment)) throw new TypeError(`Path segment at index ${index} must be a finite number, got ${segment}`);
119
- if (disallowedKeys.has(segment)) return [];
120
- if (typeof segment === "string" && shouldCoerceToNumber(segment)) normalized.push(Number.parseInt(segment, 10));
121
- else normalized.push(segment);
122
- }
123
- return normalized;
124
- }
125
- return [];
126
- }
127
- function getProperty(object, path, value) {
128
- if (!isObject(object) || typeof path !== "string" && !Array.isArray(path)) return value === void 0 ? object : value;
129
- const pathArray = normalizePath(path);
130
- if (pathArray.length === 0) return value;
131
- for (let index = 0; index < pathArray.length; index++) {
132
- const key = pathArray[index];
133
- object = object[key];
134
- if (object === void 0 || object === null) {
135
- if (index !== pathArray.length - 1) return value;
136
- break;
137
- }
138
- }
139
- return object === void 0 ? value : object;
140
- }
141
-
142
- //#endregion
143
- //#region src/utils/fs.ts
144
- function prettyPath(p, highlight = true) {
145
- p = relative(process.cwd(), p);
146
- return highlight ? colors.cyan(p) : p;
147
- }
148
- function resolveNitroPath(path, nitroOptions, base) {
149
- if (typeof path !== "string") throw new TypeError("Invalid path: " + path);
150
- path = _compilePathTemplate(path)(nitroOptions);
151
- for (const base$1 in nitroOptions.alias) if (path.startsWith(base$1)) path = nitroOptions.alias[base$1] + path.slice(base$1.length);
152
- if (/^[#\u0000]/.test(path)) return path;
153
- return resolve(base || nitroOptions.rootDir, path);
154
- }
155
- function _compilePathTemplate(contents) {
156
- return (params) => contents.replace(/{{ ?([\w.]+) ?}}/g, (_, match) => {
157
- const val = getProperty(params, match);
158
- if (!val) consola$1.warn(`cannot resolve template param '${match}' in ${contents.slice(0, 20)}`);
159
- return val || `${match}`;
160
- });
161
- }
162
- async function writeFile$1(file, contents, log = false) {
163
- await mkdir(dirname(file), { recursive: true });
164
- await writeFile(file, contents, typeof contents === "string" ? "utf8" : void 0);
165
- if (log) consola$1.info("Generated", prettyPath(file));
166
- }
167
- async function isDirectory(path) {
168
- try {
169
- return (await stat(path)).isDirectory();
170
- } catch {
171
- return false;
172
- }
173
- }
174
-
175
- //#endregion
176
- export { writeFile$1 as i, prettyPath as n, resolveNitroPath as r, isDirectory as t };