nitro-nightly 3.0.1-20260119-145349-d0c4950f → 3.0.1-20260120-020848-6786d069

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 (70) hide show
  1. package/dist/_build/rolldown.mjs +13 -8
  2. package/dist/_build/vite.build.mjs +1 -1
  3. package/dist/_chunks/dev.mjs +5 -3
  4. package/dist/_chunks/nitro.mjs +24 -1183
  5. package/dist/_chunks/nitro2.mjs +248 -91
  6. package/dist/_chunks/nitro3.mjs +2696 -0
  7. package/dist/_chunks/nitro4.mjs +176 -0
  8. package/dist/_chunks/nitro5.mjs +733 -0
  9. package/dist/_chunks/nitro6.mjs +1458 -0
  10. package/dist/_chunks/nitro7.mjs +7561 -0
  11. package/dist/_chunks/nitro8.mjs +3524 -0
  12. package/dist/_chunks/nitro9.mjs +1729 -0
  13. package/dist/_libs/_.mjs +3 -0
  14. package/dist/_libs/_2.mjs +3 -0
  15. package/dist/_libs/_3.mjs +4 -0
  16. package/dist/_libs/_4.mjs +6 -0
  17. package/dist/_libs/_5.mjs +3 -0
  18. package/dist/_libs/_6.mjs +3 -0
  19. package/dist/_libs/acorn+confbox+js-tokens+magic-string+mlly+pkg-types+sourcemap-codec+strip-literal+unimport.mjs +8900 -0
  20. package/dist/_libs/{c12.mjs → c12+dotenv+rc9.mjs} +12 -105
  21. package/dist/_libs/{chokidar.mjs → chokidar+readdirp.mjs} +2 -9
  22. package/dist/_libs/confbox+exsolve+pkg-types.mjs +1249 -0
  23. package/dist/_libs/confbox.mjs +70 -2488
  24. package/dist/_libs/confbox2.mjs +786 -0
  25. package/dist/_libs/confbox3.mjs +404 -0
  26. package/dist/_libs/confbox4.mjs +3 -0
  27. package/dist/_libs/estree-walker+unimport.mjs +378 -0
  28. package/dist/_libs/fdir+picomatch+tinyglobby.mjs +2471 -0
  29. package/dist/_libs/gen-mapping+remapping+resolve-uri+trace-mapping+unimport+unplugin+unplugin-utils+webpack-virtual-modules.mjs +2150 -0
  30. package/dist/_libs/giget+node-fetch-native.mjs +2692 -0
  31. package/dist/_libs/httpxy.mjs +1 -6
  32. package/dist/_libs/local-pkg+quansync+unimport.mjs +1526 -0
  33. package/dist/_libs/nypm+tinyexec.mjs +858 -0
  34. package/dist/_libs/pathe.mjs +164 -0
  35. package/dist/_libs/perfect-debounce.mjs +89 -0
  36. package/dist/_libs/{@rollup/plugin-inject.mjs → plugin-alias+plugin-inject.mjs} +65 -2
  37. package/dist/_libs/std-env.mjs +158 -0
  38. package/dist/_libs/unimport.mjs +5 -1781
  39. package/dist/_libs/vite-plugin-fullstack.mjs +26 -0
  40. package/dist/_presets.mjs +8 -3
  41. package/dist/builder.mjs +8 -6
  42. package/dist/cli/_chunks/build.mjs +1 -1
  43. package/dist/cli/_chunks/dev.mjs +3 -2
  44. package/dist/cli/_chunks/list.mjs +1 -1
  45. package/dist/cli/_chunks/prepare.mjs +1 -1
  46. package/dist/cli/_chunks/run.mjs +1 -1
  47. package/dist/cli/index.mjs +1 -1
  48. package/dist/types/index.d.mts +2410 -1174
  49. package/dist/vite.d.mts +13 -13
  50. package/dist/vite.mjs +640 -16
  51. package/package.json +9 -9
  52. package/dist/_build/common.mjs +0 -24931
  53. package/dist/_build/rollup.mjs +0 -201
  54. package/dist/_chunks/utils.mjs +0 -254
  55. package/dist/_common.mjs +0 -45
  56. package/dist/_libs/@hiogawa/vite-plugin-fullstack.mjs +0 -652
  57. package/dist/_libs/@jridgewell/gen-mapping.mjs +0 -448
  58. package/dist/_libs/@jridgewell/remapping.mjs +0 -117
  59. package/dist/_libs/@rollup/plugin-alias.mjs +0 -64
  60. package/dist/_libs/@rollup/plugin-commonjs.mjs +0 -1300
  61. package/dist/_libs/@rollup/plugin-json.mjs +0 -36
  62. package/dist/_libs/@rollup/plugin-node-resolve.mjs +0 -1972
  63. package/dist/_libs/escape-string-regexp.mjs +0 -8
  64. package/dist/_libs/estree-walker.mjs +0 -187
  65. package/dist/_libs/giget.mjs +0 -3550
  66. package/dist/_libs/klona.mjs +0 -38
  67. package/dist/_libs/rou3.mjs +0 -322
  68. package/dist/_libs/tsconfck.mjs +0 -832
  69. package/dist/_libs/ultrahtml.mjs +0 -138
  70. package/dist/cli/_chunks/task.mjs +0 -16
@@ -0,0 +1,176 @@
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 };