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