nitro-nightly 3.0.1-20260120-020848-6786d069 → 3.0.1-20260120-133205-cbfce96c

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 (92) 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/@hiogawa/vite-plugin-fullstack.mjs +652 -0
  11. package/dist/_libs/@jridgewell/gen-mapping.mjs +448 -0
  12. package/dist/_libs/@jridgewell/remapping.mjs +117 -0
  13. package/dist/_libs/@rollup/plugin-alias.mjs +64 -0
  14. package/dist/_libs/@rollup/plugin-commonjs.d.mts +241 -0
  15. package/dist/_libs/@rollup/plugin-commonjs.mjs +1300 -0
  16. package/dist/_libs/{plugin-alias+plugin-inject.mjs → @rollup/plugin-inject.mjs} +2 -65
  17. package/dist/_libs/@rollup/plugin-json.mjs +36 -0
  18. package/dist/_libs/@rollup/plugin-node-resolve.mjs +1972 -0
  19. package/dist/_libs/c12.d.mts +214 -0
  20. package/dist/_libs/{c12+dotenv+rc9.mjs → c12.mjs} +105 -12
  21. package/dist/_libs/{chokidar+readdirp.mjs → chokidar.mjs} +8 -1
  22. package/dist/_libs/compatx.d.mts +47 -0
  23. package/dist/_libs/confbox.mjs +2488 -70
  24. package/dist/_libs/esbuild.d.mts +20 -0
  25. package/dist/_libs/escape-string-regexp.mjs +8 -0
  26. package/dist/_libs/estree-walker.mjs +187 -0
  27. package/dist/_libs/giget.mjs +3550 -0
  28. package/dist/_libs/httpxy.d.mts +79 -0
  29. package/dist/_libs/httpxy.mjs +6 -1
  30. package/dist/_libs/klona.mjs +38 -0
  31. package/dist/_libs/magic-string.d.mts +220 -0
  32. package/dist/_libs/mlly.d.mts +57 -0
  33. package/dist/_libs/pkg-types.d.mts +23 -0
  34. package/dist/_libs/rou3.d.mts +43 -0
  35. package/dist/_libs/rou3.mjs +322 -0
  36. package/dist/_libs/std-env.d.mts +4 -0
  37. package/dist/_libs/tsconfck.mjs +832 -0
  38. package/dist/_libs/ultrahtml.mjs +138 -0
  39. package/dist/_libs/unimport.d.mts +426 -0
  40. package/dist/_libs/unimport.mjs +1781 -5
  41. package/dist/_libs/unwasm.d.mts +29 -0
  42. package/dist/_presets.mjs +3 -8
  43. package/dist/builder.mjs +6 -8
  44. package/dist/cli/_chunks/build.mjs +1 -1
  45. package/dist/cli/_chunks/dev.mjs +2 -3
  46. package/dist/cli/_chunks/list.mjs +1 -1
  47. package/dist/cli/_chunks/prepare.mjs +1 -1
  48. package/dist/cli/_chunks/run.mjs +1 -1
  49. package/dist/cli/_chunks/task.mjs +16 -0
  50. package/dist/cli/index.mjs +1 -1
  51. package/dist/presets/aws-lambda/runtime/_utils.d.mts +0 -5
  52. package/dist/presets/netlify/runtime/netlify-edge.d.mts +0 -1
  53. package/dist/presets/winterjs/runtime/winterjs.d.mts +0 -1
  54. package/dist/runtime/internal/error/dev.d.mts +0 -1
  55. package/dist/runtime/internal/route-rules.d.mts +0 -4
  56. package/dist/runtime/internal/routes/openapi.d.mts +0 -1
  57. package/dist/runtime/internal/routes/scalar.d.mts +0 -1
  58. package/dist/runtime/internal/routes/swagger.d.mts +0 -1
  59. package/dist/runtime/internal/runtime-config.d.mts +0 -1
  60. package/dist/runtime/nitro.d.mts +0 -3
  61. package/dist/runtime/virtual/renderer-template.d.mts +0 -1
  62. package/dist/types/index.d.mts +36 -1405
  63. package/dist/vite.mjs +18 -641
  64. package/package.json +2 -2
  65. package/dist/_chunks/nitro3.mjs +0 -2696
  66. package/dist/_chunks/nitro4.mjs +0 -176
  67. package/dist/_chunks/nitro5.mjs +0 -733
  68. package/dist/_chunks/nitro6.mjs +0 -1458
  69. package/dist/_chunks/nitro7.mjs +0 -7561
  70. package/dist/_chunks/nitro8.mjs +0 -3524
  71. package/dist/_chunks/nitro9.mjs +0 -1729
  72. package/dist/_libs/_.mjs +0 -3
  73. package/dist/_libs/_2.mjs +0 -3
  74. package/dist/_libs/_3.mjs +0 -4
  75. package/dist/_libs/_4.mjs +0 -6
  76. package/dist/_libs/_5.mjs +0 -3
  77. package/dist/_libs/_6.mjs +0 -3
  78. package/dist/_libs/acorn+confbox+js-tokens+magic-string+mlly+pkg-types+sourcemap-codec+strip-literal+unimport.mjs +0 -8900
  79. package/dist/_libs/confbox+exsolve+pkg-types.mjs +0 -1249
  80. package/dist/_libs/confbox2.mjs +0 -786
  81. package/dist/_libs/confbox3.mjs +0 -404
  82. package/dist/_libs/confbox4.mjs +0 -3
  83. package/dist/_libs/estree-walker+unimport.mjs +0 -378
  84. package/dist/_libs/fdir+picomatch+tinyglobby.mjs +0 -2471
  85. package/dist/_libs/gen-mapping+remapping+resolve-uri+trace-mapping+unimport+unplugin+unplugin-utils+webpack-virtual-modules.mjs +0 -2150
  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/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 };