@kubb/core 2.0.0-beta.12 → 2.0.0-beta.14
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/chunk-35FDNG5F.cjs +71 -0
- package/dist/chunk-35FDNG5F.cjs.map +1 -0
- package/dist/chunk-7CNPSL5M.js +85 -0
- package/dist/chunk-7CNPSL5M.js.map +1 -0
- package/dist/chunk-DKYWBKNH.js +18 -0
- package/dist/chunk-DKYWBKNH.js.map +1 -0
- package/dist/chunk-EZSRGYAY.js +128 -0
- package/dist/chunk-EZSRGYAY.js.map +1 -0
- package/dist/chunk-GBX7KRCX.cjs +162 -0
- package/dist/chunk-GBX7KRCX.cjs.map +1 -0
- package/dist/chunk-ICRPOCV4.cjs +2290 -0
- package/dist/chunk-ICRPOCV4.cjs.map +1 -0
- package/dist/chunk-LAS7UYTK.cjs +129 -0
- package/dist/chunk-LAS7UYTK.cjs.map +1 -0
- package/dist/chunk-LJHT3DNH.js +67 -0
- package/dist/chunk-LJHT3DNH.js.map +1 -0
- package/dist/chunk-MM42A6GN.cjs +91 -0
- package/dist/chunk-MM42A6GN.cjs.map +1 -0
- package/dist/chunk-SRGTC4FJ.js +129 -0
- package/dist/chunk-SRGTC4FJ.js.map +1 -0
- package/dist/chunk-ST7GHHSU.cjs +104 -0
- package/dist/chunk-ST7GHHSU.cjs.map +1 -0
- package/dist/chunk-U4C2WTCI.cjs +131 -0
- package/dist/chunk-U4C2WTCI.cjs.map +1 -0
- package/dist/chunk-UIQUKFF4.js +155 -0
- package/dist/chunk-UIQUKFF4.js.map +1 -0
- package/dist/chunk-WTSDXEWD.js +71 -0
- package/dist/chunk-WTSDXEWD.js.map +1 -0
- package/dist/fs.cjs +20 -2372
- package/dist/fs.cjs.map +1 -1
- package/dist/fs.d.cts +1 -1
- package/dist/fs.d.ts +1 -1
- package/dist/fs.js +4 -2373
- package/dist/fs.js.map +1 -1
- package/dist/index.cjs +930 -3261
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -15
- package/dist/index.d.ts +17 -15
- package/dist/index.js +208 -3490
- package/dist/index.js.map +1 -1
- package/dist/logger.cjs +19 -141
- package/dist/logger.cjs.map +1 -1
- package/dist/logger.d.cts +1 -0
- package/dist/logger.d.ts +1 -0
- package/dist/logger.js +3 -135
- package/dist/logger.js.map +1 -1
- package/dist/transformers.cjs +40 -208
- package/dist/transformers.cjs.map +1 -1
- package/dist/transformers.js +15 -201
- package/dist/transformers.js.map +1 -1
- package/dist/utils.cjs +22 -524
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +0 -1
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +11 -517
- package/dist/utils.js.map +1 -1
- package/dist/{write-46ytbnu9.d.cts → write-A6VgHkYA.d.cts} +4 -1
- package/dist/{write-46ytbnu9.d.ts → write-A6VgHkYA.d.ts} +4 -1
- package/package.json +9 -8
- package/src/BarrelManager.ts +3 -3
- package/src/FileManager.ts +66 -62
- package/src/PluginManager.ts +11 -18
- package/src/build.ts +57 -32
- package/src/fs/clean.ts +2 -2
- package/src/fs/read.ts +1 -0
- package/src/fs/write.ts +40 -24
- package/src/logger.ts +10 -0
- package/src/utils/FunctionParams.ts +2 -2
- package/src/utils/URLPath.ts +5 -5
- package/src/utils/index.ts +0 -2
- package/dist/Queue-2-6pMcCx.d.cts +0 -32
- package/dist/Queue-2-6pMcCx.d.ts +0 -32
- package/src/utils/Queue.ts +0 -110
package/dist/index.cjs
CHANGED
|
@@ -2,22 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var chunkU4C2WTCI_cjs = require('./chunk-U4C2WTCI.cjs');
|
|
6
|
+
var chunkLAS7UYTK_cjs = require('./chunk-LAS7UYTK.cjs');
|
|
7
|
+
require('./chunk-ST7GHHSU.cjs');
|
|
8
|
+
var chunkGBX7KRCX_cjs = require('./chunk-GBX7KRCX.cjs');
|
|
9
|
+
var chunk35FDNG5F_cjs = require('./chunk-35FDNG5F.cjs');
|
|
10
|
+
var chunkICRPOCV4_cjs = require('./chunk-ICRPOCV4.cjs');
|
|
11
|
+
var chunkMM42A6GN_cjs = require('./chunk-MM42A6GN.cjs');
|
|
12
|
+
var crypto = require('crypto');
|
|
6
13
|
var path4 = require('path');
|
|
7
|
-
var jsRuntime = require('js-runtime');
|
|
8
|
-
var crypto2 = require('crypto');
|
|
9
14
|
var parser = require('@kubb/parser');
|
|
10
15
|
var factory = require('@kubb/parser/factory');
|
|
11
16
|
var naturalOrderby = require('natural-orderby');
|
|
12
17
|
var dirTree = require('directory-tree');
|
|
13
|
-
var seedrandom = require('seedrandom');
|
|
14
18
|
var events = require('events');
|
|
15
|
-
var perf_hooks = require('perf_hooks');
|
|
16
19
|
var mod = require('module');
|
|
17
20
|
var os = require('os');
|
|
18
21
|
var url = require('url');
|
|
19
|
-
var
|
|
20
|
-
var
|
|
22
|
+
var process = require('process');
|
|
23
|
+
var fs = require('fs');
|
|
21
24
|
var semver = require('semver');
|
|
22
25
|
|
|
23
26
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -40,2301 +43,19 @@ function _interopNamespace(e) {
|
|
|
40
43
|
return Object.freeze(n);
|
|
41
44
|
}
|
|
42
45
|
|
|
46
|
+
var crypto__default = /*#__PURE__*/_interopDefault(crypto);
|
|
43
47
|
var path4__default = /*#__PURE__*/_interopDefault(path4);
|
|
44
|
-
var crypto2__default = /*#__PURE__*/_interopDefault(crypto2);
|
|
45
48
|
var factory__namespace = /*#__PURE__*/_interopNamespace(factory);
|
|
46
49
|
var dirTree__default = /*#__PURE__*/_interopDefault(dirTree);
|
|
47
|
-
var seedrandom__default = /*#__PURE__*/_interopDefault(seedrandom);
|
|
48
50
|
var mod__default = /*#__PURE__*/_interopDefault(mod);
|
|
49
51
|
var os__default = /*#__PURE__*/_interopDefault(os);
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
var __create = Object.create;
|
|
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;
|
|
59
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
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) {
|
|
63
|
-
if (typeof require !== "undefined")
|
|
64
|
-
return require.apply(this, arguments);
|
|
65
|
-
throw Error('Dynamic require of "' + x2 + '" is not supported');
|
|
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
|
-
));
|
|
89
|
-
var __publicField = (obj, key, value) => {
|
|
90
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
91
|
-
return value;
|
|
92
|
-
};
|
|
93
|
-
var __accessCheck = (obj, member, msg) => {
|
|
94
|
-
if (!member.has(obj))
|
|
95
|
-
throw TypeError("Cannot " + msg);
|
|
96
|
-
};
|
|
97
|
-
var __privateGet = (obj, member, getter) => {
|
|
98
|
-
__accessCheck(obj, member, "read from private field");
|
|
99
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
100
|
-
};
|
|
101
|
-
var __privateAdd = (obj, member, value) => {
|
|
102
|
-
if (member.has(obj))
|
|
103
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
104
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
105
|
-
};
|
|
106
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
107
|
-
__accessCheck(obj, member, "write to private field");
|
|
108
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
109
|
-
return value;
|
|
110
|
-
};
|
|
111
|
-
var __privateWrapper = (obj, member, setter, getter) => ({
|
|
112
|
-
set _(value) {
|
|
113
|
-
__privateSet(obj, member, value, setter);
|
|
114
|
-
},
|
|
115
|
-
get _() {
|
|
116
|
-
return __privateGet(obj, member, getter);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
var __privateMethod = (obj, member, method) => {
|
|
120
|
-
__accessCheck(obj, member, "access private method");
|
|
121
|
-
return method;
|
|
122
|
-
};
|
|
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
|
-
});
|
|
52
|
+
var process__default = /*#__PURE__*/_interopDefault(process);
|
|
53
|
+
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
2333
54
|
|
|
2334
55
|
// ../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js
|
|
2335
|
-
var require_lodash = __commonJS({
|
|
56
|
+
var require_lodash = chunkMM42A6GN_cjs.__commonJS({
|
|
2336
57
|
"../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js"(exports, module) {
|
|
2337
|
-
init_cjs_shims();
|
|
58
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
2338
59
|
var LARGE_ARRAY_SIZE = 200;
|
|
2339
60
|
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
2340
61
|
var COMPARE_PARTIAL_FLAG = 1;
|
|
@@ -2468,14 +189,14 @@ var require_lodash = __commonJS({
|
|
|
2468
189
|
var reIsNative = RegExp(
|
|
2469
190
|
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
2470
191
|
);
|
|
2471
|
-
var
|
|
192
|
+
var Buffer = moduleExports ? root.Buffer : void 0;
|
|
2472
193
|
var Symbol2 = root.Symbol;
|
|
2473
|
-
var
|
|
194
|
+
var Uint8Array = root.Uint8Array;
|
|
2474
195
|
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
2475
196
|
var splice = arrayProto.splice;
|
|
2476
197
|
var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
2477
198
|
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
2478
|
-
var nativeIsBuffer =
|
|
199
|
+
var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
|
|
2479
200
|
var nativeKeys = overArg(Object.keys, Object);
|
|
2480
201
|
var DataView = getNative(root, "DataView");
|
|
2481
202
|
var Map2 = getNative(root, "Map");
|
|
@@ -2818,7 +539,7 @@ var require_lodash = __commonJS({
|
|
|
2818
539
|
object = object.buffer;
|
|
2819
540
|
other = other.buffer;
|
|
2820
541
|
case arrayBufferTag:
|
|
2821
|
-
if (object.byteLength != other.byteLength || !equalFunc(new
|
|
542
|
+
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
|
|
2822
543
|
return false;
|
|
2823
544
|
}
|
|
2824
545
|
return true;
|
|
@@ -3029,616 +750,694 @@ var require_lodash = __commonJS({
|
|
|
3029
750
|
function stubFalse() {
|
|
3030
751
|
return false;
|
|
3031
752
|
}
|
|
3032
|
-
module.exports = isEqual2;
|
|
753
|
+
module.exports = isEqual2;
|
|
754
|
+
}
|
|
755
|
+
});
|
|
756
|
+
|
|
757
|
+
// ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js
|
|
758
|
+
var require_eventemitter3 = chunkMM42A6GN_cjs.__commonJS({
|
|
759
|
+
"../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js"(exports, module) {
|
|
760
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
761
|
+
var has = Object.prototype.hasOwnProperty;
|
|
762
|
+
var prefix = "~";
|
|
763
|
+
function Events() {
|
|
764
|
+
}
|
|
765
|
+
if (Object.create) {
|
|
766
|
+
Events.prototype = /* @__PURE__ */ Object.create(null);
|
|
767
|
+
if (!new Events().__proto__)
|
|
768
|
+
prefix = false;
|
|
769
|
+
}
|
|
770
|
+
function EE(fn, context, once) {
|
|
771
|
+
this.fn = fn;
|
|
772
|
+
this.context = context;
|
|
773
|
+
this.once = once || false;
|
|
774
|
+
}
|
|
775
|
+
function addListener(emitter, event, fn, context, once) {
|
|
776
|
+
if (typeof fn !== "function") {
|
|
777
|
+
throw new TypeError("The listener must be a function");
|
|
778
|
+
}
|
|
779
|
+
var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
|
|
780
|
+
if (!emitter._events[evt])
|
|
781
|
+
emitter._events[evt] = listener, emitter._eventsCount++;
|
|
782
|
+
else if (!emitter._events[evt].fn)
|
|
783
|
+
emitter._events[evt].push(listener);
|
|
784
|
+
else
|
|
785
|
+
emitter._events[evt] = [emitter._events[evt], listener];
|
|
786
|
+
return emitter;
|
|
787
|
+
}
|
|
788
|
+
function clearEvent(emitter, evt) {
|
|
789
|
+
if (--emitter._eventsCount === 0)
|
|
790
|
+
emitter._events = new Events();
|
|
791
|
+
else
|
|
792
|
+
delete emitter._events[evt];
|
|
793
|
+
}
|
|
794
|
+
function EventEmitter3() {
|
|
795
|
+
this._events = new Events();
|
|
796
|
+
this._eventsCount = 0;
|
|
797
|
+
}
|
|
798
|
+
EventEmitter3.prototype.eventNames = function eventNames() {
|
|
799
|
+
var names = [], events, name;
|
|
800
|
+
if (this._eventsCount === 0)
|
|
801
|
+
return names;
|
|
802
|
+
for (name in events = this._events) {
|
|
803
|
+
if (has.call(events, name))
|
|
804
|
+
names.push(prefix ? name.slice(1) : name);
|
|
805
|
+
}
|
|
806
|
+
if (Object.getOwnPropertySymbols) {
|
|
807
|
+
return names.concat(Object.getOwnPropertySymbols(events));
|
|
808
|
+
}
|
|
809
|
+
return names;
|
|
810
|
+
};
|
|
811
|
+
EventEmitter3.prototype.listeners = function listeners(event) {
|
|
812
|
+
var evt = prefix ? prefix + event : event, handlers = this._events[evt];
|
|
813
|
+
if (!handlers)
|
|
814
|
+
return [];
|
|
815
|
+
if (handlers.fn)
|
|
816
|
+
return [handlers.fn];
|
|
817
|
+
for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
|
|
818
|
+
ee[i] = handlers[i].fn;
|
|
819
|
+
}
|
|
820
|
+
return ee;
|
|
821
|
+
};
|
|
822
|
+
EventEmitter3.prototype.listenerCount = function listenerCount(event) {
|
|
823
|
+
var evt = prefix ? prefix + event : event, listeners = this._events[evt];
|
|
824
|
+
if (!listeners)
|
|
825
|
+
return 0;
|
|
826
|
+
if (listeners.fn)
|
|
827
|
+
return 1;
|
|
828
|
+
return listeners.length;
|
|
829
|
+
};
|
|
830
|
+
EventEmitter3.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
|
831
|
+
var evt = prefix ? prefix + event : event;
|
|
832
|
+
if (!this._events[evt])
|
|
833
|
+
return false;
|
|
834
|
+
var listeners = this._events[evt], len = arguments.length, args, i;
|
|
835
|
+
if (listeners.fn) {
|
|
836
|
+
if (listeners.once)
|
|
837
|
+
this.removeListener(event, listeners.fn, void 0, true);
|
|
838
|
+
switch (len) {
|
|
839
|
+
case 1:
|
|
840
|
+
return listeners.fn.call(listeners.context), true;
|
|
841
|
+
case 2:
|
|
842
|
+
return listeners.fn.call(listeners.context, a1), true;
|
|
843
|
+
case 3:
|
|
844
|
+
return listeners.fn.call(listeners.context, a1, a2), true;
|
|
845
|
+
case 4:
|
|
846
|
+
return listeners.fn.call(listeners.context, a1, a2, a3), true;
|
|
847
|
+
case 5:
|
|
848
|
+
return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
|
|
849
|
+
case 6:
|
|
850
|
+
return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
|
|
851
|
+
}
|
|
852
|
+
for (i = 1, args = new Array(len - 1); i < len; i++) {
|
|
853
|
+
args[i - 1] = arguments[i];
|
|
854
|
+
}
|
|
855
|
+
listeners.fn.apply(listeners.context, args);
|
|
856
|
+
} else {
|
|
857
|
+
var length = listeners.length, j;
|
|
858
|
+
for (i = 0; i < length; i++) {
|
|
859
|
+
if (listeners[i].once)
|
|
860
|
+
this.removeListener(event, listeners[i].fn, void 0, true);
|
|
861
|
+
switch (len) {
|
|
862
|
+
case 1:
|
|
863
|
+
listeners[i].fn.call(listeners[i].context);
|
|
864
|
+
break;
|
|
865
|
+
case 2:
|
|
866
|
+
listeners[i].fn.call(listeners[i].context, a1);
|
|
867
|
+
break;
|
|
868
|
+
case 3:
|
|
869
|
+
listeners[i].fn.call(listeners[i].context, a1, a2);
|
|
870
|
+
break;
|
|
871
|
+
case 4:
|
|
872
|
+
listeners[i].fn.call(listeners[i].context, a1, a2, a3);
|
|
873
|
+
break;
|
|
874
|
+
default:
|
|
875
|
+
if (!args)
|
|
876
|
+
for (j = 1, args = new Array(len - 1); j < len; j++) {
|
|
877
|
+
args[j - 1] = arguments[j];
|
|
878
|
+
}
|
|
879
|
+
listeners[i].fn.apply(listeners[i].context, args);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
return true;
|
|
884
|
+
};
|
|
885
|
+
EventEmitter3.prototype.on = function on(event, fn, context) {
|
|
886
|
+
return addListener(this, event, fn, context, false);
|
|
887
|
+
};
|
|
888
|
+
EventEmitter3.prototype.once = function once(event, fn, context) {
|
|
889
|
+
return addListener(this, event, fn, context, true);
|
|
890
|
+
};
|
|
891
|
+
EventEmitter3.prototype.removeListener = function removeListener(event, fn, context, once) {
|
|
892
|
+
var evt = prefix ? prefix + event : event;
|
|
893
|
+
if (!this._events[evt])
|
|
894
|
+
return this;
|
|
895
|
+
if (!fn) {
|
|
896
|
+
clearEvent(this, evt);
|
|
897
|
+
return this;
|
|
898
|
+
}
|
|
899
|
+
var listeners = this._events[evt];
|
|
900
|
+
if (listeners.fn) {
|
|
901
|
+
if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
|
|
902
|
+
clearEvent(this, evt);
|
|
903
|
+
}
|
|
904
|
+
} else {
|
|
905
|
+
for (var i = 0, events = [], length = listeners.length; i < length; i++) {
|
|
906
|
+
if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
|
|
907
|
+
events.push(listeners[i]);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
if (events.length)
|
|
911
|
+
this._events[evt] = events.length === 1 ? events[0] : events;
|
|
912
|
+
else
|
|
913
|
+
clearEvent(this, evt);
|
|
914
|
+
}
|
|
915
|
+
return this;
|
|
916
|
+
};
|
|
917
|
+
EventEmitter3.prototype.removeAllListeners = function removeAllListeners(event) {
|
|
918
|
+
var evt;
|
|
919
|
+
if (event) {
|
|
920
|
+
evt = prefix ? prefix + event : event;
|
|
921
|
+
if (this._events[evt])
|
|
922
|
+
clearEvent(this, evt);
|
|
923
|
+
} else {
|
|
924
|
+
this._events = new Events();
|
|
925
|
+
this._eventsCount = 0;
|
|
926
|
+
}
|
|
927
|
+
return this;
|
|
928
|
+
};
|
|
929
|
+
EventEmitter3.prototype.off = EventEmitter3.prototype.removeListener;
|
|
930
|
+
EventEmitter3.prototype.addListener = EventEmitter3.prototype.on;
|
|
931
|
+
EventEmitter3.prefixed = prefix;
|
|
932
|
+
EventEmitter3.EventEmitter = EventEmitter3;
|
|
933
|
+
if ("undefined" !== typeof module) {
|
|
934
|
+
module.exports = EventEmitter3;
|
|
935
|
+
}
|
|
3033
936
|
}
|
|
3034
937
|
});
|
|
3035
938
|
|
|
3036
939
|
// src/index.ts
|
|
3037
|
-
init_cjs_shims();
|
|
940
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
3038
941
|
|
|
3039
942
|
// 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);
|
|
3077
|
-
}
|
|
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);
|
|
3112
|
-
}
|
|
943
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
3113
944
|
|
|
3114
|
-
// src/
|
|
3115
|
-
init_cjs_shims();
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
const isWindowsPath = /^\\\\\?\\/.test(path5);
|
|
3119
|
-
if (["linux", "mac"].includes(platform) && !isWindowsPath) {
|
|
3120
|
-
return path5.replaceAll(/\\/g, "/").replace("../", "").trimEnd();
|
|
3121
|
-
}
|
|
3122
|
-
return path5.replaceAll(/\\/g, "/").replace("../", "").trimEnd();
|
|
3123
|
-
}
|
|
3124
|
-
function getRelativePath(rootDir, filePath, platform = "linux") {
|
|
3125
|
-
if (!rootDir || !filePath) {
|
|
3126
|
-
throw new Error(`Root and file should be filled in when retrieving the relativePath, ${rootDir || ""} ${filePath || ""}`);
|
|
3127
|
-
}
|
|
3128
|
-
const relativePath = path4.relative(rootDir, filePath);
|
|
3129
|
-
const slashedPath = slash(relativePath, platform);
|
|
3130
|
-
if (slashedPath.startsWith("../")) {
|
|
3131
|
-
return slashedPath.replace(path4.basename(slashedPath), path4.basename(slashedPath, path4.extname(filePath)));
|
|
3132
|
-
}
|
|
3133
|
-
return `./${slashedPath.replace(path4.basename(slashedPath), path4.basename(slashedPath, path4.extname(filePath)))}`;
|
|
945
|
+
// src/config.ts
|
|
946
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
947
|
+
function defineConfig(options) {
|
|
948
|
+
return options;
|
|
3134
949
|
}
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
node: async (path5) => {
|
|
3138
|
-
return import_fs_extra2.default.readFile(path5, { encoding: "utf8" });
|
|
3139
|
-
},
|
|
3140
|
-
bun: async (path5) => {
|
|
3141
|
-
const file = Bun.file(path5);
|
|
3142
|
-
return file.text();
|
|
3143
|
-
}
|
|
3144
|
-
},
|
|
3145
|
-
"node"
|
|
3146
|
-
);
|
|
3147
|
-
jsRuntime.switcher(
|
|
3148
|
-
{
|
|
3149
|
-
node: (path5) => {
|
|
3150
|
-
return import_fs_extra2.default.readFileSync(path5, { encoding: "utf8" });
|
|
3151
|
-
},
|
|
3152
|
-
bun: () => {
|
|
3153
|
-
throw new Error("Bun cannot read sync");
|
|
3154
|
-
}
|
|
3155
|
-
},
|
|
3156
|
-
"node"
|
|
3157
|
-
);
|
|
3158
|
-
async function read(path5) {
|
|
3159
|
-
return reader(path5);
|
|
950
|
+
function isInputPath(result) {
|
|
951
|
+
return !!result && "path" in result;
|
|
3160
952
|
}
|
|
3161
953
|
|
|
3162
|
-
// src/
|
|
3163
|
-
init_cjs_shims();
|
|
954
|
+
// src/FileManager.ts
|
|
955
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
956
|
+
var import_lodash = chunkMM42A6GN_cjs.__toESM(require_lodash(), 1);
|
|
3164
957
|
|
|
3165
|
-
//
|
|
3166
|
-
init_cjs_shims();
|
|
958
|
+
// ../../node_modules/.pnpm/p-queue@7.4.1/node_modules/p-queue/dist/index.js
|
|
959
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
3167
960
|
|
|
3168
|
-
//
|
|
3169
|
-
init_cjs_shims();
|
|
961
|
+
// ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
|
|
962
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
963
|
+
var import_index = chunkMM42A6GN_cjs.__toESM(require_eventemitter3(), 1);
|
|
3170
964
|
|
|
3171
|
-
// ../../node_modules/.pnpm/
|
|
3172
|
-
init_cjs_shims();
|
|
3173
|
-
var
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
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);
|
|
965
|
+
// ../../node_modules/.pnpm/p-timeout@5.1.0/node_modules/p-timeout/index.js
|
|
966
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
967
|
+
var TimeoutError = class extends Error {
|
|
968
|
+
constructor(message) {
|
|
969
|
+
super(message);
|
|
970
|
+
this.name = "TimeoutError";
|
|
3185
971
|
}
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
const
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
}
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
}
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
}
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
972
|
+
};
|
|
973
|
+
var AbortError = class extends Error {
|
|
974
|
+
constructor(message) {
|
|
975
|
+
super();
|
|
976
|
+
this.name = "AbortError";
|
|
977
|
+
this.message = message;
|
|
978
|
+
}
|
|
979
|
+
};
|
|
980
|
+
var getDOMException = (errorMessage) => globalThis.DOMException === void 0 ? new AbortError(errorMessage) : new DOMException(errorMessage);
|
|
981
|
+
var getAbortedReason = (signal) => {
|
|
982
|
+
const reason = signal.reason === void 0 ? getDOMException("This operation was aborted.") : signal.reason;
|
|
983
|
+
return reason instanceof Error ? reason : getDOMException(reason);
|
|
984
|
+
};
|
|
985
|
+
function pTimeout(promise, milliseconds, fallback, options) {
|
|
986
|
+
let timer;
|
|
987
|
+
const cancelablePromise = new Promise((resolve2, reject) => {
|
|
988
|
+
if (typeof milliseconds !== "number" || Math.sign(milliseconds) !== 1) {
|
|
989
|
+
throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``);
|
|
990
|
+
}
|
|
991
|
+
if (milliseconds === Number.POSITIVE_INFINITY) {
|
|
992
|
+
resolve2(promise);
|
|
993
|
+
return;
|
|
994
|
+
}
|
|
995
|
+
options = {
|
|
996
|
+
customTimers: { setTimeout, clearTimeout },
|
|
997
|
+
...options
|
|
998
|
+
};
|
|
999
|
+
if (options.signal) {
|
|
1000
|
+
const { signal } = options;
|
|
1001
|
+
if (signal.aborted) {
|
|
1002
|
+
reject(getAbortedReason(signal));
|
|
1003
|
+
}
|
|
1004
|
+
signal.addEventListener("abort", () => {
|
|
1005
|
+
reject(getAbortedReason(signal));
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
timer = options.customTimers.setTimeout.call(void 0, () => {
|
|
1009
|
+
if (typeof fallback === "function") {
|
|
1010
|
+
try {
|
|
1011
|
+
resolve2(fallback());
|
|
1012
|
+
} catch (error) {
|
|
1013
|
+
reject(error);
|
|
1014
|
+
}
|
|
1015
|
+
return;
|
|
1016
|
+
}
|
|
1017
|
+
const message = typeof fallback === "string" ? fallback : `Promise timed out after ${milliseconds} milliseconds`;
|
|
1018
|
+
const timeoutError = fallback instanceof Error ? fallback : new TimeoutError(message);
|
|
1019
|
+
if (typeof promise.cancel === "function") {
|
|
1020
|
+
promise.cancel();
|
|
1021
|
+
}
|
|
1022
|
+
reject(timeoutError);
|
|
1023
|
+
}, milliseconds);
|
|
1024
|
+
(async () => {
|
|
1025
|
+
try {
|
|
1026
|
+
resolve2(await promise);
|
|
1027
|
+
} catch (error) {
|
|
1028
|
+
reject(error);
|
|
1029
|
+
} finally {
|
|
1030
|
+
options.customTimers.clearTimeout.call(void 0, timer);
|
|
1031
|
+
}
|
|
1032
|
+
})();
|
|
1033
|
+
});
|
|
1034
|
+
cancelablePromise.clear = () => {
|
|
1035
|
+
clearTimeout(timer);
|
|
1036
|
+
timer = void 0;
|
|
3229
1037
|
};
|
|
1038
|
+
return cancelablePromise;
|
|
3230
1039
|
}
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
1040
|
+
|
|
1041
|
+
// ../../node_modules/.pnpm/p-queue@7.4.1/node_modules/p-queue/dist/priority-queue.js
|
|
1042
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
1043
|
+
|
|
1044
|
+
// ../../node_modules/.pnpm/p-queue@7.4.1/node_modules/p-queue/dist/lower-bound.js
|
|
1045
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
1046
|
+
function lowerBound(array, value, comparator) {
|
|
1047
|
+
let first = 0;
|
|
1048
|
+
let count = array.length;
|
|
1049
|
+
while (count > 0) {
|
|
1050
|
+
const step = Math.trunc(count / 2);
|
|
1051
|
+
let it = first + step;
|
|
1052
|
+
if (comparator(array[it], value) <= 0) {
|
|
1053
|
+
first = ++it;
|
|
1054
|
+
count -= step + 1;
|
|
3237
1055
|
} else {
|
|
3238
|
-
|
|
1056
|
+
count = step;
|
|
3239
1057
|
}
|
|
3240
1058
|
}
|
|
3241
|
-
return
|
|
3242
|
-
}
|
|
3243
|
-
|
|
3244
|
-
// src/transformers/casing.ts
|
|
3245
|
-
function camelCase2(text) {
|
|
3246
|
-
return camelCase(text, { delimiter: "", mergeAmbiguousCharacters: true });
|
|
3247
|
-
}
|
|
3248
|
-
function pascalCase2(text) {
|
|
3249
|
-
return pascalCase(text, { delimiter: "", mergeAmbiguousCharacters: true });
|
|
1059
|
+
return first;
|
|
3250
1060
|
}
|
|
3251
1061
|
|
|
3252
|
-
//
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
1062
|
+
// ../../node_modules/.pnpm/p-queue@7.4.1/node_modules/p-queue/dist/priority-queue.js
|
|
1063
|
+
var __classPrivateFieldGet = function(receiver, state, kind, f) {
|
|
1064
|
+
if (kind === "a" && !f)
|
|
1065
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
1066
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
1067
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1068
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
1069
|
+
};
|
|
1070
|
+
var _PriorityQueue_queue;
|
|
1071
|
+
var PriorityQueue = class {
|
|
1072
|
+
constructor() {
|
|
1073
|
+
_PriorityQueue_queue.set(this, []);
|
|
3264
1074
|
}
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
switch (character) {
|
|
3278
|
-
case '"':
|
|
3279
|
-
case "'":
|
|
3280
|
-
case "\\":
|
|
3281
|
-
return "\\" + character;
|
|
3282
|
-
case "\n":
|
|
3283
|
-
return "\\n";
|
|
3284
|
-
case "\r":
|
|
3285
|
-
return "\\r";
|
|
3286
|
-
case "\u2028":
|
|
3287
|
-
return "\\u2028";
|
|
3288
|
-
case "\u2029":
|
|
3289
|
-
return "\\u2029";
|
|
3290
|
-
default:
|
|
3291
|
-
return "";
|
|
1075
|
+
enqueue(run, options) {
|
|
1076
|
+
options = {
|
|
1077
|
+
priority: 0,
|
|
1078
|
+
...options
|
|
1079
|
+
};
|
|
1080
|
+
const element = {
|
|
1081
|
+
priority: options.priority,
|
|
1082
|
+
run
|
|
1083
|
+
};
|
|
1084
|
+
if (this.size && __classPrivateFieldGet(this, _PriorityQueue_queue, "f")[this.size - 1].priority >= options.priority) {
|
|
1085
|
+
__classPrivateFieldGet(this, _PriorityQueue_queue, "f").push(element);
|
|
1086
|
+
return;
|
|
3292
1087
|
}
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
// src/transformers/indent.ts
|
|
3297
|
-
init_cjs_shims();
|
|
3298
|
-
function createIndent(size) {
|
|
3299
|
-
return Array.from({ length: size + 1 }).join(" ");
|
|
3300
|
-
}
|
|
3301
|
-
|
|
3302
|
-
// src/transformers/nameSorter.ts
|
|
3303
|
-
init_cjs_shims();
|
|
3304
|
-
function nameSorter(a, b2) {
|
|
3305
|
-
if (a.name < b2.name) {
|
|
3306
|
-
return -1;
|
|
1088
|
+
const index = lowerBound(__classPrivateFieldGet(this, _PriorityQueue_queue, "f"), element, (a, b) => b.priority - a.priority);
|
|
1089
|
+
__classPrivateFieldGet(this, _PriorityQueue_queue, "f").splice(index, 0, element);
|
|
3307
1090
|
}
|
|
3308
|
-
|
|
3309
|
-
|
|
1091
|
+
dequeue() {
|
|
1092
|
+
const item = __classPrivateFieldGet(this, _PriorityQueue_queue, "f").shift();
|
|
1093
|
+
return item === null || item === void 0 ? void 0 : item.run;
|
|
3310
1094
|
}
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
function searchAndReplace(options) {
|
|
3317
|
-
const { text, replaceBy, prefix = "", key } = options;
|
|
3318
|
-
const searchValues = options.searchValues?.(prefix, key) || [
|
|
3319
|
-
`${prefix}["${key}"]`,
|
|
3320
|
-
`${prefix}['${key}']`,
|
|
3321
|
-
`${prefix}[\`${key}\`]`,
|
|
3322
|
-
`${prefix}"${key}"`,
|
|
3323
|
-
`${prefix}'${key}'`,
|
|
3324
|
-
`${prefix}\`${key}\``,
|
|
3325
|
-
new RegExp(`${prefix}${key}`, "g")
|
|
3326
|
-
];
|
|
3327
|
-
return searchValues.reduce((prev, searchValue) => {
|
|
3328
|
-
return prev.toString().replaceAll(searchValue, replaceBy);
|
|
3329
|
-
}, text);
|
|
3330
|
-
}
|
|
3331
|
-
|
|
3332
|
-
// src/transformers/transformReservedWord.ts
|
|
3333
|
-
init_cjs_shims();
|
|
3334
|
-
var reservedWords = [
|
|
3335
|
-
"abstract",
|
|
3336
|
-
"arguments",
|
|
3337
|
-
"boolean",
|
|
3338
|
-
"break",
|
|
3339
|
-
"byte",
|
|
3340
|
-
"case",
|
|
3341
|
-
"catch",
|
|
3342
|
-
"char",
|
|
3343
|
-
"class",
|
|
3344
|
-
"const",
|
|
3345
|
-
"continue",
|
|
3346
|
-
"debugger",
|
|
3347
|
-
"default",
|
|
3348
|
-
"delete",
|
|
3349
|
-
"do",
|
|
3350
|
-
"double",
|
|
3351
|
-
"else",
|
|
3352
|
-
"enum",
|
|
3353
|
-
"eval",
|
|
3354
|
-
"export",
|
|
3355
|
-
"extends",
|
|
3356
|
-
"false",
|
|
3357
|
-
"final",
|
|
3358
|
-
"finally",
|
|
3359
|
-
"float",
|
|
3360
|
-
"for",
|
|
3361
|
-
"function",
|
|
3362
|
-
"goto",
|
|
3363
|
-
"if",
|
|
3364
|
-
"implements",
|
|
3365
|
-
"import",
|
|
3366
|
-
"in",
|
|
3367
|
-
"instanceof",
|
|
3368
|
-
"int",
|
|
3369
|
-
"interface",
|
|
3370
|
-
"let",
|
|
3371
|
-
"long",
|
|
3372
|
-
"native",
|
|
3373
|
-
"new",
|
|
3374
|
-
"null",
|
|
3375
|
-
"package",
|
|
3376
|
-
"private",
|
|
3377
|
-
"protected",
|
|
3378
|
-
"public",
|
|
3379
|
-
"return",
|
|
3380
|
-
"short",
|
|
3381
|
-
"static",
|
|
3382
|
-
"super",
|
|
3383
|
-
"switch",
|
|
3384
|
-
"synchronized",
|
|
3385
|
-
"this",
|
|
3386
|
-
"throw",
|
|
3387
|
-
"throws",
|
|
3388
|
-
"transient",
|
|
3389
|
-
"true",
|
|
3390
|
-
"try",
|
|
3391
|
-
"typeof",
|
|
3392
|
-
"var",
|
|
3393
|
-
"void",
|
|
3394
|
-
"volatile",
|
|
3395
|
-
"while",
|
|
3396
|
-
"with",
|
|
3397
|
-
"yield",
|
|
3398
|
-
"Array",
|
|
3399
|
-
"Date",
|
|
3400
|
-
"eval",
|
|
3401
|
-
"function",
|
|
3402
|
-
"hasOwnProperty",
|
|
3403
|
-
"Infinity",
|
|
3404
|
-
"isFinite",
|
|
3405
|
-
"isNaN",
|
|
3406
|
-
"isPrototypeOf",
|
|
3407
|
-
"length",
|
|
3408
|
-
"Math",
|
|
3409
|
-
"name",
|
|
3410
|
-
"NaN",
|
|
3411
|
-
"Number",
|
|
3412
|
-
"Object",
|
|
3413
|
-
"prototype",
|
|
3414
|
-
"String",
|
|
3415
|
-
"toString",
|
|
3416
|
-
"undefined",
|
|
3417
|
-
"valueOf"
|
|
3418
|
-
];
|
|
3419
|
-
function transformReservedWord(word) {
|
|
3420
|
-
if (word && reservedWords.includes(word) || word?.match(/^\d/)) {
|
|
3421
|
-
return `_${word}`;
|
|
1095
|
+
filter(options) {
|
|
1096
|
+
return __classPrivateFieldGet(this, _PriorityQueue_queue, "f").filter((element) => element.priority === options.priority).map((element) => element.run);
|
|
1097
|
+
}
|
|
1098
|
+
get size() {
|
|
1099
|
+
return __classPrivateFieldGet(this, _PriorityQueue_queue, "f").length;
|
|
3422
1100
|
}
|
|
3423
|
-
return word;
|
|
3424
|
-
}
|
|
3425
|
-
|
|
3426
|
-
// src/transformers/trim.ts
|
|
3427
|
-
init_cjs_shims();
|
|
3428
|
-
function trim(text) {
|
|
3429
|
-
return text.replaceAll(/\n/g, "").trim();
|
|
3430
|
-
}
|
|
3431
|
-
function trimExtName(text) {
|
|
3432
|
-
return text.replace(/\.[^/.]+$/, "");
|
|
3433
|
-
}
|
|
3434
|
-
|
|
3435
|
-
// src/transformers/index.ts
|
|
3436
|
-
var transformers_default = {
|
|
3437
|
-
combineCodes,
|
|
3438
|
-
escape,
|
|
3439
|
-
jsStringEscape,
|
|
3440
|
-
createIndent,
|
|
3441
|
-
transformReservedWord,
|
|
3442
|
-
nameSorter,
|
|
3443
|
-
searchAndReplace,
|
|
3444
|
-
trim,
|
|
3445
|
-
trimExtName,
|
|
3446
|
-
JSDoc: {
|
|
3447
|
-
createJSDocBlockText
|
|
3448
|
-
},
|
|
3449
|
-
camelCase: camelCase2,
|
|
3450
|
-
pascalCase: pascalCase2
|
|
3451
1101
|
};
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
1102
|
+
_PriorityQueue_queue = /* @__PURE__ */ new WeakMap();
|
|
1103
|
+
var priority_queue_default = PriorityQueue;
|
|
1104
|
+
|
|
1105
|
+
// ../../node_modules/.pnpm/p-queue@7.4.1/node_modules/p-queue/dist/index.js
|
|
1106
|
+
var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
|
|
1107
|
+
if (kind === "m")
|
|
1108
|
+
throw new TypeError("Private method is not writable");
|
|
1109
|
+
if (kind === "a" && !f)
|
|
1110
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
1111
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
1112
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1113
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
1114
|
+
};
|
|
1115
|
+
var __classPrivateFieldGet2 = function(receiver, state, kind, f) {
|
|
1116
|
+
if (kind === "a" && !f)
|
|
1117
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
1118
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
1119
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1120
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
1121
|
+
};
|
|
1122
|
+
var _PQueue_instances;
|
|
1123
|
+
var _PQueue_carryoverConcurrencyCount;
|
|
1124
|
+
var _PQueue_isIntervalIgnored;
|
|
1125
|
+
var _PQueue_intervalCount;
|
|
1126
|
+
var _PQueue_intervalCap;
|
|
1127
|
+
var _PQueue_interval;
|
|
1128
|
+
var _PQueue_intervalEnd;
|
|
1129
|
+
var _PQueue_intervalId;
|
|
1130
|
+
var _PQueue_timeoutId;
|
|
1131
|
+
var _PQueue_queue;
|
|
1132
|
+
var _PQueue_queueClass;
|
|
1133
|
+
var _PQueue_pending;
|
|
1134
|
+
var _PQueue_concurrency;
|
|
1135
|
+
var _PQueue_isPaused;
|
|
1136
|
+
var _PQueue_throwOnTimeout;
|
|
1137
|
+
var _PQueue_doesIntervalAllowAnother_get;
|
|
1138
|
+
var _PQueue_doesConcurrentAllowAnother_get;
|
|
1139
|
+
var _PQueue_next;
|
|
1140
|
+
var _PQueue_onResumeInterval;
|
|
1141
|
+
var _PQueue_isIntervalPaused_get;
|
|
1142
|
+
var _PQueue_tryToStartAnother;
|
|
1143
|
+
var _PQueue_initializeIntervalIfNeeded;
|
|
1144
|
+
var _PQueue_onInterval;
|
|
1145
|
+
var _PQueue_processQueue;
|
|
1146
|
+
var _PQueue_throwOnAbort;
|
|
1147
|
+
var _PQueue_onEvent;
|
|
1148
|
+
var AbortError2 = class extends Error {
|
|
1149
|
+
};
|
|
1150
|
+
var PQueue = class extends import_index.default {
|
|
1151
|
+
// TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
|
|
1152
|
+
constructor(options) {
|
|
1153
|
+
var _a, _b, _c, _d;
|
|
1154
|
+
super();
|
|
1155
|
+
_PQueue_instances.add(this);
|
|
1156
|
+
_PQueue_carryoverConcurrencyCount.set(this, void 0);
|
|
1157
|
+
_PQueue_isIntervalIgnored.set(this, void 0);
|
|
1158
|
+
_PQueue_intervalCount.set(this, 0);
|
|
1159
|
+
_PQueue_intervalCap.set(this, void 0);
|
|
1160
|
+
_PQueue_interval.set(this, void 0);
|
|
1161
|
+
_PQueue_intervalEnd.set(this, 0);
|
|
1162
|
+
_PQueue_intervalId.set(this, void 0);
|
|
1163
|
+
_PQueue_timeoutId.set(this, void 0);
|
|
1164
|
+
_PQueue_queue.set(this, void 0);
|
|
1165
|
+
_PQueue_queueClass.set(this, void 0);
|
|
1166
|
+
_PQueue_pending.set(this, 0);
|
|
1167
|
+
_PQueue_concurrency.set(this, void 0);
|
|
1168
|
+
_PQueue_isPaused.set(this, void 0);
|
|
1169
|
+
_PQueue_throwOnTimeout.set(this, void 0);
|
|
1170
|
+
Object.defineProperty(this, "timeout", {
|
|
1171
|
+
enumerable: true,
|
|
1172
|
+
configurable: true,
|
|
1173
|
+
writable: true,
|
|
1174
|
+
value: void 0
|
|
1175
|
+
});
|
|
1176
|
+
options = {
|
|
1177
|
+
carryoverConcurrencyCount: false,
|
|
1178
|
+
intervalCap: Number.POSITIVE_INFINITY,
|
|
1179
|
+
interval: 0,
|
|
1180
|
+
concurrency: Number.POSITIVE_INFINITY,
|
|
1181
|
+
autoStart: true,
|
|
1182
|
+
queueClass: priority_queue_default,
|
|
1183
|
+
...options
|
|
1184
|
+
};
|
|
1185
|
+
if (!(typeof options.intervalCap === "number" && options.intervalCap >= 1)) {
|
|
1186
|
+
throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(_b = (_a = options.intervalCap) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ""}\` (${typeof options.intervalCap})`);
|
|
1187
|
+
}
|
|
1188
|
+
if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
|
|
1189
|
+
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(_d = (_c = options.interval) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : ""}\` (${typeof options.interval})`);
|
|
1190
|
+
}
|
|
1191
|
+
__classPrivateFieldSet(this, _PQueue_carryoverConcurrencyCount, options.carryoverConcurrencyCount, "f");
|
|
1192
|
+
__classPrivateFieldSet(this, _PQueue_isIntervalIgnored, options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0, "f");
|
|
1193
|
+
__classPrivateFieldSet(this, _PQueue_intervalCap, options.intervalCap, "f");
|
|
1194
|
+
__classPrivateFieldSet(this, _PQueue_interval, options.interval, "f");
|
|
1195
|
+
__classPrivateFieldSet(this, _PQueue_queue, new options.queueClass(), "f");
|
|
1196
|
+
__classPrivateFieldSet(this, _PQueue_queueClass, options.queueClass, "f");
|
|
1197
|
+
this.concurrency = options.concurrency;
|
|
1198
|
+
this.timeout = options.timeout;
|
|
1199
|
+
__classPrivateFieldSet(this, _PQueue_throwOnTimeout, options.throwOnTimeout === true, "f");
|
|
1200
|
+
__classPrivateFieldSet(this, _PQueue_isPaused, options.autoStart === false, "f");
|
|
1201
|
+
}
|
|
1202
|
+
get concurrency() {
|
|
1203
|
+
return __classPrivateFieldGet2(this, _PQueue_concurrency, "f");
|
|
1204
|
+
}
|
|
1205
|
+
set concurrency(newConcurrency) {
|
|
1206
|
+
if (!(typeof newConcurrency === "number" && newConcurrency >= 1)) {
|
|
1207
|
+
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`);
|
|
1208
|
+
}
|
|
1209
|
+
__classPrivateFieldSet(this, _PQueue_concurrency, newConcurrency, "f");
|
|
1210
|
+
__classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_processQueue).call(this);
|
|
1211
|
+
}
|
|
1212
|
+
async add(function_, options = {}) {
|
|
1213
|
+
options = {
|
|
1214
|
+
timeout: this.timeout,
|
|
1215
|
+
throwOnTimeout: __classPrivateFieldGet2(this, _PQueue_throwOnTimeout, "f"),
|
|
1216
|
+
...options
|
|
1217
|
+
};
|
|
1218
|
+
return new Promise((resolve2, reject) => {
|
|
1219
|
+
__classPrivateFieldGet2(this, _PQueue_queue, "f").enqueue(async () => {
|
|
1220
|
+
var _a;
|
|
1221
|
+
var _b, _c;
|
|
1222
|
+
__classPrivateFieldSet(this, _PQueue_pending, (_b = __classPrivateFieldGet2(this, _PQueue_pending, "f"), _b++, _b), "f");
|
|
1223
|
+
__classPrivateFieldSet(this, _PQueue_intervalCount, (_c = __classPrivateFieldGet2(this, _PQueue_intervalCount, "f"), _c++, _c), "f");
|
|
1224
|
+
try {
|
|
1225
|
+
if ((_a = options.signal) === null || _a === void 0 ? void 0 : _a.aborted) {
|
|
1226
|
+
throw new AbortError2("The task was aborted.");
|
|
1227
|
+
}
|
|
1228
|
+
let operation = function_({ signal: options.signal });
|
|
1229
|
+
if (options.timeout) {
|
|
1230
|
+
operation = pTimeout(Promise.resolve(operation), options.timeout);
|
|
1231
|
+
}
|
|
1232
|
+
if (options.signal) {
|
|
1233
|
+
operation = Promise.race([operation, __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_throwOnAbort).call(this, options.signal)]);
|
|
1234
|
+
}
|
|
1235
|
+
const result = await operation;
|
|
1236
|
+
resolve2(result);
|
|
1237
|
+
this.emit("completed", result);
|
|
1238
|
+
} catch (error) {
|
|
1239
|
+
if (error instanceof TimeoutError && !options.throwOnTimeout) {
|
|
1240
|
+
resolve2();
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1243
|
+
reject(error);
|
|
1244
|
+
this.emit("error", error);
|
|
1245
|
+
} finally {
|
|
1246
|
+
__classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_next).call(this);
|
|
1247
|
+
}
|
|
1248
|
+
}, options);
|
|
1249
|
+
this.emit("add");
|
|
1250
|
+
__classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_tryToStartAnother).call(this);
|
|
1251
|
+
});
|
|
3458
1252
|
}
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
* @example /pet/{petId} => /pet/:petId
|
|
3462
|
-
*/
|
|
3463
|
-
get URL() {
|
|
3464
|
-
return this.toURLPath();
|
|
1253
|
+
async addAll(functions, options) {
|
|
1254
|
+
return Promise.all(functions.map(async (function_) => this.add(function_, options)));
|
|
3465
1255
|
}
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
} catch (error) {
|
|
3473
|
-
return false;
|
|
1256
|
+
/**
|
|
1257
|
+
Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)
|
|
1258
|
+
*/
|
|
1259
|
+
start() {
|
|
1260
|
+
if (!__classPrivateFieldGet2(this, _PQueue_isPaused, "f")) {
|
|
1261
|
+
return this;
|
|
3474
1262
|
}
|
|
3475
|
-
|
|
1263
|
+
__classPrivateFieldSet(this, _PQueue_isPaused, false, "f");
|
|
1264
|
+
__classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_processQueue).call(this);
|
|
1265
|
+
return this;
|
|
3476
1266
|
}
|
|
3477
1267
|
/**
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
*/
|
|
3483
|
-
get template() {
|
|
3484
|
-
return this.toTemplateString();
|
|
1268
|
+
Put queue execution on hold.
|
|
1269
|
+
*/
|
|
1270
|
+
pause() {
|
|
1271
|
+
__classPrivateFieldSet(this, _PQueue_isPaused, true, "f");
|
|
3485
1272
|
}
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
1273
|
+
/**
|
|
1274
|
+
Clear the queue.
|
|
1275
|
+
*/
|
|
1276
|
+
clear() {
|
|
1277
|
+
__classPrivateFieldSet(this, _PQueue_queue, new (__classPrivateFieldGet2(this, _PQueue_queueClass, "f"))(), "f");
|
|
3491
1278
|
}
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
}
|
|
3501
|
-
if (object.params) {
|
|
3502
|
-
return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll("'", "").replaceAll(`"`, "")} }`;
|
|
3503
|
-
}
|
|
3504
|
-
return `{ url: '${object.url}' }`;
|
|
1279
|
+
/**
|
|
1280
|
+
Can be called multiple times. Useful if you for example add additional items at a later time.
|
|
1281
|
+
|
|
1282
|
+
@returns A promise that settles when the queue becomes empty.
|
|
1283
|
+
*/
|
|
1284
|
+
async onEmpty() {
|
|
1285
|
+
if (__classPrivateFieldGet2(this, _PQueue_queue, "f").size === 0) {
|
|
1286
|
+
return;
|
|
3505
1287
|
}
|
|
3506
|
-
|
|
1288
|
+
await __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_onEvent).call(this, "empty");
|
|
3507
1289
|
}
|
|
3508
1290
|
/**
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
const pathParam = replacer ? replacer(transformers_default.camelCase(curr)) : transformers_default.camelCase(curr);
|
|
3521
|
-
const replacement = `\${${pathParam}}`;
|
|
3522
|
-
return prev.replace(curr, replacement);
|
|
3523
|
-
}, this.path);
|
|
3524
|
-
}
|
|
3525
|
-
return `\`${newPath}\``;
|
|
1291
|
+
@returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
|
|
1292
|
+
|
|
1293
|
+
If you want to avoid having the queue grow beyond a certain size you can `await queue.onSizeLessThan()` before adding a new item.
|
|
1294
|
+
|
|
1295
|
+
Note that this only limits the number of items waiting to start. There could still be up to `concurrency` jobs already running that this call does not include in its calculation.
|
|
1296
|
+
*/
|
|
1297
|
+
async onSizeLessThan(limit) {
|
|
1298
|
+
if (__classPrivateFieldGet2(this, _PQueue_queue, "f").size < limit) {
|
|
1299
|
+
return;
|
|
1300
|
+
}
|
|
1301
|
+
await __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_onEvent).call(this, "next", () => __classPrivateFieldGet2(this, _PQueue_queue, "f").size < limit);
|
|
3526
1302
|
}
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
1303
|
+
/**
|
|
1304
|
+
The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.
|
|
1305
|
+
|
|
1306
|
+
@returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
|
|
1307
|
+
*/
|
|
1308
|
+
async onIdle() {
|
|
1309
|
+
if (__classPrivateFieldGet2(this, _PQueue_pending, "f") === 0 && __classPrivateFieldGet2(this, _PQueue_queue, "f").size === 0) {
|
|
1310
|
+
return;
|
|
3532
1311
|
}
|
|
3533
|
-
|
|
3534
|
-
found.forEach((item) => {
|
|
3535
|
-
item = item.replaceAll("{", "").replaceAll("}", "");
|
|
3536
|
-
const pathParam = replacer ? replacer(transformers_default.camelCase(item)) : transformers_default.camelCase(item);
|
|
3537
|
-
params[pathParam] = pathParam;
|
|
3538
|
-
}, this.path);
|
|
3539
|
-
return params;
|
|
1312
|
+
await __classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_onEvent).call(this, "idle");
|
|
3540
1313
|
}
|
|
3541
1314
|
/**
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
1315
|
+
Size of the queue, the number of queued items waiting to run.
|
|
1316
|
+
*/
|
|
1317
|
+
get size() {
|
|
1318
|
+
return __classPrivateFieldGet2(this, _PQueue_queue, "f").size;
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
Size of the queue, filtered by the given options.
|
|
1322
|
+
|
|
1323
|
+
For example, this can be used to find the number of items remaining in the queue with a specific priority level.
|
|
1324
|
+
*/
|
|
1325
|
+
sizeBy(options) {
|
|
1326
|
+
return __classPrivateFieldGet2(this, _PQueue_queue, "f").filter(options).length;
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
Number of running items (no longer in the queue).
|
|
1330
|
+
*/
|
|
1331
|
+
get pending() {
|
|
1332
|
+
return __classPrivateFieldGet2(this, _PQueue_pending, "f");
|
|
1333
|
+
}
|
|
1334
|
+
/**
|
|
1335
|
+
Whether the queue is currently paused.
|
|
1336
|
+
*/
|
|
1337
|
+
get isPaused() {
|
|
1338
|
+
return __classPrivateFieldGet2(this, _PQueue_isPaused, "f");
|
|
3547
1339
|
}
|
|
3548
1340
|
};
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
try {
|
|
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" });
|
|
3576
|
-
if (oldContent?.toString() === data?.toString()) {
|
|
3577
|
-
return;
|
|
3578
|
-
}
|
|
3579
|
-
} catch (_err) {
|
|
1341
|
+
_PQueue_carryoverConcurrencyCount = /* @__PURE__ */ new WeakMap(), _PQueue_isIntervalIgnored = /* @__PURE__ */ new WeakMap(), _PQueue_intervalCount = /* @__PURE__ */ new WeakMap(), _PQueue_intervalCap = /* @__PURE__ */ new WeakMap(), _PQueue_interval = /* @__PURE__ */ new WeakMap(), _PQueue_intervalEnd = /* @__PURE__ */ new WeakMap(), _PQueue_intervalId = /* @__PURE__ */ new WeakMap(), _PQueue_timeoutId = /* @__PURE__ */ new WeakMap(), _PQueue_queue = /* @__PURE__ */ new WeakMap(), _PQueue_queueClass = /* @__PURE__ */ new WeakMap(), _PQueue_pending = /* @__PURE__ */ new WeakMap(), _PQueue_concurrency = /* @__PURE__ */ new WeakMap(), _PQueue_isPaused = /* @__PURE__ */ new WeakMap(), _PQueue_throwOnTimeout = /* @__PURE__ */ new WeakMap(), _PQueue_instances = /* @__PURE__ */ new WeakSet(), _PQueue_doesIntervalAllowAnother_get = function _PQueue_doesIntervalAllowAnother_get2() {
|
|
1342
|
+
return __classPrivateFieldGet2(this, _PQueue_isIntervalIgnored, "f") || __classPrivateFieldGet2(this, _PQueue_intervalCount, "f") < __classPrivateFieldGet2(this, _PQueue_intervalCap, "f");
|
|
1343
|
+
}, _PQueue_doesConcurrentAllowAnother_get = function _PQueue_doesConcurrentAllowAnother_get2() {
|
|
1344
|
+
return __classPrivateFieldGet2(this, _PQueue_pending, "f") < __classPrivateFieldGet2(this, _PQueue_concurrency, "f");
|
|
1345
|
+
}, _PQueue_next = function _PQueue_next2() {
|
|
1346
|
+
var _a;
|
|
1347
|
+
__classPrivateFieldSet(this, _PQueue_pending, (_a = __classPrivateFieldGet2(this, _PQueue_pending, "f"), _a--, _a), "f");
|
|
1348
|
+
__classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_tryToStartAnother).call(this);
|
|
1349
|
+
this.emit("next");
|
|
1350
|
+
}, _PQueue_onResumeInterval = function _PQueue_onResumeInterval2() {
|
|
1351
|
+
__classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_onInterval).call(this);
|
|
1352
|
+
__classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_initializeIntervalIfNeeded).call(this);
|
|
1353
|
+
__classPrivateFieldSet(this, _PQueue_timeoutId, void 0, "f");
|
|
1354
|
+
}, _PQueue_isIntervalPaused_get = function _PQueue_isIntervalPaused_get2() {
|
|
1355
|
+
const now = Date.now();
|
|
1356
|
+
if (__classPrivateFieldGet2(this, _PQueue_intervalId, "f") === void 0) {
|
|
1357
|
+
const delay = __classPrivateFieldGet2(this, _PQueue_intervalEnd, "f") - now;
|
|
1358
|
+
if (delay < 0) {
|
|
1359
|
+
__classPrivateFieldSet(this, _PQueue_intervalCount, __classPrivateFieldGet2(this, _PQueue_carryoverConcurrencyCount, "f") ? __classPrivateFieldGet2(this, _PQueue_pending, "f") : 0, "f");
|
|
1360
|
+
} else {
|
|
1361
|
+
if (__classPrivateFieldGet2(this, _PQueue_timeoutId, "f") === void 0) {
|
|
1362
|
+
__classPrivateFieldSet(this, _PQueue_timeoutId, setTimeout(() => {
|
|
1363
|
+
__classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_onResumeInterval).call(this);
|
|
1364
|
+
}, delay), "f");
|
|
3580
1365
|
}
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
1366
|
+
return true;
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
return false;
|
|
1370
|
+
}, _PQueue_tryToStartAnother = function _PQueue_tryToStartAnother2() {
|
|
1371
|
+
if (__classPrivateFieldGet2(this, _PQueue_queue, "f").size === 0) {
|
|
1372
|
+
if (__classPrivateFieldGet2(this, _PQueue_intervalId, "f")) {
|
|
1373
|
+
clearInterval(__classPrivateFieldGet2(this, _PQueue_intervalId, "f"));
|
|
1374
|
+
}
|
|
1375
|
+
__classPrivateFieldSet(this, _PQueue_intervalId, void 0, "f");
|
|
1376
|
+
this.emit("empty");
|
|
1377
|
+
if (__classPrivateFieldGet2(this, _PQueue_pending, "f") === 0) {
|
|
1378
|
+
this.emit("idle");
|
|
1379
|
+
}
|
|
1380
|
+
return false;
|
|
1381
|
+
}
|
|
1382
|
+
if (!__classPrivateFieldGet2(this, _PQueue_isPaused, "f")) {
|
|
1383
|
+
const canInitializeInterval = !__classPrivateFieldGet2(this, _PQueue_instances, "a", _PQueue_isIntervalPaused_get);
|
|
1384
|
+
if (__classPrivateFieldGet2(this, _PQueue_instances, "a", _PQueue_doesIntervalAllowAnother_get) && __classPrivateFieldGet2(this, _PQueue_instances, "a", _PQueue_doesConcurrentAllowAnother_get)) {
|
|
1385
|
+
const job = __classPrivateFieldGet2(this, _PQueue_queue, "f").dequeue();
|
|
1386
|
+
if (!job) {
|
|
1387
|
+
return false;
|
|
3593
1388
|
}
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
await saveCreateDirectory(path5);
|
|
3599
|
-
await Bun.write(path4.resolve(path5), data);
|
|
3600
|
-
const file = Bun.file(path4.resolve(path5));
|
|
3601
|
-
const savedData = await file.text();
|
|
3602
|
-
if (savedData?.toString() !== data?.toString()) {
|
|
3603
|
-
throw new Error(`Sanity check failed for ${path5}
|
|
3604
|
-
|
|
3605
|
-
Data[${data.length}]:
|
|
3606
|
-
${data}
|
|
3607
|
-
|
|
3608
|
-
Saved[${savedData.length}]:
|
|
3609
|
-
${savedData}
|
|
3610
|
-
`);
|
|
3611
|
-
}
|
|
3612
|
-
return savedData;
|
|
3613
|
-
} catch (e) {
|
|
3614
|
-
console.log(e, path4.resolve(path5));
|
|
1389
|
+
this.emit("active");
|
|
1390
|
+
job();
|
|
1391
|
+
if (canInitializeInterval) {
|
|
1392
|
+
__classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_initializeIntervalIfNeeded).call(this);
|
|
3615
1393
|
}
|
|
1394
|
+
return true;
|
|
3616
1395
|
}
|
|
3617
|
-
},
|
|
3618
|
-
"node"
|
|
3619
|
-
);
|
|
3620
|
-
async function write(data, path5) {
|
|
3621
|
-
if (data.trim() === "") {
|
|
3622
|
-
return void 0;
|
|
3623
1396
|
}
|
|
3624
|
-
return
|
|
3625
|
-
}
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
1397
|
+
return false;
|
|
1398
|
+
}, _PQueue_initializeIntervalIfNeeded = function _PQueue_initializeIntervalIfNeeded2() {
|
|
1399
|
+
if (__classPrivateFieldGet2(this, _PQueue_isIntervalIgnored, "f") || __classPrivateFieldGet2(this, _PQueue_intervalId, "f") !== void 0) {
|
|
1400
|
+
return;
|
|
1401
|
+
}
|
|
1402
|
+
__classPrivateFieldSet(this, _PQueue_intervalId, setInterval(() => {
|
|
1403
|
+
__classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_onInterval).call(this);
|
|
1404
|
+
}, __classPrivateFieldGet2(this, _PQueue_interval, "f")), "f");
|
|
1405
|
+
__classPrivateFieldSet(this, _PQueue_intervalEnd, Date.now() + __classPrivateFieldGet2(this, _PQueue_interval, "f"), "f");
|
|
1406
|
+
}, _PQueue_onInterval = function _PQueue_onInterval2() {
|
|
1407
|
+
if (__classPrivateFieldGet2(this, _PQueue_intervalCount, "f") === 0 && __classPrivateFieldGet2(this, _PQueue_pending, "f") === 0 && __classPrivateFieldGet2(this, _PQueue_intervalId, "f")) {
|
|
1408
|
+
clearInterval(__classPrivateFieldGet2(this, _PQueue_intervalId, "f"));
|
|
1409
|
+
__classPrivateFieldSet(this, _PQueue_intervalId, void 0, "f");
|
|
1410
|
+
}
|
|
1411
|
+
__classPrivateFieldSet(this, _PQueue_intervalCount, __classPrivateFieldGet2(this, _PQueue_carryoverConcurrencyCount, "f") ? __classPrivateFieldGet2(this, _PQueue_pending, "f") : 0, "f");
|
|
1412
|
+
__classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_processQueue).call(this);
|
|
1413
|
+
}, _PQueue_processQueue = function _PQueue_processQueue2() {
|
|
1414
|
+
while (__classPrivateFieldGet2(this, _PQueue_instances, "m", _PQueue_tryToStartAnother).call(this)) {
|
|
1415
|
+
}
|
|
1416
|
+
}, _PQueue_throwOnAbort = async function _PQueue_throwOnAbort2(signal) {
|
|
1417
|
+
return new Promise((_resolve, reject) => {
|
|
1418
|
+
signal.addEventListener("abort", () => {
|
|
1419
|
+
reject(new AbortError2("The task was aborted."));
|
|
1420
|
+
}, { once: true });
|
|
3634
1421
|
});
|
|
3635
|
-
}
|
|
1422
|
+
}, _PQueue_onEvent = async function _PQueue_onEvent2(event, filter) {
|
|
1423
|
+
return new Promise((resolve2) => {
|
|
1424
|
+
const listener = () => {
|
|
1425
|
+
if (filter && !filter()) {
|
|
1426
|
+
return;
|
|
1427
|
+
}
|
|
1428
|
+
this.off(event, listener);
|
|
1429
|
+
resolve2();
|
|
1430
|
+
};
|
|
1431
|
+
this.on(event, listener);
|
|
1432
|
+
});
|
|
1433
|
+
};
|
|
1434
|
+
var dist_default = PQueue;
|
|
3636
1435
|
|
|
3637
1436
|
// src/BarrelManager.ts
|
|
3638
|
-
init_cjs_shims();
|
|
1437
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
3639
1438
|
|
|
3640
1439
|
// src/utils/TreeNode.ts
|
|
3641
|
-
init_cjs_shims();
|
|
1440
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
3642
1441
|
var TreeNode = class _TreeNode {
|
|
3643
1442
|
constructor(data, parent) {
|
|
3644
1443
|
this.children = [];
|
|
@@ -3729,12 +1528,12 @@ var TreeNode = class _TreeNode {
|
|
|
3729
1528
|
var _options;
|
|
3730
1529
|
var BarrelManager = class {
|
|
3731
1530
|
constructor(options = {}) {
|
|
3732
|
-
__privateAdd(this, _options, void 0);
|
|
3733
|
-
__privateSet(this, _options, options);
|
|
1531
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _options, void 0);
|
|
1532
|
+
chunkMM42A6GN_cjs.__privateSet(this, _options, options);
|
|
3734
1533
|
return this;
|
|
3735
1534
|
}
|
|
3736
1535
|
getIndexes(pathToBuild) {
|
|
3737
|
-
const { treeNode = {}, isTypeOnly, extName } = __privateGet(this, _options);
|
|
1536
|
+
const { treeNode = {}, isTypeOnly, extName } = chunkMM42A6GN_cjs.__privateGet(this, _options);
|
|
3738
1537
|
const tree = TreeNode.build(pathToBuild, treeNode);
|
|
3739
1538
|
if (!tree) {
|
|
3740
1539
|
return null;
|
|
@@ -3746,7 +1545,7 @@ var BarrelManager = class {
|
|
|
3746
1545
|
if (treeNode2.children.length > 1) {
|
|
3747
1546
|
const indexPath = path4__default.default.resolve(treeNode2.data.path, "index.ts");
|
|
3748
1547
|
const exports = treeNode2.children.filter(Boolean).map((file) => {
|
|
3749
|
-
const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${
|
|
1548
|
+
const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${chunkU4C2WTCI_cjs.trimExtName(file.data.name)}`;
|
|
3750
1549
|
if (importPath.endsWith("index") && file.data.type === "file") {
|
|
3751
1550
|
return void 0;
|
|
3752
1551
|
}
|
|
@@ -3767,7 +1566,7 @@ var BarrelManager = class {
|
|
|
3767
1566
|
} else if (treeNode2.children.length === 1) {
|
|
3768
1567
|
const [treeNodeChild] = treeNode2.children;
|
|
3769
1568
|
const indexPath = path4__default.default.resolve(treeNode2.data.path, "index.ts");
|
|
3770
|
-
const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${
|
|
1569
|
+
const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${chunkU4C2WTCI_cjs.trimExtName(treeNodeChild.data.name)}`;
|
|
3771
1570
|
const exports = [
|
|
3772
1571
|
{
|
|
3773
1572
|
path: extName ? `${importPath}${extName}` : importPath,
|
|
@@ -3798,43 +1597,34 @@ _options = new WeakMap();
|
|
|
3798
1597
|
exports.KubbFile = void 0;
|
|
3799
1598
|
((KubbFile2) => {
|
|
3800
1599
|
})(exports.KubbFile || (exports.KubbFile = {}));
|
|
3801
|
-
var _cache, _task,
|
|
1600
|
+
var _cache, _task, _queue, _add, add_fn, _addOrAppend, addOrAppend_fn;
|
|
3802
1601
|
var _FileManager = class _FileManager {
|
|
3803
|
-
constructor(
|
|
3804
|
-
__privateAdd(this,
|
|
3805
|
-
__privateAdd(this,
|
|
3806
|
-
__privateAdd(this,
|
|
3807
|
-
__privateAdd(this,
|
|
3808
|
-
__privateAdd(this,
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
* Timeout between writes
|
|
3812
|
-
*/
|
|
3813
|
-
__privateAdd(this, _timeout, 0);
|
|
3814
|
-
__privateAdd(this, _queue, void 0);
|
|
3815
|
-
if (options) {
|
|
3816
|
-
__privateSet(this, _task, options.task);
|
|
3817
|
-
__privateSet(this, _queue, options.queue);
|
|
3818
|
-
__privateSet(this, _timeout, options.timeout || 0);
|
|
3819
|
-
}
|
|
1602
|
+
constructor({ task = async (file) => file, queue = new dist_default() } = {}) {
|
|
1603
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _add);
|
|
1604
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _addOrAppend);
|
|
1605
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _cache, /* @__PURE__ */ new Map());
|
|
1606
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _task, void 0);
|
|
1607
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _queue, void 0);
|
|
1608
|
+
chunkMM42A6GN_cjs.__privateSet(this, _task, task);
|
|
1609
|
+
chunkMM42A6GN_cjs.__privateSet(this, _queue, queue);
|
|
3820
1610
|
return this;
|
|
3821
1611
|
}
|
|
3822
1612
|
get files() {
|
|
3823
1613
|
const files = [];
|
|
3824
|
-
__privateGet(this, _cache).forEach((item) => {
|
|
1614
|
+
chunkMM42A6GN_cjs.__privateGet(this, _cache).forEach((item) => {
|
|
3825
1615
|
files.push(...item.flat(1));
|
|
3826
1616
|
});
|
|
3827
1617
|
return files;
|
|
3828
1618
|
}
|
|
3829
1619
|
get isExecuting() {
|
|
3830
|
-
return __privateGet(this, _queue)
|
|
1620
|
+
return chunkMM42A6GN_cjs.__privateGet(this, _queue).size !== 0 && chunkMM42A6GN_cjs.__privateGet(this, _queue).pending !== 0;
|
|
3831
1621
|
}
|
|
3832
1622
|
async add(...files) {
|
|
3833
|
-
const promises = files.map((file) => {
|
|
1623
|
+
const promises = combineFiles(files).map((file) => {
|
|
3834
1624
|
if (file.override) {
|
|
3835
|
-
return __privateMethod(this, _add, add_fn).call(this, file);
|
|
1625
|
+
return chunkMM42A6GN_cjs.__privateMethod(this, _add, add_fn).call(this, file);
|
|
3836
1626
|
}
|
|
3837
|
-
return __privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, file);
|
|
1627
|
+
return chunkMM42A6GN_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, file);
|
|
3838
1628
|
});
|
|
3839
1629
|
const resolvedFiles = await Promise.all(promises);
|
|
3840
1630
|
if (files.length > 1) {
|
|
@@ -3847,7 +1637,7 @@ var _FileManager = class _FileManager {
|
|
|
3847
1637
|
if (!exportType) {
|
|
3848
1638
|
return void 0;
|
|
3849
1639
|
}
|
|
3850
|
-
const exportPath = output.path.startsWith("./") ? output.path : `./${output.path}`;
|
|
1640
|
+
const exportPath = output.path.startsWith("./") ? chunkU4C2WTCI_cjs.trimExtName(output.path) : `./${chunkU4C2WTCI_cjs.trimExtName(output.path)}`;
|
|
3851
1641
|
const barrelManager = new BarrelManager({ extName: output.extName, ...options });
|
|
3852
1642
|
const files = barrelManager.getIndexes(path4.resolve(root, output.path));
|
|
3853
1643
|
if (!files) {
|
|
@@ -3861,21 +1651,21 @@ var _FileManager = class _FileManager {
|
|
|
3861
1651
|
output.exportAs ? {
|
|
3862
1652
|
name: output.exportAs,
|
|
3863
1653
|
asAlias: true,
|
|
3864
|
-
path: exportPath,
|
|
1654
|
+
path: output.extName ? `${exportPath}${output.extName}` : exportPath,
|
|
3865
1655
|
isTypeOnly: options.isTypeOnly
|
|
3866
1656
|
} : {
|
|
3867
|
-
path: exportPath,
|
|
1657
|
+
path: output.extName ? `${exportPath}${output.extName}` : exportPath,
|
|
3868
1658
|
isTypeOnly: options.isTypeOnly
|
|
3869
1659
|
}
|
|
3870
1660
|
]
|
|
3871
1661
|
};
|
|
3872
|
-
await __privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
1662
|
+
await chunkMM42A6GN_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
3873
1663
|
...rootFile,
|
|
3874
1664
|
meta: meta ? meta : rootFile.meta
|
|
3875
1665
|
});
|
|
3876
1666
|
return await Promise.all(
|
|
3877
1667
|
files.map((file) => {
|
|
3878
|
-
return __privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
1668
|
+
return chunkMM42A6GN_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
3879
1669
|
...file,
|
|
3880
1670
|
meta: meta ? meta : file.meta
|
|
3881
1671
|
});
|
|
@@ -3884,38 +1674,34 @@ var _FileManager = class _FileManager {
|
|
|
3884
1674
|
}
|
|
3885
1675
|
getCacheByUUID(UUID) {
|
|
3886
1676
|
let cache;
|
|
3887
|
-
__privateGet(this, _cache).forEach((files) => {
|
|
1677
|
+
chunkMM42A6GN_cjs.__privateGet(this, _cache).forEach((files) => {
|
|
3888
1678
|
cache = files.find((item) => item.id === UUID);
|
|
3889
1679
|
});
|
|
3890
1680
|
return cache;
|
|
3891
1681
|
}
|
|
3892
1682
|
get(path5) {
|
|
3893
|
-
return __privateGet(this, _cache).get(path5);
|
|
1683
|
+
return chunkMM42A6GN_cjs.__privateGet(this, _cache).get(path5);
|
|
3894
1684
|
}
|
|
3895
1685
|
remove(path5) {
|
|
3896
1686
|
const cacheItem = this.get(path5);
|
|
3897
1687
|
if (!cacheItem) {
|
|
3898
1688
|
return;
|
|
3899
1689
|
}
|
|
3900
|
-
__privateGet(this, _cache).delete(path5);
|
|
1690
|
+
chunkMM42A6GN_cjs.__privateGet(this, _cache).delete(path5);
|
|
3901
1691
|
}
|
|
3902
1692
|
async write(...params) {
|
|
3903
|
-
|
|
3904
|
-
__privateSet(this, _isWriting, true);
|
|
3905
|
-
const text = await write(...params);
|
|
3906
|
-
__privateSet(this, _isWriting, false);
|
|
3907
|
-
return text;
|
|
3908
|
-
}
|
|
3909
|
-
await timeout(__privateGet(this, _timeout));
|
|
3910
|
-
return this.write(...params);
|
|
1693
|
+
return chunkICRPOCV4_cjs.write(...params);
|
|
3911
1694
|
}
|
|
3912
1695
|
async read(...params) {
|
|
3913
|
-
return read(...params);
|
|
1696
|
+
return chunk35FDNG5F_cjs.read(...params);
|
|
3914
1697
|
}
|
|
3915
1698
|
// statics
|
|
3916
1699
|
static getSource(file) {
|
|
3917
1700
|
return getSource(file);
|
|
3918
1701
|
}
|
|
1702
|
+
static combineFiles(files) {
|
|
1703
|
+
return combineFiles(files);
|
|
1704
|
+
}
|
|
3919
1705
|
static getMode(path5) {
|
|
3920
1706
|
if (!path5) {
|
|
3921
1707
|
return "directory";
|
|
@@ -3931,33 +1717,27 @@ var _FileManager = class _FileManager {
|
|
|
3931
1717
|
};
|
|
3932
1718
|
_cache = new WeakMap();
|
|
3933
1719
|
_task = new WeakMap();
|
|
3934
|
-
_isWriting = new WeakMap();
|
|
3935
|
-
_timeout = new WeakMap();
|
|
3936
1720
|
_queue = new WeakMap();
|
|
3937
|
-
_validate = new WeakSet();
|
|
3938
1721
|
_add = new WeakSet();
|
|
3939
1722
|
add_fn = async function(file) {
|
|
3940
1723
|
const controller = new AbortController();
|
|
3941
|
-
const resolvedFile = { id:
|
|
3942
|
-
__privateGet(this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
);
|
|
3951
|
-
}
|
|
3952
|
-
return resolvedFile;
|
|
1724
|
+
const resolvedFile = { id: crypto__default.default.randomUUID(), name: chunkU4C2WTCI_cjs.trimExtName(file.baseName), ...file };
|
|
1725
|
+
chunkMM42A6GN_cjs.__privateGet(this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
|
|
1726
|
+
return chunkMM42A6GN_cjs.__privateGet(this, _queue).add(
|
|
1727
|
+
async () => {
|
|
1728
|
+
var _a;
|
|
1729
|
+
return (_a = chunkMM42A6GN_cjs.__privateGet(this, _task)) == null ? void 0 : _a.call(this, resolvedFile);
|
|
1730
|
+
},
|
|
1731
|
+
{ signal: controller.signal }
|
|
1732
|
+
);
|
|
3953
1733
|
};
|
|
3954
1734
|
_addOrAppend = new WeakSet();
|
|
3955
1735
|
addOrAppend_fn = async function(file) {
|
|
3956
|
-
const previousCaches = __privateGet(this, _cache).get(file.path);
|
|
1736
|
+
const previousCaches = chunkMM42A6GN_cjs.__privateGet(this, _cache).get(file.path);
|
|
3957
1737
|
const previousCache = previousCaches ? previousCaches.at(previousCaches.length - 1) : void 0;
|
|
3958
1738
|
if (previousCache) {
|
|
3959
|
-
__privateGet(this, _cache).delete(previousCache.path);
|
|
3960
|
-
return __privateMethod(this, _add, add_fn).call(this, {
|
|
1739
|
+
chunkMM42A6GN_cjs.__privateGet(this, _cache).delete(previousCache.path);
|
|
1740
|
+
return chunkMM42A6GN_cjs.__privateMethod(this, _add, add_fn).call(this, {
|
|
3961
1741
|
...file,
|
|
3962
1742
|
source: previousCache.source && file.source ? `${previousCache.source}
|
|
3963
1743
|
${file.source}` : "",
|
|
@@ -3966,9 +1746,37 @@ ${file.source}` : "",
|
|
|
3966
1746
|
env: { ...previousCache.env || {}, ...file.env || {} }
|
|
3967
1747
|
});
|
|
3968
1748
|
}
|
|
3969
|
-
return __privateMethod(this, _add, add_fn).call(this, file);
|
|
1749
|
+
return chunkMM42A6GN_cjs.__privateMethod(this, _add, add_fn).call(this, file);
|
|
3970
1750
|
};
|
|
3971
1751
|
var FileManager = _FileManager;
|
|
1752
|
+
function combineFiles(files) {
|
|
1753
|
+
return files.filter(Boolean).reduce((acc, file) => {
|
|
1754
|
+
const prevIndex = acc.findIndex((item) => item.path === file.path);
|
|
1755
|
+
if (prevIndex === -1) {
|
|
1756
|
+
return [...acc, file];
|
|
1757
|
+
}
|
|
1758
|
+
const prev = acc[prevIndex];
|
|
1759
|
+
if (prev && file.override) {
|
|
1760
|
+
acc[prevIndex] = {
|
|
1761
|
+
imports: [],
|
|
1762
|
+
exports: [],
|
|
1763
|
+
...file
|
|
1764
|
+
};
|
|
1765
|
+
return acc;
|
|
1766
|
+
}
|
|
1767
|
+
if (prev) {
|
|
1768
|
+
acc[prevIndex] = {
|
|
1769
|
+
...file,
|
|
1770
|
+
source: prev.source && file.source ? `${prev.source}
|
|
1771
|
+
${file.source}` : "",
|
|
1772
|
+
imports: [...prev.imports || [], ...file.imports || []],
|
|
1773
|
+
exports: [...prev.exports || [], ...file.exports || []],
|
|
1774
|
+
env: { ...prev.env || {}, ...file.env || {} }
|
|
1775
|
+
};
|
|
1776
|
+
}
|
|
1777
|
+
return acc;
|
|
1778
|
+
}, []);
|
|
1779
|
+
}
|
|
3972
1780
|
function getSource(file) {
|
|
3973
1781
|
if (!FileManager.isExtensionAllowed(file.baseName)) {
|
|
3974
1782
|
return file.source;
|
|
@@ -3976,11 +1784,11 @@ function getSource(file) {
|
|
|
3976
1784
|
const exports = file.exports ? combineExports(file.exports) : [];
|
|
3977
1785
|
const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
|
|
3978
1786
|
const importNodes = imports.filter((item) => {
|
|
3979
|
-
return item.path !==
|
|
1787
|
+
return item.path !== chunkU4C2WTCI_cjs.trimExtName(file.path);
|
|
3980
1788
|
}).map((item) => {
|
|
3981
1789
|
return factory__namespace.createImportDeclaration({
|
|
3982
1790
|
name: item.name,
|
|
3983
|
-
path: item.root ? getRelativePath(item.root, item.path) : item.path,
|
|
1791
|
+
path: item.root ? chunk35FDNG5F_cjs.getRelativePath(item.root, item.path) : item.path,
|
|
3984
1792
|
isTypeOnly: item.isTypeOnly
|
|
3985
1793
|
});
|
|
3986
1794
|
});
|
|
@@ -4082,198 +1890,42 @@ function getEnvSource(source, env) {
|
|
|
4082
1890
|
throw new TypeError(`Environment should be in upperCase for ${key}`);
|
|
4083
1891
|
}
|
|
4084
1892
|
if (typeof replaceBy === "string") {
|
|
4085
|
-
prev =
|
|
4086
|
-
prev =
|
|
1893
|
+
prev = chunkU4C2WTCI_cjs.searchAndReplace({ text: prev.replaceAll(`process.env.${key}`, replaceBy), replaceBy, prefix: "process.env", key });
|
|
1894
|
+
prev = chunkU4C2WTCI_cjs.searchAndReplace({ text: prev.replaceAll(new RegExp(`(declare const).*
|
|
4087
1895
|
`, "ig"), ""), replaceBy, key });
|
|
4088
1896
|
}
|
|
4089
1897
|
return prev;
|
|
4090
1898
|
}, source);
|
|
4091
1899
|
}
|
|
4092
1900
|
|
|
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
1901
|
// src/PluginManager.ts
|
|
4165
|
-
init_cjs_shims();
|
|
1902
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
4166
1903
|
|
|
4167
1904
|
// src/utils/EventEmitter.ts
|
|
4168
|
-
init_cjs_shims();
|
|
1905
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
4169
1906
|
var _emitter;
|
|
4170
|
-
var
|
|
1907
|
+
var EventEmitter2 = class {
|
|
4171
1908
|
constructor() {
|
|
4172
|
-
__privateAdd(this, _emitter, new events.EventEmitter());
|
|
4173
|
-
__privateGet(this, _emitter).setMaxListeners(100);
|
|
1909
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _emitter, new events.EventEmitter());
|
|
1910
|
+
chunkMM42A6GN_cjs.__privateGet(this, _emitter).setMaxListeners(100);
|
|
4174
1911
|
}
|
|
4175
1912
|
emit(eventName, ...eventArg) {
|
|
4176
|
-
__privateGet(this, _emitter).emit(eventName, ...eventArg);
|
|
1913
|
+
chunkMM42A6GN_cjs.__privateGet(this, _emitter).emit(eventName, ...eventArg);
|
|
4177
1914
|
}
|
|
4178
1915
|
on(eventName, handler) {
|
|
4179
|
-
__privateGet(this, _emitter).on(eventName, handler);
|
|
1916
|
+
chunkMM42A6GN_cjs.__privateGet(this, _emitter).on(eventName, handler);
|
|
4180
1917
|
}
|
|
4181
1918
|
off(eventName, handler) {
|
|
4182
|
-
__privateGet(this, _emitter).off(eventName, handler);
|
|
1919
|
+
chunkMM42A6GN_cjs.__privateGet(this, _emitter).off(eventName, handler);
|
|
4183
1920
|
}
|
|
4184
1921
|
removeAll() {
|
|
4185
|
-
__privateGet(this, _emitter).removeAllListeners();
|
|
1922
|
+
chunkMM42A6GN_cjs.__privateGet(this, _emitter).removeAllListeners();
|
|
4186
1923
|
}
|
|
4187
1924
|
};
|
|
4188
1925
|
_emitter = new WeakMap();
|
|
4189
1926
|
|
|
4190
|
-
// src/utils/Queue.ts
|
|
4191
|
-
init_cjs_shims();
|
|
4192
|
-
var _queue2, _workerCount, _maxParallel, _debug, _work, work_fn;
|
|
4193
|
-
var Queue = class {
|
|
4194
|
-
constructor(maxParallel, debug = false) {
|
|
4195
|
-
__privateAdd(this, _work);
|
|
4196
|
-
__privateAdd(this, _queue2, []);
|
|
4197
|
-
this.eventEmitter = new EventEmitter();
|
|
4198
|
-
__privateAdd(this, _workerCount, 0);
|
|
4199
|
-
__privateAdd(this, _maxParallel, void 0);
|
|
4200
|
-
__privateAdd(this, _debug, false);
|
|
4201
|
-
__privateSet(this, _maxParallel, maxParallel);
|
|
4202
|
-
__privateSet(this, _debug, debug);
|
|
4203
|
-
}
|
|
4204
|
-
run(job, options = { controller: new AbortController(), name: crypto2__default.default.randomUUID(), description: "" }) {
|
|
4205
|
-
return new Promise((resolve3, reject) => {
|
|
4206
|
-
const item = { reject, resolve: resolve3, job, name: options.name, description: options.description || options.name };
|
|
4207
|
-
options.controller?.signal.addEventListener("abort", () => {
|
|
4208
|
-
__privateSet(this, _queue2, __privateGet(this, _queue2).filter((queueItem) => queueItem.name === item.name));
|
|
4209
|
-
reject("Aborted");
|
|
4210
|
-
});
|
|
4211
|
-
__privateGet(this, _queue2).push(item);
|
|
4212
|
-
__privateMethod(this, _work, work_fn).call(this);
|
|
4213
|
-
});
|
|
4214
|
-
}
|
|
4215
|
-
runSync(job, options = { controller: new AbortController(), name: crypto2__default.default.randomUUID(), description: "" }) {
|
|
4216
|
-
new Promise((resolve3, reject) => {
|
|
4217
|
-
const item = { reject, resolve: resolve3, job, name: options.name, description: options.description || options.name };
|
|
4218
|
-
options.controller?.signal.addEventListener("abort", () => {
|
|
4219
|
-
__privateSet(this, _queue2, __privateGet(this, _queue2).filter((queueItem) => queueItem.name === item.name));
|
|
4220
|
-
});
|
|
4221
|
-
__privateGet(this, _queue2).push(item);
|
|
4222
|
-
__privateMethod(this, _work, work_fn).call(this);
|
|
4223
|
-
});
|
|
4224
|
-
}
|
|
4225
|
-
get hasJobs() {
|
|
4226
|
-
return __privateGet(this, _workerCount) > 0 || __privateGet(this, _queue2).length > 0;
|
|
4227
|
-
}
|
|
4228
|
-
get count() {
|
|
4229
|
-
return __privateGet(this, _workerCount);
|
|
4230
|
-
}
|
|
4231
|
-
};
|
|
4232
|
-
_queue2 = new WeakMap();
|
|
4233
|
-
_workerCount = new WeakMap();
|
|
4234
|
-
_maxParallel = new WeakMap();
|
|
4235
|
-
_debug = new WeakMap();
|
|
4236
|
-
_work = new WeakSet();
|
|
4237
|
-
work_fn = function() {
|
|
4238
|
-
if (__privateGet(this, _workerCount) >= __privateGet(this, _maxParallel)) {
|
|
4239
|
-
return;
|
|
4240
|
-
}
|
|
4241
|
-
__privateWrapper(this, _workerCount)._++;
|
|
4242
|
-
let entry;
|
|
4243
|
-
while (entry = __privateGet(this, _queue2).shift()) {
|
|
4244
|
-
const { reject, resolve: resolve3, job, name, description } = entry;
|
|
4245
|
-
if (__privateGet(this, _debug)) {
|
|
4246
|
-
perf_hooks.performance.mark(name + "_start");
|
|
4247
|
-
}
|
|
4248
|
-
job().then((result) => {
|
|
4249
|
-
this.eventEmitter.emit("jobDone", result);
|
|
4250
|
-
resolve3(result);
|
|
4251
|
-
if (__privateGet(this, _debug)) {
|
|
4252
|
-
perf_hooks.performance.mark(name + "_stop");
|
|
4253
|
-
perf_hooks.performance.measure(description, name + "_start", name + "_stop");
|
|
4254
|
-
}
|
|
4255
|
-
}).catch((err) => {
|
|
4256
|
-
this.eventEmitter.emit("jobFailed", err);
|
|
4257
|
-
reject(err);
|
|
4258
|
-
});
|
|
4259
|
-
}
|
|
4260
|
-
__privateWrapper(this, _workerCount)._--;
|
|
4261
|
-
};
|
|
4262
|
-
|
|
4263
|
-
// src/utils/uniqueName.ts
|
|
4264
|
-
init_cjs_shims();
|
|
4265
|
-
function setUniqueName(originalName, data) {
|
|
4266
|
-
let used = data[originalName] || 0;
|
|
4267
|
-
if (used) {
|
|
4268
|
-
data[originalName] = ++used;
|
|
4269
|
-
return originalName;
|
|
4270
|
-
}
|
|
4271
|
-
data[originalName] = 1;
|
|
4272
|
-
return originalName;
|
|
4273
|
-
}
|
|
4274
|
-
|
|
4275
1927
|
// src/errors.ts
|
|
4276
|
-
init_cjs_shims();
|
|
1928
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
4277
1929
|
var Warning = class extends Error {
|
|
4278
1930
|
constructor(message, options) {
|
|
4279
1931
|
super(message, { cause: options?.cause });
|
|
@@ -4284,10 +1936,10 @@ var ValidationPluginError = class extends Error {
|
|
|
4284
1936
|
};
|
|
4285
1937
|
|
|
4286
1938
|
// src/plugin.ts
|
|
4287
|
-
init_cjs_shims();
|
|
1939
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
4288
1940
|
|
|
4289
1941
|
// src/utils/cache.ts
|
|
4290
|
-
init_cjs_shims();
|
|
1942
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
4291
1943
|
function createPluginCache(Store = /* @__PURE__ */ Object.create(null)) {
|
|
4292
1944
|
return {
|
|
4293
1945
|
set(id, value) {
|
|
@@ -4365,10 +2017,10 @@ var definePlugin = createPlugin((options) => {
|
|
|
4365
2017
|
});
|
|
4366
2018
|
|
|
4367
2019
|
// src/PromiseManager.ts
|
|
4368
|
-
init_cjs_shims();
|
|
2020
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
4369
2021
|
|
|
4370
2022
|
// src/utils/executeStrategies.ts
|
|
4371
|
-
init_cjs_shims();
|
|
2023
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
4372
2024
|
function hookSeq(promises) {
|
|
4373
2025
|
return promises.filter(Boolean).reduce(
|
|
4374
2026
|
(promise, func) => {
|
|
@@ -4406,8 +2058,8 @@ function hookParallel(promises) {
|
|
|
4406
2058
|
var _options2;
|
|
4407
2059
|
var PromiseManager = class {
|
|
4408
2060
|
constructor(options = {}) {
|
|
4409
|
-
__privateAdd(this, _options2, {});
|
|
4410
|
-
__privateSet(this, _options2, options);
|
|
2061
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _options2, {});
|
|
2062
|
+
chunkMM42A6GN_cjs.__privateSet(this, _options2, options);
|
|
4411
2063
|
return this;
|
|
4412
2064
|
}
|
|
4413
2065
|
run(strategy, promises) {
|
|
@@ -4415,7 +2067,7 @@ var PromiseManager = class {
|
|
|
4415
2067
|
return hookSeq(promises);
|
|
4416
2068
|
}
|
|
4417
2069
|
if (strategy === "first") {
|
|
4418
|
-
return hookFirst(promises, __privateGet(this, _options2).nullCheck);
|
|
2070
|
+
return hookFirst(promises, chunkMM42A6GN_cjs.__privateGet(this, _options2).nullCheck);
|
|
4419
2071
|
}
|
|
4420
2072
|
if (strategy === "parallel") {
|
|
4421
2073
|
return hookParallel(promises);
|
|
@@ -4435,8 +2087,8 @@ function isPromiseRejectedResult(result) {
|
|
|
4435
2087
|
var _core, _usedPluginNames, _promiseManager, _getSortedPlugins, getSortedPlugins_fn, _addExecutedToCallStack, addExecutedToCallStack_fn, _execute, execute_fn, _executeSync, executeSync_fn, _catcher, catcher_fn, _parse, parse_fn;
|
|
4436
2088
|
var PluginManager = class {
|
|
4437
2089
|
constructor(config, options) {
|
|
4438
|
-
__privateAdd(this, _getSortedPlugins);
|
|
4439
|
-
__privateAdd(this, _addExecutedToCallStack);
|
|
2090
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _getSortedPlugins);
|
|
2091
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _addExecutedToCallStack);
|
|
4440
2092
|
/**
|
|
4441
2093
|
* Run an async plugin hook and return the result.
|
|
4442
2094
|
* @param hookName Name of the plugin hook. Must be either in `PluginHooks` or `OutputPluginValueHooks`.
|
|
@@ -4444,7 +2096,7 @@ var PluginManager = class {
|
|
|
4444
2096
|
* @param plugin The actual pluginObject to run.
|
|
4445
2097
|
*/
|
|
4446
2098
|
// Implementation signature
|
|
4447
|
-
__privateAdd(this, _execute);
|
|
2099
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _execute);
|
|
4448
2100
|
/**
|
|
4449
2101
|
* Run a sync plugin hook and return the result.
|
|
4450
2102
|
* @param hookName Name of the plugin hook. Must be in `PluginHooks`.
|
|
@@ -4452,14 +2104,14 @@ var PluginManager = class {
|
|
|
4452
2104
|
* @param plugin The acutal plugin
|
|
4453
2105
|
* @param replaceContext When passed, the plugin context can be overridden.
|
|
4454
2106
|
*/
|
|
4455
|
-
__privateAdd(this, _executeSync);
|
|
4456
|
-
__privateAdd(this, _catcher);
|
|
4457
|
-
__privateAdd(this, _parse);
|
|
4458
|
-
this.events = new
|
|
2107
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _executeSync);
|
|
2108
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _catcher);
|
|
2109
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _parse);
|
|
2110
|
+
this.events = new EventEmitter2();
|
|
4459
2111
|
this.executed = [];
|
|
4460
|
-
__privateAdd(this, _core, void 0);
|
|
4461
|
-
__privateAdd(this, _usedPluginNames, {});
|
|
4462
|
-
__privateAdd(this, _promiseManager, void 0);
|
|
2112
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _core, void 0);
|
|
2113
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _usedPluginNames, {});
|
|
2114
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _promiseManager, void 0);
|
|
4463
2115
|
this.resolvePath = (params) => {
|
|
4464
2116
|
if (params.pluginKey) {
|
|
4465
2117
|
const paths = this.hookForPluginSync({
|
|
@@ -4467,8 +2119,8 @@ var PluginManager = class {
|
|
|
4467
2119
|
hookName: "resolvePath",
|
|
4468
2120
|
parameters: [params.baseName, params.directory, params.options]
|
|
4469
2121
|
});
|
|
4470
|
-
if (paths && paths?.length > 1 && this.logger.logLevel === LogLevel.debug) {
|
|
4471
|
-
this.logger.
|
|
2122
|
+
if (paths && paths?.length > 1 && this.logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.debug) {
|
|
2123
|
+
this.logger.debug(
|
|
4472
2124
|
`Cannot return a path where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
4473
2125
|
|
|
4474
2126
|
Paths: ${JSON.stringify(paths, void 0, 2)}
|
|
@@ -4491,8 +2143,8 @@ Falling back on the first item.
|
|
|
4491
2143
|
hookName: "resolveName",
|
|
4492
2144
|
parameters: [params.name, params.type]
|
|
4493
2145
|
});
|
|
4494
|
-
if (names && names?.length > 1 && this.logger.logLevel === LogLevel.debug) {
|
|
4495
|
-
this.logger.
|
|
2146
|
+
if (names && names?.length > 1 && this.logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.debug) {
|
|
2147
|
+
this.logger.debug(
|
|
4496
2148
|
`Cannot return a name where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
4497
2149
|
|
|
4498
2150
|
Names: ${JSON.stringify(names, void 0, 2)}
|
|
@@ -4501,19 +2153,19 @@ Falling back on the first item.
|
|
|
4501
2153
|
`
|
|
4502
2154
|
);
|
|
4503
2155
|
}
|
|
4504
|
-
return transformReservedWord(names?.at(0) || params.name);
|
|
2156
|
+
return chunkU4C2WTCI_cjs.transformReservedWord(names?.at(0) || params.name);
|
|
4505
2157
|
}
|
|
4506
2158
|
const name = this.hookFirstSync({
|
|
4507
2159
|
hookName: "resolveName",
|
|
4508
2160
|
parameters: [params.name, params.type]
|
|
4509
2161
|
}).result;
|
|
4510
|
-
return transformReservedWord(name);
|
|
2162
|
+
return chunkU4C2WTCI_cjs.transformReservedWord(name);
|
|
4511
2163
|
};
|
|
4512
2164
|
this.config = config;
|
|
4513
2165
|
this.logger = options.logger;
|
|
4514
|
-
this.queue = new
|
|
4515
|
-
this.fileManager = new FileManager({ task: options.task, queue: this.queue
|
|
4516
|
-
__privateSet(this, _promiseManager, new PromiseManager({ nullCheck: (state) => !!state?.result }));
|
|
2166
|
+
this.queue = new dist_default({ concurrency: 1 });
|
|
2167
|
+
this.fileManager = new FileManager({ task: options.task, queue: this.queue });
|
|
2168
|
+
chunkMM42A6GN_cjs.__privateSet(this, _promiseManager, new PromiseManager({ nullCheck: (state) => !!state?.result }));
|
|
4517
2169
|
const plugins = config.plugins || [];
|
|
4518
2170
|
const core = definePlugin({
|
|
4519
2171
|
config,
|
|
@@ -4522,11 +2174,11 @@ Falling back on the first item.
|
|
|
4522
2174
|
fileManager: this.fileManager,
|
|
4523
2175
|
resolvePath: this.resolvePath.bind(this),
|
|
4524
2176
|
resolveName: this.resolveName.bind(this),
|
|
4525
|
-
getPlugins: __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).bind(this)
|
|
2177
|
+
getPlugins: chunkMM42A6GN_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).bind(this)
|
|
4526
2178
|
});
|
|
4527
|
-
__privateSet(this, _core, __privateMethod(this, _parse, parse_fn).call(this, core, this, core.api.call(null)));
|
|
4528
|
-
this.plugins = [__privateGet(this, _core), ...plugins].map((plugin) => {
|
|
4529
|
-
return __privateMethod(this, _parse, parse_fn).call(this, plugin, this, __privateGet(this, _core).api);
|
|
2179
|
+
chunkMM42A6GN_cjs.__privateSet(this, _core, chunkMM42A6GN_cjs.__privateMethod(this, _parse, parse_fn).call(this, core, this, core.api.call(null)));
|
|
2180
|
+
this.plugins = [chunkMM42A6GN_cjs.__privateGet(this, _core), ...plugins].map((plugin) => {
|
|
2181
|
+
return chunkMM42A6GN_cjs.__privateMethod(this, _parse, parse_fn).call(this, plugin, this, chunkMM42A6GN_cjs.__privateGet(this, _core).api);
|
|
4530
2182
|
});
|
|
4531
2183
|
return this;
|
|
4532
2184
|
}
|
|
@@ -4546,7 +2198,7 @@ Falling back on the first item.
|
|
|
4546
2198
|
}) {
|
|
4547
2199
|
const plugins = this.getPluginsByKey(hookName, pluginKey);
|
|
4548
2200
|
const promises = plugins.map((plugin) => {
|
|
4549
|
-
return __privateMethod(this, _execute, execute_fn).call(this, {
|
|
2201
|
+
return chunkMM42A6GN_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
|
|
4550
2202
|
strategy: "hookFirst",
|
|
4551
2203
|
hookName,
|
|
4552
2204
|
parameters,
|
|
@@ -4565,7 +2217,7 @@ Falling back on the first item.
|
|
|
4565
2217
|
}) {
|
|
4566
2218
|
const plugins = this.getPluginsByKey(hookName, pluginKey);
|
|
4567
2219
|
return plugins.map((plugin) => {
|
|
4568
|
-
return __privateMethod(this, _executeSync, executeSync_fn).call(this, {
|
|
2220
|
+
return chunkMM42A6GN_cjs.__privateMethod(this, _executeSync, executeSync_fn).call(this, {
|
|
4569
2221
|
strategy: "hookFirst",
|
|
4570
2222
|
hookName,
|
|
4571
2223
|
parameters,
|
|
@@ -4581,11 +2233,11 @@ Falling back on the first item.
|
|
|
4581
2233
|
parameters,
|
|
4582
2234
|
skipped
|
|
4583
2235
|
}) {
|
|
4584
|
-
const promises = __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).filter((plugin) => {
|
|
2236
|
+
const promises = chunkMM42A6GN_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).filter((plugin) => {
|
|
4585
2237
|
return skipped ? skipped.has(plugin) : true;
|
|
4586
2238
|
}).map((plugin) => {
|
|
4587
2239
|
return async () => {
|
|
4588
|
-
const value = await __privateMethod(this, _execute, execute_fn).call(this, {
|
|
2240
|
+
const value = await chunkMM42A6GN_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
|
|
4589
2241
|
strategy: "hookFirst",
|
|
4590
2242
|
hookName,
|
|
4591
2243
|
parameters,
|
|
@@ -4599,7 +2251,7 @@ Falling back on the first item.
|
|
|
4599
2251
|
);
|
|
4600
2252
|
};
|
|
4601
2253
|
});
|
|
4602
|
-
return __privateGet(this, _promiseManager).run("first", promises);
|
|
2254
|
+
return chunkMM42A6GN_cjs.__privateGet(this, _promiseManager).run("first", promises);
|
|
4603
2255
|
}
|
|
4604
2256
|
/**
|
|
4605
2257
|
* First non-null result stops and will return it's value.
|
|
@@ -4610,12 +2262,12 @@ Falling back on the first item.
|
|
|
4610
2262
|
skipped
|
|
4611
2263
|
}) {
|
|
4612
2264
|
let parseResult = null;
|
|
4613
|
-
for (const plugin of __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
|
|
2265
|
+
for (const plugin of chunkMM42A6GN_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
|
|
4614
2266
|
if (skipped && skipped.has(plugin)) {
|
|
4615
2267
|
continue;
|
|
4616
2268
|
}
|
|
4617
2269
|
parseResult = {
|
|
4618
|
-
result: __privateMethod(this, _executeSync, executeSync_fn).call(this, {
|
|
2270
|
+
result: chunkMM42A6GN_cjs.__privateMethod(this, _executeSync, executeSync_fn).call(this, {
|
|
4619
2271
|
strategy: "hookFirst",
|
|
4620
2272
|
hookName,
|
|
4621
2273
|
parameters,
|
|
@@ -4636,14 +2288,14 @@ Falling back on the first item.
|
|
|
4636
2288
|
hookName,
|
|
4637
2289
|
parameters
|
|
4638
2290
|
}) {
|
|
4639
|
-
const promises = __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
|
|
4640
|
-
return () => __privateMethod(this, _execute, execute_fn).call(this, { strategy: "hookParallel", hookName, parameters, plugin });
|
|
2291
|
+
const promises = chunkMM42A6GN_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
|
|
2292
|
+
return () => chunkMM42A6GN_cjs.__privateMethod(this, _execute, execute_fn).call(this, { strategy: "hookParallel", hookName, parameters, plugin });
|
|
4641
2293
|
});
|
|
4642
|
-
const results = await __privateGet(this, _promiseManager).run("parallel", promises);
|
|
2294
|
+
const results = await chunkMM42A6GN_cjs.__privateGet(this, _promiseManager).run("parallel", promises);
|
|
4643
2295
|
results.forEach((result, index) => {
|
|
4644
2296
|
if (isPromiseRejectedResult(result)) {
|
|
4645
|
-
const plugin = __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)[index];
|
|
4646
|
-
__privateMethod(this, _catcher, catcher_fn).call(this, result.reason, plugin, hookName);
|
|
2297
|
+
const plugin = chunkMM42A6GN_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)[index];
|
|
2298
|
+
chunkMM42A6GN_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, result.reason, plugin, hookName);
|
|
4647
2299
|
}
|
|
4648
2300
|
});
|
|
4649
2301
|
return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
@@ -4658,16 +2310,16 @@ Falling back on the first item.
|
|
|
4658
2310
|
}) {
|
|
4659
2311
|
const [argument0, ...rest] = parameters;
|
|
4660
2312
|
let promise = Promise.resolve(argument0);
|
|
4661
|
-
for (const plugin of __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
|
|
2313
|
+
for (const plugin of chunkMM42A6GN_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
|
|
4662
2314
|
promise = promise.then((arg0) => {
|
|
4663
|
-
const value = __privateMethod(this, _execute, execute_fn).call(this, {
|
|
2315
|
+
const value = chunkMM42A6GN_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
|
|
4664
2316
|
strategy: "hookReduceArg0",
|
|
4665
2317
|
hookName,
|
|
4666
2318
|
parameters: [arg0, ...rest],
|
|
4667
2319
|
plugin
|
|
4668
2320
|
});
|
|
4669
2321
|
return value;
|
|
4670
|
-
}).then((result) => reduce.call(__privateGet(this, _core).api, argument0, result, plugin));
|
|
2322
|
+
}).then((result) => reduce.call(chunkMM42A6GN_cjs.__privateGet(this, _core).api, argument0, result, plugin));
|
|
4671
2323
|
}
|
|
4672
2324
|
return promise;
|
|
4673
2325
|
}
|
|
@@ -4675,15 +2327,15 @@ Falling back on the first item.
|
|
|
4675
2327
|
* Chains plugins
|
|
4676
2328
|
*/
|
|
4677
2329
|
async hookSeq({ hookName, parameters }) {
|
|
4678
|
-
const promises = __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
|
|
4679
|
-
return () => __privateMethod(this, _execute, execute_fn).call(this, {
|
|
2330
|
+
const promises = chunkMM42A6GN_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
|
|
2331
|
+
return () => chunkMM42A6GN_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
|
|
4680
2332
|
strategy: "hookSeq",
|
|
4681
2333
|
hookName,
|
|
4682
2334
|
parameters,
|
|
4683
2335
|
plugin
|
|
4684
2336
|
});
|
|
4685
2337
|
});
|
|
4686
|
-
return __privateGet(this, _promiseManager).run("seq", promises);
|
|
2338
|
+
return chunkMM42A6GN_cjs.__privateGet(this, _promiseManager).run("seq", promises);
|
|
4687
2339
|
}
|
|
4688
2340
|
getPluginsByKey(hookName, pluginKey) {
|
|
4689
2341
|
const plugins = [...this.plugins];
|
|
@@ -4699,11 +2351,11 @@ Falling back on the first item.
|
|
|
4699
2351
|
});
|
|
4700
2352
|
if (!pluginByPluginName?.length) {
|
|
4701
2353
|
const corePlugin = plugins.find((plugin) => plugin.name === "core" && plugin[hookName]);
|
|
4702
|
-
if (this.logger.logLevel === LogLevel.debug) {
|
|
2354
|
+
if (this.logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.debug) {
|
|
4703
2355
|
if (corePlugin) {
|
|
4704
|
-
this.logger.
|
|
2356
|
+
this.logger.debug(`No hook '${hookName}' for pluginKey '${JSON.stringify(pluginKey)}' found, falling back on the '@kubb/core' plugin`);
|
|
4705
2357
|
} else {
|
|
4706
|
-
this.logger.
|
|
2358
|
+
this.logger.debug(`No hook '${hookName}' for pluginKey '${JSON.stringify(pluginKey)}' found, no fallback found in the '@kubb/core' plugin`);
|
|
4707
2359
|
}
|
|
4708
2360
|
}
|
|
4709
2361
|
return corePlugin ? [corePlugin] : [];
|
|
@@ -4737,7 +2389,7 @@ _getSortedPlugins = new WeakSet();
|
|
|
4737
2389
|
getSortedPlugins_fn = function(hookName) {
|
|
4738
2390
|
const plugins = [...this.plugins].filter((plugin) => plugin.name !== "core");
|
|
4739
2391
|
if (hookName) {
|
|
4740
|
-
if (this.logger.logLevel === LogLevel.info) {
|
|
2392
|
+
if (this.logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.info) {
|
|
4741
2393
|
const containsHookName = plugins.some((item) => item[hookName]);
|
|
4742
2394
|
if (!containsHookName) {
|
|
4743
2395
|
this.logger.warn(`No hook ${hookName} found`);
|
|
@@ -4753,11 +2405,11 @@ getSortedPlugins_fn = function(hookName) {
|
|
|
4753
2405
|
}
|
|
4754
2406
|
}
|
|
4755
2407
|
return plugin;
|
|
4756
|
-
}).sort((a,
|
|
4757
|
-
if (
|
|
2408
|
+
}).sort((a, b) => {
|
|
2409
|
+
if (b.pre?.includes(a.name)) {
|
|
4758
2410
|
return 1;
|
|
4759
2411
|
}
|
|
4760
|
-
if (
|
|
2412
|
+
if (b.post?.includes(a.name)) {
|
|
4761
2413
|
return -1;
|
|
4762
2414
|
}
|
|
4763
2415
|
return 0;
|
|
@@ -4785,7 +2437,7 @@ execute_fn = function({
|
|
|
4785
2437
|
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
4786
2438
|
const task = Promise.resolve().then(() => {
|
|
4787
2439
|
if (typeof hook === "function") {
|
|
4788
|
-
const possiblePromiseResult = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
|
|
2440
|
+
const possiblePromiseResult = hook.apply({ ...chunkMM42A6GN_cjs.__privateGet(this, _core).api, plugin }, parameters);
|
|
4789
2441
|
if (isPromise(possiblePromiseResult)) {
|
|
4790
2442
|
return Promise.resolve(possiblePromiseResult);
|
|
4791
2443
|
}
|
|
@@ -4794,7 +2446,7 @@ execute_fn = function({
|
|
|
4794
2446
|
return hook;
|
|
4795
2447
|
}).then((result) => {
|
|
4796
2448
|
output = result;
|
|
4797
|
-
__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
|
|
2449
|
+
chunkMM42A6GN_cjs.__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
|
|
4798
2450
|
parameters,
|
|
4799
2451
|
output,
|
|
4800
2452
|
strategy,
|
|
@@ -4803,7 +2455,7 @@ execute_fn = function({
|
|
|
4803
2455
|
});
|
|
4804
2456
|
return result;
|
|
4805
2457
|
}).catch((e) => {
|
|
4806
|
-
__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
|
|
2458
|
+
chunkMM42A6GN_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
|
|
4807
2459
|
return null;
|
|
4808
2460
|
});
|
|
4809
2461
|
return task;
|
|
@@ -4823,12 +2475,12 @@ executeSync_fn = function({
|
|
|
4823
2475
|
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
4824
2476
|
try {
|
|
4825
2477
|
if (typeof hook === "function") {
|
|
4826
|
-
const fn = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
|
|
2478
|
+
const fn = hook.apply({ ...chunkMM42A6GN_cjs.__privateGet(this, _core).api, plugin }, parameters);
|
|
4827
2479
|
output = fn;
|
|
4828
2480
|
return fn;
|
|
4829
2481
|
}
|
|
4830
2482
|
output = hook;
|
|
4831
|
-
__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
|
|
2483
|
+
chunkMM42A6GN_cjs.__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
|
|
4832
2484
|
parameters,
|
|
4833
2485
|
output,
|
|
4834
2486
|
strategy,
|
|
@@ -4837,7 +2489,7 @@ executeSync_fn = function({
|
|
|
4837
2489
|
});
|
|
4838
2490
|
return hook;
|
|
4839
2491
|
} catch (e) {
|
|
4840
|
-
__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
|
|
2492
|
+
chunkMM42A6GN_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
|
|
4841
2493
|
return null;
|
|
4842
2494
|
}
|
|
4843
2495
|
};
|
|
@@ -4850,12 +2502,9 @@ catcher_fn = function(e, plugin, hookName) {
|
|
|
4850
2502
|
};
|
|
4851
2503
|
_parse = new WeakSet();
|
|
4852
2504
|
parse_fn = function(plugin, pluginManager, context) {
|
|
4853
|
-
const usedPluginNames = __privateGet(pluginManager, _usedPluginNames);
|
|
4854
|
-
setUniqueName(plugin.name, usedPluginNames);
|
|
2505
|
+
const usedPluginNames = chunkMM42A6GN_cjs.__privateGet(pluginManager, _usedPluginNames);
|
|
2506
|
+
chunkLAS7UYTK_cjs.setUniqueName(plugin.name, usedPluginNames);
|
|
4855
2507
|
const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
|
|
4856
|
-
if (plugin.name !== "core" && usedPluginNames[plugin.name] >= 2) {
|
|
4857
|
-
pluginManager.logger.warn("Using multiple of the same plugin is an experimental feature");
|
|
4858
|
-
}
|
|
4859
2508
|
if (!plugin.transform) {
|
|
4860
2509
|
plugin.transform = function transform(code) {
|
|
4861
2510
|
return code;
|
|
@@ -4880,15 +2529,16 @@ async function transformReducer(_previousCode, result, _plugin) {
|
|
|
4880
2529
|
return result;
|
|
4881
2530
|
}
|
|
4882
2531
|
async function setup(options) {
|
|
4883
|
-
const { config, logger = createLogger({ logLevel: LogLevel.silent }) } = options;
|
|
2532
|
+
const { config, logger = chunkGBX7KRCX_cjs.createLogger({ logLevel: chunkGBX7KRCX_cjs.LogLevel.silent }) } = options;
|
|
2533
|
+
let count = 0;
|
|
4884
2534
|
try {
|
|
4885
|
-
if (isInputPath(config) && !new URLPath(config.input.path).isURL) {
|
|
4886
|
-
await read(config.input.path);
|
|
2535
|
+
if (isInputPath(config) && !new chunkLAS7UYTK_cjs.URLPath(config.input.path).isURL) {
|
|
2536
|
+
await chunk35FDNG5F_cjs.read(config.input.path);
|
|
4887
2537
|
}
|
|
4888
2538
|
} catch (e) {
|
|
4889
2539
|
if (isInputPath(config)) {
|
|
4890
2540
|
throw new Error(
|
|
4891
|
-
"Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " +
|
|
2541
|
+
"Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + chunkGBX7KRCX_cjs.p.dim(config.input.path),
|
|
4892
2542
|
{
|
|
4893
2543
|
cause: e
|
|
4894
2544
|
}
|
|
@@ -4896,78 +2546,97 @@ async function setup(options) {
|
|
|
4896
2546
|
}
|
|
4897
2547
|
}
|
|
4898
2548
|
if (config.output.clean) {
|
|
4899
|
-
await clean(config.output.path);
|
|
2549
|
+
await chunk35FDNG5F_cjs.clean(config.output.path);
|
|
4900
2550
|
}
|
|
4901
|
-
const
|
|
2551
|
+
const task = async (file) => {
|
|
4902
2552
|
const { path: path5 } = file;
|
|
4903
|
-
let
|
|
2553
|
+
let source = FileManager.getSource(file);
|
|
4904
2554
|
const { result: loadedResult } = await pluginManager.hookFirst({
|
|
4905
2555
|
hookName: "load",
|
|
4906
2556
|
parameters: [path5]
|
|
4907
2557
|
});
|
|
4908
2558
|
if (loadedResult && isPromise(loadedResult)) {
|
|
4909
|
-
|
|
2559
|
+
source = await loadedResult;
|
|
4910
2560
|
}
|
|
4911
2561
|
if (loadedResult && !isPromise(loadedResult)) {
|
|
4912
|
-
|
|
2562
|
+
source = loadedResult;
|
|
4913
2563
|
}
|
|
4914
|
-
if (
|
|
4915
|
-
|
|
2564
|
+
if (source) {
|
|
2565
|
+
source = await pluginManager.hookReduceArg0({
|
|
4916
2566
|
hookName: "transform",
|
|
4917
|
-
parameters: [
|
|
2567
|
+
parameters: [source, path5],
|
|
4918
2568
|
reduce: transformReducer
|
|
4919
2569
|
});
|
|
4920
2570
|
if (config.output.write || config.output.write === void 0) {
|
|
4921
2571
|
if (file.meta?.pluginKey) {
|
|
4922
|
-
|
|
2572
|
+
await pluginManager.hookForPlugin({
|
|
4923
2573
|
pluginKey: file.meta?.pluginKey,
|
|
4924
2574
|
hookName: "writeFile",
|
|
4925
|
-
parameters: [
|
|
2575
|
+
parameters: [source, path5]
|
|
4926
2576
|
});
|
|
4927
2577
|
}
|
|
4928
|
-
|
|
2578
|
+
await pluginManager.hookFirst({
|
|
4929
2579
|
hookName: "writeFile",
|
|
4930
|
-
parameters: [
|
|
2580
|
+
parameters: [source, path5]
|
|
4931
2581
|
});
|
|
4932
2582
|
}
|
|
4933
2583
|
}
|
|
2584
|
+
return {
|
|
2585
|
+
...file,
|
|
2586
|
+
source: source || ""
|
|
2587
|
+
};
|
|
4934
2588
|
};
|
|
4935
|
-
const pluginManager = new PluginManager(config, { logger, task
|
|
2589
|
+
const pluginManager = new PluginManager(config, { logger, task });
|
|
4936
2590
|
pluginManager.on("execute", (executer) => {
|
|
4937
2591
|
const { hookName, parameters, plugin } = executer;
|
|
4938
2592
|
if (hookName === "writeFile" && logger.spinner) {
|
|
4939
2593
|
const [code] = parameters;
|
|
4940
|
-
if (logger.logLevel === LogLevel.
|
|
4941
|
-
logger.
|
|
4942
|
-
}
|
|
4943
|
-
if (logger.logLevel === LogLevel.debug) {
|
|
4944
|
-
logger.info(`PluginKey ${p2.dim(JSON.stringify(plugin.key))}
|
|
2594
|
+
if (logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.debug) {
|
|
2595
|
+
logger.debug(`PluginKey ${chunkGBX7KRCX_cjs.p.dim(JSON.stringify(plugin.key))}
|
|
4945
2596
|
with source
|
|
4946
2597
|
|
|
4947
2598
|
${code}`);
|
|
4948
2599
|
}
|
|
4949
2600
|
}
|
|
4950
2601
|
});
|
|
2602
|
+
pluginManager.queue.on("add", () => {
|
|
2603
|
+
if (logger.logLevel !== chunkGBX7KRCX_cjs.LogLevel.info) {
|
|
2604
|
+
return;
|
|
2605
|
+
}
|
|
2606
|
+
if (logger.spinner && count === 0) {
|
|
2607
|
+
logger.spinner?.start(`\u{1F4BE} Writing`);
|
|
2608
|
+
}
|
|
2609
|
+
});
|
|
2610
|
+
pluginManager.queue.on("active", () => {
|
|
2611
|
+
if (logger.logLevel !== chunkGBX7KRCX_cjs.LogLevel.info) {
|
|
2612
|
+
return;
|
|
2613
|
+
}
|
|
2614
|
+
if (logger.spinner && pluginManager.queue.size > 0) {
|
|
2615
|
+
const text = `Item: ${count} Size: ${pluginManager.queue.size} Pending: ${pluginManager.queue.pending}`;
|
|
2616
|
+
logger.spinner.suffixText = chunkGBX7KRCX_cjs.p.dim(text);
|
|
2617
|
+
}
|
|
2618
|
+
++count;
|
|
2619
|
+
});
|
|
2620
|
+
pluginManager.queue.on("completed", () => {
|
|
2621
|
+
if (logger.logLevel !== chunkGBX7KRCX_cjs.LogLevel.info) {
|
|
2622
|
+
return;
|
|
2623
|
+
}
|
|
2624
|
+
if (logger.spinner) {
|
|
2625
|
+
const text = `Item: ${count} Size: ${pluginManager.queue.size} Pending: ${pluginManager.queue.pending}`;
|
|
2626
|
+
logger.spinner.suffixText = chunkGBX7KRCX_cjs.p.dim(text);
|
|
2627
|
+
}
|
|
2628
|
+
});
|
|
4951
2629
|
pluginManager.on("executed", (executer) => {
|
|
4952
2630
|
const { hookName, plugin, output, parameters } = executer;
|
|
4953
|
-
|
|
4954
|
-
if (logger.logLevel === LogLevel.info && logger.spinner) {
|
|
4955
|
-
if (hookName === "writeFile") {
|
|
4956
|
-
const [_code, path5] = parameters;
|
|
4957
|
-
logger.spinner.suffixText = p2.dim(path5);
|
|
4958
|
-
} else {
|
|
4959
|
-
logger.spinner.suffixText = messsage;
|
|
4960
|
-
}
|
|
4961
|
-
}
|
|
4962
|
-
if (logger.logLevel === LogLevel.debug) {
|
|
4963
|
-
logger.info(messsage);
|
|
2631
|
+
if (logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.debug) {
|
|
4964
2632
|
const logs = [
|
|
4965
|
-
|
|
2633
|
+
`${chunkGBX7KRCX_cjs.randomCliColour(plugin.name)} Executing ${hookName}`,
|
|
2634
|
+
parameters && `${chunkGBX7KRCX_cjs.p.bgWhite(`Parameters`)} ${chunkGBX7KRCX_cjs.randomCliColour(plugin.name)} ${hookName}`,
|
|
4966
2635
|
JSON.stringify(parameters, void 0, 2),
|
|
4967
|
-
output && `${
|
|
2636
|
+
output && `${chunkGBX7KRCX_cjs.p.bgWhite("Output")} ${chunkGBX7KRCX_cjs.randomCliColour(plugin.name)} ${hookName}`,
|
|
4968
2637
|
output
|
|
4969
2638
|
].filter(Boolean);
|
|
4970
|
-
|
|
2639
|
+
logger.debug(logs.join("\n"));
|
|
4971
2640
|
}
|
|
4972
2641
|
});
|
|
4973
2642
|
return pluginManager;
|
|
@@ -4980,7 +2649,7 @@ async function build(options) {
|
|
|
4980
2649
|
parameters: [options.config]
|
|
4981
2650
|
});
|
|
4982
2651
|
await pluginManager.hookParallel({ hookName: "buildEnd" });
|
|
4983
|
-
if (
|
|
2652
|
+
if (logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.info && logger.spinner) {
|
|
4984
2653
|
logger.spinner.suffixText = "";
|
|
4985
2654
|
logger.spinner.succeed(`\u{1F4BE} Writing completed`);
|
|
4986
2655
|
}
|
|
@@ -4995,7 +2664,7 @@ async function safeBuild(options) {
|
|
|
4995
2664
|
parameters: [options.config]
|
|
4996
2665
|
});
|
|
4997
2666
|
await pluginManager.hookParallel({ hookName: "buildEnd" });
|
|
4998
|
-
if (
|
|
2667
|
+
if (logger.logLevel === chunkGBX7KRCX_cjs.LogLevel.info && logger.spinner) {
|
|
4999
2668
|
logger.spinner.suffixText = "";
|
|
5000
2669
|
logger.spinner.succeed(`\u{1F4BE} Writing completed`);
|
|
5001
2670
|
}
|
|
@@ -5006,95 +2675,95 @@ async function safeBuild(options) {
|
|
|
5006
2675
|
}
|
|
5007
2676
|
|
|
5008
2677
|
// src/Generator.ts
|
|
5009
|
-
init_cjs_shims();
|
|
2678
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
5010
2679
|
var _options3, _context;
|
|
5011
2680
|
var Generator = class {
|
|
5012
2681
|
constructor(options, context) {
|
|
5013
|
-
__privateAdd(this, _options3, {});
|
|
5014
|
-
__privateAdd(this, _context, {});
|
|
2682
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _options3, {});
|
|
2683
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _context, {});
|
|
5015
2684
|
if (context) {
|
|
5016
|
-
__privateSet(this, _context, context);
|
|
2685
|
+
chunkMM42A6GN_cjs.__privateSet(this, _context, context);
|
|
5017
2686
|
}
|
|
5018
2687
|
if (options) {
|
|
5019
|
-
__privateSet(this, _options3, options);
|
|
2688
|
+
chunkMM42A6GN_cjs.__privateSet(this, _options3, options);
|
|
5020
2689
|
}
|
|
5021
2690
|
return this;
|
|
5022
2691
|
}
|
|
5023
2692
|
get options() {
|
|
5024
|
-
return __privateGet(this, _options3);
|
|
2693
|
+
return chunkMM42A6GN_cjs.__privateGet(this, _options3);
|
|
5025
2694
|
}
|
|
5026
2695
|
get context() {
|
|
5027
|
-
return __privateGet(this, _context);
|
|
2696
|
+
return chunkMM42A6GN_cjs.__privateGet(this, _context);
|
|
5028
2697
|
}
|
|
5029
2698
|
set options(options) {
|
|
5030
|
-
__privateSet(this, _options3, { ...__privateGet(this, _options3), ...options });
|
|
2699
|
+
chunkMM42A6GN_cjs.__privateSet(this, _options3, { ...chunkMM42A6GN_cjs.__privateGet(this, _options3), ...options });
|
|
5031
2700
|
}
|
|
5032
2701
|
};
|
|
5033
2702
|
_options3 = new WeakMap();
|
|
5034
2703
|
_context = new WeakMap();
|
|
5035
2704
|
|
|
5036
2705
|
// src/PackageManager.ts
|
|
5037
|
-
init_cjs_shims();
|
|
2706
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
5038
2707
|
|
|
5039
2708
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
5040
|
-
init_cjs_shims();
|
|
2709
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
5041
2710
|
|
|
5042
2711
|
// ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
5043
|
-
init_cjs_shims();
|
|
2712
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
5044
2713
|
|
|
5045
2714
|
// ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
|
|
5046
|
-
init_cjs_shims();
|
|
2715
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
5047
2716
|
|
|
5048
2717
|
// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
|
|
5049
|
-
init_cjs_shims();
|
|
2718
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
5050
2719
|
|
|
5051
2720
|
// ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
|
|
5052
|
-
init_cjs_shims();
|
|
2721
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
5053
2722
|
var Node = class {
|
|
5054
2723
|
constructor(value) {
|
|
5055
|
-
__publicField(this, "value");
|
|
5056
|
-
__publicField(this, "next");
|
|
2724
|
+
chunkMM42A6GN_cjs.__publicField(this, "value");
|
|
2725
|
+
chunkMM42A6GN_cjs.__publicField(this, "next");
|
|
5057
2726
|
this.value = value;
|
|
5058
2727
|
}
|
|
5059
2728
|
};
|
|
5060
2729
|
var _head, _tail, _size;
|
|
5061
|
-
var
|
|
2730
|
+
var Queue = class {
|
|
5062
2731
|
constructor() {
|
|
5063
|
-
__privateAdd(this, _head, void 0);
|
|
5064
|
-
__privateAdd(this, _tail, void 0);
|
|
5065
|
-
__privateAdd(this, _size, void 0);
|
|
2732
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _head, void 0);
|
|
2733
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _tail, void 0);
|
|
2734
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _size, void 0);
|
|
5066
2735
|
this.clear();
|
|
5067
2736
|
}
|
|
5068
2737
|
enqueue(value) {
|
|
5069
2738
|
const node = new Node(value);
|
|
5070
|
-
if (__privateGet(this, _head)) {
|
|
5071
|
-
__privateGet(this, _tail).next = node;
|
|
5072
|
-
__privateSet(this, _tail, node);
|
|
2739
|
+
if (chunkMM42A6GN_cjs.__privateGet(this, _head)) {
|
|
2740
|
+
chunkMM42A6GN_cjs.__privateGet(this, _tail).next = node;
|
|
2741
|
+
chunkMM42A6GN_cjs.__privateSet(this, _tail, node);
|
|
5073
2742
|
} else {
|
|
5074
|
-
__privateSet(this, _head, node);
|
|
5075
|
-
__privateSet(this, _tail, node);
|
|
2743
|
+
chunkMM42A6GN_cjs.__privateSet(this, _head, node);
|
|
2744
|
+
chunkMM42A6GN_cjs.__privateSet(this, _tail, node);
|
|
5076
2745
|
}
|
|
5077
|
-
__privateWrapper(this, _size)._++;
|
|
2746
|
+
chunkMM42A6GN_cjs.__privateWrapper(this, _size)._++;
|
|
5078
2747
|
}
|
|
5079
2748
|
dequeue() {
|
|
5080
|
-
const current = __privateGet(this, _head);
|
|
2749
|
+
const current = chunkMM42A6GN_cjs.__privateGet(this, _head);
|
|
5081
2750
|
if (!current) {
|
|
5082
2751
|
return;
|
|
5083
2752
|
}
|
|
5084
|
-
__privateSet(this, _head, __privateGet(this, _head).next);
|
|
5085
|
-
__privateWrapper(this, _size)._--;
|
|
2753
|
+
chunkMM42A6GN_cjs.__privateSet(this, _head, chunkMM42A6GN_cjs.__privateGet(this, _head).next);
|
|
2754
|
+
chunkMM42A6GN_cjs.__privateWrapper(this, _size)._--;
|
|
5086
2755
|
return current.value;
|
|
5087
2756
|
}
|
|
5088
2757
|
clear() {
|
|
5089
|
-
__privateSet(this, _head, void 0);
|
|
5090
|
-
__privateSet(this, _tail, void 0);
|
|
5091
|
-
__privateSet(this, _size, 0);
|
|
2758
|
+
chunkMM42A6GN_cjs.__privateSet(this, _head, void 0);
|
|
2759
|
+
chunkMM42A6GN_cjs.__privateSet(this, _tail, void 0);
|
|
2760
|
+
chunkMM42A6GN_cjs.__privateSet(this, _size, 0);
|
|
5092
2761
|
}
|
|
5093
2762
|
get size() {
|
|
5094
|
-
return __privateGet(this, _size);
|
|
2763
|
+
return chunkMM42A6GN_cjs.__privateGet(this, _size);
|
|
5095
2764
|
}
|
|
5096
2765
|
*[Symbol.iterator]() {
|
|
5097
|
-
let current = __privateGet(this, _head);
|
|
2766
|
+
let current = chunkMM42A6GN_cjs.__privateGet(this, _head);
|
|
5098
2767
|
while (current) {
|
|
5099
2768
|
yield current.value;
|
|
5100
2769
|
current = current.next;
|
|
@@ -5110,7 +2779,7 @@ function pLimit(concurrency) {
|
|
|
5110
2779
|
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
|
5111
2780
|
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
5112
2781
|
}
|
|
5113
|
-
const queue = new
|
|
2782
|
+
const queue = new Queue();
|
|
5114
2783
|
let activeCount = 0;
|
|
5115
2784
|
const next = () => {
|
|
5116
2785
|
activeCount--;
|
|
@@ -5118,18 +2787,18 @@ function pLimit(concurrency) {
|
|
|
5118
2787
|
queue.dequeue()();
|
|
5119
2788
|
}
|
|
5120
2789
|
};
|
|
5121
|
-
const run = async (fn,
|
|
2790
|
+
const run = async (fn, resolve2, args) => {
|
|
5122
2791
|
activeCount++;
|
|
5123
2792
|
const result = (async () => fn(...args))();
|
|
5124
|
-
|
|
2793
|
+
resolve2(result);
|
|
5125
2794
|
try {
|
|
5126
2795
|
await result;
|
|
5127
2796
|
} catch {
|
|
5128
2797
|
}
|
|
5129
2798
|
next();
|
|
5130
2799
|
};
|
|
5131
|
-
const enqueue = (fn,
|
|
5132
|
-
queue.enqueue(run.bind(void 0, fn,
|
|
2800
|
+
const enqueue = (fn, resolve2, args) => {
|
|
2801
|
+
queue.enqueue(run.bind(void 0, fn, resolve2, args));
|
|
5133
2802
|
(async () => {
|
|
5134
2803
|
await Promise.resolve();
|
|
5135
2804
|
if (activeCount < concurrency && queue.size > 0) {
|
|
@@ -5137,8 +2806,8 @@ function pLimit(concurrency) {
|
|
|
5137
2806
|
}
|
|
5138
2807
|
})();
|
|
5139
2808
|
};
|
|
5140
|
-
const generator = (fn, ...args) => new Promise((
|
|
5141
|
-
enqueue(fn,
|
|
2809
|
+
const generator = (fn, ...args) => new Promise((resolve2) => {
|
|
2810
|
+
enqueue(fn, resolve2, args);
|
|
5142
2811
|
});
|
|
5143
2812
|
Object.defineProperties(generator, {
|
|
5144
2813
|
activeCount: {
|
|
@@ -5202,7 +2871,7 @@ function checkType(type) {
|
|
|
5202
2871
|
var matchType = (type, stat) => stat[typeMappings[type]]();
|
|
5203
2872
|
var toPath = (urlOrPath) => urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
5204
2873
|
async function locatePath(paths, {
|
|
5205
|
-
cwd =
|
|
2874
|
+
cwd = process__default.default.cwd(),
|
|
5206
2875
|
type = "file",
|
|
5207
2876
|
allowSymlinks = true,
|
|
5208
2877
|
concurrency,
|
|
@@ -5210,7 +2879,7 @@ async function locatePath(paths, {
|
|
|
5210
2879
|
} = {}) {
|
|
5211
2880
|
checkType(type);
|
|
5212
2881
|
cwd = toPath(cwd);
|
|
5213
|
-
const statFunction = allowSymlinks ?
|
|
2882
|
+
const statFunction = allowSymlinks ? fs.promises.stat : fs.promises.lstat;
|
|
5214
2883
|
return pLocate(paths, async (path_) => {
|
|
5215
2884
|
try {
|
|
5216
2885
|
const stat = await statFunction(path4__default.default.resolve(cwd, path_));
|
|
@@ -5221,13 +2890,13 @@ async function locatePath(paths, {
|
|
|
5221
2890
|
}, { concurrency, preserveOrder });
|
|
5222
2891
|
}
|
|
5223
2892
|
function locatePathSync(paths, {
|
|
5224
|
-
cwd =
|
|
2893
|
+
cwd = process__default.default.cwd(),
|
|
5225
2894
|
type = "file",
|
|
5226
2895
|
allowSymlinks = true
|
|
5227
2896
|
} = {}) {
|
|
5228
2897
|
checkType(type);
|
|
5229
2898
|
cwd = toPath(cwd);
|
|
5230
|
-
const statFunction = allowSymlinks ?
|
|
2899
|
+
const statFunction = allowSymlinks ? fs__default.default.statSync : fs__default.default.lstatSync;
|
|
5231
2900
|
for (const path_ of paths) {
|
|
5232
2901
|
try {
|
|
5233
2902
|
const stat = statFunction(path4__default.default.resolve(cwd, path_), {
|
|
@@ -5245,13 +2914,13 @@ function locatePathSync(paths, {
|
|
|
5245
2914
|
}
|
|
5246
2915
|
|
|
5247
2916
|
// ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
|
|
5248
|
-
init_cjs_shims();
|
|
2917
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
5249
2918
|
function toPath2(urlOrPath) {
|
|
5250
2919
|
return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
5251
2920
|
}
|
|
5252
2921
|
|
|
5253
2922
|
// ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
|
|
5254
|
-
init_cjs_shims();
|
|
2923
|
+
chunkMM42A6GN_cjs.init_cjs_shims();
|
|
5255
2924
|
|
|
5256
2925
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
5257
2926
|
var findUpStop = Symbol("findUpStop");
|
|
@@ -5330,30 +2999,30 @@ function findUpSync(name, options = {}) {
|
|
|
5330
2999
|
var _cache2, _cwd, _SLASHES, _match, match_fn;
|
|
5331
3000
|
var _PackageManager = class _PackageManager {
|
|
5332
3001
|
constructor(workspace) {
|
|
5333
|
-
__privateAdd(this, _match);
|
|
5334
|
-
__privateAdd(this, _cwd, void 0);
|
|
5335
|
-
__privateAdd(this, _SLASHES, /* @__PURE__ */ new Set(["/", "\\"]));
|
|
3002
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _match);
|
|
3003
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _cwd, void 0);
|
|
3004
|
+
chunkMM42A6GN_cjs.__privateAdd(this, _SLASHES, /* @__PURE__ */ new Set(["/", "\\"]));
|
|
5336
3005
|
if (workspace) {
|
|
5337
|
-
__privateSet(this, _cwd, workspace);
|
|
3006
|
+
chunkMM42A6GN_cjs.__privateSet(this, _cwd, workspace);
|
|
5338
3007
|
}
|
|
5339
3008
|
return this;
|
|
5340
3009
|
}
|
|
5341
3010
|
set workspace(workspace) {
|
|
5342
|
-
__privateSet(this, _cwd, workspace);
|
|
3011
|
+
chunkMM42A6GN_cjs.__privateSet(this, _cwd, workspace);
|
|
5343
3012
|
}
|
|
5344
3013
|
get workspace() {
|
|
5345
|
-
return __privateGet(this, _cwd);
|
|
3014
|
+
return chunkMM42A6GN_cjs.__privateGet(this, _cwd);
|
|
5346
3015
|
}
|
|
5347
3016
|
normalizeDirectory(directory) {
|
|
5348
|
-
if (!__privateGet(this, _SLASHES).has(directory[directory.length - 1])) {
|
|
3017
|
+
if (!chunkMM42A6GN_cjs.__privateGet(this, _SLASHES).has(directory[directory.length - 1])) {
|
|
5349
3018
|
return `${directory}/`;
|
|
5350
3019
|
}
|
|
5351
3020
|
return directory;
|
|
5352
3021
|
}
|
|
5353
3022
|
getLocation(path5) {
|
|
5354
3023
|
let location = path5;
|
|
5355
|
-
if (__privateGet(this, _cwd)) {
|
|
5356
|
-
const require2 = mod__default.default.createRequire(this.normalizeDirectory(__privateGet(this, _cwd)));
|
|
3024
|
+
if (chunkMM42A6GN_cjs.__privateGet(this, _cwd)) {
|
|
3025
|
+
const require2 = mod__default.default.createRequire(this.normalizeDirectory(chunkMM42A6GN_cjs.__privateGet(this, _cwd)));
|
|
5357
3026
|
location = require2.resolve(path5);
|
|
5358
3027
|
}
|
|
5359
3028
|
return location;
|
|
@@ -5373,44 +3042,44 @@ var _PackageManager = class _PackageManager {
|
|
|
5373
3042
|
}
|
|
5374
3043
|
async getPackageJSON() {
|
|
5375
3044
|
const pkgPath = await findUp(["package.json"], {
|
|
5376
|
-
cwd: __privateGet(this, _cwd)
|
|
3045
|
+
cwd: chunkMM42A6GN_cjs.__privateGet(this, _cwd)
|
|
5377
3046
|
});
|
|
5378
3047
|
if (!pkgPath) {
|
|
5379
3048
|
return void 0;
|
|
5380
3049
|
}
|
|
5381
|
-
return __require(pkgPath);
|
|
3050
|
+
return chunkMM42A6GN_cjs.__require(pkgPath);
|
|
5382
3051
|
}
|
|
5383
3052
|
getPackageJSONSync() {
|
|
5384
3053
|
const pkgPath = findUpSync(["package.json"], {
|
|
5385
|
-
cwd: __privateGet(this, _cwd)
|
|
3054
|
+
cwd: chunkMM42A6GN_cjs.__privateGet(this, _cwd)
|
|
5386
3055
|
});
|
|
5387
3056
|
if (!pkgPath) {
|
|
5388
3057
|
return void 0;
|
|
5389
3058
|
}
|
|
5390
|
-
return __require(pkgPath);
|
|
3059
|
+
return chunkMM42A6GN_cjs.__require(pkgPath);
|
|
5391
3060
|
}
|
|
5392
3061
|
static setVersion(dependency, version) {
|
|
5393
|
-
__privateGet(_PackageManager, _cache2)[dependency] = version;
|
|
3062
|
+
chunkMM42A6GN_cjs.__privateGet(_PackageManager, _cache2)[dependency] = version;
|
|
5394
3063
|
}
|
|
5395
3064
|
async getVersion(dependency) {
|
|
5396
|
-
if (typeof dependency === "string" && __privateGet(_PackageManager, _cache2)[dependency]) {
|
|
5397
|
-
return __privateGet(_PackageManager, _cache2)[dependency];
|
|
3065
|
+
if (typeof dependency === "string" && chunkMM42A6GN_cjs.__privateGet(_PackageManager, _cache2)[dependency]) {
|
|
3066
|
+
return chunkMM42A6GN_cjs.__privateGet(_PackageManager, _cache2)[dependency];
|
|
5398
3067
|
}
|
|
5399
3068
|
const packageJSON = await this.getPackageJSON();
|
|
5400
3069
|
if (!packageJSON) {
|
|
5401
3070
|
return void 0;
|
|
5402
3071
|
}
|
|
5403
|
-
return __privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
|
|
3072
|
+
return chunkMM42A6GN_cjs.__privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
|
|
5404
3073
|
}
|
|
5405
3074
|
getVersionSync(dependency) {
|
|
5406
|
-
if (typeof dependency === "string" && __privateGet(_PackageManager, _cache2)[dependency]) {
|
|
5407
|
-
return __privateGet(_PackageManager, _cache2)[dependency];
|
|
3075
|
+
if (typeof dependency === "string" && chunkMM42A6GN_cjs.__privateGet(_PackageManager, _cache2)[dependency]) {
|
|
3076
|
+
return chunkMM42A6GN_cjs.__privateGet(_PackageManager, _cache2)[dependency];
|
|
5408
3077
|
}
|
|
5409
3078
|
const packageJSON = this.getPackageJSONSync();
|
|
5410
3079
|
if (!packageJSON) {
|
|
5411
3080
|
return void 0;
|
|
5412
3081
|
}
|
|
5413
|
-
return __privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
|
|
3082
|
+
return chunkMM42A6GN_cjs.__privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
|
|
5414
3083
|
}
|
|
5415
3084
|
async isValid(dependency, version) {
|
|
5416
3085
|
const packageVersion = await this.getVersion(dependency);
|
|
@@ -5453,7 +3122,7 @@ match_fn = function(packageJSON, dependency) {
|
|
|
5453
3122
|
const matchedDependency = Object.keys(dependencies).find((dep) => dep.match(dependency));
|
|
5454
3123
|
return matchedDependency ? dependencies[matchedDependency] : void 0;
|
|
5455
3124
|
};
|
|
5456
|
-
__privateAdd(_PackageManager, _cache2, {});
|
|
3125
|
+
chunkMM42A6GN_cjs.__privateAdd(_PackageManager, _cache2, {});
|
|
5457
3126
|
var PackageManager = _PackageManager;
|
|
5458
3127
|
|
|
5459
3128
|
// src/index.ts
|