@kubb/core 2.0.0-beta.10 → 2.0.0-beta.12
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/Queue-2-6pMcCx.d.cts +32 -0
- package/dist/Queue-2-6pMcCx.d.ts +32 -0
- package/dist/fs.cjs +2383 -0
- package/dist/fs.cjs.map +1 -0
- package/dist/fs.d.cts +5 -0
- package/dist/fs.d.ts +5 -0
- package/dist/fs.js +2380 -0
- package/dist/fs.js.map +1 -0
- package/dist/index.cjs +3336 -191
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -69
- package/dist/index.d.ts +18 -69
- package/dist/index.js +3655 -226
- package/dist/index.js.map +1 -1
- package/dist/logger.cjs +148 -0
- package/dist/logger.cjs.map +1 -0
- package/dist/logger.d.cts +31 -0
- package/dist/logger.d.ts +31 -0
- package/dist/logger.js +140 -0
- package/dist/logger.js.map +1 -0
- package/dist/transformers.cjs +79 -9
- package/dist/transformers.cjs.map +1 -1
- package/dist/transformers.js +82 -8
- package/dist/transformers.js.map +1 -1
- package/dist/utils.cjs +86 -766
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +3 -595
- package/dist/utils.d.ts +3 -595
- package/dist/utils.js +87 -727
- package/dist/utils.js.map +1 -1
- package/dist/write-46ytbnu9.d.cts +7 -0
- package/dist/write-46ytbnu9.d.ts +7 -0
- package/package.json +21 -11
- package/src/FileManager.ts +34 -62
- package/src/PluginManager.ts +20 -15
- package/src/build.ts +11 -12
- package/src/fs/index.ts +3 -0
- package/src/index.ts +4 -4
- package/src/{utils/logger.ts → logger.ts} +38 -3
- package/src/plugin.ts +1 -1
- package/src/transformers/casing.ts +3 -3
- package/src/types.ts +1 -1
- package/src/utils/index.ts +10 -18
- package/src/utils/randomColour.ts +0 -39
- package/src/utils/throttle.ts +0 -30
- /package/src/{utils → fs}/clean.ts +0 -0
- /package/src/{utils → fs}/read.ts +0 -0
- /package/src/{utils → fs}/write.ts +0 -0
package/dist/index.cjs
CHANGED
|
@@ -2,24 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var fs2 = require('fs-extra');
|
|
7
|
-
var seedrandom = require('seedrandom');
|
|
5
|
+
var tty = require('tty');
|
|
8
6
|
var path4 = require('path');
|
|
9
7
|
var jsRuntime = require('js-runtime');
|
|
10
|
-
var changeCase = require('change-case');
|
|
11
8
|
var crypto2 = require('crypto');
|
|
12
9
|
var parser = require('@kubb/parser');
|
|
13
10
|
var factory = require('@kubb/parser/factory');
|
|
14
|
-
var isEqual = require('lodash.isequal');
|
|
15
11
|
var naturalOrderby = require('natural-orderby');
|
|
16
12
|
var dirTree = require('directory-tree');
|
|
13
|
+
var seedrandom = require('seedrandom');
|
|
17
14
|
var events = require('events');
|
|
18
15
|
var perf_hooks = require('perf_hooks');
|
|
19
16
|
var mod = require('module');
|
|
20
17
|
var os = require('os');
|
|
21
18
|
var url = require('url');
|
|
22
|
-
var
|
|
19
|
+
var process2 = require('process');
|
|
23
20
|
var fs3 = require('fs');
|
|
24
21
|
var semver = require('semver');
|
|
25
22
|
|
|
@@ -43,28 +40,52 @@ function _interopNamespace(e) {
|
|
|
43
40
|
return Object.freeze(n);
|
|
44
41
|
}
|
|
45
42
|
|
|
46
|
-
var pc3__default = /*#__PURE__*/_interopDefault(pc3);
|
|
47
|
-
var fs2__default = /*#__PURE__*/_interopDefault(fs2);
|
|
48
|
-
var seedrandom__default = /*#__PURE__*/_interopDefault(seedrandom);
|
|
49
43
|
var path4__default = /*#__PURE__*/_interopDefault(path4);
|
|
50
44
|
var crypto2__default = /*#__PURE__*/_interopDefault(crypto2);
|
|
51
45
|
var factory__namespace = /*#__PURE__*/_interopNamespace(factory);
|
|
52
|
-
var isEqual__default = /*#__PURE__*/_interopDefault(isEqual);
|
|
53
46
|
var dirTree__default = /*#__PURE__*/_interopDefault(dirTree);
|
|
47
|
+
var seedrandom__default = /*#__PURE__*/_interopDefault(seedrandom);
|
|
54
48
|
var mod__default = /*#__PURE__*/_interopDefault(mod);
|
|
55
49
|
var os__default = /*#__PURE__*/_interopDefault(os);
|
|
56
|
-
var
|
|
50
|
+
var process2__default = /*#__PURE__*/_interopDefault(process2);
|
|
57
51
|
var fs3__default = /*#__PURE__*/_interopDefault(fs3);
|
|
58
52
|
|
|
53
|
+
var __create = Object.create;
|
|
59
54
|
var __defProp = Object.defineProperty;
|
|
55
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
56
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
57
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
58
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
60
59
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
61
|
-
var __require = /* @__PURE__ */ ((
|
|
62
|
-
get: (a,
|
|
63
|
-
}) :
|
|
60
|
+
var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
|
|
61
|
+
get: (a, b2) => (typeof require !== "undefined" ? require : a)[b2]
|
|
62
|
+
}) : x2)(function(x2) {
|
|
64
63
|
if (typeof require !== "undefined")
|
|
65
64
|
return require.apply(this, arguments);
|
|
66
|
-
throw Error('Dynamic require of "' +
|
|
65
|
+
throw Error('Dynamic require of "' + x2 + '" is not supported');
|
|
67
66
|
});
|
|
67
|
+
var __esm = (fn, res) => function __init() {
|
|
68
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
69
|
+
};
|
|
70
|
+
var __commonJS = (cb, mod2) => function __require2() {
|
|
71
|
+
return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
|
|
72
|
+
};
|
|
73
|
+
var __copyProps = (to, from, except, desc) => {
|
|
74
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
75
|
+
for (let key of __getOwnPropNames(from))
|
|
76
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
77
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
78
|
+
}
|
|
79
|
+
return to;
|
|
80
|
+
};
|
|
81
|
+
var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
|
|
82
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
83
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
84
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
85
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
86
|
+
isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
|
|
87
|
+
mod2
|
|
88
|
+
));
|
|
68
89
|
var __publicField = (obj, key, value) => {
|
|
69
90
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
70
91
|
return value;
|
|
@@ -99,77 +120,3000 @@ var __privateMethod = (obj, member, method) => {
|
|
|
99
120
|
__accessCheck(obj, member, "access private method");
|
|
100
121
|
return method;
|
|
101
122
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
123
|
+
|
|
124
|
+
// ../../node_modules/.pnpm/tsup@8.0.1_@microsoft+api-extractor@7.38.3_ts-node@10.9.1_typescript@5.3.2/node_modules/tsup/assets/cjs_shims.js
|
|
125
|
+
var init_cjs_shims = __esm({
|
|
126
|
+
"../../node_modules/.pnpm/tsup@8.0.1_@microsoft+api-extractor@7.38.3_ts-node@10.9.1_typescript@5.3.2/node_modules/tsup/assets/cjs_shims.js"() {
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
// ../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js
|
|
131
|
+
var require_universalify = __commonJS({
|
|
132
|
+
"../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports) {
|
|
133
|
+
init_cjs_shims();
|
|
134
|
+
exports.fromCallback = function(fn) {
|
|
135
|
+
return Object.defineProperty(function(...args) {
|
|
136
|
+
if (typeof args[args.length - 1] === "function")
|
|
137
|
+
fn.apply(this, args);
|
|
138
|
+
else {
|
|
139
|
+
return new Promise((resolve3, reject) => {
|
|
140
|
+
args.push((err, res) => err != null ? reject(err) : resolve3(res));
|
|
141
|
+
fn.apply(this, args);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}, "name", { value: fn.name });
|
|
145
|
+
};
|
|
146
|
+
exports.fromPromise = function(fn) {
|
|
147
|
+
return Object.defineProperty(function(...args) {
|
|
148
|
+
const cb = args[args.length - 1];
|
|
149
|
+
if (typeof cb !== "function")
|
|
150
|
+
return fn.apply(this, args);
|
|
151
|
+
else {
|
|
152
|
+
args.pop();
|
|
153
|
+
fn.apply(this, args).then((r2) => cb(null, r2), cb);
|
|
154
|
+
}
|
|
155
|
+
}, "name", { value: fn.name });
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
|
|
161
|
+
var require_polyfills = __commonJS({
|
|
162
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports, module) {
|
|
163
|
+
init_cjs_shims();
|
|
164
|
+
var constants = __require("constants");
|
|
165
|
+
var origCwd = process.cwd;
|
|
166
|
+
var cwd = null;
|
|
167
|
+
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
168
|
+
process.cwd = function() {
|
|
169
|
+
if (!cwd)
|
|
170
|
+
cwd = origCwd.call(process);
|
|
171
|
+
return cwd;
|
|
172
|
+
};
|
|
173
|
+
try {
|
|
174
|
+
process.cwd();
|
|
175
|
+
} catch (er) {
|
|
176
|
+
}
|
|
177
|
+
if (typeof process.chdir === "function") {
|
|
178
|
+
chdir = process.chdir;
|
|
179
|
+
process.chdir = function(d2) {
|
|
180
|
+
cwd = null;
|
|
181
|
+
chdir.call(process, d2);
|
|
182
|
+
};
|
|
183
|
+
if (Object.setPrototypeOf)
|
|
184
|
+
Object.setPrototypeOf(process.chdir, chdir);
|
|
185
|
+
}
|
|
186
|
+
var chdir;
|
|
187
|
+
module.exports = patch;
|
|
188
|
+
function patch(fs5) {
|
|
189
|
+
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
190
|
+
patchLchmod(fs5);
|
|
191
|
+
}
|
|
192
|
+
if (!fs5.lutimes) {
|
|
193
|
+
patchLutimes(fs5);
|
|
194
|
+
}
|
|
195
|
+
fs5.chown = chownFix(fs5.chown);
|
|
196
|
+
fs5.fchown = chownFix(fs5.fchown);
|
|
197
|
+
fs5.lchown = chownFix(fs5.lchown);
|
|
198
|
+
fs5.chmod = chmodFix(fs5.chmod);
|
|
199
|
+
fs5.fchmod = chmodFix(fs5.fchmod);
|
|
200
|
+
fs5.lchmod = chmodFix(fs5.lchmod);
|
|
201
|
+
fs5.chownSync = chownFixSync(fs5.chownSync);
|
|
202
|
+
fs5.fchownSync = chownFixSync(fs5.fchownSync);
|
|
203
|
+
fs5.lchownSync = chownFixSync(fs5.lchownSync);
|
|
204
|
+
fs5.chmodSync = chmodFixSync(fs5.chmodSync);
|
|
205
|
+
fs5.fchmodSync = chmodFixSync(fs5.fchmodSync);
|
|
206
|
+
fs5.lchmodSync = chmodFixSync(fs5.lchmodSync);
|
|
207
|
+
fs5.stat = statFix(fs5.stat);
|
|
208
|
+
fs5.fstat = statFix(fs5.fstat);
|
|
209
|
+
fs5.lstat = statFix(fs5.lstat);
|
|
210
|
+
fs5.statSync = statFixSync(fs5.statSync);
|
|
211
|
+
fs5.fstatSync = statFixSync(fs5.fstatSync);
|
|
212
|
+
fs5.lstatSync = statFixSync(fs5.lstatSync);
|
|
213
|
+
if (fs5.chmod && !fs5.lchmod) {
|
|
214
|
+
fs5.lchmod = function(path5, mode, cb) {
|
|
215
|
+
if (cb)
|
|
216
|
+
process.nextTick(cb);
|
|
217
|
+
};
|
|
218
|
+
fs5.lchmodSync = function() {
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
if (fs5.chown && !fs5.lchown) {
|
|
222
|
+
fs5.lchown = function(path5, uid, gid, cb) {
|
|
223
|
+
if (cb)
|
|
224
|
+
process.nextTick(cb);
|
|
225
|
+
};
|
|
226
|
+
fs5.lchownSync = function() {
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
if (platform === "win32") {
|
|
230
|
+
fs5.rename = typeof fs5.rename !== "function" ? fs5.rename : function(fs$rename) {
|
|
231
|
+
function rename(from, to, cb) {
|
|
232
|
+
var start = Date.now();
|
|
233
|
+
var backoff = 0;
|
|
234
|
+
fs$rename(from, to, function CB(er) {
|
|
235
|
+
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
236
|
+
setTimeout(function() {
|
|
237
|
+
fs5.stat(to, function(stater, st) {
|
|
238
|
+
if (stater && stater.code === "ENOENT")
|
|
239
|
+
fs$rename(from, to, CB);
|
|
240
|
+
else
|
|
241
|
+
cb(er);
|
|
242
|
+
});
|
|
243
|
+
}, backoff);
|
|
244
|
+
if (backoff < 100)
|
|
245
|
+
backoff += 10;
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (cb)
|
|
249
|
+
cb(er);
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
if (Object.setPrototypeOf)
|
|
253
|
+
Object.setPrototypeOf(rename, fs$rename);
|
|
254
|
+
return rename;
|
|
255
|
+
}(fs5.rename);
|
|
256
|
+
}
|
|
257
|
+
fs5.read = typeof fs5.read !== "function" ? fs5.read : function(fs$read) {
|
|
258
|
+
function read2(fd, buffer, offset, length, position, callback_) {
|
|
259
|
+
var callback;
|
|
260
|
+
if (callback_ && typeof callback_ === "function") {
|
|
261
|
+
var eagCounter = 0;
|
|
262
|
+
callback = function(er, _, __) {
|
|
263
|
+
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
264
|
+
eagCounter++;
|
|
265
|
+
return fs$read.call(fs5, fd, buffer, offset, length, position, callback);
|
|
266
|
+
}
|
|
267
|
+
callback_.apply(this, arguments);
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
return fs$read.call(fs5, fd, buffer, offset, length, position, callback);
|
|
271
|
+
}
|
|
272
|
+
if (Object.setPrototypeOf)
|
|
273
|
+
Object.setPrototypeOf(read2, fs$read);
|
|
274
|
+
return read2;
|
|
275
|
+
}(fs5.read);
|
|
276
|
+
fs5.readSync = typeof fs5.readSync !== "function" ? fs5.readSync : /* @__PURE__ */ function(fs$readSync) {
|
|
277
|
+
return function(fd, buffer, offset, length, position) {
|
|
278
|
+
var eagCounter = 0;
|
|
279
|
+
while (true) {
|
|
280
|
+
try {
|
|
281
|
+
return fs$readSync.call(fs5, fd, buffer, offset, length, position);
|
|
282
|
+
} catch (er) {
|
|
283
|
+
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
284
|
+
eagCounter++;
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
throw er;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
}(fs5.readSync);
|
|
292
|
+
function patchLchmod(fs6) {
|
|
293
|
+
fs6.lchmod = function(path5, mode, callback) {
|
|
294
|
+
fs6.open(
|
|
295
|
+
path5,
|
|
296
|
+
constants.O_WRONLY | constants.O_SYMLINK,
|
|
297
|
+
mode,
|
|
298
|
+
function(err, fd) {
|
|
299
|
+
if (err) {
|
|
300
|
+
if (callback)
|
|
301
|
+
callback(err);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
fs6.fchmod(fd, mode, function(err2) {
|
|
305
|
+
fs6.close(fd, function(err22) {
|
|
306
|
+
if (callback)
|
|
307
|
+
callback(err2 || err22);
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
};
|
|
313
|
+
fs6.lchmodSync = function(path5, mode) {
|
|
314
|
+
var fd = fs6.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
315
|
+
var threw = true;
|
|
316
|
+
var ret;
|
|
317
|
+
try {
|
|
318
|
+
ret = fs6.fchmodSync(fd, mode);
|
|
319
|
+
threw = false;
|
|
320
|
+
} finally {
|
|
321
|
+
if (threw) {
|
|
322
|
+
try {
|
|
323
|
+
fs6.closeSync(fd);
|
|
324
|
+
} catch (er) {
|
|
325
|
+
}
|
|
326
|
+
} else {
|
|
327
|
+
fs6.closeSync(fd);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return ret;
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function patchLutimes(fs6) {
|
|
334
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs6.futimes) {
|
|
335
|
+
fs6.lutimes = function(path5, at, mt, cb) {
|
|
336
|
+
fs6.open(path5, constants.O_SYMLINK, function(er, fd) {
|
|
337
|
+
if (er) {
|
|
338
|
+
if (cb)
|
|
339
|
+
cb(er);
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
fs6.futimes(fd, at, mt, function(er2) {
|
|
343
|
+
fs6.close(fd, function(er22) {
|
|
344
|
+
if (cb)
|
|
345
|
+
cb(er2 || er22);
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
});
|
|
349
|
+
};
|
|
350
|
+
fs6.lutimesSync = function(path5, at, mt) {
|
|
351
|
+
var fd = fs6.openSync(path5, constants.O_SYMLINK);
|
|
352
|
+
var ret;
|
|
353
|
+
var threw = true;
|
|
354
|
+
try {
|
|
355
|
+
ret = fs6.futimesSync(fd, at, mt);
|
|
356
|
+
threw = false;
|
|
357
|
+
} finally {
|
|
358
|
+
if (threw) {
|
|
359
|
+
try {
|
|
360
|
+
fs6.closeSync(fd);
|
|
361
|
+
} catch (er) {
|
|
362
|
+
}
|
|
363
|
+
} else {
|
|
364
|
+
fs6.closeSync(fd);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
return ret;
|
|
368
|
+
};
|
|
369
|
+
} else if (fs6.futimes) {
|
|
370
|
+
fs6.lutimes = function(_a, _b, _c, cb) {
|
|
371
|
+
if (cb)
|
|
372
|
+
process.nextTick(cb);
|
|
373
|
+
};
|
|
374
|
+
fs6.lutimesSync = function() {
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
function chmodFix(orig) {
|
|
379
|
+
if (!orig)
|
|
380
|
+
return orig;
|
|
381
|
+
return function(target, mode, cb) {
|
|
382
|
+
return orig.call(fs5, target, mode, function(er) {
|
|
383
|
+
if (chownErOk(er))
|
|
384
|
+
er = null;
|
|
385
|
+
if (cb)
|
|
386
|
+
cb.apply(this, arguments);
|
|
387
|
+
});
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
function chmodFixSync(orig) {
|
|
391
|
+
if (!orig)
|
|
392
|
+
return orig;
|
|
393
|
+
return function(target, mode) {
|
|
394
|
+
try {
|
|
395
|
+
return orig.call(fs5, target, mode);
|
|
396
|
+
} catch (er) {
|
|
397
|
+
if (!chownErOk(er))
|
|
398
|
+
throw er;
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
function chownFix(orig) {
|
|
403
|
+
if (!orig)
|
|
404
|
+
return orig;
|
|
405
|
+
return function(target, uid, gid, cb) {
|
|
406
|
+
return orig.call(fs5, target, uid, gid, function(er) {
|
|
407
|
+
if (chownErOk(er))
|
|
408
|
+
er = null;
|
|
409
|
+
if (cb)
|
|
410
|
+
cb.apply(this, arguments);
|
|
411
|
+
});
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
function chownFixSync(orig) {
|
|
415
|
+
if (!orig)
|
|
416
|
+
return orig;
|
|
417
|
+
return function(target, uid, gid) {
|
|
418
|
+
try {
|
|
419
|
+
return orig.call(fs5, target, uid, gid);
|
|
420
|
+
} catch (er) {
|
|
421
|
+
if (!chownErOk(er))
|
|
422
|
+
throw er;
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
function statFix(orig) {
|
|
427
|
+
if (!orig)
|
|
428
|
+
return orig;
|
|
429
|
+
return function(target, options, cb) {
|
|
430
|
+
if (typeof options === "function") {
|
|
431
|
+
cb = options;
|
|
432
|
+
options = null;
|
|
433
|
+
}
|
|
434
|
+
function callback(er, stats) {
|
|
435
|
+
if (stats) {
|
|
436
|
+
if (stats.uid < 0)
|
|
437
|
+
stats.uid += 4294967296;
|
|
438
|
+
if (stats.gid < 0)
|
|
439
|
+
stats.gid += 4294967296;
|
|
440
|
+
}
|
|
441
|
+
if (cb)
|
|
442
|
+
cb.apply(this, arguments);
|
|
443
|
+
}
|
|
444
|
+
return options ? orig.call(fs5, target, options, callback) : orig.call(fs5, target, callback);
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
function statFixSync(orig) {
|
|
448
|
+
if (!orig)
|
|
449
|
+
return orig;
|
|
450
|
+
return function(target, options) {
|
|
451
|
+
var stats = options ? orig.call(fs5, target, options) : orig.call(fs5, target);
|
|
452
|
+
if (stats) {
|
|
453
|
+
if (stats.uid < 0)
|
|
454
|
+
stats.uid += 4294967296;
|
|
455
|
+
if (stats.gid < 0)
|
|
456
|
+
stats.gid += 4294967296;
|
|
457
|
+
}
|
|
458
|
+
return stats;
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
function chownErOk(er) {
|
|
462
|
+
if (!er)
|
|
463
|
+
return true;
|
|
464
|
+
if (er.code === "ENOSYS")
|
|
465
|
+
return true;
|
|
466
|
+
var nonroot = !process.getuid || process.getuid() !== 0;
|
|
467
|
+
if (nonroot) {
|
|
468
|
+
if (er.code === "EINVAL" || er.code === "EPERM")
|
|
469
|
+
return true;
|
|
470
|
+
}
|
|
471
|
+
return false;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
|
|
478
|
+
var require_legacy_streams = __commonJS({
|
|
479
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module) {
|
|
480
|
+
init_cjs_shims();
|
|
481
|
+
var Stream = __require("stream").Stream;
|
|
482
|
+
module.exports = legacy;
|
|
483
|
+
function legacy(fs5) {
|
|
484
|
+
return {
|
|
485
|
+
ReadStream,
|
|
486
|
+
WriteStream
|
|
487
|
+
};
|
|
488
|
+
function ReadStream(path5, options) {
|
|
489
|
+
if (!(this instanceof ReadStream))
|
|
490
|
+
return new ReadStream(path5, options);
|
|
491
|
+
Stream.call(this);
|
|
492
|
+
var self2 = this;
|
|
493
|
+
this.path = path5;
|
|
494
|
+
this.fd = null;
|
|
495
|
+
this.readable = true;
|
|
496
|
+
this.paused = false;
|
|
497
|
+
this.flags = "r";
|
|
498
|
+
this.mode = 438;
|
|
499
|
+
this.bufferSize = 64 * 1024;
|
|
500
|
+
options = options || {};
|
|
501
|
+
var keys = Object.keys(options);
|
|
502
|
+
for (var index = 0, length = keys.length; index < length; index++) {
|
|
503
|
+
var key = keys[index];
|
|
504
|
+
this[key] = options[key];
|
|
505
|
+
}
|
|
506
|
+
if (this.encoding)
|
|
507
|
+
this.setEncoding(this.encoding);
|
|
508
|
+
if (this.start !== void 0) {
|
|
509
|
+
if ("number" !== typeof this.start) {
|
|
510
|
+
throw TypeError("start must be a Number");
|
|
511
|
+
}
|
|
512
|
+
if (this.end === void 0) {
|
|
513
|
+
this.end = Infinity;
|
|
514
|
+
} else if ("number" !== typeof this.end) {
|
|
515
|
+
throw TypeError("end must be a Number");
|
|
516
|
+
}
|
|
517
|
+
if (this.start > this.end) {
|
|
518
|
+
throw new Error("start must be <= end");
|
|
519
|
+
}
|
|
520
|
+
this.pos = this.start;
|
|
521
|
+
}
|
|
522
|
+
if (this.fd !== null) {
|
|
523
|
+
process.nextTick(function() {
|
|
524
|
+
self2._read();
|
|
525
|
+
});
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
fs5.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
529
|
+
if (err) {
|
|
530
|
+
self2.emit("error", err);
|
|
531
|
+
self2.readable = false;
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
self2.fd = fd;
|
|
535
|
+
self2.emit("open", fd);
|
|
536
|
+
self2._read();
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
function WriteStream(path5, options) {
|
|
540
|
+
if (!(this instanceof WriteStream))
|
|
541
|
+
return new WriteStream(path5, options);
|
|
542
|
+
Stream.call(this);
|
|
543
|
+
this.path = path5;
|
|
544
|
+
this.fd = null;
|
|
545
|
+
this.writable = true;
|
|
546
|
+
this.flags = "w";
|
|
547
|
+
this.encoding = "binary";
|
|
548
|
+
this.mode = 438;
|
|
549
|
+
this.bytesWritten = 0;
|
|
550
|
+
options = options || {};
|
|
551
|
+
var keys = Object.keys(options);
|
|
552
|
+
for (var index = 0, length = keys.length; index < length; index++) {
|
|
553
|
+
var key = keys[index];
|
|
554
|
+
this[key] = options[key];
|
|
555
|
+
}
|
|
556
|
+
if (this.start !== void 0) {
|
|
557
|
+
if ("number" !== typeof this.start) {
|
|
558
|
+
throw TypeError("start must be a Number");
|
|
559
|
+
}
|
|
560
|
+
if (this.start < 0) {
|
|
561
|
+
throw new Error("start must be >= zero");
|
|
562
|
+
}
|
|
563
|
+
this.pos = this.start;
|
|
564
|
+
}
|
|
565
|
+
this.busy = false;
|
|
566
|
+
this._queue = [];
|
|
567
|
+
if (this.fd === null) {
|
|
568
|
+
this._open = fs5.open;
|
|
569
|
+
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
570
|
+
this.flush();
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js
|
|
578
|
+
var require_clone = __commonJS({
|
|
579
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module) {
|
|
580
|
+
init_cjs_shims();
|
|
581
|
+
module.exports = clone;
|
|
582
|
+
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
|
583
|
+
return obj.__proto__;
|
|
584
|
+
};
|
|
585
|
+
function clone(obj) {
|
|
586
|
+
if (obj === null || typeof obj !== "object")
|
|
587
|
+
return obj;
|
|
588
|
+
if (obj instanceof Object)
|
|
589
|
+
var copy = { __proto__: getPrototypeOf(obj) };
|
|
590
|
+
else
|
|
591
|
+
var copy = /* @__PURE__ */ Object.create(null);
|
|
592
|
+
Object.getOwnPropertyNames(obj).forEach(function(key) {
|
|
593
|
+
Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
|
|
594
|
+
});
|
|
595
|
+
return copy;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
|
|
600
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
|
|
601
|
+
var require_graceful_fs = __commonJS({
|
|
602
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module) {
|
|
603
|
+
init_cjs_shims();
|
|
604
|
+
var fs5 = __require("fs");
|
|
605
|
+
var polyfills = require_polyfills();
|
|
606
|
+
var legacy = require_legacy_streams();
|
|
607
|
+
var clone = require_clone();
|
|
608
|
+
var util = __require("util");
|
|
609
|
+
var gracefulQueue;
|
|
610
|
+
var previousSymbol;
|
|
611
|
+
if (typeof Symbol === "function" && typeof Symbol.for === "function") {
|
|
612
|
+
gracefulQueue = Symbol.for("graceful-fs.queue");
|
|
613
|
+
previousSymbol = Symbol.for("graceful-fs.previous");
|
|
614
|
+
} else {
|
|
615
|
+
gracefulQueue = "___graceful-fs.queue";
|
|
616
|
+
previousSymbol = "___graceful-fs.previous";
|
|
617
|
+
}
|
|
618
|
+
function noop() {
|
|
619
|
+
}
|
|
620
|
+
function publishQueue(context, queue2) {
|
|
621
|
+
Object.defineProperty(context, gracefulQueue, {
|
|
622
|
+
get: function() {
|
|
623
|
+
return queue2;
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
var debug = noop;
|
|
628
|
+
if (util.debuglog)
|
|
629
|
+
debug = util.debuglog("gfs4");
|
|
630
|
+
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
|
631
|
+
debug = function() {
|
|
632
|
+
var m = util.format.apply(util, arguments);
|
|
633
|
+
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
634
|
+
console.error(m);
|
|
635
|
+
};
|
|
636
|
+
if (!fs5[gracefulQueue]) {
|
|
637
|
+
queue = global[gracefulQueue] || [];
|
|
638
|
+
publishQueue(fs5, queue);
|
|
639
|
+
fs5.close = function(fs$close) {
|
|
640
|
+
function close(fd, cb) {
|
|
641
|
+
return fs$close.call(fs5, fd, function(err) {
|
|
642
|
+
if (!err) {
|
|
643
|
+
resetQueue();
|
|
644
|
+
}
|
|
645
|
+
if (typeof cb === "function")
|
|
646
|
+
cb.apply(this, arguments);
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
Object.defineProperty(close, previousSymbol, {
|
|
650
|
+
value: fs$close
|
|
651
|
+
});
|
|
652
|
+
return close;
|
|
653
|
+
}(fs5.close);
|
|
654
|
+
fs5.closeSync = function(fs$closeSync) {
|
|
655
|
+
function closeSync(fd) {
|
|
656
|
+
fs$closeSync.apply(fs5, arguments);
|
|
657
|
+
resetQueue();
|
|
658
|
+
}
|
|
659
|
+
Object.defineProperty(closeSync, previousSymbol, {
|
|
660
|
+
value: fs$closeSync
|
|
661
|
+
});
|
|
662
|
+
return closeSync;
|
|
663
|
+
}(fs5.closeSync);
|
|
664
|
+
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
665
|
+
process.on("exit", function() {
|
|
666
|
+
debug(fs5[gracefulQueue]);
|
|
667
|
+
__require("assert").equal(fs5[gracefulQueue].length, 0);
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
var queue;
|
|
672
|
+
if (!global[gracefulQueue]) {
|
|
673
|
+
publishQueue(global, fs5[gracefulQueue]);
|
|
674
|
+
}
|
|
675
|
+
module.exports = patch(clone(fs5));
|
|
676
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs5.__patched) {
|
|
677
|
+
module.exports = patch(fs5);
|
|
678
|
+
fs5.__patched = true;
|
|
679
|
+
}
|
|
680
|
+
function patch(fs6) {
|
|
681
|
+
polyfills(fs6);
|
|
682
|
+
fs6.gracefulify = patch;
|
|
683
|
+
fs6.createReadStream = createReadStream;
|
|
684
|
+
fs6.createWriteStream = createWriteStream;
|
|
685
|
+
var fs$readFile = fs6.readFile;
|
|
686
|
+
fs6.readFile = readFile;
|
|
687
|
+
function readFile(path5, options, cb) {
|
|
688
|
+
if (typeof options === "function")
|
|
689
|
+
cb = options, options = null;
|
|
690
|
+
return go$readFile(path5, options, cb);
|
|
691
|
+
function go$readFile(path6, options2, cb2, startTime) {
|
|
692
|
+
return fs$readFile(path6, options2, function(err) {
|
|
693
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
694
|
+
enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
695
|
+
else {
|
|
696
|
+
if (typeof cb2 === "function")
|
|
697
|
+
cb2.apply(this, arguments);
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
var fs$writeFile = fs6.writeFile;
|
|
703
|
+
fs6.writeFile = writeFile;
|
|
704
|
+
function writeFile(path5, data, options, cb) {
|
|
705
|
+
if (typeof options === "function")
|
|
706
|
+
cb = options, options = null;
|
|
707
|
+
return go$writeFile(path5, data, options, cb);
|
|
708
|
+
function go$writeFile(path6, data2, options2, cb2, startTime) {
|
|
709
|
+
return fs$writeFile(path6, data2, options2, function(err) {
|
|
710
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
711
|
+
enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
712
|
+
else {
|
|
713
|
+
if (typeof cb2 === "function")
|
|
714
|
+
cb2.apply(this, arguments);
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
var fs$appendFile = fs6.appendFile;
|
|
720
|
+
if (fs$appendFile)
|
|
721
|
+
fs6.appendFile = appendFile;
|
|
722
|
+
function appendFile(path5, data, options, cb) {
|
|
723
|
+
if (typeof options === "function")
|
|
724
|
+
cb = options, options = null;
|
|
725
|
+
return go$appendFile(path5, data, options, cb);
|
|
726
|
+
function go$appendFile(path6, data2, options2, cb2, startTime) {
|
|
727
|
+
return fs$appendFile(path6, data2, options2, function(err) {
|
|
728
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
729
|
+
enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
730
|
+
else {
|
|
731
|
+
if (typeof cb2 === "function")
|
|
732
|
+
cb2.apply(this, arguments);
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
var fs$copyFile = fs6.copyFile;
|
|
738
|
+
if (fs$copyFile)
|
|
739
|
+
fs6.copyFile = copyFile;
|
|
740
|
+
function copyFile(src, dest, flags, cb) {
|
|
741
|
+
if (typeof flags === "function") {
|
|
742
|
+
cb = flags;
|
|
743
|
+
flags = 0;
|
|
744
|
+
}
|
|
745
|
+
return go$copyFile(src, dest, flags, cb);
|
|
746
|
+
function go$copyFile(src2, dest2, flags2, cb2, startTime) {
|
|
747
|
+
return fs$copyFile(src2, dest2, flags2, function(err) {
|
|
748
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
749
|
+
enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
750
|
+
else {
|
|
751
|
+
if (typeof cb2 === "function")
|
|
752
|
+
cb2.apply(this, arguments);
|
|
753
|
+
}
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
var fs$readdir = fs6.readdir;
|
|
758
|
+
fs6.readdir = readdir;
|
|
759
|
+
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
760
|
+
function readdir(path5, options, cb) {
|
|
761
|
+
if (typeof options === "function")
|
|
762
|
+
cb = options, options = null;
|
|
763
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) {
|
|
764
|
+
return fs$readdir(path6, fs$readdirCallback(
|
|
765
|
+
path6,
|
|
766
|
+
options2,
|
|
767
|
+
cb2,
|
|
768
|
+
startTime
|
|
769
|
+
));
|
|
770
|
+
} : function go$readdir2(path6, options2, cb2, startTime) {
|
|
771
|
+
return fs$readdir(path6, options2, fs$readdirCallback(
|
|
772
|
+
path6,
|
|
773
|
+
options2,
|
|
774
|
+
cb2,
|
|
775
|
+
startTime
|
|
776
|
+
));
|
|
777
|
+
};
|
|
778
|
+
return go$readdir(path5, options, cb);
|
|
779
|
+
function fs$readdirCallback(path6, options2, cb2, startTime) {
|
|
780
|
+
return function(err, files) {
|
|
781
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
782
|
+
enqueue([
|
|
783
|
+
go$readdir,
|
|
784
|
+
[path6, options2, cb2],
|
|
785
|
+
err,
|
|
786
|
+
startTime || Date.now(),
|
|
787
|
+
Date.now()
|
|
788
|
+
]);
|
|
789
|
+
else {
|
|
790
|
+
if (files && files.sort)
|
|
791
|
+
files.sort();
|
|
792
|
+
if (typeof cb2 === "function")
|
|
793
|
+
cb2.call(this, err, files);
|
|
794
|
+
}
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
if (process.version.substr(0, 4) === "v0.8") {
|
|
799
|
+
var legStreams = legacy(fs6);
|
|
800
|
+
ReadStream = legStreams.ReadStream;
|
|
801
|
+
WriteStream = legStreams.WriteStream;
|
|
802
|
+
}
|
|
803
|
+
var fs$ReadStream = fs6.ReadStream;
|
|
804
|
+
if (fs$ReadStream) {
|
|
805
|
+
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
806
|
+
ReadStream.prototype.open = ReadStream$open;
|
|
807
|
+
}
|
|
808
|
+
var fs$WriteStream = fs6.WriteStream;
|
|
809
|
+
if (fs$WriteStream) {
|
|
810
|
+
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
811
|
+
WriteStream.prototype.open = WriteStream$open;
|
|
812
|
+
}
|
|
813
|
+
Object.defineProperty(fs6, "ReadStream", {
|
|
814
|
+
get: function() {
|
|
815
|
+
return ReadStream;
|
|
816
|
+
},
|
|
817
|
+
set: function(val) {
|
|
818
|
+
ReadStream = val;
|
|
819
|
+
},
|
|
820
|
+
enumerable: true,
|
|
821
|
+
configurable: true
|
|
822
|
+
});
|
|
823
|
+
Object.defineProperty(fs6, "WriteStream", {
|
|
824
|
+
get: function() {
|
|
825
|
+
return WriteStream;
|
|
826
|
+
},
|
|
827
|
+
set: function(val) {
|
|
828
|
+
WriteStream = val;
|
|
829
|
+
},
|
|
830
|
+
enumerable: true,
|
|
831
|
+
configurable: true
|
|
832
|
+
});
|
|
833
|
+
var FileReadStream = ReadStream;
|
|
834
|
+
Object.defineProperty(fs6, "FileReadStream", {
|
|
835
|
+
get: function() {
|
|
836
|
+
return FileReadStream;
|
|
837
|
+
},
|
|
838
|
+
set: function(val) {
|
|
839
|
+
FileReadStream = val;
|
|
840
|
+
},
|
|
841
|
+
enumerable: true,
|
|
842
|
+
configurable: true
|
|
843
|
+
});
|
|
844
|
+
var FileWriteStream = WriteStream;
|
|
845
|
+
Object.defineProperty(fs6, "FileWriteStream", {
|
|
846
|
+
get: function() {
|
|
847
|
+
return FileWriteStream;
|
|
848
|
+
},
|
|
849
|
+
set: function(val) {
|
|
850
|
+
FileWriteStream = val;
|
|
851
|
+
},
|
|
852
|
+
enumerable: true,
|
|
853
|
+
configurable: true
|
|
854
|
+
});
|
|
855
|
+
function ReadStream(path5, options) {
|
|
856
|
+
if (this instanceof ReadStream)
|
|
857
|
+
return fs$ReadStream.apply(this, arguments), this;
|
|
858
|
+
else
|
|
859
|
+
return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
860
|
+
}
|
|
861
|
+
function ReadStream$open() {
|
|
862
|
+
var that = this;
|
|
863
|
+
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
864
|
+
if (err) {
|
|
865
|
+
if (that.autoClose)
|
|
866
|
+
that.destroy();
|
|
867
|
+
that.emit("error", err);
|
|
868
|
+
} else {
|
|
869
|
+
that.fd = fd;
|
|
870
|
+
that.emit("open", fd);
|
|
871
|
+
that.read();
|
|
872
|
+
}
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
function WriteStream(path5, options) {
|
|
876
|
+
if (this instanceof WriteStream)
|
|
877
|
+
return fs$WriteStream.apply(this, arguments), this;
|
|
878
|
+
else
|
|
879
|
+
return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
880
|
+
}
|
|
881
|
+
function WriteStream$open() {
|
|
882
|
+
var that = this;
|
|
883
|
+
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
884
|
+
if (err) {
|
|
885
|
+
that.destroy();
|
|
886
|
+
that.emit("error", err);
|
|
887
|
+
} else {
|
|
888
|
+
that.fd = fd;
|
|
889
|
+
that.emit("open", fd);
|
|
890
|
+
}
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
function createReadStream(path5, options) {
|
|
894
|
+
return new fs6.ReadStream(path5, options);
|
|
895
|
+
}
|
|
896
|
+
function createWriteStream(path5, options) {
|
|
897
|
+
return new fs6.WriteStream(path5, options);
|
|
898
|
+
}
|
|
899
|
+
var fs$open = fs6.open;
|
|
900
|
+
fs6.open = open;
|
|
901
|
+
function open(path5, flags, mode, cb) {
|
|
902
|
+
if (typeof mode === "function")
|
|
903
|
+
cb = mode, mode = null;
|
|
904
|
+
return go$open(path5, flags, mode, cb);
|
|
905
|
+
function go$open(path6, flags2, mode2, cb2, startTime) {
|
|
906
|
+
return fs$open(path6, flags2, mode2, function(err, fd) {
|
|
907
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
908
|
+
enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
909
|
+
else {
|
|
910
|
+
if (typeof cb2 === "function")
|
|
911
|
+
cb2.apply(this, arguments);
|
|
912
|
+
}
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
return fs6;
|
|
917
|
+
}
|
|
918
|
+
function enqueue(elem) {
|
|
919
|
+
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
920
|
+
fs5[gracefulQueue].push(elem);
|
|
921
|
+
retry();
|
|
922
|
+
}
|
|
923
|
+
var retryTimer;
|
|
924
|
+
function resetQueue() {
|
|
925
|
+
var now = Date.now();
|
|
926
|
+
for (var i = 0; i < fs5[gracefulQueue].length; ++i) {
|
|
927
|
+
if (fs5[gracefulQueue][i].length > 2) {
|
|
928
|
+
fs5[gracefulQueue][i][3] = now;
|
|
929
|
+
fs5[gracefulQueue][i][4] = now;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
retry();
|
|
933
|
+
}
|
|
934
|
+
function retry() {
|
|
935
|
+
clearTimeout(retryTimer);
|
|
936
|
+
retryTimer = void 0;
|
|
937
|
+
if (fs5[gracefulQueue].length === 0)
|
|
938
|
+
return;
|
|
939
|
+
var elem = fs5[gracefulQueue].shift();
|
|
940
|
+
var fn = elem[0];
|
|
941
|
+
var args = elem[1];
|
|
942
|
+
var err = elem[2];
|
|
943
|
+
var startTime = elem[3];
|
|
944
|
+
var lastTime = elem[4];
|
|
945
|
+
if (startTime === void 0) {
|
|
946
|
+
debug("RETRY", fn.name, args);
|
|
947
|
+
fn.apply(null, args);
|
|
948
|
+
} else if (Date.now() - startTime >= 6e4) {
|
|
949
|
+
debug("TIMEOUT", fn.name, args);
|
|
950
|
+
var cb = args.pop();
|
|
951
|
+
if (typeof cb === "function")
|
|
952
|
+
cb.call(null, err);
|
|
953
|
+
} else {
|
|
954
|
+
var sinceAttempt = Date.now() - lastTime;
|
|
955
|
+
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
956
|
+
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
957
|
+
if (sinceAttempt >= desiredDelay) {
|
|
958
|
+
debug("RETRY", fn.name, args);
|
|
959
|
+
fn.apply(null, args.concat([startTime]));
|
|
960
|
+
} else {
|
|
961
|
+
fs5[gracefulQueue].push(elem);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
if (retryTimer === void 0) {
|
|
965
|
+
retryTimer = setTimeout(retry, 0);
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
});
|
|
970
|
+
|
|
971
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js
|
|
972
|
+
var require_fs = __commonJS({
|
|
973
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js"(exports) {
|
|
974
|
+
init_cjs_shims();
|
|
975
|
+
var u = require_universalify().fromCallback;
|
|
976
|
+
var fs5 = require_graceful_fs();
|
|
977
|
+
var api = [
|
|
978
|
+
"access",
|
|
979
|
+
"appendFile",
|
|
980
|
+
"chmod",
|
|
981
|
+
"chown",
|
|
982
|
+
"close",
|
|
983
|
+
"copyFile",
|
|
984
|
+
"fchmod",
|
|
985
|
+
"fchown",
|
|
986
|
+
"fdatasync",
|
|
987
|
+
"fstat",
|
|
988
|
+
"fsync",
|
|
989
|
+
"ftruncate",
|
|
990
|
+
"futimes",
|
|
991
|
+
"lchmod",
|
|
992
|
+
"lchown",
|
|
993
|
+
"link",
|
|
994
|
+
"lstat",
|
|
995
|
+
"mkdir",
|
|
996
|
+
"mkdtemp",
|
|
997
|
+
"open",
|
|
998
|
+
"opendir",
|
|
999
|
+
"readdir",
|
|
1000
|
+
"readFile",
|
|
1001
|
+
"readlink",
|
|
1002
|
+
"realpath",
|
|
1003
|
+
"rename",
|
|
1004
|
+
"rm",
|
|
1005
|
+
"rmdir",
|
|
1006
|
+
"stat",
|
|
1007
|
+
"symlink",
|
|
1008
|
+
"truncate",
|
|
1009
|
+
"unlink",
|
|
1010
|
+
"utimes",
|
|
1011
|
+
"writeFile"
|
|
1012
|
+
].filter((key) => {
|
|
1013
|
+
return typeof fs5[key] === "function";
|
|
1014
|
+
});
|
|
1015
|
+
Object.assign(exports, fs5);
|
|
1016
|
+
api.forEach((method) => {
|
|
1017
|
+
exports[method] = u(fs5[method]);
|
|
1018
|
+
});
|
|
1019
|
+
exports.exists = function(filename, callback) {
|
|
1020
|
+
if (typeof callback === "function") {
|
|
1021
|
+
return fs5.exists(filename, callback);
|
|
1022
|
+
}
|
|
1023
|
+
return new Promise((resolve3) => {
|
|
1024
|
+
return fs5.exists(filename, resolve3);
|
|
1025
|
+
});
|
|
1026
|
+
};
|
|
1027
|
+
exports.read = function(fd, buffer, offset, length, position, callback) {
|
|
1028
|
+
if (typeof callback === "function") {
|
|
1029
|
+
return fs5.read(fd, buffer, offset, length, position, callback);
|
|
1030
|
+
}
|
|
1031
|
+
return new Promise((resolve3, reject) => {
|
|
1032
|
+
fs5.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
1033
|
+
if (err)
|
|
1034
|
+
return reject(err);
|
|
1035
|
+
resolve3({ bytesRead, buffer: buffer2 });
|
|
1036
|
+
});
|
|
1037
|
+
});
|
|
1038
|
+
};
|
|
1039
|
+
exports.write = function(fd, buffer, ...args) {
|
|
1040
|
+
if (typeof args[args.length - 1] === "function") {
|
|
1041
|
+
return fs5.write(fd, buffer, ...args);
|
|
1042
|
+
}
|
|
1043
|
+
return new Promise((resolve3, reject) => {
|
|
1044
|
+
fs5.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
1045
|
+
if (err)
|
|
1046
|
+
return reject(err);
|
|
1047
|
+
resolve3({ bytesWritten, buffer: buffer2 });
|
|
1048
|
+
});
|
|
1049
|
+
});
|
|
1050
|
+
};
|
|
1051
|
+
exports.readv = function(fd, buffers, ...args) {
|
|
1052
|
+
if (typeof args[args.length - 1] === "function") {
|
|
1053
|
+
return fs5.readv(fd, buffers, ...args);
|
|
1054
|
+
}
|
|
1055
|
+
return new Promise((resolve3, reject) => {
|
|
1056
|
+
fs5.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
|
|
1057
|
+
if (err)
|
|
1058
|
+
return reject(err);
|
|
1059
|
+
resolve3({ bytesRead, buffers: buffers2 });
|
|
1060
|
+
});
|
|
1061
|
+
});
|
|
1062
|
+
};
|
|
1063
|
+
exports.writev = function(fd, buffers, ...args) {
|
|
1064
|
+
if (typeof args[args.length - 1] === "function") {
|
|
1065
|
+
return fs5.writev(fd, buffers, ...args);
|
|
1066
|
+
}
|
|
1067
|
+
return new Promise((resolve3, reject) => {
|
|
1068
|
+
fs5.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
1069
|
+
if (err)
|
|
1070
|
+
return reject(err);
|
|
1071
|
+
resolve3({ bytesWritten, buffers: buffers2 });
|
|
1072
|
+
});
|
|
1073
|
+
});
|
|
1074
|
+
};
|
|
1075
|
+
if (typeof fs5.realpath.native === "function") {
|
|
1076
|
+
exports.realpath.native = u(fs5.realpath.native);
|
|
1077
|
+
} else {
|
|
1078
|
+
process.emitWarning(
|
|
1079
|
+
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
1080
|
+
"Warning",
|
|
1081
|
+
"fs-extra-WARN0003"
|
|
1082
|
+
);
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
});
|
|
1086
|
+
|
|
1087
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js
|
|
1088
|
+
var require_utils = __commonJS({
|
|
1089
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module) {
|
|
1090
|
+
init_cjs_shims();
|
|
1091
|
+
var path5 = __require("path");
|
|
1092
|
+
module.exports.checkPath = function checkPath(pth) {
|
|
1093
|
+
if (process.platform === "win32") {
|
|
1094
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path5.parse(pth).root, ""));
|
|
1095
|
+
if (pathHasInvalidWinCharacters) {
|
|
1096
|
+
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
1097
|
+
error.code = "EINVAL";
|
|
1098
|
+
throw error;
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
};
|
|
1102
|
+
}
|
|
1103
|
+
});
|
|
1104
|
+
|
|
1105
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js
|
|
1106
|
+
var require_make_dir = __commonJS({
|
|
1107
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module) {
|
|
1108
|
+
init_cjs_shims();
|
|
1109
|
+
var fs5 = require_fs();
|
|
1110
|
+
var { checkPath } = require_utils();
|
|
1111
|
+
var getMode = (options) => {
|
|
1112
|
+
const defaults = { mode: 511 };
|
|
1113
|
+
if (typeof options === "number")
|
|
1114
|
+
return options;
|
|
1115
|
+
return { ...defaults, ...options }.mode;
|
|
1116
|
+
};
|
|
1117
|
+
module.exports.makeDir = async (dir, options) => {
|
|
1118
|
+
checkPath(dir);
|
|
1119
|
+
return fs5.mkdir(dir, {
|
|
1120
|
+
mode: getMode(options),
|
|
1121
|
+
recursive: true
|
|
1122
|
+
});
|
|
1123
|
+
};
|
|
1124
|
+
module.exports.makeDirSync = (dir, options) => {
|
|
1125
|
+
checkPath(dir);
|
|
1126
|
+
return fs5.mkdirSync(dir, {
|
|
1127
|
+
mode: getMode(options),
|
|
1128
|
+
recursive: true
|
|
1129
|
+
});
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
1132
|
+
});
|
|
1133
|
+
|
|
1134
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js
|
|
1135
|
+
var require_mkdirs = __commonJS({
|
|
1136
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module) {
|
|
1137
|
+
init_cjs_shims();
|
|
1138
|
+
var u = require_universalify().fromPromise;
|
|
1139
|
+
var { makeDir: _makeDir, makeDirSync } = require_make_dir();
|
|
1140
|
+
var makeDir = u(_makeDir);
|
|
1141
|
+
module.exports = {
|
|
1142
|
+
mkdirs: makeDir,
|
|
1143
|
+
mkdirsSync: makeDirSync,
|
|
1144
|
+
// alias
|
|
1145
|
+
mkdirp: makeDir,
|
|
1146
|
+
mkdirpSync: makeDirSync,
|
|
1147
|
+
ensureDir: makeDir,
|
|
1148
|
+
ensureDirSync: makeDirSync
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
});
|
|
1152
|
+
|
|
1153
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js
|
|
1154
|
+
var require_path_exists = __commonJS({
|
|
1155
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js"(exports, module) {
|
|
1156
|
+
init_cjs_shims();
|
|
1157
|
+
var u = require_universalify().fromPromise;
|
|
1158
|
+
var fs5 = require_fs();
|
|
1159
|
+
function pathExists2(path5) {
|
|
1160
|
+
return fs5.access(path5).then(() => true).catch(() => false);
|
|
1161
|
+
}
|
|
1162
|
+
module.exports = {
|
|
1163
|
+
pathExists: u(pathExists2),
|
|
1164
|
+
pathExistsSync: fs5.existsSync
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1167
|
+
});
|
|
1168
|
+
|
|
1169
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js
|
|
1170
|
+
var require_utimes = __commonJS({
|
|
1171
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js"(exports, module) {
|
|
1172
|
+
init_cjs_shims();
|
|
1173
|
+
var fs5 = require_fs();
|
|
1174
|
+
var u = require_universalify().fromPromise;
|
|
1175
|
+
async function utimesMillis(path5, atime, mtime) {
|
|
1176
|
+
const fd = await fs5.open(path5, "r+");
|
|
1177
|
+
let closeErr = null;
|
|
1178
|
+
try {
|
|
1179
|
+
await fs5.futimes(fd, atime, mtime);
|
|
1180
|
+
} finally {
|
|
1181
|
+
try {
|
|
1182
|
+
await fs5.close(fd);
|
|
1183
|
+
} catch (e) {
|
|
1184
|
+
closeErr = e;
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
if (closeErr) {
|
|
1188
|
+
throw closeErr;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
function utimesMillisSync(path5, atime, mtime) {
|
|
1192
|
+
const fd = fs5.openSync(path5, "r+");
|
|
1193
|
+
fs5.futimesSync(fd, atime, mtime);
|
|
1194
|
+
return fs5.closeSync(fd);
|
|
1195
|
+
}
|
|
1196
|
+
module.exports = {
|
|
1197
|
+
utimesMillis: u(utimesMillis),
|
|
1198
|
+
utimesMillisSync
|
|
1199
|
+
};
|
|
1200
|
+
}
|
|
1201
|
+
});
|
|
1202
|
+
|
|
1203
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js
|
|
1204
|
+
var require_stat = __commonJS({
|
|
1205
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js"(exports, module) {
|
|
1206
|
+
init_cjs_shims();
|
|
1207
|
+
var fs5 = require_fs();
|
|
1208
|
+
var path5 = __require("path");
|
|
1209
|
+
var u = require_universalify().fromPromise;
|
|
1210
|
+
function getStats(src, dest, opts) {
|
|
1211
|
+
const statFunc = opts.dereference ? (file) => fs5.stat(file, { bigint: true }) : (file) => fs5.lstat(file, { bigint: true });
|
|
1212
|
+
return Promise.all([
|
|
1213
|
+
statFunc(src),
|
|
1214
|
+
statFunc(dest).catch((err) => {
|
|
1215
|
+
if (err.code === "ENOENT")
|
|
1216
|
+
return null;
|
|
1217
|
+
throw err;
|
|
1218
|
+
})
|
|
1219
|
+
]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
|
|
1220
|
+
}
|
|
1221
|
+
function getStatsSync(src, dest, opts) {
|
|
1222
|
+
let destStat;
|
|
1223
|
+
const statFunc = opts.dereference ? (file) => fs5.statSync(file, { bigint: true }) : (file) => fs5.lstatSync(file, { bigint: true });
|
|
1224
|
+
const srcStat = statFunc(src);
|
|
1225
|
+
try {
|
|
1226
|
+
destStat = statFunc(dest);
|
|
1227
|
+
} catch (err) {
|
|
1228
|
+
if (err.code === "ENOENT")
|
|
1229
|
+
return { srcStat, destStat: null };
|
|
1230
|
+
throw err;
|
|
1231
|
+
}
|
|
1232
|
+
return { srcStat, destStat };
|
|
1233
|
+
}
|
|
1234
|
+
async function checkPaths(src, dest, funcName, opts) {
|
|
1235
|
+
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
1236
|
+
if (destStat) {
|
|
1237
|
+
if (areIdentical(srcStat, destStat)) {
|
|
1238
|
+
const srcBaseName = path5.basename(src);
|
|
1239
|
+
const destBaseName = path5.basename(dest);
|
|
1240
|
+
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1241
|
+
return { srcStat, destStat, isChangingCase: true };
|
|
1242
|
+
}
|
|
1243
|
+
throw new Error("Source and destination must not be the same.");
|
|
1244
|
+
}
|
|
1245
|
+
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
|
1246
|
+
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
|
1247
|
+
}
|
|
1248
|
+
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
|
1249
|
+
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
|
1253
|
+
throw new Error(errMsg(src, dest, funcName));
|
|
1254
|
+
}
|
|
1255
|
+
return { srcStat, destStat };
|
|
1256
|
+
}
|
|
1257
|
+
function checkPathsSync(src, dest, funcName, opts) {
|
|
1258
|
+
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
1259
|
+
if (destStat) {
|
|
1260
|
+
if (areIdentical(srcStat, destStat)) {
|
|
1261
|
+
const srcBaseName = path5.basename(src);
|
|
1262
|
+
const destBaseName = path5.basename(dest);
|
|
1263
|
+
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1264
|
+
return { srcStat, destStat, isChangingCase: true };
|
|
1265
|
+
}
|
|
1266
|
+
throw new Error("Source and destination must not be the same.");
|
|
1267
|
+
}
|
|
1268
|
+
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
|
1269
|
+
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
|
1270
|
+
}
|
|
1271
|
+
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
|
1272
|
+
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
|
1276
|
+
throw new Error(errMsg(src, dest, funcName));
|
|
1277
|
+
}
|
|
1278
|
+
return { srcStat, destStat };
|
|
1279
|
+
}
|
|
1280
|
+
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
1281
|
+
const srcParent = path5.resolve(path5.dirname(src));
|
|
1282
|
+
const destParent = path5.resolve(path5.dirname(dest));
|
|
1283
|
+
if (destParent === srcParent || destParent === path5.parse(destParent).root)
|
|
1284
|
+
return;
|
|
1285
|
+
let destStat;
|
|
1286
|
+
try {
|
|
1287
|
+
destStat = await fs5.stat(destParent, { bigint: true });
|
|
1288
|
+
} catch (err) {
|
|
1289
|
+
if (err.code === "ENOENT")
|
|
1290
|
+
return;
|
|
1291
|
+
throw err;
|
|
1292
|
+
}
|
|
1293
|
+
if (areIdentical(srcStat, destStat)) {
|
|
1294
|
+
throw new Error(errMsg(src, dest, funcName));
|
|
1295
|
+
}
|
|
1296
|
+
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
1297
|
+
}
|
|
1298
|
+
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
1299
|
+
const srcParent = path5.resolve(path5.dirname(src));
|
|
1300
|
+
const destParent = path5.resolve(path5.dirname(dest));
|
|
1301
|
+
if (destParent === srcParent || destParent === path5.parse(destParent).root)
|
|
1302
|
+
return;
|
|
1303
|
+
let destStat;
|
|
1304
|
+
try {
|
|
1305
|
+
destStat = fs5.statSync(destParent, { bigint: true });
|
|
1306
|
+
} catch (err) {
|
|
1307
|
+
if (err.code === "ENOENT")
|
|
1308
|
+
return;
|
|
1309
|
+
throw err;
|
|
1310
|
+
}
|
|
1311
|
+
if (areIdentical(srcStat, destStat)) {
|
|
1312
|
+
throw new Error(errMsg(src, dest, funcName));
|
|
1313
|
+
}
|
|
1314
|
+
return checkParentPathsSync(src, srcStat, destParent, funcName);
|
|
1315
|
+
}
|
|
1316
|
+
function areIdentical(srcStat, destStat) {
|
|
1317
|
+
return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
1318
|
+
}
|
|
1319
|
+
function isSrcSubdir(src, dest) {
|
|
1320
|
+
const srcArr = path5.resolve(src).split(path5.sep).filter((i) => i);
|
|
1321
|
+
const destArr = path5.resolve(dest).split(path5.sep).filter((i) => i);
|
|
1322
|
+
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
1323
|
+
}
|
|
1324
|
+
function errMsg(src, dest, funcName) {
|
|
1325
|
+
return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
|
|
1326
|
+
}
|
|
1327
|
+
module.exports = {
|
|
1328
|
+
// checkPaths
|
|
1329
|
+
checkPaths: u(checkPaths),
|
|
1330
|
+
checkPathsSync,
|
|
1331
|
+
// checkParent
|
|
1332
|
+
checkParentPaths: u(checkParentPaths),
|
|
1333
|
+
checkParentPathsSync,
|
|
1334
|
+
// Misc
|
|
1335
|
+
isSrcSubdir,
|
|
1336
|
+
areIdentical
|
|
1337
|
+
};
|
|
1338
|
+
}
|
|
1339
|
+
});
|
|
1340
|
+
|
|
1341
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js
|
|
1342
|
+
var require_copy = __commonJS({
|
|
1343
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js"(exports, module) {
|
|
1344
|
+
init_cjs_shims();
|
|
1345
|
+
var fs5 = require_fs();
|
|
1346
|
+
var path5 = __require("path");
|
|
1347
|
+
var { mkdirs } = require_mkdirs();
|
|
1348
|
+
var { pathExists: pathExists2 } = require_path_exists();
|
|
1349
|
+
var { utimesMillis } = require_utimes();
|
|
1350
|
+
var stat = require_stat();
|
|
1351
|
+
async function copy(src, dest, opts = {}) {
|
|
1352
|
+
if (typeof opts === "function") {
|
|
1353
|
+
opts = { filter: opts };
|
|
1354
|
+
}
|
|
1355
|
+
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
1356
|
+
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
1357
|
+
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
1358
|
+
process.emitWarning(
|
|
1359
|
+
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
|
1360
|
+
"Warning",
|
|
1361
|
+
"fs-extra-WARN0001"
|
|
1362
|
+
);
|
|
1363
|
+
}
|
|
1364
|
+
const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts);
|
|
1365
|
+
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
1366
|
+
const include = await runFilter(src, dest, opts);
|
|
1367
|
+
if (!include)
|
|
1368
|
+
return;
|
|
1369
|
+
const destParent = path5.dirname(dest);
|
|
1370
|
+
const dirExists = await pathExists2(destParent);
|
|
1371
|
+
if (!dirExists) {
|
|
1372
|
+
await mkdirs(destParent);
|
|
1373
|
+
}
|
|
1374
|
+
await getStatsAndPerformCopy(destStat, src, dest, opts);
|
|
1375
|
+
}
|
|
1376
|
+
async function runFilter(src, dest, opts) {
|
|
1377
|
+
if (!opts.filter)
|
|
1378
|
+
return true;
|
|
1379
|
+
return opts.filter(src, dest);
|
|
1380
|
+
}
|
|
1381
|
+
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
1382
|
+
const statFn = opts.dereference ? fs5.stat : fs5.lstat;
|
|
1383
|
+
const srcStat = await statFn(src);
|
|
1384
|
+
if (srcStat.isDirectory())
|
|
1385
|
+
return onDir(srcStat, destStat, src, dest, opts);
|
|
1386
|
+
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
|
|
1387
|
+
return onFile(srcStat, destStat, src, dest, opts);
|
|
1388
|
+
if (srcStat.isSymbolicLink())
|
|
1389
|
+
return onLink(destStat, src, dest, opts);
|
|
1390
|
+
if (srcStat.isSocket())
|
|
1391
|
+
throw new Error(`Cannot copy a socket file: ${src}`);
|
|
1392
|
+
if (srcStat.isFIFO())
|
|
1393
|
+
throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
|
1394
|
+
throw new Error(`Unknown file: ${src}`);
|
|
1395
|
+
}
|
|
1396
|
+
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
1397
|
+
if (!destStat)
|
|
1398
|
+
return copyFile(srcStat, src, dest, opts);
|
|
1399
|
+
if (opts.overwrite) {
|
|
1400
|
+
await fs5.unlink(dest);
|
|
1401
|
+
return copyFile(srcStat, src, dest, opts);
|
|
1402
|
+
}
|
|
1403
|
+
if (opts.errorOnExist) {
|
|
1404
|
+
throw new Error(`'${dest}' already exists`);
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
async function copyFile(srcStat, src, dest, opts) {
|
|
1408
|
+
await fs5.copyFile(src, dest);
|
|
1409
|
+
if (opts.preserveTimestamps) {
|
|
1410
|
+
if (fileIsNotWritable(srcStat.mode)) {
|
|
1411
|
+
await makeFileWritable(dest, srcStat.mode);
|
|
1412
|
+
}
|
|
1413
|
+
const updatedSrcStat = await fs5.stat(src);
|
|
1414
|
+
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1415
|
+
}
|
|
1416
|
+
return fs5.chmod(dest, srcStat.mode);
|
|
1417
|
+
}
|
|
1418
|
+
function fileIsNotWritable(srcMode) {
|
|
1419
|
+
return (srcMode & 128) === 0;
|
|
1420
|
+
}
|
|
1421
|
+
function makeFileWritable(dest, srcMode) {
|
|
1422
|
+
return fs5.chmod(dest, srcMode | 128);
|
|
1423
|
+
}
|
|
1424
|
+
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
1425
|
+
if (!destStat) {
|
|
1426
|
+
await fs5.mkdir(dest);
|
|
1427
|
+
}
|
|
1428
|
+
const items = await fs5.readdir(src);
|
|
1429
|
+
await Promise.all(items.map(async (item) => {
|
|
1430
|
+
const srcItem = path5.join(src, item);
|
|
1431
|
+
const destItem = path5.join(dest, item);
|
|
1432
|
+
const include = await runFilter(srcItem, destItem, opts);
|
|
1433
|
+
if (!include)
|
|
1434
|
+
return;
|
|
1435
|
+
const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
|
|
1436
|
+
return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
|
|
1437
|
+
}));
|
|
1438
|
+
if (!destStat) {
|
|
1439
|
+
await fs5.chmod(dest, srcStat.mode);
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
async function onLink(destStat, src, dest, opts) {
|
|
1443
|
+
let resolvedSrc = await fs5.readlink(src);
|
|
1444
|
+
if (opts.dereference) {
|
|
1445
|
+
resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
|
|
1446
|
+
}
|
|
1447
|
+
if (!destStat) {
|
|
1448
|
+
return fs5.symlink(resolvedSrc, dest);
|
|
1449
|
+
}
|
|
1450
|
+
let resolvedDest = null;
|
|
1451
|
+
try {
|
|
1452
|
+
resolvedDest = await fs5.readlink(dest);
|
|
1453
|
+
} catch (e) {
|
|
1454
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN")
|
|
1455
|
+
return fs5.symlink(resolvedSrc, dest);
|
|
1456
|
+
throw e;
|
|
1457
|
+
}
|
|
1458
|
+
if (opts.dereference) {
|
|
1459
|
+
resolvedDest = path5.resolve(process.cwd(), resolvedDest);
|
|
1460
|
+
}
|
|
1461
|
+
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1462
|
+
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
1463
|
+
}
|
|
1464
|
+
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
1465
|
+
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
1466
|
+
}
|
|
1467
|
+
await fs5.unlink(dest);
|
|
1468
|
+
return fs5.symlink(resolvedSrc, dest);
|
|
1469
|
+
}
|
|
1470
|
+
module.exports = copy;
|
|
1471
|
+
}
|
|
1472
|
+
});
|
|
1473
|
+
|
|
1474
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js
|
|
1475
|
+
var require_copy_sync = __commonJS({
|
|
1476
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module) {
|
|
1477
|
+
init_cjs_shims();
|
|
1478
|
+
var fs5 = require_graceful_fs();
|
|
1479
|
+
var path5 = __require("path");
|
|
1480
|
+
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
1481
|
+
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
1482
|
+
var stat = require_stat();
|
|
1483
|
+
function copySync(src, dest, opts) {
|
|
1484
|
+
if (typeof opts === "function") {
|
|
1485
|
+
opts = { filter: opts };
|
|
1486
|
+
}
|
|
1487
|
+
opts = opts || {};
|
|
1488
|
+
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
1489
|
+
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
1490
|
+
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
1491
|
+
process.emitWarning(
|
|
1492
|
+
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
|
1493
|
+
"Warning",
|
|
1494
|
+
"fs-extra-WARN0002"
|
|
1495
|
+
);
|
|
1496
|
+
}
|
|
1497
|
+
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
1498
|
+
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
1499
|
+
if (opts.filter && !opts.filter(src, dest))
|
|
1500
|
+
return;
|
|
1501
|
+
const destParent = path5.dirname(dest);
|
|
1502
|
+
if (!fs5.existsSync(destParent))
|
|
1503
|
+
mkdirsSync(destParent);
|
|
1504
|
+
return getStats(destStat, src, dest, opts);
|
|
1505
|
+
}
|
|
1506
|
+
function getStats(destStat, src, dest, opts) {
|
|
1507
|
+
const statSync = opts.dereference ? fs5.statSync : fs5.lstatSync;
|
|
1508
|
+
const srcStat = statSync(src);
|
|
1509
|
+
if (srcStat.isDirectory())
|
|
1510
|
+
return onDir(srcStat, destStat, src, dest, opts);
|
|
1511
|
+
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
|
|
1512
|
+
return onFile(srcStat, destStat, src, dest, opts);
|
|
1513
|
+
else if (srcStat.isSymbolicLink())
|
|
1514
|
+
return onLink(destStat, src, dest, opts);
|
|
1515
|
+
else if (srcStat.isSocket())
|
|
1516
|
+
throw new Error(`Cannot copy a socket file: ${src}`);
|
|
1517
|
+
else if (srcStat.isFIFO())
|
|
1518
|
+
throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
|
1519
|
+
throw new Error(`Unknown file: ${src}`);
|
|
1520
|
+
}
|
|
1521
|
+
function onFile(srcStat, destStat, src, dest, opts) {
|
|
1522
|
+
if (!destStat)
|
|
1523
|
+
return copyFile(srcStat, src, dest, opts);
|
|
1524
|
+
return mayCopyFile(srcStat, src, dest, opts);
|
|
1525
|
+
}
|
|
1526
|
+
function mayCopyFile(srcStat, src, dest, opts) {
|
|
1527
|
+
if (opts.overwrite) {
|
|
1528
|
+
fs5.unlinkSync(dest);
|
|
1529
|
+
return copyFile(srcStat, src, dest, opts);
|
|
1530
|
+
} else if (opts.errorOnExist) {
|
|
1531
|
+
throw new Error(`'${dest}' already exists`);
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
function copyFile(srcStat, src, dest, opts) {
|
|
1535
|
+
fs5.copyFileSync(src, dest);
|
|
1536
|
+
if (opts.preserveTimestamps)
|
|
1537
|
+
handleTimestamps(srcStat.mode, src, dest);
|
|
1538
|
+
return setDestMode(dest, srcStat.mode);
|
|
1539
|
+
}
|
|
1540
|
+
function handleTimestamps(srcMode, src, dest) {
|
|
1541
|
+
if (fileIsNotWritable(srcMode))
|
|
1542
|
+
makeFileWritable(dest, srcMode);
|
|
1543
|
+
return setDestTimestamps(src, dest);
|
|
1544
|
+
}
|
|
1545
|
+
function fileIsNotWritable(srcMode) {
|
|
1546
|
+
return (srcMode & 128) === 0;
|
|
1547
|
+
}
|
|
1548
|
+
function makeFileWritable(dest, srcMode) {
|
|
1549
|
+
return setDestMode(dest, srcMode | 128);
|
|
1550
|
+
}
|
|
1551
|
+
function setDestMode(dest, srcMode) {
|
|
1552
|
+
return fs5.chmodSync(dest, srcMode);
|
|
1553
|
+
}
|
|
1554
|
+
function setDestTimestamps(src, dest) {
|
|
1555
|
+
const updatedSrcStat = fs5.statSync(src);
|
|
1556
|
+
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1557
|
+
}
|
|
1558
|
+
function onDir(srcStat, destStat, src, dest, opts) {
|
|
1559
|
+
if (!destStat)
|
|
1560
|
+
return mkDirAndCopy(srcStat.mode, src, dest, opts);
|
|
1561
|
+
return copyDir(src, dest, opts);
|
|
1562
|
+
}
|
|
1563
|
+
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
1564
|
+
fs5.mkdirSync(dest);
|
|
1565
|
+
copyDir(src, dest, opts);
|
|
1566
|
+
return setDestMode(dest, srcMode);
|
|
1567
|
+
}
|
|
1568
|
+
function copyDir(src, dest, opts) {
|
|
1569
|
+
fs5.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
|
|
1570
|
+
}
|
|
1571
|
+
function copyDirItem(item, src, dest, opts) {
|
|
1572
|
+
const srcItem = path5.join(src, item);
|
|
1573
|
+
const destItem = path5.join(dest, item);
|
|
1574
|
+
if (opts.filter && !opts.filter(srcItem, destItem))
|
|
1575
|
+
return;
|
|
1576
|
+
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
1577
|
+
return getStats(destStat, srcItem, destItem, opts);
|
|
1578
|
+
}
|
|
1579
|
+
function onLink(destStat, src, dest, opts) {
|
|
1580
|
+
let resolvedSrc = fs5.readlinkSync(src);
|
|
1581
|
+
if (opts.dereference) {
|
|
1582
|
+
resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
|
|
1583
|
+
}
|
|
1584
|
+
if (!destStat) {
|
|
1585
|
+
return fs5.symlinkSync(resolvedSrc, dest);
|
|
1586
|
+
} else {
|
|
1587
|
+
let resolvedDest;
|
|
1588
|
+
try {
|
|
1589
|
+
resolvedDest = fs5.readlinkSync(dest);
|
|
1590
|
+
} catch (err) {
|
|
1591
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN")
|
|
1592
|
+
return fs5.symlinkSync(resolvedSrc, dest);
|
|
1593
|
+
throw err;
|
|
1594
|
+
}
|
|
1595
|
+
if (opts.dereference) {
|
|
1596
|
+
resolvedDest = path5.resolve(process.cwd(), resolvedDest);
|
|
1597
|
+
}
|
|
1598
|
+
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1599
|
+
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
1600
|
+
}
|
|
1601
|
+
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
1602
|
+
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
1603
|
+
}
|
|
1604
|
+
return copyLink(resolvedSrc, dest);
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
function copyLink(resolvedSrc, dest) {
|
|
1608
|
+
fs5.unlinkSync(dest);
|
|
1609
|
+
return fs5.symlinkSync(resolvedSrc, dest);
|
|
1610
|
+
}
|
|
1611
|
+
module.exports = copySync;
|
|
1612
|
+
}
|
|
1613
|
+
});
|
|
1614
|
+
|
|
1615
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js
|
|
1616
|
+
var require_copy2 = __commonJS({
|
|
1617
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js"(exports, module) {
|
|
1618
|
+
init_cjs_shims();
|
|
1619
|
+
var u = require_universalify().fromPromise;
|
|
1620
|
+
module.exports = {
|
|
1621
|
+
copy: u(require_copy()),
|
|
1622
|
+
copySync: require_copy_sync()
|
|
1623
|
+
};
|
|
1624
|
+
}
|
|
1625
|
+
});
|
|
1626
|
+
|
|
1627
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js
|
|
1628
|
+
var require_remove = __commonJS({
|
|
1629
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js"(exports, module) {
|
|
1630
|
+
init_cjs_shims();
|
|
1631
|
+
var fs5 = require_graceful_fs();
|
|
1632
|
+
var u = require_universalify().fromCallback;
|
|
1633
|
+
function remove2(path5, callback) {
|
|
1634
|
+
fs5.rm(path5, { recursive: true, force: true }, callback);
|
|
1635
|
+
}
|
|
1636
|
+
function removeSync(path5) {
|
|
1637
|
+
fs5.rmSync(path5, { recursive: true, force: true });
|
|
1638
|
+
}
|
|
1639
|
+
module.exports = {
|
|
1640
|
+
remove: u(remove2),
|
|
1641
|
+
removeSync
|
|
1642
|
+
};
|
|
1643
|
+
}
|
|
1644
|
+
});
|
|
1645
|
+
|
|
1646
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js
|
|
1647
|
+
var require_empty = __commonJS({
|
|
1648
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js"(exports, module) {
|
|
1649
|
+
init_cjs_shims();
|
|
1650
|
+
var u = require_universalify().fromPromise;
|
|
1651
|
+
var fs5 = require_fs();
|
|
1652
|
+
var path5 = __require("path");
|
|
1653
|
+
var mkdir = require_mkdirs();
|
|
1654
|
+
var remove2 = require_remove();
|
|
1655
|
+
var emptyDir = u(async function emptyDir2(dir) {
|
|
1656
|
+
let items;
|
|
1657
|
+
try {
|
|
1658
|
+
items = await fs5.readdir(dir);
|
|
1659
|
+
} catch {
|
|
1660
|
+
return mkdir.mkdirs(dir);
|
|
1661
|
+
}
|
|
1662
|
+
return Promise.all(items.map((item) => remove2.remove(path5.join(dir, item))));
|
|
1663
|
+
});
|
|
1664
|
+
function emptyDirSync(dir) {
|
|
1665
|
+
let items;
|
|
1666
|
+
try {
|
|
1667
|
+
items = fs5.readdirSync(dir);
|
|
1668
|
+
} catch {
|
|
1669
|
+
return mkdir.mkdirsSync(dir);
|
|
1670
|
+
}
|
|
1671
|
+
items.forEach((item) => {
|
|
1672
|
+
item = path5.join(dir, item);
|
|
1673
|
+
remove2.removeSync(item);
|
|
1674
|
+
});
|
|
1675
|
+
}
|
|
1676
|
+
module.exports = {
|
|
1677
|
+
emptyDirSync,
|
|
1678
|
+
emptydirSync: emptyDirSync,
|
|
1679
|
+
emptyDir,
|
|
1680
|
+
emptydir: emptyDir
|
|
1681
|
+
};
|
|
1682
|
+
}
|
|
1683
|
+
});
|
|
1684
|
+
|
|
1685
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js
|
|
1686
|
+
var require_file = __commonJS({
|
|
1687
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js"(exports, module) {
|
|
1688
|
+
init_cjs_shims();
|
|
1689
|
+
var u = require_universalify().fromPromise;
|
|
1690
|
+
var path5 = __require("path");
|
|
1691
|
+
var fs5 = require_fs();
|
|
1692
|
+
var mkdir = require_mkdirs();
|
|
1693
|
+
async function createFile(file) {
|
|
1694
|
+
let stats;
|
|
1695
|
+
try {
|
|
1696
|
+
stats = await fs5.stat(file);
|
|
1697
|
+
} catch {
|
|
1698
|
+
}
|
|
1699
|
+
if (stats && stats.isFile())
|
|
1700
|
+
return;
|
|
1701
|
+
const dir = path5.dirname(file);
|
|
1702
|
+
let dirStats = null;
|
|
1703
|
+
try {
|
|
1704
|
+
dirStats = await fs5.stat(dir);
|
|
1705
|
+
} catch (err) {
|
|
1706
|
+
if (err.code === "ENOENT") {
|
|
1707
|
+
await mkdir.mkdirs(dir);
|
|
1708
|
+
await fs5.writeFile(file, "");
|
|
1709
|
+
return;
|
|
1710
|
+
} else {
|
|
1711
|
+
throw err;
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
if (dirStats.isDirectory()) {
|
|
1715
|
+
await fs5.writeFile(file, "");
|
|
1716
|
+
} else {
|
|
1717
|
+
await fs5.readdir(dir);
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
function createFileSync(file) {
|
|
1721
|
+
let stats;
|
|
1722
|
+
try {
|
|
1723
|
+
stats = fs5.statSync(file);
|
|
1724
|
+
} catch {
|
|
1725
|
+
}
|
|
1726
|
+
if (stats && stats.isFile())
|
|
1727
|
+
return;
|
|
1728
|
+
const dir = path5.dirname(file);
|
|
1729
|
+
try {
|
|
1730
|
+
if (!fs5.statSync(dir).isDirectory()) {
|
|
1731
|
+
fs5.readdirSync(dir);
|
|
1732
|
+
}
|
|
1733
|
+
} catch (err) {
|
|
1734
|
+
if (err && err.code === "ENOENT")
|
|
1735
|
+
mkdir.mkdirsSync(dir);
|
|
1736
|
+
else
|
|
1737
|
+
throw err;
|
|
1738
|
+
}
|
|
1739
|
+
fs5.writeFileSync(file, "");
|
|
1740
|
+
}
|
|
1741
|
+
module.exports = {
|
|
1742
|
+
createFile: u(createFile),
|
|
1743
|
+
createFileSync
|
|
1744
|
+
};
|
|
1745
|
+
}
|
|
1746
|
+
});
|
|
1747
|
+
|
|
1748
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js
|
|
1749
|
+
var require_link = __commonJS({
|
|
1750
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js"(exports, module) {
|
|
1751
|
+
init_cjs_shims();
|
|
1752
|
+
var u = require_universalify().fromPromise;
|
|
1753
|
+
var path5 = __require("path");
|
|
1754
|
+
var fs5 = require_fs();
|
|
1755
|
+
var mkdir = require_mkdirs();
|
|
1756
|
+
var { pathExists: pathExists2 } = require_path_exists();
|
|
1757
|
+
var { areIdentical } = require_stat();
|
|
1758
|
+
async function createLink(srcpath, dstpath) {
|
|
1759
|
+
let dstStat;
|
|
1760
|
+
try {
|
|
1761
|
+
dstStat = await fs5.lstat(dstpath);
|
|
1762
|
+
} catch {
|
|
1763
|
+
}
|
|
1764
|
+
let srcStat;
|
|
1765
|
+
try {
|
|
1766
|
+
srcStat = await fs5.lstat(srcpath);
|
|
1767
|
+
} catch (err) {
|
|
1768
|
+
err.message = err.message.replace("lstat", "ensureLink");
|
|
1769
|
+
throw err;
|
|
1770
|
+
}
|
|
1771
|
+
if (dstStat && areIdentical(srcStat, dstStat))
|
|
1772
|
+
return;
|
|
1773
|
+
const dir = path5.dirname(dstpath);
|
|
1774
|
+
const dirExists = await pathExists2(dir);
|
|
1775
|
+
if (!dirExists) {
|
|
1776
|
+
await mkdir.mkdirs(dir);
|
|
1777
|
+
}
|
|
1778
|
+
await fs5.link(srcpath, dstpath);
|
|
1779
|
+
}
|
|
1780
|
+
function createLinkSync(srcpath, dstpath) {
|
|
1781
|
+
let dstStat;
|
|
1782
|
+
try {
|
|
1783
|
+
dstStat = fs5.lstatSync(dstpath);
|
|
1784
|
+
} catch {
|
|
1785
|
+
}
|
|
1786
|
+
try {
|
|
1787
|
+
const srcStat = fs5.lstatSync(srcpath);
|
|
1788
|
+
if (dstStat && areIdentical(srcStat, dstStat))
|
|
1789
|
+
return;
|
|
1790
|
+
} catch (err) {
|
|
1791
|
+
err.message = err.message.replace("lstat", "ensureLink");
|
|
1792
|
+
throw err;
|
|
1793
|
+
}
|
|
1794
|
+
const dir = path5.dirname(dstpath);
|
|
1795
|
+
const dirExists = fs5.existsSync(dir);
|
|
1796
|
+
if (dirExists)
|
|
1797
|
+
return fs5.linkSync(srcpath, dstpath);
|
|
1798
|
+
mkdir.mkdirsSync(dir);
|
|
1799
|
+
return fs5.linkSync(srcpath, dstpath);
|
|
1800
|
+
}
|
|
1801
|
+
module.exports = {
|
|
1802
|
+
createLink: u(createLink),
|
|
1803
|
+
createLinkSync
|
|
1804
|
+
};
|
|
1805
|
+
}
|
|
1806
|
+
});
|
|
1807
|
+
|
|
1808
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js
|
|
1809
|
+
var require_symlink_paths = __commonJS({
|
|
1810
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module) {
|
|
1811
|
+
init_cjs_shims();
|
|
1812
|
+
var path5 = __require("path");
|
|
1813
|
+
var fs5 = require_fs();
|
|
1814
|
+
var { pathExists: pathExists2 } = require_path_exists();
|
|
1815
|
+
var u = require_universalify().fromPromise;
|
|
1816
|
+
async function symlinkPaths(srcpath, dstpath) {
|
|
1817
|
+
if (path5.isAbsolute(srcpath)) {
|
|
1818
|
+
try {
|
|
1819
|
+
await fs5.lstat(srcpath);
|
|
1820
|
+
} catch (err) {
|
|
1821
|
+
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
1822
|
+
throw err;
|
|
1823
|
+
}
|
|
1824
|
+
return {
|
|
1825
|
+
toCwd: srcpath,
|
|
1826
|
+
toDst: srcpath
|
|
1827
|
+
};
|
|
1828
|
+
}
|
|
1829
|
+
const dstdir = path5.dirname(dstpath);
|
|
1830
|
+
const relativeToDst = path5.join(dstdir, srcpath);
|
|
1831
|
+
const exists = await pathExists2(relativeToDst);
|
|
1832
|
+
if (exists) {
|
|
1833
|
+
return {
|
|
1834
|
+
toCwd: relativeToDst,
|
|
1835
|
+
toDst: srcpath
|
|
1836
|
+
};
|
|
1837
|
+
}
|
|
1838
|
+
try {
|
|
1839
|
+
await fs5.lstat(srcpath);
|
|
1840
|
+
} catch (err) {
|
|
1841
|
+
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
1842
|
+
throw err;
|
|
1843
|
+
}
|
|
1844
|
+
return {
|
|
1845
|
+
toCwd: srcpath,
|
|
1846
|
+
toDst: path5.relative(dstdir, srcpath)
|
|
1847
|
+
};
|
|
1848
|
+
}
|
|
1849
|
+
function symlinkPathsSync(srcpath, dstpath) {
|
|
1850
|
+
if (path5.isAbsolute(srcpath)) {
|
|
1851
|
+
const exists2 = fs5.existsSync(srcpath);
|
|
1852
|
+
if (!exists2)
|
|
1853
|
+
throw new Error("absolute srcpath does not exist");
|
|
1854
|
+
return {
|
|
1855
|
+
toCwd: srcpath,
|
|
1856
|
+
toDst: srcpath
|
|
1857
|
+
};
|
|
1858
|
+
}
|
|
1859
|
+
const dstdir = path5.dirname(dstpath);
|
|
1860
|
+
const relativeToDst = path5.join(dstdir, srcpath);
|
|
1861
|
+
const exists = fs5.existsSync(relativeToDst);
|
|
1862
|
+
if (exists) {
|
|
1863
|
+
return {
|
|
1864
|
+
toCwd: relativeToDst,
|
|
1865
|
+
toDst: srcpath
|
|
1866
|
+
};
|
|
1867
|
+
}
|
|
1868
|
+
const srcExists = fs5.existsSync(srcpath);
|
|
1869
|
+
if (!srcExists)
|
|
1870
|
+
throw new Error("relative srcpath does not exist");
|
|
1871
|
+
return {
|
|
1872
|
+
toCwd: srcpath,
|
|
1873
|
+
toDst: path5.relative(dstdir, srcpath)
|
|
1874
|
+
};
|
|
1875
|
+
}
|
|
1876
|
+
module.exports = {
|
|
1877
|
+
symlinkPaths: u(symlinkPaths),
|
|
1878
|
+
symlinkPathsSync
|
|
1879
|
+
};
|
|
1880
|
+
}
|
|
1881
|
+
});
|
|
1882
|
+
|
|
1883
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js
|
|
1884
|
+
var require_symlink_type = __commonJS({
|
|
1885
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module) {
|
|
1886
|
+
init_cjs_shims();
|
|
1887
|
+
var fs5 = require_fs();
|
|
1888
|
+
var u = require_universalify().fromPromise;
|
|
1889
|
+
async function symlinkType(srcpath, type) {
|
|
1890
|
+
if (type)
|
|
1891
|
+
return type;
|
|
1892
|
+
let stats;
|
|
1893
|
+
try {
|
|
1894
|
+
stats = await fs5.lstat(srcpath);
|
|
1895
|
+
} catch {
|
|
1896
|
+
return "file";
|
|
1897
|
+
}
|
|
1898
|
+
return stats && stats.isDirectory() ? "dir" : "file";
|
|
1899
|
+
}
|
|
1900
|
+
function symlinkTypeSync(srcpath, type) {
|
|
1901
|
+
if (type)
|
|
1902
|
+
return type;
|
|
1903
|
+
let stats;
|
|
1904
|
+
try {
|
|
1905
|
+
stats = fs5.lstatSync(srcpath);
|
|
1906
|
+
} catch {
|
|
1907
|
+
return "file";
|
|
1908
|
+
}
|
|
1909
|
+
return stats && stats.isDirectory() ? "dir" : "file";
|
|
1910
|
+
}
|
|
1911
|
+
module.exports = {
|
|
1912
|
+
symlinkType: u(symlinkType),
|
|
1913
|
+
symlinkTypeSync
|
|
1914
|
+
};
|
|
1915
|
+
}
|
|
1916
|
+
});
|
|
1917
|
+
|
|
1918
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js
|
|
1919
|
+
var require_symlink = __commonJS({
|
|
1920
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module) {
|
|
1921
|
+
init_cjs_shims();
|
|
1922
|
+
var u = require_universalify().fromPromise;
|
|
1923
|
+
var path5 = __require("path");
|
|
1924
|
+
var fs5 = require_fs();
|
|
1925
|
+
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
1926
|
+
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
1927
|
+
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
1928
|
+
var { pathExists: pathExists2 } = require_path_exists();
|
|
1929
|
+
var { areIdentical } = require_stat();
|
|
1930
|
+
async function createSymlink(srcpath, dstpath, type) {
|
|
1931
|
+
let stats;
|
|
1932
|
+
try {
|
|
1933
|
+
stats = await fs5.lstat(dstpath);
|
|
1934
|
+
} catch {
|
|
1935
|
+
}
|
|
1936
|
+
if (stats && stats.isSymbolicLink()) {
|
|
1937
|
+
const [srcStat, dstStat] = await Promise.all([
|
|
1938
|
+
fs5.stat(srcpath),
|
|
1939
|
+
fs5.stat(dstpath)
|
|
1940
|
+
]);
|
|
1941
|
+
if (areIdentical(srcStat, dstStat))
|
|
1942
|
+
return;
|
|
1943
|
+
}
|
|
1944
|
+
const relative2 = await symlinkPaths(srcpath, dstpath);
|
|
1945
|
+
srcpath = relative2.toDst;
|
|
1946
|
+
const toType = await symlinkType(relative2.toCwd, type);
|
|
1947
|
+
const dir = path5.dirname(dstpath);
|
|
1948
|
+
if (!await pathExists2(dir)) {
|
|
1949
|
+
await mkdirs(dir);
|
|
1950
|
+
}
|
|
1951
|
+
return fs5.symlink(srcpath, dstpath, toType);
|
|
1952
|
+
}
|
|
1953
|
+
function createSymlinkSync(srcpath, dstpath, type) {
|
|
1954
|
+
let stats;
|
|
1955
|
+
try {
|
|
1956
|
+
stats = fs5.lstatSync(dstpath);
|
|
1957
|
+
} catch {
|
|
1958
|
+
}
|
|
1959
|
+
if (stats && stats.isSymbolicLink()) {
|
|
1960
|
+
const srcStat = fs5.statSync(srcpath);
|
|
1961
|
+
const dstStat = fs5.statSync(dstpath);
|
|
1962
|
+
if (areIdentical(srcStat, dstStat))
|
|
1963
|
+
return;
|
|
1964
|
+
}
|
|
1965
|
+
const relative2 = symlinkPathsSync(srcpath, dstpath);
|
|
1966
|
+
srcpath = relative2.toDst;
|
|
1967
|
+
type = symlinkTypeSync(relative2.toCwd, type);
|
|
1968
|
+
const dir = path5.dirname(dstpath);
|
|
1969
|
+
const exists = fs5.existsSync(dir);
|
|
1970
|
+
if (exists)
|
|
1971
|
+
return fs5.symlinkSync(srcpath, dstpath, type);
|
|
1972
|
+
mkdirsSync(dir);
|
|
1973
|
+
return fs5.symlinkSync(srcpath, dstpath, type);
|
|
1974
|
+
}
|
|
1975
|
+
module.exports = {
|
|
1976
|
+
createSymlink: u(createSymlink),
|
|
1977
|
+
createSymlinkSync
|
|
1978
|
+
};
|
|
1979
|
+
}
|
|
1980
|
+
});
|
|
1981
|
+
|
|
1982
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js
|
|
1983
|
+
var require_ensure = __commonJS({
|
|
1984
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js"(exports, module) {
|
|
1985
|
+
init_cjs_shims();
|
|
1986
|
+
var { createFile, createFileSync } = require_file();
|
|
1987
|
+
var { createLink, createLinkSync } = require_link();
|
|
1988
|
+
var { createSymlink, createSymlinkSync } = require_symlink();
|
|
1989
|
+
module.exports = {
|
|
1990
|
+
// file
|
|
1991
|
+
createFile,
|
|
1992
|
+
createFileSync,
|
|
1993
|
+
ensureFile: createFile,
|
|
1994
|
+
ensureFileSync: createFileSync,
|
|
1995
|
+
// link
|
|
1996
|
+
createLink,
|
|
1997
|
+
createLinkSync,
|
|
1998
|
+
ensureLink: createLink,
|
|
1999
|
+
ensureLinkSync: createLinkSync,
|
|
2000
|
+
// symlink
|
|
2001
|
+
createSymlink,
|
|
2002
|
+
createSymlinkSync,
|
|
2003
|
+
ensureSymlink: createSymlink,
|
|
2004
|
+
ensureSymlinkSync: createSymlinkSync
|
|
2005
|
+
};
|
|
2006
|
+
}
|
|
2007
|
+
});
|
|
2008
|
+
|
|
2009
|
+
// ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js
|
|
2010
|
+
var require_utils2 = __commonJS({
|
|
2011
|
+
"../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports, module) {
|
|
2012
|
+
init_cjs_shims();
|
|
2013
|
+
function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
|
|
2014
|
+
const EOF = finalEOL ? EOL : "";
|
|
2015
|
+
const str = JSON.stringify(obj, replacer, spaces);
|
|
2016
|
+
return str.replace(/\n/g, EOL) + EOF;
|
|
2017
|
+
}
|
|
2018
|
+
function stripBom(content) {
|
|
2019
|
+
if (Buffer.isBuffer(content))
|
|
2020
|
+
content = content.toString("utf8");
|
|
2021
|
+
return content.replace(/^\uFEFF/, "");
|
|
2022
|
+
}
|
|
2023
|
+
module.exports = { stringify, stripBom };
|
|
2024
|
+
}
|
|
2025
|
+
});
|
|
2026
|
+
|
|
2027
|
+
// ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js
|
|
2028
|
+
var require_jsonfile = __commonJS({
|
|
2029
|
+
"../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js"(exports, module) {
|
|
2030
|
+
init_cjs_shims();
|
|
2031
|
+
var _fs;
|
|
2032
|
+
try {
|
|
2033
|
+
_fs = require_graceful_fs();
|
|
2034
|
+
} catch (_) {
|
|
2035
|
+
_fs = __require("fs");
|
|
2036
|
+
}
|
|
2037
|
+
var universalify = require_universalify();
|
|
2038
|
+
var { stringify, stripBom } = require_utils2();
|
|
2039
|
+
async function _readFile(file, options = {}) {
|
|
2040
|
+
if (typeof options === "string") {
|
|
2041
|
+
options = { encoding: options };
|
|
2042
|
+
}
|
|
2043
|
+
const fs5 = options.fs || _fs;
|
|
2044
|
+
const shouldThrow = "throws" in options ? options.throws : true;
|
|
2045
|
+
let data = await universalify.fromCallback(fs5.readFile)(file, options);
|
|
2046
|
+
data = stripBom(data);
|
|
2047
|
+
let obj;
|
|
2048
|
+
try {
|
|
2049
|
+
obj = JSON.parse(data, options ? options.reviver : null);
|
|
2050
|
+
} catch (err) {
|
|
2051
|
+
if (shouldThrow) {
|
|
2052
|
+
err.message = `${file}: ${err.message}`;
|
|
2053
|
+
throw err;
|
|
2054
|
+
} else {
|
|
2055
|
+
return null;
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
return obj;
|
|
2059
|
+
}
|
|
2060
|
+
var readFile = universalify.fromPromise(_readFile);
|
|
2061
|
+
function readFileSync(file, options = {}) {
|
|
2062
|
+
if (typeof options === "string") {
|
|
2063
|
+
options = { encoding: options };
|
|
2064
|
+
}
|
|
2065
|
+
const fs5 = options.fs || _fs;
|
|
2066
|
+
const shouldThrow = "throws" in options ? options.throws : true;
|
|
2067
|
+
try {
|
|
2068
|
+
let content = fs5.readFileSync(file, options);
|
|
2069
|
+
content = stripBom(content);
|
|
2070
|
+
return JSON.parse(content, options.reviver);
|
|
2071
|
+
} catch (err) {
|
|
2072
|
+
if (shouldThrow) {
|
|
2073
|
+
err.message = `${file}: ${err.message}`;
|
|
2074
|
+
throw err;
|
|
2075
|
+
} else {
|
|
2076
|
+
return null;
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
async function _writeFile(file, obj, options = {}) {
|
|
2081
|
+
const fs5 = options.fs || _fs;
|
|
2082
|
+
const str = stringify(obj, options);
|
|
2083
|
+
await universalify.fromCallback(fs5.writeFile)(file, str, options);
|
|
2084
|
+
}
|
|
2085
|
+
var writeFile = universalify.fromPromise(_writeFile);
|
|
2086
|
+
function writeFileSync(file, obj, options = {}) {
|
|
2087
|
+
const fs5 = options.fs || _fs;
|
|
2088
|
+
const str = stringify(obj, options);
|
|
2089
|
+
return fs5.writeFileSync(file, str, options);
|
|
2090
|
+
}
|
|
2091
|
+
var jsonfile = {
|
|
2092
|
+
readFile,
|
|
2093
|
+
readFileSync,
|
|
2094
|
+
writeFile,
|
|
2095
|
+
writeFileSync
|
|
2096
|
+
};
|
|
2097
|
+
module.exports = jsonfile;
|
|
2098
|
+
}
|
|
2099
|
+
});
|
|
2100
|
+
|
|
2101
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js
|
|
2102
|
+
var require_jsonfile2 = __commonJS({
|
|
2103
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module) {
|
|
2104
|
+
init_cjs_shims();
|
|
2105
|
+
var jsonFile = require_jsonfile();
|
|
2106
|
+
module.exports = {
|
|
2107
|
+
// jsonfile exports
|
|
2108
|
+
readJson: jsonFile.readFile,
|
|
2109
|
+
readJsonSync: jsonFile.readFileSync,
|
|
2110
|
+
writeJson: jsonFile.writeFile,
|
|
2111
|
+
writeJsonSync: jsonFile.writeFileSync
|
|
2112
|
+
};
|
|
2113
|
+
}
|
|
2114
|
+
});
|
|
2115
|
+
|
|
2116
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js
|
|
2117
|
+
var require_output_file = __commonJS({
|
|
2118
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js"(exports, module) {
|
|
2119
|
+
init_cjs_shims();
|
|
2120
|
+
var u = require_universalify().fromPromise;
|
|
2121
|
+
var fs5 = require_fs();
|
|
2122
|
+
var path5 = __require("path");
|
|
2123
|
+
var mkdir = require_mkdirs();
|
|
2124
|
+
var pathExists2 = require_path_exists().pathExists;
|
|
2125
|
+
async function outputFile(file, data, encoding = "utf-8") {
|
|
2126
|
+
const dir = path5.dirname(file);
|
|
2127
|
+
if (!await pathExists2(dir)) {
|
|
2128
|
+
await mkdir.mkdirs(dir);
|
|
2129
|
+
}
|
|
2130
|
+
return fs5.writeFile(file, data, encoding);
|
|
2131
|
+
}
|
|
2132
|
+
function outputFileSync(file, ...args) {
|
|
2133
|
+
const dir = path5.dirname(file);
|
|
2134
|
+
if (!fs5.existsSync(dir)) {
|
|
2135
|
+
mkdir.mkdirsSync(dir);
|
|
2136
|
+
}
|
|
2137
|
+
fs5.writeFileSync(file, ...args);
|
|
2138
|
+
}
|
|
2139
|
+
module.exports = {
|
|
2140
|
+
outputFile: u(outputFile),
|
|
2141
|
+
outputFileSync
|
|
2142
|
+
};
|
|
2143
|
+
}
|
|
2144
|
+
});
|
|
2145
|
+
|
|
2146
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js
|
|
2147
|
+
var require_output_json = __commonJS({
|
|
2148
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js"(exports, module) {
|
|
2149
|
+
init_cjs_shims();
|
|
2150
|
+
var { stringify } = require_utils2();
|
|
2151
|
+
var { outputFile } = require_output_file();
|
|
2152
|
+
async function outputJson(file, data, options = {}) {
|
|
2153
|
+
const str = stringify(data, options);
|
|
2154
|
+
await outputFile(file, str, options);
|
|
2155
|
+
}
|
|
2156
|
+
module.exports = outputJson;
|
|
2157
|
+
}
|
|
2158
|
+
});
|
|
2159
|
+
|
|
2160
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js
|
|
2161
|
+
var require_output_json_sync = __commonJS({
|
|
2162
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module) {
|
|
2163
|
+
init_cjs_shims();
|
|
2164
|
+
var { stringify } = require_utils2();
|
|
2165
|
+
var { outputFileSync } = require_output_file();
|
|
2166
|
+
function outputJsonSync(file, data, options) {
|
|
2167
|
+
const str = stringify(data, options);
|
|
2168
|
+
outputFileSync(file, str, options);
|
|
2169
|
+
}
|
|
2170
|
+
module.exports = outputJsonSync;
|
|
2171
|
+
}
|
|
2172
|
+
});
|
|
2173
|
+
|
|
2174
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js
|
|
2175
|
+
var require_json = __commonJS({
|
|
2176
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js"(exports, module) {
|
|
2177
|
+
init_cjs_shims();
|
|
2178
|
+
var u = require_universalify().fromPromise;
|
|
2179
|
+
var jsonFile = require_jsonfile2();
|
|
2180
|
+
jsonFile.outputJson = u(require_output_json());
|
|
2181
|
+
jsonFile.outputJsonSync = require_output_json_sync();
|
|
2182
|
+
jsonFile.outputJSON = jsonFile.outputJson;
|
|
2183
|
+
jsonFile.outputJSONSync = jsonFile.outputJsonSync;
|
|
2184
|
+
jsonFile.writeJSON = jsonFile.writeJson;
|
|
2185
|
+
jsonFile.writeJSONSync = jsonFile.writeJsonSync;
|
|
2186
|
+
jsonFile.readJSON = jsonFile.readJson;
|
|
2187
|
+
jsonFile.readJSONSync = jsonFile.readJsonSync;
|
|
2188
|
+
module.exports = jsonFile;
|
|
2189
|
+
}
|
|
2190
|
+
});
|
|
2191
|
+
|
|
2192
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js
|
|
2193
|
+
var require_move = __commonJS({
|
|
2194
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js"(exports, module) {
|
|
2195
|
+
init_cjs_shims();
|
|
2196
|
+
var fs5 = require_fs();
|
|
2197
|
+
var path5 = __require("path");
|
|
2198
|
+
var { copy } = require_copy2();
|
|
2199
|
+
var { remove: remove2 } = require_remove();
|
|
2200
|
+
var { mkdirp } = require_mkdirs();
|
|
2201
|
+
var { pathExists: pathExists2 } = require_path_exists();
|
|
2202
|
+
var stat = require_stat();
|
|
2203
|
+
async function move(src, dest, opts = {}) {
|
|
2204
|
+
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2205
|
+
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
|
2206
|
+
await stat.checkParentPaths(src, srcStat, dest, "move");
|
|
2207
|
+
const destParent = path5.dirname(dest);
|
|
2208
|
+
const parsedParentPath = path5.parse(destParent);
|
|
2209
|
+
if (parsedParentPath.root !== destParent) {
|
|
2210
|
+
await mkdirp(destParent);
|
|
2211
|
+
}
|
|
2212
|
+
return doRename(src, dest, overwrite, isChangingCase);
|
|
2213
|
+
}
|
|
2214
|
+
async function doRename(src, dest, overwrite, isChangingCase) {
|
|
2215
|
+
if (!isChangingCase) {
|
|
2216
|
+
if (overwrite) {
|
|
2217
|
+
await remove2(dest);
|
|
2218
|
+
} else if (await pathExists2(dest)) {
|
|
2219
|
+
throw new Error("dest already exists.");
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
try {
|
|
2223
|
+
await fs5.rename(src, dest);
|
|
2224
|
+
} catch (err) {
|
|
2225
|
+
if (err.code !== "EXDEV") {
|
|
2226
|
+
throw err;
|
|
2227
|
+
}
|
|
2228
|
+
await moveAcrossDevice(src, dest, overwrite);
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
async function moveAcrossDevice(src, dest, overwrite) {
|
|
2232
|
+
const opts = {
|
|
2233
|
+
overwrite,
|
|
2234
|
+
errorOnExist: true,
|
|
2235
|
+
preserveTimestamps: true
|
|
2236
|
+
};
|
|
2237
|
+
await copy(src, dest, opts);
|
|
2238
|
+
return remove2(src);
|
|
2239
|
+
}
|
|
2240
|
+
module.exports = move;
|
|
2241
|
+
}
|
|
2242
|
+
});
|
|
2243
|
+
|
|
2244
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js
|
|
2245
|
+
var require_move_sync = __commonJS({
|
|
2246
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js"(exports, module) {
|
|
2247
|
+
init_cjs_shims();
|
|
2248
|
+
var fs5 = require_graceful_fs();
|
|
2249
|
+
var path5 = __require("path");
|
|
2250
|
+
var copySync = require_copy2().copySync;
|
|
2251
|
+
var removeSync = require_remove().removeSync;
|
|
2252
|
+
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
2253
|
+
var stat = require_stat();
|
|
2254
|
+
function moveSync(src, dest, opts) {
|
|
2255
|
+
opts = opts || {};
|
|
2256
|
+
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2257
|
+
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
2258
|
+
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
2259
|
+
if (!isParentRoot(dest))
|
|
2260
|
+
mkdirpSync(path5.dirname(dest));
|
|
2261
|
+
return doRename(src, dest, overwrite, isChangingCase);
|
|
2262
|
+
}
|
|
2263
|
+
function isParentRoot(dest) {
|
|
2264
|
+
const parent = path5.dirname(dest);
|
|
2265
|
+
const parsedPath = path5.parse(parent);
|
|
2266
|
+
return parsedPath.root === parent;
|
|
2267
|
+
}
|
|
2268
|
+
function doRename(src, dest, overwrite, isChangingCase) {
|
|
2269
|
+
if (isChangingCase)
|
|
2270
|
+
return rename(src, dest, overwrite);
|
|
2271
|
+
if (overwrite) {
|
|
2272
|
+
removeSync(dest);
|
|
2273
|
+
return rename(src, dest, overwrite);
|
|
2274
|
+
}
|
|
2275
|
+
if (fs5.existsSync(dest))
|
|
2276
|
+
throw new Error("dest already exists.");
|
|
2277
|
+
return rename(src, dest, overwrite);
|
|
2278
|
+
}
|
|
2279
|
+
function rename(src, dest, overwrite) {
|
|
2280
|
+
try {
|
|
2281
|
+
fs5.renameSync(src, dest);
|
|
2282
|
+
} catch (err) {
|
|
2283
|
+
if (err.code !== "EXDEV")
|
|
2284
|
+
throw err;
|
|
2285
|
+
return moveAcrossDevice(src, dest, overwrite);
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
function moveAcrossDevice(src, dest, overwrite) {
|
|
2289
|
+
const opts = {
|
|
2290
|
+
overwrite,
|
|
2291
|
+
errorOnExist: true,
|
|
2292
|
+
preserveTimestamps: true
|
|
2293
|
+
};
|
|
2294
|
+
copySync(src, dest, opts);
|
|
2295
|
+
return removeSync(src);
|
|
2296
|
+
}
|
|
2297
|
+
module.exports = moveSync;
|
|
2298
|
+
}
|
|
2299
|
+
});
|
|
2300
|
+
|
|
2301
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js
|
|
2302
|
+
var require_move2 = __commonJS({
|
|
2303
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js"(exports, module) {
|
|
2304
|
+
init_cjs_shims();
|
|
2305
|
+
var u = require_universalify().fromPromise;
|
|
2306
|
+
module.exports = {
|
|
2307
|
+
move: u(require_move()),
|
|
2308
|
+
moveSync: require_move_sync()
|
|
2309
|
+
};
|
|
2310
|
+
}
|
|
2311
|
+
});
|
|
2312
|
+
|
|
2313
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js
|
|
2314
|
+
var require_lib = __commonJS({
|
|
2315
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js"(exports, module) {
|
|
2316
|
+
init_cjs_shims();
|
|
2317
|
+
module.exports = {
|
|
2318
|
+
// Export promiseified graceful-fs:
|
|
2319
|
+
...require_fs(),
|
|
2320
|
+
// Export extra methods:
|
|
2321
|
+
...require_copy2(),
|
|
2322
|
+
...require_empty(),
|
|
2323
|
+
...require_ensure(),
|
|
2324
|
+
...require_json(),
|
|
2325
|
+
...require_mkdirs(),
|
|
2326
|
+
...require_move2(),
|
|
2327
|
+
...require_output_file(),
|
|
2328
|
+
...require_path_exists(),
|
|
2329
|
+
...require_remove()
|
|
2330
|
+
};
|
|
2331
|
+
}
|
|
2332
|
+
});
|
|
2333
|
+
|
|
2334
|
+
// ../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js
|
|
2335
|
+
var require_lodash = __commonJS({
|
|
2336
|
+
"../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js"(exports, module) {
|
|
2337
|
+
init_cjs_shims();
|
|
2338
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
2339
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
2340
|
+
var COMPARE_PARTIAL_FLAG = 1;
|
|
2341
|
+
var COMPARE_UNORDERED_FLAG = 2;
|
|
2342
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
2343
|
+
var argsTag = "[object Arguments]";
|
|
2344
|
+
var arrayTag = "[object Array]";
|
|
2345
|
+
var asyncTag = "[object AsyncFunction]";
|
|
2346
|
+
var boolTag = "[object Boolean]";
|
|
2347
|
+
var dateTag = "[object Date]";
|
|
2348
|
+
var errorTag = "[object Error]";
|
|
2349
|
+
var funcTag = "[object Function]";
|
|
2350
|
+
var genTag = "[object GeneratorFunction]";
|
|
2351
|
+
var mapTag = "[object Map]";
|
|
2352
|
+
var numberTag = "[object Number]";
|
|
2353
|
+
var nullTag = "[object Null]";
|
|
2354
|
+
var objectTag = "[object Object]";
|
|
2355
|
+
var promiseTag = "[object Promise]";
|
|
2356
|
+
var proxyTag = "[object Proxy]";
|
|
2357
|
+
var regexpTag = "[object RegExp]";
|
|
2358
|
+
var setTag = "[object Set]";
|
|
2359
|
+
var stringTag = "[object String]";
|
|
2360
|
+
var symbolTag = "[object Symbol]";
|
|
2361
|
+
var undefinedTag = "[object Undefined]";
|
|
2362
|
+
var weakMapTag = "[object WeakMap]";
|
|
2363
|
+
var arrayBufferTag = "[object ArrayBuffer]";
|
|
2364
|
+
var dataViewTag = "[object DataView]";
|
|
2365
|
+
var float32Tag = "[object Float32Array]";
|
|
2366
|
+
var float64Tag = "[object Float64Array]";
|
|
2367
|
+
var int8Tag = "[object Int8Array]";
|
|
2368
|
+
var int16Tag = "[object Int16Array]";
|
|
2369
|
+
var int32Tag = "[object Int32Array]";
|
|
2370
|
+
var uint8Tag = "[object Uint8Array]";
|
|
2371
|
+
var uint8ClampedTag = "[object Uint8ClampedArray]";
|
|
2372
|
+
var uint16Tag = "[object Uint16Array]";
|
|
2373
|
+
var uint32Tag = "[object Uint32Array]";
|
|
2374
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
2375
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
2376
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
2377
|
+
var typedArrayTags = {};
|
|
2378
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
2379
|
+
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
|
2380
|
+
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
2381
|
+
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
2382
|
+
var root = freeGlobal || freeSelf || Function("return this")();
|
|
2383
|
+
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
2384
|
+
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
2385
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2386
|
+
var freeProcess = moduleExports && freeGlobal.process;
|
|
2387
|
+
var nodeUtil = function() {
|
|
2388
|
+
try {
|
|
2389
|
+
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
2390
|
+
} catch (e) {
|
|
2391
|
+
}
|
|
2392
|
+
}();
|
|
2393
|
+
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
2394
|
+
function arrayFilter(array, predicate) {
|
|
2395
|
+
var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
|
|
2396
|
+
while (++index < length) {
|
|
2397
|
+
var value = array[index];
|
|
2398
|
+
if (predicate(value, index, array)) {
|
|
2399
|
+
result[resIndex++] = value;
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
return result;
|
|
2403
|
+
}
|
|
2404
|
+
function arrayPush(array, values) {
|
|
2405
|
+
var index = -1, length = values.length, offset = array.length;
|
|
2406
|
+
while (++index < length) {
|
|
2407
|
+
array[offset + index] = values[index];
|
|
2408
|
+
}
|
|
2409
|
+
return array;
|
|
2410
|
+
}
|
|
2411
|
+
function arraySome(array, predicate) {
|
|
2412
|
+
var index = -1, length = array == null ? 0 : array.length;
|
|
2413
|
+
while (++index < length) {
|
|
2414
|
+
if (predicate(array[index], index, array)) {
|
|
2415
|
+
return true;
|
|
2416
|
+
}
|
|
2417
|
+
}
|
|
2418
|
+
return false;
|
|
2419
|
+
}
|
|
2420
|
+
function baseTimes(n, iteratee) {
|
|
2421
|
+
var index = -1, result = Array(n);
|
|
2422
|
+
while (++index < n) {
|
|
2423
|
+
result[index] = iteratee(index);
|
|
2424
|
+
}
|
|
2425
|
+
return result;
|
|
2426
|
+
}
|
|
2427
|
+
function baseUnary(func) {
|
|
2428
|
+
return function(value) {
|
|
2429
|
+
return func(value);
|
|
2430
|
+
};
|
|
2431
|
+
}
|
|
2432
|
+
function cacheHas(cache, key) {
|
|
2433
|
+
return cache.has(key);
|
|
2434
|
+
}
|
|
2435
|
+
function getValue(object, key) {
|
|
2436
|
+
return object == null ? void 0 : object[key];
|
|
2437
|
+
}
|
|
2438
|
+
function mapToArray(map) {
|
|
2439
|
+
var index = -1, result = Array(map.size);
|
|
2440
|
+
map.forEach(function(value, key) {
|
|
2441
|
+
result[++index] = [key, value];
|
|
2442
|
+
});
|
|
2443
|
+
return result;
|
|
2444
|
+
}
|
|
2445
|
+
function overArg(func, transform) {
|
|
2446
|
+
return function(arg) {
|
|
2447
|
+
return func(transform(arg));
|
|
2448
|
+
};
|
|
2449
|
+
}
|
|
2450
|
+
function setToArray(set) {
|
|
2451
|
+
var index = -1, result = Array(set.size);
|
|
2452
|
+
set.forEach(function(value) {
|
|
2453
|
+
result[++index] = value;
|
|
2454
|
+
});
|
|
2455
|
+
return result;
|
|
2456
|
+
}
|
|
2457
|
+
var arrayProto = Array.prototype;
|
|
2458
|
+
var funcProto = Function.prototype;
|
|
2459
|
+
var objectProto = Object.prototype;
|
|
2460
|
+
var coreJsData = root["__core-js_shared__"];
|
|
2461
|
+
var funcToString = funcProto.toString;
|
|
2462
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2463
|
+
var maskSrcKey = function() {
|
|
2464
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
2465
|
+
return uid ? "Symbol(src)_1." + uid : "";
|
|
2466
|
+
}();
|
|
2467
|
+
var nativeObjectToString = objectProto.toString;
|
|
2468
|
+
var reIsNative = RegExp(
|
|
2469
|
+
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
2470
|
+
);
|
|
2471
|
+
var Buffer2 = moduleExports ? root.Buffer : void 0;
|
|
2472
|
+
var Symbol2 = root.Symbol;
|
|
2473
|
+
var Uint8Array2 = root.Uint8Array;
|
|
2474
|
+
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
2475
|
+
var splice = arrayProto.splice;
|
|
2476
|
+
var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
2477
|
+
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
2478
|
+
var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
|
|
2479
|
+
var nativeKeys = overArg(Object.keys, Object);
|
|
2480
|
+
var DataView = getNative(root, "DataView");
|
|
2481
|
+
var Map2 = getNative(root, "Map");
|
|
2482
|
+
var Promise2 = getNative(root, "Promise");
|
|
2483
|
+
var Set2 = getNative(root, "Set");
|
|
2484
|
+
var WeakMap2 = getNative(root, "WeakMap");
|
|
2485
|
+
var nativeCreate = getNative(Object, "create");
|
|
2486
|
+
var dataViewCtorString = toSource(DataView);
|
|
2487
|
+
var mapCtorString = toSource(Map2);
|
|
2488
|
+
var promiseCtorString = toSource(Promise2);
|
|
2489
|
+
var setCtorString = toSource(Set2);
|
|
2490
|
+
var weakMapCtorString = toSource(WeakMap2);
|
|
2491
|
+
var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
|
|
2492
|
+
var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
2493
|
+
function Hash(entries) {
|
|
2494
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
2495
|
+
this.clear();
|
|
2496
|
+
while (++index < length) {
|
|
2497
|
+
var entry = entries[index];
|
|
2498
|
+
this.set(entry[0], entry[1]);
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
function hashClear() {
|
|
2502
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
2503
|
+
this.size = 0;
|
|
2504
|
+
}
|
|
2505
|
+
function hashDelete(key) {
|
|
2506
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
2507
|
+
this.size -= result ? 1 : 0;
|
|
2508
|
+
return result;
|
|
2509
|
+
}
|
|
2510
|
+
function hashGet(key) {
|
|
2511
|
+
var data = this.__data__;
|
|
2512
|
+
if (nativeCreate) {
|
|
2513
|
+
var result = data[key];
|
|
2514
|
+
return result === HASH_UNDEFINED ? void 0 : result;
|
|
2515
|
+
}
|
|
2516
|
+
return hasOwnProperty.call(data, key) ? data[key] : void 0;
|
|
2517
|
+
}
|
|
2518
|
+
function hashHas(key) {
|
|
2519
|
+
var data = this.__data__;
|
|
2520
|
+
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
2521
|
+
}
|
|
2522
|
+
function hashSet(key, value) {
|
|
2523
|
+
var data = this.__data__;
|
|
2524
|
+
this.size += this.has(key) ? 0 : 1;
|
|
2525
|
+
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
|
|
2526
|
+
return this;
|
|
2527
|
+
}
|
|
2528
|
+
Hash.prototype.clear = hashClear;
|
|
2529
|
+
Hash.prototype["delete"] = hashDelete;
|
|
2530
|
+
Hash.prototype.get = hashGet;
|
|
2531
|
+
Hash.prototype.has = hashHas;
|
|
2532
|
+
Hash.prototype.set = hashSet;
|
|
2533
|
+
function ListCache(entries) {
|
|
2534
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
2535
|
+
this.clear();
|
|
2536
|
+
while (++index < length) {
|
|
2537
|
+
var entry = entries[index];
|
|
2538
|
+
this.set(entry[0], entry[1]);
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
function listCacheClear() {
|
|
2542
|
+
this.__data__ = [];
|
|
2543
|
+
this.size = 0;
|
|
2544
|
+
}
|
|
2545
|
+
function listCacheDelete(key) {
|
|
2546
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2547
|
+
if (index < 0) {
|
|
2548
|
+
return false;
|
|
2549
|
+
}
|
|
2550
|
+
var lastIndex = data.length - 1;
|
|
2551
|
+
if (index == lastIndex) {
|
|
2552
|
+
data.pop();
|
|
2553
|
+
} else {
|
|
2554
|
+
splice.call(data, index, 1);
|
|
2555
|
+
}
|
|
2556
|
+
--this.size;
|
|
2557
|
+
return true;
|
|
2558
|
+
}
|
|
2559
|
+
function listCacheGet(key) {
|
|
2560
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2561
|
+
return index < 0 ? void 0 : data[index][1];
|
|
2562
|
+
}
|
|
2563
|
+
function listCacheHas(key) {
|
|
2564
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
2565
|
+
}
|
|
2566
|
+
function listCacheSet(key, value) {
|
|
2567
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2568
|
+
if (index < 0) {
|
|
2569
|
+
++this.size;
|
|
2570
|
+
data.push([key, value]);
|
|
2571
|
+
} else {
|
|
2572
|
+
data[index][1] = value;
|
|
2573
|
+
}
|
|
2574
|
+
return this;
|
|
2575
|
+
}
|
|
2576
|
+
ListCache.prototype.clear = listCacheClear;
|
|
2577
|
+
ListCache.prototype["delete"] = listCacheDelete;
|
|
2578
|
+
ListCache.prototype.get = listCacheGet;
|
|
2579
|
+
ListCache.prototype.has = listCacheHas;
|
|
2580
|
+
ListCache.prototype.set = listCacheSet;
|
|
2581
|
+
function MapCache(entries) {
|
|
2582
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
2583
|
+
this.clear();
|
|
2584
|
+
while (++index < length) {
|
|
2585
|
+
var entry = entries[index];
|
|
2586
|
+
this.set(entry[0], entry[1]);
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
function mapCacheClear() {
|
|
2590
|
+
this.size = 0;
|
|
2591
|
+
this.__data__ = {
|
|
2592
|
+
"hash": new Hash(),
|
|
2593
|
+
"map": new (Map2 || ListCache)(),
|
|
2594
|
+
"string": new Hash()
|
|
2595
|
+
};
|
|
2596
|
+
}
|
|
2597
|
+
function mapCacheDelete(key) {
|
|
2598
|
+
var result = getMapData(this, key)["delete"](key);
|
|
2599
|
+
this.size -= result ? 1 : 0;
|
|
2600
|
+
return result;
|
|
2601
|
+
}
|
|
2602
|
+
function mapCacheGet(key) {
|
|
2603
|
+
return getMapData(this, key).get(key);
|
|
2604
|
+
}
|
|
2605
|
+
function mapCacheHas(key) {
|
|
2606
|
+
return getMapData(this, key).has(key);
|
|
2607
|
+
}
|
|
2608
|
+
function mapCacheSet(key, value) {
|
|
2609
|
+
var data = getMapData(this, key), size = data.size;
|
|
2610
|
+
data.set(key, value);
|
|
2611
|
+
this.size += data.size == size ? 0 : 1;
|
|
2612
|
+
return this;
|
|
2613
|
+
}
|
|
2614
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
2615
|
+
MapCache.prototype["delete"] = mapCacheDelete;
|
|
2616
|
+
MapCache.prototype.get = mapCacheGet;
|
|
2617
|
+
MapCache.prototype.has = mapCacheHas;
|
|
2618
|
+
MapCache.prototype.set = mapCacheSet;
|
|
2619
|
+
function SetCache(values) {
|
|
2620
|
+
var index = -1, length = values == null ? 0 : values.length;
|
|
2621
|
+
this.__data__ = new MapCache();
|
|
2622
|
+
while (++index < length) {
|
|
2623
|
+
this.add(values[index]);
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
function setCacheAdd(value) {
|
|
2627
|
+
this.__data__.set(value, HASH_UNDEFINED);
|
|
2628
|
+
return this;
|
|
2629
|
+
}
|
|
2630
|
+
function setCacheHas(value) {
|
|
2631
|
+
return this.__data__.has(value);
|
|
2632
|
+
}
|
|
2633
|
+
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
|
2634
|
+
SetCache.prototype.has = setCacheHas;
|
|
2635
|
+
function Stack(entries) {
|
|
2636
|
+
var data = this.__data__ = new ListCache(entries);
|
|
2637
|
+
this.size = data.size;
|
|
2638
|
+
}
|
|
2639
|
+
function stackClear() {
|
|
2640
|
+
this.__data__ = new ListCache();
|
|
2641
|
+
this.size = 0;
|
|
2642
|
+
}
|
|
2643
|
+
function stackDelete(key) {
|
|
2644
|
+
var data = this.__data__, result = data["delete"](key);
|
|
2645
|
+
this.size = data.size;
|
|
2646
|
+
return result;
|
|
2647
|
+
}
|
|
2648
|
+
function stackGet(key) {
|
|
2649
|
+
return this.__data__.get(key);
|
|
2650
|
+
}
|
|
2651
|
+
function stackHas(key) {
|
|
2652
|
+
return this.__data__.has(key);
|
|
2653
|
+
}
|
|
2654
|
+
function stackSet(key, value) {
|
|
2655
|
+
var data = this.__data__;
|
|
2656
|
+
if (data instanceof ListCache) {
|
|
2657
|
+
var pairs = data.__data__;
|
|
2658
|
+
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
2659
|
+
pairs.push([key, value]);
|
|
2660
|
+
this.size = ++data.size;
|
|
2661
|
+
return this;
|
|
2662
|
+
}
|
|
2663
|
+
data = this.__data__ = new MapCache(pairs);
|
|
2664
|
+
}
|
|
2665
|
+
data.set(key, value);
|
|
2666
|
+
this.size = data.size;
|
|
2667
|
+
return this;
|
|
2668
|
+
}
|
|
2669
|
+
Stack.prototype.clear = stackClear;
|
|
2670
|
+
Stack.prototype["delete"] = stackDelete;
|
|
2671
|
+
Stack.prototype.get = stackGet;
|
|
2672
|
+
Stack.prototype.has = stackHas;
|
|
2673
|
+
Stack.prototype.set = stackSet;
|
|
2674
|
+
function arrayLikeKeys(value, inherited) {
|
|
2675
|
+
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
2676
|
+
for (var key in value) {
|
|
2677
|
+
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
2678
|
+
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
2679
|
+
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
2680
|
+
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
2681
|
+
isIndex(key, length)))) {
|
|
2682
|
+
result.push(key);
|
|
2683
|
+
}
|
|
2684
|
+
}
|
|
2685
|
+
return result;
|
|
2686
|
+
}
|
|
2687
|
+
function assocIndexOf(array, key) {
|
|
2688
|
+
var length = array.length;
|
|
2689
|
+
while (length--) {
|
|
2690
|
+
if (eq(array[length][0], key)) {
|
|
2691
|
+
return length;
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
return -1;
|
|
2695
|
+
}
|
|
2696
|
+
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
2697
|
+
var result = keysFunc(object);
|
|
2698
|
+
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
2699
|
+
}
|
|
2700
|
+
function baseGetTag(value) {
|
|
2701
|
+
if (value == null) {
|
|
2702
|
+
return value === void 0 ? undefinedTag : nullTag;
|
|
2703
|
+
}
|
|
2704
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
2705
|
+
}
|
|
2706
|
+
function baseIsArguments(value) {
|
|
2707
|
+
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
2708
|
+
}
|
|
2709
|
+
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
2710
|
+
if (value === other) {
|
|
2711
|
+
return true;
|
|
2712
|
+
}
|
|
2713
|
+
if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
|
|
2714
|
+
return value !== value && other !== other;
|
|
2715
|
+
}
|
|
2716
|
+
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
2717
|
+
}
|
|
2718
|
+
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
2719
|
+
var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
|
|
2720
|
+
objTag = objTag == argsTag ? objectTag : objTag;
|
|
2721
|
+
othTag = othTag == argsTag ? objectTag : othTag;
|
|
2722
|
+
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
2723
|
+
if (isSameTag && isBuffer(object)) {
|
|
2724
|
+
if (!isBuffer(other)) {
|
|
2725
|
+
return false;
|
|
2726
|
+
}
|
|
2727
|
+
objIsArr = true;
|
|
2728
|
+
objIsObj = false;
|
|
2729
|
+
}
|
|
2730
|
+
if (isSameTag && !objIsObj) {
|
|
2731
|
+
stack || (stack = new Stack());
|
|
2732
|
+
return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
2733
|
+
}
|
|
2734
|
+
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
2735
|
+
var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
|
|
2736
|
+
if (objIsWrapped || othIsWrapped) {
|
|
2737
|
+
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
2738
|
+
stack || (stack = new Stack());
|
|
2739
|
+
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
2740
|
+
}
|
|
2741
|
+
}
|
|
2742
|
+
if (!isSameTag) {
|
|
2743
|
+
return false;
|
|
2744
|
+
}
|
|
2745
|
+
stack || (stack = new Stack());
|
|
2746
|
+
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
2747
|
+
}
|
|
2748
|
+
function baseIsNative(value) {
|
|
2749
|
+
if (!isObject(value) || isMasked(value)) {
|
|
2750
|
+
return false;
|
|
2751
|
+
}
|
|
2752
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
2753
|
+
return pattern.test(toSource(value));
|
|
2754
|
+
}
|
|
2755
|
+
function baseIsTypedArray(value) {
|
|
2756
|
+
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
2757
|
+
}
|
|
2758
|
+
function baseKeys(object) {
|
|
2759
|
+
if (!isPrototype(object)) {
|
|
2760
|
+
return nativeKeys(object);
|
|
2761
|
+
}
|
|
2762
|
+
var result = [];
|
|
2763
|
+
for (var key in Object(object)) {
|
|
2764
|
+
if (hasOwnProperty.call(object, key) && key != "constructor") {
|
|
2765
|
+
result.push(key);
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
return result;
|
|
2769
|
+
}
|
|
2770
|
+
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
2771
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
|
|
2772
|
+
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
2773
|
+
return false;
|
|
2774
|
+
}
|
|
2775
|
+
var stacked = stack.get(array);
|
|
2776
|
+
if (stacked && stack.get(other)) {
|
|
2777
|
+
return stacked == other;
|
|
2778
|
+
}
|
|
2779
|
+
var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
|
|
2780
|
+
stack.set(array, other);
|
|
2781
|
+
stack.set(other, array);
|
|
2782
|
+
while (++index < arrLength) {
|
|
2783
|
+
var arrValue = array[index], othValue = other[index];
|
|
2784
|
+
if (customizer) {
|
|
2785
|
+
var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
|
|
2786
|
+
}
|
|
2787
|
+
if (compared !== void 0) {
|
|
2788
|
+
if (compared) {
|
|
2789
|
+
continue;
|
|
2790
|
+
}
|
|
2791
|
+
result = false;
|
|
2792
|
+
break;
|
|
2793
|
+
}
|
|
2794
|
+
if (seen) {
|
|
2795
|
+
if (!arraySome(other, function(othValue2, othIndex) {
|
|
2796
|
+
if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
|
|
2797
|
+
return seen.push(othIndex);
|
|
2798
|
+
}
|
|
2799
|
+
})) {
|
|
2800
|
+
result = false;
|
|
2801
|
+
break;
|
|
2802
|
+
}
|
|
2803
|
+
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
2804
|
+
result = false;
|
|
2805
|
+
break;
|
|
2806
|
+
}
|
|
2807
|
+
}
|
|
2808
|
+
stack["delete"](array);
|
|
2809
|
+
stack["delete"](other);
|
|
2810
|
+
return result;
|
|
2811
|
+
}
|
|
2812
|
+
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
2813
|
+
switch (tag) {
|
|
2814
|
+
case dataViewTag:
|
|
2815
|
+
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
|
|
2816
|
+
return false;
|
|
2817
|
+
}
|
|
2818
|
+
object = object.buffer;
|
|
2819
|
+
other = other.buffer;
|
|
2820
|
+
case arrayBufferTag:
|
|
2821
|
+
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
|
|
2822
|
+
return false;
|
|
2823
|
+
}
|
|
2824
|
+
return true;
|
|
2825
|
+
case boolTag:
|
|
2826
|
+
case dateTag:
|
|
2827
|
+
case numberTag:
|
|
2828
|
+
return eq(+object, +other);
|
|
2829
|
+
case errorTag:
|
|
2830
|
+
return object.name == other.name && object.message == other.message;
|
|
2831
|
+
case regexpTag:
|
|
2832
|
+
case stringTag:
|
|
2833
|
+
return object == other + "";
|
|
2834
|
+
case mapTag:
|
|
2835
|
+
var convert = mapToArray;
|
|
2836
|
+
case setTag:
|
|
2837
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
|
|
2838
|
+
convert || (convert = setToArray);
|
|
2839
|
+
if (object.size != other.size && !isPartial) {
|
|
2840
|
+
return false;
|
|
2841
|
+
}
|
|
2842
|
+
var stacked = stack.get(object);
|
|
2843
|
+
if (stacked) {
|
|
2844
|
+
return stacked == other;
|
|
2845
|
+
}
|
|
2846
|
+
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
2847
|
+
stack.set(object, other);
|
|
2848
|
+
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
2849
|
+
stack["delete"](object);
|
|
2850
|
+
return result;
|
|
2851
|
+
case symbolTag:
|
|
2852
|
+
if (symbolValueOf) {
|
|
2853
|
+
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
return false;
|
|
116
2857
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
2858
|
+
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
2859
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
|
|
2860
|
+
if (objLength != othLength && !isPartial) {
|
|
2861
|
+
return false;
|
|
2862
|
+
}
|
|
2863
|
+
var index = objLength;
|
|
2864
|
+
while (index--) {
|
|
2865
|
+
var key = objProps[index];
|
|
2866
|
+
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
|
|
2867
|
+
return false;
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
var stacked = stack.get(object);
|
|
2871
|
+
if (stacked && stack.get(other)) {
|
|
2872
|
+
return stacked == other;
|
|
2873
|
+
}
|
|
2874
|
+
var result = true;
|
|
2875
|
+
stack.set(object, other);
|
|
2876
|
+
stack.set(other, object);
|
|
2877
|
+
var skipCtor = isPartial;
|
|
2878
|
+
while (++index < objLength) {
|
|
2879
|
+
key = objProps[index];
|
|
2880
|
+
var objValue = object[key], othValue = other[key];
|
|
2881
|
+
if (customizer) {
|
|
2882
|
+
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
|
|
2883
|
+
}
|
|
2884
|
+
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
|
|
2885
|
+
result = false;
|
|
2886
|
+
break;
|
|
2887
|
+
}
|
|
2888
|
+
skipCtor || (skipCtor = key == "constructor");
|
|
2889
|
+
}
|
|
2890
|
+
if (result && !skipCtor) {
|
|
2891
|
+
var objCtor = object.constructor, othCtor = other.constructor;
|
|
2892
|
+
if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
|
|
2893
|
+
result = false;
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
stack["delete"](object);
|
|
2897
|
+
stack["delete"](other);
|
|
2898
|
+
return result;
|
|
121
2899
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
if (message && spinner) {
|
|
125
|
-
spinner.warn(pc3__default.default.yellow(message));
|
|
126
|
-
logs.push(message);
|
|
2900
|
+
function getAllKeys(object) {
|
|
2901
|
+
return baseGetAllKeys(object, keys, getSymbols);
|
|
127
2902
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
spinner.info(message);
|
|
132
|
-
logs.push(message);
|
|
2903
|
+
function getMapData(map, key) {
|
|
2904
|
+
var data = map.__data__;
|
|
2905
|
+
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
133
2906
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
2907
|
+
function getNative(object, key) {
|
|
2908
|
+
var value = getValue(object, key);
|
|
2909
|
+
return baseIsNative(value) ? value : void 0;
|
|
2910
|
+
}
|
|
2911
|
+
function getRawTag(value) {
|
|
2912
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
2913
|
+
try {
|
|
2914
|
+
value[symToStringTag] = void 0;
|
|
2915
|
+
var unmasked = true;
|
|
2916
|
+
} catch (e) {
|
|
2917
|
+
}
|
|
2918
|
+
var result = nativeObjectToString.call(value);
|
|
2919
|
+
if (unmasked) {
|
|
2920
|
+
if (isOwn) {
|
|
2921
|
+
value[symToStringTag] = tag;
|
|
2922
|
+
} else {
|
|
2923
|
+
delete value[symToStringTag];
|
|
2924
|
+
}
|
|
2925
|
+
}
|
|
2926
|
+
return result;
|
|
2927
|
+
}
|
|
2928
|
+
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
|
|
2929
|
+
if (object == null) {
|
|
2930
|
+
return [];
|
|
2931
|
+
}
|
|
2932
|
+
object = Object(object);
|
|
2933
|
+
return arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
2934
|
+
return propertyIsEnumerable.call(object, symbol);
|
|
2935
|
+
});
|
|
2936
|
+
};
|
|
2937
|
+
var getTag = baseGetTag;
|
|
2938
|
+
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
|
|
2939
|
+
getTag = function(value) {
|
|
2940
|
+
var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
|
2941
|
+
if (ctorString) {
|
|
2942
|
+
switch (ctorString) {
|
|
2943
|
+
case dataViewCtorString:
|
|
2944
|
+
return dataViewTag;
|
|
2945
|
+
case mapCtorString:
|
|
2946
|
+
return mapTag;
|
|
2947
|
+
case promiseCtorString:
|
|
2948
|
+
return promiseTag;
|
|
2949
|
+
case setCtorString:
|
|
2950
|
+
return setTag;
|
|
2951
|
+
case weakMapCtorString:
|
|
2952
|
+
return weakMapTag;
|
|
2953
|
+
}
|
|
2954
|
+
}
|
|
2955
|
+
return result;
|
|
2956
|
+
};
|
|
2957
|
+
}
|
|
2958
|
+
function isIndex(value, length) {
|
|
2959
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
2960
|
+
return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
2961
|
+
}
|
|
2962
|
+
function isKeyable(value) {
|
|
2963
|
+
var type = typeof value;
|
|
2964
|
+
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
2965
|
+
}
|
|
2966
|
+
function isMasked(func) {
|
|
2967
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
2968
|
+
}
|
|
2969
|
+
function isPrototype(value) {
|
|
2970
|
+
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
2971
|
+
return value === proto;
|
|
2972
|
+
}
|
|
2973
|
+
function objectToString(value) {
|
|
2974
|
+
return nativeObjectToString.call(value);
|
|
2975
|
+
}
|
|
2976
|
+
function toSource(func) {
|
|
2977
|
+
if (func != null) {
|
|
2978
|
+
try {
|
|
2979
|
+
return funcToString.call(func);
|
|
2980
|
+
} catch (e) {
|
|
2981
|
+
}
|
|
2982
|
+
try {
|
|
2983
|
+
return func + "";
|
|
2984
|
+
} catch (e) {
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
return "";
|
|
2988
|
+
}
|
|
2989
|
+
function eq(value, other) {
|
|
2990
|
+
return value === other || value !== value && other !== other;
|
|
2991
|
+
}
|
|
2992
|
+
var isArguments = baseIsArguments(/* @__PURE__ */ function() {
|
|
2993
|
+
return arguments;
|
|
2994
|
+
}()) ? baseIsArguments : function(value) {
|
|
2995
|
+
return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
2996
|
+
};
|
|
2997
|
+
var isArray = Array.isArray;
|
|
2998
|
+
function isArrayLike(value) {
|
|
2999
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
|
3000
|
+
}
|
|
3001
|
+
var isBuffer = nativeIsBuffer || stubFalse;
|
|
3002
|
+
function isEqual2(value, other) {
|
|
3003
|
+
return baseIsEqual(value, other);
|
|
3004
|
+
}
|
|
3005
|
+
function isFunction(value) {
|
|
3006
|
+
if (!isObject(value)) {
|
|
3007
|
+
return false;
|
|
3008
|
+
}
|
|
3009
|
+
var tag = baseGetTag(value);
|
|
3010
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
3011
|
+
}
|
|
3012
|
+
function isLength(value) {
|
|
3013
|
+
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
3014
|
+
}
|
|
3015
|
+
function isObject(value) {
|
|
3016
|
+
var type = typeof value;
|
|
3017
|
+
return value != null && (type == "object" || type == "function");
|
|
3018
|
+
}
|
|
3019
|
+
function isObjectLike(value) {
|
|
3020
|
+
return value != null && typeof value == "object";
|
|
3021
|
+
}
|
|
3022
|
+
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
3023
|
+
function keys(object) {
|
|
3024
|
+
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
3025
|
+
}
|
|
3026
|
+
function stubArray() {
|
|
3027
|
+
return [];
|
|
3028
|
+
}
|
|
3029
|
+
function stubFalse() {
|
|
3030
|
+
return false;
|
|
3031
|
+
}
|
|
3032
|
+
module.exports = isEqual2;
|
|
151
3033
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
3034
|
+
});
|
|
3035
|
+
|
|
3036
|
+
// src/index.ts
|
|
3037
|
+
init_cjs_shims();
|
|
3038
|
+
|
|
3039
|
+
// src/build.ts
|
|
3040
|
+
init_cjs_shims();
|
|
3041
|
+
|
|
3042
|
+
// ../../node_modules/.pnpm/tinyrainbow@1.1.1/node_modules/tinyrainbow/dist/node.js
|
|
3043
|
+
init_cjs_shims();
|
|
3044
|
+
|
|
3045
|
+
// ../../node_modules/.pnpm/tinyrainbow@1.1.1/node_modules/tinyrainbow/dist/chunk-5WCZOS7T.js
|
|
3046
|
+
init_cjs_shims();
|
|
3047
|
+
var b = {
|
|
3048
|
+
reset: [0, 0],
|
|
3049
|
+
bold: [1, 22, "\x1B[22m\x1B[1m"],
|
|
3050
|
+
dim: [2, 22, "\x1B[22m\x1B[2m"],
|
|
3051
|
+
italic: [3, 23],
|
|
3052
|
+
underline: [4, 24],
|
|
3053
|
+
inverse: [7, 27],
|
|
3054
|
+
hidden: [8, 28],
|
|
3055
|
+
strikethrough: [9, 29],
|
|
3056
|
+
black: [30, 39],
|
|
3057
|
+
red: [31, 39],
|
|
3058
|
+
green: [32, 39],
|
|
3059
|
+
yellow: [33, 39],
|
|
3060
|
+
blue: [34, 39],
|
|
3061
|
+
magenta: [35, 39],
|
|
3062
|
+
cyan: [36, 39],
|
|
3063
|
+
white: [37, 39],
|
|
3064
|
+
gray: [90, 39],
|
|
3065
|
+
bgBlack: [40, 49],
|
|
3066
|
+
bgRed: [41, 49],
|
|
3067
|
+
bgGreen: [42, 49],
|
|
3068
|
+
bgYellow: [43, 49],
|
|
3069
|
+
bgBlue: [44, 49],
|
|
3070
|
+
bgMagenta: [45, 49],
|
|
3071
|
+
bgCyan: [46, 49],
|
|
3072
|
+
bgWhite: [47, 49]
|
|
3073
|
+
};
|
|
3074
|
+
var C = Object.entries(b);
|
|
3075
|
+
function d(r2) {
|
|
3076
|
+
return String(r2);
|
|
155
3077
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
3078
|
+
d.open = "";
|
|
3079
|
+
d.close = "";
|
|
3080
|
+
function p(r2 = false) {
|
|
3081
|
+
let n = typeof process != "undefined" ? process : void 0, t = (n == null ? void 0 : n.env) || {}, a = (n == null ? void 0 : n.argv) || [];
|
|
3082
|
+
return !("NO_COLOR" in t || a.includes("--no-color")) && !("GITHUB_ACTIONS" in t) && ("FORCE_COLOR" in t || a.includes("--color") || (n == null ? void 0 : n.platform) === "win32" || r2 && t.TERM !== "dumb" || "CI" in t) || typeof window != "undefined" && !!window.chrome;
|
|
3083
|
+
}
|
|
3084
|
+
function w(r2 = false) {
|
|
3085
|
+
let n = p(r2), t = (e, o, c, i) => {
|
|
3086
|
+
let u = e.substring(0, i) + c, s = e.substring(i + o.length), l = s.indexOf(o);
|
|
3087
|
+
return ~l ? u + t(s, o, c, l) : u + s;
|
|
3088
|
+
}, a = (e, o, c = e) => {
|
|
3089
|
+
let i = (u) => {
|
|
3090
|
+
let s = String(u), l = s.indexOf(o, e.length);
|
|
3091
|
+
return ~l ? e + t(s, o, c, l) + o : e + s + o;
|
|
3092
|
+
};
|
|
3093
|
+
return i.open = e, i.close = o, i;
|
|
3094
|
+
}, g = {
|
|
3095
|
+
isColorSupported: n
|
|
3096
|
+
}, f = (e) => `\x1B[${e}m`;
|
|
3097
|
+
for (let [e, o] of C)
|
|
3098
|
+
g[e] = n ? a(
|
|
3099
|
+
f(o[0]),
|
|
3100
|
+
f(o[1]),
|
|
3101
|
+
o[2]
|
|
3102
|
+
) : d;
|
|
3103
|
+
return g;
|
|
3104
|
+
}
|
|
3105
|
+
var p2 = w(tty.isatty(1));
|
|
3106
|
+
|
|
3107
|
+
// src/fs/clean.ts
|
|
3108
|
+
init_cjs_shims();
|
|
3109
|
+
var import_fs_extra = __toESM(require_lib(), 1);
|
|
3110
|
+
async function clean(path5) {
|
|
3111
|
+
return (0, import_fs_extra.remove)(path5);
|
|
172
3112
|
}
|
|
3113
|
+
|
|
3114
|
+
// src/fs/read.ts
|
|
3115
|
+
init_cjs_shims();
|
|
3116
|
+
var import_fs_extra2 = __toESM(require_lib(), 1);
|
|
173
3117
|
function slash(path5, platform = "linux") {
|
|
174
3118
|
const isWindowsPath = /^\\\\\?\\/.test(path5);
|
|
175
3119
|
if (["linux", "mac"].includes(platform) && !isWindowsPath) {
|
|
@@ -191,7 +3135,7 @@ function getRelativePath(rootDir, filePath, platform = "linux") {
|
|
|
191
3135
|
var reader = jsRuntime.switcher(
|
|
192
3136
|
{
|
|
193
3137
|
node: async (path5) => {
|
|
194
|
-
return
|
|
3138
|
+
return import_fs_extra2.default.readFile(path5, { encoding: "utf8" });
|
|
195
3139
|
},
|
|
196
3140
|
bun: async (path5) => {
|
|
197
3141
|
const file = Bun.file(path5);
|
|
@@ -203,7 +3147,7 @@ var reader = jsRuntime.switcher(
|
|
|
203
3147
|
jsRuntime.switcher(
|
|
204
3148
|
{
|
|
205
3149
|
node: (path5) => {
|
|
206
|
-
return
|
|
3150
|
+
return import_fs_extra2.default.readFileSync(path5, { encoding: "utf8" });
|
|
207
3151
|
},
|
|
208
3152
|
bun: () => {
|
|
209
3153
|
throw new Error("Bun cannot read sync");
|
|
@@ -214,19 +3158,105 @@ jsRuntime.switcher(
|
|
|
214
3158
|
async function read(path5) {
|
|
215
3159
|
return reader(path5);
|
|
216
3160
|
}
|
|
217
|
-
|
|
218
|
-
|
|
3161
|
+
|
|
3162
|
+
// src/utils/URLPath.ts
|
|
3163
|
+
init_cjs_shims();
|
|
3164
|
+
|
|
3165
|
+
// src/transformers/index.ts
|
|
3166
|
+
init_cjs_shims();
|
|
3167
|
+
|
|
3168
|
+
// src/transformers/casing.ts
|
|
3169
|
+
init_cjs_shims();
|
|
3170
|
+
|
|
3171
|
+
// ../../node_modules/.pnpm/change-case@5.2.0/node_modules/change-case/dist/index.js
|
|
3172
|
+
init_cjs_shims();
|
|
3173
|
+
var SPLIT_LOWER_UPPER_RE = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
3174
|
+
var SPLIT_UPPER_UPPER_RE = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
3175
|
+
var SPLIT_NUMBER_LOWER_RE = /(\d)(\p{Ll})/gu;
|
|
3176
|
+
var SPLIT_LETTER_NUMBER_RE = /(\p{L})(\d)/gu;
|
|
3177
|
+
var DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
|
|
3178
|
+
var SPLIT_REPLACE_VALUE = "$1\0$2";
|
|
3179
|
+
var DEFAULT_PREFIX_CHARACTERS = "";
|
|
3180
|
+
function split(input, options) {
|
|
3181
|
+
let result = input.trim();
|
|
3182
|
+
result = result.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
|
|
3183
|
+
if (options?.separateNumbers) {
|
|
3184
|
+
result = result.replace(SPLIT_NUMBER_LOWER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_LETTER_NUMBER_RE, SPLIT_REPLACE_VALUE);
|
|
3185
|
+
}
|
|
3186
|
+
result = result.replace(DEFAULT_STRIP_REGEXP, "\0");
|
|
3187
|
+
let start = 0;
|
|
3188
|
+
let end = result.length;
|
|
3189
|
+
while (result.charAt(start) === "\0")
|
|
3190
|
+
start++;
|
|
3191
|
+
if (start === end)
|
|
3192
|
+
return [];
|
|
3193
|
+
while (result.charAt(end - 1) === "\0")
|
|
3194
|
+
end--;
|
|
3195
|
+
return result.slice(start, end).split(/\0/g);
|
|
3196
|
+
}
|
|
3197
|
+
function camelCase(input, options) {
|
|
3198
|
+
const prefix = getPrefix(input, options?.prefixCharacters);
|
|
3199
|
+
const lower = lowerFactory(options?.locale);
|
|
3200
|
+
const upper = upperFactory(options?.locale);
|
|
3201
|
+
const transform = options?.mergeAmbiguousCharacters ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
|
|
3202
|
+
return prefix + split(input, options).map((word, index) => {
|
|
3203
|
+
if (index === 0)
|
|
3204
|
+
return lower(word);
|
|
3205
|
+
return transform(word, index);
|
|
3206
|
+
}).join(options?.delimiter ?? "");
|
|
3207
|
+
}
|
|
3208
|
+
function pascalCase(input, options) {
|
|
3209
|
+
const prefix = getPrefix(input, options?.prefixCharacters);
|
|
3210
|
+
const lower = lowerFactory(options?.locale);
|
|
3211
|
+
const upper = upperFactory(options?.locale);
|
|
3212
|
+
const transform = options?.mergeAmbiguousCharacters ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
|
|
3213
|
+
return prefix + split(input, options).map(transform).join(options?.delimiter ?? "");
|
|
3214
|
+
}
|
|
3215
|
+
function lowerFactory(locale) {
|
|
3216
|
+
return locale === false ? (input) => input.toLowerCase() : (input) => input.toLocaleLowerCase(locale);
|
|
3217
|
+
}
|
|
3218
|
+
function upperFactory(locale) {
|
|
3219
|
+
return locale === false ? (input) => input.toUpperCase() : (input) => input.toLocaleUpperCase(locale);
|
|
3220
|
+
}
|
|
3221
|
+
function capitalCaseTransformFactory(lower, upper) {
|
|
3222
|
+
return (word) => `${upper(word[0])}${lower(word.slice(1))}`;
|
|
3223
|
+
}
|
|
3224
|
+
function pascalCaseTransformFactory(lower, upper) {
|
|
3225
|
+
return (word, index) => {
|
|
3226
|
+
const char0 = word[0];
|
|
3227
|
+
const initial = index > 0 && char0 >= "0" && char0 <= "9" ? "_" + char0 : upper(char0);
|
|
3228
|
+
return initial + lower(word.slice(1));
|
|
3229
|
+
};
|
|
3230
|
+
}
|
|
3231
|
+
function getPrefix(input, prefixCharacters = DEFAULT_PREFIX_CHARACTERS) {
|
|
3232
|
+
let prefix = "";
|
|
3233
|
+
for (let i = 0; i < input.length; i++) {
|
|
3234
|
+
const char = input.charAt(i);
|
|
3235
|
+
if (prefixCharacters.includes(char)) {
|
|
3236
|
+
prefix += char;
|
|
3237
|
+
} else {
|
|
3238
|
+
break;
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3241
|
+
return prefix;
|
|
3242
|
+
}
|
|
3243
|
+
|
|
3244
|
+
// src/transformers/casing.ts
|
|
3245
|
+
function camelCase2(text) {
|
|
3246
|
+
return camelCase(text, { delimiter: "", mergeAmbiguousCharacters: true });
|
|
219
3247
|
}
|
|
220
|
-
function
|
|
221
|
-
return
|
|
3248
|
+
function pascalCase2(text) {
|
|
3249
|
+
return pascalCase(text, { delimiter: "", mergeAmbiguousCharacters: true });
|
|
222
3250
|
}
|
|
223
3251
|
|
|
224
3252
|
// src/transformers/combineCodes.ts
|
|
3253
|
+
init_cjs_shims();
|
|
225
3254
|
function combineCodes(codes) {
|
|
226
3255
|
return codes.join("\n");
|
|
227
3256
|
}
|
|
228
3257
|
|
|
229
3258
|
// src/transformers/createJSDocBlockText.ts
|
|
3259
|
+
init_cjs_shims();
|
|
230
3260
|
function createJSDocBlockText({ comments }) {
|
|
231
3261
|
const filteredComments = comments.filter(Boolean);
|
|
232
3262
|
if (!filteredComments.length) {
|
|
@@ -238,6 +3268,7 @@ function createJSDocBlockText({ comments }) {
|
|
|
238
3268
|
}
|
|
239
3269
|
|
|
240
3270
|
// src/transformers/escape.ts
|
|
3271
|
+
init_cjs_shims();
|
|
241
3272
|
function escape(text) {
|
|
242
3273
|
return text ? text.replaceAll("`", "\\`") : "";
|
|
243
3274
|
}
|
|
@@ -263,22 +3294,25 @@ function jsStringEscape(input) {
|
|
|
263
3294
|
}
|
|
264
3295
|
|
|
265
3296
|
// src/transformers/indent.ts
|
|
3297
|
+
init_cjs_shims();
|
|
266
3298
|
function createIndent(size) {
|
|
267
3299
|
return Array.from({ length: size + 1 }).join(" ");
|
|
268
3300
|
}
|
|
269
3301
|
|
|
270
3302
|
// src/transformers/nameSorter.ts
|
|
271
|
-
|
|
272
|
-
|
|
3303
|
+
init_cjs_shims();
|
|
3304
|
+
function nameSorter(a, b2) {
|
|
3305
|
+
if (a.name < b2.name) {
|
|
273
3306
|
return -1;
|
|
274
3307
|
}
|
|
275
|
-
if (a.name >
|
|
3308
|
+
if (a.name > b2.name) {
|
|
276
3309
|
return 1;
|
|
277
3310
|
}
|
|
278
3311
|
return 0;
|
|
279
3312
|
}
|
|
280
3313
|
|
|
281
3314
|
// src/transformers/searchAndReplace.ts
|
|
3315
|
+
init_cjs_shims();
|
|
282
3316
|
function searchAndReplace(options) {
|
|
283
3317
|
const { text, replaceBy, prefix = "", key } = options;
|
|
284
3318
|
const searchValues = options.searchValues?.(prefix, key) || [
|
|
@@ -296,6 +3330,7 @@ function searchAndReplace(options) {
|
|
|
296
3330
|
}
|
|
297
3331
|
|
|
298
3332
|
// src/transformers/transformReservedWord.ts
|
|
3333
|
+
init_cjs_shims();
|
|
299
3334
|
var reservedWords = [
|
|
300
3335
|
"abstract",
|
|
301
3336
|
"arguments",
|
|
@@ -389,6 +3424,7 @@ function transformReservedWord(word) {
|
|
|
389
3424
|
}
|
|
390
3425
|
|
|
391
3426
|
// src/transformers/trim.ts
|
|
3427
|
+
init_cjs_shims();
|
|
392
3428
|
function trim(text) {
|
|
393
3429
|
return text.replaceAll(/\n/g, "").trim();
|
|
394
3430
|
}
|
|
@@ -410,8 +3446,8 @@ var transformers_default = {
|
|
|
410
3446
|
JSDoc: {
|
|
411
3447
|
createJSDocBlockText
|
|
412
3448
|
},
|
|
413
|
-
camelCase,
|
|
414
|
-
pascalCase
|
|
3449
|
+
camelCase: camelCase2,
|
|
3450
|
+
pascalCase: pascalCase2
|
|
415
3451
|
};
|
|
416
3452
|
|
|
417
3453
|
// src/utils/URLPath.ts
|
|
@@ -512,6 +3548,7 @@ var URLPath = class {
|
|
|
512
3548
|
};
|
|
513
3549
|
|
|
514
3550
|
// src/config.ts
|
|
3551
|
+
init_cjs_shims();
|
|
515
3552
|
function defineConfig(options) {
|
|
516
3553
|
return options;
|
|
517
3554
|
}
|
|
@@ -519,32 +3556,31 @@ function isInputPath(result) {
|
|
|
519
3556
|
return !!result && "path" in result;
|
|
520
3557
|
}
|
|
521
3558
|
|
|
522
|
-
// src/
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
}
|
|
3559
|
+
// src/FileManager.ts
|
|
3560
|
+
init_cjs_shims();
|
|
3561
|
+
var import_lodash = __toESM(require_lodash(), 1);
|
|
3562
|
+
|
|
3563
|
+
// src/fs/write.ts
|
|
3564
|
+
init_cjs_shims();
|
|
3565
|
+
var import_fs_extra3 = __toESM(require_lib(), 1);
|
|
530
3566
|
async function saveCreateDirectory(path5) {
|
|
531
3567
|
const passedPath = path4.dirname(path4.resolve(path5));
|
|
532
|
-
await
|
|
3568
|
+
await import_fs_extra3.default.mkdir(passedPath, { recursive: true });
|
|
533
3569
|
}
|
|
534
3570
|
var writer = jsRuntime.switcher(
|
|
535
3571
|
{
|
|
536
3572
|
node: async (path5, data) => {
|
|
537
3573
|
try {
|
|
538
|
-
await
|
|
539
|
-
const oldContent = await
|
|
3574
|
+
await import_fs_extra3.default.stat(path4.resolve(path5));
|
|
3575
|
+
const oldContent = await import_fs_extra3.default.readFile(path4.resolve(path5), { encoding: "utf-8" });
|
|
540
3576
|
if (oldContent?.toString() === data?.toString()) {
|
|
541
3577
|
return;
|
|
542
3578
|
}
|
|
543
3579
|
} catch (_err) {
|
|
544
3580
|
}
|
|
545
3581
|
await saveCreateDirectory(path5);
|
|
546
|
-
await
|
|
547
|
-
const savedData = await
|
|
3582
|
+
await import_fs_extra3.default.writeFile(path4.resolve(path5), data, { encoding: "utf-8" });
|
|
3583
|
+
const savedData = await import_fs_extra3.default.readFile(path4.resolve(path5), { encoding: "utf-8" });
|
|
548
3584
|
if (savedData?.toString() !== data?.toString()) {
|
|
549
3585
|
throw new Error(`Sanity check failed for ${path5}
|
|
550
3586
|
|
|
@@ -587,6 +3623,22 @@ async function write(data, path5) {
|
|
|
587
3623
|
}
|
|
588
3624
|
return writer(path5, data.trim());
|
|
589
3625
|
}
|
|
3626
|
+
|
|
3627
|
+
// src/utils/timeout.ts
|
|
3628
|
+
init_cjs_shims();
|
|
3629
|
+
async function timeout(ms) {
|
|
3630
|
+
return new Promise((resolve3) => {
|
|
3631
|
+
setTimeout(() => {
|
|
3632
|
+
resolve3(true);
|
|
3633
|
+
}, ms);
|
|
3634
|
+
});
|
|
3635
|
+
}
|
|
3636
|
+
|
|
3637
|
+
// src/BarrelManager.ts
|
|
3638
|
+
init_cjs_shims();
|
|
3639
|
+
|
|
3640
|
+
// src/utils/TreeNode.ts
|
|
3641
|
+
init_cjs_shims();
|
|
590
3642
|
var TreeNode = class _TreeNode {
|
|
591
3643
|
constructor(data, parent) {
|
|
592
3644
|
this.children = [];
|
|
@@ -862,57 +3914,7 @@ var _FileManager = class _FileManager {
|
|
|
862
3914
|
}
|
|
863
3915
|
// statics
|
|
864
3916
|
static getSource(file) {
|
|
865
|
-
|
|
866
|
-
return file.source;
|
|
867
|
-
}
|
|
868
|
-
const exports = file.exports ? combineExports(file.exports) : [];
|
|
869
|
-
const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
|
|
870
|
-
const importNodes = imports.filter((item) => {
|
|
871
|
-
return item.path !== transformers_default.trimExtName(file.path);
|
|
872
|
-
}).map((item) => {
|
|
873
|
-
return factory__namespace.createImportDeclaration({
|
|
874
|
-
name: item.name,
|
|
875
|
-
path: item.root ? getRelativePath(item.root, item.path) : item.path,
|
|
876
|
-
isTypeOnly: item.isTypeOnly
|
|
877
|
-
});
|
|
878
|
-
});
|
|
879
|
-
const exportNodes = exports.map(
|
|
880
|
-
(item) => factory__namespace.createExportDeclaration({
|
|
881
|
-
name: item.name,
|
|
882
|
-
path: item.path,
|
|
883
|
-
isTypeOnly: item.isTypeOnly,
|
|
884
|
-
asAlias: item.asAlias
|
|
885
|
-
})
|
|
886
|
-
);
|
|
887
|
-
return [parser.print([...importNodes, ...exportNodes]), getEnvSource(file.source, file.env)].join("\n");
|
|
888
|
-
}
|
|
889
|
-
static combineFiles(files) {
|
|
890
|
-
return files.filter(Boolean).reduce((acc, file) => {
|
|
891
|
-
const prevIndex = acc.findIndex((item) => item.path === file.path);
|
|
892
|
-
if (prevIndex === -1) {
|
|
893
|
-
return [...acc, file];
|
|
894
|
-
}
|
|
895
|
-
const prev = acc[prevIndex];
|
|
896
|
-
if (prev && file.override) {
|
|
897
|
-
acc[prevIndex] = {
|
|
898
|
-
imports: [],
|
|
899
|
-
exports: [],
|
|
900
|
-
...file
|
|
901
|
-
};
|
|
902
|
-
return acc;
|
|
903
|
-
}
|
|
904
|
-
if (prev) {
|
|
905
|
-
acc[prevIndex] = {
|
|
906
|
-
...file,
|
|
907
|
-
source: prev.source && file.source ? `${prev.source}
|
|
908
|
-
${file.source}` : "",
|
|
909
|
-
imports: [...prev.imports || [], ...file.imports || []],
|
|
910
|
-
exports: [...prev.exports || [], ...file.exports || []],
|
|
911
|
-
env: { ...prev.env || {}, ...file.env || {} }
|
|
912
|
-
};
|
|
913
|
-
}
|
|
914
|
-
return acc;
|
|
915
|
-
}, []);
|
|
3917
|
+
return getSource(file);
|
|
916
3918
|
}
|
|
917
3919
|
static getMode(path5) {
|
|
918
3920
|
if (!path5) {
|
|
@@ -967,16 +3969,41 @@ ${file.source}` : "",
|
|
|
967
3969
|
return __privateMethod(this, _add, add_fn).call(this, file);
|
|
968
3970
|
};
|
|
969
3971
|
var FileManager = _FileManager;
|
|
3972
|
+
function getSource(file) {
|
|
3973
|
+
if (!FileManager.isExtensionAllowed(file.baseName)) {
|
|
3974
|
+
return file.source;
|
|
3975
|
+
}
|
|
3976
|
+
const exports = file.exports ? combineExports(file.exports) : [];
|
|
3977
|
+
const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
|
|
3978
|
+
const importNodes = imports.filter((item) => {
|
|
3979
|
+
return item.path !== transformers_default.trimExtName(file.path);
|
|
3980
|
+
}).map((item) => {
|
|
3981
|
+
return factory__namespace.createImportDeclaration({
|
|
3982
|
+
name: item.name,
|
|
3983
|
+
path: item.root ? getRelativePath(item.root, item.path) : item.path,
|
|
3984
|
+
isTypeOnly: item.isTypeOnly
|
|
3985
|
+
});
|
|
3986
|
+
});
|
|
3987
|
+
const exportNodes = exports.map(
|
|
3988
|
+
(item) => factory__namespace.createExportDeclaration({
|
|
3989
|
+
name: item.name,
|
|
3990
|
+
path: item.path,
|
|
3991
|
+
isTypeOnly: item.isTypeOnly,
|
|
3992
|
+
asAlias: item.asAlias
|
|
3993
|
+
})
|
|
3994
|
+
);
|
|
3995
|
+
return [parser.print([...importNodes, ...exportNodes]), getEnvSource(file.source, file.env)].join("\n");
|
|
3996
|
+
}
|
|
970
3997
|
function combineExports(exports) {
|
|
971
3998
|
const combinedExports = naturalOrderby.orderBy(exports, [(v) => !v.isTypeOnly], ["asc"]).reduce((prev, curr) => {
|
|
972
3999
|
const name = curr.name;
|
|
973
4000
|
const prevByPath = prev.findLast((imp) => imp.path === curr.path);
|
|
974
|
-
const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path &&
|
|
4001
|
+
const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly);
|
|
975
4002
|
if (prevByPathAndIsTypeOnly) {
|
|
976
4003
|
return prev;
|
|
977
4004
|
}
|
|
978
4005
|
const uniquePrev = prev.findLast(
|
|
979
|
-
(imp) => imp.path === curr.path &&
|
|
4006
|
+
(imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly && imp.asAlias === curr.asAlias
|
|
980
4007
|
);
|
|
981
4008
|
if (uniquePrev || Array.isArray(name) && !name.length || prevByPath?.asAlias && !curr.asAlias) {
|
|
982
4009
|
return prev;
|
|
@@ -1012,8 +4039,8 @@ function combineImports(imports, exports, source) {
|
|
|
1012
4039
|
name = name.filter((item) => typeof item === "string" ? hasImportInSource(item) : hasImportInSource(item.propertyName));
|
|
1013
4040
|
}
|
|
1014
4041
|
const prevByPath = prev.findLast((imp) => imp.path === curr.path && imp.isTypeOnly === curr.isTypeOnly);
|
|
1015
|
-
const uniquePrev = prev.findLast((imp) => imp.path === curr.path &&
|
|
1016
|
-
const prevByPathNameAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path &&
|
|
4042
|
+
const uniquePrev = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly);
|
|
4043
|
+
const prevByPathNameAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly);
|
|
1017
4044
|
if (prevByPathNameAndIsTypeOnly) {
|
|
1018
4045
|
return prev;
|
|
1019
4046
|
}
|
|
@@ -1062,6 +4089,83 @@ function getEnvSource(source, env) {
|
|
|
1062
4089
|
return prev;
|
|
1063
4090
|
}, source);
|
|
1064
4091
|
}
|
|
4092
|
+
|
|
4093
|
+
// src/logger.ts
|
|
4094
|
+
init_cjs_shims();
|
|
4095
|
+
var LogLevel = {
|
|
4096
|
+
silent: "silent",
|
|
4097
|
+
info: "info",
|
|
4098
|
+
debug: "debug"
|
|
4099
|
+
};
|
|
4100
|
+
function createLogger({ logLevel, name, spinner }) {
|
|
4101
|
+
const logs = [];
|
|
4102
|
+
const log = (message) => {
|
|
4103
|
+
if (message && spinner) {
|
|
4104
|
+
spinner.text = message;
|
|
4105
|
+
logs.push(message);
|
|
4106
|
+
}
|
|
4107
|
+
};
|
|
4108
|
+
const error = (message) => {
|
|
4109
|
+
if (message) {
|
|
4110
|
+
throw new Error(message || "Something went wrong");
|
|
4111
|
+
}
|
|
4112
|
+
};
|
|
4113
|
+
const warn = (message) => {
|
|
4114
|
+
if (message && spinner) {
|
|
4115
|
+
spinner.warn(p2.yellow(message));
|
|
4116
|
+
logs.push(message);
|
|
4117
|
+
}
|
|
4118
|
+
};
|
|
4119
|
+
const info = (message) => {
|
|
4120
|
+
if (message && spinner && logLevel !== LogLevel.silent) {
|
|
4121
|
+
spinner.info(message);
|
|
4122
|
+
logs.push(message);
|
|
4123
|
+
}
|
|
4124
|
+
};
|
|
4125
|
+
const logger = {
|
|
4126
|
+
name,
|
|
4127
|
+
logLevel,
|
|
4128
|
+
log,
|
|
4129
|
+
error,
|
|
4130
|
+
warn,
|
|
4131
|
+
info,
|
|
4132
|
+
spinner,
|
|
4133
|
+
logs
|
|
4134
|
+
};
|
|
4135
|
+
return logger;
|
|
4136
|
+
}
|
|
4137
|
+
var defaultColours = ["black", "blue", "darkBlue", "cyan", "gray", "green", "darkGreen", "magenta", "red", "darkRed", "yellow", "darkYellow"];
|
|
4138
|
+
function randomColour(text, colours = defaultColours) {
|
|
4139
|
+
if (!text) {
|
|
4140
|
+
return "white";
|
|
4141
|
+
}
|
|
4142
|
+
const random = seedrandom__default.default(text);
|
|
4143
|
+
const colour = colours.at(Math.floor(random() * colours.length)) || "white";
|
|
4144
|
+
return colour;
|
|
4145
|
+
}
|
|
4146
|
+
function randomCliColour(text, colors = defaultColours) {
|
|
4147
|
+
const colours = w(true);
|
|
4148
|
+
if (!text) {
|
|
4149
|
+
return colours.white(text);
|
|
4150
|
+
}
|
|
4151
|
+
const colour = randomColour(text, colors);
|
|
4152
|
+
const isDark = colour.includes("dark");
|
|
4153
|
+
const key = colour.replace("dark", "").toLowerCase();
|
|
4154
|
+
const formatter = colours[key];
|
|
4155
|
+
if (isDark) {
|
|
4156
|
+
return p2.bold(formatter(text));
|
|
4157
|
+
}
|
|
4158
|
+
if (typeof formatter !== "function") {
|
|
4159
|
+
throw new Error("Formatter for picoColor is not of type function/Formatter");
|
|
4160
|
+
}
|
|
4161
|
+
return formatter(text);
|
|
4162
|
+
}
|
|
4163
|
+
|
|
4164
|
+
// src/PluginManager.ts
|
|
4165
|
+
init_cjs_shims();
|
|
4166
|
+
|
|
4167
|
+
// src/utils/EventEmitter.ts
|
|
4168
|
+
init_cjs_shims();
|
|
1065
4169
|
var _emitter;
|
|
1066
4170
|
var EventEmitter = class {
|
|
1067
4171
|
constructor() {
|
|
@@ -1082,6 +4186,9 @@ var EventEmitter = class {
|
|
|
1082
4186
|
}
|
|
1083
4187
|
};
|
|
1084
4188
|
_emitter = new WeakMap();
|
|
4189
|
+
|
|
4190
|
+
// src/utils/Queue.ts
|
|
4191
|
+
init_cjs_shims();
|
|
1085
4192
|
var _queue2, _workerCount, _maxParallel, _debug, _work, work_fn;
|
|
1086
4193
|
var Queue = class {
|
|
1087
4194
|
constructor(maxParallel, debug = false) {
|
|
@@ -1154,6 +4261,7 @@ work_fn = function() {
|
|
|
1154
4261
|
};
|
|
1155
4262
|
|
|
1156
4263
|
// src/utils/uniqueName.ts
|
|
4264
|
+
init_cjs_shims();
|
|
1157
4265
|
function setUniqueName(originalName, data) {
|
|
1158
4266
|
let used = data[originalName] || 0;
|
|
1159
4267
|
if (used) {
|
|
@@ -1165,6 +4273,7 @@ function setUniqueName(originalName, data) {
|
|
|
1165
4273
|
}
|
|
1166
4274
|
|
|
1167
4275
|
// src/errors.ts
|
|
4276
|
+
init_cjs_shims();
|
|
1168
4277
|
var Warning = class extends Error {
|
|
1169
4278
|
constructor(message, options) {
|
|
1170
4279
|
super(message, { cause: options?.cause });
|
|
@@ -1174,7 +4283,11 @@ var Warning = class extends Error {
|
|
|
1174
4283
|
var ValidationPluginError = class extends Error {
|
|
1175
4284
|
};
|
|
1176
4285
|
|
|
4286
|
+
// src/plugin.ts
|
|
4287
|
+
init_cjs_shims();
|
|
4288
|
+
|
|
1177
4289
|
// src/utils/cache.ts
|
|
4290
|
+
init_cjs_shims();
|
|
1178
4291
|
function createPluginCache(Store = /* @__PURE__ */ Object.create(null)) {
|
|
1179
4292
|
return {
|
|
1180
4293
|
set(id, value) {
|
|
@@ -1251,7 +4364,11 @@ var definePlugin = createPlugin((options) => {
|
|
|
1251
4364
|
};
|
|
1252
4365
|
});
|
|
1253
4366
|
|
|
4367
|
+
// src/PromiseManager.ts
|
|
4368
|
+
init_cjs_shims();
|
|
4369
|
+
|
|
1254
4370
|
// src/utils/executeStrategies.ts
|
|
4371
|
+
init_cjs_shims();
|
|
1255
4372
|
function hookSeq(promises) {
|
|
1256
4373
|
return promises.filter(Boolean).reduce(
|
|
1257
4374
|
(promise, func) => {
|
|
@@ -1338,7 +4455,7 @@ var PluginManager = class {
|
|
|
1338
4455
|
__privateAdd(this, _executeSync);
|
|
1339
4456
|
__privateAdd(this, _catcher);
|
|
1340
4457
|
__privateAdd(this, _parse);
|
|
1341
|
-
this.
|
|
4458
|
+
this.events = new EventEmitter();
|
|
1342
4459
|
this.executed = [];
|
|
1343
4460
|
__privateAdd(this, _core, void 0);
|
|
1344
4461
|
__privateAdd(this, _usedPluginNames, {});
|
|
@@ -1413,11 +4530,14 @@ Falling back on the first item.
|
|
|
1413
4530
|
});
|
|
1414
4531
|
return this;
|
|
1415
4532
|
}
|
|
4533
|
+
/**
|
|
4534
|
+
* Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
|
|
4535
|
+
*/
|
|
1416
4536
|
on(eventName, handler) {
|
|
1417
|
-
this.
|
|
4537
|
+
this.events.on(eventName, handler);
|
|
1418
4538
|
}
|
|
1419
4539
|
/**
|
|
1420
|
-
* Run
|
|
4540
|
+
* Run a specific hookName for plugin x.
|
|
1421
4541
|
*/
|
|
1422
4542
|
hookForPlugin({
|
|
1423
4543
|
pluginKey,
|
|
@@ -1435,6 +4555,9 @@ Falling back on the first item.
|
|
|
1435
4555
|
}).filter(Boolean);
|
|
1436
4556
|
return Promise.all(promises);
|
|
1437
4557
|
}
|
|
4558
|
+
/**
|
|
4559
|
+
* Run a specific hookName for plugin x.
|
|
4560
|
+
*/
|
|
1438
4561
|
hookForPluginSync({
|
|
1439
4562
|
pluginKey,
|
|
1440
4563
|
hookName,
|
|
@@ -1451,7 +4574,7 @@ Falling back on the first item.
|
|
|
1451
4574
|
}).filter(Boolean);
|
|
1452
4575
|
}
|
|
1453
4576
|
/**
|
|
1454
|
-
*
|
|
4577
|
+
* First non-null result stops and will return it's value.
|
|
1455
4578
|
*/
|
|
1456
4579
|
async hookFirst({
|
|
1457
4580
|
hookName,
|
|
@@ -1479,7 +4602,7 @@ Falling back on the first item.
|
|
|
1479
4602
|
return __privateGet(this, _promiseManager).run("first", promises);
|
|
1480
4603
|
}
|
|
1481
4604
|
/**
|
|
1482
|
-
*
|
|
4605
|
+
* First non-null result stops and will return it's value.
|
|
1483
4606
|
*/
|
|
1484
4607
|
hookFirstSync({
|
|
1485
4608
|
hookName,
|
|
@@ -1507,7 +4630,7 @@ Falling back on the first item.
|
|
|
1507
4630
|
return parseResult;
|
|
1508
4631
|
}
|
|
1509
4632
|
/**
|
|
1510
|
-
*
|
|
4633
|
+
* Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).
|
|
1511
4634
|
*/
|
|
1512
4635
|
async hookParallel({
|
|
1513
4636
|
hookName,
|
|
@@ -1526,7 +4649,7 @@ Falling back on the first item.
|
|
|
1526
4649
|
return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
1527
4650
|
}
|
|
1528
4651
|
/**
|
|
1529
|
-
*
|
|
4652
|
+
* Chain all plugins, `reduce` can be passed through to handle every returned value. The return value of the first plugin will be used as the first parameter for the plugin after that.
|
|
1530
4653
|
*/
|
|
1531
4654
|
hookReduceArg0({
|
|
1532
4655
|
hookName,
|
|
@@ -1630,11 +4753,11 @@ getSortedPlugins_fn = function(hookName) {
|
|
|
1630
4753
|
}
|
|
1631
4754
|
}
|
|
1632
4755
|
return plugin;
|
|
1633
|
-
}).sort((a,
|
|
1634
|
-
if (
|
|
4756
|
+
}).sort((a, b2) => {
|
|
4757
|
+
if (b2.pre?.includes(a.name)) {
|
|
1635
4758
|
return 1;
|
|
1636
4759
|
}
|
|
1637
|
-
if (
|
|
4760
|
+
if (b2.post?.includes(a.name)) {
|
|
1638
4761
|
return -1;
|
|
1639
4762
|
}
|
|
1640
4763
|
return 0;
|
|
@@ -1643,7 +4766,7 @@ getSortedPlugins_fn = function(hookName) {
|
|
|
1643
4766
|
_addExecutedToCallStack = new WeakSet();
|
|
1644
4767
|
addExecutedToCallStack_fn = function(executer) {
|
|
1645
4768
|
if (executer) {
|
|
1646
|
-
this.
|
|
4769
|
+
this.events.emit("executed", executer);
|
|
1647
4770
|
this.executed.push(executer);
|
|
1648
4771
|
}
|
|
1649
4772
|
};
|
|
@@ -1659,7 +4782,7 @@ execute_fn = function({
|
|
|
1659
4782
|
if (!hook) {
|
|
1660
4783
|
return null;
|
|
1661
4784
|
}
|
|
1662
|
-
this.
|
|
4785
|
+
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
1663
4786
|
const task = Promise.resolve().then(() => {
|
|
1664
4787
|
if (typeof hook === "function") {
|
|
1665
4788
|
const possiblePromiseResult = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
|
|
@@ -1697,7 +4820,7 @@ executeSync_fn = function({
|
|
|
1697
4820
|
if (!hook) {
|
|
1698
4821
|
return null;
|
|
1699
4822
|
}
|
|
1700
|
-
this.
|
|
4823
|
+
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
1701
4824
|
try {
|
|
1702
4825
|
if (typeof hook === "function") {
|
|
1703
4826
|
const fn = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
|
|
@@ -1723,7 +4846,7 @@ catcher_fn = function(e, plugin, hookName) {
|
|
|
1723
4846
|
const text = `${e.message} (plugin: ${plugin?.name || "unknown"}, hook: ${hookName || "unknown"})
|
|
1724
4847
|
`;
|
|
1725
4848
|
this.logger.error(text);
|
|
1726
|
-
this.
|
|
4849
|
+
this.events.emit("error", e);
|
|
1727
4850
|
};
|
|
1728
4851
|
_parse = new WeakSet();
|
|
1729
4852
|
parse_fn = function(plugin, pluginManager, context) {
|
|
@@ -1765,7 +4888,7 @@ async function setup(options) {
|
|
|
1765
4888
|
} catch (e) {
|
|
1766
4889
|
if (isInputPath(config)) {
|
|
1767
4890
|
throw new Error(
|
|
1768
|
-
"Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " +
|
|
4891
|
+
"Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + p2.dim(config.input.path),
|
|
1769
4892
|
{
|
|
1770
4893
|
cause: e
|
|
1771
4894
|
}
|
|
@@ -1818,7 +4941,7 @@ async function setup(options) {
|
|
|
1818
4941
|
logger.spinner.start(`\u{1F4BE} Writing`);
|
|
1819
4942
|
}
|
|
1820
4943
|
if (logger.logLevel === LogLevel.debug) {
|
|
1821
|
-
logger.info(`PluginKey ${
|
|
4944
|
+
logger.info(`PluginKey ${p2.dim(JSON.stringify(plugin.key))}
|
|
1822
4945
|
with source
|
|
1823
4946
|
|
|
1824
4947
|
${code}`);
|
|
@@ -1827,11 +4950,11 @@ ${code}`);
|
|
|
1827
4950
|
});
|
|
1828
4951
|
pluginManager.on("executed", (executer) => {
|
|
1829
4952
|
const { hookName, plugin, output, parameters } = executer;
|
|
1830
|
-
const messsage = `${
|
|
4953
|
+
const messsage = `${randomCliColour(plugin.name)} Executing ${hookName}`;
|
|
1831
4954
|
if (logger.logLevel === LogLevel.info && logger.spinner) {
|
|
1832
4955
|
if (hookName === "writeFile") {
|
|
1833
4956
|
const [_code, path5] = parameters;
|
|
1834
|
-
logger.spinner.suffixText =
|
|
4957
|
+
logger.spinner.suffixText = p2.dim(path5);
|
|
1835
4958
|
} else {
|
|
1836
4959
|
logger.spinner.suffixText = messsage;
|
|
1837
4960
|
}
|
|
@@ -1839,9 +4962,9 @@ ${code}`);
|
|
|
1839
4962
|
if (logger.logLevel === LogLevel.debug) {
|
|
1840
4963
|
logger.info(messsage);
|
|
1841
4964
|
const logs = [
|
|
1842
|
-
parameters && `${
|
|
4965
|
+
parameters && `${p2.bgWhite(`Parameters`)} ${randomCliColour(plugin.name)} ${hookName}`,
|
|
1843
4966
|
JSON.stringify(parameters, void 0, 2),
|
|
1844
|
-
output && `${
|
|
4967
|
+
output && `${p2.bgWhite("Output")} ${randomCliColour(plugin.name)} ${hookName}`,
|
|
1845
4968
|
output
|
|
1846
4969
|
].filter(Boolean);
|
|
1847
4970
|
console.log(logs.join("\n"));
|
|
@@ -1883,6 +5006,7 @@ async function safeBuild(options) {
|
|
|
1883
5006
|
}
|
|
1884
5007
|
|
|
1885
5008
|
// src/Generator.ts
|
|
5009
|
+
init_cjs_shims();
|
|
1886
5010
|
var _options3, _context;
|
|
1887
5011
|
var Generator = class {
|
|
1888
5012
|
constructor(options, context) {
|
|
@@ -1909,7 +5033,23 @@ var Generator = class {
|
|
|
1909
5033
|
_options3 = new WeakMap();
|
|
1910
5034
|
_context = new WeakMap();
|
|
1911
5035
|
|
|
5036
|
+
// src/PackageManager.ts
|
|
5037
|
+
init_cjs_shims();
|
|
5038
|
+
|
|
5039
|
+
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
5040
|
+
init_cjs_shims();
|
|
5041
|
+
|
|
5042
|
+
// ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
5043
|
+
init_cjs_shims();
|
|
5044
|
+
|
|
5045
|
+
// ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
|
|
5046
|
+
init_cjs_shims();
|
|
5047
|
+
|
|
5048
|
+
// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
|
|
5049
|
+
init_cjs_shims();
|
|
5050
|
+
|
|
1912
5051
|
// ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
|
|
5052
|
+
init_cjs_shims();
|
|
1913
5053
|
var Node = class {
|
|
1914
5054
|
constructor(value) {
|
|
1915
5055
|
__publicField(this, "value");
|
|
@@ -2062,7 +5202,7 @@ function checkType(type) {
|
|
|
2062
5202
|
var matchType = (type, stat) => stat[typeMappings[type]]();
|
|
2063
5203
|
var toPath = (urlOrPath) => urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
2064
5204
|
async function locatePath(paths, {
|
|
2065
|
-
cwd =
|
|
5205
|
+
cwd = process2__default.default.cwd(),
|
|
2066
5206
|
type = "file",
|
|
2067
5207
|
allowSymlinks = true,
|
|
2068
5208
|
concurrency,
|
|
@@ -2081,7 +5221,7 @@ async function locatePath(paths, {
|
|
|
2081
5221
|
}, { concurrency, preserveOrder });
|
|
2082
5222
|
}
|
|
2083
5223
|
function locatePathSync(paths, {
|
|
2084
|
-
cwd =
|
|
5224
|
+
cwd = process2__default.default.cwd(),
|
|
2085
5225
|
type = "file",
|
|
2086
5226
|
allowSymlinks = true
|
|
2087
5227
|
} = {}) {
|
|
@@ -2104,14 +5244,22 @@ function locatePathSync(paths, {
|
|
|
2104
5244
|
}
|
|
2105
5245
|
}
|
|
2106
5246
|
|
|
2107
|
-
// ../../node_modules/.pnpm/
|
|
2108
|
-
|
|
5247
|
+
// ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
|
|
5248
|
+
init_cjs_shims();
|
|
5249
|
+
function toPath2(urlOrPath) {
|
|
5250
|
+
return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
5251
|
+
}
|
|
5252
|
+
|
|
5253
|
+
// ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
|
|
5254
|
+
init_cjs_shims();
|
|
5255
|
+
|
|
5256
|
+
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
2109
5257
|
var findUpStop = Symbol("findUpStop");
|
|
2110
5258
|
async function findUpMultiple(name, options = {}) {
|
|
2111
|
-
let directory = path4__default.default.resolve(toPath2(options.cwd)
|
|
5259
|
+
let directory = path4__default.default.resolve(toPath2(options.cwd) ?? "");
|
|
2112
5260
|
const { root } = path4__default.default.parse(directory);
|
|
2113
|
-
const stopAt = path4__default.default.resolve(directory, options.stopAt
|
|
2114
|
-
const limit = options.limit
|
|
5261
|
+
const stopAt = path4__default.default.resolve(directory, toPath2(options.stopAt ?? root));
|
|
5262
|
+
const limit = options.limit ?? Number.POSITIVE_INFINITY;
|
|
2115
5263
|
const paths = [name].flat();
|
|
2116
5264
|
const runMatcher = async (locateOptions) => {
|
|
2117
5265
|
if (typeof name !== "function") {
|
|
@@ -2140,10 +5288,10 @@ async function findUpMultiple(name, options = {}) {
|
|
|
2140
5288
|
return matches;
|
|
2141
5289
|
}
|
|
2142
5290
|
function findUpMultipleSync(name, options = {}) {
|
|
2143
|
-
let directory = path4__default.default.resolve(toPath2(options.cwd)
|
|
5291
|
+
let directory = path4__default.default.resolve(toPath2(options.cwd) ?? "");
|
|
2144
5292
|
const { root } = path4__default.default.parse(directory);
|
|
2145
|
-
const stopAt = options.stopAt
|
|
2146
|
-
const limit = options.limit
|
|
5293
|
+
const stopAt = path4__default.default.resolve(directory, toPath2(options.stopAt) ?? root);
|
|
5294
|
+
const limit = options.limit ?? Number.POSITIVE_INFINITY;
|
|
2147
5295
|
const paths = [name].flat();
|
|
2148
5296
|
const runMatcher = (locateOptions) => {
|
|
2149
5297
|
if (typeof name !== "function") {
|
|
@@ -2316,11 +5464,8 @@ exports.Generator = Generator;
|
|
|
2316
5464
|
exports.PackageManager = PackageManager;
|
|
2317
5465
|
exports.PluginManager = PluginManager;
|
|
2318
5466
|
exports.PromiseManager = PromiseManager;
|
|
2319
|
-
exports.ValidationPluginError = ValidationPluginError;
|
|
2320
5467
|
exports.Warning = Warning;
|
|
2321
5468
|
exports.build = build;
|
|
2322
|
-
exports.combineExports = combineExports;
|
|
2323
|
-
exports.combineImports = combineImports;
|
|
2324
5469
|
exports.createPlugin = createPlugin;
|
|
2325
5470
|
exports.default = src_default;
|
|
2326
5471
|
exports.defineConfig = defineConfig;
|