@vixt/react 0.9.0 → 0.11.0
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/client/client.d.ts +17 -0
- package/dist/client/entry.d.ts +2 -5
- package/dist/client/entry.js +2 -5
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +2 -0
- package/dist/node/chunk-e9Ob2GDo.mjs +26 -0
- package/dist/node/components-DgaASyfT.mjs +10683 -0
- package/dist/node/detect-acorn-Du_gcr4-.mjs +370 -0
- package/dist/{index.mjs → node/dist-OcbwbyG4.mjs} +456 -2356
- package/dist/node/index.d.mts +9 -0
- package/dist/node/index.mjs +38 -0
- package/dist/node/lib-ByhivYXf.mjs +1930 -0
- package/dist/node/modules/components.d.mts +10 -0
- package/dist/node/modules/components.mjs +2 -0
- package/dist/node/modules/preset-react.d.mts +7 -0
- package/dist/node/modules/preset-react.mjs +2 -0
- package/dist/node/modules/route-block.d.mts +13 -0
- package/dist/node/modules/route-block.mjs +38 -0
- package/dist/node/modules/virtual-root-component.d.mts +7 -0
- package/dist/node/modules/virtual-root-component.mjs +51 -0
- package/dist/node/modules/virtual-setup-layouts.d.mts +6 -0
- package/dist/node/modules/virtual-setup-layouts.mjs +41 -0
- package/dist/node/node.d.mts +18 -0
- package/dist/node/preset-react-DWJpAlWQ.mjs +65 -0
- package/dist/types/index.d.ts +2 -2
- package/package.json +12 -13
- package/dist/index.d.mts +0 -7
- package/dist/types/client.d.ts +0 -12
- package/dist/types/node.d.ts +0 -20
|
@@ -1,1979 +1,12 @@
|
|
|
1
|
-
import { builtinModules
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { URL as URL$1, fileURLToPath, pathToFileURL } from "node:url";
|
|
1
|
+
import { builtinModules } from "node:module";
|
|
2
|
+
import fs, { promises, realpathSync, statSync } from "node:fs";
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
4
|
import assert from "node:assert";
|
|
6
|
-
import process$1
|
|
5
|
+
import process$1 from "node:process";
|
|
7
6
|
import path from "node:path";
|
|
8
7
|
import v8 from "node:v8";
|
|
9
8
|
import { format, inspect } from "node:util";
|
|
10
|
-
|
|
11
|
-
import UnoCSS from "unocss/vite";
|
|
12
|
-
import AutoImport from "unplugin-auto-import/vite";
|
|
13
|
-
import Pages from "vite-plugin-pages";
|
|
14
|
-
import Layouts from "vite-plugin-vue-layouts";
|
|
15
|
-
import fg from "fast-glob";
|
|
16
|
-
import { pascalCase } from "unplugin-vue-components";
|
|
17
|
-
import extractComments from "extract-comments";
|
|
18
|
-
import { parse } from "yaml";
|
|
19
|
-
import { parseAst } from "vite";
|
|
20
|
-
|
|
21
|
-
//#region \0rolldown/runtime.js
|
|
22
|
-
var __create = Object.create;
|
|
23
|
-
var __defProp = Object.defineProperty;
|
|
24
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
25
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
26
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
27
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
28
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
29
|
-
var __copyProps = (to, from, except, desc) => {
|
|
30
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
31
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
32
|
-
key = keys[i];
|
|
33
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
34
|
-
__defProp(to, key, {
|
|
35
|
-
get: ((k) => from[k]).bind(null, key),
|
|
36
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return to;
|
|
42
|
-
};
|
|
43
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
44
|
-
value: mod,
|
|
45
|
-
enumerable: true
|
|
46
|
-
}) : target, mod));
|
|
47
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
48
|
-
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region ../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js
|
|
51
|
-
var require_universalify = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
52
|
-
exports.fromCallback = function(fn) {
|
|
53
|
-
return Object.defineProperty(function(...args) {
|
|
54
|
-
if (typeof args[args.length - 1] === "function") fn.apply(this, args);
|
|
55
|
-
else return new Promise((resolve, reject) => {
|
|
56
|
-
args.push((err, res) => err != null ? reject(err) : resolve(res));
|
|
57
|
-
fn.apply(this, args);
|
|
58
|
-
});
|
|
59
|
-
}, "name", { value: fn.name });
|
|
60
|
-
};
|
|
61
|
-
exports.fromPromise = function(fn) {
|
|
62
|
-
return Object.defineProperty(function(...args) {
|
|
63
|
-
const cb = args[args.length - 1];
|
|
64
|
-
if (typeof cb !== "function") return fn.apply(this, args);
|
|
65
|
-
else {
|
|
66
|
-
args.pop();
|
|
67
|
-
fn.apply(this, args).then((r) => cb(null, r), cb);
|
|
68
|
-
}
|
|
69
|
-
}, "name", { value: fn.name });
|
|
70
|
-
};
|
|
71
|
-
}));
|
|
72
|
-
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
|
|
75
|
-
var require_polyfills = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
76
|
-
var constants = __require("constants");
|
|
77
|
-
var origCwd = process.cwd;
|
|
78
|
-
var cwd = null;
|
|
79
|
-
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
80
|
-
process.cwd = function() {
|
|
81
|
-
if (!cwd) cwd = origCwd.call(process);
|
|
82
|
-
return cwd;
|
|
83
|
-
};
|
|
84
|
-
try {
|
|
85
|
-
process.cwd();
|
|
86
|
-
} catch (er) {}
|
|
87
|
-
if (typeof process.chdir === "function") {
|
|
88
|
-
var chdir = process.chdir;
|
|
89
|
-
process.chdir = function(d) {
|
|
90
|
-
cwd = null;
|
|
91
|
-
chdir.call(process, d);
|
|
92
|
-
};
|
|
93
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
|
|
94
|
-
}
|
|
95
|
-
module.exports = patch;
|
|
96
|
-
function patch(fs) {
|
|
97
|
-
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) patchLchmod(fs);
|
|
98
|
-
if (!fs.lutimes) patchLutimes(fs);
|
|
99
|
-
fs.chown = chownFix(fs.chown);
|
|
100
|
-
fs.fchown = chownFix(fs.fchown);
|
|
101
|
-
fs.lchown = chownFix(fs.lchown);
|
|
102
|
-
fs.chmod = chmodFix(fs.chmod);
|
|
103
|
-
fs.fchmod = chmodFix(fs.fchmod);
|
|
104
|
-
fs.lchmod = chmodFix(fs.lchmod);
|
|
105
|
-
fs.chownSync = chownFixSync(fs.chownSync);
|
|
106
|
-
fs.fchownSync = chownFixSync(fs.fchownSync);
|
|
107
|
-
fs.lchownSync = chownFixSync(fs.lchownSync);
|
|
108
|
-
fs.chmodSync = chmodFixSync(fs.chmodSync);
|
|
109
|
-
fs.fchmodSync = chmodFixSync(fs.fchmodSync);
|
|
110
|
-
fs.lchmodSync = chmodFixSync(fs.lchmodSync);
|
|
111
|
-
fs.stat = statFix(fs.stat);
|
|
112
|
-
fs.fstat = statFix(fs.fstat);
|
|
113
|
-
fs.lstat = statFix(fs.lstat);
|
|
114
|
-
fs.statSync = statFixSync(fs.statSync);
|
|
115
|
-
fs.fstatSync = statFixSync(fs.fstatSync);
|
|
116
|
-
fs.lstatSync = statFixSync(fs.lstatSync);
|
|
117
|
-
if (fs.chmod && !fs.lchmod) {
|
|
118
|
-
fs.lchmod = function(path, mode, cb) {
|
|
119
|
-
if (cb) process.nextTick(cb);
|
|
120
|
-
};
|
|
121
|
-
fs.lchmodSync = function() {};
|
|
122
|
-
}
|
|
123
|
-
if (fs.chown && !fs.lchown) {
|
|
124
|
-
fs.lchown = function(path, uid, gid, cb) {
|
|
125
|
-
if (cb) process.nextTick(cb);
|
|
126
|
-
};
|
|
127
|
-
fs.lchownSync = function() {};
|
|
128
|
-
}
|
|
129
|
-
if (platform === "win32") fs.rename = typeof fs.rename !== "function" ? fs.rename : (function(fs$rename) {
|
|
130
|
-
function rename(from, to, cb) {
|
|
131
|
-
var start = Date.now();
|
|
132
|
-
var backoff = 0;
|
|
133
|
-
fs$rename(from, to, function CB(er) {
|
|
134
|
-
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
135
|
-
setTimeout(function() {
|
|
136
|
-
fs.stat(to, function(stater, st) {
|
|
137
|
-
if (stater && stater.code === "ENOENT") fs$rename(from, to, CB);
|
|
138
|
-
else cb(er);
|
|
139
|
-
});
|
|
140
|
-
}, backoff);
|
|
141
|
-
if (backoff < 100) backoff += 10;
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
if (cb) cb(er);
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
148
|
-
return rename;
|
|
149
|
-
})(fs.rename);
|
|
150
|
-
fs.read = typeof fs.read !== "function" ? fs.read : (function(fs$read) {
|
|
151
|
-
function read(fd, buffer, offset, length, position, callback_) {
|
|
152
|
-
var callback;
|
|
153
|
-
if (callback_ && typeof callback_ === "function") {
|
|
154
|
-
var eagCounter = 0;
|
|
155
|
-
callback = function(er, _, __) {
|
|
156
|
-
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
157
|
-
eagCounter++;
|
|
158
|
-
return fs$read.call(fs, fd, buffer, offset, length, position, callback);
|
|
159
|
-
}
|
|
160
|
-
callback_.apply(this, arguments);
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
return fs$read.call(fs, fd, buffer, offset, length, position, callback);
|
|
164
|
-
}
|
|
165
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
166
|
-
return read;
|
|
167
|
-
})(fs.read);
|
|
168
|
-
fs.readSync = typeof fs.readSync !== "function" ? fs.readSync : (function(fs$readSync) {
|
|
169
|
-
return function(fd, buffer, offset, length, position) {
|
|
170
|
-
var eagCounter = 0;
|
|
171
|
-
while (true) try {
|
|
172
|
-
return fs$readSync.call(fs, fd, buffer, offset, length, position);
|
|
173
|
-
} catch (er) {
|
|
174
|
-
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
175
|
-
eagCounter++;
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
throw er;
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
})(fs.readSync);
|
|
182
|
-
function patchLchmod(fs) {
|
|
183
|
-
fs.lchmod = function(path, mode, callback) {
|
|
184
|
-
fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) {
|
|
185
|
-
if (err) {
|
|
186
|
-
if (callback) callback(err);
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
fs.fchmod(fd, mode, function(err) {
|
|
190
|
-
fs.close(fd, function(err2) {
|
|
191
|
-
if (callback) callback(err || err2);
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
|
-
};
|
|
196
|
-
fs.lchmodSync = function(path, mode) {
|
|
197
|
-
var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
198
|
-
var threw = true;
|
|
199
|
-
var ret;
|
|
200
|
-
try {
|
|
201
|
-
ret = fs.fchmodSync(fd, mode);
|
|
202
|
-
threw = false;
|
|
203
|
-
} finally {
|
|
204
|
-
if (threw) try {
|
|
205
|
-
fs.closeSync(fd);
|
|
206
|
-
} catch (er) {}
|
|
207
|
-
else fs.closeSync(fd);
|
|
208
|
-
}
|
|
209
|
-
return ret;
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
function patchLutimes(fs) {
|
|
213
|
-
if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
|
|
214
|
-
fs.lutimes = function(path, at, mt, cb) {
|
|
215
|
-
fs.open(path, constants.O_SYMLINK, function(er, fd) {
|
|
216
|
-
if (er) {
|
|
217
|
-
if (cb) cb(er);
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
fs.futimes(fd, at, mt, function(er) {
|
|
221
|
-
fs.close(fd, function(er2) {
|
|
222
|
-
if (cb) cb(er || er2);
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
});
|
|
226
|
-
};
|
|
227
|
-
fs.lutimesSync = function(path, at, mt) {
|
|
228
|
-
var fd = fs.openSync(path, constants.O_SYMLINK);
|
|
229
|
-
var ret;
|
|
230
|
-
var threw = true;
|
|
231
|
-
try {
|
|
232
|
-
ret = fs.futimesSync(fd, at, mt);
|
|
233
|
-
threw = false;
|
|
234
|
-
} finally {
|
|
235
|
-
if (threw) try {
|
|
236
|
-
fs.closeSync(fd);
|
|
237
|
-
} catch (er) {}
|
|
238
|
-
else fs.closeSync(fd);
|
|
239
|
-
}
|
|
240
|
-
return ret;
|
|
241
|
-
};
|
|
242
|
-
} else if (fs.futimes) {
|
|
243
|
-
fs.lutimes = function(_a, _b, _c, cb) {
|
|
244
|
-
if (cb) process.nextTick(cb);
|
|
245
|
-
};
|
|
246
|
-
fs.lutimesSync = function() {};
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
function chmodFix(orig) {
|
|
250
|
-
if (!orig) return orig;
|
|
251
|
-
return function(target, mode, cb) {
|
|
252
|
-
return orig.call(fs, target, mode, function(er) {
|
|
253
|
-
if (chownErOk(er)) er = null;
|
|
254
|
-
if (cb) cb.apply(this, arguments);
|
|
255
|
-
});
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
function chmodFixSync(orig) {
|
|
259
|
-
if (!orig) return orig;
|
|
260
|
-
return function(target, mode) {
|
|
261
|
-
try {
|
|
262
|
-
return orig.call(fs, target, mode);
|
|
263
|
-
} catch (er) {
|
|
264
|
-
if (!chownErOk(er)) throw er;
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
function chownFix(orig) {
|
|
269
|
-
if (!orig) return orig;
|
|
270
|
-
return function(target, uid, gid, cb) {
|
|
271
|
-
return orig.call(fs, target, uid, gid, function(er) {
|
|
272
|
-
if (chownErOk(er)) er = null;
|
|
273
|
-
if (cb) cb.apply(this, arguments);
|
|
274
|
-
});
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
function chownFixSync(orig) {
|
|
278
|
-
if (!orig) return orig;
|
|
279
|
-
return function(target, uid, gid) {
|
|
280
|
-
try {
|
|
281
|
-
return orig.call(fs, target, uid, gid);
|
|
282
|
-
} catch (er) {
|
|
283
|
-
if (!chownErOk(er)) throw er;
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
function statFix(orig) {
|
|
288
|
-
if (!orig) return orig;
|
|
289
|
-
return function(target, options, cb) {
|
|
290
|
-
if (typeof options === "function") {
|
|
291
|
-
cb = options;
|
|
292
|
-
options = null;
|
|
293
|
-
}
|
|
294
|
-
function callback(er, stats) {
|
|
295
|
-
if (stats) {
|
|
296
|
-
if (stats.uid < 0) stats.uid += 4294967296;
|
|
297
|
-
if (stats.gid < 0) stats.gid += 4294967296;
|
|
298
|
-
}
|
|
299
|
-
if (cb) cb.apply(this, arguments);
|
|
300
|
-
}
|
|
301
|
-
return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback);
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
function statFixSync(orig) {
|
|
305
|
-
if (!orig) return orig;
|
|
306
|
-
return function(target, options) {
|
|
307
|
-
var stats = options ? orig.call(fs, target, options) : orig.call(fs, target);
|
|
308
|
-
if (stats) {
|
|
309
|
-
if (stats.uid < 0) stats.uid += 4294967296;
|
|
310
|
-
if (stats.gid < 0) stats.gid += 4294967296;
|
|
311
|
-
}
|
|
312
|
-
return stats;
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
function chownErOk(er) {
|
|
316
|
-
if (!er) return true;
|
|
317
|
-
if (er.code === "ENOSYS") return true;
|
|
318
|
-
if (!process.getuid || process.getuid() !== 0) {
|
|
319
|
-
if (er.code === "EINVAL" || er.code === "EPERM") return true;
|
|
320
|
-
}
|
|
321
|
-
return false;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}));
|
|
325
|
-
|
|
326
|
-
//#endregion
|
|
327
|
-
//#region ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
|
|
328
|
-
var require_legacy_streams = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
329
|
-
var Stream = __require("stream").Stream;
|
|
330
|
-
module.exports = legacy;
|
|
331
|
-
function legacy(fs) {
|
|
332
|
-
return {
|
|
333
|
-
ReadStream,
|
|
334
|
-
WriteStream
|
|
335
|
-
};
|
|
336
|
-
function ReadStream(path, options) {
|
|
337
|
-
if (!(this instanceof ReadStream)) return new ReadStream(path, options);
|
|
338
|
-
Stream.call(this);
|
|
339
|
-
var self = this;
|
|
340
|
-
this.path = path;
|
|
341
|
-
this.fd = null;
|
|
342
|
-
this.readable = true;
|
|
343
|
-
this.paused = false;
|
|
344
|
-
this.flags = "r";
|
|
345
|
-
this.mode = 438;
|
|
346
|
-
this.bufferSize = 64 * 1024;
|
|
347
|
-
options = options || {};
|
|
348
|
-
var keys = Object.keys(options);
|
|
349
|
-
for (var index = 0, length = keys.length; index < length; index++) {
|
|
350
|
-
var key = keys[index];
|
|
351
|
-
this[key] = options[key];
|
|
352
|
-
}
|
|
353
|
-
if (this.encoding) this.setEncoding(this.encoding);
|
|
354
|
-
if (this.start !== void 0) {
|
|
355
|
-
if ("number" !== typeof this.start) throw TypeError("start must be a Number");
|
|
356
|
-
if (this.end === void 0) this.end = Infinity;
|
|
357
|
-
else if ("number" !== typeof this.end) throw TypeError("end must be a Number");
|
|
358
|
-
if (this.start > this.end) throw new Error("start must be <= end");
|
|
359
|
-
this.pos = this.start;
|
|
360
|
-
}
|
|
361
|
-
if (this.fd !== null) {
|
|
362
|
-
process.nextTick(function() {
|
|
363
|
-
self._read();
|
|
364
|
-
});
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
fs.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
368
|
-
if (err) {
|
|
369
|
-
self.emit("error", err);
|
|
370
|
-
self.readable = false;
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
self.fd = fd;
|
|
374
|
-
self.emit("open", fd);
|
|
375
|
-
self._read();
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
function WriteStream(path, options) {
|
|
379
|
-
if (!(this instanceof WriteStream)) return new WriteStream(path, options);
|
|
380
|
-
Stream.call(this);
|
|
381
|
-
this.path = path;
|
|
382
|
-
this.fd = null;
|
|
383
|
-
this.writable = true;
|
|
384
|
-
this.flags = "w";
|
|
385
|
-
this.encoding = "binary";
|
|
386
|
-
this.mode = 438;
|
|
387
|
-
this.bytesWritten = 0;
|
|
388
|
-
options = options || {};
|
|
389
|
-
var keys = Object.keys(options);
|
|
390
|
-
for (var index = 0, length = keys.length; index < length; index++) {
|
|
391
|
-
var key = keys[index];
|
|
392
|
-
this[key] = options[key];
|
|
393
|
-
}
|
|
394
|
-
if (this.start !== void 0) {
|
|
395
|
-
if ("number" !== typeof this.start) throw TypeError("start must be a Number");
|
|
396
|
-
if (this.start < 0) throw new Error("start must be >= zero");
|
|
397
|
-
this.pos = this.start;
|
|
398
|
-
}
|
|
399
|
-
this.busy = false;
|
|
400
|
-
this._queue = [];
|
|
401
|
-
if (this.fd === null) {
|
|
402
|
-
this._open = fs.open;
|
|
403
|
-
this._queue.push([
|
|
404
|
-
this._open,
|
|
405
|
-
this.path,
|
|
406
|
-
this.flags,
|
|
407
|
-
this.mode,
|
|
408
|
-
void 0
|
|
409
|
-
]);
|
|
410
|
-
this.flush();
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
}));
|
|
415
|
-
|
|
416
|
-
//#endregion
|
|
417
|
-
//#region ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js
|
|
418
|
-
var require_clone = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
419
|
-
module.exports = clone;
|
|
420
|
-
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
|
421
|
-
return obj.__proto__;
|
|
422
|
-
};
|
|
423
|
-
function clone(obj) {
|
|
424
|
-
if (obj === null || typeof obj !== "object") return obj;
|
|
425
|
-
if (obj instanceof Object) var copy = { __proto__: getPrototypeOf(obj) };
|
|
426
|
-
else var copy = Object.create(null);
|
|
427
|
-
Object.getOwnPropertyNames(obj).forEach(function(key) {
|
|
428
|
-
Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
|
|
429
|
-
});
|
|
430
|
-
return copy;
|
|
431
|
-
}
|
|
432
|
-
}));
|
|
433
|
-
|
|
434
|
-
//#endregion
|
|
435
|
-
//#region ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
|
|
436
|
-
var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
437
|
-
var fs$4 = __require("fs");
|
|
438
|
-
var polyfills = require_polyfills();
|
|
439
|
-
var legacy = require_legacy_streams();
|
|
440
|
-
var clone = require_clone();
|
|
441
|
-
var util = __require("util");
|
|
442
|
-
/* istanbul ignore next - node 0.x polyfill */
|
|
443
|
-
var gracefulQueue;
|
|
444
|
-
var previousSymbol;
|
|
445
|
-
/* istanbul ignore else - node 0.x polyfill */
|
|
446
|
-
if (typeof Symbol === "function" && typeof Symbol.for === "function") {
|
|
447
|
-
gracefulQueue = Symbol.for("graceful-fs.queue");
|
|
448
|
-
previousSymbol = Symbol.for("graceful-fs.previous");
|
|
449
|
-
} else {
|
|
450
|
-
gracefulQueue = "___graceful-fs.queue";
|
|
451
|
-
previousSymbol = "___graceful-fs.previous";
|
|
452
|
-
}
|
|
453
|
-
function noop() {}
|
|
454
|
-
function publishQueue(context, queue) {
|
|
455
|
-
Object.defineProperty(context, gracefulQueue, { get: function() {
|
|
456
|
-
return queue;
|
|
457
|
-
} });
|
|
458
|
-
}
|
|
459
|
-
var debug = noop;
|
|
460
|
-
if (util.debuglog) debug = util.debuglog("gfs4");
|
|
461
|
-
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) debug = function() {
|
|
462
|
-
var m = util.format.apply(util, arguments);
|
|
463
|
-
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
464
|
-
console.error(m);
|
|
465
|
-
};
|
|
466
|
-
if (!fs$4[gracefulQueue]) {
|
|
467
|
-
publishQueue(fs$4, global[gracefulQueue] || []);
|
|
468
|
-
fs$4.close = (function(fs$close) {
|
|
469
|
-
function close(fd, cb) {
|
|
470
|
-
return fs$close.call(fs$4, fd, function(err) {
|
|
471
|
-
if (!err) resetQueue();
|
|
472
|
-
if (typeof cb === "function") cb.apply(this, arguments);
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
Object.defineProperty(close, previousSymbol, { value: fs$close });
|
|
476
|
-
return close;
|
|
477
|
-
})(fs$4.close);
|
|
478
|
-
fs$4.closeSync = (function(fs$closeSync) {
|
|
479
|
-
function closeSync(fd) {
|
|
480
|
-
fs$closeSync.apply(fs$4, arguments);
|
|
481
|
-
resetQueue();
|
|
482
|
-
}
|
|
483
|
-
Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync });
|
|
484
|
-
return closeSync;
|
|
485
|
-
})(fs$4.closeSync);
|
|
486
|
-
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) process.on("exit", function() {
|
|
487
|
-
debug(fs$4[gracefulQueue]);
|
|
488
|
-
__require("assert").equal(fs$4[gracefulQueue].length, 0);
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
if (!global[gracefulQueue]) publishQueue(global, fs$4[gracefulQueue]);
|
|
492
|
-
module.exports = patch(clone(fs$4));
|
|
493
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$4.__patched) {
|
|
494
|
-
module.exports = patch(fs$4);
|
|
495
|
-
fs$4.__patched = true;
|
|
496
|
-
}
|
|
497
|
-
function patch(fs) {
|
|
498
|
-
polyfills(fs);
|
|
499
|
-
fs.gracefulify = patch;
|
|
500
|
-
fs.createReadStream = createReadStream;
|
|
501
|
-
fs.createWriteStream = createWriteStream;
|
|
502
|
-
var fs$readFile = fs.readFile;
|
|
503
|
-
fs.readFile = readFile;
|
|
504
|
-
function readFile(path, options, cb) {
|
|
505
|
-
if (typeof options === "function") cb = options, options = null;
|
|
506
|
-
return go$readFile(path, options, cb);
|
|
507
|
-
function go$readFile(path, options, cb, startTime) {
|
|
508
|
-
return fs$readFile(path, options, function(err) {
|
|
509
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
510
|
-
go$readFile,
|
|
511
|
-
[
|
|
512
|
-
path,
|
|
513
|
-
options,
|
|
514
|
-
cb
|
|
515
|
-
],
|
|
516
|
-
err,
|
|
517
|
-
startTime || Date.now(),
|
|
518
|
-
Date.now()
|
|
519
|
-
]);
|
|
520
|
-
else if (typeof cb === "function") cb.apply(this, arguments);
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
var fs$writeFile = fs.writeFile;
|
|
525
|
-
fs.writeFile = writeFile;
|
|
526
|
-
function writeFile(path, data, options, cb) {
|
|
527
|
-
if (typeof options === "function") cb = options, options = null;
|
|
528
|
-
return go$writeFile(path, data, options, cb);
|
|
529
|
-
function go$writeFile(path, data, options, cb, startTime) {
|
|
530
|
-
return fs$writeFile(path, data, options, function(err) {
|
|
531
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
532
|
-
go$writeFile,
|
|
533
|
-
[
|
|
534
|
-
path,
|
|
535
|
-
data,
|
|
536
|
-
options,
|
|
537
|
-
cb
|
|
538
|
-
],
|
|
539
|
-
err,
|
|
540
|
-
startTime || Date.now(),
|
|
541
|
-
Date.now()
|
|
542
|
-
]);
|
|
543
|
-
else if (typeof cb === "function") cb.apply(this, arguments);
|
|
544
|
-
});
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
var fs$appendFile = fs.appendFile;
|
|
548
|
-
if (fs$appendFile) fs.appendFile = appendFile;
|
|
549
|
-
function appendFile(path, data, options, cb) {
|
|
550
|
-
if (typeof options === "function") cb = options, options = null;
|
|
551
|
-
return go$appendFile(path, data, options, cb);
|
|
552
|
-
function go$appendFile(path, data, options, cb, startTime) {
|
|
553
|
-
return fs$appendFile(path, data, options, function(err) {
|
|
554
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
555
|
-
go$appendFile,
|
|
556
|
-
[
|
|
557
|
-
path,
|
|
558
|
-
data,
|
|
559
|
-
options,
|
|
560
|
-
cb
|
|
561
|
-
],
|
|
562
|
-
err,
|
|
563
|
-
startTime || Date.now(),
|
|
564
|
-
Date.now()
|
|
565
|
-
]);
|
|
566
|
-
else if (typeof cb === "function") cb.apply(this, arguments);
|
|
567
|
-
});
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
var fs$copyFile = fs.copyFile;
|
|
571
|
-
if (fs$copyFile) fs.copyFile = copyFile;
|
|
572
|
-
function copyFile(src, dest, flags, cb) {
|
|
573
|
-
if (typeof flags === "function") {
|
|
574
|
-
cb = flags;
|
|
575
|
-
flags = 0;
|
|
576
|
-
}
|
|
577
|
-
return go$copyFile(src, dest, flags, cb);
|
|
578
|
-
function go$copyFile(src, dest, flags, cb, startTime) {
|
|
579
|
-
return fs$copyFile(src, dest, flags, function(err) {
|
|
580
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
581
|
-
go$copyFile,
|
|
582
|
-
[
|
|
583
|
-
src,
|
|
584
|
-
dest,
|
|
585
|
-
flags,
|
|
586
|
-
cb
|
|
587
|
-
],
|
|
588
|
-
err,
|
|
589
|
-
startTime || Date.now(),
|
|
590
|
-
Date.now()
|
|
591
|
-
]);
|
|
592
|
-
else if (typeof cb === "function") cb.apply(this, arguments);
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
var fs$readdir = fs.readdir;
|
|
597
|
-
fs.readdir = readdir;
|
|
598
|
-
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
599
|
-
function readdir(path, options, cb) {
|
|
600
|
-
if (typeof options === "function") cb = options, options = null;
|
|
601
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir(path, options, cb, startTime) {
|
|
602
|
-
return fs$readdir(path, fs$readdirCallback(path, options, cb, startTime));
|
|
603
|
-
} : function go$readdir(path, options, cb, startTime) {
|
|
604
|
-
return fs$readdir(path, options, fs$readdirCallback(path, options, cb, startTime));
|
|
605
|
-
};
|
|
606
|
-
return go$readdir(path, options, cb);
|
|
607
|
-
function fs$readdirCallback(path, options, cb, startTime) {
|
|
608
|
-
return function(err, files) {
|
|
609
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
610
|
-
go$readdir,
|
|
611
|
-
[
|
|
612
|
-
path,
|
|
613
|
-
options,
|
|
614
|
-
cb
|
|
615
|
-
],
|
|
616
|
-
err,
|
|
617
|
-
startTime || Date.now(),
|
|
618
|
-
Date.now()
|
|
619
|
-
]);
|
|
620
|
-
else {
|
|
621
|
-
if (files && files.sort) files.sort();
|
|
622
|
-
if (typeof cb === "function") cb.call(this, err, files);
|
|
623
|
-
}
|
|
624
|
-
};
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
if (process.version.substr(0, 4) === "v0.8") {
|
|
628
|
-
var legStreams = legacy(fs);
|
|
629
|
-
ReadStream = legStreams.ReadStream;
|
|
630
|
-
WriteStream = legStreams.WriteStream;
|
|
631
|
-
}
|
|
632
|
-
var fs$ReadStream = fs.ReadStream;
|
|
633
|
-
if (fs$ReadStream) {
|
|
634
|
-
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
635
|
-
ReadStream.prototype.open = ReadStream$open;
|
|
636
|
-
}
|
|
637
|
-
var fs$WriteStream = fs.WriteStream;
|
|
638
|
-
if (fs$WriteStream) {
|
|
639
|
-
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
640
|
-
WriteStream.prototype.open = WriteStream$open;
|
|
641
|
-
}
|
|
642
|
-
Object.defineProperty(fs, "ReadStream", {
|
|
643
|
-
get: function() {
|
|
644
|
-
return ReadStream;
|
|
645
|
-
},
|
|
646
|
-
set: function(val) {
|
|
647
|
-
ReadStream = val;
|
|
648
|
-
},
|
|
649
|
-
enumerable: true,
|
|
650
|
-
configurable: true
|
|
651
|
-
});
|
|
652
|
-
Object.defineProperty(fs, "WriteStream", {
|
|
653
|
-
get: function() {
|
|
654
|
-
return WriteStream;
|
|
655
|
-
},
|
|
656
|
-
set: function(val) {
|
|
657
|
-
WriteStream = val;
|
|
658
|
-
},
|
|
659
|
-
enumerable: true,
|
|
660
|
-
configurable: true
|
|
661
|
-
});
|
|
662
|
-
var FileReadStream = ReadStream;
|
|
663
|
-
Object.defineProperty(fs, "FileReadStream", {
|
|
664
|
-
get: function() {
|
|
665
|
-
return FileReadStream;
|
|
666
|
-
},
|
|
667
|
-
set: function(val) {
|
|
668
|
-
FileReadStream = val;
|
|
669
|
-
},
|
|
670
|
-
enumerable: true,
|
|
671
|
-
configurable: true
|
|
672
|
-
});
|
|
673
|
-
var FileWriteStream = WriteStream;
|
|
674
|
-
Object.defineProperty(fs, "FileWriteStream", {
|
|
675
|
-
get: function() {
|
|
676
|
-
return FileWriteStream;
|
|
677
|
-
},
|
|
678
|
-
set: function(val) {
|
|
679
|
-
FileWriteStream = val;
|
|
680
|
-
},
|
|
681
|
-
enumerable: true,
|
|
682
|
-
configurable: true
|
|
683
|
-
});
|
|
684
|
-
function ReadStream(path, options) {
|
|
685
|
-
if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this;
|
|
686
|
-
else return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
687
|
-
}
|
|
688
|
-
function ReadStream$open() {
|
|
689
|
-
var that = this;
|
|
690
|
-
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
691
|
-
if (err) {
|
|
692
|
-
if (that.autoClose) that.destroy();
|
|
693
|
-
that.emit("error", err);
|
|
694
|
-
} else {
|
|
695
|
-
that.fd = fd;
|
|
696
|
-
that.emit("open", fd);
|
|
697
|
-
that.read();
|
|
698
|
-
}
|
|
699
|
-
});
|
|
700
|
-
}
|
|
701
|
-
function WriteStream(path, options) {
|
|
702
|
-
if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this;
|
|
703
|
-
else return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
704
|
-
}
|
|
705
|
-
function WriteStream$open() {
|
|
706
|
-
var that = this;
|
|
707
|
-
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
708
|
-
if (err) {
|
|
709
|
-
that.destroy();
|
|
710
|
-
that.emit("error", err);
|
|
711
|
-
} else {
|
|
712
|
-
that.fd = fd;
|
|
713
|
-
that.emit("open", fd);
|
|
714
|
-
}
|
|
715
|
-
});
|
|
716
|
-
}
|
|
717
|
-
function createReadStream(path, options) {
|
|
718
|
-
return new fs.ReadStream(path, options);
|
|
719
|
-
}
|
|
720
|
-
function createWriteStream(path, options) {
|
|
721
|
-
return new fs.WriteStream(path, options);
|
|
722
|
-
}
|
|
723
|
-
var fs$open = fs.open;
|
|
724
|
-
fs.open = open;
|
|
725
|
-
function open(path, flags, mode, cb) {
|
|
726
|
-
if (typeof mode === "function") cb = mode, mode = null;
|
|
727
|
-
return go$open(path, flags, mode, cb);
|
|
728
|
-
function go$open(path, flags, mode, cb, startTime) {
|
|
729
|
-
return fs$open(path, flags, mode, function(err, fd) {
|
|
730
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
731
|
-
go$open,
|
|
732
|
-
[
|
|
733
|
-
path,
|
|
734
|
-
flags,
|
|
735
|
-
mode,
|
|
736
|
-
cb
|
|
737
|
-
],
|
|
738
|
-
err,
|
|
739
|
-
startTime || Date.now(),
|
|
740
|
-
Date.now()
|
|
741
|
-
]);
|
|
742
|
-
else if (typeof cb === "function") cb.apply(this, arguments);
|
|
743
|
-
});
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
return fs;
|
|
747
|
-
}
|
|
748
|
-
function enqueue(elem) {
|
|
749
|
-
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
750
|
-
fs$4[gracefulQueue].push(elem);
|
|
751
|
-
retry();
|
|
752
|
-
}
|
|
753
|
-
var retryTimer;
|
|
754
|
-
function resetQueue() {
|
|
755
|
-
var now = Date.now();
|
|
756
|
-
for (var i = 0; i < fs$4[gracefulQueue].length; ++i) if (fs$4[gracefulQueue][i].length > 2) {
|
|
757
|
-
fs$4[gracefulQueue][i][3] = now;
|
|
758
|
-
fs$4[gracefulQueue][i][4] = now;
|
|
759
|
-
}
|
|
760
|
-
retry();
|
|
761
|
-
}
|
|
762
|
-
function retry() {
|
|
763
|
-
clearTimeout(retryTimer);
|
|
764
|
-
retryTimer = void 0;
|
|
765
|
-
if (fs$4[gracefulQueue].length === 0) return;
|
|
766
|
-
var elem = fs$4[gracefulQueue].shift();
|
|
767
|
-
var fn = elem[0];
|
|
768
|
-
var args = elem[1];
|
|
769
|
-
var err = elem[2];
|
|
770
|
-
var startTime = elem[3];
|
|
771
|
-
var lastTime = elem[4];
|
|
772
|
-
if (startTime === void 0) {
|
|
773
|
-
debug("RETRY", fn.name, args);
|
|
774
|
-
fn.apply(null, args);
|
|
775
|
-
} else if (Date.now() - startTime >= 6e4) {
|
|
776
|
-
debug("TIMEOUT", fn.name, args);
|
|
777
|
-
var cb = args.pop();
|
|
778
|
-
if (typeof cb === "function") cb.call(null, err);
|
|
779
|
-
} else {
|
|
780
|
-
var sinceAttempt = Date.now() - lastTime;
|
|
781
|
-
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
782
|
-
if (sinceAttempt >= Math.min(sinceStart * 1.2, 100)) {
|
|
783
|
-
debug("RETRY", fn.name, args);
|
|
784
|
-
fn.apply(null, args.concat([startTime]));
|
|
785
|
-
} else fs$4[gracefulQueue].push(elem);
|
|
786
|
-
}
|
|
787
|
-
if (retryTimer === void 0) retryTimer = setTimeout(retry, 0);
|
|
788
|
-
}
|
|
789
|
-
}));
|
|
790
|
-
|
|
791
|
-
//#endregion
|
|
792
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/fs/index.js
|
|
793
|
-
var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
794
|
-
const u = require_universalify().fromCallback;
|
|
795
|
-
const fs = require_graceful_fs();
|
|
796
|
-
const api = [
|
|
797
|
-
"access",
|
|
798
|
-
"appendFile",
|
|
799
|
-
"chmod",
|
|
800
|
-
"chown",
|
|
801
|
-
"close",
|
|
802
|
-
"copyFile",
|
|
803
|
-
"cp",
|
|
804
|
-
"fchmod",
|
|
805
|
-
"fchown",
|
|
806
|
-
"fdatasync",
|
|
807
|
-
"fstat",
|
|
808
|
-
"fsync",
|
|
809
|
-
"ftruncate",
|
|
810
|
-
"futimes",
|
|
811
|
-
"glob",
|
|
812
|
-
"lchmod",
|
|
813
|
-
"lchown",
|
|
814
|
-
"lutimes",
|
|
815
|
-
"link",
|
|
816
|
-
"lstat",
|
|
817
|
-
"mkdir",
|
|
818
|
-
"mkdtemp",
|
|
819
|
-
"open",
|
|
820
|
-
"opendir",
|
|
821
|
-
"readdir",
|
|
822
|
-
"readFile",
|
|
823
|
-
"readlink",
|
|
824
|
-
"realpath",
|
|
825
|
-
"rename",
|
|
826
|
-
"rm",
|
|
827
|
-
"rmdir",
|
|
828
|
-
"stat",
|
|
829
|
-
"statfs",
|
|
830
|
-
"symlink",
|
|
831
|
-
"truncate",
|
|
832
|
-
"unlink",
|
|
833
|
-
"utimes",
|
|
834
|
-
"writeFile"
|
|
835
|
-
].filter((key) => {
|
|
836
|
-
return typeof fs[key] === "function";
|
|
837
|
-
});
|
|
838
|
-
Object.assign(exports, fs);
|
|
839
|
-
api.forEach((method) => {
|
|
840
|
-
exports[method] = u(fs[method]);
|
|
841
|
-
});
|
|
842
|
-
exports.exists = function(filename, callback) {
|
|
843
|
-
if (typeof callback === "function") return fs.exists(filename, callback);
|
|
844
|
-
return new Promise((resolve) => {
|
|
845
|
-
return fs.exists(filename, resolve);
|
|
846
|
-
});
|
|
847
|
-
};
|
|
848
|
-
exports.read = function(fd, buffer, offset, length, position, callback) {
|
|
849
|
-
if (typeof callback === "function") return fs.read(fd, buffer, offset, length, position, callback);
|
|
850
|
-
return new Promise((resolve, reject) => {
|
|
851
|
-
fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {
|
|
852
|
-
if (err) return reject(err);
|
|
853
|
-
resolve({
|
|
854
|
-
bytesRead,
|
|
855
|
-
buffer
|
|
856
|
-
});
|
|
857
|
-
});
|
|
858
|
-
});
|
|
859
|
-
};
|
|
860
|
-
exports.write = function(fd, buffer, ...args) {
|
|
861
|
-
if (typeof args[args.length - 1] === "function") return fs.write(fd, buffer, ...args);
|
|
862
|
-
return new Promise((resolve, reject) => {
|
|
863
|
-
fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {
|
|
864
|
-
if (err) return reject(err);
|
|
865
|
-
resolve({
|
|
866
|
-
bytesWritten,
|
|
867
|
-
buffer
|
|
868
|
-
});
|
|
869
|
-
});
|
|
870
|
-
});
|
|
871
|
-
};
|
|
872
|
-
exports.readv = function(fd, buffers, ...args) {
|
|
873
|
-
if (typeof args[args.length - 1] === "function") return fs.readv(fd, buffers, ...args);
|
|
874
|
-
return new Promise((resolve, reject) => {
|
|
875
|
-
fs.readv(fd, buffers, ...args, (err, bytesRead, buffers) => {
|
|
876
|
-
if (err) return reject(err);
|
|
877
|
-
resolve({
|
|
878
|
-
bytesRead,
|
|
879
|
-
buffers
|
|
880
|
-
});
|
|
881
|
-
});
|
|
882
|
-
});
|
|
883
|
-
};
|
|
884
|
-
exports.writev = function(fd, buffers, ...args) {
|
|
885
|
-
if (typeof args[args.length - 1] === "function") return fs.writev(fd, buffers, ...args);
|
|
886
|
-
return new Promise((resolve, reject) => {
|
|
887
|
-
fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {
|
|
888
|
-
if (err) return reject(err);
|
|
889
|
-
resolve({
|
|
890
|
-
bytesWritten,
|
|
891
|
-
buffers
|
|
892
|
-
});
|
|
893
|
-
});
|
|
894
|
-
});
|
|
895
|
-
};
|
|
896
|
-
if (typeof fs.realpath.native === "function") exports.realpath.native = u(fs.realpath.native);
|
|
897
|
-
else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?", "Warning", "fs-extra-WARN0003");
|
|
898
|
-
}));
|
|
899
|
-
|
|
900
|
-
//#endregion
|
|
901
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/mkdirs/utils.js
|
|
902
|
-
var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
903
|
-
const path$12 = __require("path");
|
|
904
|
-
module.exports.checkPath = function checkPath(pth) {
|
|
905
|
-
if (process.platform === "win32") {
|
|
906
|
-
if (/[<>:"|?*]/.test(pth.replace(path$12.parse(pth).root, ""))) {
|
|
907
|
-
const error = /* @__PURE__ */ new Error(`Path contains invalid characters: ${pth}`);
|
|
908
|
-
error.code = "EINVAL";
|
|
909
|
-
throw error;
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
};
|
|
913
|
-
}));
|
|
914
|
-
|
|
915
|
-
//#endregion
|
|
916
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/mkdirs/make-dir.js
|
|
917
|
-
var require_make_dir = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
918
|
-
const fs = require_fs();
|
|
919
|
-
const { checkPath } = require_utils$1();
|
|
920
|
-
const getMode = (options) => {
|
|
921
|
-
const defaults = { mode: 511 };
|
|
922
|
-
if (typeof options === "number") return options;
|
|
923
|
-
return {
|
|
924
|
-
...defaults,
|
|
925
|
-
...options
|
|
926
|
-
}.mode;
|
|
927
|
-
};
|
|
928
|
-
module.exports.makeDir = async (dir, options) => {
|
|
929
|
-
checkPath(dir);
|
|
930
|
-
return fs.mkdir(dir, {
|
|
931
|
-
mode: getMode(options),
|
|
932
|
-
recursive: true
|
|
933
|
-
});
|
|
934
|
-
};
|
|
935
|
-
module.exports.makeDirSync = (dir, options) => {
|
|
936
|
-
checkPath(dir);
|
|
937
|
-
return fs.mkdirSync(dir, {
|
|
938
|
-
mode: getMode(options),
|
|
939
|
-
recursive: true
|
|
940
|
-
});
|
|
941
|
-
};
|
|
942
|
-
}));
|
|
943
|
-
|
|
944
|
-
//#endregion
|
|
945
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/mkdirs/index.js
|
|
946
|
-
var require_mkdirs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
947
|
-
const u = require_universalify().fromPromise;
|
|
948
|
-
const { makeDir: _makeDir, makeDirSync } = require_make_dir();
|
|
949
|
-
const makeDir = u(_makeDir);
|
|
950
|
-
module.exports = {
|
|
951
|
-
mkdirs: makeDir,
|
|
952
|
-
mkdirsSync: makeDirSync,
|
|
953
|
-
mkdirp: makeDir,
|
|
954
|
-
mkdirpSync: makeDirSync,
|
|
955
|
-
ensureDir: makeDir,
|
|
956
|
-
ensureDirSync: makeDirSync
|
|
957
|
-
};
|
|
958
|
-
}));
|
|
959
|
-
|
|
960
|
-
//#endregion
|
|
961
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/path-exists/index.js
|
|
962
|
-
var require_path_exists = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
963
|
-
const u = require_universalify().fromPromise;
|
|
964
|
-
const fs = require_fs();
|
|
965
|
-
function pathExists(path) {
|
|
966
|
-
return fs.access(path).then(() => true).catch(() => false);
|
|
967
|
-
}
|
|
968
|
-
module.exports = {
|
|
969
|
-
pathExists: u(pathExists),
|
|
970
|
-
pathExistsSync: fs.existsSync
|
|
971
|
-
};
|
|
972
|
-
}));
|
|
973
|
-
|
|
974
|
-
//#endregion
|
|
975
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/util/utimes.js
|
|
976
|
-
var require_utimes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
977
|
-
const fs = require_fs();
|
|
978
|
-
const u = require_universalify().fromPromise;
|
|
979
|
-
async function utimesMillis(path, atime, mtime) {
|
|
980
|
-
const fd = await fs.open(path, "r+");
|
|
981
|
-
let closeErr = null;
|
|
982
|
-
try {
|
|
983
|
-
await fs.futimes(fd, atime, mtime);
|
|
984
|
-
} finally {
|
|
985
|
-
try {
|
|
986
|
-
await fs.close(fd);
|
|
987
|
-
} catch (e) {
|
|
988
|
-
closeErr = e;
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
if (closeErr) throw closeErr;
|
|
992
|
-
}
|
|
993
|
-
function utimesMillisSync(path, atime, mtime) {
|
|
994
|
-
const fd = fs.openSync(path, "r+");
|
|
995
|
-
fs.futimesSync(fd, atime, mtime);
|
|
996
|
-
return fs.closeSync(fd);
|
|
997
|
-
}
|
|
998
|
-
module.exports = {
|
|
999
|
-
utimesMillis: u(utimesMillis),
|
|
1000
|
-
utimesMillisSync
|
|
1001
|
-
};
|
|
1002
|
-
}));
|
|
1003
|
-
|
|
1004
|
-
//#endregion
|
|
1005
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/util/stat.js
|
|
1006
|
-
var require_stat = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1007
|
-
const fs = require_fs();
|
|
1008
|
-
const path$11 = __require("path");
|
|
1009
|
-
const u = require_universalify().fromPromise;
|
|
1010
|
-
function getStats(src, dest, opts) {
|
|
1011
|
-
const statFunc = opts.dereference ? (file) => fs.stat(file, { bigint: true }) : (file) => fs.lstat(file, { bigint: true });
|
|
1012
|
-
return Promise.all([statFunc(src), statFunc(dest).catch((err) => {
|
|
1013
|
-
if (err.code === "ENOENT") return null;
|
|
1014
|
-
throw err;
|
|
1015
|
-
})]).then(([srcStat, destStat]) => ({
|
|
1016
|
-
srcStat,
|
|
1017
|
-
destStat
|
|
1018
|
-
}));
|
|
1019
|
-
}
|
|
1020
|
-
function getStatsSync(src, dest, opts) {
|
|
1021
|
-
let destStat;
|
|
1022
|
-
const statFunc = opts.dereference ? (file) => fs.statSync(file, { bigint: true }) : (file) => fs.lstatSync(file, { bigint: true });
|
|
1023
|
-
const srcStat = statFunc(src);
|
|
1024
|
-
try {
|
|
1025
|
-
destStat = statFunc(dest);
|
|
1026
|
-
} catch (err) {
|
|
1027
|
-
if (err.code === "ENOENT") return {
|
|
1028
|
-
srcStat,
|
|
1029
|
-
destStat: null
|
|
1030
|
-
};
|
|
1031
|
-
throw err;
|
|
1032
|
-
}
|
|
1033
|
-
return {
|
|
1034
|
-
srcStat,
|
|
1035
|
-
destStat
|
|
1036
|
-
};
|
|
1037
|
-
}
|
|
1038
|
-
async function checkPaths(src, dest, funcName, opts) {
|
|
1039
|
-
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
1040
|
-
if (destStat) {
|
|
1041
|
-
if (areIdentical(srcStat, destStat)) {
|
|
1042
|
-
const srcBaseName = path$11.basename(src);
|
|
1043
|
-
const destBaseName = path$11.basename(dest);
|
|
1044
|
-
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) return {
|
|
1045
|
-
srcStat,
|
|
1046
|
-
destStat,
|
|
1047
|
-
isChangingCase: true
|
|
1048
|
-
};
|
|
1049
|
-
throw new Error("Source and destination must not be the same.");
|
|
1050
|
-
}
|
|
1051
|
-
if (srcStat.isDirectory() && !destStat.isDirectory()) throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
|
1052
|
-
if (!srcStat.isDirectory() && destStat.isDirectory()) throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
|
1053
|
-
}
|
|
1054
|
-
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) throw new Error(errMsg(src, dest, funcName));
|
|
1055
|
-
return {
|
|
1056
|
-
srcStat,
|
|
1057
|
-
destStat
|
|
1058
|
-
};
|
|
1059
|
-
}
|
|
1060
|
-
function checkPathsSync(src, dest, funcName, opts) {
|
|
1061
|
-
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
1062
|
-
if (destStat) {
|
|
1063
|
-
if (areIdentical(srcStat, destStat)) {
|
|
1064
|
-
const srcBaseName = path$11.basename(src);
|
|
1065
|
-
const destBaseName = path$11.basename(dest);
|
|
1066
|
-
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) return {
|
|
1067
|
-
srcStat,
|
|
1068
|
-
destStat,
|
|
1069
|
-
isChangingCase: true
|
|
1070
|
-
};
|
|
1071
|
-
throw new Error("Source and destination must not be the same.");
|
|
1072
|
-
}
|
|
1073
|
-
if (srcStat.isDirectory() && !destStat.isDirectory()) throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
|
1074
|
-
if (!srcStat.isDirectory() && destStat.isDirectory()) throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
|
1075
|
-
}
|
|
1076
|
-
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) throw new Error(errMsg(src, dest, funcName));
|
|
1077
|
-
return {
|
|
1078
|
-
srcStat,
|
|
1079
|
-
destStat
|
|
1080
|
-
};
|
|
1081
|
-
}
|
|
1082
|
-
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
1083
|
-
const srcParent = path$11.resolve(path$11.dirname(src));
|
|
1084
|
-
const destParent = path$11.resolve(path$11.dirname(dest));
|
|
1085
|
-
if (destParent === srcParent || destParent === path$11.parse(destParent).root) return;
|
|
1086
|
-
let destStat;
|
|
1087
|
-
try {
|
|
1088
|
-
destStat = await fs.stat(destParent, { bigint: true });
|
|
1089
|
-
} catch (err) {
|
|
1090
|
-
if (err.code === "ENOENT") return;
|
|
1091
|
-
throw err;
|
|
1092
|
-
}
|
|
1093
|
-
if (areIdentical(srcStat, destStat)) throw new Error(errMsg(src, dest, funcName));
|
|
1094
|
-
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
1095
|
-
}
|
|
1096
|
-
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
1097
|
-
const srcParent = path$11.resolve(path$11.dirname(src));
|
|
1098
|
-
const destParent = path$11.resolve(path$11.dirname(dest));
|
|
1099
|
-
if (destParent === srcParent || destParent === path$11.parse(destParent).root) return;
|
|
1100
|
-
let destStat;
|
|
1101
|
-
try {
|
|
1102
|
-
destStat = fs.statSync(destParent, { bigint: true });
|
|
1103
|
-
} catch (err) {
|
|
1104
|
-
if (err.code === "ENOENT") return;
|
|
1105
|
-
throw err;
|
|
1106
|
-
}
|
|
1107
|
-
if (areIdentical(srcStat, destStat)) throw new Error(errMsg(src, dest, funcName));
|
|
1108
|
-
return checkParentPathsSync(src, srcStat, destParent, funcName);
|
|
1109
|
-
}
|
|
1110
|
-
function areIdentical(srcStat, destStat) {
|
|
1111
|
-
return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
1112
|
-
}
|
|
1113
|
-
function isSrcSubdir(src, dest) {
|
|
1114
|
-
const srcArr = path$11.resolve(src).split(path$11.sep).filter((i) => i);
|
|
1115
|
-
const destArr = path$11.resolve(dest).split(path$11.sep).filter((i) => i);
|
|
1116
|
-
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
1117
|
-
}
|
|
1118
|
-
function errMsg(src, dest, funcName) {
|
|
1119
|
-
return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
|
|
1120
|
-
}
|
|
1121
|
-
module.exports = {
|
|
1122
|
-
checkPaths: u(checkPaths),
|
|
1123
|
-
checkPathsSync,
|
|
1124
|
-
checkParentPaths: u(checkParentPaths),
|
|
1125
|
-
checkParentPathsSync,
|
|
1126
|
-
isSrcSubdir,
|
|
1127
|
-
areIdentical
|
|
1128
|
-
};
|
|
1129
|
-
}));
|
|
1130
|
-
|
|
1131
|
-
//#endregion
|
|
1132
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/util/async.js
|
|
1133
|
-
var require_async = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1134
|
-
async function asyncIteratorConcurrentProcess(iterator, fn) {
|
|
1135
|
-
const promises = [];
|
|
1136
|
-
for await (const item of iterator) promises.push(fn(item).then(() => null, (err) => err ?? /* @__PURE__ */ new Error("unknown error")));
|
|
1137
|
-
await Promise.all(promises.map((promise) => promise.then((possibleErr) => {
|
|
1138
|
-
if (possibleErr !== null) throw possibleErr;
|
|
1139
|
-
})));
|
|
1140
|
-
}
|
|
1141
|
-
module.exports = { asyncIteratorConcurrentProcess };
|
|
1142
|
-
}));
|
|
1143
|
-
|
|
1144
|
-
//#endregion
|
|
1145
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/copy/copy.js
|
|
1146
|
-
var require_copy$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1147
|
-
const fs = require_fs();
|
|
1148
|
-
const path$10 = __require("path");
|
|
1149
|
-
const { mkdirs } = require_mkdirs();
|
|
1150
|
-
const { pathExists } = require_path_exists();
|
|
1151
|
-
const { utimesMillis } = require_utimes();
|
|
1152
|
-
const stat = require_stat();
|
|
1153
|
-
const { asyncIteratorConcurrentProcess } = require_async();
|
|
1154
|
-
async function copy(src, dest, opts = {}) {
|
|
1155
|
-
if (typeof opts === "function") opts = { filter: opts };
|
|
1156
|
-
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
1157
|
-
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
1158
|
-
if (opts.preserveTimestamps && process.arch === "ia32") process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269", "Warning", "fs-extra-WARN0001");
|
|
1159
|
-
const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts);
|
|
1160
|
-
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
1161
|
-
if (!await runFilter(src, dest, opts)) return;
|
|
1162
|
-
const destParent = path$10.dirname(dest);
|
|
1163
|
-
if (!await pathExists(destParent)) await mkdirs(destParent);
|
|
1164
|
-
await getStatsAndPerformCopy(destStat, src, dest, opts);
|
|
1165
|
-
}
|
|
1166
|
-
async function runFilter(src, dest, opts) {
|
|
1167
|
-
if (!opts.filter) return true;
|
|
1168
|
-
return opts.filter(src, dest);
|
|
1169
|
-
}
|
|
1170
|
-
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
1171
|
-
const srcStat = await (opts.dereference ? fs.stat : fs.lstat)(src);
|
|
1172
|
-
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
1173
|
-
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
1174
|
-
if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
|
|
1175
|
-
if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
|
|
1176
|
-
if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
|
1177
|
-
throw new Error(`Unknown file: ${src}`);
|
|
1178
|
-
}
|
|
1179
|
-
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
1180
|
-
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
1181
|
-
if (opts.overwrite) {
|
|
1182
|
-
await fs.unlink(dest);
|
|
1183
|
-
return copyFile(srcStat, src, dest, opts);
|
|
1184
|
-
}
|
|
1185
|
-
if (opts.errorOnExist) throw new Error(`'${dest}' already exists`);
|
|
1186
|
-
}
|
|
1187
|
-
async function copyFile(srcStat, src, dest, opts) {
|
|
1188
|
-
await fs.copyFile(src, dest);
|
|
1189
|
-
if (opts.preserveTimestamps) {
|
|
1190
|
-
if (fileIsNotWritable(srcStat.mode)) await makeFileWritable(dest, srcStat.mode);
|
|
1191
|
-
const updatedSrcStat = await fs.stat(src);
|
|
1192
|
-
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1193
|
-
}
|
|
1194
|
-
return fs.chmod(dest, srcStat.mode);
|
|
1195
|
-
}
|
|
1196
|
-
function fileIsNotWritable(srcMode) {
|
|
1197
|
-
return (srcMode & 128) === 0;
|
|
1198
|
-
}
|
|
1199
|
-
function makeFileWritable(dest, srcMode) {
|
|
1200
|
-
return fs.chmod(dest, srcMode | 128);
|
|
1201
|
-
}
|
|
1202
|
-
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
1203
|
-
if (!destStat) await fs.mkdir(dest);
|
|
1204
|
-
await asyncIteratorConcurrentProcess(await fs.opendir(src), async (item) => {
|
|
1205
|
-
const srcItem = path$10.join(src, item.name);
|
|
1206
|
-
const destItem = path$10.join(dest, item.name);
|
|
1207
|
-
if (await runFilter(srcItem, destItem, opts)) {
|
|
1208
|
-
const { destStat } = await stat.checkPaths(srcItem, destItem, "copy", opts);
|
|
1209
|
-
await getStatsAndPerformCopy(destStat, srcItem, destItem, opts);
|
|
1210
|
-
}
|
|
1211
|
-
});
|
|
1212
|
-
if (!destStat) await fs.chmod(dest, srcStat.mode);
|
|
1213
|
-
}
|
|
1214
|
-
async function onLink(destStat, src, dest, opts) {
|
|
1215
|
-
let resolvedSrc = await fs.readlink(src);
|
|
1216
|
-
if (opts.dereference) resolvedSrc = path$10.resolve(process.cwd(), resolvedSrc);
|
|
1217
|
-
if (!destStat) return fs.symlink(resolvedSrc, dest);
|
|
1218
|
-
let resolvedDest = null;
|
|
1219
|
-
try {
|
|
1220
|
-
resolvedDest = await fs.readlink(dest);
|
|
1221
|
-
} catch (e) {
|
|
1222
|
-
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs.symlink(resolvedSrc, dest);
|
|
1223
|
-
throw e;
|
|
1224
|
-
}
|
|
1225
|
-
if (opts.dereference) resolvedDest = path$10.resolve(process.cwd(), resolvedDest);
|
|
1226
|
-
if (resolvedSrc !== resolvedDest) {
|
|
1227
|
-
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
1228
|
-
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
1229
|
-
}
|
|
1230
|
-
await fs.unlink(dest);
|
|
1231
|
-
return fs.symlink(resolvedSrc, dest);
|
|
1232
|
-
}
|
|
1233
|
-
module.exports = copy;
|
|
1234
|
-
}));
|
|
1235
|
-
|
|
1236
|
-
//#endregion
|
|
1237
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/copy/copy-sync.js
|
|
1238
|
-
var require_copy_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1239
|
-
const fs = require_graceful_fs();
|
|
1240
|
-
const path$9 = __require("path");
|
|
1241
|
-
const mkdirsSync = require_mkdirs().mkdirsSync;
|
|
1242
|
-
const utimesMillisSync = require_utimes().utimesMillisSync;
|
|
1243
|
-
const stat = require_stat();
|
|
1244
|
-
function copySync(src, dest, opts) {
|
|
1245
|
-
if (typeof opts === "function") opts = { filter: opts };
|
|
1246
|
-
opts = opts || {};
|
|
1247
|
-
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
1248
|
-
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
1249
|
-
if (opts.preserveTimestamps && process.arch === "ia32") process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269", "Warning", "fs-extra-WARN0002");
|
|
1250
|
-
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
1251
|
-
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
1252
|
-
if (opts.filter && !opts.filter(src, dest)) return;
|
|
1253
|
-
const destParent = path$9.dirname(dest);
|
|
1254
|
-
if (!fs.existsSync(destParent)) mkdirsSync(destParent);
|
|
1255
|
-
return getStats(destStat, src, dest, opts);
|
|
1256
|
-
}
|
|
1257
|
-
function getStats(destStat, src, dest, opts) {
|
|
1258
|
-
const srcStat = (opts.dereference ? fs.statSync : fs.lstatSync)(src);
|
|
1259
|
-
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
1260
|
-
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
1261
|
-
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
|
|
1262
|
-
else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
|
|
1263
|
-
else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
|
1264
|
-
throw new Error(`Unknown file: ${src}`);
|
|
1265
|
-
}
|
|
1266
|
-
function onFile(srcStat, destStat, src, dest, opts) {
|
|
1267
|
-
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
1268
|
-
return mayCopyFile(srcStat, src, dest, opts);
|
|
1269
|
-
}
|
|
1270
|
-
function mayCopyFile(srcStat, src, dest, opts) {
|
|
1271
|
-
if (opts.overwrite) {
|
|
1272
|
-
fs.unlinkSync(dest);
|
|
1273
|
-
return copyFile(srcStat, src, dest, opts);
|
|
1274
|
-
} else if (opts.errorOnExist) throw new Error(`'${dest}' already exists`);
|
|
1275
|
-
}
|
|
1276
|
-
function copyFile(srcStat, src, dest, opts) {
|
|
1277
|
-
fs.copyFileSync(src, dest);
|
|
1278
|
-
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
1279
|
-
return setDestMode(dest, srcStat.mode);
|
|
1280
|
-
}
|
|
1281
|
-
function handleTimestamps(srcMode, src, dest) {
|
|
1282
|
-
if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode);
|
|
1283
|
-
return setDestTimestamps(src, dest);
|
|
1284
|
-
}
|
|
1285
|
-
function fileIsNotWritable(srcMode) {
|
|
1286
|
-
return (srcMode & 128) === 0;
|
|
1287
|
-
}
|
|
1288
|
-
function makeFileWritable(dest, srcMode) {
|
|
1289
|
-
return setDestMode(dest, srcMode | 128);
|
|
1290
|
-
}
|
|
1291
|
-
function setDestMode(dest, srcMode) {
|
|
1292
|
-
return fs.chmodSync(dest, srcMode);
|
|
1293
|
-
}
|
|
1294
|
-
function setDestTimestamps(src, dest) {
|
|
1295
|
-
const updatedSrcStat = fs.statSync(src);
|
|
1296
|
-
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1297
|
-
}
|
|
1298
|
-
function onDir(srcStat, destStat, src, dest, opts) {
|
|
1299
|
-
if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts);
|
|
1300
|
-
return copyDir(src, dest, opts);
|
|
1301
|
-
}
|
|
1302
|
-
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
1303
|
-
fs.mkdirSync(dest);
|
|
1304
|
-
copyDir(src, dest, opts);
|
|
1305
|
-
return setDestMode(dest, srcMode);
|
|
1306
|
-
}
|
|
1307
|
-
function copyDir(src, dest, opts) {
|
|
1308
|
-
const dir = fs.opendirSync(src);
|
|
1309
|
-
try {
|
|
1310
|
-
let dirent;
|
|
1311
|
-
while ((dirent = dir.readSync()) !== null) copyDirItem(dirent.name, src, dest, opts);
|
|
1312
|
-
} finally {
|
|
1313
|
-
dir.closeSync();
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
function copyDirItem(item, src, dest, opts) {
|
|
1317
|
-
const srcItem = path$9.join(src, item);
|
|
1318
|
-
const destItem = path$9.join(dest, item);
|
|
1319
|
-
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
1320
|
-
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
1321
|
-
return getStats(destStat, srcItem, destItem, opts);
|
|
1322
|
-
}
|
|
1323
|
-
function onLink(destStat, src, dest, opts) {
|
|
1324
|
-
let resolvedSrc = fs.readlinkSync(src);
|
|
1325
|
-
if (opts.dereference) resolvedSrc = path$9.resolve(process.cwd(), resolvedSrc);
|
|
1326
|
-
if (!destStat) return fs.symlinkSync(resolvedSrc, dest);
|
|
1327
|
-
else {
|
|
1328
|
-
let resolvedDest;
|
|
1329
|
-
try {
|
|
1330
|
-
resolvedDest = fs.readlinkSync(dest);
|
|
1331
|
-
} catch (err) {
|
|
1332
|
-
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs.symlinkSync(resolvedSrc, dest);
|
|
1333
|
-
throw err;
|
|
1334
|
-
}
|
|
1335
|
-
if (opts.dereference) resolvedDest = path$9.resolve(process.cwd(), resolvedDest);
|
|
1336
|
-
if (resolvedSrc !== resolvedDest) {
|
|
1337
|
-
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
1338
|
-
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
1339
|
-
}
|
|
1340
|
-
return copyLink(resolvedSrc, dest);
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
function copyLink(resolvedSrc, dest) {
|
|
1344
|
-
fs.unlinkSync(dest);
|
|
1345
|
-
return fs.symlinkSync(resolvedSrc, dest);
|
|
1346
|
-
}
|
|
1347
|
-
module.exports = copySync;
|
|
1348
|
-
}));
|
|
1349
|
-
|
|
1350
|
-
//#endregion
|
|
1351
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/copy/index.js
|
|
1352
|
-
var require_copy = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1353
|
-
const u = require_universalify().fromPromise;
|
|
1354
|
-
module.exports = {
|
|
1355
|
-
copy: u(require_copy$1()),
|
|
1356
|
-
copySync: require_copy_sync()
|
|
1357
|
-
};
|
|
1358
|
-
}));
|
|
1359
|
-
|
|
1360
|
-
//#endregion
|
|
1361
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/remove/index.js
|
|
1362
|
-
var require_remove = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1363
|
-
const fs = require_graceful_fs();
|
|
1364
|
-
const u = require_universalify().fromCallback;
|
|
1365
|
-
function remove(path, callback) {
|
|
1366
|
-
fs.rm(path, {
|
|
1367
|
-
recursive: true,
|
|
1368
|
-
force: true
|
|
1369
|
-
}, callback);
|
|
1370
|
-
}
|
|
1371
|
-
function removeSync(path) {
|
|
1372
|
-
fs.rmSync(path, {
|
|
1373
|
-
recursive: true,
|
|
1374
|
-
force: true
|
|
1375
|
-
});
|
|
1376
|
-
}
|
|
1377
|
-
module.exports = {
|
|
1378
|
-
remove: u(remove),
|
|
1379
|
-
removeSync
|
|
1380
|
-
};
|
|
1381
|
-
}));
|
|
1382
|
-
|
|
1383
|
-
//#endregion
|
|
1384
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/empty/index.js
|
|
1385
|
-
var require_empty = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1386
|
-
const u = require_universalify().fromPromise;
|
|
1387
|
-
const fs = require_fs();
|
|
1388
|
-
const path$8 = __require("path");
|
|
1389
|
-
const mkdir = require_mkdirs();
|
|
1390
|
-
const remove = require_remove();
|
|
1391
|
-
const emptyDir = u(async function emptyDir(dir) {
|
|
1392
|
-
let items;
|
|
1393
|
-
try {
|
|
1394
|
-
items = await fs.readdir(dir);
|
|
1395
|
-
} catch {
|
|
1396
|
-
return mkdir.mkdirs(dir);
|
|
1397
|
-
}
|
|
1398
|
-
return Promise.all(items.map((item) => remove.remove(path$8.join(dir, item))));
|
|
1399
|
-
});
|
|
1400
|
-
function emptyDirSync(dir) {
|
|
1401
|
-
let items;
|
|
1402
|
-
try {
|
|
1403
|
-
items = fs.readdirSync(dir);
|
|
1404
|
-
} catch {
|
|
1405
|
-
return mkdir.mkdirsSync(dir);
|
|
1406
|
-
}
|
|
1407
|
-
items.forEach((item) => {
|
|
1408
|
-
item = path$8.join(dir, item);
|
|
1409
|
-
remove.removeSync(item);
|
|
1410
|
-
});
|
|
1411
|
-
}
|
|
1412
|
-
module.exports = {
|
|
1413
|
-
emptyDirSync,
|
|
1414
|
-
emptydirSync: emptyDirSync,
|
|
1415
|
-
emptyDir,
|
|
1416
|
-
emptydir: emptyDir
|
|
1417
|
-
};
|
|
1418
|
-
}));
|
|
1419
|
-
|
|
1420
|
-
//#endregion
|
|
1421
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/file.js
|
|
1422
|
-
var require_file = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1423
|
-
const u = require_universalify().fromPromise;
|
|
1424
|
-
const path$7 = __require("path");
|
|
1425
|
-
const fs = require_fs();
|
|
1426
|
-
const mkdir = require_mkdirs();
|
|
1427
|
-
async function createFile(file) {
|
|
1428
|
-
let stats;
|
|
1429
|
-
try {
|
|
1430
|
-
stats = await fs.stat(file);
|
|
1431
|
-
} catch {}
|
|
1432
|
-
if (stats && stats.isFile()) return;
|
|
1433
|
-
const dir = path$7.dirname(file);
|
|
1434
|
-
let dirStats = null;
|
|
1435
|
-
try {
|
|
1436
|
-
dirStats = await fs.stat(dir);
|
|
1437
|
-
} catch (err) {
|
|
1438
|
-
if (err.code === "ENOENT") {
|
|
1439
|
-
await mkdir.mkdirs(dir);
|
|
1440
|
-
await fs.writeFile(file, "");
|
|
1441
|
-
return;
|
|
1442
|
-
} else throw err;
|
|
1443
|
-
}
|
|
1444
|
-
if (dirStats.isDirectory()) await fs.writeFile(file, "");
|
|
1445
|
-
else await fs.readdir(dir);
|
|
1446
|
-
}
|
|
1447
|
-
function createFileSync(file) {
|
|
1448
|
-
let stats;
|
|
1449
|
-
try {
|
|
1450
|
-
stats = fs.statSync(file);
|
|
1451
|
-
} catch {}
|
|
1452
|
-
if (stats && stats.isFile()) return;
|
|
1453
|
-
const dir = path$7.dirname(file);
|
|
1454
|
-
try {
|
|
1455
|
-
if (!fs.statSync(dir).isDirectory()) fs.readdirSync(dir);
|
|
1456
|
-
} catch (err) {
|
|
1457
|
-
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
|
1458
|
-
else throw err;
|
|
1459
|
-
}
|
|
1460
|
-
fs.writeFileSync(file, "");
|
|
1461
|
-
}
|
|
1462
|
-
module.exports = {
|
|
1463
|
-
createFile: u(createFile),
|
|
1464
|
-
createFileSync
|
|
1465
|
-
};
|
|
1466
|
-
}));
|
|
1467
|
-
|
|
1468
|
-
//#endregion
|
|
1469
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/link.js
|
|
1470
|
-
var require_link = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1471
|
-
const u = require_universalify().fromPromise;
|
|
1472
|
-
const path$6 = __require("path");
|
|
1473
|
-
const fs = require_fs();
|
|
1474
|
-
const mkdir = require_mkdirs();
|
|
1475
|
-
const { pathExists } = require_path_exists();
|
|
1476
|
-
const { areIdentical } = require_stat();
|
|
1477
|
-
async function createLink(srcpath, dstpath) {
|
|
1478
|
-
let dstStat;
|
|
1479
|
-
try {
|
|
1480
|
-
dstStat = await fs.lstat(dstpath);
|
|
1481
|
-
} catch {}
|
|
1482
|
-
let srcStat;
|
|
1483
|
-
try {
|
|
1484
|
-
srcStat = await fs.lstat(srcpath);
|
|
1485
|
-
} catch (err) {
|
|
1486
|
-
err.message = err.message.replace("lstat", "ensureLink");
|
|
1487
|
-
throw err;
|
|
1488
|
-
}
|
|
1489
|
-
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
1490
|
-
const dir = path$6.dirname(dstpath);
|
|
1491
|
-
if (!await pathExists(dir)) await mkdir.mkdirs(dir);
|
|
1492
|
-
await fs.link(srcpath, dstpath);
|
|
1493
|
-
}
|
|
1494
|
-
function createLinkSync(srcpath, dstpath) {
|
|
1495
|
-
let dstStat;
|
|
1496
|
-
try {
|
|
1497
|
-
dstStat = fs.lstatSync(dstpath);
|
|
1498
|
-
} catch {}
|
|
1499
|
-
try {
|
|
1500
|
-
const srcStat = fs.lstatSync(srcpath);
|
|
1501
|
-
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
1502
|
-
} catch (err) {
|
|
1503
|
-
err.message = err.message.replace("lstat", "ensureLink");
|
|
1504
|
-
throw err;
|
|
1505
|
-
}
|
|
1506
|
-
const dir = path$6.dirname(dstpath);
|
|
1507
|
-
if (fs.existsSync(dir)) return fs.linkSync(srcpath, dstpath);
|
|
1508
|
-
mkdir.mkdirsSync(dir);
|
|
1509
|
-
return fs.linkSync(srcpath, dstpath);
|
|
1510
|
-
}
|
|
1511
|
-
module.exports = {
|
|
1512
|
-
createLink: u(createLink),
|
|
1513
|
-
createLinkSync
|
|
1514
|
-
};
|
|
1515
|
-
}));
|
|
1516
|
-
|
|
1517
|
-
//#endregion
|
|
1518
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/symlink-paths.js
|
|
1519
|
-
var require_symlink_paths = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1520
|
-
const path$5 = __require("path");
|
|
1521
|
-
const fs = require_fs();
|
|
1522
|
-
const { pathExists } = require_path_exists();
|
|
1523
|
-
const u = require_universalify().fromPromise;
|
|
1524
|
-
/**
|
|
1525
|
-
* Function that returns two types of paths, one relative to symlink, and one
|
|
1526
|
-
* relative to the current working directory. Checks if path is absolute or
|
|
1527
|
-
* relative. If the path is relative, this function checks if the path is
|
|
1528
|
-
* relative to symlink or relative to current working directory. This is an
|
|
1529
|
-
* initiative to find a smarter `srcpath` to supply when building symlinks.
|
|
1530
|
-
* This allows you to determine which path to use out of one of three possible
|
|
1531
|
-
* types of source paths. The first is an absolute path. This is detected by
|
|
1532
|
-
* `path.isAbsolute()`. When an absolute path is provided, it is checked to
|
|
1533
|
-
* see if it exists. If it does it's used, if not an error is returned
|
|
1534
|
-
* (callback)/ thrown (sync). The other two options for `srcpath` are a
|
|
1535
|
-
* relative url. By default Node's `fs.symlink` works by creating a symlink
|
|
1536
|
-
* using `dstpath` and expects the `srcpath` to be relative to the newly
|
|
1537
|
-
* created symlink. If you provide a `srcpath` that does not exist on the file
|
|
1538
|
-
* system it results in a broken symlink. To minimize this, the function
|
|
1539
|
-
* checks to see if the 'relative to symlink' source file exists, and if it
|
|
1540
|
-
* does it will use it. If it does not, it checks if there's a file that
|
|
1541
|
-
* exists that is relative to the current working directory, if does its used.
|
|
1542
|
-
* This preserves the expectations of the original fs.symlink spec and adds
|
|
1543
|
-
* the ability to pass in `relative to current working direcotry` paths.
|
|
1544
|
-
*/
|
|
1545
|
-
async function symlinkPaths(srcpath, dstpath) {
|
|
1546
|
-
if (path$5.isAbsolute(srcpath)) {
|
|
1547
|
-
try {
|
|
1548
|
-
await fs.lstat(srcpath);
|
|
1549
|
-
} catch (err) {
|
|
1550
|
-
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
1551
|
-
throw err;
|
|
1552
|
-
}
|
|
1553
|
-
return {
|
|
1554
|
-
toCwd: srcpath,
|
|
1555
|
-
toDst: srcpath
|
|
1556
|
-
};
|
|
1557
|
-
}
|
|
1558
|
-
const dstdir = path$5.dirname(dstpath);
|
|
1559
|
-
const relativeToDst = path$5.join(dstdir, srcpath);
|
|
1560
|
-
if (await pathExists(relativeToDst)) return {
|
|
1561
|
-
toCwd: relativeToDst,
|
|
1562
|
-
toDst: srcpath
|
|
1563
|
-
};
|
|
1564
|
-
try {
|
|
1565
|
-
await fs.lstat(srcpath);
|
|
1566
|
-
} catch (err) {
|
|
1567
|
-
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
1568
|
-
throw err;
|
|
1569
|
-
}
|
|
1570
|
-
return {
|
|
1571
|
-
toCwd: srcpath,
|
|
1572
|
-
toDst: path$5.relative(dstdir, srcpath)
|
|
1573
|
-
};
|
|
1574
|
-
}
|
|
1575
|
-
function symlinkPathsSync(srcpath, dstpath) {
|
|
1576
|
-
if (path$5.isAbsolute(srcpath)) {
|
|
1577
|
-
if (!fs.existsSync(srcpath)) throw new Error("absolute srcpath does not exist");
|
|
1578
|
-
return {
|
|
1579
|
-
toCwd: srcpath,
|
|
1580
|
-
toDst: srcpath
|
|
1581
|
-
};
|
|
1582
|
-
}
|
|
1583
|
-
const dstdir = path$5.dirname(dstpath);
|
|
1584
|
-
const relativeToDst = path$5.join(dstdir, srcpath);
|
|
1585
|
-
if (fs.existsSync(relativeToDst)) return {
|
|
1586
|
-
toCwd: relativeToDst,
|
|
1587
|
-
toDst: srcpath
|
|
1588
|
-
};
|
|
1589
|
-
if (!fs.existsSync(srcpath)) throw new Error("relative srcpath does not exist");
|
|
1590
|
-
return {
|
|
1591
|
-
toCwd: srcpath,
|
|
1592
|
-
toDst: path$5.relative(dstdir, srcpath)
|
|
1593
|
-
};
|
|
1594
|
-
}
|
|
1595
|
-
module.exports = {
|
|
1596
|
-
symlinkPaths: u(symlinkPaths),
|
|
1597
|
-
symlinkPathsSync
|
|
1598
|
-
};
|
|
1599
|
-
}));
|
|
1600
|
-
|
|
1601
|
-
//#endregion
|
|
1602
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/symlink-type.js
|
|
1603
|
-
var require_symlink_type = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1604
|
-
const fs = require_fs();
|
|
1605
|
-
const u = require_universalify().fromPromise;
|
|
1606
|
-
async function symlinkType(srcpath, type) {
|
|
1607
|
-
if (type) return type;
|
|
1608
|
-
let stats;
|
|
1609
|
-
try {
|
|
1610
|
-
stats = await fs.lstat(srcpath);
|
|
1611
|
-
} catch {
|
|
1612
|
-
return "file";
|
|
1613
|
-
}
|
|
1614
|
-
return stats && stats.isDirectory() ? "dir" : "file";
|
|
1615
|
-
}
|
|
1616
|
-
function symlinkTypeSync(srcpath, type) {
|
|
1617
|
-
if (type) return type;
|
|
1618
|
-
let stats;
|
|
1619
|
-
try {
|
|
1620
|
-
stats = fs.lstatSync(srcpath);
|
|
1621
|
-
} catch {
|
|
1622
|
-
return "file";
|
|
1623
|
-
}
|
|
1624
|
-
return stats && stats.isDirectory() ? "dir" : "file";
|
|
1625
|
-
}
|
|
1626
|
-
module.exports = {
|
|
1627
|
-
symlinkType: u(symlinkType),
|
|
1628
|
-
symlinkTypeSync
|
|
1629
|
-
};
|
|
1630
|
-
}));
|
|
1631
|
-
|
|
1632
|
-
//#endregion
|
|
1633
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/symlink.js
|
|
1634
|
-
var require_symlink = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1635
|
-
const u = require_universalify().fromPromise;
|
|
1636
|
-
const path$4 = __require("path");
|
|
1637
|
-
const fs = require_fs();
|
|
1638
|
-
const { mkdirs, mkdirsSync } = require_mkdirs();
|
|
1639
|
-
const { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
1640
|
-
const { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
1641
|
-
const { pathExists } = require_path_exists();
|
|
1642
|
-
const { areIdentical } = require_stat();
|
|
1643
|
-
async function createSymlink(srcpath, dstpath, type) {
|
|
1644
|
-
let stats;
|
|
1645
|
-
try {
|
|
1646
|
-
stats = await fs.lstat(dstpath);
|
|
1647
|
-
} catch {}
|
|
1648
|
-
if (stats && stats.isSymbolicLink()) {
|
|
1649
|
-
const [srcStat, dstStat] = await Promise.all([fs.stat(srcpath), fs.stat(dstpath)]);
|
|
1650
|
-
if (areIdentical(srcStat, dstStat)) return;
|
|
1651
|
-
}
|
|
1652
|
-
const relative = await symlinkPaths(srcpath, dstpath);
|
|
1653
|
-
srcpath = relative.toDst;
|
|
1654
|
-
const toType = await symlinkType(relative.toCwd, type);
|
|
1655
|
-
const dir = path$4.dirname(dstpath);
|
|
1656
|
-
if (!await pathExists(dir)) await mkdirs(dir);
|
|
1657
|
-
return fs.symlink(srcpath, dstpath, toType);
|
|
1658
|
-
}
|
|
1659
|
-
function createSymlinkSync(srcpath, dstpath, type) {
|
|
1660
|
-
let stats;
|
|
1661
|
-
try {
|
|
1662
|
-
stats = fs.lstatSync(dstpath);
|
|
1663
|
-
} catch {}
|
|
1664
|
-
if (stats && stats.isSymbolicLink()) {
|
|
1665
|
-
if (areIdentical(fs.statSync(srcpath), fs.statSync(dstpath))) return;
|
|
1666
|
-
}
|
|
1667
|
-
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
1668
|
-
srcpath = relative.toDst;
|
|
1669
|
-
type = symlinkTypeSync(relative.toCwd, type);
|
|
1670
|
-
const dir = path$4.dirname(dstpath);
|
|
1671
|
-
if (fs.existsSync(dir)) return fs.symlinkSync(srcpath, dstpath, type);
|
|
1672
|
-
mkdirsSync(dir);
|
|
1673
|
-
return fs.symlinkSync(srcpath, dstpath, type);
|
|
1674
|
-
}
|
|
1675
|
-
module.exports = {
|
|
1676
|
-
createSymlink: u(createSymlink),
|
|
1677
|
-
createSymlinkSync
|
|
1678
|
-
};
|
|
1679
|
-
}));
|
|
1680
|
-
|
|
1681
|
-
//#endregion
|
|
1682
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/index.js
|
|
1683
|
-
var require_ensure = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1684
|
-
const { createFile, createFileSync } = require_file();
|
|
1685
|
-
const { createLink, createLinkSync } = require_link();
|
|
1686
|
-
const { createSymlink, createSymlinkSync } = require_symlink();
|
|
1687
|
-
module.exports = {
|
|
1688
|
-
createFile,
|
|
1689
|
-
createFileSync,
|
|
1690
|
-
ensureFile: createFile,
|
|
1691
|
-
ensureFileSync: createFileSync,
|
|
1692
|
-
createLink,
|
|
1693
|
-
createLinkSync,
|
|
1694
|
-
ensureLink: createLink,
|
|
1695
|
-
ensureLinkSync: createLinkSync,
|
|
1696
|
-
createSymlink,
|
|
1697
|
-
createSymlinkSync,
|
|
1698
|
-
ensureSymlink: createSymlink,
|
|
1699
|
-
ensureSymlinkSync: createSymlinkSync
|
|
1700
|
-
};
|
|
1701
|
-
}));
|
|
1702
|
-
|
|
1703
|
-
//#endregion
|
|
1704
|
-
//#region ../../node_modules/.pnpm/jsonfile@6.2.0/node_modules/jsonfile/utils.js
|
|
1705
|
-
var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1706
|
-
function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
|
|
1707
|
-
const EOF = finalEOL ? EOL : "";
|
|
1708
|
-
return JSON.stringify(obj, replacer, spaces).replace(/\n/g, EOL) + EOF;
|
|
1709
|
-
}
|
|
1710
|
-
function stripBom(content) {
|
|
1711
|
-
if (Buffer.isBuffer(content)) content = content.toString("utf8");
|
|
1712
|
-
return content.replace(/^\uFEFF/, "");
|
|
1713
|
-
}
|
|
1714
|
-
module.exports = {
|
|
1715
|
-
stringify,
|
|
1716
|
-
stripBom
|
|
1717
|
-
};
|
|
1718
|
-
}));
|
|
1719
|
-
|
|
1720
|
-
//#endregion
|
|
1721
|
-
//#region ../../node_modules/.pnpm/jsonfile@6.2.0/node_modules/jsonfile/index.js
|
|
1722
|
-
var require_jsonfile$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1723
|
-
let _fs;
|
|
1724
|
-
try {
|
|
1725
|
-
_fs = require_graceful_fs();
|
|
1726
|
-
} catch (_) {
|
|
1727
|
-
_fs = __require("fs");
|
|
1728
|
-
}
|
|
1729
|
-
const universalify = require_universalify();
|
|
1730
|
-
const { stringify, stripBom } = require_utils();
|
|
1731
|
-
async function _readFile(file, options = {}) {
|
|
1732
|
-
if (typeof options === "string") options = { encoding: options };
|
|
1733
|
-
const fs = options.fs || _fs;
|
|
1734
|
-
const shouldThrow = "throws" in options ? options.throws : true;
|
|
1735
|
-
let data = await universalify.fromCallback(fs.readFile)(file, options);
|
|
1736
|
-
data = stripBom(data);
|
|
1737
|
-
let obj;
|
|
1738
|
-
try {
|
|
1739
|
-
obj = JSON.parse(data, options ? options.reviver : null);
|
|
1740
|
-
} catch (err) {
|
|
1741
|
-
if (shouldThrow) {
|
|
1742
|
-
err.message = `${file}: ${err.message}`;
|
|
1743
|
-
throw err;
|
|
1744
|
-
} else return null;
|
|
1745
|
-
}
|
|
1746
|
-
return obj;
|
|
1747
|
-
}
|
|
1748
|
-
const readFile = universalify.fromPromise(_readFile);
|
|
1749
|
-
function readFileSync(file, options = {}) {
|
|
1750
|
-
if (typeof options === "string") options = { encoding: options };
|
|
1751
|
-
const fs = options.fs || _fs;
|
|
1752
|
-
const shouldThrow = "throws" in options ? options.throws : true;
|
|
1753
|
-
try {
|
|
1754
|
-
let content = fs.readFileSync(file, options);
|
|
1755
|
-
content = stripBom(content);
|
|
1756
|
-
return JSON.parse(content, options.reviver);
|
|
1757
|
-
} catch (err) {
|
|
1758
|
-
if (shouldThrow) {
|
|
1759
|
-
err.message = `${file}: ${err.message}`;
|
|
1760
|
-
throw err;
|
|
1761
|
-
} else return null;
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1764
|
-
async function _writeFile(file, obj, options = {}) {
|
|
1765
|
-
const fs = options.fs || _fs;
|
|
1766
|
-
const str = stringify(obj, options);
|
|
1767
|
-
await universalify.fromCallback(fs.writeFile)(file, str, options);
|
|
1768
|
-
}
|
|
1769
|
-
const writeFile = universalify.fromPromise(_writeFile);
|
|
1770
|
-
function writeFileSync(file, obj, options = {}) {
|
|
1771
|
-
const fs = options.fs || _fs;
|
|
1772
|
-
const str = stringify(obj, options);
|
|
1773
|
-
return fs.writeFileSync(file, str, options);
|
|
1774
|
-
}
|
|
1775
|
-
module.exports = {
|
|
1776
|
-
readFile,
|
|
1777
|
-
readFileSync,
|
|
1778
|
-
writeFile,
|
|
1779
|
-
writeFileSync
|
|
1780
|
-
};
|
|
1781
|
-
}));
|
|
1782
|
-
|
|
1783
|
-
//#endregion
|
|
1784
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/json/jsonfile.js
|
|
1785
|
-
var require_jsonfile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1786
|
-
const jsonFile = require_jsonfile$1();
|
|
1787
|
-
module.exports = {
|
|
1788
|
-
readJson: jsonFile.readFile,
|
|
1789
|
-
readJsonSync: jsonFile.readFileSync,
|
|
1790
|
-
writeJson: jsonFile.writeFile,
|
|
1791
|
-
writeJsonSync: jsonFile.writeFileSync
|
|
1792
|
-
};
|
|
1793
|
-
}));
|
|
1794
|
-
|
|
1795
|
-
//#endregion
|
|
1796
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/output-file/index.js
|
|
1797
|
-
var require_output_file = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1798
|
-
const u = require_universalify().fromPromise;
|
|
1799
|
-
const fs = require_fs();
|
|
1800
|
-
const path$3 = __require("path");
|
|
1801
|
-
const mkdir = require_mkdirs();
|
|
1802
|
-
const pathExists = require_path_exists().pathExists;
|
|
1803
|
-
async function outputFile(file, data, encoding = "utf-8") {
|
|
1804
|
-
const dir = path$3.dirname(file);
|
|
1805
|
-
if (!await pathExists(dir)) await mkdir.mkdirs(dir);
|
|
1806
|
-
return fs.writeFile(file, data, encoding);
|
|
1807
|
-
}
|
|
1808
|
-
function outputFileSync(file, ...args) {
|
|
1809
|
-
const dir = path$3.dirname(file);
|
|
1810
|
-
if (!fs.existsSync(dir)) mkdir.mkdirsSync(dir);
|
|
1811
|
-
fs.writeFileSync(file, ...args);
|
|
1812
|
-
}
|
|
1813
|
-
module.exports = {
|
|
1814
|
-
outputFile: u(outputFile),
|
|
1815
|
-
outputFileSync
|
|
1816
|
-
};
|
|
1817
|
-
}));
|
|
1818
|
-
|
|
1819
|
-
//#endregion
|
|
1820
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/json/output-json.js
|
|
1821
|
-
var require_output_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1822
|
-
const { stringify } = require_utils();
|
|
1823
|
-
const { outputFile } = require_output_file();
|
|
1824
|
-
async function outputJson(file, data, options = {}) {
|
|
1825
|
-
await outputFile(file, stringify(data, options), options);
|
|
1826
|
-
}
|
|
1827
|
-
module.exports = outputJson;
|
|
1828
|
-
}));
|
|
1829
|
-
|
|
1830
|
-
//#endregion
|
|
1831
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/json/output-json-sync.js
|
|
1832
|
-
var require_output_json_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1833
|
-
const { stringify } = require_utils();
|
|
1834
|
-
const { outputFileSync } = require_output_file();
|
|
1835
|
-
function outputJsonSync(file, data, options) {
|
|
1836
|
-
outputFileSync(file, stringify(data, options), options);
|
|
1837
|
-
}
|
|
1838
|
-
module.exports = outputJsonSync;
|
|
1839
|
-
}));
|
|
1840
|
-
|
|
1841
|
-
//#endregion
|
|
1842
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/json/index.js
|
|
1843
|
-
var require_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1844
|
-
const u = require_universalify().fromPromise;
|
|
1845
|
-
const jsonFile = require_jsonfile();
|
|
1846
|
-
jsonFile.outputJson = u(require_output_json());
|
|
1847
|
-
jsonFile.outputJsonSync = require_output_json_sync();
|
|
1848
|
-
jsonFile.outputJSON = jsonFile.outputJson;
|
|
1849
|
-
jsonFile.outputJSONSync = jsonFile.outputJsonSync;
|
|
1850
|
-
jsonFile.writeJSON = jsonFile.writeJson;
|
|
1851
|
-
jsonFile.writeJSONSync = jsonFile.writeJsonSync;
|
|
1852
|
-
jsonFile.readJSON = jsonFile.readJson;
|
|
1853
|
-
jsonFile.readJSONSync = jsonFile.readJsonSync;
|
|
1854
|
-
module.exports = jsonFile;
|
|
1855
|
-
}));
|
|
1856
|
-
|
|
1857
|
-
//#endregion
|
|
1858
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/move/move.js
|
|
1859
|
-
var require_move$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1860
|
-
const fs = require_fs();
|
|
1861
|
-
const path$2 = __require("path");
|
|
1862
|
-
const { copy } = require_copy();
|
|
1863
|
-
const { remove } = require_remove();
|
|
1864
|
-
const { mkdirp } = require_mkdirs();
|
|
1865
|
-
const { pathExists } = require_path_exists();
|
|
1866
|
-
const stat = require_stat();
|
|
1867
|
-
async function move(src, dest, opts = {}) {
|
|
1868
|
-
const overwrite = opts.overwrite || opts.clobber || false;
|
|
1869
|
-
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
|
1870
|
-
await stat.checkParentPaths(src, srcStat, dest, "move");
|
|
1871
|
-
const destParent = path$2.dirname(dest);
|
|
1872
|
-
if (path$2.parse(destParent).root !== destParent) await mkdirp(destParent);
|
|
1873
|
-
return doRename(src, dest, overwrite, isChangingCase);
|
|
1874
|
-
}
|
|
1875
|
-
async function doRename(src, dest, overwrite, isChangingCase) {
|
|
1876
|
-
if (!isChangingCase) {
|
|
1877
|
-
if (overwrite) await remove(dest);
|
|
1878
|
-
else if (await pathExists(dest)) throw new Error("dest already exists.");
|
|
1879
|
-
}
|
|
1880
|
-
try {
|
|
1881
|
-
await fs.rename(src, dest);
|
|
1882
|
-
} catch (err) {
|
|
1883
|
-
if (err.code !== "EXDEV") throw err;
|
|
1884
|
-
await moveAcrossDevice(src, dest, overwrite);
|
|
1885
|
-
}
|
|
1886
|
-
}
|
|
1887
|
-
async function moveAcrossDevice(src, dest, overwrite) {
|
|
1888
|
-
await copy(src, dest, {
|
|
1889
|
-
overwrite,
|
|
1890
|
-
errorOnExist: true,
|
|
1891
|
-
preserveTimestamps: true
|
|
1892
|
-
});
|
|
1893
|
-
return remove(src);
|
|
1894
|
-
}
|
|
1895
|
-
module.exports = move;
|
|
1896
|
-
}));
|
|
1897
|
-
|
|
1898
|
-
//#endregion
|
|
1899
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/move/move-sync.js
|
|
1900
|
-
var require_move_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1901
|
-
const fs = require_graceful_fs();
|
|
1902
|
-
const path$1 = __require("path");
|
|
1903
|
-
const copySync = require_copy().copySync;
|
|
1904
|
-
const removeSync = require_remove().removeSync;
|
|
1905
|
-
const mkdirpSync = require_mkdirs().mkdirpSync;
|
|
1906
|
-
const stat = require_stat();
|
|
1907
|
-
function moveSync(src, dest, opts) {
|
|
1908
|
-
opts = opts || {};
|
|
1909
|
-
const overwrite = opts.overwrite || opts.clobber || false;
|
|
1910
|
-
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
1911
|
-
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
1912
|
-
if (!isParentRoot(dest)) mkdirpSync(path$1.dirname(dest));
|
|
1913
|
-
return doRename(src, dest, overwrite, isChangingCase);
|
|
1914
|
-
}
|
|
1915
|
-
function isParentRoot(dest) {
|
|
1916
|
-
const parent = path$1.dirname(dest);
|
|
1917
|
-
return path$1.parse(parent).root === parent;
|
|
1918
|
-
}
|
|
1919
|
-
function doRename(src, dest, overwrite, isChangingCase) {
|
|
1920
|
-
if (isChangingCase) return rename(src, dest, overwrite);
|
|
1921
|
-
if (overwrite) {
|
|
1922
|
-
removeSync(dest);
|
|
1923
|
-
return rename(src, dest, overwrite);
|
|
1924
|
-
}
|
|
1925
|
-
if (fs.existsSync(dest)) throw new Error("dest already exists.");
|
|
1926
|
-
return rename(src, dest, overwrite);
|
|
1927
|
-
}
|
|
1928
|
-
function rename(src, dest, overwrite) {
|
|
1929
|
-
try {
|
|
1930
|
-
fs.renameSync(src, dest);
|
|
1931
|
-
} catch (err) {
|
|
1932
|
-
if (err.code !== "EXDEV") throw err;
|
|
1933
|
-
return moveAcrossDevice(src, dest, overwrite);
|
|
1934
|
-
}
|
|
1935
|
-
}
|
|
1936
|
-
function moveAcrossDevice(src, dest, overwrite) {
|
|
1937
|
-
copySync(src, dest, {
|
|
1938
|
-
overwrite,
|
|
1939
|
-
errorOnExist: true,
|
|
1940
|
-
preserveTimestamps: true
|
|
1941
|
-
});
|
|
1942
|
-
return removeSync(src);
|
|
1943
|
-
}
|
|
1944
|
-
module.exports = moveSync;
|
|
1945
|
-
}));
|
|
1946
|
-
|
|
1947
|
-
//#endregion
|
|
1948
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/move/index.js
|
|
1949
|
-
var require_move = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1950
|
-
const u = require_universalify().fromPromise;
|
|
1951
|
-
module.exports = {
|
|
1952
|
-
move: u(require_move$1()),
|
|
1953
|
-
moveSync: require_move_sync()
|
|
1954
|
-
};
|
|
1955
|
-
}));
|
|
1956
|
-
|
|
1957
|
-
//#endregion
|
|
1958
|
-
//#region ../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/index.js
|
|
1959
|
-
var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1960
|
-
module.exports = {
|
|
1961
|
-
...require_fs(),
|
|
1962
|
-
...require_copy(),
|
|
1963
|
-
...require_empty(),
|
|
1964
|
-
...require_ensure(),
|
|
1965
|
-
...require_json(),
|
|
1966
|
-
...require_mkdirs(),
|
|
1967
|
-
...require_move(),
|
|
1968
|
-
...require_output_file(),
|
|
1969
|
-
...require_path_exists(),
|
|
1970
|
-
...require_remove()
|
|
1971
|
-
};
|
|
1972
|
-
}));
|
|
1973
|
-
|
|
1974
|
-
//#endregion
|
|
1975
|
-
//#region ../../node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.mjs
|
|
1976
|
-
var import_lib = /* @__PURE__ */ __toESM(require_lib(), 1);
|
|
9
|
+
//#region ../../node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.mjs
|
|
1977
10
|
var astralIdentifierCodes = [
|
|
1978
11
|
509,
|
|
1979
12
|
0,
|
|
@@ -2005,8 +38,8 @@ var astralIdentifierCodes = [
|
|
|
2005
38
|
4,
|
|
2006
39
|
318,
|
|
2007
40
|
1,
|
|
2008
|
-
|
|
2009
|
-
|
|
41
|
+
78,
|
|
42
|
+
5,
|
|
2010
43
|
71,
|
|
2011
44
|
10,
|
|
2012
45
|
50,
|
|
@@ -2151,7 +184,9 @@ var astralIdentifierCodes = [
|
|
|
2151
184
|
10,
|
|
2152
185
|
47,
|
|
2153
186
|
15,
|
|
2154
|
-
|
|
187
|
+
199,
|
|
188
|
+
7,
|
|
189
|
+
137,
|
|
2155
190
|
9,
|
|
2156
191
|
54,
|
|
2157
192
|
7,
|
|
@@ -2183,7 +218,9 @@ var astralIdentifierCodes = [
|
|
|
2183
218
|
4,
|
|
2184
219
|
9,
|
|
2185
220
|
9,
|
|
2186
|
-
|
|
221
|
+
55,
|
|
222
|
+
9,
|
|
223
|
+
266,
|
|
2187
224
|
3,
|
|
2188
225
|
10,
|
|
2189
226
|
1,
|
|
@@ -2283,7 +320,15 @@ var astralIdentifierCodes = [
|
|
|
2283
320
|
1,
|
|
2284
321
|
2,
|
|
2285
322
|
9,
|
|
2286
|
-
|
|
323
|
+
233,
|
|
324
|
+
0,
|
|
325
|
+
3,
|
|
326
|
+
0,
|
|
327
|
+
8,
|
|
328
|
+
1,
|
|
329
|
+
6,
|
|
330
|
+
0,
|
|
331
|
+
475,
|
|
2287
332
|
6,
|
|
2288
333
|
110,
|
|
2289
334
|
6,
|
|
@@ -2393,7 +438,9 @@ var astralIdentifierStartCodes = [
|
|
|
2393
438
|
21,
|
|
2394
439
|
11,
|
|
2395
440
|
25,
|
|
2396
|
-
|
|
441
|
+
7,
|
|
442
|
+
25,
|
|
443
|
+
39,
|
|
2397
444
|
55,
|
|
2398
445
|
7,
|
|
2399
446
|
1,
|
|
@@ -2438,8 +485,8 @@ var astralIdentifierStartCodes = [
|
|
|
2438
485
|
7,
|
|
2439
486
|
1,
|
|
2440
487
|
17,
|
|
2441
|
-
|
|
2442
|
-
|
|
488
|
+
5,
|
|
489
|
+
57,
|
|
2443
490
|
28,
|
|
2444
491
|
11,
|
|
2445
492
|
0,
|
|
@@ -2623,7 +670,9 @@ var astralIdentifierStartCodes = [
|
|
|
2623
670
|
31,
|
|
2624
671
|
15,
|
|
2625
672
|
0,
|
|
2626
|
-
|
|
673
|
+
24,
|
|
674
|
+
43,
|
|
675
|
+
261,
|
|
2627
676
|
18,
|
|
2628
677
|
16,
|
|
2629
678
|
0,
|
|
@@ -2671,7 +720,11 @@ var astralIdentifierStartCodes = [
|
|
|
2671
720
|
44,
|
|
2672
721
|
212,
|
|
2673
722
|
63,
|
|
2674
|
-
|
|
723
|
+
33,
|
|
724
|
+
24,
|
|
725
|
+
3,
|
|
726
|
+
24,
|
|
727
|
+
45,
|
|
2675
728
|
74,
|
|
2676
729
|
6,
|
|
2677
730
|
0,
|
|
@@ -2681,13 +734,15 @@ var astralIdentifierStartCodes = [
|
|
|
2681
734
|
1,
|
|
2682
735
|
2,
|
|
2683
736
|
0,
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
737
|
+
15,
|
|
738
|
+
4,
|
|
739
|
+
10,
|
|
740
|
+
7381,
|
|
2688
741
|
42,
|
|
2689
|
-
|
|
2690
|
-
|
|
742
|
+
31,
|
|
743
|
+
98,
|
|
744
|
+
114,
|
|
745
|
+
8702,
|
|
2691
746
|
3,
|
|
2692
747
|
2,
|
|
2693
748
|
6,
|
|
@@ -2795,7 +850,19 @@ var astralIdentifierStartCodes = [
|
|
|
2795
850
|
29,
|
|
2796
851
|
3,
|
|
2797
852
|
0,
|
|
2798
|
-
|
|
853
|
+
208,
|
|
854
|
+
30,
|
|
855
|
+
2,
|
|
856
|
+
2,
|
|
857
|
+
2,
|
|
858
|
+
1,
|
|
859
|
+
2,
|
|
860
|
+
6,
|
|
861
|
+
3,
|
|
862
|
+
4,
|
|
863
|
+
10,
|
|
864
|
+
1,
|
|
865
|
+
225,
|
|
2799
866
|
6,
|
|
2800
867
|
2,
|
|
2801
868
|
3,
|
|
@@ -2878,12 +945,10 @@ var astralIdentifierStartCodes = [
|
|
|
2878
945
|
4421,
|
|
2879
946
|
42719,
|
|
2880
947
|
33,
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
948
|
+
4381,
|
|
949
|
+
3,
|
|
950
|
+
5773,
|
|
2884
951
|
3,
|
|
2885
|
-
5761,
|
|
2886
|
-
15,
|
|
2887
952
|
7472,
|
|
2888
953
|
16,
|
|
2889
954
|
621,
|
|
@@ -2892,10 +957,10 @@ var astralIdentifierStartCodes = [
|
|
|
2892
957
|
1507,
|
|
2893
958
|
4938,
|
|
2894
959
|
6,
|
|
2895
|
-
|
|
960
|
+
8489
|
|
2896
961
|
];
|
|
2897
|
-
var nonASCIIidentifierChars = "
|
|
2898
|
-
var nonASCIIidentifierStartChars = "
|
|
962
|
+
var nonASCIIidentifierChars = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";
|
|
963
|
+
var nonASCIIidentifierStartChars = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";
|
|
2899
964
|
var reservedWords = {
|
|
2900
965
|
3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
|
|
2901
966
|
5: "class enum extends super const export import",
|
|
@@ -3198,6 +1263,7 @@ function getOptions(opts) {
|
|
|
3198
1263
|
};
|
|
3199
1264
|
}
|
|
3200
1265
|
if (isArray(options.onComment)) options.onComment = pushComment(options, options.onComment);
|
|
1266
|
+
if (options.sourceType === "commonjs" && options.allowAwaitOutsideFunction) throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");
|
|
3201
1267
|
return options;
|
|
3202
1268
|
}
|
|
3203
1269
|
function pushComment(options, array) {
|
|
@@ -3213,7 +1279,7 @@ function pushComment(options, array) {
|
|
|
3213
1279
|
array.push(comment);
|
|
3214
1280
|
};
|
|
3215
1281
|
}
|
|
3216
|
-
var SCOPE_TOP = 1, SCOPE_FUNCTION = 2, SCOPE_ASYNC = 4, SCOPE_GENERATOR = 8, SCOPE_ARROW = 16, SCOPE_SIMPLE_CATCH = 32, SCOPE_SUPER = 64, SCOPE_DIRECT_SUPER = 128, SCOPE_CLASS_STATIC_BLOCK = 256, SCOPE_CLASS_FIELD_INIT = 512, SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
|
|
1282
|
+
var SCOPE_TOP = 1, SCOPE_FUNCTION = 2, SCOPE_ASYNC = 4, SCOPE_GENERATOR = 8, SCOPE_ARROW = 16, SCOPE_SIMPLE_CATCH = 32, SCOPE_SUPER = 64, SCOPE_DIRECT_SUPER = 128, SCOPE_CLASS_STATIC_BLOCK = 256, SCOPE_CLASS_FIELD_INIT = 512, SCOPE_SWITCH = 1024, SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
|
|
3217
1283
|
function functionFlags(async, generator) {
|
|
3218
1284
|
return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0);
|
|
3219
1285
|
}
|
|
@@ -3258,7 +1324,7 @@ var Parser = function Parser(options, input, startPos) {
|
|
|
3258
1324
|
this.undefinedExports = Object.create(null);
|
|
3259
1325
|
if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") this.skipLineComment(2);
|
|
3260
1326
|
this.scopeStack = [];
|
|
3261
|
-
this.enterScope(SCOPE_TOP);
|
|
1327
|
+
this.enterScope(this.options.sourceType === "commonjs" ? SCOPE_FUNCTION : SCOPE_TOP);
|
|
3262
1328
|
this.regexpState = null;
|
|
3263
1329
|
this.privateNameStack = [];
|
|
3264
1330
|
};
|
|
@@ -3267,10 +1333,12 @@ var prototypeAccessors = {
|
|
|
3267
1333
|
inGenerator: { configurable: true },
|
|
3268
1334
|
inAsync: { configurable: true },
|
|
3269
1335
|
canAwait: { configurable: true },
|
|
1336
|
+
allowReturn: { configurable: true },
|
|
3270
1337
|
allowSuper: { configurable: true },
|
|
3271
1338
|
allowDirectSuper: { configurable: true },
|
|
3272
1339
|
treatFunctionsAsVar: { configurable: true },
|
|
3273
1340
|
allowNewDotTarget: { configurable: true },
|
|
1341
|
+
allowUsing: { configurable: true },
|
|
3274
1342
|
inClassStaticBlock: { configurable: true }
|
|
3275
1343
|
};
|
|
3276
1344
|
Parser.prototype.parse = function parse() {
|
|
@@ -3295,6 +1363,11 @@ prototypeAccessors.canAwait.get = function() {
|
|
|
3295
1363
|
}
|
|
3296
1364
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
3297
1365
|
};
|
|
1366
|
+
prototypeAccessors.allowReturn.get = function() {
|
|
1367
|
+
if (this.inFunction) return true;
|
|
1368
|
+
if (this.options.allowReturnOutsideFunction && this.currentVarScope().flags & SCOPE_TOP) return true;
|
|
1369
|
+
return false;
|
|
1370
|
+
};
|
|
3298
1371
|
prototypeAccessors.allowSuper.get = function() {
|
|
3299
1372
|
return (this.currentThisScope().flags & SCOPE_SUPER) > 0 || this.options.allowSuperOutsideMethod;
|
|
3300
1373
|
};
|
|
@@ -3311,6 +1384,12 @@ prototypeAccessors.allowNewDotTarget.get = function() {
|
|
|
3311
1384
|
}
|
|
3312
1385
|
return false;
|
|
3313
1386
|
};
|
|
1387
|
+
prototypeAccessors.allowUsing.get = function() {
|
|
1388
|
+
var flags = this.currentScope().flags;
|
|
1389
|
+
if (flags & SCOPE_SWITCH) return false;
|
|
1390
|
+
if (!this.inModule && flags & SCOPE_TOP) return false;
|
|
1391
|
+
return true;
|
|
1392
|
+
};
|
|
3314
1393
|
prototypeAccessors.inClassStaticBlock.get = function() {
|
|
3315
1394
|
return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0;
|
|
3316
1395
|
};
|
|
@@ -3435,7 +1514,7 @@ pp$8.parseTopLevel = function(node) {
|
|
|
3435
1514
|
}
|
|
3436
1515
|
this.adaptDirectivePrologue(node.body);
|
|
3437
1516
|
this.next();
|
|
3438
|
-
node.sourceType = this.options.sourceType;
|
|
1517
|
+
node.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType;
|
|
3439
1518
|
return this.finishNode(node, "Program");
|
|
3440
1519
|
};
|
|
3441
1520
|
var loopLabel = { kind: "loop" }, switchLabel = { kind: "switch" };
|
|
@@ -3443,15 +1522,17 @@ pp$8.isLet = function(context) {
|
|
|
3443
1522
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return false;
|
|
3444
1523
|
skipWhiteSpace.lastIndex = this.pos;
|
|
3445
1524
|
var skip = skipWhiteSpace.exec(this.input);
|
|
3446
|
-
var next = this.pos + skip[0].length, nextCh = this.
|
|
1525
|
+
var next = this.pos + skip[0].length, nextCh = this.fullCharCodeAt(next);
|
|
3447
1526
|
if (nextCh === 91 || nextCh === 92) return true;
|
|
3448
1527
|
if (context) return false;
|
|
3449
|
-
if (nextCh === 123
|
|
3450
|
-
if (isIdentifierStart(nextCh
|
|
3451
|
-
var
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
1528
|
+
if (nextCh === 123) return true;
|
|
1529
|
+
if (isIdentifierStart(nextCh)) {
|
|
1530
|
+
var start = next;
|
|
1531
|
+
do
|
|
1532
|
+
next += nextCh <= 65535 ? 1 : 2;
|
|
1533
|
+
while (isIdentifierChar(nextCh = this.fullCharCodeAt(next)));
|
|
1534
|
+
if (nextCh === 92) return true;
|
|
1535
|
+
var ident = this.input.slice(start, next);
|
|
3455
1536
|
if (!keywordRelationalOperator.test(ident)) return true;
|
|
3456
1537
|
}
|
|
3457
1538
|
return false;
|
|
@@ -3461,7 +1542,7 @@ pp$8.isAsyncFunction = function() {
|
|
|
3461
1542
|
skipWhiteSpace.lastIndex = this.pos;
|
|
3462
1543
|
var skip = skipWhiteSpace.exec(this.input);
|
|
3463
1544
|
var next = this.pos + skip[0].length, after;
|
|
3464
|
-
return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.
|
|
1545
|
+
return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.fullCharCodeAt(next + 8)) || after === 92));
|
|
3465
1546
|
};
|
|
3466
1547
|
pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
|
|
3467
1548
|
if (this.options.ecmaVersion < 17 || !this.isContextual(isAwaitUsing ? "await" : "using")) return false;
|
|
@@ -3470,20 +1551,23 @@ pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
|
|
|
3470
1551
|
var next = this.pos + skip[0].length;
|
|
3471
1552
|
if (lineBreak.test(this.input.slice(this.pos, next))) return false;
|
|
3472
1553
|
if (isAwaitUsing) {
|
|
3473
|
-
var
|
|
3474
|
-
if (this.input.slice(next,
|
|
3475
|
-
skipWhiteSpace.lastIndex =
|
|
1554
|
+
var usingEndPos = next + 5, after;
|
|
1555
|
+
if (this.input.slice(next, usingEndPos) !== "using" || usingEndPos === this.input.length || isIdentifierChar(after = this.fullCharCodeAt(usingEndPos)) || after === 92) return false;
|
|
1556
|
+
skipWhiteSpace.lastIndex = usingEndPos;
|
|
3476
1557
|
var skipAfterUsing = skipWhiteSpace.exec(this.input);
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
1558
|
+
next = usingEndPos + skipAfterUsing[0].length;
|
|
1559
|
+
if (skipAfterUsing && lineBreak.test(this.input.slice(usingEndPos, next))) return false;
|
|
1560
|
+
}
|
|
1561
|
+
var ch = this.fullCharCodeAt(next);
|
|
1562
|
+
if (!isIdentifierStart(ch) && ch !== 92) return false;
|
|
1563
|
+
var idStart = next;
|
|
1564
|
+
do
|
|
1565
|
+
next += ch <= 65535 ? 1 : 2;
|
|
1566
|
+
while (isIdentifierChar(ch = this.fullCharCodeAt(next)));
|
|
1567
|
+
if (ch === 92) return true;
|
|
1568
|
+
var id = this.input.slice(idStart, next);
|
|
1569
|
+
if (keywordRelationalOperator.test(id) || isFor && id === "of") return false;
|
|
1570
|
+
return true;
|
|
3487
1571
|
};
|
|
3488
1572
|
pp$8.isAwaitUsing = function(isFor) {
|
|
3489
1573
|
return this.isUsingKeyword(true, isFor);
|
|
@@ -3544,7 +1628,7 @@ pp$8.parseStatement = function(context, topLevel, exports) {
|
|
|
3544
1628
|
}
|
|
3545
1629
|
var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
|
|
3546
1630
|
if (usingKind) {
|
|
3547
|
-
if (
|
|
1631
|
+
if (!this.allowUsing) this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");
|
|
3548
1632
|
if (usingKind === "await using") {
|
|
3549
1633
|
if (!this.canAwait) this.raise(this.start, "Await using cannot appear outside of async function");
|
|
3550
1634
|
this.next();
|
|
@@ -3618,7 +1702,10 @@ pp$8.parseForStatement = function(node) {
|
|
|
3618
1702
|
if (usingKind) {
|
|
3619
1703
|
var init$2 = this.startNode();
|
|
3620
1704
|
this.next();
|
|
3621
|
-
if (usingKind === "await using")
|
|
1705
|
+
if (usingKind === "await using") {
|
|
1706
|
+
if (!this.canAwait) this.raise(this.start, "Await using cannot appear outside of async function");
|
|
1707
|
+
this.next();
|
|
1708
|
+
}
|
|
3622
1709
|
this.parseVar(init$2, true, usingKind);
|
|
3623
1710
|
this.finishNode(init$2, "VariableDeclaration");
|
|
3624
1711
|
return this.parseForAfterInit(node, init$2, awaitAt);
|
|
@@ -3665,7 +1752,7 @@ pp$8.parseIfStatement = function(node) {
|
|
|
3665
1752
|
return this.finishNode(node, "IfStatement");
|
|
3666
1753
|
};
|
|
3667
1754
|
pp$8.parseReturnStatement = function(node) {
|
|
3668
|
-
if (!this.
|
|
1755
|
+
if (!this.allowReturn) this.raise(this.start, "'return' outside of function");
|
|
3669
1756
|
this.next();
|
|
3670
1757
|
if (this.eat(types$1.semi) || this.insertSemicolon()) node.argument = null;
|
|
3671
1758
|
else {
|
|
@@ -3680,7 +1767,7 @@ pp$8.parseSwitchStatement = function(node) {
|
|
|
3680
1767
|
node.cases = [];
|
|
3681
1768
|
this.expect(types$1.braceL);
|
|
3682
1769
|
this.labels.push(switchLabel);
|
|
3683
|
-
this.enterScope(
|
|
1770
|
+
this.enterScope(SCOPE_SWITCH);
|
|
3684
1771
|
var cur;
|
|
3685
1772
|
for (var sawDefault = false; this.type !== types$1.braceR;) if (this.type === types$1._case || this.type === types$1._default) {
|
|
3686
1773
|
var isCase = this.type === types$1._case;
|
|
@@ -5421,29 +3508,27 @@ pp$2.copyNode = function(node) {
|
|
|
5421
3508
|
for (var prop in node) newNode[prop] = node[prop];
|
|
5422
3509
|
return newNode;
|
|
5423
3510
|
};
|
|
5424
|
-
var scriptValuesAddedInUnicode = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz";
|
|
3511
|
+
var scriptValuesAddedInUnicode = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz";
|
|
5425
3512
|
var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
|
|
5426
3513
|
var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
|
|
5427
3514
|
var ecma11BinaryProperties = ecma10BinaryProperties;
|
|
5428
3515
|
var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict";
|
|
5429
3516
|
var ecma13BinaryProperties = ecma12BinaryProperties;
|
|
5430
|
-
var ecma14BinaryProperties = ecma13BinaryProperties;
|
|
5431
3517
|
var unicodeBinaryProperties = {
|
|
5432
3518
|
9: ecma9BinaryProperties,
|
|
5433
3519
|
10: ecma10BinaryProperties,
|
|
5434
3520
|
11: ecma11BinaryProperties,
|
|
5435
3521
|
12: ecma12BinaryProperties,
|
|
5436
3522
|
13: ecma13BinaryProperties,
|
|
5437
|
-
14:
|
|
3523
|
+
14: ecma13BinaryProperties
|
|
5438
3524
|
};
|
|
5439
|
-
var ecma14BinaryPropertiesOfStrings = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji";
|
|
5440
3525
|
var unicodeBinaryPropertiesOfStrings = {
|
|
5441
3526
|
9: "",
|
|
5442
3527
|
10: "",
|
|
5443
3528
|
11: "",
|
|
5444
3529
|
12: "",
|
|
5445
3530
|
13: "",
|
|
5446
|
-
14:
|
|
3531
|
+
14: "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"
|
|
5447
3532
|
};
|
|
5448
3533
|
var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";
|
|
5449
3534
|
var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
|
|
@@ -5451,14 +3536,13 @@ var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Han
|
|
|
5451
3536
|
var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
|
|
5452
3537
|
var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
|
|
5453
3538
|
var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
|
|
5454
|
-
var ecma14ScriptValues = ecma13ScriptValues + " " + scriptValuesAddedInUnicode;
|
|
5455
3539
|
var unicodeScriptValues = {
|
|
5456
3540
|
9: ecma9ScriptValues,
|
|
5457
3541
|
10: ecma10ScriptValues,
|
|
5458
3542
|
11: ecma11ScriptValues,
|
|
5459
3543
|
12: ecma12ScriptValues,
|
|
5460
3544
|
13: ecma13ScriptValues,
|
|
5461
|
-
14:
|
|
3545
|
+
14: ecma13ScriptValues + " " + scriptValuesAddedInUnicode
|
|
5462
3546
|
};
|
|
5463
3547
|
var data = {};
|
|
5464
3548
|
function buildUnicodeData(ecmaVersion) {
|
|
@@ -6427,12 +4511,15 @@ pp.readToken = function(code) {
|
|
|
6427
4511
|
if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92) return this.readWord();
|
|
6428
4512
|
return this.getTokenFromCode(code);
|
|
6429
4513
|
};
|
|
6430
|
-
pp.
|
|
6431
|
-
var code = this.input.charCodeAt(
|
|
4514
|
+
pp.fullCharCodeAt = function(pos) {
|
|
4515
|
+
var code = this.input.charCodeAt(pos);
|
|
6432
4516
|
if (code <= 55295 || code >= 56320) return code;
|
|
6433
|
-
var next = this.input.charCodeAt(
|
|
4517
|
+
var next = this.input.charCodeAt(pos + 1);
|
|
6434
4518
|
return next <= 56319 || next >= 57344 ? code : (code << 10) + next - 56613888;
|
|
6435
4519
|
};
|
|
4520
|
+
pp.fullCharCodeAtPos = function() {
|
|
4521
|
+
return this.fullCharCodeAt(this.pos);
|
|
4522
|
+
};
|
|
6436
4523
|
pp.skipBlockComment = function() {
|
|
6437
4524
|
var startLoc = this.options.onComment && this.curPosition();
|
|
6438
4525
|
var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
|
|
@@ -6976,10 +5063,9 @@ pp.readWord = function() {
|
|
|
6976
5063
|
if (this.keywords.test(word)) type = keywords[word];
|
|
6977
5064
|
return this.finishToken(type, word);
|
|
6978
5065
|
};
|
|
6979
|
-
var version = "8.15.0";
|
|
6980
5066
|
Parser.acorn = {
|
|
6981
5067
|
Parser,
|
|
6982
|
-
version,
|
|
5068
|
+
version: "8.16.0",
|
|
6983
5069
|
defaultOptions,
|
|
6984
5070
|
Position,
|
|
6985
5071
|
SourceLocation,
|
|
@@ -6998,10 +5084,13 @@ Parser.acorn = {
|
|
|
6998
5084
|
lineBreakG,
|
|
6999
5085
|
nonASCIIwhitespace
|
|
7000
5086
|
};
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
5087
|
+
function parse$2(input, options) {
|
|
5088
|
+
return Parser.parse(input, options);
|
|
5089
|
+
}
|
|
5090
|
+
function tokenizer(input, options) {
|
|
5091
|
+
return Parser.tokenizer(input, options);
|
|
5092
|
+
}
|
|
5093
|
+
String.fromCharCode;
|
|
7005
5094
|
const TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
|
|
7006
5095
|
const JOIN_LEADING_SLASH_RE = /^\.?\//;
|
|
7007
5096
|
function hasTrailingSlash(input = "", respectQueryAndFragment) {
|
|
@@ -7033,8 +5122,6 @@ function joinURL(base, ...input) {
|
|
|
7033
5122
|
} else url = segment;
|
|
7034
5123
|
return url;
|
|
7035
5124
|
}
|
|
7036
|
-
const protocolRelative = Symbol.for("ufo:protocolRelative");
|
|
7037
|
-
|
|
7038
5125
|
//#endregion
|
|
7039
5126
|
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
7040
5127
|
let _lazyMatch = () => {
|
|
@@ -7283,12 +5370,11 @@ const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
|
7283
5370
|
const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
7284
5371
|
const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
|
|
7285
5372
|
const _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
|
|
7286
|
-
const
|
|
7287
|
-
const normalize = function(path) {
|
|
5373
|
+
const normalize$1 = function(path) {
|
|
7288
5374
|
if (path.length === 0) return ".";
|
|
7289
5375
|
path = normalizeWindowsPath(path);
|
|
7290
5376
|
const isUNCPath = path.match(_UNC_REGEX);
|
|
7291
|
-
const isPathAbsolute = isAbsolute(path);
|
|
5377
|
+
const isPathAbsolute = isAbsolute$1(path);
|
|
7292
5378
|
const trailingSeparator = path[path.length - 1] === "/";
|
|
7293
5379
|
path = normalizeString(path, !isPathAbsolute);
|
|
7294
5380
|
if (path.length === 0) {
|
|
@@ -7301,9 +5387,9 @@ const normalize = function(path) {
|
|
|
7301
5387
|
if (!isPathAbsolute) return `//./${path}`;
|
|
7302
5388
|
return `//${path}`;
|
|
7303
5389
|
}
|
|
7304
|
-
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
5390
|
+
return isPathAbsolute && !isAbsolute$1(path) ? `/${path}` : path;
|
|
7305
5391
|
};
|
|
7306
|
-
const join = function(...segments) {
|
|
5392
|
+
const join$1 = function(...segments) {
|
|
7307
5393
|
let path = "";
|
|
7308
5394
|
for (const seg of segments) {
|
|
7309
5395
|
if (!seg) continue;
|
|
@@ -7314,13 +5400,13 @@ const join = function(...segments) {
|
|
|
7314
5400
|
else path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
7315
5401
|
} else path += seg;
|
|
7316
5402
|
}
|
|
7317
|
-
return normalize(path);
|
|
5403
|
+
return normalize$1(path);
|
|
7318
5404
|
};
|
|
7319
5405
|
function cwd$1() {
|
|
7320
5406
|
if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
|
|
7321
5407
|
return "/";
|
|
7322
5408
|
}
|
|
7323
|
-
const resolve = function(...arguments_) {
|
|
5409
|
+
const resolve$2 = function(...arguments_) {
|
|
7324
5410
|
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
7325
5411
|
let resolvedPath = "";
|
|
7326
5412
|
let resolvedAbsolute = false;
|
|
@@ -7328,10 +5414,10 @@ const resolve = function(...arguments_) {
|
|
|
7328
5414
|
const path = index >= 0 ? arguments_[index] : cwd$1();
|
|
7329
5415
|
if (!path || path.length === 0) continue;
|
|
7330
5416
|
resolvedPath = `${path}/${resolvedPath}`;
|
|
7331
|
-
resolvedAbsolute = isAbsolute(path);
|
|
5417
|
+
resolvedAbsolute = isAbsolute$1(path);
|
|
7332
5418
|
}
|
|
7333
5419
|
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
7334
|
-
if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
|
|
5420
|
+
if (resolvedAbsolute && !isAbsolute$1(resolvedPath)) return `/${resolvedPath}`;
|
|
7335
5421
|
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
7336
5422
|
};
|
|
7337
5423
|
function normalizeString(path, allowAboveRoot) {
|
|
@@ -7384,20 +5470,20 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
7384
5470
|
}
|
|
7385
5471
|
return res;
|
|
7386
5472
|
}
|
|
7387
|
-
const isAbsolute = function(p) {
|
|
5473
|
+
const isAbsolute$1 = function(p) {
|
|
7388
5474
|
return _IS_ABSOLUTE_RE.test(p);
|
|
7389
5475
|
};
|
|
7390
5476
|
const toNamespacedPath = function(p) {
|
|
7391
5477
|
return normalizeWindowsPath(p);
|
|
7392
5478
|
};
|
|
7393
|
-
const extname$
|
|
5479
|
+
const extname$2 = function(p) {
|
|
7394
5480
|
if (p === "..") return "";
|
|
7395
5481
|
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
7396
5482
|
return match && match[1] || "";
|
|
7397
5483
|
};
|
|
7398
|
-
const relative = function(from, to) {
|
|
7399
|
-
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
7400
|
-
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
5484
|
+
const relative$1 = function(from, to) {
|
|
5485
|
+
const _from = resolve$2(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
5486
|
+
const _to = resolve$2(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
7401
5487
|
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) return _to.join("/");
|
|
7402
5488
|
const _fromCopy = [..._from];
|
|
7403
5489
|
for (const segment of _fromCopy) {
|
|
@@ -7407,10 +5493,10 @@ const relative = function(from, to) {
|
|
|
7407
5493
|
}
|
|
7408
5494
|
return [..._from.map(() => ".."), ..._to].join("/");
|
|
7409
5495
|
};
|
|
7410
|
-
const dirname = function(p) {
|
|
5496
|
+
const dirname$1 = function(p) {
|
|
7411
5497
|
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
7412
5498
|
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
|
|
7413
|
-
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
5499
|
+
return segments.join("/") || (isAbsolute$1(p) ? "/" : ".");
|
|
7414
5500
|
};
|
|
7415
5501
|
const format$1 = function(p) {
|
|
7416
5502
|
const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
|
|
@@ -7419,9 +5505,9 @@ const format$1 = function(p) {
|
|
|
7419
5505
|
p.dir,
|
|
7420
5506
|
p.base ?? (p.name ?? "") + ext
|
|
7421
5507
|
].filter(Boolean);
|
|
7422
|
-
return normalizeWindowsPath(p.root ? resolve(...segments) : segments.join("/"));
|
|
5508
|
+
return normalizeWindowsPath(p.root ? resolve$2(...segments) : segments.join("/"));
|
|
7423
5509
|
};
|
|
7424
|
-
const basename = function(p, extension) {
|
|
5510
|
+
const basename$1 = function(p, extension) {
|
|
7425
5511
|
const segments = normalizeWindowsPath(p).split("/");
|
|
7426
5512
|
let lastSegment = "";
|
|
7427
5513
|
for (let i = segments.length - 1; i >= 0; i--) {
|
|
@@ -7435,37 +5521,36 @@ const basename = function(p, extension) {
|
|
|
7435
5521
|
};
|
|
7436
5522
|
const parse$1 = function(p) {
|
|
7437
5523
|
const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
|
|
7438
|
-
const base = basename(p);
|
|
7439
|
-
const extension = extname$
|
|
5524
|
+
const base = basename$1(p);
|
|
5525
|
+
const extension = extname$2(base);
|
|
7440
5526
|
return {
|
|
7441
5527
|
root,
|
|
7442
|
-
dir: dirname(p),
|
|
5528
|
+
dir: dirname$1(p),
|
|
7443
5529
|
base,
|
|
7444
5530
|
ext: extension,
|
|
7445
5531
|
name: base.slice(0, base.length - extension.length)
|
|
7446
5532
|
};
|
|
7447
5533
|
};
|
|
7448
5534
|
const matchesGlob = (path, pattern) => {
|
|
7449
|
-
return zeptomatch(pattern, normalize(path));
|
|
5535
|
+
return zeptomatch(pattern, normalize$1(path));
|
|
7450
5536
|
};
|
|
7451
5537
|
const _path = {
|
|
7452
5538
|
__proto__: null,
|
|
7453
|
-
basename,
|
|
7454
|
-
dirname,
|
|
7455
|
-
extname: extname$
|
|
5539
|
+
basename: basename$1,
|
|
5540
|
+
dirname: dirname$1,
|
|
5541
|
+
extname: extname$2,
|
|
7456
5542
|
format: format$1,
|
|
7457
|
-
isAbsolute,
|
|
7458
|
-
join,
|
|
5543
|
+
isAbsolute: isAbsolute$1,
|
|
5544
|
+
join: join$1,
|
|
7459
5545
|
matchesGlob,
|
|
7460
|
-
normalize,
|
|
5546
|
+
normalize: normalize$1,
|
|
7461
5547
|
normalizeString,
|
|
7462
5548
|
parse: parse$1,
|
|
7463
|
-
relative,
|
|
7464
|
-
resolve,
|
|
7465
|
-
sep,
|
|
5549
|
+
relative: relative$1,
|
|
5550
|
+
resolve: resolve$2,
|
|
5551
|
+
sep: "/",
|
|
7466
5552
|
toNamespacedPath
|
|
7467
5553
|
};
|
|
7468
|
-
|
|
7469
5554
|
//#endregion
|
|
7470
5555
|
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs
|
|
7471
5556
|
const delimiter = globalThis.process?.platform === "win32" ? ";" : ":";
|
|
@@ -7477,19 +5562,39 @@ const mix = (del = delimiter) => {
|
|
|
7477
5562
|
return new Proxy(_path, { get(_, prop) {
|
|
7478
5563
|
if (prop === "delimiter") return del;
|
|
7479
5564
|
if (prop === "posix") return posix;
|
|
7480
|
-
if (prop === "win32") return win32;
|
|
5565
|
+
if (prop === "win32") return win32$1;
|
|
7481
5566
|
return _platforms[prop] || _path[prop];
|
|
7482
5567
|
} });
|
|
7483
5568
|
};
|
|
7484
5569
|
const posix = /* @__PURE__ */ mix(":");
|
|
7485
|
-
const win32 = /* @__PURE__ */ mix(";");
|
|
7486
|
-
|
|
5570
|
+
const win32$1 = /* @__PURE__ */ mix(";");
|
|
7487
5571
|
//#endregion
|
|
7488
|
-
//#region ../../node_modules/.pnpm/mlly@1.8.
|
|
5572
|
+
//#region ../../node_modules/.pnpm/mlly@1.8.2/node_modules/mlly/dist/index.mjs
|
|
7489
5573
|
const BUILTIN_MODULES = new Set(builtinModules);
|
|
7490
5574
|
function normalizeSlash(path) {
|
|
7491
5575
|
return path.replace(/\\/g, "/");
|
|
7492
5576
|
}
|
|
5577
|
+
function matchAll(regex, string, addition) {
|
|
5578
|
+
const matches = [];
|
|
5579
|
+
for (const match of string.matchAll(regex)) matches.push({
|
|
5580
|
+
...addition,
|
|
5581
|
+
...match.groups,
|
|
5582
|
+
code: match[0],
|
|
5583
|
+
start: match.index,
|
|
5584
|
+
end: (match.index || 0) + match[0].length
|
|
5585
|
+
});
|
|
5586
|
+
return matches;
|
|
5587
|
+
}
|
|
5588
|
+
function clearImports(imports) {
|
|
5589
|
+
return (imports || "").replace(/\/\/[^\n]*\n|\/\*.*\*\//g, "").replace(/\s+/g, " ");
|
|
5590
|
+
}
|
|
5591
|
+
function getImportNames(cleanedImports) {
|
|
5592
|
+
const topLevelImports = cleanedImports.replace(/{[^}]*}/, "");
|
|
5593
|
+
return {
|
|
5594
|
+
namespacedImport: topLevelImports.match(/\* as \s*(\S*)/)?.[1],
|
|
5595
|
+
defaultImport: topLevelImports.split(",").find((index) => !/[*{}]/.test(index))?.trim() || void 0
|
|
5596
|
+
};
|
|
5597
|
+
}
|
|
7493
5598
|
/**
|
|
7494
5599
|
* @typedef ErrnoExceptionFields
|
|
7495
5600
|
* @property {number | undefined} [errnode]
|
|
@@ -7541,7 +5646,7 @@ codes.ERR_INVALID_ARG_TYPE = createError(
|
|
|
7541
5646
|
* @param {unknown} actual
|
|
7542
5647
|
*/
|
|
7543
5648
|
(name, expected, actual) => {
|
|
7544
|
-
assert(typeof name === "string", "'name' must be a string");
|
|
5649
|
+
assert.ok(typeof name === "string", "'name' must be a string");
|
|
7545
5650
|
if (!Array.isArray(expected)) expected = [expected];
|
|
7546
5651
|
let message = "The ";
|
|
7547
5652
|
if (name.endsWith(" argument")) message += `${name} `;
|
|
@@ -7557,10 +5662,10 @@ codes.ERR_INVALID_ARG_TYPE = createError(
|
|
|
7557
5662
|
/** @type {Array<string>} */
|
|
7558
5663
|
const other = [];
|
|
7559
5664
|
for (const value of expected) {
|
|
7560
|
-
assert(typeof value === "string", "All expected entries have to be of type string");
|
|
5665
|
+
assert.ok(typeof value === "string", "All expected entries have to be of type string");
|
|
7561
5666
|
if (kTypes.has(value)) types.push(value.toLowerCase());
|
|
7562
5667
|
else if (classRegExp.exec(value) === null) {
|
|
7563
|
-
assert(value !== "object", "The value \"object\" should be written as \"Object\"");
|
|
5668
|
+
assert.ok(value !== "object", "The value \"object\" should be written as \"Object\"");
|
|
7564
5669
|
other.push(value);
|
|
7565
5670
|
} else instances.push(value);
|
|
7566
5671
|
}
|
|
@@ -7625,7 +5730,7 @@ codes.ERR_INVALID_PACKAGE_TARGET = createError(
|
|
|
7625
5730
|
(packagePath, key, target, isImport = false, base = void 0) => {
|
|
7626
5731
|
const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
|
|
7627
5732
|
if (key === ".") {
|
|
7628
|
-
assert(isImport === false);
|
|
5733
|
+
assert.ok(isImport === false);
|
|
7629
5734
|
return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? "; targets must start with \"./\"" : ""}`;
|
|
7630
5735
|
}
|
|
7631
5736
|
return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? "; targets must start with \"./\"" : ""}`;
|
|
@@ -7733,6 +5838,7 @@ function makeNodeErrorWithCode(Base, key) {
|
|
|
7733
5838
|
configurable: true
|
|
7734
5839
|
},
|
|
7735
5840
|
toString: {
|
|
5841
|
+
/** @this {Error} */
|
|
7736
5842
|
value() {
|
|
7737
5843
|
return `${this.name} [${key}]: ${this.message}`;
|
|
7738
5844
|
},
|
|
@@ -7792,15 +5898,15 @@ const captureLargerStackTrace = hideStackFrames(
|
|
|
7792
5898
|
*/
|
|
7793
5899
|
function getMessage(key, parameters, self) {
|
|
7794
5900
|
const message = messages.get(key);
|
|
7795
|
-
assert(message !== void 0, "expected `message` to be found");
|
|
5901
|
+
assert.ok(message !== void 0, "expected `message` to be found");
|
|
7796
5902
|
if (typeof message === "function") {
|
|
7797
|
-
assert(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`);
|
|
5903
|
+
assert.ok(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`);
|
|
7798
5904
|
return Reflect.apply(message, self, parameters);
|
|
7799
5905
|
}
|
|
7800
5906
|
const regex = /%[dfijoOs]/g;
|
|
7801
5907
|
let expectedLength = 0;
|
|
7802
5908
|
while (regex.exec(message) !== null) expectedLength++;
|
|
7803
|
-
assert(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`);
|
|
5909
|
+
assert.ok(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`);
|
|
7804
5910
|
if (parameters.length === 0) return message;
|
|
7805
5911
|
parameters.unshift(message);
|
|
7806
5912
|
return Reflect.apply(format, null, parameters);
|
|
@@ -7960,7 +6066,7 @@ function getDataProtocolModuleFormat(parsed) {
|
|
|
7960
6066
|
* @param {URL} url
|
|
7961
6067
|
* @returns {string}
|
|
7962
6068
|
*/
|
|
7963
|
-
function extname(url) {
|
|
6069
|
+
function extname$1(url) {
|
|
7964
6070
|
const pathname = url.pathname;
|
|
7965
6071
|
let index = pathname.length;
|
|
7966
6072
|
while (index--) {
|
|
@@ -7974,7 +6080,7 @@ function extname(url) {
|
|
|
7974
6080
|
* @type {ProtocolHandler}
|
|
7975
6081
|
*/
|
|
7976
6082
|
function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
|
|
7977
|
-
const value = extname(url);
|
|
6083
|
+
const value = extname$1(url);
|
|
7978
6084
|
if (value === ".js") {
|
|
7979
6085
|
const packageType = getPackageType(url);
|
|
7980
6086
|
if (packageType !== "none") return packageType;
|
|
@@ -8001,6 +6107,21 @@ function defaultGetFormatWithoutErrors(url, context) {
|
|
|
8001
6107
|
if (!hasOwnProperty.call(protocolHandlers, protocol)) return null;
|
|
8002
6108
|
return protocolHandlers[protocol](url, context, true) || null;
|
|
8003
6109
|
}
|
|
6110
|
+
const DEFAULT_CONDITIONS = Object.freeze(["node", "import"]);
|
|
6111
|
+
const DEFAULT_CONDITIONS_SET$1 = new Set(DEFAULT_CONDITIONS);
|
|
6112
|
+
/**
|
|
6113
|
+
* Returns the default conditions for ES module loading, as a Set.
|
|
6114
|
+
*/
|
|
6115
|
+
function getDefaultConditionsSet() {
|
|
6116
|
+
return DEFAULT_CONDITIONS_SET$1;
|
|
6117
|
+
}
|
|
6118
|
+
/**
|
|
6119
|
+
* @param {Array<string>} [conditions]
|
|
6120
|
+
* @returns {Set<string>}
|
|
6121
|
+
*/
|
|
6122
|
+
function getConditionsSet(conditions) {
|
|
6123
|
+
return getDefaultConditionsSet();
|
|
6124
|
+
}
|
|
8004
6125
|
const RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
|
|
8005
6126
|
const { ERR_INVALID_MODULE_SPECIFIER, ERR_INVALID_PACKAGE_CONFIG, ERR_INVALID_PACKAGE_TARGET, ERR_MODULE_NOT_FOUND, ERR_PACKAGE_IMPORT_NOT_DEFINED, ERR_PACKAGE_PATH_NOT_EXPORTED, ERR_UNSUPPORTED_DIR_IMPORT, ERR_UNSUPPORTED_RESOLVE_REQUEST } = codes;
|
|
8006
6127
|
const own = {}.hasOwnProperty;
|
|
@@ -8039,7 +6160,7 @@ function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
|
|
|
8039
6160
|
if (process$1.noDeprecation) return;
|
|
8040
6161
|
if (defaultGetFormatWithoutErrors(url, { parentURL: base.href }) !== "module") return;
|
|
8041
6162
|
const urlPath = fileURLToPath(url.href);
|
|
8042
|
-
const packagePath = fileURLToPath(new URL
|
|
6163
|
+
const packagePath = fileURLToPath(new URL(".", packageJsonUrl));
|
|
8043
6164
|
const basePath = fileURLToPath(base);
|
|
8044
6165
|
if (!main) process$1.emitWarning(`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\nDefault "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
|
|
8045
6166
|
else if (path.resolve(packagePath, main) !== urlPath) process$1.emitWarning(`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
|
|
@@ -8079,7 +6200,7 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
|
|
|
8079
6200
|
/** @type {URL | undefined} */
|
|
8080
6201
|
let guess;
|
|
8081
6202
|
if (packageConfig.main !== void 0) {
|
|
8082
|
-
guess = new URL
|
|
6203
|
+
guess = new URL(packageConfig.main, packageJsonUrl);
|
|
8083
6204
|
if (fileExists(guess)) return guess;
|
|
8084
6205
|
const tries = [
|
|
8085
6206
|
`./${packageConfig.main}.js`,
|
|
@@ -8091,7 +6212,7 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
|
|
|
8091
6212
|
];
|
|
8092
6213
|
let i = -1;
|
|
8093
6214
|
while (++i < tries.length) {
|
|
8094
|
-
guess = new URL
|
|
6215
|
+
guess = new URL(tries[i], packageJsonUrl);
|
|
8095
6216
|
if (fileExists(guess)) break;
|
|
8096
6217
|
guess = void 0;
|
|
8097
6218
|
}
|
|
@@ -8107,7 +6228,7 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
|
|
|
8107
6228
|
];
|
|
8108
6229
|
let i = -1;
|
|
8109
6230
|
while (++i < tries.length) {
|
|
8110
|
-
guess = new URL
|
|
6231
|
+
guess = new URL(tries[i], packageJsonUrl);
|
|
8111
6232
|
if (fileExists(guess)) break;
|
|
8112
6233
|
guess = void 0;
|
|
8113
6234
|
}
|
|
@@ -8115,7 +6236,7 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
|
|
|
8115
6236
|
emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main);
|
|
8116
6237
|
return guess;
|
|
8117
6238
|
}
|
|
8118
|
-
throw new ERR_MODULE_NOT_FOUND(fileURLToPath(new URL
|
|
6239
|
+
throw new ERR_MODULE_NOT_FOUND(fileURLToPath(new URL(".", packageJsonUrl)), fileURLToPath(base));
|
|
8119
6240
|
}
|
|
8120
6241
|
/**
|
|
8121
6242
|
* @param {URL} resolved
|
|
@@ -8162,7 +6283,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
|
8162
6283
|
* @returns {Error}
|
|
8163
6284
|
*/
|
|
8164
6285
|
function importNotDefined(specifier, packageJsonUrl, base) {
|
|
8165
|
-
return new ERR_PACKAGE_IMPORT_NOT_DEFINED(specifier, packageJsonUrl && fileURLToPath(new URL
|
|
6286
|
+
return new ERR_PACKAGE_IMPORT_NOT_DEFINED(specifier, packageJsonUrl && fileURLToPath(new URL(".", packageJsonUrl)), fileURLToPath(base));
|
|
8166
6287
|
}
|
|
8167
6288
|
/**
|
|
8168
6289
|
* @param {string} subpath
|
|
@@ -8171,7 +6292,7 @@ function importNotDefined(specifier, packageJsonUrl, base) {
|
|
|
8171
6292
|
* @returns {Error}
|
|
8172
6293
|
*/
|
|
8173
6294
|
function exportsNotFound(subpath, packageJsonUrl, base) {
|
|
8174
|
-
return new ERR_PACKAGE_PATH_NOT_EXPORTED(fileURLToPath(new URL
|
|
6295
|
+
return new ERR_PACKAGE_PATH_NOT_EXPORTED(fileURLToPath(new URL(".", packageJsonUrl)), subpath, base && fileURLToPath(base));
|
|
8175
6296
|
}
|
|
8176
6297
|
/**
|
|
8177
6298
|
* @param {string} request
|
|
@@ -8194,7 +6315,7 @@ function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) {
|
|
|
8194
6315
|
*/
|
|
8195
6316
|
function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) {
|
|
8196
6317
|
target = typeof target === "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`;
|
|
8197
|
-
return new ERR_INVALID_PACKAGE_TARGET(fileURLToPath(new URL
|
|
6318
|
+
return new ERR_INVALID_PACKAGE_TARGET(fileURLToPath(new URL(".", packageJsonUrl)), subpath, target, internal, base && fileURLToPath(base));
|
|
8198
6319
|
}
|
|
8199
6320
|
/**
|
|
8200
6321
|
* @param {string} target
|
|
@@ -8214,7 +6335,7 @@ function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base
|
|
|
8214
6335
|
if (internal && !target.startsWith("../") && !target.startsWith("/")) {
|
|
8215
6336
|
let isURL = false;
|
|
8216
6337
|
try {
|
|
8217
|
-
new URL
|
|
6338
|
+
new URL(target);
|
|
8218
6339
|
isURL = true;
|
|
8219
6340
|
} catch {}
|
|
8220
6341
|
if (!isURL) return packageResolve(pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target + subpath, packageJsonUrl, conditions);
|
|
@@ -8227,9 +6348,9 @@ function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base
|
|
|
8227
6348
|
emitInvalidSegmentDeprecation(pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target, request, match, packageJsonUrl, internal, base, true);
|
|
8228
6349
|
}
|
|
8229
6350
|
} else throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
8230
|
-
const resolved = new URL
|
|
6351
|
+
const resolved = new URL(target, packageJsonUrl);
|
|
8231
6352
|
const resolvedPath = resolved.pathname;
|
|
8232
|
-
const packagePath = new URL
|
|
6353
|
+
const packagePath = new URL(".", packageJsonUrl).pathname;
|
|
8233
6354
|
if (!resolvedPath.startsWith(packagePath)) throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
8234
6355
|
if (subpath === "") return resolved;
|
|
8235
6356
|
if (invalidSegmentRegEx.exec(subpath) !== null) {
|
|
@@ -8238,8 +6359,8 @@ function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base
|
|
|
8238
6359
|
if (!isPathMap) emitInvalidSegmentDeprecation(pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target, request, match, packageJsonUrl, internal, base, false);
|
|
8239
6360
|
} else throwInvalidSubpath(request, match, packageJsonUrl, internal, base);
|
|
8240
6361
|
}
|
|
8241
|
-
if (pattern) return new URL
|
|
8242
|
-
return new URL
|
|
6362
|
+
if (pattern) return new URL(RegExpPrototypeSymbolReplace.call(patternRegEx, resolved.href, () => subpath));
|
|
6363
|
+
return new URL(subpath, resolved);
|
|
8243
6364
|
}
|
|
8244
6365
|
/**
|
|
8245
6366
|
* @param {string} key
|
|
@@ -8321,10 +6442,10 @@ function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, b
|
|
|
8321
6442
|
* @param {URL} base
|
|
8322
6443
|
* @returns {boolean}
|
|
8323
6444
|
*/
|
|
8324
|
-
function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
|
|
8325
|
-
if (typeof exports === "string" || Array.isArray(exports)) return true;
|
|
8326
|
-
if (typeof exports !== "object" || exports === null) return false;
|
|
8327
|
-
const keys = Object.getOwnPropertyNames(exports);
|
|
6445
|
+
function isConditionalExportsMainSugar(exports$1, packageJsonUrl, base) {
|
|
6446
|
+
if (typeof exports$1 === "string" || Array.isArray(exports$1)) return true;
|
|
6447
|
+
if (typeof exports$1 !== "object" || exports$1 === null) return false;
|
|
6448
|
+
const keys = Object.getOwnPropertyNames(exports$1);
|
|
8328
6449
|
let isConditionalSugar = false;
|
|
8329
6450
|
let i = 0;
|
|
8330
6451
|
let keyIndex = -1;
|
|
@@ -8357,17 +6478,17 @@ function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
|
|
|
8357
6478
|
* @returns {URL}
|
|
8358
6479
|
*/
|
|
8359
6480
|
function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) {
|
|
8360
|
-
let exports = packageConfig.exports;
|
|
8361
|
-
if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) exports = { ".": exports };
|
|
8362
|
-
if (own.call(exports, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) {
|
|
8363
|
-
const target = exports[packageSubpath];
|
|
6481
|
+
let exports$1 = packageConfig.exports;
|
|
6482
|
+
if (isConditionalExportsMainSugar(exports$1, packageJsonUrl, base)) exports$1 = { ".": exports$1 };
|
|
6483
|
+
if (own.call(exports$1, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) {
|
|
6484
|
+
const target = exports$1[packageSubpath];
|
|
8364
6485
|
const resolveResult = resolvePackageTarget(packageJsonUrl, target, "", packageSubpath, base, false, false, false, conditions);
|
|
8365
6486
|
if (resolveResult === null || resolveResult === void 0) throw exportsNotFound(packageSubpath, packageJsonUrl, base);
|
|
8366
6487
|
return resolveResult;
|
|
8367
6488
|
}
|
|
8368
6489
|
let bestMatch = "";
|
|
8369
6490
|
let bestMatchSubpath = "";
|
|
8370
|
-
const keys = Object.getOwnPropertyNames(exports);
|
|
6491
|
+
const keys = Object.getOwnPropertyNames(exports$1);
|
|
8371
6492
|
let i = -1;
|
|
8372
6493
|
while (++i < keys.length) {
|
|
8373
6494
|
const key = keys[i];
|
|
@@ -8382,7 +6503,7 @@ function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, ba
|
|
|
8382
6503
|
}
|
|
8383
6504
|
}
|
|
8384
6505
|
if (bestMatch) {
|
|
8385
|
-
const target = exports[bestMatch];
|
|
6506
|
+
const target = exports$1[bestMatch];
|
|
8386
6507
|
const resolveResult = resolvePackageTarget(packageJsonUrl, target, bestMatchSubpath, bestMatch, base, true, false, packageSubpath.endsWith("/"), conditions);
|
|
8387
6508
|
if (resolveResult === null || resolveResult === void 0) throw exportsNotFound(packageSubpath, packageJsonUrl, base);
|
|
8388
6509
|
return resolveResult;
|
|
@@ -8477,7 +6598,7 @@ function parsePackageName(specifier, base) {
|
|
|
8477
6598
|
* @returns {URL}
|
|
8478
6599
|
*/
|
|
8479
6600
|
function packageResolve(specifier, base, conditions) {
|
|
8480
|
-
if (builtinModules.includes(specifier)) return new URL
|
|
6601
|
+
if (builtinModules.includes(specifier)) return new URL("node:" + specifier);
|
|
8481
6602
|
const { packageName, packageSubpath, isScoped } = parsePackageName(specifier, base);
|
|
8482
6603
|
const packageConfig = getPackageScopeConfig(base);
|
|
8483
6604
|
/* c8 ignore next 16 */
|
|
@@ -8485,7 +6606,7 @@ function packageResolve(specifier, base, conditions) {
|
|
|
8485
6606
|
const packageJsonUrl = pathToFileURL(packageConfig.pjsonPath);
|
|
8486
6607
|
if (packageConfig.name === packageName && packageConfig.exports !== void 0 && packageConfig.exports !== null) return packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions);
|
|
8487
6608
|
}
|
|
8488
|
-
let packageJsonUrl = new URL
|
|
6609
|
+
let packageJsonUrl = new URL("./node_modules/" + packageName + "/package.json", base);
|
|
8489
6610
|
let packageJsonPath = fileURLToPath(packageJsonUrl);
|
|
8490
6611
|
/** @type {string} */
|
|
8491
6612
|
let lastPath;
|
|
@@ -8493,7 +6614,7 @@ function packageResolve(specifier, base, conditions) {
|
|
|
8493
6614
|
const stat = tryStatSync(packageJsonPath.slice(0, -13));
|
|
8494
6615
|
if (!stat || !stat.isDirectory()) {
|
|
8495
6616
|
lastPath = packageJsonPath;
|
|
8496
|
-
packageJsonUrl = new URL
|
|
6617
|
+
packageJsonUrl = new URL((isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json", packageJsonUrl);
|
|
8497
6618
|
packageJsonPath = fileURLToPath(packageJsonUrl);
|
|
8498
6619
|
continue;
|
|
8499
6620
|
}
|
|
@@ -8503,7 +6624,7 @@ function packageResolve(specifier, base, conditions) {
|
|
|
8503
6624
|
});
|
|
8504
6625
|
if (packageConfig.exports !== void 0 && packageConfig.exports !== null) return packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions);
|
|
8505
6626
|
if (packageSubpath === ".") return legacyMainResolve(packageJsonUrl, packageConfig, base);
|
|
8506
|
-
return new URL
|
|
6627
|
+
return new URL(packageSubpath, packageJsonUrl);
|
|
8507
6628
|
} while (packageJsonPath.length !== lastPath.length);
|
|
8508
6629
|
throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), false);
|
|
8509
6630
|
}
|
|
@@ -8543,12 +6664,13 @@ function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {
|
|
|
8543
6664
|
* A URL object to the found thing.
|
|
8544
6665
|
*/
|
|
8545
6666
|
function moduleResolve(specifier, base, conditions, preserveSymlinks) {
|
|
6667
|
+
if (conditions === void 0) conditions = getConditionsSet();
|
|
8546
6668
|
const protocol = base.protocol;
|
|
8547
6669
|
const isRemote = protocol === "data:" || protocol === "http:" || protocol === "https:";
|
|
8548
6670
|
/** @type {URL | undefined} */
|
|
8549
6671
|
let resolved;
|
|
8550
6672
|
if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) try {
|
|
8551
|
-
resolved = new URL
|
|
6673
|
+
resolved = new URL(specifier, base);
|
|
8552
6674
|
} catch (error_) {
|
|
8553
6675
|
const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
|
|
8554
6676
|
error.cause = error_;
|
|
@@ -8556,7 +6678,7 @@ function moduleResolve(specifier, base, conditions, preserveSymlinks) {
|
|
|
8556
6678
|
}
|
|
8557
6679
|
else if (protocol === "file:" && specifier[0] === "#") resolved = packageImportsResolve(specifier, base, conditions);
|
|
8558
6680
|
else try {
|
|
8559
|
-
resolved = new URL
|
|
6681
|
+
resolved = new URL(specifier);
|
|
8560
6682
|
} catch (error_) {
|
|
8561
6683
|
if (isRemote && !builtinModules.includes(specifier)) {
|
|
8562
6684
|
const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
|
|
@@ -8565,7 +6687,7 @@ function moduleResolve(specifier, base, conditions, preserveSymlinks) {
|
|
|
8565
6687
|
}
|
|
8566
6688
|
resolved = packageResolve(specifier, base, conditions);
|
|
8567
6689
|
}
|
|
8568
|
-
assert(resolved !== void 0, "expected to be defined");
|
|
6690
|
+
assert.ok(resolved !== void 0, "expected to be defined");
|
|
8569
6691
|
if (resolved.protocol !== "file:") return resolved;
|
|
8570
6692
|
return finalizeResolution(resolved, base);
|
|
8571
6693
|
}
|
|
@@ -8582,6 +6704,9 @@ function normalizeid(id) {
|
|
|
8582
6704
|
if (BUILTIN_MODULES.has(id)) return "node:" + id;
|
|
8583
6705
|
return "file://" + encodeURI(normalizeSlash(id));
|
|
8584
6706
|
}
|
|
6707
|
+
async function loadURL(url) {
|
|
6708
|
+
return await promises.readFile(fileURLToPath$1(url), "utf8");
|
|
6709
|
+
}
|
|
8585
6710
|
const DEFAULT_CONDITIONS_SET = /* @__PURE__ */ new Set(["node", "import"]);
|
|
8586
6711
|
const DEFAULT_EXTENSIONS = [
|
|
8587
6712
|
".mjs",
|
|
@@ -8608,7 +6733,7 @@ function _resolve(id, options = {}) {
|
|
|
8608
6733
|
if (/(?:node|data|http|https):/.test(id)) return id;
|
|
8609
6734
|
if (BUILTIN_MODULES.has(id)) return "node:" + id;
|
|
8610
6735
|
if (id.startsWith("file://")) id = fileURLToPath$1(id);
|
|
8611
|
-
if (isAbsolute(id)) try {
|
|
6736
|
+
if (isAbsolute$1(id)) try {
|
|
8612
6737
|
if (statSync(id).isFile()) return pathToFileURL$1(id);
|
|
8613
6738
|
} catch (error) {
|
|
8614
6739
|
if (error?.code !== "ENOENT") throw error;
|
|
@@ -8641,259 +6766,234 @@ function _resolve(id, options = {}) {
|
|
|
8641
6766
|
function resolveSync(id, options) {
|
|
8642
6767
|
return _resolve(id, options);
|
|
8643
6768
|
}
|
|
6769
|
+
function resolve$1(id, options) {
|
|
6770
|
+
try {
|
|
6771
|
+
return Promise.resolve(resolveSync(id, options));
|
|
6772
|
+
} catch (error) {
|
|
6773
|
+
return Promise.reject(error);
|
|
6774
|
+
}
|
|
6775
|
+
}
|
|
8644
6776
|
function resolvePathSync(id, options) {
|
|
8645
6777
|
return fileURLToPath$1(resolveSync(id, options));
|
|
8646
6778
|
}
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
|
|
8654
|
-
if (Symbol.iterator in value) return false;
|
|
8655
|
-
if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
|
|
8656
|
-
return true;
|
|
6779
|
+
function resolvePath(id, options) {
|
|
6780
|
+
try {
|
|
6781
|
+
return Promise.resolve(resolvePathSync(id, options));
|
|
6782
|
+
} catch (error) {
|
|
6783
|
+
return Promise.reject(error);
|
|
6784
|
+
}
|
|
8657
6785
|
}
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
}
|
|
8670
|
-
return object;
|
|
6786
|
+
const ESM_STATIC_IMPORT_RE = /(?<=\s|^|;|\})import\s*(?:[\s"']*(?<imports>[\p{L}\p{M}\w\t\n\r $*,/{}@.]+)from\s*)?["']\s*(?<specifier>(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][\s;]*/gmu;
|
|
6787
|
+
const EXPORT_DECAL_RE = /\bexport\s+(?<declaration>(?:async function\s*\*?|function\s*\*?|let|const enum|const|enum|var|class))\s+\*?(?<name>[\w$]+)(?<extraNames>.*,\s*[\s\w:[\]{}]*[\w$\]}]+)*/g;
|
|
6788
|
+
const EXPORT_DECAL_TYPE_RE = /\bexport\s+(?<declaration>(?:interface|type|declare (?:async function|function|let|const enum|const|enum|var|class)))\s+(?<name>[\w$]+)/g;
|
|
6789
|
+
const EXPORT_NAMED_RE = /\bexport\s*{(?<exports>[^}]+?)[\s,]*}(?:\s*from\s*["']\s*(?<specifier>(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][^\n;]*)?/g;
|
|
6790
|
+
const EXPORT_NAMED_TYPE_RE = /\bexport\s+type\s*{(?<exports>[^}]+?)[\s,]*}(?:\s*from\s*["']\s*(?<specifier>(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][^\n;]*)?/g;
|
|
6791
|
+
const EXPORT_NAMED_DESTRUCT = /\bexport\s+(?:let|var|const)\s+(?:{(?<exports1>[^}]+?)[\s,]*}|\[(?<exports2>[^\]]+?)[\s,]*])\s+=/gm;
|
|
6792
|
+
const EXPORT_STAR_RE = /\bexport\s*\*(?:\s*as\s+(?<name>[\w$]+)\s+)?\s*(?:\s*from\s*["']\s*(?<specifier>(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][^\n;]*)?/g;
|
|
6793
|
+
const EXPORT_DEFAULT_RE = /\bexport\s+default\s+(async function|function|class|true|false|\W|\d)|\bexport\s+default\s+(?<defaultName>.*)/g;
|
|
6794
|
+
const EXPORT_DEFAULT_CLASS_RE = /\bexport\s+default\s+(?<declaration>class)\s+(?<name>[\w$]+)/g;
|
|
6795
|
+
const TYPE_RE = /^\s*?type\s/;
|
|
6796
|
+
function findStaticImports(code) {
|
|
6797
|
+
return _filterStatement(_tryGetLocations(code, "import"), matchAll(ESM_STATIC_IMPORT_RE, code, { type: "static" }));
|
|
8671
6798
|
}
|
|
8672
|
-
function
|
|
8673
|
-
|
|
6799
|
+
function parseStaticImport(matched) {
|
|
6800
|
+
const cleanedImports = clearImports(matched.imports);
|
|
6801
|
+
const namedImports = {};
|
|
6802
|
+
const _matches = cleanedImports.match(/{([^}]*)}/)?.[1]?.split(",") || [];
|
|
6803
|
+
for (const namedImport of _matches) {
|
|
6804
|
+
const _match = namedImport.match(/^\s*(\S*) as (\S*)\s*$/);
|
|
6805
|
+
const source = _match?.[1] || namedImport.trim();
|
|
6806
|
+
const importName = _match?.[2] || source;
|
|
6807
|
+
if (source && !TYPE_RE.test(source)) namedImports[source] = importName;
|
|
6808
|
+
}
|
|
6809
|
+
const { namespacedImport, defaultImport } = getImportNames(cleanedImports);
|
|
6810
|
+
return {
|
|
6811
|
+
...matched,
|
|
6812
|
+
defaultImport,
|
|
6813
|
+
namespacedImport,
|
|
6814
|
+
namedImports
|
|
6815
|
+
};
|
|
8674
6816
|
}
|
|
8675
|
-
|
|
8676
|
-
const
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
const
|
|
8683
|
-
|
|
8684
|
-
|
|
8685
|
-
|
|
6817
|
+
function _extractExtraNames(extraNamesStr) {
|
|
6818
|
+
const names = [];
|
|
6819
|
+
let depth = 0;
|
|
6820
|
+
let angleDepth = 0;
|
|
6821
|
+
let inString = false;
|
|
6822
|
+
let inTypeAnnotation = false;
|
|
6823
|
+
for (let i = 0; i < extraNamesStr.length; i++) {
|
|
6824
|
+
const char = extraNamesStr[i];
|
|
6825
|
+
if (inString) {
|
|
6826
|
+
if (char === inString) {
|
|
6827
|
+
let backslashCount = 0;
|
|
6828
|
+
for (let j = i - 1; j >= 0 && extraNamesStr[j] === "\\"; j--) backslashCount++;
|
|
6829
|
+
if (backslashCount % 2 === 0) inString = false;
|
|
6830
|
+
}
|
|
6831
|
+
continue;
|
|
6832
|
+
}
|
|
6833
|
+
if (char === "\"" || char === "'" || char === "`") {
|
|
6834
|
+
inString = char;
|
|
6835
|
+
continue;
|
|
6836
|
+
}
|
|
6837
|
+
if (char === ":" && depth === 0 && angleDepth === 0) {
|
|
6838
|
+
inTypeAnnotation = true;
|
|
6839
|
+
continue;
|
|
6840
|
+
}
|
|
6841
|
+
if (char === "=" && extraNamesStr[i + 1] !== ">" && depth === 0 && angleDepth === 0) inTypeAnnotation = false;
|
|
6842
|
+
if (inTypeAnnotation && char === "<") {
|
|
6843
|
+
angleDepth++;
|
|
6844
|
+
continue;
|
|
6845
|
+
}
|
|
6846
|
+
if (!inTypeAnnotation && char === "<" && depth === 0 && i > 0 && _isIdentifierBeforeAngleBracket(extraNamesStr, i)) {
|
|
6847
|
+
angleDepth++;
|
|
6848
|
+
continue;
|
|
6849
|
+
}
|
|
6850
|
+
if (char === ">" && angleDepth > 0 && extraNamesStr[i - 1] !== "=") {
|
|
6851
|
+
angleDepth--;
|
|
6852
|
+
continue;
|
|
6853
|
+
}
|
|
6854
|
+
if (char === "(" || char === "[" || char === "{") depth++;
|
|
6855
|
+
else if (char === ")" || char === "]" || char === "}") depth--;
|
|
6856
|
+
if (char === "," && depth === 0 && angleDepth === 0) {
|
|
6857
|
+
const match = extraNamesStr.slice(i + 1).match(/^\s*([\w$]+)/);
|
|
6858
|
+
if (match) names.push(match[1]);
|
|
6859
|
+
}
|
|
8686
6860
|
}
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
6861
|
+
return names;
|
|
6862
|
+
}
|
|
6863
|
+
function findExports(code) {
|
|
6864
|
+
const declaredExports = matchAll(EXPORT_DECAL_RE, code, { type: "declaration" });
|
|
6865
|
+
for (const declaredExport of declaredExports) {
|
|
6866
|
+
if (/^export\s+(?:async\s+)?function/.test(declaredExport.code)) continue;
|
|
6867
|
+
const extraNamesStr = declaredExport.extraNames;
|
|
6868
|
+
if (extraNamesStr) {
|
|
6869
|
+
const extraNames = _extractExtraNames(extraNamesStr);
|
|
6870
|
+
if (extraNames.length > 0) declaredExport.names = [declaredExport.name, ...extraNames];
|
|
6871
|
+
}
|
|
6872
|
+
delete declaredExport.extraNames;
|
|
6873
|
+
}
|
|
6874
|
+
const namedExports = normalizeNamedExports(matchAll(EXPORT_NAMED_RE, code, { type: "named" }));
|
|
6875
|
+
const destructuredExports = matchAll(EXPORT_NAMED_DESTRUCT, code, { type: "named" });
|
|
6876
|
+
for (const namedExport of destructuredExports) {
|
|
6877
|
+
namedExport.exports = namedExport.exports1 || namedExport.exports2;
|
|
6878
|
+
namedExport.names = namedExport.exports.replace(/^\r?\n?/, "").split(/\s*,\s*/g).filter((name) => !TYPE_RE.test(name)).map((name) => name.replace(/^.*?\s*:\s*/, "").replace(/\s*=\s*.*$/, "").trim());
|
|
6879
|
+
}
|
|
6880
|
+
const defaultExport = matchAll(EXPORT_DEFAULT_RE, code, {
|
|
6881
|
+
type: "default",
|
|
6882
|
+
name: "default"
|
|
8698
6883
|
});
|
|
8699
|
-
const
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
6884
|
+
const defaultClassExports = matchAll(EXPORT_DEFAULT_CLASS_RE, code, { type: "declaration" });
|
|
6885
|
+
const starExports = matchAll(EXPORT_STAR_RE, code, { type: "star" });
|
|
6886
|
+
const exports$1 = normalizeExports([
|
|
6887
|
+
...declaredExports,
|
|
6888
|
+
...namedExports,
|
|
6889
|
+
...destructuredExports,
|
|
6890
|
+
...defaultExport,
|
|
6891
|
+
...defaultClassExports,
|
|
6892
|
+
...starExports
|
|
6893
|
+
]);
|
|
6894
|
+
if (exports$1.length === 0) return [];
|
|
6895
|
+
const exportLocations = _tryGetLocations(code, "export");
|
|
6896
|
+
if (exportLocations && exportLocations.length === 0) return [];
|
|
6897
|
+
return _filterStatement(exportLocations, exports$1).filter((exp, index, exports2) => {
|
|
6898
|
+
const nextExport = exports2[index + 1];
|
|
6899
|
+
return !nextExport || exp.type !== nextExport.type || !exp.name || exp.name !== nextExport.name;
|
|
8705
6900
|
});
|
|
8706
|
-
return imports;
|
|
8707
6901
|
}
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
const
|
|
8712
|
-
|
|
8713
|
-
|
|
6902
|
+
function findTypeExports(code) {
|
|
6903
|
+
const declaredExports = matchAll(EXPORT_DECAL_TYPE_RE, code, { type: "declaration" });
|
|
6904
|
+
const namedExports = normalizeNamedExports(matchAll(EXPORT_NAMED_TYPE_RE, code, { type: "named" }));
|
|
6905
|
+
const exports$1 = normalizeExports([...declaredExports, ...namedExports]);
|
|
6906
|
+
if (exports$1.length === 0) return [];
|
|
6907
|
+
const exportLocations = _tryGetLocations(code, "export");
|
|
6908
|
+
if (exportLocations && exportLocations.length === 0) return [];
|
|
6909
|
+
return _filterStatement(exportLocations, exports$1).filter((exp, index, exports2) => {
|
|
6910
|
+
const nextExport = exports2[index + 1];
|
|
6911
|
+
return !nextExport || exp.type !== nextExport.type || !exp.name || exp.name !== nextExport.name;
|
|
6912
|
+
});
|
|
8714
6913
|
}
|
|
8715
|
-
function
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
return {
|
|
8722
|
-
...memo,
|
|
8723
|
-
...yamlResult
|
|
8724
|
-
};
|
|
8725
|
-
} catch (err) {
|
|
8726
|
-
throw new Error(`Invalid YAML format of comment in ${path}\n${err.message}`);
|
|
6914
|
+
function normalizeExports(exports$1) {
|
|
6915
|
+
for (const exp of exports$1) {
|
|
6916
|
+
if (!exp.name && exp.names && exp.names.length === 1) exp.name = exp.names[0];
|
|
6917
|
+
if (exp.name === "default" && exp.type !== "default") {
|
|
6918
|
+
exp._type = exp.type;
|
|
6919
|
+
exp.type = "default";
|
|
8727
6920
|
}
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
return
|
|
6921
|
+
if (!exp.names && exp.name) exp.names = [exp.name];
|
|
6922
|
+
if (exp.type === "declaration" && exp.declaration) exp.declarationType = exp.declaration.replace(/^declare\s*/, "");
|
|
6923
|
+
}
|
|
6924
|
+
return exports$1;
|
|
8732
6925
|
}
|
|
8733
|
-
function
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
return {
|
|
8737
|
-
...route,
|
|
8738
|
-
...block
|
|
8739
|
-
};
|
|
6926
|
+
function normalizeNamedExports(namedExports) {
|
|
6927
|
+
for (const namedExport of namedExports) namedExport.names = namedExport.exports.replace(/^\r?\n?/, "").split(/\s*,\s*/g).filter((name) => !TYPE_RE.test(name)).map((name) => name.replace(/^.*?\sas\s/, "").trim());
|
|
6928
|
+
return namedExports;
|
|
8740
6929
|
}
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
const
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
pages: {
|
|
8753
|
-
dirs: pages,
|
|
8754
|
-
extendRoute
|
|
8755
|
-
},
|
|
8756
|
-
layouts: {
|
|
8757
|
-
layoutsDirs: layouts,
|
|
8758
|
-
pagesDirs: pages,
|
|
8759
|
-
extensions: ["jsx", "tsx"],
|
|
8760
|
-
importMode: () => "sync"
|
|
8761
|
-
},
|
|
8762
|
-
imports: {
|
|
8763
|
-
imports: [
|
|
8764
|
-
"react",
|
|
8765
|
-
"react-router",
|
|
8766
|
-
"ahooks",
|
|
8767
|
-
componentsResolver({ dirs: components }),
|
|
8768
|
-
VixtClientAutoImports
|
|
8769
|
-
],
|
|
8770
|
-
dts: `${buildTypesDir}/auto-imports.d.ts`,
|
|
8771
|
-
dirs: [
|
|
8772
|
-
constants,
|
|
8773
|
-
hooks,
|
|
8774
|
-
stores,
|
|
8775
|
-
utils
|
|
8776
|
-
].flat()
|
|
8777
|
-
},
|
|
8778
|
-
unocss: {}
|
|
8779
|
-
};
|
|
8780
|
-
const options = vixt.options = defu(vixt.options, defaultOptions);
|
|
8781
|
-
return [
|
|
8782
|
-
UnoCSS(options.unocss),
|
|
8783
|
-
React(options.react),
|
|
8784
|
-
Pages(options.pages),
|
|
8785
|
-
Layouts(options.layouts),
|
|
8786
|
-
AutoImport(options.imports)
|
|
8787
|
-
];
|
|
8788
|
-
}
|
|
8789
|
-
});
|
|
8790
|
-
|
|
8791
|
-
//#endregion
|
|
8792
|
-
//#region src/modules/virtual-root-component.ts
|
|
8793
|
-
function resolveRootComponent(vixt) {
|
|
8794
|
-
for (const layer of vixt._layers) {
|
|
8795
|
-
const layerRootComponentPath = posix.resolve(layer.config.srcDir, "App.tsx");
|
|
8796
|
-
const layerRootComponentCode = import_lib.default.existsSync(layerRootComponentPath) && import_lib.default.readFileSync(layerRootComponentPath, "utf-8") || "";
|
|
8797
|
-
if (!isEmptyCode(layerRootComponentCode)) return {
|
|
8798
|
-
path: layerRootComponentPath,
|
|
8799
|
-
code: layerRootComponentCode
|
|
8800
|
-
};
|
|
6930
|
+
async function resolveModuleExportNames(id, options) {
|
|
6931
|
+
const url = await resolvePath(id, options);
|
|
6932
|
+
const exports$1 = findExports(await loadURL(url));
|
|
6933
|
+
const exportNames = new Set(exports$1.flatMap((exp) => exp.names).filter(Boolean));
|
|
6934
|
+
for (const exp of exports$1) {
|
|
6935
|
+
if (exp.type !== "star" || !exp.specifier) continue;
|
|
6936
|
+
const subExports = await resolveModuleExportNames(exp.specifier, {
|
|
6937
|
+
...options,
|
|
6938
|
+
url
|
|
6939
|
+
});
|
|
6940
|
+
for (const subExport of subExports) exportNames.add(subExport);
|
|
8801
6941
|
}
|
|
8802
|
-
|
|
8803
|
-
return {
|
|
8804
|
-
path: defaultRootComponentPath,
|
|
8805
|
-
code: import_lib.default.readFileSync(defaultRootComponentPath, "utf-8")
|
|
8806
|
-
};
|
|
6942
|
+
return [...exportNames];
|
|
8807
6943
|
}
|
|
8808
|
-
function
|
|
8809
|
-
|
|
6944
|
+
function _filterStatement(locations, statements) {
|
|
6945
|
+
return statements.filter((exp) => {
|
|
6946
|
+
return !locations || locations.some((location) => {
|
|
6947
|
+
return exp.start <= location.start && exp.end >= location.end;
|
|
6948
|
+
});
|
|
6949
|
+
});
|
|
6950
|
+
}
|
|
6951
|
+
function _tryGetLocations(code, label) {
|
|
8810
6952
|
try {
|
|
8811
|
-
return
|
|
8812
|
-
} catch {
|
|
8813
|
-
|
|
8814
|
-
|
|
6953
|
+
return _getLocations(code, label);
|
|
6954
|
+
} catch {}
|
|
6955
|
+
}
|
|
6956
|
+
function _getLocations(code, label) {
|
|
6957
|
+
const tokens = tokenizer(code, {
|
|
6958
|
+
ecmaVersion: "latest",
|
|
6959
|
+
sourceType: "module",
|
|
6960
|
+
allowHashBang: true,
|
|
6961
|
+
allowAwaitOutsideFunction: true,
|
|
6962
|
+
allowImportExportEverywhere: true
|
|
6963
|
+
});
|
|
6964
|
+
const locations = [];
|
|
6965
|
+
for (const token of tokens) if (token.type.label === label) locations.push({
|
|
6966
|
+
start: token.start,
|
|
6967
|
+
end: token.end
|
|
6968
|
+
});
|
|
6969
|
+
return locations;
|
|
6970
|
+
}
|
|
6971
|
+
function _isIdentifierBeforeAngleBracket(str, i) {
|
|
6972
|
+
let j = i - 1;
|
|
6973
|
+
while (j >= 0 && /[A-Za-z0-9_$]/.test(str[j])) j--;
|
|
6974
|
+
const wordStart = j + 1;
|
|
6975
|
+
return wordStart < i && /[A-Za-z_$]/.test(str[wordStart]);
|
|
6976
|
+
}
|
|
6977
|
+
const ESM_RE = /(?:[\s;]|^)(?:import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m;
|
|
6978
|
+
const CJS_RE = /(?:[\s;]|^)(?:module\.exports\b|exports\.\w|require\s*\(|global\.\w)/m;
|
|
6979
|
+
const COMMENT_RE = /\/\*.+?\*\/|\/\/.*(?=[nr])/g;
|
|
6980
|
+
function hasESMSyntax(code, opts = {}) {
|
|
6981
|
+
if (opts.stripComments) code = code.replace(COMMENT_RE, "");
|
|
6982
|
+
return ESM_RE.test(code);
|
|
6983
|
+
}
|
|
6984
|
+
function hasCJSSyntax(code, opts = {}) {
|
|
6985
|
+
if (opts.stripComments) code = code.replace(COMMENT_RE, "");
|
|
6986
|
+
return CJS_RE.test(code);
|
|
6987
|
+
}
|
|
6988
|
+
function detectSyntax(code, opts = {}) {
|
|
6989
|
+
if (opts.stripComments) code = code.replace(COMMENT_RE, "");
|
|
6990
|
+
const hasESM = hasESMSyntax(code, {});
|
|
6991
|
+
const hasCJS = hasCJSSyntax(code, {});
|
|
6992
|
+
return {
|
|
6993
|
+
hasESM,
|
|
6994
|
+
hasCJS,
|
|
6995
|
+
isMixed: hasESM && hasCJS
|
|
6996
|
+
};
|
|
8815
6997
|
}
|
|
8816
|
-
const name$1 = "virtual:vixt:root-component.tsx";
|
|
8817
|
-
var virtual_root_component_default = defineVixtModule({
|
|
8818
|
-
meta: { name: name$1 },
|
|
8819
|
-
setup(_, vixt) {
|
|
8820
|
-
return {
|
|
8821
|
-
name: name$1,
|
|
8822
|
-
resolveId(id) {
|
|
8823
|
-
if (id === name$1) return name$1;
|
|
8824
|
-
},
|
|
8825
|
-
load(id) {
|
|
8826
|
-
if (id === name$1) {
|
|
8827
|
-
const { path, code } = resolveRootComponent(vixt);
|
|
8828
|
-
this.addWatchFile(path);
|
|
8829
|
-
return code;
|
|
8830
|
-
}
|
|
8831
|
-
}
|
|
8832
|
-
};
|
|
8833
|
-
}
|
|
8834
|
-
});
|
|
8835
|
-
|
|
8836
|
-
//#endregion
|
|
8837
|
-
//#region src/modules/virtual-setup-layouts.ts
|
|
8838
|
-
const name = "virtual:vixt:setup-layouts";
|
|
8839
|
-
const virtualModuleId = name;
|
|
8840
|
-
const resolvedVirtualModuleId = `\0${virtualModuleId}`;
|
|
8841
|
-
var virtual_setup_layouts_default = defineVixtModule({
|
|
8842
|
-
meta: { name },
|
|
8843
|
-
setup(_, vixt) {
|
|
8844
|
-
return {
|
|
8845
|
-
name,
|
|
8846
|
-
resolveId(id) {
|
|
8847
|
-
if (id === virtualModuleId) return resolvedVirtualModuleId;
|
|
8848
|
-
},
|
|
8849
|
-
load(id) {
|
|
8850
|
-
if (id === resolvedVirtualModuleId) {
|
|
8851
|
-
const { defaultLayout = "default" } = vixt.options.layouts ?? {};
|
|
8852
|
-
return `import { createElement } from 'react'
|
|
8853
|
-
import { layouts } from 'virtual:generated-layouts'
|
|
8854
|
-
|
|
8855
|
-
export function setupLayouts(routes) {
|
|
8856
|
-
return routes.map(route => {
|
|
8857
|
-
if (route.children?.length > 0) {
|
|
8858
|
-
route.children = setupLayouts(route.children)
|
|
8859
|
-
}
|
|
8860
|
-
if(route.element && route.meta?.layout !== false) {
|
|
8861
|
-
return {
|
|
8862
|
-
path: route.path,
|
|
8863
|
-
element: createElement(layouts[route.meta?.layout ?? '${defaultLayout}']),
|
|
8864
|
-
children: [{ ...route, path: '' }]
|
|
8865
|
-
}
|
|
8866
|
-
}
|
|
8867
|
-
return route
|
|
8868
|
-
});
|
|
8869
|
-
}`;
|
|
8870
|
-
}
|
|
8871
|
-
}
|
|
8872
|
-
};
|
|
8873
|
-
}
|
|
8874
|
-
});
|
|
8875
|
-
|
|
8876
|
-
//#endregion
|
|
8877
|
-
//#region src/index.ts
|
|
8878
|
-
var src_default = createVixtPlugin({ defaults: {
|
|
8879
|
-
modules: [
|
|
8880
|
-
preset_react_default,
|
|
8881
|
-
virtual_root_component_default,
|
|
8882
|
-
virtual_setup_layouts_default
|
|
8883
|
-
],
|
|
8884
|
-
app: {
|
|
8885
|
-
entryFile: "main.tsx",
|
|
8886
|
-
entryCode: import_lib.default.readFileSync(resolvePathSync("@vixt/react/client/entry"), "utf-8"),
|
|
8887
|
-
head: { meta: [{ charset: "utf-8" }, {
|
|
8888
|
-
name: "viewport",
|
|
8889
|
-
content: "width=device-width, initial-scale=1.0"
|
|
8890
|
-
}] }
|
|
8891
|
-
},
|
|
8892
|
-
typescript: { tsConfig: { compilerOptions: {
|
|
8893
|
-
jsxImportSource: "react",
|
|
8894
|
-
types: ["@vixt/react/types", "vite-plugin-pages/client-react"]
|
|
8895
|
-
} } }
|
|
8896
|
-
} });
|
|
8897
|
-
|
|
8898
6998
|
//#endregion
|
|
8899
|
-
export {
|
|
6999
|
+
export { resolve$2 as _, parseStaticImport as a, resolvePathSync as c, dirname$1 as d, isAbsolute$1 as f, relative$1 as g, parse$1 as h, findTypeExports as i, posix as l, normalize$1 as m, findExports as n, resolve$1 as o, join$1 as p, findStaticImports as r, resolveModuleExportNames as s, detectSyntax as t, basename$1 as u, Parser as v, parse$2 as y };
|