nitro-nightly 3.0.1-20260106-182834-5019d347 → 3.0.1-20260106-205209-b085a480

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 (85) hide show
  1. package/dist/_build/common.mjs +24899 -0
  2. package/dist/_build/rolldown.mjs +5 -18
  3. package/dist/_build/rollup.mjs +5 -52
  4. package/dist/_build/vite.build.mjs +2 -21
  5. package/dist/{_dev.mjs → _chunks/dev.mjs} +4 -7
  6. package/dist/{_nitro.mjs → _chunks/nitro.mjs} +16 -195
  7. package/dist/_chunks/nitro2.mjs +101 -0
  8. package/dist/_chunks/utils.mjs +278 -0
  9. package/dist/_libs/@hiogawa/vite-plugin-fullstack.mjs +32 -4
  10. package/dist/_libs/@jridgewell/gen-mapping.mjs +304 -2
  11. package/dist/_libs/@jridgewell/remapping.mjs +1 -2
  12. package/dist/_libs/@rollup/plugin-commonjs.mjs +75 -31
  13. package/dist/_libs/@rollup/plugin-inject.mjs +1 -3
  14. package/dist/_libs/@rollup/plugin-json.mjs +1 -1
  15. package/dist/_libs/@rollup/plugin-node-resolve.mjs +1111 -7
  16. package/dist/_libs/c12.mjs +597 -41
  17. package/dist/_libs/chokidar.mjs +235 -2
  18. package/dist/_libs/confbox.mjs +454 -1476
  19. package/dist/_libs/estree-walker.mjs +1 -144
  20. package/dist/_libs/giget.mjs +2235 -1377
  21. package/dist/_libs/httpxy.mjs +1 -1
  22. package/dist/_libs/unimport.mjs +1547 -1772
  23. package/dist/_presets.mjs +3 -9
  24. package/dist/builder.mjs +7 -12
  25. package/dist/cli/_chunks/build.mjs +1 -1
  26. package/dist/cli/_chunks/dev.mjs +3 -5
  27. package/dist/cli/_chunks/list.mjs +1 -1
  28. package/dist/cli/_chunks/prepare.mjs +1 -1
  29. package/dist/cli/_chunks/run.mjs +1 -1
  30. package/dist/types/index.d.mts +4 -4
  31. package/dist/vite.mjs +14 -1128
  32. package/package.json +2 -2
  33. package/dist/_build/shared.mjs +0 -60
  34. package/dist/_build/shared2.mjs +0 -40
  35. package/dist/_build/shared3.mjs +0 -68
  36. package/dist/_libs/@jridgewell/resolve-uri.mjs +0 -166
  37. package/dist/_libs/@jridgewell/sourcemap-codec.mjs +0 -167
  38. package/dist/_libs/@jridgewell/trace-mapping.mjs +0 -141
  39. package/dist/_libs/@rolldown/pluginutils.mjs +0 -31
  40. package/dist/_libs/@rollup/plugin-replace.mjs +0 -104
  41. package/dist/_libs/@rollup/pluginutils.mjs +0 -241
  42. package/dist/_libs/acorn.mjs +0 -5034
  43. package/dist/_libs/commondir.mjs +0 -22
  44. package/dist/_libs/deepmerge.mjs +0 -86
  45. package/dist/_libs/dot-prop.mjs +0 -138
  46. package/dist/_libs/dotenv.mjs +0 -345
  47. package/dist/_libs/duplexer.mjs +0 -71
  48. package/dist/_libs/etag.mjs +0 -80
  49. package/dist/_libs/exsolve.mjs +0 -1007
  50. package/dist/_libs/fdir.mjs +0 -514
  51. package/dist/_libs/function-bind.mjs +0 -63
  52. package/dist/_libs/gzip-size.mjs +0 -21
  53. package/dist/_libs/hasown.mjs +0 -14
  54. package/dist/_libs/is-core-module.mjs +0 -220
  55. package/dist/_libs/is-module.mjs +0 -13
  56. package/dist/_libs/is-reference.mjs +0 -33
  57. package/dist/_libs/js-tokens.mjs +0 -382
  58. package/dist/_libs/knitwork.mjs +0 -124
  59. package/dist/_libs/local-pkg.mjs +0 -125
  60. package/dist/_libs/magic-string.mjs +0 -939
  61. package/dist/_libs/mime.mjs +0 -1391
  62. package/dist/_libs/mlly.mjs +0 -1415
  63. package/dist/_libs/node-fetch-native.mjs +0 -7
  64. package/dist/_libs/nypm.mjs +0 -239
  65. package/dist/_libs/path-parse.mjs +0 -47
  66. package/dist/_libs/pathe.mjs +0 -202
  67. package/dist/_libs/perfect-debounce.mjs +0 -89
  68. package/dist/_libs/picomatch.mjs +0 -1673
  69. package/dist/_libs/pkg-types.mjs +0 -197
  70. package/dist/_libs/pretty-bytes.mjs +0 -116
  71. package/dist/_libs/quansync.mjs +0 -90
  72. package/dist/_libs/rc9.mjs +0 -136
  73. package/dist/_libs/readdirp.mjs +0 -237
  74. package/dist/_libs/resolve.mjs +0 -689
  75. package/dist/_libs/std-env.mjs +0 -158
  76. package/dist/_libs/strip-literal.mjs +0 -51
  77. package/dist/_libs/tinyexec.mjs +0 -627
  78. package/dist/_libs/tinyglobby.mjs +0 -292
  79. package/dist/_libs/unplugin-utils.mjs +0 -61
  80. package/dist/_libs/unplugin.mjs +0 -1225
  81. package/dist/_libs/untyped.mjs +0 -271
  82. package/dist/_libs/unwasm.mjs +0 -5895
  83. package/dist/_libs/webpack-virtual-modules.mjs +0 -272
  84. package/dist/_nitro2.mjs +0 -303
  85. /package/dist/{_rolldown.mjs → _common.mjs} +0 -0
