@kubb/core 2.0.0-beta.12 → 2.0.0-beta.13
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-56YH3VX6.js +239 -0
- package/dist/chunk-56YH3VX6.js.map +1 -0
- package/dist/chunk-6N4JBFFS.js +79 -0
- package/dist/chunk-6N4JBFFS.js.map +1 -0
- package/dist/chunk-72O327DC.cjs +247 -0
- package/dist/chunk-72O327DC.cjs.map +1 -0
- package/dist/chunk-77QZQ377.cjs +155 -0
- package/dist/chunk-77QZQ377.cjs.map +1 -0
- package/dist/chunk-ABFPJZJL.cjs +131 -0
- package/dist/chunk-ABFPJZJL.cjs.map +1 -0
- package/dist/chunk-FOQFLMOC.js +2336 -0
- package/dist/chunk-FOQFLMOC.js.map +1 -0
- package/dist/chunk-I7UUR5MZ.cjs +91 -0
- package/dist/chunk-I7UUR5MZ.cjs.map +1 -0
- package/dist/chunk-L6F5QUH2.js +129 -0
- package/dist/chunk-L6F5QUH2.js.map +1 -0
- package/dist/chunk-PY7I7OEN.cjs +92 -0
- package/dist/chunk-PY7I7OEN.cjs.map +1 -0
- package/dist/chunk-SX2AYX5F.js +18 -0
- package/dist/chunk-SX2AYX5F.js.map +1 -0
- package/dist/chunk-WFDR7OMY.js +148 -0
- package/dist/chunk-WFDR7OMY.js.map +1 -0
- package/dist/chunk-Z7XZQBAK.cjs +2339 -0
- package/dist/chunk-Z7XZQBAK.cjs.map +1 -0
- package/dist/fs.cjs +19 -2372
- package/dist/fs.cjs.map +1 -1
- package/dist/fs.js +3 -2373
- package/dist/fs.js.map +1 -1
- package/dist/index.cjs +209 -3251
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +139 -3473
- package/dist/index.js.map +1 -1
- package/dist/logger.cjs +18 -141
- package/dist/logger.cjs.map +1 -1
- package/dist/logger.js +2 -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 +29 -534
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +10 -526
- package/dist/utils.js.map +1 -1
- package/package.json +5 -5
- package/src/BarrelManager.ts +3 -3
- package/src/FileManager.ts +6 -5
- package/src/utils/FunctionParams.ts +2 -2
- package/src/utils/URLPath.ts +5 -5
package/dist/index.cjs
CHANGED
|
@@ -2,22 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var chunkABFPJZJL_cjs = require('./chunk-ABFPJZJL.cjs');
|
|
6
|
+
var chunk72O327DC_cjs = require('./chunk-72O327DC.cjs');
|
|
7
|
+
require('./chunk-PY7I7OEN.cjs');
|
|
8
|
+
var chunk77QZQ377_cjs = require('./chunk-77QZQ377.cjs');
|
|
9
|
+
var chunkZ7XZQBAK_cjs = require('./chunk-Z7XZQBAK.cjs');
|
|
10
|
+
var chunkI7UUR5MZ_cjs = require('./chunk-I7UUR5MZ.cjs');
|
|
11
|
+
var crypto = require('crypto');
|
|
6
12
|
var path4 = require('path');
|
|
7
|
-
var jsRuntime = require('js-runtime');
|
|
8
|
-
var crypto2 = require('crypto');
|
|
9
13
|
var parser = require('@kubb/parser');
|
|
10
14
|
var factory = require('@kubb/parser/factory');
|
|
11
15
|
var naturalOrderby = require('natural-orderby');
|
|
12
16
|
var dirTree = require('directory-tree');
|
|
13
|
-
var seedrandom = require('seedrandom');
|
|
14
|
-
var events = require('events');
|
|
15
|
-
var perf_hooks = require('perf_hooks');
|
|
16
17
|
var mod = require('module');
|
|
17
18
|
var os = require('os');
|
|
18
19
|
var url = require('url');
|
|
19
|
-
var
|
|
20
|
-
var
|
|
20
|
+
var process = require('process');
|
|
21
|
+
var fs = require('fs');
|
|
21
22
|
var semver = require('semver');
|
|
22
23
|
|
|
23
24
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -40,2301 +41,19 @@ function _interopNamespace(e) {
|
|
|
40
41
|
return Object.freeze(n);
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
var crypto__default = /*#__PURE__*/_interopDefault(crypto);
|
|
43
45
|
var path4__default = /*#__PURE__*/_interopDefault(path4);
|
|
44
|
-
var crypto2__default = /*#__PURE__*/_interopDefault(crypto2);
|
|
45
46
|
var factory__namespace = /*#__PURE__*/_interopNamespace(factory);
|
|
46
47
|
var dirTree__default = /*#__PURE__*/_interopDefault(dirTree);
|
|
47
|
-
var seedrandom__default = /*#__PURE__*/_interopDefault(seedrandom);
|
|
48
48
|
var mod__default = /*#__PURE__*/_interopDefault(mod);
|
|
49
49
|
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
|
-
});
|
|
50
|
+
var process__default = /*#__PURE__*/_interopDefault(process);
|
|
51
|
+
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
2333
52
|
|
|
2334
53
|
// ../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js
|
|
2335
|
-
var require_lodash = __commonJS({
|
|
54
|
+
var require_lodash = chunkI7UUR5MZ_cjs.__commonJS({
|
|
2336
55
|
"../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js"(exports, module) {
|
|
2337
|
-
init_cjs_shims();
|
|
56
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
2338
57
|
var LARGE_ARRAY_SIZE = 200;
|
|
2339
58
|
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
2340
59
|
var COMPARE_PARTIAL_FLAG = 1;
|
|
@@ -2468,14 +187,14 @@ var require_lodash = __commonJS({
|
|
|
2468
187
|
var reIsNative = RegExp(
|
|
2469
188
|
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
2470
189
|
);
|
|
2471
|
-
var
|
|
190
|
+
var Buffer = moduleExports ? root.Buffer : void 0;
|
|
2472
191
|
var Symbol2 = root.Symbol;
|
|
2473
|
-
var
|
|
192
|
+
var Uint8Array = root.Uint8Array;
|
|
2474
193
|
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
2475
194
|
var splice = arrayProto.splice;
|
|
2476
195
|
var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
2477
196
|
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
2478
|
-
var nativeIsBuffer =
|
|
197
|
+
var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
|
|
2479
198
|
var nativeKeys = overArg(Object.keys, Object);
|
|
2480
199
|
var DataView = getNative(root, "DataView");
|
|
2481
200
|
var Map2 = getNative(root, "Map");
|
|
@@ -2818,7 +537,7 @@ var require_lodash = __commonJS({
|
|
|
2818
537
|
object = object.buffer;
|
|
2819
538
|
other = other.buffer;
|
|
2820
539
|
case arrayBufferTag:
|
|
2821
|
-
if (object.byteLength != other.byteLength || !equalFunc(new
|
|
540
|
+
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
|
|
2822
541
|
return false;
|
|
2823
542
|
}
|
|
2824
543
|
return true;
|
|
@@ -3034,521 +753,13 @@ var require_lodash = __commonJS({
|
|
|
3034
753
|
});
|
|
3035
754
|
|
|
3036
755
|
// src/index.ts
|
|
3037
|
-
init_cjs_shims();
|
|
756
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
3038
757
|
|
|
3039
758
|
// 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
|
-
}
|
|
3113
|
-
|
|
3114
|
-
// src/fs/read.ts
|
|
3115
|
-
init_cjs_shims();
|
|
3116
|
-
var import_fs_extra2 = __toESM(require_lib(), 1);
|
|
3117
|
-
function slash(path5, platform = "linux") {
|
|
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)))}`;
|
|
3134
|
-
}
|
|
3135
|
-
var reader = jsRuntime.switcher(
|
|
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);
|
|
3160
|
-
}
|
|
3161
|
-
|
|
3162
|
-
// src/utils/URLPath.ts
|
|
3163
|
-
init_cjs_shims();
|
|
3164
|
-
|
|
3165
|
-
// src/transformers/index.ts
|
|
3166
|
-
init_cjs_shims();
|
|
3167
|
-
|
|
3168
|
-
// src/transformers/casing.ts
|
|
3169
|
-
init_cjs_shims();
|
|
3170
|
-
|
|
3171
|
-
// ../../node_modules/.pnpm/change-case@5.2.0/node_modules/change-case/dist/index.js
|
|
3172
|
-
init_cjs_shims();
|
|
3173
|
-
var SPLIT_LOWER_UPPER_RE = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
3174
|
-
var SPLIT_UPPER_UPPER_RE = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
3175
|
-
var SPLIT_NUMBER_LOWER_RE = /(\d)(\p{Ll})/gu;
|
|
3176
|
-
var SPLIT_LETTER_NUMBER_RE = /(\p{L})(\d)/gu;
|
|
3177
|
-
var DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
|
|
3178
|
-
var SPLIT_REPLACE_VALUE = "$1\0$2";
|
|
3179
|
-
var DEFAULT_PREFIX_CHARACTERS = "";
|
|
3180
|
-
function split(input, options) {
|
|
3181
|
-
let result = input.trim();
|
|
3182
|
-
result = result.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
|
|
3183
|
-
if (options?.separateNumbers) {
|
|
3184
|
-
result = result.replace(SPLIT_NUMBER_LOWER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_LETTER_NUMBER_RE, SPLIT_REPLACE_VALUE);
|
|
3185
|
-
}
|
|
3186
|
-
result = result.replace(DEFAULT_STRIP_REGEXP, "\0");
|
|
3187
|
-
let start = 0;
|
|
3188
|
-
let end = result.length;
|
|
3189
|
-
while (result.charAt(start) === "\0")
|
|
3190
|
-
start++;
|
|
3191
|
-
if (start === end)
|
|
3192
|
-
return [];
|
|
3193
|
-
while (result.charAt(end - 1) === "\0")
|
|
3194
|
-
end--;
|
|
3195
|
-
return result.slice(start, end).split(/\0/g);
|
|
3196
|
-
}
|
|
3197
|
-
function camelCase(input, options) {
|
|
3198
|
-
const prefix = getPrefix(input, options?.prefixCharacters);
|
|
3199
|
-
const lower = lowerFactory(options?.locale);
|
|
3200
|
-
const upper = upperFactory(options?.locale);
|
|
3201
|
-
const transform = options?.mergeAmbiguousCharacters ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
|
|
3202
|
-
return prefix + split(input, options).map((word, index) => {
|
|
3203
|
-
if (index === 0)
|
|
3204
|
-
return lower(word);
|
|
3205
|
-
return transform(word, index);
|
|
3206
|
-
}).join(options?.delimiter ?? "");
|
|
3207
|
-
}
|
|
3208
|
-
function pascalCase(input, options) {
|
|
3209
|
-
const prefix = getPrefix(input, options?.prefixCharacters);
|
|
3210
|
-
const lower = lowerFactory(options?.locale);
|
|
3211
|
-
const upper = upperFactory(options?.locale);
|
|
3212
|
-
const transform = options?.mergeAmbiguousCharacters ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
|
|
3213
|
-
return prefix + split(input, options).map(transform).join(options?.delimiter ?? "");
|
|
3214
|
-
}
|
|
3215
|
-
function lowerFactory(locale) {
|
|
3216
|
-
return locale === false ? (input) => input.toLowerCase() : (input) => input.toLocaleLowerCase(locale);
|
|
3217
|
-
}
|
|
3218
|
-
function upperFactory(locale) {
|
|
3219
|
-
return locale === false ? (input) => input.toUpperCase() : (input) => input.toLocaleUpperCase(locale);
|
|
3220
|
-
}
|
|
3221
|
-
function capitalCaseTransformFactory(lower, upper) {
|
|
3222
|
-
return (word) => `${upper(word[0])}${lower(word.slice(1))}`;
|
|
3223
|
-
}
|
|
3224
|
-
function pascalCaseTransformFactory(lower, upper) {
|
|
3225
|
-
return (word, index) => {
|
|
3226
|
-
const char0 = word[0];
|
|
3227
|
-
const initial = index > 0 && char0 >= "0" && char0 <= "9" ? "_" + char0 : upper(char0);
|
|
3228
|
-
return initial + lower(word.slice(1));
|
|
3229
|
-
};
|
|
3230
|
-
}
|
|
3231
|
-
function getPrefix(input, prefixCharacters = DEFAULT_PREFIX_CHARACTERS) {
|
|
3232
|
-
let prefix = "";
|
|
3233
|
-
for (let i = 0; i < input.length; i++) {
|
|
3234
|
-
const char = input.charAt(i);
|
|
3235
|
-
if (prefixCharacters.includes(char)) {
|
|
3236
|
-
prefix += char;
|
|
3237
|
-
} else {
|
|
3238
|
-
break;
|
|
3239
|
-
}
|
|
3240
|
-
}
|
|
3241
|
-
return prefix;
|
|
3242
|
-
}
|
|
3243
|
-
|
|
3244
|
-
// src/transformers/casing.ts
|
|
3245
|
-
function camelCase2(text) {
|
|
3246
|
-
return camelCase(text, { delimiter: "", mergeAmbiguousCharacters: true });
|
|
3247
|
-
}
|
|
3248
|
-
function pascalCase2(text) {
|
|
3249
|
-
return pascalCase(text, { delimiter: "", mergeAmbiguousCharacters: true });
|
|
3250
|
-
}
|
|
3251
|
-
|
|
3252
|
-
// src/transformers/combineCodes.ts
|
|
3253
|
-
init_cjs_shims();
|
|
3254
|
-
function combineCodes(codes) {
|
|
3255
|
-
return codes.join("\n");
|
|
3256
|
-
}
|
|
3257
|
-
|
|
3258
|
-
// src/transformers/createJSDocBlockText.ts
|
|
3259
|
-
init_cjs_shims();
|
|
3260
|
-
function createJSDocBlockText({ comments }) {
|
|
3261
|
-
const filteredComments = comments.filter(Boolean);
|
|
3262
|
-
if (!filteredComments.length) {
|
|
3263
|
-
return "";
|
|
3264
|
-
}
|
|
3265
|
-
return `/**
|
|
3266
|
-
* ${filteredComments.join("\n * ")}
|
|
3267
|
-
*/`;
|
|
3268
|
-
}
|
|
3269
|
-
|
|
3270
|
-
// src/transformers/escape.ts
|
|
3271
|
-
init_cjs_shims();
|
|
3272
|
-
function escape(text) {
|
|
3273
|
-
return text ? text.replaceAll("`", "\\`") : "";
|
|
3274
|
-
}
|
|
3275
|
-
function jsStringEscape(input) {
|
|
3276
|
-
return `${input}`.replace(/["'\\\n\r\u2028\u2029]/g, (character) => {
|
|
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 "";
|
|
3292
|
-
}
|
|
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;
|
|
3307
|
-
}
|
|
3308
|
-
if (a.name > b2.name) {
|
|
3309
|
-
return 1;
|
|
3310
|
-
}
|
|
3311
|
-
return 0;
|
|
3312
|
-
}
|
|
3313
|
-
|
|
3314
|
-
// src/transformers/searchAndReplace.ts
|
|
3315
|
-
init_cjs_shims();
|
|
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}`;
|
|
3422
|
-
}
|
|
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
|
-
};
|
|
3452
|
-
|
|
3453
|
-
// src/utils/URLPath.ts
|
|
3454
|
-
var URLPath = class {
|
|
3455
|
-
constructor(path5) {
|
|
3456
|
-
this.path = path5;
|
|
3457
|
-
return this;
|
|
3458
|
-
}
|
|
3459
|
-
/**
|
|
3460
|
-
* Convert Swagger path to URLPath(syntax of Express)
|
|
3461
|
-
* @example /pet/{petId} => /pet/:petId
|
|
3462
|
-
*/
|
|
3463
|
-
get URL() {
|
|
3464
|
-
return this.toURLPath();
|
|
3465
|
-
}
|
|
3466
|
-
get isURL() {
|
|
3467
|
-
try {
|
|
3468
|
-
const url = new URL(this.path);
|
|
3469
|
-
if (url?.href) {
|
|
3470
|
-
return true;
|
|
3471
|
-
}
|
|
3472
|
-
} catch (error) {
|
|
3473
|
-
return false;
|
|
3474
|
-
}
|
|
3475
|
-
return false;
|
|
3476
|
-
}
|
|
3477
|
-
/**
|
|
3478
|
-
* Convert Swagger path to template literals/ template strings(camelcase)
|
|
3479
|
-
* @example /pet/{petId} => `/pet/${petId}`
|
|
3480
|
-
* @example /account/monetary-accountID => `/account/${monetaryAccountId}`
|
|
3481
|
-
* @example /account/userID => `/account/${userId}`
|
|
3482
|
-
*/
|
|
3483
|
-
get template() {
|
|
3484
|
-
return this.toTemplateString();
|
|
3485
|
-
}
|
|
3486
|
-
get object() {
|
|
3487
|
-
return this.toObject();
|
|
3488
|
-
}
|
|
3489
|
-
get params() {
|
|
3490
|
-
return this.getParams();
|
|
3491
|
-
}
|
|
3492
|
-
toObject({ type = "path", replacer, stringify } = {}) {
|
|
3493
|
-
const object = {
|
|
3494
|
-
url: type === "path" ? this.toURLPath() : this.toTemplateString(replacer),
|
|
3495
|
-
params: this.getParams()
|
|
3496
|
-
};
|
|
3497
|
-
if (stringify) {
|
|
3498
|
-
if (type === "template") {
|
|
3499
|
-
return JSON.stringify(object).replaceAll("'", "").replaceAll(`"`, "");
|
|
3500
|
-
}
|
|
3501
|
-
if (object.params) {
|
|
3502
|
-
return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll("'", "").replaceAll(`"`, "")} }`;
|
|
3503
|
-
}
|
|
3504
|
-
return `{ url: '${object.url}' }`;
|
|
3505
|
-
}
|
|
3506
|
-
return object;
|
|
3507
|
-
}
|
|
3508
|
-
/**
|
|
3509
|
-
* Convert Swagger path to template literals/ template strings(camelcase)
|
|
3510
|
-
* @example /pet/{petId} => `/pet/${petId}`
|
|
3511
|
-
* @example /account/monetary-accountID => `/account/${monetaryAccountId}`
|
|
3512
|
-
* @example /account/userID => `/account/${userId}`
|
|
3513
|
-
*/
|
|
3514
|
-
toTemplateString(replacer) {
|
|
3515
|
-
const regex = /{(\w|-)*}/g;
|
|
3516
|
-
const found = this.path.match(regex);
|
|
3517
|
-
let newPath = this.path.replaceAll("{", "${");
|
|
3518
|
-
if (found) {
|
|
3519
|
-
newPath = found.reduce((prev, curr) => {
|
|
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}\``;
|
|
3526
|
-
}
|
|
3527
|
-
getParams(replacer) {
|
|
3528
|
-
const regex = /{(\w|-)*}/g;
|
|
3529
|
-
const found = this.path.match(regex);
|
|
3530
|
-
if (!found) {
|
|
3531
|
-
return void 0;
|
|
3532
|
-
}
|
|
3533
|
-
const params = {};
|
|
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;
|
|
3540
|
-
}
|
|
3541
|
-
/**
|
|
3542
|
-
* Convert Swagger path to URLPath(syntax of Express)
|
|
3543
|
-
* @example /pet/{petId} => /pet/:petId
|
|
3544
|
-
*/
|
|
3545
|
-
toURLPath() {
|
|
3546
|
-
return this.path.replaceAll("{", ":").replaceAll("}", "");
|
|
3547
|
-
}
|
|
3548
|
-
};
|
|
759
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
3549
760
|
|
|
3550
761
|
// src/config.ts
|
|
3551
|
-
init_cjs_shims();
|
|
762
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
3552
763
|
function defineConfig(options) {
|
|
3553
764
|
return options;
|
|
3554
765
|
}
|
|
@@ -3557,88 +768,14 @@ function isInputPath(result) {
|
|
|
3557
768
|
}
|
|
3558
769
|
|
|
3559
770
|
// src/FileManager.ts
|
|
3560
|
-
init_cjs_shims();
|
|
3561
|
-
var import_lodash = __toESM(require_lodash(), 1);
|
|
3562
|
-
|
|
3563
|
-
// src/fs/write.ts
|
|
3564
|
-
init_cjs_shims();
|
|
3565
|
-
var import_fs_extra3 = __toESM(require_lib(), 1);
|
|
3566
|
-
async function saveCreateDirectory(path5) {
|
|
3567
|
-
const passedPath = path4.dirname(path4.resolve(path5));
|
|
3568
|
-
await import_fs_extra3.default.mkdir(passedPath, { recursive: true });
|
|
3569
|
-
}
|
|
3570
|
-
var writer = jsRuntime.switcher(
|
|
3571
|
-
{
|
|
3572
|
-
node: async (path5, data) => {
|
|
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) {
|
|
3580
|
-
}
|
|
3581
|
-
await saveCreateDirectory(path5);
|
|
3582
|
-
await import_fs_extra3.default.writeFile(path4.resolve(path5), data, { encoding: "utf-8" });
|
|
3583
|
-
const savedData = await import_fs_extra3.default.readFile(path4.resolve(path5), { encoding: "utf-8" });
|
|
3584
|
-
if (savedData?.toString() !== data?.toString()) {
|
|
3585
|
-
throw new Error(`Sanity check failed for ${path5}
|
|
3586
|
-
|
|
3587
|
-
Data[${data.length}]:
|
|
3588
|
-
${data}
|
|
3589
|
-
|
|
3590
|
-
Saved[${savedData.length}]:
|
|
3591
|
-
${savedData}
|
|
3592
|
-
`);
|
|
3593
|
-
}
|
|
3594
|
-
return savedData;
|
|
3595
|
-
},
|
|
3596
|
-
bun: async (path5, data) => {
|
|
3597
|
-
try {
|
|
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));
|
|
3615
|
-
}
|
|
3616
|
-
}
|
|
3617
|
-
},
|
|
3618
|
-
"node"
|
|
3619
|
-
);
|
|
3620
|
-
async function write(data, path5) {
|
|
3621
|
-
if (data.trim() === "") {
|
|
3622
|
-
return void 0;
|
|
3623
|
-
}
|
|
3624
|
-
return writer(path5, data.trim());
|
|
3625
|
-
}
|
|
3626
|
-
|
|
3627
|
-
// src/utils/timeout.ts
|
|
3628
|
-
init_cjs_shims();
|
|
3629
|
-
async function timeout(ms) {
|
|
3630
|
-
return new Promise((resolve3) => {
|
|
3631
|
-
setTimeout(() => {
|
|
3632
|
-
resolve3(true);
|
|
3633
|
-
}, ms);
|
|
3634
|
-
});
|
|
3635
|
-
}
|
|
771
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
772
|
+
var import_lodash = chunkI7UUR5MZ_cjs.__toESM(require_lodash(), 1);
|
|
3636
773
|
|
|
3637
774
|
// src/BarrelManager.ts
|
|
3638
|
-
init_cjs_shims();
|
|
775
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
3639
776
|
|
|
3640
777
|
// src/utils/TreeNode.ts
|
|
3641
|
-
init_cjs_shims();
|
|
778
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
3642
779
|
var TreeNode = class _TreeNode {
|
|
3643
780
|
constructor(data, parent) {
|
|
3644
781
|
this.children = [];
|
|
@@ -3729,12 +866,12 @@ var TreeNode = class _TreeNode {
|
|
|
3729
866
|
var _options;
|
|
3730
867
|
var BarrelManager = class {
|
|
3731
868
|
constructor(options = {}) {
|
|
3732
|
-
__privateAdd(this, _options, void 0);
|
|
3733
|
-
__privateSet(this, _options, options);
|
|
869
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _options, void 0);
|
|
870
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _options, options);
|
|
3734
871
|
return this;
|
|
3735
872
|
}
|
|
3736
873
|
getIndexes(pathToBuild) {
|
|
3737
|
-
const { treeNode = {}, isTypeOnly, extName } = __privateGet(this, _options);
|
|
874
|
+
const { treeNode = {}, isTypeOnly, extName } = chunkI7UUR5MZ_cjs.__privateGet(this, _options);
|
|
3738
875
|
const tree = TreeNode.build(pathToBuild, treeNode);
|
|
3739
876
|
if (!tree) {
|
|
3740
877
|
return null;
|
|
@@ -3746,7 +883,7 @@ var BarrelManager = class {
|
|
|
3746
883
|
if (treeNode2.children.length > 1) {
|
|
3747
884
|
const indexPath = path4__default.default.resolve(treeNode2.data.path, "index.ts");
|
|
3748
885
|
const exports = treeNode2.children.filter(Boolean).map((file) => {
|
|
3749
|
-
const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${
|
|
886
|
+
const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${chunkABFPJZJL_cjs.trimExtName(file.data.name)}`;
|
|
3750
887
|
if (importPath.endsWith("index") && file.data.type === "file") {
|
|
3751
888
|
return void 0;
|
|
3752
889
|
}
|
|
@@ -3767,7 +904,7 @@ var BarrelManager = class {
|
|
|
3767
904
|
} else if (treeNode2.children.length === 1) {
|
|
3768
905
|
const [treeNodeChild] = treeNode2.children;
|
|
3769
906
|
const indexPath = path4__default.default.resolve(treeNode2.data.path, "index.ts");
|
|
3770
|
-
const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${
|
|
907
|
+
const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${chunkABFPJZJL_cjs.trimExtName(treeNodeChild.data.name)}`;
|
|
3771
908
|
const exports = [
|
|
3772
909
|
{
|
|
3773
910
|
path: extName ? `${importPath}${extName}` : importPath,
|
|
@@ -3801,40 +938,40 @@ exports.KubbFile = void 0;
|
|
|
3801
938
|
var _cache, _task, _isWriting, _timeout, _queue, _validate, _add, add_fn, _addOrAppend, addOrAppend_fn;
|
|
3802
939
|
var _FileManager = class _FileManager {
|
|
3803
940
|
constructor(options) {
|
|
3804
|
-
__privateAdd(this, _validate);
|
|
3805
|
-
__privateAdd(this, _add);
|
|
3806
|
-
__privateAdd(this, _addOrAppend);
|
|
3807
|
-
__privateAdd(this, _cache, /* @__PURE__ */ new Map());
|
|
3808
|
-
__privateAdd(this, _task, void 0);
|
|
3809
|
-
__privateAdd(this, _isWriting, false);
|
|
941
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _validate);
|
|
942
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _add);
|
|
943
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _addOrAppend);
|
|
944
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _cache, /* @__PURE__ */ new Map());
|
|
945
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _task, void 0);
|
|
946
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _isWriting, false);
|
|
3810
947
|
/**
|
|
3811
948
|
* Timeout between writes
|
|
3812
949
|
*/
|
|
3813
|
-
__privateAdd(this, _timeout, 0);
|
|
3814
|
-
__privateAdd(this, _queue, void 0);
|
|
950
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _timeout, 0);
|
|
951
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _queue, void 0);
|
|
3815
952
|
if (options) {
|
|
3816
|
-
__privateSet(this, _task, options.task);
|
|
3817
|
-
__privateSet(this, _queue, options.queue);
|
|
3818
|
-
__privateSet(this, _timeout, options.timeout || 0);
|
|
953
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _task, options.task);
|
|
954
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _queue, options.queue);
|
|
955
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _timeout, options.timeout || 0);
|
|
3819
956
|
}
|
|
3820
957
|
return this;
|
|
3821
958
|
}
|
|
3822
959
|
get files() {
|
|
3823
960
|
const files = [];
|
|
3824
|
-
__privateGet(this, _cache).forEach((item) => {
|
|
961
|
+
chunkI7UUR5MZ_cjs.__privateGet(this, _cache).forEach((item) => {
|
|
3825
962
|
files.push(...item.flat(1));
|
|
3826
963
|
});
|
|
3827
964
|
return files;
|
|
3828
965
|
}
|
|
3829
966
|
get isExecuting() {
|
|
3830
|
-
return __privateGet(this, _queue)?.hasJobs ?? __privateGet(this, _isWriting) ?? false;
|
|
967
|
+
return chunkI7UUR5MZ_cjs.__privateGet(this, _queue)?.hasJobs ?? chunkI7UUR5MZ_cjs.__privateGet(this, _isWriting) ?? false;
|
|
3831
968
|
}
|
|
3832
969
|
async add(...files) {
|
|
3833
970
|
const promises = files.map((file) => {
|
|
3834
971
|
if (file.override) {
|
|
3835
|
-
return __privateMethod(this, _add, add_fn).call(this, file);
|
|
972
|
+
return chunkI7UUR5MZ_cjs.__privateMethod(this, _add, add_fn).call(this, file);
|
|
3836
973
|
}
|
|
3837
|
-
return __privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, file);
|
|
974
|
+
return chunkI7UUR5MZ_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, file);
|
|
3838
975
|
});
|
|
3839
976
|
const resolvedFiles = await Promise.all(promises);
|
|
3840
977
|
if (files.length > 1) {
|
|
@@ -3869,13 +1006,13 @@ var _FileManager = class _FileManager {
|
|
|
3869
1006
|
}
|
|
3870
1007
|
]
|
|
3871
1008
|
};
|
|
3872
|
-
await __privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
1009
|
+
await chunkI7UUR5MZ_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
3873
1010
|
...rootFile,
|
|
3874
1011
|
meta: meta ? meta : rootFile.meta
|
|
3875
1012
|
});
|
|
3876
1013
|
return await Promise.all(
|
|
3877
1014
|
files.map((file) => {
|
|
3878
|
-
return __privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
1015
|
+
return chunkI7UUR5MZ_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
3879
1016
|
...file,
|
|
3880
1017
|
meta: meta ? meta : file.meta
|
|
3881
1018
|
});
|
|
@@ -3884,33 +1021,33 @@ var _FileManager = class _FileManager {
|
|
|
3884
1021
|
}
|
|
3885
1022
|
getCacheByUUID(UUID) {
|
|
3886
1023
|
let cache;
|
|
3887
|
-
__privateGet(this, _cache).forEach((files) => {
|
|
1024
|
+
chunkI7UUR5MZ_cjs.__privateGet(this, _cache).forEach((files) => {
|
|
3888
1025
|
cache = files.find((item) => item.id === UUID);
|
|
3889
1026
|
});
|
|
3890
1027
|
return cache;
|
|
3891
1028
|
}
|
|
3892
1029
|
get(path5) {
|
|
3893
|
-
return __privateGet(this, _cache).get(path5);
|
|
1030
|
+
return chunkI7UUR5MZ_cjs.__privateGet(this, _cache).get(path5);
|
|
3894
1031
|
}
|
|
3895
1032
|
remove(path5) {
|
|
3896
1033
|
const cacheItem = this.get(path5);
|
|
3897
1034
|
if (!cacheItem) {
|
|
3898
1035
|
return;
|
|
3899
1036
|
}
|
|
3900
|
-
__privateGet(this, _cache).delete(path5);
|
|
1037
|
+
chunkI7UUR5MZ_cjs.__privateGet(this, _cache).delete(path5);
|
|
3901
1038
|
}
|
|
3902
1039
|
async write(...params) {
|
|
3903
|
-
if (!__privateGet(this, _isWriting)) {
|
|
3904
|
-
__privateSet(this, _isWriting, true);
|
|
3905
|
-
const text = await write(...params);
|
|
3906
|
-
__privateSet(this, _isWriting, false);
|
|
1040
|
+
if (!chunkI7UUR5MZ_cjs.__privateGet(this, _isWriting)) {
|
|
1041
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _isWriting, true);
|
|
1042
|
+
const text = await chunkZ7XZQBAK_cjs.write(...params);
|
|
1043
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _isWriting, false);
|
|
3907
1044
|
return text;
|
|
3908
1045
|
}
|
|
3909
|
-
await timeout(__privateGet(this, _timeout));
|
|
1046
|
+
await chunk72O327DC_cjs.timeout(chunkI7UUR5MZ_cjs.__privateGet(this, _timeout));
|
|
3910
1047
|
return this.write(...params);
|
|
3911
1048
|
}
|
|
3912
1049
|
async read(...params) {
|
|
3913
|
-
return read(...params);
|
|
1050
|
+
return chunkZ7XZQBAK_cjs.read(...params);
|
|
3914
1051
|
}
|
|
3915
1052
|
// statics
|
|
3916
1053
|
static getSource(file) {
|
|
@@ -3938,13 +1075,13 @@ _validate = new WeakSet();
|
|
|
3938
1075
|
_add = new WeakSet();
|
|
3939
1076
|
add_fn = async function(file) {
|
|
3940
1077
|
const controller = new AbortController();
|
|
3941
|
-
const resolvedFile = { id:
|
|
3942
|
-
__privateGet(this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
|
|
3943
|
-
if (__privateGet(this, _queue)) {
|
|
3944
|
-
await __privateGet(this, _queue).run(
|
|
1078
|
+
const resolvedFile = { id: crypto__default.default.randomUUID(), name: chunkABFPJZJL_cjs.trimExtName(file.baseName), ...file };
|
|
1079
|
+
chunkI7UUR5MZ_cjs.__privateGet(this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
|
|
1080
|
+
if (chunkI7UUR5MZ_cjs.__privateGet(this, _queue)) {
|
|
1081
|
+
await chunkI7UUR5MZ_cjs.__privateGet(this, _queue).run(
|
|
3945
1082
|
async () => {
|
|
3946
1083
|
var _a;
|
|
3947
|
-
return (_a = __privateGet(this, _task)) == null ? void 0 : _a.call(this, resolvedFile);
|
|
1084
|
+
return (_a = chunkI7UUR5MZ_cjs.__privateGet(this, _task)) == null ? void 0 : _a.call(this, resolvedFile);
|
|
3948
1085
|
},
|
|
3949
1086
|
{ controller }
|
|
3950
1087
|
);
|
|
@@ -3953,11 +1090,11 @@ add_fn = async function(file) {
|
|
|
3953
1090
|
};
|
|
3954
1091
|
_addOrAppend = new WeakSet();
|
|
3955
1092
|
addOrAppend_fn = async function(file) {
|
|
3956
|
-
const previousCaches = __privateGet(this, _cache).get(file.path);
|
|
1093
|
+
const previousCaches = chunkI7UUR5MZ_cjs.__privateGet(this, _cache).get(file.path);
|
|
3957
1094
|
const previousCache = previousCaches ? previousCaches.at(previousCaches.length - 1) : void 0;
|
|
3958
1095
|
if (previousCache) {
|
|
3959
|
-
__privateGet(this, _cache).delete(previousCache.path);
|
|
3960
|
-
return __privateMethod(this, _add, add_fn).call(this, {
|
|
1096
|
+
chunkI7UUR5MZ_cjs.__privateGet(this, _cache).delete(previousCache.path);
|
|
1097
|
+
return chunkI7UUR5MZ_cjs.__privateMethod(this, _add, add_fn).call(this, {
|
|
3961
1098
|
...file,
|
|
3962
1099
|
source: previousCache.source && file.source ? `${previousCache.source}
|
|
3963
1100
|
${file.source}` : "",
|
|
@@ -3966,7 +1103,7 @@ ${file.source}` : "",
|
|
|
3966
1103
|
env: { ...previousCache.env || {}, ...file.env || {} }
|
|
3967
1104
|
});
|
|
3968
1105
|
}
|
|
3969
|
-
return __privateMethod(this, _add, add_fn).call(this, file);
|
|
1106
|
+
return chunkI7UUR5MZ_cjs.__privateMethod(this, _add, add_fn).call(this, file);
|
|
3970
1107
|
};
|
|
3971
1108
|
var FileManager = _FileManager;
|
|
3972
1109
|
function getSource(file) {
|
|
@@ -3976,11 +1113,11 @@ function getSource(file) {
|
|
|
3976
1113
|
const exports = file.exports ? combineExports(file.exports) : [];
|
|
3977
1114
|
const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
|
|
3978
1115
|
const importNodes = imports.filter((item) => {
|
|
3979
|
-
return item.path !==
|
|
1116
|
+
return item.path !== chunkABFPJZJL_cjs.trimExtName(file.path);
|
|
3980
1117
|
}).map((item) => {
|
|
3981
1118
|
return factory__namespace.createImportDeclaration({
|
|
3982
1119
|
name: item.name,
|
|
3983
|
-
path: item.root ? getRelativePath(item.root, item.path) : item.path,
|
|
1120
|
+
path: item.root ? chunkZ7XZQBAK_cjs.getRelativePath(item.root, item.path) : item.path,
|
|
3984
1121
|
isTypeOnly: item.isTypeOnly
|
|
3985
1122
|
});
|
|
3986
1123
|
});
|
|
@@ -4082,198 +1219,19 @@ function getEnvSource(source, env) {
|
|
|
4082
1219
|
throw new TypeError(`Environment should be in upperCase for ${key}`);
|
|
4083
1220
|
}
|
|
4084
1221
|
if (typeof replaceBy === "string") {
|
|
4085
|
-
prev =
|
|
4086
|
-
prev =
|
|
1222
|
+
prev = chunkABFPJZJL_cjs.searchAndReplace({ text: prev.replaceAll(`process.env.${key}`, replaceBy), replaceBy, prefix: "process.env", key });
|
|
1223
|
+
prev = chunkABFPJZJL_cjs.searchAndReplace({ text: prev.replaceAll(new RegExp(`(declare const).*
|
|
4087
1224
|
`, "ig"), ""), replaceBy, key });
|
|
4088
1225
|
}
|
|
4089
1226
|
return prev;
|
|
4090
1227
|
}, source);
|
|
4091
1228
|
}
|
|
4092
1229
|
|
|
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
1230
|
// src/PluginManager.ts
|
|
4165
|
-
init_cjs_shims();
|
|
4166
|
-
|
|
4167
|
-
// src/utils/EventEmitter.ts
|
|
4168
|
-
init_cjs_shims();
|
|
4169
|
-
var _emitter;
|
|
4170
|
-
var EventEmitter = class {
|
|
4171
|
-
constructor() {
|
|
4172
|
-
__privateAdd(this, _emitter, new events.EventEmitter());
|
|
4173
|
-
__privateGet(this, _emitter).setMaxListeners(100);
|
|
4174
|
-
}
|
|
4175
|
-
emit(eventName, ...eventArg) {
|
|
4176
|
-
__privateGet(this, _emitter).emit(eventName, ...eventArg);
|
|
4177
|
-
}
|
|
4178
|
-
on(eventName, handler) {
|
|
4179
|
-
__privateGet(this, _emitter).on(eventName, handler);
|
|
4180
|
-
}
|
|
4181
|
-
off(eventName, handler) {
|
|
4182
|
-
__privateGet(this, _emitter).off(eventName, handler);
|
|
4183
|
-
}
|
|
4184
|
-
removeAll() {
|
|
4185
|
-
__privateGet(this, _emitter).removeAllListeners();
|
|
4186
|
-
}
|
|
4187
|
-
};
|
|
4188
|
-
_emitter = new WeakMap();
|
|
4189
|
-
|
|
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
|
-
}
|
|
1231
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
4274
1232
|
|
|
4275
1233
|
// src/errors.ts
|
|
4276
|
-
init_cjs_shims();
|
|
1234
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
4277
1235
|
var Warning = class extends Error {
|
|
4278
1236
|
constructor(message, options) {
|
|
4279
1237
|
super(message, { cause: options?.cause });
|
|
@@ -4284,10 +1242,10 @@ var ValidationPluginError = class extends Error {
|
|
|
4284
1242
|
};
|
|
4285
1243
|
|
|
4286
1244
|
// src/plugin.ts
|
|
4287
|
-
init_cjs_shims();
|
|
1245
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
4288
1246
|
|
|
4289
1247
|
// src/utils/cache.ts
|
|
4290
|
-
init_cjs_shims();
|
|
1248
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
4291
1249
|
function createPluginCache(Store = /* @__PURE__ */ Object.create(null)) {
|
|
4292
1250
|
return {
|
|
4293
1251
|
set(id, value) {
|
|
@@ -4365,10 +1323,10 @@ var definePlugin = createPlugin((options) => {
|
|
|
4365
1323
|
});
|
|
4366
1324
|
|
|
4367
1325
|
// src/PromiseManager.ts
|
|
4368
|
-
init_cjs_shims();
|
|
1326
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
4369
1327
|
|
|
4370
1328
|
// src/utils/executeStrategies.ts
|
|
4371
|
-
init_cjs_shims();
|
|
1329
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
4372
1330
|
function hookSeq(promises) {
|
|
4373
1331
|
return promises.filter(Boolean).reduce(
|
|
4374
1332
|
(promise, func) => {
|
|
@@ -4406,8 +1364,8 @@ function hookParallel(promises) {
|
|
|
4406
1364
|
var _options2;
|
|
4407
1365
|
var PromiseManager = class {
|
|
4408
1366
|
constructor(options = {}) {
|
|
4409
|
-
__privateAdd(this, _options2, {});
|
|
4410
|
-
__privateSet(this, _options2, options);
|
|
1367
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _options2, {});
|
|
1368
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _options2, options);
|
|
4411
1369
|
return this;
|
|
4412
1370
|
}
|
|
4413
1371
|
run(strategy, promises) {
|
|
@@ -4415,7 +1373,7 @@ var PromiseManager = class {
|
|
|
4415
1373
|
return hookSeq(promises);
|
|
4416
1374
|
}
|
|
4417
1375
|
if (strategy === "first") {
|
|
4418
|
-
return hookFirst(promises, __privateGet(this, _options2).nullCheck);
|
|
1376
|
+
return hookFirst(promises, chunkI7UUR5MZ_cjs.__privateGet(this, _options2).nullCheck);
|
|
4419
1377
|
}
|
|
4420
1378
|
if (strategy === "parallel") {
|
|
4421
1379
|
return hookParallel(promises);
|
|
@@ -4435,8 +1393,8 @@ function isPromiseRejectedResult(result) {
|
|
|
4435
1393
|
var _core, _usedPluginNames, _promiseManager, _getSortedPlugins, getSortedPlugins_fn, _addExecutedToCallStack, addExecutedToCallStack_fn, _execute, execute_fn, _executeSync, executeSync_fn, _catcher, catcher_fn, _parse, parse_fn;
|
|
4436
1394
|
var PluginManager = class {
|
|
4437
1395
|
constructor(config, options) {
|
|
4438
|
-
__privateAdd(this, _getSortedPlugins);
|
|
4439
|
-
__privateAdd(this, _addExecutedToCallStack);
|
|
1396
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _getSortedPlugins);
|
|
1397
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _addExecutedToCallStack);
|
|
4440
1398
|
/**
|
|
4441
1399
|
* Run an async plugin hook and return the result.
|
|
4442
1400
|
* @param hookName Name of the plugin hook. Must be either in `PluginHooks` or `OutputPluginValueHooks`.
|
|
@@ -4444,7 +1402,7 @@ var PluginManager = class {
|
|
|
4444
1402
|
* @param plugin The actual pluginObject to run.
|
|
4445
1403
|
*/
|
|
4446
1404
|
// Implementation signature
|
|
4447
|
-
__privateAdd(this, _execute);
|
|
1405
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _execute);
|
|
4448
1406
|
/**
|
|
4449
1407
|
* Run a sync plugin hook and return the result.
|
|
4450
1408
|
* @param hookName Name of the plugin hook. Must be in `PluginHooks`.
|
|
@@ -4452,14 +1410,14 @@ var PluginManager = class {
|
|
|
4452
1410
|
* @param plugin The acutal plugin
|
|
4453
1411
|
* @param replaceContext When passed, the plugin context can be overridden.
|
|
4454
1412
|
*/
|
|
4455
|
-
__privateAdd(this, _executeSync);
|
|
4456
|
-
__privateAdd(this, _catcher);
|
|
4457
|
-
__privateAdd(this, _parse);
|
|
4458
|
-
this.events = new EventEmitter();
|
|
1413
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _executeSync);
|
|
1414
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _catcher);
|
|
1415
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _parse);
|
|
1416
|
+
this.events = new chunk72O327DC_cjs.EventEmitter();
|
|
4459
1417
|
this.executed = [];
|
|
4460
|
-
__privateAdd(this, _core, void 0);
|
|
4461
|
-
__privateAdd(this, _usedPluginNames, {});
|
|
4462
|
-
__privateAdd(this, _promiseManager, void 0);
|
|
1418
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _core, void 0);
|
|
1419
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _usedPluginNames, {});
|
|
1420
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _promiseManager, void 0);
|
|
4463
1421
|
this.resolvePath = (params) => {
|
|
4464
1422
|
if (params.pluginKey) {
|
|
4465
1423
|
const paths = this.hookForPluginSync({
|
|
@@ -4467,7 +1425,7 @@ var PluginManager = class {
|
|
|
4467
1425
|
hookName: "resolvePath",
|
|
4468
1426
|
parameters: [params.baseName, params.directory, params.options]
|
|
4469
1427
|
});
|
|
4470
|
-
if (paths && paths?.length > 1 && this.logger.logLevel === LogLevel.debug) {
|
|
1428
|
+
if (paths && paths?.length > 1 && this.logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug) {
|
|
4471
1429
|
this.logger.warn(
|
|
4472
1430
|
`Cannot return a path where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
4473
1431
|
|
|
@@ -4491,7 +1449,7 @@ Falling back on the first item.
|
|
|
4491
1449
|
hookName: "resolveName",
|
|
4492
1450
|
parameters: [params.name, params.type]
|
|
4493
1451
|
});
|
|
4494
|
-
if (names && names?.length > 1 && this.logger.logLevel === LogLevel.debug) {
|
|
1452
|
+
if (names && names?.length > 1 && this.logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug) {
|
|
4495
1453
|
this.logger.warn(
|
|
4496
1454
|
`Cannot return a name where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
4497
1455
|
|
|
@@ -4501,19 +1459,19 @@ Falling back on the first item.
|
|
|
4501
1459
|
`
|
|
4502
1460
|
);
|
|
4503
1461
|
}
|
|
4504
|
-
return transformReservedWord(names?.at(0) || params.name);
|
|
1462
|
+
return chunkABFPJZJL_cjs.transformReservedWord(names?.at(0) || params.name);
|
|
4505
1463
|
}
|
|
4506
1464
|
const name = this.hookFirstSync({
|
|
4507
1465
|
hookName: "resolveName",
|
|
4508
1466
|
parameters: [params.name, params.type]
|
|
4509
1467
|
}).result;
|
|
4510
|
-
return transformReservedWord(name);
|
|
1468
|
+
return chunkABFPJZJL_cjs.transformReservedWord(name);
|
|
4511
1469
|
};
|
|
4512
1470
|
this.config = config;
|
|
4513
1471
|
this.logger = options.logger;
|
|
4514
|
-
this.queue = new Queue(100, this.logger.logLevel === LogLevel.debug);
|
|
1472
|
+
this.queue = new chunk72O327DC_cjs.Queue(100, this.logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug);
|
|
4515
1473
|
this.fileManager = new FileManager({ task: options.task, queue: this.queue, timeout: options.writeTimeout });
|
|
4516
|
-
__privateSet(this, _promiseManager, new PromiseManager({ nullCheck: (state) => !!state?.result }));
|
|
1474
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _promiseManager, new PromiseManager({ nullCheck: (state) => !!state?.result }));
|
|
4517
1475
|
const plugins = config.plugins || [];
|
|
4518
1476
|
const core = definePlugin({
|
|
4519
1477
|
config,
|
|
@@ -4522,11 +1480,11 @@ Falling back on the first item.
|
|
|
4522
1480
|
fileManager: this.fileManager,
|
|
4523
1481
|
resolvePath: this.resolvePath.bind(this),
|
|
4524
1482
|
resolveName: this.resolveName.bind(this),
|
|
4525
|
-
getPlugins: __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).bind(this)
|
|
1483
|
+
getPlugins: chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).bind(this)
|
|
4526
1484
|
});
|
|
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);
|
|
1485
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _core, chunkI7UUR5MZ_cjs.__privateMethod(this, _parse, parse_fn).call(this, core, this, core.api.call(null)));
|
|
1486
|
+
this.plugins = [chunkI7UUR5MZ_cjs.__privateGet(this, _core), ...plugins].map((plugin) => {
|
|
1487
|
+
return chunkI7UUR5MZ_cjs.__privateMethod(this, _parse, parse_fn).call(this, plugin, this, chunkI7UUR5MZ_cjs.__privateGet(this, _core).api);
|
|
4530
1488
|
});
|
|
4531
1489
|
return this;
|
|
4532
1490
|
}
|
|
@@ -4546,7 +1504,7 @@ Falling back on the first item.
|
|
|
4546
1504
|
}) {
|
|
4547
1505
|
const plugins = this.getPluginsByKey(hookName, pluginKey);
|
|
4548
1506
|
const promises = plugins.map((plugin) => {
|
|
4549
|
-
return __privateMethod(this, _execute, execute_fn).call(this, {
|
|
1507
|
+
return chunkI7UUR5MZ_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
|
|
4550
1508
|
strategy: "hookFirst",
|
|
4551
1509
|
hookName,
|
|
4552
1510
|
parameters,
|
|
@@ -4565,7 +1523,7 @@ Falling back on the first item.
|
|
|
4565
1523
|
}) {
|
|
4566
1524
|
const plugins = this.getPluginsByKey(hookName, pluginKey);
|
|
4567
1525
|
return plugins.map((plugin) => {
|
|
4568
|
-
return __privateMethod(this, _executeSync, executeSync_fn).call(this, {
|
|
1526
|
+
return chunkI7UUR5MZ_cjs.__privateMethod(this, _executeSync, executeSync_fn).call(this, {
|
|
4569
1527
|
strategy: "hookFirst",
|
|
4570
1528
|
hookName,
|
|
4571
1529
|
parameters,
|
|
@@ -4581,11 +1539,11 @@ Falling back on the first item.
|
|
|
4581
1539
|
parameters,
|
|
4582
1540
|
skipped
|
|
4583
1541
|
}) {
|
|
4584
|
-
const promises = __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).filter((plugin) => {
|
|
1542
|
+
const promises = chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).filter((plugin) => {
|
|
4585
1543
|
return skipped ? skipped.has(plugin) : true;
|
|
4586
1544
|
}).map((plugin) => {
|
|
4587
1545
|
return async () => {
|
|
4588
|
-
const value = await __privateMethod(this, _execute, execute_fn).call(this, {
|
|
1546
|
+
const value = await chunkI7UUR5MZ_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
|
|
4589
1547
|
strategy: "hookFirst",
|
|
4590
1548
|
hookName,
|
|
4591
1549
|
parameters,
|
|
@@ -4599,7 +1557,7 @@ Falling back on the first item.
|
|
|
4599
1557
|
);
|
|
4600
1558
|
};
|
|
4601
1559
|
});
|
|
4602
|
-
return __privateGet(this, _promiseManager).run("first", promises);
|
|
1560
|
+
return chunkI7UUR5MZ_cjs.__privateGet(this, _promiseManager).run("first", promises);
|
|
4603
1561
|
}
|
|
4604
1562
|
/**
|
|
4605
1563
|
* First non-null result stops and will return it's value.
|
|
@@ -4610,12 +1568,12 @@ Falling back on the first item.
|
|
|
4610
1568
|
skipped
|
|
4611
1569
|
}) {
|
|
4612
1570
|
let parseResult = null;
|
|
4613
|
-
for (const plugin of __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
|
|
1571
|
+
for (const plugin of chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
|
|
4614
1572
|
if (skipped && skipped.has(plugin)) {
|
|
4615
1573
|
continue;
|
|
4616
1574
|
}
|
|
4617
1575
|
parseResult = {
|
|
4618
|
-
result: __privateMethod(this, _executeSync, executeSync_fn).call(this, {
|
|
1576
|
+
result: chunkI7UUR5MZ_cjs.__privateMethod(this, _executeSync, executeSync_fn).call(this, {
|
|
4619
1577
|
strategy: "hookFirst",
|
|
4620
1578
|
hookName,
|
|
4621
1579
|
parameters,
|
|
@@ -4636,14 +1594,14 @@ Falling back on the first item.
|
|
|
4636
1594
|
hookName,
|
|
4637
1595
|
parameters
|
|
4638
1596
|
}) {
|
|
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 });
|
|
1597
|
+
const promises = chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
|
|
1598
|
+
return () => chunkI7UUR5MZ_cjs.__privateMethod(this, _execute, execute_fn).call(this, { strategy: "hookParallel", hookName, parameters, plugin });
|
|
4641
1599
|
});
|
|
4642
|
-
const results = await __privateGet(this, _promiseManager).run("parallel", promises);
|
|
1600
|
+
const results = await chunkI7UUR5MZ_cjs.__privateGet(this, _promiseManager).run("parallel", promises);
|
|
4643
1601
|
results.forEach((result, index) => {
|
|
4644
1602
|
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);
|
|
1603
|
+
const plugin = chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)[index];
|
|
1604
|
+
chunkI7UUR5MZ_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, result.reason, plugin, hookName);
|
|
4647
1605
|
}
|
|
4648
1606
|
});
|
|
4649
1607
|
return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
@@ -4658,16 +1616,16 @@ Falling back on the first item.
|
|
|
4658
1616
|
}) {
|
|
4659
1617
|
const [argument0, ...rest] = parameters;
|
|
4660
1618
|
let promise = Promise.resolve(argument0);
|
|
4661
|
-
for (const plugin of __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
|
|
1619
|
+
for (const plugin of chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
|
|
4662
1620
|
promise = promise.then((arg0) => {
|
|
4663
|
-
const value = __privateMethod(this, _execute, execute_fn).call(this, {
|
|
1621
|
+
const value = chunkI7UUR5MZ_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
|
|
4664
1622
|
strategy: "hookReduceArg0",
|
|
4665
1623
|
hookName,
|
|
4666
1624
|
parameters: [arg0, ...rest],
|
|
4667
1625
|
plugin
|
|
4668
1626
|
});
|
|
4669
1627
|
return value;
|
|
4670
|
-
}).then((result) => reduce.call(__privateGet(this, _core).api, argument0, result, plugin));
|
|
1628
|
+
}).then((result) => reduce.call(chunkI7UUR5MZ_cjs.__privateGet(this, _core).api, argument0, result, plugin));
|
|
4671
1629
|
}
|
|
4672
1630
|
return promise;
|
|
4673
1631
|
}
|
|
@@ -4675,15 +1633,15 @@ Falling back on the first item.
|
|
|
4675
1633
|
* Chains plugins
|
|
4676
1634
|
*/
|
|
4677
1635
|
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, {
|
|
1636
|
+
const promises = chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
|
|
1637
|
+
return () => chunkI7UUR5MZ_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
|
|
4680
1638
|
strategy: "hookSeq",
|
|
4681
1639
|
hookName,
|
|
4682
1640
|
parameters,
|
|
4683
1641
|
plugin
|
|
4684
1642
|
});
|
|
4685
1643
|
});
|
|
4686
|
-
return __privateGet(this, _promiseManager).run("seq", promises);
|
|
1644
|
+
return chunkI7UUR5MZ_cjs.__privateGet(this, _promiseManager).run("seq", promises);
|
|
4687
1645
|
}
|
|
4688
1646
|
getPluginsByKey(hookName, pluginKey) {
|
|
4689
1647
|
const plugins = [...this.plugins];
|
|
@@ -4699,7 +1657,7 @@ Falling back on the first item.
|
|
|
4699
1657
|
});
|
|
4700
1658
|
if (!pluginByPluginName?.length) {
|
|
4701
1659
|
const corePlugin = plugins.find((plugin) => plugin.name === "core" && plugin[hookName]);
|
|
4702
|
-
if (this.logger.logLevel === LogLevel.debug) {
|
|
1660
|
+
if (this.logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug) {
|
|
4703
1661
|
if (corePlugin) {
|
|
4704
1662
|
this.logger.warn(`No hook '${hookName}' for pluginKey '${JSON.stringify(pluginKey)}' found, falling back on the '@kubb/core' plugin`);
|
|
4705
1663
|
} else {
|
|
@@ -4737,7 +1695,7 @@ _getSortedPlugins = new WeakSet();
|
|
|
4737
1695
|
getSortedPlugins_fn = function(hookName) {
|
|
4738
1696
|
const plugins = [...this.plugins].filter((plugin) => plugin.name !== "core");
|
|
4739
1697
|
if (hookName) {
|
|
4740
|
-
if (this.logger.logLevel === LogLevel.info) {
|
|
1698
|
+
if (this.logger.logLevel === chunk77QZQ377_cjs.LogLevel.info) {
|
|
4741
1699
|
const containsHookName = plugins.some((item) => item[hookName]);
|
|
4742
1700
|
if (!containsHookName) {
|
|
4743
1701
|
this.logger.warn(`No hook ${hookName} found`);
|
|
@@ -4753,11 +1711,11 @@ getSortedPlugins_fn = function(hookName) {
|
|
|
4753
1711
|
}
|
|
4754
1712
|
}
|
|
4755
1713
|
return plugin;
|
|
4756
|
-
}).sort((a,
|
|
4757
|
-
if (
|
|
1714
|
+
}).sort((a, b) => {
|
|
1715
|
+
if (b.pre?.includes(a.name)) {
|
|
4758
1716
|
return 1;
|
|
4759
1717
|
}
|
|
4760
|
-
if (
|
|
1718
|
+
if (b.post?.includes(a.name)) {
|
|
4761
1719
|
return -1;
|
|
4762
1720
|
}
|
|
4763
1721
|
return 0;
|
|
@@ -4785,7 +1743,7 @@ execute_fn = function({
|
|
|
4785
1743
|
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
4786
1744
|
const task = Promise.resolve().then(() => {
|
|
4787
1745
|
if (typeof hook === "function") {
|
|
4788
|
-
const possiblePromiseResult = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
|
|
1746
|
+
const possiblePromiseResult = hook.apply({ ...chunkI7UUR5MZ_cjs.__privateGet(this, _core).api, plugin }, parameters);
|
|
4789
1747
|
if (isPromise(possiblePromiseResult)) {
|
|
4790
1748
|
return Promise.resolve(possiblePromiseResult);
|
|
4791
1749
|
}
|
|
@@ -4794,7 +1752,7 @@ execute_fn = function({
|
|
|
4794
1752
|
return hook;
|
|
4795
1753
|
}).then((result) => {
|
|
4796
1754
|
output = result;
|
|
4797
|
-
__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
|
|
1755
|
+
chunkI7UUR5MZ_cjs.__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
|
|
4798
1756
|
parameters,
|
|
4799
1757
|
output,
|
|
4800
1758
|
strategy,
|
|
@@ -4803,7 +1761,7 @@ execute_fn = function({
|
|
|
4803
1761
|
});
|
|
4804
1762
|
return result;
|
|
4805
1763
|
}).catch((e) => {
|
|
4806
|
-
__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
|
|
1764
|
+
chunkI7UUR5MZ_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
|
|
4807
1765
|
return null;
|
|
4808
1766
|
});
|
|
4809
1767
|
return task;
|
|
@@ -4823,12 +1781,12 @@ executeSync_fn = function({
|
|
|
4823
1781
|
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
4824
1782
|
try {
|
|
4825
1783
|
if (typeof hook === "function") {
|
|
4826
|
-
const fn = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
|
|
1784
|
+
const fn = hook.apply({ ...chunkI7UUR5MZ_cjs.__privateGet(this, _core).api, plugin }, parameters);
|
|
4827
1785
|
output = fn;
|
|
4828
1786
|
return fn;
|
|
4829
1787
|
}
|
|
4830
1788
|
output = hook;
|
|
4831
|
-
__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
|
|
1789
|
+
chunkI7UUR5MZ_cjs.__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
|
|
4832
1790
|
parameters,
|
|
4833
1791
|
output,
|
|
4834
1792
|
strategy,
|
|
@@ -4837,7 +1795,7 @@ executeSync_fn = function({
|
|
|
4837
1795
|
});
|
|
4838
1796
|
return hook;
|
|
4839
1797
|
} catch (e) {
|
|
4840
|
-
__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
|
|
1798
|
+
chunkI7UUR5MZ_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
|
|
4841
1799
|
return null;
|
|
4842
1800
|
}
|
|
4843
1801
|
};
|
|
@@ -4850,8 +1808,8 @@ catcher_fn = function(e, plugin, hookName) {
|
|
|
4850
1808
|
};
|
|
4851
1809
|
_parse = new WeakSet();
|
|
4852
1810
|
parse_fn = function(plugin, pluginManager, context) {
|
|
4853
|
-
const usedPluginNames = __privateGet(pluginManager, _usedPluginNames);
|
|
4854
|
-
setUniqueName(plugin.name, usedPluginNames);
|
|
1811
|
+
const usedPluginNames = chunkI7UUR5MZ_cjs.__privateGet(pluginManager, _usedPluginNames);
|
|
1812
|
+
chunk72O327DC_cjs.setUniqueName(plugin.name, usedPluginNames);
|
|
4855
1813
|
const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
|
|
4856
1814
|
if (plugin.name !== "core" && usedPluginNames[plugin.name] >= 2) {
|
|
4857
1815
|
pluginManager.logger.warn("Using multiple of the same plugin is an experimental feature");
|
|
@@ -4880,15 +1838,15 @@ async function transformReducer(_previousCode, result, _plugin) {
|
|
|
4880
1838
|
return result;
|
|
4881
1839
|
}
|
|
4882
1840
|
async function setup(options) {
|
|
4883
|
-
const { config, logger = createLogger({ logLevel: LogLevel.silent }) } = options;
|
|
1841
|
+
const { config, logger = chunk77QZQ377_cjs.createLogger({ logLevel: chunk77QZQ377_cjs.LogLevel.silent }) } = options;
|
|
4884
1842
|
try {
|
|
4885
|
-
if (isInputPath(config) && !new URLPath(config.input.path).isURL) {
|
|
4886
|
-
await read(config.input.path);
|
|
1843
|
+
if (isInputPath(config) && !new chunk72O327DC_cjs.URLPath(config.input.path).isURL) {
|
|
1844
|
+
await chunkZ7XZQBAK_cjs.read(config.input.path);
|
|
4887
1845
|
}
|
|
4888
1846
|
} catch (e) {
|
|
4889
1847
|
if (isInputPath(config)) {
|
|
4890
1848
|
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 " +
|
|
1849
|
+
"Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + chunk77QZQ377_cjs.p.dim(config.input.path),
|
|
4892
1850
|
{
|
|
4893
1851
|
cause: e
|
|
4894
1852
|
}
|
|
@@ -4896,7 +1854,7 @@ async function setup(options) {
|
|
|
4896
1854
|
}
|
|
4897
1855
|
}
|
|
4898
1856
|
if (config.output.clean) {
|
|
4899
|
-
await clean(config.output.path);
|
|
1857
|
+
await chunkZ7XZQBAK_cjs.clean(config.output.path);
|
|
4900
1858
|
}
|
|
4901
1859
|
const queueTask = async (file) => {
|
|
4902
1860
|
const { path: path5 } = file;
|
|
@@ -4937,11 +1895,11 @@ async function setup(options) {
|
|
|
4937
1895
|
const { hookName, parameters, plugin } = executer;
|
|
4938
1896
|
if (hookName === "writeFile" && logger.spinner) {
|
|
4939
1897
|
const [code] = parameters;
|
|
4940
|
-
if (logger.logLevel === LogLevel.info) {
|
|
1898
|
+
if (logger.logLevel === chunk77QZQ377_cjs.LogLevel.info) {
|
|
4941
1899
|
logger.spinner.start(`\u{1F4BE} Writing`);
|
|
4942
1900
|
}
|
|
4943
|
-
if (logger.logLevel === LogLevel.debug) {
|
|
4944
|
-
logger.info(`PluginKey ${
|
|
1901
|
+
if (logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug) {
|
|
1902
|
+
logger.info(`PluginKey ${chunk77QZQ377_cjs.p.dim(JSON.stringify(plugin.key))}
|
|
4945
1903
|
with source
|
|
4946
1904
|
|
|
4947
1905
|
${code}`);
|
|
@@ -4950,21 +1908,21 @@ ${code}`);
|
|
|
4950
1908
|
});
|
|
4951
1909
|
pluginManager.on("executed", (executer) => {
|
|
4952
1910
|
const { hookName, plugin, output, parameters } = executer;
|
|
4953
|
-
const messsage = `${randomCliColour(plugin.name)} Executing ${hookName}`;
|
|
4954
|
-
if (logger.logLevel === LogLevel.info && logger.spinner) {
|
|
1911
|
+
const messsage = `${chunk77QZQ377_cjs.randomCliColour(plugin.name)} Executing ${hookName}`;
|
|
1912
|
+
if (logger.logLevel === chunk77QZQ377_cjs.LogLevel.info && logger.spinner) {
|
|
4955
1913
|
if (hookName === "writeFile") {
|
|
4956
1914
|
const [_code, path5] = parameters;
|
|
4957
|
-
logger.spinner.suffixText =
|
|
1915
|
+
logger.spinner.suffixText = chunk77QZQ377_cjs.p.dim(path5);
|
|
4958
1916
|
} else {
|
|
4959
1917
|
logger.spinner.suffixText = messsage;
|
|
4960
1918
|
}
|
|
4961
1919
|
}
|
|
4962
|
-
if (logger.logLevel === LogLevel.debug) {
|
|
1920
|
+
if (logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug) {
|
|
4963
1921
|
logger.info(messsage);
|
|
4964
1922
|
const logs = [
|
|
4965
|
-
parameters && `${
|
|
1923
|
+
parameters && `${chunk77QZQ377_cjs.p.bgWhite(`Parameters`)} ${chunk77QZQ377_cjs.randomCliColour(plugin.name)} ${hookName}`,
|
|
4966
1924
|
JSON.stringify(parameters, void 0, 2),
|
|
4967
|
-
output && `${
|
|
1925
|
+
output && `${chunk77QZQ377_cjs.p.bgWhite("Output")} ${chunk77QZQ377_cjs.randomCliColour(plugin.name)} ${hookName}`,
|
|
4968
1926
|
output
|
|
4969
1927
|
].filter(Boolean);
|
|
4970
1928
|
console.log(logs.join("\n"));
|
|
@@ -5006,95 +1964,95 @@ async function safeBuild(options) {
|
|
|
5006
1964
|
}
|
|
5007
1965
|
|
|
5008
1966
|
// src/Generator.ts
|
|
5009
|
-
init_cjs_shims();
|
|
1967
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
5010
1968
|
var _options3, _context;
|
|
5011
1969
|
var Generator = class {
|
|
5012
1970
|
constructor(options, context) {
|
|
5013
|
-
__privateAdd(this, _options3, {});
|
|
5014
|
-
__privateAdd(this, _context, {});
|
|
1971
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _options3, {});
|
|
1972
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _context, {});
|
|
5015
1973
|
if (context) {
|
|
5016
|
-
__privateSet(this, _context, context);
|
|
1974
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _context, context);
|
|
5017
1975
|
}
|
|
5018
1976
|
if (options) {
|
|
5019
|
-
__privateSet(this, _options3, options);
|
|
1977
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _options3, options);
|
|
5020
1978
|
}
|
|
5021
1979
|
return this;
|
|
5022
1980
|
}
|
|
5023
1981
|
get options() {
|
|
5024
|
-
return __privateGet(this, _options3);
|
|
1982
|
+
return chunkI7UUR5MZ_cjs.__privateGet(this, _options3);
|
|
5025
1983
|
}
|
|
5026
1984
|
get context() {
|
|
5027
|
-
return __privateGet(this, _context);
|
|
1985
|
+
return chunkI7UUR5MZ_cjs.__privateGet(this, _context);
|
|
5028
1986
|
}
|
|
5029
1987
|
set options(options) {
|
|
5030
|
-
__privateSet(this, _options3, { ...__privateGet(this, _options3), ...options });
|
|
1988
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _options3, { ...chunkI7UUR5MZ_cjs.__privateGet(this, _options3), ...options });
|
|
5031
1989
|
}
|
|
5032
1990
|
};
|
|
5033
1991
|
_options3 = new WeakMap();
|
|
5034
1992
|
_context = new WeakMap();
|
|
5035
1993
|
|
|
5036
1994
|
// src/PackageManager.ts
|
|
5037
|
-
init_cjs_shims();
|
|
1995
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
5038
1996
|
|
|
5039
1997
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
5040
|
-
init_cjs_shims();
|
|
1998
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
5041
1999
|
|
|
5042
2000
|
// ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
5043
|
-
init_cjs_shims();
|
|
2001
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
5044
2002
|
|
|
5045
2003
|
// ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
|
|
5046
|
-
init_cjs_shims();
|
|
2004
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
5047
2005
|
|
|
5048
2006
|
// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
|
|
5049
|
-
init_cjs_shims();
|
|
2007
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
5050
2008
|
|
|
5051
2009
|
// ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
|
|
5052
|
-
init_cjs_shims();
|
|
2010
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
5053
2011
|
var Node = class {
|
|
5054
2012
|
constructor(value) {
|
|
5055
|
-
__publicField(this, "value");
|
|
5056
|
-
__publicField(this, "next");
|
|
2013
|
+
chunkI7UUR5MZ_cjs.__publicField(this, "value");
|
|
2014
|
+
chunkI7UUR5MZ_cjs.__publicField(this, "next");
|
|
5057
2015
|
this.value = value;
|
|
5058
2016
|
}
|
|
5059
2017
|
};
|
|
5060
2018
|
var _head, _tail, _size;
|
|
5061
2019
|
var Queue2 = class {
|
|
5062
2020
|
constructor() {
|
|
5063
|
-
__privateAdd(this, _head, void 0);
|
|
5064
|
-
__privateAdd(this, _tail, void 0);
|
|
5065
|
-
__privateAdd(this, _size, void 0);
|
|
2021
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _head, void 0);
|
|
2022
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _tail, void 0);
|
|
2023
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _size, void 0);
|
|
5066
2024
|
this.clear();
|
|
5067
2025
|
}
|
|
5068
2026
|
enqueue(value) {
|
|
5069
2027
|
const node = new Node(value);
|
|
5070
|
-
if (__privateGet(this, _head)) {
|
|
5071
|
-
__privateGet(this, _tail).next = node;
|
|
5072
|
-
__privateSet(this, _tail, node);
|
|
2028
|
+
if (chunkI7UUR5MZ_cjs.__privateGet(this, _head)) {
|
|
2029
|
+
chunkI7UUR5MZ_cjs.__privateGet(this, _tail).next = node;
|
|
2030
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _tail, node);
|
|
5073
2031
|
} else {
|
|
5074
|
-
__privateSet(this, _head, node);
|
|
5075
|
-
__privateSet(this, _tail, node);
|
|
2032
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _head, node);
|
|
2033
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _tail, node);
|
|
5076
2034
|
}
|
|
5077
|
-
__privateWrapper(this, _size)._++;
|
|
2035
|
+
chunkI7UUR5MZ_cjs.__privateWrapper(this, _size)._++;
|
|
5078
2036
|
}
|
|
5079
2037
|
dequeue() {
|
|
5080
|
-
const current = __privateGet(this, _head);
|
|
2038
|
+
const current = chunkI7UUR5MZ_cjs.__privateGet(this, _head);
|
|
5081
2039
|
if (!current) {
|
|
5082
2040
|
return;
|
|
5083
2041
|
}
|
|
5084
|
-
__privateSet(this, _head, __privateGet(this, _head).next);
|
|
5085
|
-
__privateWrapper(this, _size)._--;
|
|
2042
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _head, chunkI7UUR5MZ_cjs.__privateGet(this, _head).next);
|
|
2043
|
+
chunkI7UUR5MZ_cjs.__privateWrapper(this, _size)._--;
|
|
5086
2044
|
return current.value;
|
|
5087
2045
|
}
|
|
5088
2046
|
clear() {
|
|
5089
|
-
__privateSet(this, _head, void 0);
|
|
5090
|
-
__privateSet(this, _tail, void 0);
|
|
5091
|
-
__privateSet(this, _size, 0);
|
|
2047
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _head, void 0);
|
|
2048
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _tail, void 0);
|
|
2049
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _size, 0);
|
|
5092
2050
|
}
|
|
5093
2051
|
get size() {
|
|
5094
|
-
return __privateGet(this, _size);
|
|
2052
|
+
return chunkI7UUR5MZ_cjs.__privateGet(this, _size);
|
|
5095
2053
|
}
|
|
5096
2054
|
*[Symbol.iterator]() {
|
|
5097
|
-
let current = __privateGet(this, _head);
|
|
2055
|
+
let current = chunkI7UUR5MZ_cjs.__privateGet(this, _head);
|
|
5098
2056
|
while (current) {
|
|
5099
2057
|
yield current.value;
|
|
5100
2058
|
current = current.next;
|
|
@@ -5118,18 +2076,18 @@ function pLimit(concurrency) {
|
|
|
5118
2076
|
queue.dequeue()();
|
|
5119
2077
|
}
|
|
5120
2078
|
};
|
|
5121
|
-
const run = async (fn,
|
|
2079
|
+
const run = async (fn, resolve2, args) => {
|
|
5122
2080
|
activeCount++;
|
|
5123
2081
|
const result = (async () => fn(...args))();
|
|
5124
|
-
|
|
2082
|
+
resolve2(result);
|
|
5125
2083
|
try {
|
|
5126
2084
|
await result;
|
|
5127
2085
|
} catch {
|
|
5128
2086
|
}
|
|
5129
2087
|
next();
|
|
5130
2088
|
};
|
|
5131
|
-
const enqueue = (fn,
|
|
5132
|
-
queue.enqueue(run.bind(void 0, fn,
|
|
2089
|
+
const enqueue = (fn, resolve2, args) => {
|
|
2090
|
+
queue.enqueue(run.bind(void 0, fn, resolve2, args));
|
|
5133
2091
|
(async () => {
|
|
5134
2092
|
await Promise.resolve();
|
|
5135
2093
|
if (activeCount < concurrency && queue.size > 0) {
|
|
@@ -5137,8 +2095,8 @@ function pLimit(concurrency) {
|
|
|
5137
2095
|
}
|
|
5138
2096
|
})();
|
|
5139
2097
|
};
|
|
5140
|
-
const generator = (fn, ...args) => new Promise((
|
|
5141
|
-
enqueue(fn,
|
|
2098
|
+
const generator = (fn, ...args) => new Promise((resolve2) => {
|
|
2099
|
+
enqueue(fn, resolve2, args);
|
|
5142
2100
|
});
|
|
5143
2101
|
Object.defineProperties(generator, {
|
|
5144
2102
|
activeCount: {
|
|
@@ -5202,7 +2160,7 @@ function checkType(type) {
|
|
|
5202
2160
|
var matchType = (type, stat) => stat[typeMappings[type]]();
|
|
5203
2161
|
var toPath = (urlOrPath) => urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
5204
2162
|
async function locatePath(paths, {
|
|
5205
|
-
cwd =
|
|
2163
|
+
cwd = process__default.default.cwd(),
|
|
5206
2164
|
type = "file",
|
|
5207
2165
|
allowSymlinks = true,
|
|
5208
2166
|
concurrency,
|
|
@@ -5210,7 +2168,7 @@ async function locatePath(paths, {
|
|
|
5210
2168
|
} = {}) {
|
|
5211
2169
|
checkType(type);
|
|
5212
2170
|
cwd = toPath(cwd);
|
|
5213
|
-
const statFunction = allowSymlinks ?
|
|
2171
|
+
const statFunction = allowSymlinks ? fs.promises.stat : fs.promises.lstat;
|
|
5214
2172
|
return pLocate(paths, async (path_) => {
|
|
5215
2173
|
try {
|
|
5216
2174
|
const stat = await statFunction(path4__default.default.resolve(cwd, path_));
|
|
@@ -5221,13 +2179,13 @@ async function locatePath(paths, {
|
|
|
5221
2179
|
}, { concurrency, preserveOrder });
|
|
5222
2180
|
}
|
|
5223
2181
|
function locatePathSync(paths, {
|
|
5224
|
-
cwd =
|
|
2182
|
+
cwd = process__default.default.cwd(),
|
|
5225
2183
|
type = "file",
|
|
5226
2184
|
allowSymlinks = true
|
|
5227
2185
|
} = {}) {
|
|
5228
2186
|
checkType(type);
|
|
5229
2187
|
cwd = toPath(cwd);
|
|
5230
|
-
const statFunction = allowSymlinks ?
|
|
2188
|
+
const statFunction = allowSymlinks ? fs__default.default.statSync : fs__default.default.lstatSync;
|
|
5231
2189
|
for (const path_ of paths) {
|
|
5232
2190
|
try {
|
|
5233
2191
|
const stat = statFunction(path4__default.default.resolve(cwd, path_), {
|
|
@@ -5245,13 +2203,13 @@ function locatePathSync(paths, {
|
|
|
5245
2203
|
}
|
|
5246
2204
|
|
|
5247
2205
|
// ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
|
|
5248
|
-
init_cjs_shims();
|
|
2206
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
5249
2207
|
function toPath2(urlOrPath) {
|
|
5250
2208
|
return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
5251
2209
|
}
|
|
5252
2210
|
|
|
5253
2211
|
// ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
|
|
5254
|
-
init_cjs_shims();
|
|
2212
|
+
chunkI7UUR5MZ_cjs.init_cjs_shims();
|
|
5255
2213
|
|
|
5256
2214
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
5257
2215
|
var findUpStop = Symbol("findUpStop");
|
|
@@ -5330,30 +2288,30 @@ function findUpSync(name, options = {}) {
|
|
|
5330
2288
|
var _cache2, _cwd, _SLASHES, _match, match_fn;
|
|
5331
2289
|
var _PackageManager = class _PackageManager {
|
|
5332
2290
|
constructor(workspace) {
|
|
5333
|
-
__privateAdd(this, _match);
|
|
5334
|
-
__privateAdd(this, _cwd, void 0);
|
|
5335
|
-
__privateAdd(this, _SLASHES, /* @__PURE__ */ new Set(["/", "\\"]));
|
|
2291
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _match);
|
|
2292
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _cwd, void 0);
|
|
2293
|
+
chunkI7UUR5MZ_cjs.__privateAdd(this, _SLASHES, /* @__PURE__ */ new Set(["/", "\\"]));
|
|
5336
2294
|
if (workspace) {
|
|
5337
|
-
__privateSet(this, _cwd, workspace);
|
|
2295
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _cwd, workspace);
|
|
5338
2296
|
}
|
|
5339
2297
|
return this;
|
|
5340
2298
|
}
|
|
5341
2299
|
set workspace(workspace) {
|
|
5342
|
-
__privateSet(this, _cwd, workspace);
|
|
2300
|
+
chunkI7UUR5MZ_cjs.__privateSet(this, _cwd, workspace);
|
|
5343
2301
|
}
|
|
5344
2302
|
get workspace() {
|
|
5345
|
-
return __privateGet(this, _cwd);
|
|
2303
|
+
return chunkI7UUR5MZ_cjs.__privateGet(this, _cwd);
|
|
5346
2304
|
}
|
|
5347
2305
|
normalizeDirectory(directory) {
|
|
5348
|
-
if (!__privateGet(this, _SLASHES).has(directory[directory.length - 1])) {
|
|
2306
|
+
if (!chunkI7UUR5MZ_cjs.__privateGet(this, _SLASHES).has(directory[directory.length - 1])) {
|
|
5349
2307
|
return `${directory}/`;
|
|
5350
2308
|
}
|
|
5351
2309
|
return directory;
|
|
5352
2310
|
}
|
|
5353
2311
|
getLocation(path5) {
|
|
5354
2312
|
let location = path5;
|
|
5355
|
-
if (__privateGet(this, _cwd)) {
|
|
5356
|
-
const require2 = mod__default.default.createRequire(this.normalizeDirectory(__privateGet(this, _cwd)));
|
|
2313
|
+
if (chunkI7UUR5MZ_cjs.__privateGet(this, _cwd)) {
|
|
2314
|
+
const require2 = mod__default.default.createRequire(this.normalizeDirectory(chunkI7UUR5MZ_cjs.__privateGet(this, _cwd)));
|
|
5357
2315
|
location = require2.resolve(path5);
|
|
5358
2316
|
}
|
|
5359
2317
|
return location;
|
|
@@ -5373,44 +2331,44 @@ var _PackageManager = class _PackageManager {
|
|
|
5373
2331
|
}
|
|
5374
2332
|
async getPackageJSON() {
|
|
5375
2333
|
const pkgPath = await findUp(["package.json"], {
|
|
5376
|
-
cwd: __privateGet(this, _cwd)
|
|
2334
|
+
cwd: chunkI7UUR5MZ_cjs.__privateGet(this, _cwd)
|
|
5377
2335
|
});
|
|
5378
2336
|
if (!pkgPath) {
|
|
5379
2337
|
return void 0;
|
|
5380
2338
|
}
|
|
5381
|
-
return __require(pkgPath);
|
|
2339
|
+
return chunkI7UUR5MZ_cjs.__require(pkgPath);
|
|
5382
2340
|
}
|
|
5383
2341
|
getPackageJSONSync() {
|
|
5384
2342
|
const pkgPath = findUpSync(["package.json"], {
|
|
5385
|
-
cwd: __privateGet(this, _cwd)
|
|
2343
|
+
cwd: chunkI7UUR5MZ_cjs.__privateGet(this, _cwd)
|
|
5386
2344
|
});
|
|
5387
2345
|
if (!pkgPath) {
|
|
5388
2346
|
return void 0;
|
|
5389
2347
|
}
|
|
5390
|
-
return __require(pkgPath);
|
|
2348
|
+
return chunkI7UUR5MZ_cjs.__require(pkgPath);
|
|
5391
2349
|
}
|
|
5392
2350
|
static setVersion(dependency, version) {
|
|
5393
|
-
__privateGet(_PackageManager, _cache2)[dependency] = version;
|
|
2351
|
+
chunkI7UUR5MZ_cjs.__privateGet(_PackageManager, _cache2)[dependency] = version;
|
|
5394
2352
|
}
|
|
5395
2353
|
async getVersion(dependency) {
|
|
5396
|
-
if (typeof dependency === "string" && __privateGet(_PackageManager, _cache2)[dependency]) {
|
|
5397
|
-
return __privateGet(_PackageManager, _cache2)[dependency];
|
|
2354
|
+
if (typeof dependency === "string" && chunkI7UUR5MZ_cjs.__privateGet(_PackageManager, _cache2)[dependency]) {
|
|
2355
|
+
return chunkI7UUR5MZ_cjs.__privateGet(_PackageManager, _cache2)[dependency];
|
|
5398
2356
|
}
|
|
5399
2357
|
const packageJSON = await this.getPackageJSON();
|
|
5400
2358
|
if (!packageJSON) {
|
|
5401
2359
|
return void 0;
|
|
5402
2360
|
}
|
|
5403
|
-
return __privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
|
|
2361
|
+
return chunkI7UUR5MZ_cjs.__privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
|
|
5404
2362
|
}
|
|
5405
2363
|
getVersionSync(dependency) {
|
|
5406
|
-
if (typeof dependency === "string" && __privateGet(_PackageManager, _cache2)[dependency]) {
|
|
5407
|
-
return __privateGet(_PackageManager, _cache2)[dependency];
|
|
2364
|
+
if (typeof dependency === "string" && chunkI7UUR5MZ_cjs.__privateGet(_PackageManager, _cache2)[dependency]) {
|
|
2365
|
+
return chunkI7UUR5MZ_cjs.__privateGet(_PackageManager, _cache2)[dependency];
|
|
5408
2366
|
}
|
|
5409
2367
|
const packageJSON = this.getPackageJSONSync();
|
|
5410
2368
|
if (!packageJSON) {
|
|
5411
2369
|
return void 0;
|
|
5412
2370
|
}
|
|
5413
|
-
return __privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
|
|
2371
|
+
return chunkI7UUR5MZ_cjs.__privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
|
|
5414
2372
|
}
|
|
5415
2373
|
async isValid(dependency, version) {
|
|
5416
2374
|
const packageVersion = await this.getVersion(dependency);
|
|
@@ -5453,7 +2411,7 @@ match_fn = function(packageJSON, dependency) {
|
|
|
5453
2411
|
const matchedDependency = Object.keys(dependencies).find((dep) => dep.match(dependency));
|
|
5454
2412
|
return matchedDependency ? dependencies[matchedDependency] : void 0;
|
|
5455
2413
|
};
|
|
5456
|
-
__privateAdd(_PackageManager, _cache2, {});
|
|
2414
|
+
chunkI7UUR5MZ_cjs.__privateAdd(_PackageManager, _cache2, {});
|
|
5457
2415
|
var PackageManager = _PackageManager;
|
|
5458
2416
|
|
|
5459
2417
|
// src/index.ts
|