@@ -1,11 +1,244 @@
1
- import { n as __exportAll } from "../_rolldown.mjs";
2
- import { t as readdirp } from "./readdirp.mjs";
1
+ import { n as __exportAll } from "../_common.mjs";
3
2
  import { stat, unwatchFile, watch, watchFile } from "node:fs";
4
3
  import { lstat, open, readdir, realpath, stat as stat$1 } from "node:fs/promises";
5
4
  import { type } from "node:os";
6
5
  import * as sp from "node:path";
6
+ import { join, relative, resolve, sep } from "node:path";
7
7
  import { EventEmitter } from "node:events";
8
+ import { Readable } from "node:stream";
8
9
 
10
+ //#region node_modules/.pnpm/readdirp@5.0.0/node_modules/readdirp/index.js
11
+ const EntryTypes = {
12
+ FILE_TYPE: "files",
13
+ DIR_TYPE: "directories",
14
+ FILE_DIR_TYPE: "files_directories",
15
+ EVERYTHING_TYPE: "all"
16
+ };
17
+ const defaultOptions = {
18
+ root: ".",
19
+ fileFilter: (_entryInfo) => true,
20
+ directoryFilter: (_entryInfo) => true,
21
+ type: EntryTypes.FILE_TYPE,
22
+ lstat: false,
23
+ depth: 2147483648,
24
+ alwaysStat: false,
25
+ highWaterMark: 4096
26
+ };
27
+ Object.freeze(defaultOptions);
28
+ const RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
29
+ const NORMAL_FLOW_ERRORS = new Set([
30
+ "ENOENT",
31
+ "EPERM",
32
+ "EACCES",
33
+ "ELOOP",
34
+ RECURSIVE_ERROR_CODE
35
+ ]);
36
+ const ALL_TYPES = [
37
+ EntryTypes.DIR_TYPE,
38
+ EntryTypes.EVERYTHING_TYPE,
39
+ EntryTypes.FILE_DIR_TYPE,
40
+ EntryTypes.FILE_TYPE
41
+ ];
42
+ const DIR_TYPES = new Set([
43
+ EntryTypes.DIR_TYPE,
44
+ EntryTypes.EVERYTHING_TYPE,
45
+ EntryTypes.FILE_DIR_TYPE
46
+ ]);
47
+ const FILE_TYPES = new Set([
48
+ EntryTypes.EVERYTHING_TYPE,
49
+ EntryTypes.FILE_DIR_TYPE,
50
+ EntryTypes.FILE_TYPE
51
+ ]);
52
+ const isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code);
53
+ const wantBigintFsStats = process.platform === "win32";
54
+ const emptyFn = (_entryInfo) => true;
55
+ const normalizeFilter = (filter) => {
56
+ if (filter === void 0) return emptyFn;
57
+ if (typeof filter === "function") return filter;
58
+ if (typeof filter === "string") {
59
+ const fl = filter.trim();
60
+ return (entry) => entry.basename === fl;
61
+ }
62
+ if (Array.isArray(filter)) {
63
+ const trItems = filter.map((item) => item.trim());
64
+ return (entry) => trItems.some((f) => entry.basename === f);
65
+ }
66
+ return emptyFn;
67
+ };
68
+ /** Readable readdir stream, emitting new files as they're being listed. */
69
+ var ReaddirpStream = class extends Readable {
70
+ parents;
71
+ reading;
72
+ parent;
73
+ _stat;
74
+ _maxDepth;
75
+ _wantsDir;
76
+ _wantsFile;
77
+ _wantsEverything;
78
+ _root;
79
+ _isDirent;
80
+ _statsProp;
81
+ _rdOptions;
82
+ _fileFilter;
83
+ _directoryFilter;
84
+ constructor(options = {}) {
85
+ super({
86
+ objectMode: true,
87
+ autoDestroy: true,
88
+ highWaterMark: options.highWaterMark
89
+ });
90
+ const opts = {
91
+ ...defaultOptions,
92
+ ...options
93
+ };
94
+ const { root, type: type$1 } = opts;
95
+ this._fileFilter = normalizeFilter(opts.fileFilter);
96
+ this._directoryFilter = normalizeFilter(opts.directoryFilter);
97
+ const statMethod = opts.lstat ? lstat : stat$1;
98
+ if (wantBigintFsStats) this._stat = (path$1) => statMethod(path$1, { bigint: true });
99
+ else this._stat = statMethod;
100
+ this._maxDepth = opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth;
101
+ this._wantsDir = type$1 ? DIR_TYPES.has(type$1) : false;
102
+ this._wantsFile = type$1 ? FILE_TYPES.has(type$1) : false;
103
+ this._wantsEverything = type$1 === EntryTypes.EVERYTHING_TYPE;
104
+ this._root = resolve(root);
105
+ this._isDirent = !opts.alwaysStat;
106
+ this._statsProp = this._isDirent ? "dirent" : "stats";
107
+ this._rdOptions = {
108
+ encoding: "utf8",
109
+ withFileTypes: this._isDirent
110
+ };
111
+ this.parents = [this._exploreDir(root, 1)];
112
+ this.reading = false;
113
+ this.parent = void 0;
114
+ }
115
+ async _read(batch) {
116
+ if (this.reading) return;
117
+ this.reading = true;
118
+ try {
119
+ while (!this.destroyed && batch > 0) {
120
+ const par = this.parent;
121
+ const fil = par && par.files;
122
+ if (fil && fil.length > 0) {
123
+ const { path: path$1, depth } = par;
124
+ const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path$1));
125
+ const awaited = await Promise.all(slice);
126
+ for (const entry of awaited) {
127
+ if (!entry) continue;
128
+ if (this.destroyed) return;
129
+ const entryType = await this._getEntryType(entry);
130
+ if (entryType === "directory" && this._directoryFilter(entry)) {
131
+ if (depth <= this._maxDepth) this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
132
+ if (this._wantsDir) {
133
+ this.push(entry);
134
+ batch--;
135
+ }
136
+ } else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
137
+ if (this._wantsFile) {
138
+ this.push(entry);
139
+ batch--;
140
+ }
141
+ }
142
+ }
143
+ } else {
144
+ const parent = this.parents.pop();
145
+ if (!parent) {
146
+ this.push(null);
147
+ break;
148
+ }
149
+ this.parent = await parent;
150
+ if (this.destroyed) return;
151
+ }
152
+ }
153
+ } catch (error) {
154
+ this.destroy(error);
155
+ } finally {
156
+ this.reading = false;
157
+ }
158
+ }
159
+ async _exploreDir(path$1, depth) {
160
+ let files;
161
+ try {
162
+ files = await readdir(path$1, this._rdOptions);
163
+ } catch (error) {
164
+ this._onError(error);
165
+ }
166
+ return {
167
+ files,
168
+ depth,
169
+ path: path$1
170
+ };
171
+ }
172
+ async _formatEntry(dirent, path$1) {
173
+ let entry;
174
+ const basename$1 = this._isDirent ? dirent.name : dirent;
175
+ try {
176
+ const fullPath = resolve(join(path$1, basename$1));
177
+ entry = {
178
+ path: relative(this._root, fullPath),
179
+ fullPath,
180
+ basename: basename$1
181
+ };
182
+ entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
183
+ } catch (err) {
184
+ this._onError(err);
185
+ return;
186
+ }
187
+ return entry;
188
+ }
189
+ _onError(err) {
190
+ if (isNormalFlowError(err) && !this.destroyed) this.emit("warn", err);
191
+ else this.destroy(err);
192
+ }
193
+ async _getEntryType(entry) {
194
+ if (!entry && this._statsProp in entry) return "";
195
+ const stats = entry[this._statsProp];
196
+ if (stats.isFile()) return "file";
197
+ if (stats.isDirectory()) return "directory";
198
+ if (stats && stats.isSymbolicLink()) {
199
+ const full = entry.fullPath;
200
+ try {
201
+ const entryRealPath = await realpath(full);
202
+ const entryRealPathStats = await lstat(entryRealPath);
203
+ if (entryRealPathStats.isFile()) return "file";
204
+ if (entryRealPathStats.isDirectory()) {
205
+ const len = entryRealPath.length;
206
+ if (full.startsWith(entryRealPath) && full.substr(len, 1) === sep) {
207
+ const recursiveError = /* @__PURE__ */ new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
208
+ recursiveError.code = RECURSIVE_ERROR_CODE;
209
+ return this._onError(recursiveError);
210
+ }
211
+ return "directory";
212
+ }
213
+ } catch (error) {
214
+ this._onError(error);
215
+ return "";
216
+ }
217
+ }
218
+ }
219
+ _includeAsFile(entry) {
220
+ const stats = entry && entry[this._statsProp];
221
+ return stats && this._wantsEverything && !stats.isDirectory();
222
+ }
223
+ };
224
+ /**
225
+ * Streaming version: Reads all files and directories in given root recursively.
226
+ * Consumes ~constant small amount of RAM.
227
+ * @param root Root directory
228
+ * @param options Options to specify root (start directory), filters and recursion depth
229
+ */
230
+ function readdirp(root, options = {}) {
231
+ let type$1 = options.entryType || options.type;
232
+ if (type$1 === "both") type$1 = EntryTypes.FILE_DIR_TYPE;
233
+ if (type$1) options.type = type$1;
234
+ if (!root) throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
235
+ else if (typeof root !== "string") throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
236
+ else if (type$1 && !ALL_TYPES.includes(type$1)) throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
237
+ options.root = root;
238
+ return new ReaddirpStream(options);
239
+ }
240
+
241
+ //#endregion
9
242
  //#region node_modules/.pnpm/chokidar@5.0.0/node_modules/chokidar/handler.js
10
243
  const STR_DATA = "data";
11
244
  const STR_END = "end";