@kubb/core 2.0.0-beta.1 → 2.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Queue-2-6pMcCx.d.cts +32 -0
- package/dist/Queue-2-6pMcCx.d.ts +32 -0
- package/dist/fs.cjs +2383 -0
- package/dist/fs.cjs.map +1 -0
- package/dist/fs.d.cts +5 -0
- package/dist/fs.d.ts +5 -0
- package/dist/fs.js +2380 -0
- package/dist/fs.js.map +1 -0
- package/dist/index.cjs +3448 -394
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +77 -127
- package/dist/index.d.ts +77 -127
- package/dist/index.js +3761 -423
- package/dist/index.js.map +1 -1
- package/dist/logger.cjs +90 -0
- package/dist/logger.cjs.map +1 -0
- package/dist/logger.d.cts +32 -0
- package/dist/logger.d.ts +32 -0
- package/dist/logger.js +78 -0
- package/dist/logger.js.map +1 -0
- package/dist/transformers.cjs +222 -0
- package/dist/transformers.cjs.map +1 -0
- package/dist/transformers.d.cts +55 -0
- package/dist/transformers.d.ts +55 -0
- package/dist/transformers.js +207 -0
- package/dist/transformers.js.map +1 -0
- package/dist/utils.cjs +174 -899
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +2 -146
- package/dist/utils.d.ts +2 -146
- package/dist/utils.js +175 -859
- package/dist/utils.js.map +1 -1
- package/dist/write-46ytbnu9.d.cts +7 -0
- package/dist/write-46ytbnu9.d.ts +7 -0
- package/package.json +27 -12
- package/src/BarrelManager.ts +55 -65
- package/src/FileManager.ts +109 -68
- package/src/PluginManager.ts +55 -32
- package/src/build.ts +5 -16
- package/src/fs/index.ts +3 -0
- package/src/index.ts +4 -5
- package/src/{utils/logger.ts → logger.ts} +37 -0
- package/src/plugin.ts +4 -4
- package/src/transformers/casing.ts +9 -0
- package/src/transformers/createJSDocBlockText.ts +9 -0
- package/src/transformers/index.ts +36 -0
- package/src/transformers/trim.ts +7 -0
- package/src/types.ts +23 -42
- package/src/utils/FunctionParams.ts +3 -2
- package/src/utils/TreeNode.ts +6 -3
- package/src/utils/URLPath.ts +5 -5
- package/src/utils/index.ts +10 -19
- package/src/SchemaGenerator.ts +0 -8
- package/src/utils/randomColour.ts +0 -39
- package/src/utils/throttle.ts +0 -30
- package/src/utils/transformers/createJSDocBlockText.ts +0 -15
- package/src/utils/transformers/index.ts +0 -22
- package/src/utils/transformers/trim.ts +0 -3
- /package/src/{utils → fs}/clean.ts +0 -0
- /package/src/{utils → fs}/read.ts +0 -0
- /package/src/{utils → fs}/write.ts +0 -0
- /package/src/{utils/transformers → transformers}/combineCodes.ts +0 -0
- /package/src/{utils/transformers → transformers}/escape.ts +0 -0
- /package/src/{utils/transformers → transformers}/indent.ts +0 -0
- /package/src/{utils/transformers → transformers}/nameSorter.ts +0 -0
- /package/src/{utils/transformers → transformers}/searchAndReplace.ts +0 -0
- /package/src/{utils/transformers → transformers}/transformReservedWord.ts +0 -0
package/dist/index.cjs
CHANGED
|
@@ -2,24 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var fs2 = require('fs-extra');
|
|
7
|
-
var seedrandom = require('seedrandom');
|
|
5
|
+
var pc2 = require('picocolors');
|
|
8
6
|
var path4 = require('path');
|
|
9
7
|
var jsRuntime = require('js-runtime');
|
|
10
8
|
var changeCase = require('change-case');
|
|
11
9
|
var crypto2 = require('crypto');
|
|
12
10
|
var parser = require('@kubb/parser');
|
|
13
11
|
var factory = require('@kubb/parser/factory');
|
|
14
|
-
var isEqual = require('lodash.isequal');
|
|
15
12
|
var naturalOrderby = require('natural-orderby');
|
|
16
13
|
var dirTree = require('directory-tree');
|
|
14
|
+
var seedrandom = require('seedrandom');
|
|
17
15
|
var events = require('events');
|
|
18
16
|
var perf_hooks = require('perf_hooks');
|
|
19
17
|
var mod = require('module');
|
|
20
18
|
var os = require('os');
|
|
21
19
|
var url = require('url');
|
|
22
|
-
var
|
|
20
|
+
var process2 = require('process');
|
|
23
21
|
var fs3 = require('fs');
|
|
24
22
|
var semver = require('semver');
|
|
25
23
|
|
|
@@ -43,20 +41,23 @@ function _interopNamespace(e) {
|
|
|
43
41
|
return Object.freeze(n);
|
|
44
42
|
}
|
|
45
43
|
|
|
46
|
-
var
|
|
47
|
-
var fs2__default = /*#__PURE__*/_interopDefault(fs2);
|
|
48
|
-
var seedrandom__default = /*#__PURE__*/_interopDefault(seedrandom);
|
|
44
|
+
var pc2__default = /*#__PURE__*/_interopDefault(pc2);
|
|
49
45
|
var path4__default = /*#__PURE__*/_interopDefault(path4);
|
|
50
46
|
var crypto2__default = /*#__PURE__*/_interopDefault(crypto2);
|
|
51
47
|
var factory__namespace = /*#__PURE__*/_interopNamespace(factory);
|
|
52
|
-
var isEqual__default = /*#__PURE__*/_interopDefault(isEqual);
|
|
53
48
|
var dirTree__default = /*#__PURE__*/_interopDefault(dirTree);
|
|
49
|
+
var seedrandom__default = /*#__PURE__*/_interopDefault(seedrandom);
|
|
54
50
|
var mod__default = /*#__PURE__*/_interopDefault(mod);
|
|
55
51
|
var os__default = /*#__PURE__*/_interopDefault(os);
|
|
56
|
-
var
|
|
52
|
+
var process2__default = /*#__PURE__*/_interopDefault(process2);
|
|
57
53
|
var fs3__default = /*#__PURE__*/_interopDefault(fs3);
|
|
58
54
|
|
|
55
|
+
var __create = Object.create;
|
|
59
56
|
var __defProp = Object.defineProperty;
|
|
57
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
58
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
59
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
60
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
60
61
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
61
62
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
62
63
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
@@ -65,6 +66,28 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
65
66
|
return require.apply(this, arguments);
|
|
66
67
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
67
68
|
});
|
|
69
|
+
var __esm = (fn, res) => function __init() {
|
|
70
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
71
|
+
};
|
|
72
|
+
var __commonJS = (cb, mod2) => function __require2() {
|
|
73
|
+
return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
|
|
74
|
+
};
|
|
75
|
+
var __copyProps = (to, from, except, desc) => {
|
|
76
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
77
|
+
for (let key of __getOwnPropNames(from))
|
|
78
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
79
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
80
|
+
}
|
|
81
|
+
return to;
|
|
82
|
+
};
|
|
83
|
+
var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
|
|
84
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
85
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
86
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
87
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
88
|
+
isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
|
|
89
|
+
mod2
|
|
90
|
+
));
|
|
68
91
|
var __publicField = (obj, key, value) => {
|
|
69
92
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
70
93
|
return value;
|
|
@@ -99,238 +122,3015 @@ var __privateMethod = (obj, member, method) => {
|
|
|
99
122
|
__accessCheck(obj, member, "access private method");
|
|
100
123
|
return method;
|
|
101
124
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
silent: "silent",
|
|
107
|
-
info: "info",
|
|
108
|
-
debug: "debug"
|
|
109
|
-
};
|
|
110
|
-
function createLogger({ logLevel, name, spinner }) {
|
|
111
|
-
const logs = [];
|
|
112
|
-
const log = (message) => {
|
|
113
|
-
if (message && spinner) {
|
|
114
|
-
spinner.text = message;
|
|
115
|
-
logs.push(message);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
const error = (message) => {
|
|
119
|
-
if (message) {
|
|
120
|
-
throw new Error(message || "Something went wrong");
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
const warn = (message) => {
|
|
124
|
-
if (message && spinner) {
|
|
125
|
-
spinner.warn(pc3__default.default.yellow(message));
|
|
126
|
-
logs.push(message);
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
const info = (message) => {
|
|
130
|
-
if (message && spinner && logLevel !== LogLevel.silent) {
|
|
131
|
-
spinner.info(message);
|
|
132
|
-
logs.push(message);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
const logger = {
|
|
136
|
-
name,
|
|
137
|
-
logLevel,
|
|
138
|
-
log,
|
|
139
|
-
error,
|
|
140
|
-
warn,
|
|
141
|
-
info,
|
|
142
|
-
spinner,
|
|
143
|
-
logs
|
|
144
|
-
};
|
|
145
|
-
return logger;
|
|
146
|
-
}
|
|
147
|
-
var defaultColours = ["black", "blue", "darkBlue", "cyan", "gray", "green", "darkGreen", "magenta", "red", "darkRed", "yellow", "darkYellow"];
|
|
148
|
-
function randomColour(text, colours = defaultColours) {
|
|
149
|
-
if (!text) {
|
|
150
|
-
return "white";
|
|
151
|
-
}
|
|
152
|
-
const random = seedrandom__default.default(text);
|
|
153
|
-
const colour = colours.at(Math.floor(random() * colours.length)) || "white";
|
|
154
|
-
return colour;
|
|
155
|
-
}
|
|
156
|
-
function randomPicoColour(text, colors = defaultColours) {
|
|
157
|
-
const colours = pc3__default.default.createColors(true);
|
|
158
|
-
if (!text) {
|
|
159
|
-
return colours.white(text);
|
|
160
|
-
}
|
|
161
|
-
const colour = randomColour(text, colors);
|
|
162
|
-
const isDark = colour.includes("dark");
|
|
163
|
-
const key = colour.replace("dark", "").toLowerCase();
|
|
164
|
-
const formatter = colours[key];
|
|
165
|
-
if (isDark) {
|
|
166
|
-
return pc3__default.default.bold(formatter(text));
|
|
125
|
+
|
|
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
|
+
var init_cjs_shims = __esm({
|
|
128
|
+
"../../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"() {
|
|
167
129
|
}
|
|
168
|
-
|
|
169
|
-
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
// ../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js
|
|
133
|
+
var require_universalify = __commonJS({
|
|
134
|
+
"../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports) {
|
|
135
|
+
init_cjs_shims();
|
|
136
|
+
exports.fromCallback = function(fn) {
|
|
137
|
+
return Object.defineProperty(function(...args) {
|
|
138
|
+
if (typeof args[args.length - 1] === "function")
|
|
139
|
+
fn.apply(this, args);
|
|
140
|
+
else {
|
|
141
|
+
return new Promise((resolve3, reject) => {
|
|
142
|
+
args.push((err, res) => err != null ? reject(err) : resolve3(res));
|
|
143
|
+
fn.apply(this, args);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}, "name", { value: fn.name });
|
|
147
|
+
};
|
|
148
|
+
exports.fromPromise = function(fn) {
|
|
149
|
+
return Object.defineProperty(function(...args) {
|
|
150
|
+
const cb = args[args.length - 1];
|
|
151
|
+
if (typeof cb !== "function")
|
|
152
|
+
return fn.apply(this, args);
|
|
153
|
+
else {
|
|
154
|
+
args.pop();
|
|
155
|
+
fn.apply(this, args).then((r) => cb(null, r), cb);
|
|
156
|
+
}
|
|
157
|
+
}, "name", { value: fn.name });
|
|
158
|
+
};
|
|
170
159
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
|
|
163
|
+
var require_polyfills = __commonJS({
|
|
164
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports, module) {
|
|
165
|
+
init_cjs_shims();
|
|
166
|
+
var constants = __require("constants");
|
|
167
|
+
var origCwd = process.cwd;
|
|
168
|
+
var cwd = null;
|
|
169
|
+
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
170
|
+
process.cwd = function() {
|
|
171
|
+
if (!cwd)
|
|
172
|
+
cwd = origCwd.call(process);
|
|
173
|
+
return cwd;
|
|
174
|
+
};
|
|
175
|
+
try {
|
|
176
|
+
process.cwd();
|
|
177
|
+
} catch (er) {
|
|
181
178
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
)
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
bun: () => {
|
|
191
|
-
throw new Error("Bun cannot read sync");
|
|
179
|
+
if (typeof process.chdir === "function") {
|
|
180
|
+
chdir = process.chdir;
|
|
181
|
+
process.chdir = function(d) {
|
|
182
|
+
cwd = null;
|
|
183
|
+
chdir.call(process, d);
|
|
184
|
+
};
|
|
185
|
+
if (Object.setPrototypeOf)
|
|
186
|
+
Object.setPrototypeOf(process.chdir, chdir);
|
|
192
187
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
)
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
188
|
+
var chdir;
|
|
189
|
+
module.exports = patch;
|
|
190
|
+
function patch(fs5) {
|
|
191
|
+
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
192
|
+
patchLchmod(fs5);
|
|
193
|
+
}
|
|
194
|
+
if (!fs5.lutimes) {
|
|
195
|
+
patchLutimes(fs5);
|
|
196
|
+
}
|
|
197
|
+
fs5.chown = chownFix(fs5.chown);
|
|
198
|
+
fs5.fchown = chownFix(fs5.fchown);
|
|
199
|
+
fs5.lchown = chownFix(fs5.lchown);
|
|
200
|
+
fs5.chmod = chmodFix(fs5.chmod);
|
|
201
|
+
fs5.fchmod = chmodFix(fs5.fchmod);
|
|
202
|
+
fs5.lchmod = chmodFix(fs5.lchmod);
|
|
203
|
+
fs5.chownSync = chownFixSync(fs5.chownSync);
|
|
204
|
+
fs5.fchownSync = chownFixSync(fs5.fchownSync);
|
|
205
|
+
fs5.lchownSync = chownFixSync(fs5.lchownSync);
|
|
206
|
+
fs5.chmodSync = chmodFixSync(fs5.chmodSync);
|
|
207
|
+
fs5.fchmodSync = chmodFixSync(fs5.fchmodSync);
|
|
208
|
+
fs5.lchmodSync = chmodFixSync(fs5.lchmodSync);
|
|
209
|
+
fs5.stat = statFix(fs5.stat);
|
|
210
|
+
fs5.fstat = statFix(fs5.fstat);
|
|
211
|
+
fs5.lstat = statFix(fs5.lstat);
|
|
212
|
+
fs5.statSync = statFixSync(fs5.statSync);
|
|
213
|
+
fs5.fstatSync = statFixSync(fs5.fstatSync);
|
|
214
|
+
fs5.lstatSync = statFixSync(fs5.lstatSync);
|
|
215
|
+
if (fs5.chmod && !fs5.lchmod) {
|
|
216
|
+
fs5.lchmod = function(path5, mode, cb) {
|
|
217
|
+
if (cb)
|
|
218
|
+
process.nextTick(cb);
|
|
219
|
+
};
|
|
220
|
+
fs5.lchmodSync = function() {
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
if (fs5.chown && !fs5.lchown) {
|
|
224
|
+
fs5.lchown = function(path5, uid, gid, cb) {
|
|
225
|
+
if (cb)
|
|
226
|
+
process.nextTick(cb);
|
|
227
|
+
};
|
|
228
|
+
fs5.lchownSync = function() {
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
if (platform === "win32") {
|
|
232
|
+
fs5.rename = typeof fs5.rename !== "function" ? fs5.rename : function(fs$rename) {
|
|
233
|
+
function rename(from, to, cb) {
|
|
234
|
+
var start = Date.now();
|
|
235
|
+
var backoff = 0;
|
|
236
|
+
fs$rename(from, to, function CB(er) {
|
|
237
|
+
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
238
|
+
setTimeout(function() {
|
|
239
|
+
fs5.stat(to, function(stater, st) {
|
|
240
|
+
if (stater && stater.code === "ENOENT")
|
|
241
|
+
fs$rename(from, to, CB);
|
|
242
|
+
else
|
|
243
|
+
cb(er);
|
|
244
|
+
});
|
|
245
|
+
}, backoff);
|
|
246
|
+
if (backoff < 100)
|
|
247
|
+
backoff += 10;
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
if (cb)
|
|
251
|
+
cb(er);
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
if (Object.setPrototypeOf)
|
|
255
|
+
Object.setPrototypeOf(rename, fs$rename);
|
|
256
|
+
return rename;
|
|
257
|
+
}(fs5.rename);
|
|
258
|
+
}
|
|
259
|
+
fs5.read = typeof fs5.read !== "function" ? fs5.read : function(fs$read) {
|
|
260
|
+
function read2(fd, buffer, offset, length, position, callback_) {
|
|
261
|
+
var callback;
|
|
262
|
+
if (callback_ && typeof callback_ === "function") {
|
|
263
|
+
var eagCounter = 0;
|
|
264
|
+
callback = function(er, _, __) {
|
|
265
|
+
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
266
|
+
eagCounter++;
|
|
267
|
+
return fs$read.call(fs5, fd, buffer, offset, length, position, callback);
|
|
268
|
+
}
|
|
269
|
+
callback_.apply(this, arguments);
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
return fs$read.call(fs5, fd, buffer, offset, length, position, callback);
|
|
273
|
+
}
|
|
274
|
+
if (Object.setPrototypeOf)
|
|
275
|
+
Object.setPrototypeOf(read2, fs$read);
|
|
276
|
+
return read2;
|
|
277
|
+
}(fs5.read);
|
|
278
|
+
fs5.readSync = typeof fs5.readSync !== "function" ? fs5.readSync : /* @__PURE__ */ function(fs$readSync) {
|
|
279
|
+
return function(fd, buffer, offset, length, position) {
|
|
280
|
+
var eagCounter = 0;
|
|
281
|
+
while (true) {
|
|
282
|
+
try {
|
|
283
|
+
return fs$readSync.call(fs5, fd, buffer, offset, length, position);
|
|
284
|
+
} catch (er) {
|
|
285
|
+
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
286
|
+
eagCounter++;
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
throw er;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}(fs5.readSync);
|
|
294
|
+
function patchLchmod(fs6) {
|
|
295
|
+
fs6.lchmod = function(path5, mode, callback) {
|
|
296
|
+
fs6.open(
|
|
297
|
+
path5,
|
|
298
|
+
constants.O_WRONLY | constants.O_SYMLINK,
|
|
299
|
+
mode,
|
|
300
|
+
function(err, fd) {
|
|
301
|
+
if (err) {
|
|
302
|
+
if (callback)
|
|
303
|
+
callback(err);
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
fs6.fchmod(fd, mode, function(err2) {
|
|
307
|
+
fs6.close(fd, function(err22) {
|
|
308
|
+
if (callback)
|
|
309
|
+
callback(err2 || err22);
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
);
|
|
314
|
+
};
|
|
315
|
+
fs6.lchmodSync = function(path5, mode) {
|
|
316
|
+
var fd = fs6.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
317
|
+
var threw = true;
|
|
318
|
+
var ret;
|
|
319
|
+
try {
|
|
320
|
+
ret = fs6.fchmodSync(fd, mode);
|
|
321
|
+
threw = false;
|
|
322
|
+
} finally {
|
|
323
|
+
if (threw) {
|
|
324
|
+
try {
|
|
325
|
+
fs6.closeSync(fd);
|
|
326
|
+
} catch (er) {
|
|
327
|
+
}
|
|
328
|
+
} else {
|
|
329
|
+
fs6.closeSync(fd);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return ret;
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
function patchLutimes(fs6) {
|
|
336
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs6.futimes) {
|
|
337
|
+
fs6.lutimes = function(path5, at, mt, cb) {
|
|
338
|
+
fs6.open(path5, constants.O_SYMLINK, function(er, fd) {
|
|
339
|
+
if (er) {
|
|
340
|
+
if (cb)
|
|
341
|
+
cb(er);
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
fs6.futimes(fd, at, mt, function(er2) {
|
|
345
|
+
fs6.close(fd, function(er22) {
|
|
346
|
+
if (cb)
|
|
347
|
+
cb(er2 || er22);
|
|
348
|
+
});
|
|
349
|
+
});
|
|
350
|
+
});
|
|
351
|
+
};
|
|
352
|
+
fs6.lutimesSync = function(path5, at, mt) {
|
|
353
|
+
var fd = fs6.openSync(path5, constants.O_SYMLINK);
|
|
354
|
+
var ret;
|
|
355
|
+
var threw = true;
|
|
356
|
+
try {
|
|
357
|
+
ret = fs6.futimesSync(fd, at, mt);
|
|
358
|
+
threw = false;
|
|
359
|
+
} finally {
|
|
360
|
+
if (threw) {
|
|
361
|
+
try {
|
|
362
|
+
fs6.closeSync(fd);
|
|
363
|
+
} catch (er) {
|
|
364
|
+
}
|
|
365
|
+
} else {
|
|
366
|
+
fs6.closeSync(fd);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
return ret;
|
|
370
|
+
};
|
|
371
|
+
} else if (fs6.futimes) {
|
|
372
|
+
fs6.lutimes = function(_a, _b, _c, cb) {
|
|
373
|
+
if (cb)
|
|
374
|
+
process.nextTick(cb);
|
|
375
|
+
};
|
|
376
|
+
fs6.lutimesSync = function() {
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
function chmodFix(orig) {
|
|
381
|
+
if (!orig)
|
|
382
|
+
return orig;
|
|
383
|
+
return function(target, mode, cb) {
|
|
384
|
+
return orig.call(fs5, target, mode, function(er) {
|
|
385
|
+
if (chownErOk(er))
|
|
386
|
+
er = null;
|
|
387
|
+
if (cb)
|
|
388
|
+
cb.apply(this, arguments);
|
|
389
|
+
});
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
function chmodFixSync(orig) {
|
|
393
|
+
if (!orig)
|
|
394
|
+
return orig;
|
|
395
|
+
return function(target, mode) {
|
|
396
|
+
try {
|
|
397
|
+
return orig.call(fs5, target, mode);
|
|
398
|
+
} catch (er) {
|
|
399
|
+
if (!chownErOk(er))
|
|
400
|
+
throw er;
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
function chownFix(orig) {
|
|
405
|
+
if (!orig)
|
|
406
|
+
return orig;
|
|
407
|
+
return function(target, uid, gid, cb) {
|
|
408
|
+
return orig.call(fs5, target, uid, gid, function(er) {
|
|
409
|
+
if (chownErOk(er))
|
|
410
|
+
er = null;
|
|
411
|
+
if (cb)
|
|
412
|
+
cb.apply(this, arguments);
|
|
413
|
+
});
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
function chownFixSync(orig) {
|
|
417
|
+
if (!orig)
|
|
418
|
+
return orig;
|
|
419
|
+
return function(target, uid, gid) {
|
|
420
|
+
try {
|
|
421
|
+
return orig.call(fs5, target, uid, gid);
|
|
422
|
+
} catch (er) {
|
|
423
|
+
if (!chownErOk(er))
|
|
424
|
+
throw er;
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
function statFix(orig) {
|
|
429
|
+
if (!orig)
|
|
430
|
+
return orig;
|
|
431
|
+
return function(target, options, cb) {
|
|
432
|
+
if (typeof options === "function") {
|
|
433
|
+
cb = options;
|
|
434
|
+
options = null;
|
|
435
|
+
}
|
|
436
|
+
function callback(er, stats) {
|
|
437
|
+
if (stats) {
|
|
438
|
+
if (stats.uid < 0)
|
|
439
|
+
stats.uid += 4294967296;
|
|
440
|
+
if (stats.gid < 0)
|
|
441
|
+
stats.gid += 4294967296;
|
|
442
|
+
}
|
|
443
|
+
if (cb)
|
|
444
|
+
cb.apply(this, arguments);
|
|
445
|
+
}
|
|
446
|
+
return options ? orig.call(fs5, target, options, callback) : orig.call(fs5, target, callback);
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
function statFixSync(orig) {
|
|
450
|
+
if (!orig)
|
|
451
|
+
return orig;
|
|
452
|
+
return function(target, options) {
|
|
453
|
+
var stats = options ? orig.call(fs5, target, options) : orig.call(fs5, target);
|
|
454
|
+
if (stats) {
|
|
455
|
+
if (stats.uid < 0)
|
|
456
|
+
stats.uid += 4294967296;
|
|
457
|
+
if (stats.gid < 0)
|
|
458
|
+
stats.gid += 4294967296;
|
|
459
|
+
}
|
|
460
|
+
return stats;
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
function chownErOk(er) {
|
|
464
|
+
if (!er)
|
|
465
|
+
return true;
|
|
466
|
+
if (er.code === "ENOSYS")
|
|
467
|
+
return true;
|
|
468
|
+
var nonroot = !process.getuid || process.getuid() !== 0;
|
|
469
|
+
if (nonroot) {
|
|
470
|
+
if (er.code === "EINVAL" || er.code === "EPERM")
|
|
471
|
+
return true;
|
|
472
|
+
}
|
|
473
|
+
return false;
|
|
216
474
|
}
|
|
217
|
-
} catch (error) {
|
|
218
|
-
return false;
|
|
219
475
|
}
|
|
220
|
-
return false;
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Convert Swagger path to template literals/ template strings(camelcase)
|
|
224
|
-
* @example /pet/{petId} => `/pet/${petId}`
|
|
225
|
-
* @example /account/monetary-accountID => `/account/${monetaryAccountId}`
|
|
226
|
-
* @example /account/userID => `/account/${userId}`
|
|
227
|
-
*/
|
|
228
|
-
get template() {
|
|
229
|
-
return this.toTemplateString();
|
|
230
|
-
}
|
|
231
|
-
get object() {
|
|
232
|
-
return this.toObject();
|
|
233
|
-
}
|
|
234
|
-
get params() {
|
|
235
|
-
return this.getParams();
|
|
236
476
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
|
|
480
|
+
var require_legacy_streams = __commonJS({
|
|
481
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module) {
|
|
482
|
+
init_cjs_shims();
|
|
483
|
+
var Stream = __require("stream").Stream;
|
|
484
|
+
module.exports = legacy;
|
|
485
|
+
function legacy(fs5) {
|
|
486
|
+
return {
|
|
487
|
+
ReadStream,
|
|
488
|
+
WriteStream
|
|
489
|
+
};
|
|
490
|
+
function ReadStream(path5, options) {
|
|
491
|
+
if (!(this instanceof ReadStream))
|
|
492
|
+
return new ReadStream(path5, options);
|
|
493
|
+
Stream.call(this);
|
|
494
|
+
var self2 = this;
|
|
495
|
+
this.path = path5;
|
|
496
|
+
this.fd = null;
|
|
497
|
+
this.readable = true;
|
|
498
|
+
this.paused = false;
|
|
499
|
+
this.flags = "r";
|
|
500
|
+
this.mode = 438;
|
|
501
|
+
this.bufferSize = 64 * 1024;
|
|
502
|
+
options = options || {};
|
|
503
|
+
var keys = Object.keys(options);
|
|
504
|
+
for (var index = 0, length = keys.length; index < length; index++) {
|
|
505
|
+
var key = keys[index];
|
|
506
|
+
this[key] = options[key];
|
|
507
|
+
}
|
|
508
|
+
if (this.encoding)
|
|
509
|
+
this.setEncoding(this.encoding);
|
|
510
|
+
if (this.start !== void 0) {
|
|
511
|
+
if ("number" !== typeof this.start) {
|
|
512
|
+
throw TypeError("start must be a Number");
|
|
513
|
+
}
|
|
514
|
+
if (this.end === void 0) {
|
|
515
|
+
this.end = Infinity;
|
|
516
|
+
} else if ("number" !== typeof this.end) {
|
|
517
|
+
throw TypeError("end must be a Number");
|
|
518
|
+
}
|
|
519
|
+
if (this.start > this.end) {
|
|
520
|
+
throw new Error("start must be <= end");
|
|
521
|
+
}
|
|
522
|
+
this.pos = this.start;
|
|
523
|
+
}
|
|
524
|
+
if (this.fd !== null) {
|
|
525
|
+
process.nextTick(function() {
|
|
526
|
+
self2._read();
|
|
527
|
+
});
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
fs5.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
531
|
+
if (err) {
|
|
532
|
+
self2.emit("error", err);
|
|
533
|
+
self2.readable = false;
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
self2.fd = fd;
|
|
537
|
+
self2.emit("open", fd);
|
|
538
|
+
self2._read();
|
|
539
|
+
});
|
|
245
540
|
}
|
|
246
|
-
|
|
247
|
-
|
|
541
|
+
function WriteStream(path5, options) {
|
|
542
|
+
if (!(this instanceof WriteStream))
|
|
543
|
+
return new WriteStream(path5, options);
|
|
544
|
+
Stream.call(this);
|
|
545
|
+
this.path = path5;
|
|
546
|
+
this.fd = null;
|
|
547
|
+
this.writable = true;
|
|
548
|
+
this.flags = "w";
|
|
549
|
+
this.encoding = "binary";
|
|
550
|
+
this.mode = 438;
|
|
551
|
+
this.bytesWritten = 0;
|
|
552
|
+
options = options || {};
|
|
553
|
+
var keys = Object.keys(options);
|
|
554
|
+
for (var index = 0, length = keys.length; index < length; index++) {
|
|
555
|
+
var key = keys[index];
|
|
556
|
+
this[key] = options[key];
|
|
557
|
+
}
|
|
558
|
+
if (this.start !== void 0) {
|
|
559
|
+
if ("number" !== typeof this.start) {
|
|
560
|
+
throw TypeError("start must be a Number");
|
|
561
|
+
}
|
|
562
|
+
if (this.start < 0) {
|
|
563
|
+
throw new Error("start must be >= zero");
|
|
564
|
+
}
|
|
565
|
+
this.pos = this.start;
|
|
566
|
+
}
|
|
567
|
+
this.busy = false;
|
|
568
|
+
this._queue = [];
|
|
569
|
+
if (this.fd === null) {
|
|
570
|
+
this._open = fs5.open;
|
|
571
|
+
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
572
|
+
this.flush();
|
|
573
|
+
}
|
|
248
574
|
}
|
|
249
|
-
return `{ url: '${object.url}' }`;
|
|
250
575
|
}
|
|
251
|
-
return object;
|
|
252
576
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
577
|
+
});
|
|
578
|
+
|
|
579
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js
|
|
580
|
+
var require_clone = __commonJS({
|
|
581
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module) {
|
|
582
|
+
init_cjs_shims();
|
|
583
|
+
module.exports = clone;
|
|
584
|
+
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
|
585
|
+
return obj.__proto__;
|
|
586
|
+
};
|
|
587
|
+
function clone(obj) {
|
|
588
|
+
if (obj === null || typeof obj !== "object")
|
|
589
|
+
return obj;
|
|
590
|
+
if (obj instanceof Object)
|
|
591
|
+
var copy = { __proto__: getPrototypeOf(obj) };
|
|
592
|
+
else
|
|
593
|
+
var copy = /* @__PURE__ */ Object.create(null);
|
|
594
|
+
Object.getOwnPropertyNames(obj).forEach(function(key) {
|
|
595
|
+
Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
|
|
596
|
+
});
|
|
597
|
+
return copy;
|
|
269
598
|
}
|
|
270
|
-
return `\`${newPath}\``;
|
|
271
599
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
|
|
603
|
+
var require_graceful_fs = __commonJS({
|
|
604
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module) {
|
|
605
|
+
init_cjs_shims();
|
|
606
|
+
var fs5 = __require("fs");
|
|
607
|
+
var polyfills = require_polyfills();
|
|
608
|
+
var legacy = require_legacy_streams();
|
|
609
|
+
var clone = require_clone();
|
|
610
|
+
var util = __require("util");
|
|
611
|
+
var gracefulQueue;
|
|
612
|
+
var previousSymbol;
|
|
613
|
+
if (typeof Symbol === "function" && typeof Symbol.for === "function") {
|
|
614
|
+
gracefulQueue = Symbol.for("graceful-fs.queue");
|
|
615
|
+
previousSymbol = Symbol.for("graceful-fs.previous");
|
|
616
|
+
} else {
|
|
617
|
+
gracefulQueue = "___graceful-fs.queue";
|
|
618
|
+
previousSymbol = "___graceful-fs.previous";
|
|
277
619
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
620
|
+
function noop() {
|
|
621
|
+
}
|
|
622
|
+
function publishQueue(context, queue2) {
|
|
623
|
+
Object.defineProperty(context, gracefulQueue, {
|
|
624
|
+
get: function() {
|
|
625
|
+
return queue2;
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
var debug = noop;
|
|
630
|
+
if (util.debuglog)
|
|
631
|
+
debug = util.debuglog("gfs4");
|
|
632
|
+
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
|
633
|
+
debug = function() {
|
|
634
|
+
var m = util.format.apply(util, arguments);
|
|
635
|
+
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
636
|
+
console.error(m);
|
|
637
|
+
};
|
|
638
|
+
if (!fs5[gracefulQueue]) {
|
|
639
|
+
queue = global[gracefulQueue] || [];
|
|
640
|
+
publishQueue(fs5, queue);
|
|
641
|
+
fs5.close = function(fs$close) {
|
|
642
|
+
function close(fd, cb) {
|
|
643
|
+
return fs$close.call(fs5, fd, function(err) {
|
|
644
|
+
if (!err) {
|
|
645
|
+
resetQueue();
|
|
646
|
+
}
|
|
647
|
+
if (typeof cb === "function")
|
|
648
|
+
cb.apply(this, arguments);
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
Object.defineProperty(close, previousSymbol, {
|
|
652
|
+
value: fs$close
|
|
653
|
+
});
|
|
654
|
+
return close;
|
|
655
|
+
}(fs5.close);
|
|
656
|
+
fs5.closeSync = function(fs$closeSync) {
|
|
657
|
+
function closeSync(fd) {
|
|
658
|
+
fs$closeSync.apply(fs5, arguments);
|
|
659
|
+
resetQueue();
|
|
660
|
+
}
|
|
661
|
+
Object.defineProperty(closeSync, previousSymbol, {
|
|
662
|
+
value: fs$closeSync
|
|
663
|
+
});
|
|
664
|
+
return closeSync;
|
|
665
|
+
}(fs5.closeSync);
|
|
666
|
+
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
667
|
+
process.on("exit", function() {
|
|
668
|
+
debug(fs5[gracefulQueue]);
|
|
669
|
+
__require("assert").equal(fs5[gracefulQueue].length, 0);
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
var queue;
|
|
674
|
+
if (!global[gracefulQueue]) {
|
|
675
|
+
publishQueue(global, fs5[gracefulQueue]);
|
|
676
|
+
}
|
|
677
|
+
module.exports = patch(clone(fs5));
|
|
678
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs5.__patched) {
|
|
679
|
+
module.exports = patch(fs5);
|
|
680
|
+
fs5.__patched = true;
|
|
681
|
+
}
|
|
682
|
+
function patch(fs6) {
|
|
683
|
+
polyfills(fs6);
|
|
684
|
+
fs6.gracefulify = patch;
|
|
685
|
+
fs6.createReadStream = createReadStream;
|
|
686
|
+
fs6.createWriteStream = createWriteStream;
|
|
687
|
+
var fs$readFile = fs6.readFile;
|
|
688
|
+
fs6.readFile = readFile;
|
|
689
|
+
function readFile(path5, options, cb) {
|
|
690
|
+
if (typeof options === "function")
|
|
691
|
+
cb = options, options = null;
|
|
692
|
+
return go$readFile(path5, options, cb);
|
|
693
|
+
function go$readFile(path6, options2, cb2, startTime) {
|
|
694
|
+
return fs$readFile(path6, options2, function(err) {
|
|
695
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
696
|
+
enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
697
|
+
else {
|
|
698
|
+
if (typeof cb2 === "function")
|
|
699
|
+
cb2.apply(this, arguments);
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
var fs$writeFile = fs6.writeFile;
|
|
705
|
+
fs6.writeFile = writeFile;
|
|
706
|
+
function writeFile(path5, data, options, cb) {
|
|
707
|
+
if (typeof options === "function")
|
|
708
|
+
cb = options, options = null;
|
|
709
|
+
return go$writeFile(path5, data, options, cb);
|
|
710
|
+
function go$writeFile(path6, data2, options2, cb2, startTime) {
|
|
711
|
+
return fs$writeFile(path6, data2, options2, function(err) {
|
|
712
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
713
|
+
enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
714
|
+
else {
|
|
715
|
+
if (typeof cb2 === "function")
|
|
716
|
+
cb2.apply(this, arguments);
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
var fs$appendFile = fs6.appendFile;
|
|
722
|
+
if (fs$appendFile)
|
|
723
|
+
fs6.appendFile = appendFile;
|
|
724
|
+
function appendFile(path5, data, options, cb) {
|
|
725
|
+
if (typeof options === "function")
|
|
726
|
+
cb = options, options = null;
|
|
727
|
+
return go$appendFile(path5, data, options, cb);
|
|
728
|
+
function go$appendFile(path6, data2, options2, cb2, startTime) {
|
|
729
|
+
return fs$appendFile(path6, data2, options2, function(err) {
|
|
730
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
731
|
+
enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
732
|
+
else {
|
|
733
|
+
if (typeof cb2 === "function")
|
|
734
|
+
cb2.apply(this, arguments);
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
var fs$copyFile = fs6.copyFile;
|
|
740
|
+
if (fs$copyFile)
|
|
741
|
+
fs6.copyFile = copyFile;
|
|
742
|
+
function copyFile(src, dest, flags, cb) {
|
|
743
|
+
if (typeof flags === "function") {
|
|
744
|
+
cb = flags;
|
|
745
|
+
flags = 0;
|
|
746
|
+
}
|
|
747
|
+
return go$copyFile(src, dest, flags, cb);
|
|
748
|
+
function go$copyFile(src2, dest2, flags2, cb2, startTime) {
|
|
749
|
+
return fs$copyFile(src2, dest2, flags2, function(err) {
|
|
750
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
751
|
+
enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
752
|
+
else {
|
|
753
|
+
if (typeof cb2 === "function")
|
|
754
|
+
cb2.apply(this, arguments);
|
|
755
|
+
}
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
var fs$readdir = fs6.readdir;
|
|
760
|
+
fs6.readdir = readdir;
|
|
761
|
+
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
762
|
+
function readdir(path5, options, cb) {
|
|
763
|
+
if (typeof options === "function")
|
|
764
|
+
cb = options, options = null;
|
|
765
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) {
|
|
766
|
+
return fs$readdir(path6, fs$readdirCallback(
|
|
767
|
+
path6,
|
|
768
|
+
options2,
|
|
769
|
+
cb2,
|
|
770
|
+
startTime
|
|
771
|
+
));
|
|
772
|
+
} : function go$readdir2(path6, options2, cb2, startTime) {
|
|
773
|
+
return fs$readdir(path6, options2, fs$readdirCallback(
|
|
774
|
+
path6,
|
|
775
|
+
options2,
|
|
776
|
+
cb2,
|
|
777
|
+
startTime
|
|
778
|
+
));
|
|
779
|
+
};
|
|
780
|
+
return go$readdir(path5, options, cb);
|
|
781
|
+
function fs$readdirCallback(path6, options2, cb2, startTime) {
|
|
782
|
+
return function(err, files) {
|
|
783
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
784
|
+
enqueue([
|
|
785
|
+
go$readdir,
|
|
786
|
+
[path6, options2, cb2],
|
|
787
|
+
err,
|
|
788
|
+
startTime || Date.now(),
|
|
789
|
+
Date.now()
|
|
790
|
+
]);
|
|
791
|
+
else {
|
|
792
|
+
if (files && files.sort)
|
|
793
|
+
files.sort();
|
|
794
|
+
if (typeof cb2 === "function")
|
|
795
|
+
cb2.call(this, err, files);
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
if (process.version.substr(0, 4) === "v0.8") {
|
|
801
|
+
var legStreams = legacy(fs6);
|
|
802
|
+
ReadStream = legStreams.ReadStream;
|
|
803
|
+
WriteStream = legStreams.WriteStream;
|
|
804
|
+
}
|
|
805
|
+
var fs$ReadStream = fs6.ReadStream;
|
|
806
|
+
if (fs$ReadStream) {
|
|
807
|
+
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
808
|
+
ReadStream.prototype.open = ReadStream$open;
|
|
809
|
+
}
|
|
810
|
+
var fs$WriteStream = fs6.WriteStream;
|
|
811
|
+
if (fs$WriteStream) {
|
|
812
|
+
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
813
|
+
WriteStream.prototype.open = WriteStream$open;
|
|
814
|
+
}
|
|
815
|
+
Object.defineProperty(fs6, "ReadStream", {
|
|
816
|
+
get: function() {
|
|
817
|
+
return ReadStream;
|
|
818
|
+
},
|
|
819
|
+
set: function(val) {
|
|
820
|
+
ReadStream = val;
|
|
821
|
+
},
|
|
822
|
+
enumerable: true,
|
|
823
|
+
configurable: true
|
|
824
|
+
});
|
|
825
|
+
Object.defineProperty(fs6, "WriteStream", {
|
|
826
|
+
get: function() {
|
|
827
|
+
return WriteStream;
|
|
828
|
+
},
|
|
829
|
+
set: function(val) {
|
|
830
|
+
WriteStream = val;
|
|
831
|
+
},
|
|
832
|
+
enumerable: true,
|
|
833
|
+
configurable: true
|
|
834
|
+
});
|
|
835
|
+
var FileReadStream = ReadStream;
|
|
836
|
+
Object.defineProperty(fs6, "FileReadStream", {
|
|
837
|
+
get: function() {
|
|
838
|
+
return FileReadStream;
|
|
839
|
+
},
|
|
840
|
+
set: function(val) {
|
|
841
|
+
FileReadStream = val;
|
|
842
|
+
},
|
|
843
|
+
enumerable: true,
|
|
844
|
+
configurable: true
|
|
845
|
+
});
|
|
846
|
+
var FileWriteStream = WriteStream;
|
|
847
|
+
Object.defineProperty(fs6, "FileWriteStream", {
|
|
848
|
+
get: function() {
|
|
849
|
+
return FileWriteStream;
|
|
850
|
+
},
|
|
851
|
+
set: function(val) {
|
|
852
|
+
FileWriteStream = val;
|
|
853
|
+
},
|
|
854
|
+
enumerable: true,
|
|
855
|
+
configurable: true
|
|
856
|
+
});
|
|
857
|
+
function ReadStream(path5, options) {
|
|
858
|
+
if (this instanceof ReadStream)
|
|
859
|
+
return fs$ReadStream.apply(this, arguments), this;
|
|
860
|
+
else
|
|
861
|
+
return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
862
|
+
}
|
|
863
|
+
function ReadStream$open() {
|
|
864
|
+
var that = this;
|
|
865
|
+
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
866
|
+
if (err) {
|
|
867
|
+
if (that.autoClose)
|
|
868
|
+
that.destroy();
|
|
869
|
+
that.emit("error", err);
|
|
870
|
+
} else {
|
|
871
|
+
that.fd = fd;
|
|
872
|
+
that.emit("open", fd);
|
|
873
|
+
that.read();
|
|
874
|
+
}
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
function WriteStream(path5, options) {
|
|
878
|
+
if (this instanceof WriteStream)
|
|
879
|
+
return fs$WriteStream.apply(this, arguments), this;
|
|
880
|
+
else
|
|
881
|
+
return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
882
|
+
}
|
|
883
|
+
function WriteStream$open() {
|
|
884
|
+
var that = this;
|
|
885
|
+
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
886
|
+
if (err) {
|
|
887
|
+
that.destroy();
|
|
888
|
+
that.emit("error", err);
|
|
889
|
+
} else {
|
|
890
|
+
that.fd = fd;
|
|
891
|
+
that.emit("open", fd);
|
|
892
|
+
}
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
function createReadStream(path5, options) {
|
|
896
|
+
return new fs6.ReadStream(path5, options);
|
|
897
|
+
}
|
|
898
|
+
function createWriteStream(path5, options) {
|
|
899
|
+
return new fs6.WriteStream(path5, options);
|
|
900
|
+
}
|
|
901
|
+
var fs$open = fs6.open;
|
|
902
|
+
fs6.open = open;
|
|
903
|
+
function open(path5, flags, mode, cb) {
|
|
904
|
+
if (typeof mode === "function")
|
|
905
|
+
cb = mode, mode = null;
|
|
906
|
+
return go$open(path5, flags, mode, cb);
|
|
907
|
+
function go$open(path6, flags2, mode2, cb2, startTime) {
|
|
908
|
+
return fs$open(path6, flags2, mode2, function(err, fd) {
|
|
909
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
910
|
+
enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
911
|
+
else {
|
|
912
|
+
if (typeof cb2 === "function")
|
|
913
|
+
cb2.apply(this, arguments);
|
|
914
|
+
}
|
|
915
|
+
});
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
return fs6;
|
|
919
|
+
}
|
|
920
|
+
function enqueue(elem) {
|
|
921
|
+
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
922
|
+
fs5[gracefulQueue].push(elem);
|
|
923
|
+
retry();
|
|
924
|
+
}
|
|
925
|
+
var retryTimer;
|
|
926
|
+
function resetQueue() {
|
|
927
|
+
var now = Date.now();
|
|
928
|
+
for (var i = 0; i < fs5[gracefulQueue].length; ++i) {
|
|
929
|
+
if (fs5[gracefulQueue][i].length > 2) {
|
|
930
|
+
fs5[gracefulQueue][i][3] = now;
|
|
931
|
+
fs5[gracefulQueue][i][4] = now;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
retry();
|
|
935
|
+
}
|
|
936
|
+
function retry() {
|
|
937
|
+
clearTimeout(retryTimer);
|
|
938
|
+
retryTimer = void 0;
|
|
939
|
+
if (fs5[gracefulQueue].length === 0)
|
|
940
|
+
return;
|
|
941
|
+
var elem = fs5[gracefulQueue].shift();
|
|
942
|
+
var fn = elem[0];
|
|
943
|
+
var args = elem[1];
|
|
944
|
+
var err = elem[2];
|
|
945
|
+
var startTime = elem[3];
|
|
946
|
+
var lastTime = elem[4];
|
|
947
|
+
if (startTime === void 0) {
|
|
948
|
+
debug("RETRY", fn.name, args);
|
|
949
|
+
fn.apply(null, args);
|
|
950
|
+
} else if (Date.now() - startTime >= 6e4) {
|
|
951
|
+
debug("TIMEOUT", fn.name, args);
|
|
952
|
+
var cb = args.pop();
|
|
953
|
+
if (typeof cb === "function")
|
|
954
|
+
cb.call(null, err);
|
|
955
|
+
} else {
|
|
956
|
+
var sinceAttempt = Date.now() - lastTime;
|
|
957
|
+
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
958
|
+
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
959
|
+
if (sinceAttempt >= desiredDelay) {
|
|
960
|
+
debug("RETRY", fn.name, args);
|
|
961
|
+
fn.apply(null, args.concat([startTime]));
|
|
962
|
+
} else {
|
|
963
|
+
fs5[gracefulQueue].push(elem);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
if (retryTimer === void 0) {
|
|
967
|
+
retryTimer = setTimeout(retry, 0);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
});
|
|
972
|
+
|
|
973
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js
|
|
974
|
+
var require_fs = __commonJS({
|
|
975
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js"(exports) {
|
|
976
|
+
init_cjs_shims();
|
|
977
|
+
var u = require_universalify().fromCallback;
|
|
978
|
+
var fs5 = require_graceful_fs();
|
|
979
|
+
var api = [
|
|
980
|
+
"access",
|
|
981
|
+
"appendFile",
|
|
982
|
+
"chmod",
|
|
983
|
+
"chown",
|
|
984
|
+
"close",
|
|
985
|
+
"copyFile",
|
|
986
|
+
"fchmod",
|
|
987
|
+
"fchown",
|
|
988
|
+
"fdatasync",
|
|
989
|
+
"fstat",
|
|
990
|
+
"fsync",
|
|
991
|
+
"ftruncate",
|
|
992
|
+
"futimes",
|
|
993
|
+
"lchmod",
|
|
994
|
+
"lchown",
|
|
995
|
+
"link",
|
|
996
|
+
"lstat",
|
|
997
|
+
"mkdir",
|
|
998
|
+
"mkdtemp",
|
|
999
|
+
"open",
|
|
1000
|
+
"opendir",
|
|
1001
|
+
"readdir",
|
|
1002
|
+
"readFile",
|
|
1003
|
+
"readlink",
|
|
1004
|
+
"realpath",
|
|
1005
|
+
"rename",
|
|
1006
|
+
"rm",
|
|
1007
|
+
"rmdir",
|
|
1008
|
+
"stat",
|
|
1009
|
+
"symlink",
|
|
1010
|
+
"truncate",
|
|
1011
|
+
"unlink",
|
|
1012
|
+
"utimes",
|
|
1013
|
+
"writeFile"
|
|
1014
|
+
].filter((key) => {
|
|
1015
|
+
return typeof fs5[key] === "function";
|
|
1016
|
+
});
|
|
1017
|
+
Object.assign(exports, fs5);
|
|
1018
|
+
api.forEach((method) => {
|
|
1019
|
+
exports[method] = u(fs5[method]);
|
|
1020
|
+
});
|
|
1021
|
+
exports.exists = function(filename, callback) {
|
|
1022
|
+
if (typeof callback === "function") {
|
|
1023
|
+
return fs5.exists(filename, callback);
|
|
1024
|
+
}
|
|
1025
|
+
return new Promise((resolve3) => {
|
|
1026
|
+
return fs5.exists(filename, resolve3);
|
|
1027
|
+
});
|
|
1028
|
+
};
|
|
1029
|
+
exports.read = function(fd, buffer, offset, length, position, callback) {
|
|
1030
|
+
if (typeof callback === "function") {
|
|
1031
|
+
return fs5.read(fd, buffer, offset, length, position, callback);
|
|
1032
|
+
}
|
|
1033
|
+
return new Promise((resolve3, reject) => {
|
|
1034
|
+
fs5.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
1035
|
+
if (err)
|
|
1036
|
+
return reject(err);
|
|
1037
|
+
resolve3({ bytesRead, buffer: buffer2 });
|
|
1038
|
+
});
|
|
1039
|
+
});
|
|
1040
|
+
};
|
|
1041
|
+
exports.write = function(fd, buffer, ...args) {
|
|
1042
|
+
if (typeof args[args.length - 1] === "function") {
|
|
1043
|
+
return fs5.write(fd, buffer, ...args);
|
|
1044
|
+
}
|
|
1045
|
+
return new Promise((resolve3, reject) => {
|
|
1046
|
+
fs5.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
1047
|
+
if (err)
|
|
1048
|
+
return reject(err);
|
|
1049
|
+
resolve3({ bytesWritten, buffer: buffer2 });
|
|
1050
|
+
});
|
|
1051
|
+
});
|
|
1052
|
+
};
|
|
1053
|
+
exports.readv = function(fd, buffers, ...args) {
|
|
1054
|
+
if (typeof args[args.length - 1] === "function") {
|
|
1055
|
+
return fs5.readv(fd, buffers, ...args);
|
|
1056
|
+
}
|
|
1057
|
+
return new Promise((resolve3, reject) => {
|
|
1058
|
+
fs5.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
|
|
1059
|
+
if (err)
|
|
1060
|
+
return reject(err);
|
|
1061
|
+
resolve3({ bytesRead, buffers: buffers2 });
|
|
1062
|
+
});
|
|
1063
|
+
});
|
|
1064
|
+
};
|
|
1065
|
+
exports.writev = function(fd, buffers, ...args) {
|
|
1066
|
+
if (typeof args[args.length - 1] === "function") {
|
|
1067
|
+
return fs5.writev(fd, buffers, ...args);
|
|
1068
|
+
}
|
|
1069
|
+
return new Promise((resolve3, reject) => {
|
|
1070
|
+
fs5.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
1071
|
+
if (err)
|
|
1072
|
+
return reject(err);
|
|
1073
|
+
resolve3({ bytesWritten, buffers: buffers2 });
|
|
1074
|
+
});
|
|
1075
|
+
});
|
|
1076
|
+
};
|
|
1077
|
+
if (typeof fs5.realpath.native === "function") {
|
|
1078
|
+
exports.realpath.native = u(fs5.realpath.native);
|
|
1079
|
+
} else {
|
|
1080
|
+
process.emitWarning(
|
|
1081
|
+
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
1082
|
+
"Warning",
|
|
1083
|
+
"fs-extra-WARN0003"
|
|
1084
|
+
);
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
});
|
|
1088
|
+
|
|
1089
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js
|
|
1090
|
+
var require_utils = __commonJS({
|
|
1091
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module) {
|
|
1092
|
+
init_cjs_shims();
|
|
1093
|
+
var path5 = __require("path");
|
|
1094
|
+
module.exports.checkPath = function checkPath(pth) {
|
|
1095
|
+
if (process.platform === "win32") {
|
|
1096
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path5.parse(pth).root, ""));
|
|
1097
|
+
if (pathHasInvalidWinCharacters) {
|
|
1098
|
+
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
1099
|
+
error.code = "EINVAL";
|
|
1100
|
+
throw error;
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
};
|
|
1104
|
+
}
|
|
1105
|
+
});
|
|
1106
|
+
|
|
1107
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js
|
|
1108
|
+
var require_make_dir = __commonJS({
|
|
1109
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module) {
|
|
1110
|
+
init_cjs_shims();
|
|
1111
|
+
var fs5 = require_fs();
|
|
1112
|
+
var { checkPath } = require_utils();
|
|
1113
|
+
var getMode = (options) => {
|
|
1114
|
+
const defaults = { mode: 511 };
|
|
1115
|
+
if (typeof options === "number")
|
|
1116
|
+
return options;
|
|
1117
|
+
return { ...defaults, ...options }.mode;
|
|
1118
|
+
};
|
|
1119
|
+
module.exports.makeDir = async (dir, options) => {
|
|
1120
|
+
checkPath(dir);
|
|
1121
|
+
return fs5.mkdir(dir, {
|
|
1122
|
+
mode: getMode(options),
|
|
1123
|
+
recursive: true
|
|
1124
|
+
});
|
|
1125
|
+
};
|
|
1126
|
+
module.exports.makeDirSync = (dir, options) => {
|
|
1127
|
+
checkPath(dir);
|
|
1128
|
+
return fs5.mkdirSync(dir, {
|
|
1129
|
+
mode: getMode(options),
|
|
1130
|
+
recursive: true
|
|
1131
|
+
});
|
|
1132
|
+
};
|
|
1133
|
+
}
|
|
1134
|
+
});
|
|
1135
|
+
|
|
1136
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js
|
|
1137
|
+
var require_mkdirs = __commonJS({
|
|
1138
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module) {
|
|
1139
|
+
init_cjs_shims();
|
|
1140
|
+
var u = require_universalify().fromPromise;
|
|
1141
|
+
var { makeDir: _makeDir, makeDirSync } = require_make_dir();
|
|
1142
|
+
var makeDir = u(_makeDir);
|
|
1143
|
+
module.exports = {
|
|
1144
|
+
mkdirs: makeDir,
|
|
1145
|
+
mkdirsSync: makeDirSync,
|
|
1146
|
+
// alias
|
|
1147
|
+
mkdirp: makeDir,
|
|
1148
|
+
mkdirpSync: makeDirSync,
|
|
1149
|
+
ensureDir: makeDir,
|
|
1150
|
+
ensureDirSync: makeDirSync
|
|
1151
|
+
};
|
|
1152
|
+
}
|
|
1153
|
+
});
|
|
1154
|
+
|
|
1155
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js
|
|
1156
|
+
var require_path_exists = __commonJS({
|
|
1157
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js"(exports, module) {
|
|
1158
|
+
init_cjs_shims();
|
|
1159
|
+
var u = require_universalify().fromPromise;
|
|
1160
|
+
var fs5 = require_fs();
|
|
1161
|
+
function pathExists2(path5) {
|
|
1162
|
+
return fs5.access(path5).then(() => true).catch(() => false);
|
|
1163
|
+
}
|
|
1164
|
+
module.exports = {
|
|
1165
|
+
pathExists: u(pathExists2),
|
|
1166
|
+
pathExistsSync: fs5.existsSync
|
|
1167
|
+
};
|
|
1168
|
+
}
|
|
1169
|
+
});
|
|
1170
|
+
|
|
1171
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js
|
|
1172
|
+
var require_utimes = __commonJS({
|
|
1173
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js"(exports, module) {
|
|
1174
|
+
init_cjs_shims();
|
|
1175
|
+
var fs5 = require_fs();
|
|
1176
|
+
var u = require_universalify().fromPromise;
|
|
1177
|
+
async function utimesMillis(path5, atime, mtime) {
|
|
1178
|
+
const fd = await fs5.open(path5, "r+");
|
|
1179
|
+
let closeErr = null;
|
|
1180
|
+
try {
|
|
1181
|
+
await fs5.futimes(fd, atime, mtime);
|
|
1182
|
+
} finally {
|
|
1183
|
+
try {
|
|
1184
|
+
await fs5.close(fd);
|
|
1185
|
+
} catch (e) {
|
|
1186
|
+
closeErr = e;
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
if (closeErr) {
|
|
1190
|
+
throw closeErr;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
function utimesMillisSync(path5, atime, mtime) {
|
|
1194
|
+
const fd = fs5.openSync(path5, "r+");
|
|
1195
|
+
fs5.futimesSync(fd, atime, mtime);
|
|
1196
|
+
return fs5.closeSync(fd);
|
|
1197
|
+
}
|
|
1198
|
+
module.exports = {
|
|
1199
|
+
utimesMillis: u(utimesMillis),
|
|
1200
|
+
utimesMillisSync
|
|
1201
|
+
};
|
|
1202
|
+
}
|
|
1203
|
+
});
|
|
1204
|
+
|
|
1205
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js
|
|
1206
|
+
var require_stat = __commonJS({
|
|
1207
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js"(exports, module) {
|
|
1208
|
+
init_cjs_shims();
|
|
1209
|
+
var fs5 = require_fs();
|
|
1210
|
+
var path5 = __require("path");
|
|
1211
|
+
var u = require_universalify().fromPromise;
|
|
1212
|
+
function getStats(src, dest, opts) {
|
|
1213
|
+
const statFunc = opts.dereference ? (file) => fs5.stat(file, { bigint: true }) : (file) => fs5.lstat(file, { bigint: true });
|
|
1214
|
+
return Promise.all([
|
|
1215
|
+
statFunc(src),
|
|
1216
|
+
statFunc(dest).catch((err) => {
|
|
1217
|
+
if (err.code === "ENOENT")
|
|
1218
|
+
return null;
|
|
1219
|
+
throw err;
|
|
1220
|
+
})
|
|
1221
|
+
]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
|
|
1222
|
+
}
|
|
1223
|
+
function getStatsSync(src, dest, opts) {
|
|
1224
|
+
let destStat;
|
|
1225
|
+
const statFunc = opts.dereference ? (file) => fs5.statSync(file, { bigint: true }) : (file) => fs5.lstatSync(file, { bigint: true });
|
|
1226
|
+
const srcStat = statFunc(src);
|
|
1227
|
+
try {
|
|
1228
|
+
destStat = statFunc(dest);
|
|
1229
|
+
} catch (err) {
|
|
1230
|
+
if (err.code === "ENOENT")
|
|
1231
|
+
return { srcStat, destStat: null };
|
|
1232
|
+
throw err;
|
|
1233
|
+
}
|
|
1234
|
+
return { srcStat, destStat };
|
|
1235
|
+
}
|
|
1236
|
+
async function checkPaths(src, dest, funcName, opts) {
|
|
1237
|
+
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
1238
|
+
if (destStat) {
|
|
1239
|
+
if (areIdentical(srcStat, destStat)) {
|
|
1240
|
+
const srcBaseName = path5.basename(src);
|
|
1241
|
+
const destBaseName = path5.basename(dest);
|
|
1242
|
+
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1243
|
+
return { srcStat, destStat, isChangingCase: true };
|
|
1244
|
+
}
|
|
1245
|
+
throw new Error("Source and destination must not be the same.");
|
|
1246
|
+
}
|
|
1247
|
+
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
|
1248
|
+
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
|
1249
|
+
}
|
|
1250
|
+
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
|
1251
|
+
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
|
1255
|
+
throw new Error(errMsg(src, dest, funcName));
|
|
1256
|
+
}
|
|
1257
|
+
return { srcStat, destStat };
|
|
1258
|
+
}
|
|
1259
|
+
function checkPathsSync(src, dest, funcName, opts) {
|
|
1260
|
+
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
1261
|
+
if (destStat) {
|
|
1262
|
+
if (areIdentical(srcStat, destStat)) {
|
|
1263
|
+
const srcBaseName = path5.basename(src);
|
|
1264
|
+
const destBaseName = path5.basename(dest);
|
|
1265
|
+
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1266
|
+
return { srcStat, destStat, isChangingCase: true };
|
|
1267
|
+
}
|
|
1268
|
+
throw new Error("Source and destination must not be the same.");
|
|
1269
|
+
}
|
|
1270
|
+
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
|
1271
|
+
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
|
1272
|
+
}
|
|
1273
|
+
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
|
1274
|
+
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
|
1278
|
+
throw new Error(errMsg(src, dest, funcName));
|
|
1279
|
+
}
|
|
1280
|
+
return { srcStat, destStat };
|
|
1281
|
+
}
|
|
1282
|
+
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
1283
|
+
const srcParent = path5.resolve(path5.dirname(src));
|
|
1284
|
+
const destParent = path5.resolve(path5.dirname(dest));
|
|
1285
|
+
if (destParent === srcParent || destParent === path5.parse(destParent).root)
|
|
1286
|
+
return;
|
|
1287
|
+
let destStat;
|
|
1288
|
+
try {
|
|
1289
|
+
destStat = await fs5.stat(destParent, { bigint: true });
|
|
1290
|
+
} catch (err) {
|
|
1291
|
+
if (err.code === "ENOENT")
|
|
1292
|
+
return;
|
|
1293
|
+
throw err;
|
|
1294
|
+
}
|
|
1295
|
+
if (areIdentical(srcStat, destStat)) {
|
|
1296
|
+
throw new Error(errMsg(src, dest, funcName));
|
|
1297
|
+
}
|
|
1298
|
+
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
1299
|
+
}
|
|
1300
|
+
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
1301
|
+
const srcParent = path5.resolve(path5.dirname(src));
|
|
1302
|
+
const destParent = path5.resolve(path5.dirname(dest));
|
|
1303
|
+
if (destParent === srcParent || destParent === path5.parse(destParent).root)
|
|
1304
|
+
return;
|
|
1305
|
+
let destStat;
|
|
1306
|
+
try {
|
|
1307
|
+
destStat = fs5.statSync(destParent, { bigint: true });
|
|
1308
|
+
} catch (err) {
|
|
1309
|
+
if (err.code === "ENOENT")
|
|
1310
|
+
return;
|
|
1311
|
+
throw err;
|
|
1312
|
+
}
|
|
1313
|
+
if (areIdentical(srcStat, destStat)) {
|
|
1314
|
+
throw new Error(errMsg(src, dest, funcName));
|
|
1315
|
+
}
|
|
1316
|
+
return checkParentPathsSync(src, srcStat, destParent, funcName);
|
|
1317
|
+
}
|
|
1318
|
+
function areIdentical(srcStat, destStat) {
|
|
1319
|
+
return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
1320
|
+
}
|
|
1321
|
+
function isSrcSubdir(src, dest) {
|
|
1322
|
+
const srcArr = path5.resolve(src).split(path5.sep).filter((i) => i);
|
|
1323
|
+
const destArr = path5.resolve(dest).split(path5.sep).filter((i) => i);
|
|
1324
|
+
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
1325
|
+
}
|
|
1326
|
+
function errMsg(src, dest, funcName) {
|
|
1327
|
+
return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
|
|
1328
|
+
}
|
|
1329
|
+
module.exports = {
|
|
1330
|
+
// checkPaths
|
|
1331
|
+
checkPaths: u(checkPaths),
|
|
1332
|
+
checkPathsSync,
|
|
1333
|
+
// checkParent
|
|
1334
|
+
checkParentPaths: u(checkParentPaths),
|
|
1335
|
+
checkParentPathsSync,
|
|
1336
|
+
// Misc
|
|
1337
|
+
isSrcSubdir,
|
|
1338
|
+
areIdentical
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1341
|
+
});
|
|
1342
|
+
|
|
1343
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js
|
|
1344
|
+
var require_copy = __commonJS({
|
|
1345
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js"(exports, module) {
|
|
1346
|
+
init_cjs_shims();
|
|
1347
|
+
var fs5 = require_fs();
|
|
1348
|
+
var path5 = __require("path");
|
|
1349
|
+
var { mkdirs } = require_mkdirs();
|
|
1350
|
+
var { pathExists: pathExists2 } = require_path_exists();
|
|
1351
|
+
var { utimesMillis } = require_utimes();
|
|
1352
|
+
var stat = require_stat();
|
|
1353
|
+
async function copy(src, dest, opts = {}) {
|
|
1354
|
+
if (typeof opts === "function") {
|
|
1355
|
+
opts = { filter: opts };
|
|
1356
|
+
}
|
|
1357
|
+
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
1358
|
+
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
1359
|
+
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
1360
|
+
process.emitWarning(
|
|
1361
|
+
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
|
1362
|
+
"Warning",
|
|
1363
|
+
"fs-extra-WARN0001"
|
|
1364
|
+
);
|
|
1365
|
+
}
|
|
1366
|
+
const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts);
|
|
1367
|
+
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
1368
|
+
const include = await runFilter(src, dest, opts);
|
|
1369
|
+
if (!include)
|
|
1370
|
+
return;
|
|
1371
|
+
const destParent = path5.dirname(dest);
|
|
1372
|
+
const dirExists = await pathExists2(destParent);
|
|
1373
|
+
if (!dirExists) {
|
|
1374
|
+
await mkdirs(destParent);
|
|
1375
|
+
}
|
|
1376
|
+
await getStatsAndPerformCopy(destStat, src, dest, opts);
|
|
1377
|
+
}
|
|
1378
|
+
async function runFilter(src, dest, opts) {
|
|
1379
|
+
if (!opts.filter)
|
|
1380
|
+
return true;
|
|
1381
|
+
return opts.filter(src, dest);
|
|
1382
|
+
}
|
|
1383
|
+
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
1384
|
+
const statFn = opts.dereference ? fs5.stat : fs5.lstat;
|
|
1385
|
+
const srcStat = await statFn(src);
|
|
1386
|
+
if (srcStat.isDirectory())
|
|
1387
|
+
return onDir(srcStat, destStat, src, dest, opts);
|
|
1388
|
+
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
|
|
1389
|
+
return onFile(srcStat, destStat, src, dest, opts);
|
|
1390
|
+
if (srcStat.isSymbolicLink())
|
|
1391
|
+
return onLink(destStat, src, dest, opts);
|
|
1392
|
+
if (srcStat.isSocket())
|
|
1393
|
+
throw new Error(`Cannot copy a socket file: ${src}`);
|
|
1394
|
+
if (srcStat.isFIFO())
|
|
1395
|
+
throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
|
1396
|
+
throw new Error(`Unknown file: ${src}`);
|
|
1397
|
+
}
|
|
1398
|
+
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
1399
|
+
if (!destStat)
|
|
1400
|
+
return copyFile(srcStat, src, dest, opts);
|
|
1401
|
+
if (opts.overwrite) {
|
|
1402
|
+
await fs5.unlink(dest);
|
|
1403
|
+
return copyFile(srcStat, src, dest, opts);
|
|
1404
|
+
}
|
|
1405
|
+
if (opts.errorOnExist) {
|
|
1406
|
+
throw new Error(`'${dest}' already exists`);
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
async function copyFile(srcStat, src, dest, opts) {
|
|
1410
|
+
await fs5.copyFile(src, dest);
|
|
1411
|
+
if (opts.preserveTimestamps) {
|
|
1412
|
+
if (fileIsNotWritable(srcStat.mode)) {
|
|
1413
|
+
await makeFileWritable(dest, srcStat.mode);
|
|
1414
|
+
}
|
|
1415
|
+
const updatedSrcStat = await fs5.stat(src);
|
|
1416
|
+
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1417
|
+
}
|
|
1418
|
+
return fs5.chmod(dest, srcStat.mode);
|
|
1419
|
+
}
|
|
1420
|
+
function fileIsNotWritable(srcMode) {
|
|
1421
|
+
return (srcMode & 128) === 0;
|
|
1422
|
+
}
|
|
1423
|
+
function makeFileWritable(dest, srcMode) {
|
|
1424
|
+
return fs5.chmod(dest, srcMode | 128);
|
|
1425
|
+
}
|
|
1426
|
+
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
1427
|
+
if (!destStat) {
|
|
1428
|
+
await fs5.mkdir(dest);
|
|
1429
|
+
}
|
|
1430
|
+
const items = await fs5.readdir(src);
|
|
1431
|
+
await Promise.all(items.map(async (item) => {
|
|
1432
|
+
const srcItem = path5.join(src, item);
|
|
1433
|
+
const destItem = path5.join(dest, item);
|
|
1434
|
+
const include = await runFilter(srcItem, destItem, opts);
|
|
1435
|
+
if (!include)
|
|
1436
|
+
return;
|
|
1437
|
+
const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
|
|
1438
|
+
return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
|
|
1439
|
+
}));
|
|
1440
|
+
if (!destStat) {
|
|
1441
|
+
await fs5.chmod(dest, srcStat.mode);
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
async function onLink(destStat, src, dest, opts) {
|
|
1445
|
+
let resolvedSrc = await fs5.readlink(src);
|
|
1446
|
+
if (opts.dereference) {
|
|
1447
|
+
resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
|
|
1448
|
+
}
|
|
1449
|
+
if (!destStat) {
|
|
1450
|
+
return fs5.symlink(resolvedSrc, dest);
|
|
1451
|
+
}
|
|
1452
|
+
let resolvedDest = null;
|
|
1453
|
+
try {
|
|
1454
|
+
resolvedDest = await fs5.readlink(dest);
|
|
1455
|
+
} catch (e) {
|
|
1456
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN")
|
|
1457
|
+
return fs5.symlink(resolvedSrc, dest);
|
|
1458
|
+
throw e;
|
|
1459
|
+
}
|
|
1460
|
+
if (opts.dereference) {
|
|
1461
|
+
resolvedDest = path5.resolve(process.cwd(), resolvedDest);
|
|
1462
|
+
}
|
|
1463
|
+
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1464
|
+
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
1465
|
+
}
|
|
1466
|
+
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
1467
|
+
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
1468
|
+
}
|
|
1469
|
+
await fs5.unlink(dest);
|
|
1470
|
+
return fs5.symlink(resolvedSrc, dest);
|
|
1471
|
+
}
|
|
1472
|
+
module.exports = copy;
|
|
1473
|
+
}
|
|
1474
|
+
});
|
|
1475
|
+
|
|
1476
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js
|
|
1477
|
+
var require_copy_sync = __commonJS({
|
|
1478
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module) {
|
|
1479
|
+
init_cjs_shims();
|
|
1480
|
+
var fs5 = require_graceful_fs();
|
|
1481
|
+
var path5 = __require("path");
|
|
1482
|
+
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
1483
|
+
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
1484
|
+
var stat = require_stat();
|
|
1485
|
+
function copySync(src, dest, opts) {
|
|
1486
|
+
if (typeof opts === "function") {
|
|
1487
|
+
opts = { filter: opts };
|
|
1488
|
+
}
|
|
1489
|
+
opts = opts || {};
|
|
1490
|
+
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
1491
|
+
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
1492
|
+
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
1493
|
+
process.emitWarning(
|
|
1494
|
+
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
|
1495
|
+
"Warning",
|
|
1496
|
+
"fs-extra-WARN0002"
|
|
1497
|
+
);
|
|
1498
|
+
}
|
|
1499
|
+
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
1500
|
+
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
1501
|
+
if (opts.filter && !opts.filter(src, dest))
|
|
1502
|
+
return;
|
|
1503
|
+
const destParent = path5.dirname(dest);
|
|
1504
|
+
if (!fs5.existsSync(destParent))
|
|
1505
|
+
mkdirsSync(destParent);
|
|
1506
|
+
return getStats(destStat, src, dest, opts);
|
|
1507
|
+
}
|
|
1508
|
+
function getStats(destStat, src, dest, opts) {
|
|
1509
|
+
const statSync = opts.dereference ? fs5.statSync : fs5.lstatSync;
|
|
1510
|
+
const srcStat = statSync(src);
|
|
1511
|
+
if (srcStat.isDirectory())
|
|
1512
|
+
return onDir(srcStat, destStat, src, dest, opts);
|
|
1513
|
+
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
|
|
1514
|
+
return onFile(srcStat, destStat, src, dest, opts);
|
|
1515
|
+
else if (srcStat.isSymbolicLink())
|
|
1516
|
+
return onLink(destStat, src, dest, opts);
|
|
1517
|
+
else if (srcStat.isSocket())
|
|
1518
|
+
throw new Error(`Cannot copy a socket file: ${src}`);
|
|
1519
|
+
else if (srcStat.isFIFO())
|
|
1520
|
+
throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
|
1521
|
+
throw new Error(`Unknown file: ${src}`);
|
|
1522
|
+
}
|
|
1523
|
+
function onFile(srcStat, destStat, src, dest, opts) {
|
|
1524
|
+
if (!destStat)
|
|
1525
|
+
return copyFile(srcStat, src, dest, opts);
|
|
1526
|
+
return mayCopyFile(srcStat, src, dest, opts);
|
|
1527
|
+
}
|
|
1528
|
+
function mayCopyFile(srcStat, src, dest, opts) {
|
|
1529
|
+
if (opts.overwrite) {
|
|
1530
|
+
fs5.unlinkSync(dest);
|
|
1531
|
+
return copyFile(srcStat, src, dest, opts);
|
|
1532
|
+
} else if (opts.errorOnExist) {
|
|
1533
|
+
throw new Error(`'${dest}' already exists`);
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
function copyFile(srcStat, src, dest, opts) {
|
|
1537
|
+
fs5.copyFileSync(src, dest);
|
|
1538
|
+
if (opts.preserveTimestamps)
|
|
1539
|
+
handleTimestamps(srcStat.mode, src, dest);
|
|
1540
|
+
return setDestMode(dest, srcStat.mode);
|
|
1541
|
+
}
|
|
1542
|
+
function handleTimestamps(srcMode, src, dest) {
|
|
1543
|
+
if (fileIsNotWritable(srcMode))
|
|
1544
|
+
makeFileWritable(dest, srcMode);
|
|
1545
|
+
return setDestTimestamps(src, dest);
|
|
1546
|
+
}
|
|
1547
|
+
function fileIsNotWritable(srcMode) {
|
|
1548
|
+
return (srcMode & 128) === 0;
|
|
1549
|
+
}
|
|
1550
|
+
function makeFileWritable(dest, srcMode) {
|
|
1551
|
+
return setDestMode(dest, srcMode | 128);
|
|
1552
|
+
}
|
|
1553
|
+
function setDestMode(dest, srcMode) {
|
|
1554
|
+
return fs5.chmodSync(dest, srcMode);
|
|
1555
|
+
}
|
|
1556
|
+
function setDestTimestamps(src, dest) {
|
|
1557
|
+
const updatedSrcStat = fs5.statSync(src);
|
|
1558
|
+
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1559
|
+
}
|
|
1560
|
+
function onDir(srcStat, destStat, src, dest, opts) {
|
|
1561
|
+
if (!destStat)
|
|
1562
|
+
return mkDirAndCopy(srcStat.mode, src, dest, opts);
|
|
1563
|
+
return copyDir(src, dest, opts);
|
|
1564
|
+
}
|
|
1565
|
+
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
1566
|
+
fs5.mkdirSync(dest);
|
|
1567
|
+
copyDir(src, dest, opts);
|
|
1568
|
+
return setDestMode(dest, srcMode);
|
|
1569
|
+
}
|
|
1570
|
+
function copyDir(src, dest, opts) {
|
|
1571
|
+
fs5.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
|
|
1572
|
+
}
|
|
1573
|
+
function copyDirItem(item, src, dest, opts) {
|
|
1574
|
+
const srcItem = path5.join(src, item);
|
|
1575
|
+
const destItem = path5.join(dest, item);
|
|
1576
|
+
if (opts.filter && !opts.filter(srcItem, destItem))
|
|
1577
|
+
return;
|
|
1578
|
+
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
1579
|
+
return getStats(destStat, srcItem, destItem, opts);
|
|
1580
|
+
}
|
|
1581
|
+
function onLink(destStat, src, dest, opts) {
|
|
1582
|
+
let resolvedSrc = fs5.readlinkSync(src);
|
|
1583
|
+
if (opts.dereference) {
|
|
1584
|
+
resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
|
|
1585
|
+
}
|
|
1586
|
+
if (!destStat) {
|
|
1587
|
+
return fs5.symlinkSync(resolvedSrc, dest);
|
|
1588
|
+
} else {
|
|
1589
|
+
let resolvedDest;
|
|
1590
|
+
try {
|
|
1591
|
+
resolvedDest = fs5.readlinkSync(dest);
|
|
1592
|
+
} catch (err) {
|
|
1593
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN")
|
|
1594
|
+
return fs5.symlinkSync(resolvedSrc, dest);
|
|
1595
|
+
throw err;
|
|
1596
|
+
}
|
|
1597
|
+
if (opts.dereference) {
|
|
1598
|
+
resolvedDest = path5.resolve(process.cwd(), resolvedDest);
|
|
1599
|
+
}
|
|
1600
|
+
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1601
|
+
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
1602
|
+
}
|
|
1603
|
+
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
1604
|
+
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
1605
|
+
}
|
|
1606
|
+
return copyLink(resolvedSrc, dest);
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
function copyLink(resolvedSrc, dest) {
|
|
1610
|
+
fs5.unlinkSync(dest);
|
|
1611
|
+
return fs5.symlinkSync(resolvedSrc, dest);
|
|
1612
|
+
}
|
|
1613
|
+
module.exports = copySync;
|
|
1614
|
+
}
|
|
1615
|
+
});
|
|
1616
|
+
|
|
1617
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js
|
|
1618
|
+
var require_copy2 = __commonJS({
|
|
1619
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js"(exports, module) {
|
|
1620
|
+
init_cjs_shims();
|
|
1621
|
+
var u = require_universalify().fromPromise;
|
|
1622
|
+
module.exports = {
|
|
1623
|
+
copy: u(require_copy()),
|
|
1624
|
+
copySync: require_copy_sync()
|
|
1625
|
+
};
|
|
1626
|
+
}
|
|
1627
|
+
});
|
|
1628
|
+
|
|
1629
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js
|
|
1630
|
+
var require_remove = __commonJS({
|
|
1631
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js"(exports, module) {
|
|
1632
|
+
init_cjs_shims();
|
|
1633
|
+
var fs5 = require_graceful_fs();
|
|
1634
|
+
var u = require_universalify().fromCallback;
|
|
1635
|
+
function remove2(path5, callback) {
|
|
1636
|
+
fs5.rm(path5, { recursive: true, force: true }, callback);
|
|
1637
|
+
}
|
|
1638
|
+
function removeSync(path5) {
|
|
1639
|
+
fs5.rmSync(path5, { recursive: true, force: true });
|
|
1640
|
+
}
|
|
1641
|
+
module.exports = {
|
|
1642
|
+
remove: u(remove2),
|
|
1643
|
+
removeSync
|
|
1644
|
+
};
|
|
1645
|
+
}
|
|
1646
|
+
});
|
|
1647
|
+
|
|
1648
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js
|
|
1649
|
+
var require_empty = __commonJS({
|
|
1650
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js"(exports, module) {
|
|
1651
|
+
init_cjs_shims();
|
|
1652
|
+
var u = require_universalify().fromPromise;
|
|
1653
|
+
var fs5 = require_fs();
|
|
1654
|
+
var path5 = __require("path");
|
|
1655
|
+
var mkdir = require_mkdirs();
|
|
1656
|
+
var remove2 = require_remove();
|
|
1657
|
+
var emptyDir = u(async function emptyDir2(dir) {
|
|
1658
|
+
let items;
|
|
1659
|
+
try {
|
|
1660
|
+
items = await fs5.readdir(dir);
|
|
1661
|
+
} catch {
|
|
1662
|
+
return mkdir.mkdirs(dir);
|
|
1663
|
+
}
|
|
1664
|
+
return Promise.all(items.map((item) => remove2.remove(path5.join(dir, item))));
|
|
1665
|
+
});
|
|
1666
|
+
function emptyDirSync(dir) {
|
|
1667
|
+
let items;
|
|
1668
|
+
try {
|
|
1669
|
+
items = fs5.readdirSync(dir);
|
|
1670
|
+
} catch {
|
|
1671
|
+
return mkdir.mkdirsSync(dir);
|
|
1672
|
+
}
|
|
1673
|
+
items.forEach((item) => {
|
|
1674
|
+
item = path5.join(dir, item);
|
|
1675
|
+
remove2.removeSync(item);
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
module.exports = {
|
|
1679
|
+
emptyDirSync,
|
|
1680
|
+
emptydirSync: emptyDirSync,
|
|
1681
|
+
emptyDir,
|
|
1682
|
+
emptydir: emptyDir
|
|
1683
|
+
};
|
|
1684
|
+
}
|
|
1685
|
+
});
|
|
1686
|
+
|
|
1687
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js
|
|
1688
|
+
var require_file = __commonJS({
|
|
1689
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js"(exports, module) {
|
|
1690
|
+
init_cjs_shims();
|
|
1691
|
+
var u = require_universalify().fromPromise;
|
|
1692
|
+
var path5 = __require("path");
|
|
1693
|
+
var fs5 = require_fs();
|
|
1694
|
+
var mkdir = require_mkdirs();
|
|
1695
|
+
async function createFile(file) {
|
|
1696
|
+
let stats;
|
|
1697
|
+
try {
|
|
1698
|
+
stats = await fs5.stat(file);
|
|
1699
|
+
} catch {
|
|
1700
|
+
}
|
|
1701
|
+
if (stats && stats.isFile())
|
|
1702
|
+
return;
|
|
1703
|
+
const dir = path5.dirname(file);
|
|
1704
|
+
let dirStats = null;
|
|
1705
|
+
try {
|
|
1706
|
+
dirStats = await fs5.stat(dir);
|
|
1707
|
+
} catch (err) {
|
|
1708
|
+
if (err.code === "ENOENT") {
|
|
1709
|
+
await mkdir.mkdirs(dir);
|
|
1710
|
+
await fs5.writeFile(file, "");
|
|
1711
|
+
return;
|
|
1712
|
+
} else {
|
|
1713
|
+
throw err;
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
if (dirStats.isDirectory()) {
|
|
1717
|
+
await fs5.writeFile(file, "");
|
|
1718
|
+
} else {
|
|
1719
|
+
await fs5.readdir(dir);
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
function createFileSync(file) {
|
|
1723
|
+
let stats;
|
|
1724
|
+
try {
|
|
1725
|
+
stats = fs5.statSync(file);
|
|
1726
|
+
} catch {
|
|
1727
|
+
}
|
|
1728
|
+
if (stats && stats.isFile())
|
|
1729
|
+
return;
|
|
1730
|
+
const dir = path5.dirname(file);
|
|
1731
|
+
try {
|
|
1732
|
+
if (!fs5.statSync(dir).isDirectory()) {
|
|
1733
|
+
fs5.readdirSync(dir);
|
|
1734
|
+
}
|
|
1735
|
+
} catch (err) {
|
|
1736
|
+
if (err && err.code === "ENOENT")
|
|
1737
|
+
mkdir.mkdirsSync(dir);
|
|
1738
|
+
else
|
|
1739
|
+
throw err;
|
|
1740
|
+
}
|
|
1741
|
+
fs5.writeFileSync(file, "");
|
|
1742
|
+
}
|
|
1743
|
+
module.exports = {
|
|
1744
|
+
createFile: u(createFile),
|
|
1745
|
+
createFileSync
|
|
1746
|
+
};
|
|
1747
|
+
}
|
|
1748
|
+
});
|
|
1749
|
+
|
|
1750
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js
|
|
1751
|
+
var require_link = __commonJS({
|
|
1752
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js"(exports, module) {
|
|
1753
|
+
init_cjs_shims();
|
|
1754
|
+
var u = require_universalify().fromPromise;
|
|
1755
|
+
var path5 = __require("path");
|
|
1756
|
+
var fs5 = require_fs();
|
|
1757
|
+
var mkdir = require_mkdirs();
|
|
1758
|
+
var { pathExists: pathExists2 } = require_path_exists();
|
|
1759
|
+
var { areIdentical } = require_stat();
|
|
1760
|
+
async function createLink(srcpath, dstpath) {
|
|
1761
|
+
let dstStat;
|
|
1762
|
+
try {
|
|
1763
|
+
dstStat = await fs5.lstat(dstpath);
|
|
1764
|
+
} catch {
|
|
1765
|
+
}
|
|
1766
|
+
let srcStat;
|
|
1767
|
+
try {
|
|
1768
|
+
srcStat = await fs5.lstat(srcpath);
|
|
1769
|
+
} catch (err) {
|
|
1770
|
+
err.message = err.message.replace("lstat", "ensureLink");
|
|
1771
|
+
throw err;
|
|
1772
|
+
}
|
|
1773
|
+
if (dstStat && areIdentical(srcStat, dstStat))
|
|
1774
|
+
return;
|
|
1775
|
+
const dir = path5.dirname(dstpath);
|
|
1776
|
+
const dirExists = await pathExists2(dir);
|
|
1777
|
+
if (!dirExists) {
|
|
1778
|
+
await mkdir.mkdirs(dir);
|
|
1779
|
+
}
|
|
1780
|
+
await fs5.link(srcpath, dstpath);
|
|
1781
|
+
}
|
|
1782
|
+
function createLinkSync(srcpath, dstpath) {
|
|
1783
|
+
let dstStat;
|
|
1784
|
+
try {
|
|
1785
|
+
dstStat = fs5.lstatSync(dstpath);
|
|
1786
|
+
} catch {
|
|
1787
|
+
}
|
|
1788
|
+
try {
|
|
1789
|
+
const srcStat = fs5.lstatSync(srcpath);
|
|
1790
|
+
if (dstStat && areIdentical(srcStat, dstStat))
|
|
1791
|
+
return;
|
|
1792
|
+
} catch (err) {
|
|
1793
|
+
err.message = err.message.replace("lstat", "ensureLink");
|
|
1794
|
+
throw err;
|
|
1795
|
+
}
|
|
1796
|
+
const dir = path5.dirname(dstpath);
|
|
1797
|
+
const dirExists = fs5.existsSync(dir);
|
|
1798
|
+
if (dirExists)
|
|
1799
|
+
return fs5.linkSync(srcpath, dstpath);
|
|
1800
|
+
mkdir.mkdirsSync(dir);
|
|
1801
|
+
return fs5.linkSync(srcpath, dstpath);
|
|
1802
|
+
}
|
|
1803
|
+
module.exports = {
|
|
1804
|
+
createLink: u(createLink),
|
|
1805
|
+
createLinkSync
|
|
1806
|
+
};
|
|
1807
|
+
}
|
|
1808
|
+
});
|
|
1809
|
+
|
|
1810
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js
|
|
1811
|
+
var require_symlink_paths = __commonJS({
|
|
1812
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module) {
|
|
1813
|
+
init_cjs_shims();
|
|
1814
|
+
var path5 = __require("path");
|
|
1815
|
+
var fs5 = require_fs();
|
|
1816
|
+
var { pathExists: pathExists2 } = require_path_exists();
|
|
1817
|
+
var u = require_universalify().fromPromise;
|
|
1818
|
+
async function symlinkPaths(srcpath, dstpath) {
|
|
1819
|
+
if (path5.isAbsolute(srcpath)) {
|
|
1820
|
+
try {
|
|
1821
|
+
await fs5.lstat(srcpath);
|
|
1822
|
+
} catch (err) {
|
|
1823
|
+
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
1824
|
+
throw err;
|
|
1825
|
+
}
|
|
1826
|
+
return {
|
|
1827
|
+
toCwd: srcpath,
|
|
1828
|
+
toDst: srcpath
|
|
1829
|
+
};
|
|
1830
|
+
}
|
|
1831
|
+
const dstdir = path5.dirname(dstpath);
|
|
1832
|
+
const relativeToDst = path5.join(dstdir, srcpath);
|
|
1833
|
+
const exists = await pathExists2(relativeToDst);
|
|
1834
|
+
if (exists) {
|
|
1835
|
+
return {
|
|
1836
|
+
toCwd: relativeToDst,
|
|
1837
|
+
toDst: srcpath
|
|
1838
|
+
};
|
|
1839
|
+
}
|
|
1840
|
+
try {
|
|
1841
|
+
await fs5.lstat(srcpath);
|
|
1842
|
+
} catch (err) {
|
|
1843
|
+
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
1844
|
+
throw err;
|
|
1845
|
+
}
|
|
1846
|
+
return {
|
|
1847
|
+
toCwd: srcpath,
|
|
1848
|
+
toDst: path5.relative(dstdir, srcpath)
|
|
1849
|
+
};
|
|
1850
|
+
}
|
|
1851
|
+
function symlinkPathsSync(srcpath, dstpath) {
|
|
1852
|
+
if (path5.isAbsolute(srcpath)) {
|
|
1853
|
+
const exists2 = fs5.existsSync(srcpath);
|
|
1854
|
+
if (!exists2)
|
|
1855
|
+
throw new Error("absolute srcpath does not exist");
|
|
1856
|
+
return {
|
|
1857
|
+
toCwd: srcpath,
|
|
1858
|
+
toDst: srcpath
|
|
1859
|
+
};
|
|
1860
|
+
}
|
|
1861
|
+
const dstdir = path5.dirname(dstpath);
|
|
1862
|
+
const relativeToDst = path5.join(dstdir, srcpath);
|
|
1863
|
+
const exists = fs5.existsSync(relativeToDst);
|
|
1864
|
+
if (exists) {
|
|
1865
|
+
return {
|
|
1866
|
+
toCwd: relativeToDst,
|
|
1867
|
+
toDst: srcpath
|
|
1868
|
+
};
|
|
1869
|
+
}
|
|
1870
|
+
const srcExists = fs5.existsSync(srcpath);
|
|
1871
|
+
if (!srcExists)
|
|
1872
|
+
throw new Error("relative srcpath does not exist");
|
|
1873
|
+
return {
|
|
1874
|
+
toCwd: srcpath,
|
|
1875
|
+
toDst: path5.relative(dstdir, srcpath)
|
|
1876
|
+
};
|
|
1877
|
+
}
|
|
1878
|
+
module.exports = {
|
|
1879
|
+
symlinkPaths: u(symlinkPaths),
|
|
1880
|
+
symlinkPathsSync
|
|
1881
|
+
};
|
|
1882
|
+
}
|
|
1883
|
+
});
|
|
1884
|
+
|
|
1885
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js
|
|
1886
|
+
var require_symlink_type = __commonJS({
|
|
1887
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module) {
|
|
1888
|
+
init_cjs_shims();
|
|
1889
|
+
var fs5 = require_fs();
|
|
1890
|
+
var u = require_universalify().fromPromise;
|
|
1891
|
+
async function symlinkType(srcpath, type) {
|
|
1892
|
+
if (type)
|
|
1893
|
+
return type;
|
|
1894
|
+
let stats;
|
|
1895
|
+
try {
|
|
1896
|
+
stats = await fs5.lstat(srcpath);
|
|
1897
|
+
} catch {
|
|
1898
|
+
return "file";
|
|
1899
|
+
}
|
|
1900
|
+
return stats && stats.isDirectory() ? "dir" : "file";
|
|
1901
|
+
}
|
|
1902
|
+
function symlinkTypeSync(srcpath, type) {
|
|
1903
|
+
if (type)
|
|
1904
|
+
return type;
|
|
1905
|
+
let stats;
|
|
1906
|
+
try {
|
|
1907
|
+
stats = fs5.lstatSync(srcpath);
|
|
1908
|
+
} catch {
|
|
1909
|
+
return "file";
|
|
1910
|
+
}
|
|
1911
|
+
return stats && stats.isDirectory() ? "dir" : "file";
|
|
1912
|
+
}
|
|
1913
|
+
module.exports = {
|
|
1914
|
+
symlinkType: u(symlinkType),
|
|
1915
|
+
symlinkTypeSync
|
|
1916
|
+
};
|
|
1917
|
+
}
|
|
1918
|
+
});
|
|
1919
|
+
|
|
1920
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js
|
|
1921
|
+
var require_symlink = __commonJS({
|
|
1922
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module) {
|
|
1923
|
+
init_cjs_shims();
|
|
1924
|
+
var u = require_universalify().fromPromise;
|
|
1925
|
+
var path5 = __require("path");
|
|
1926
|
+
var fs5 = require_fs();
|
|
1927
|
+
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
1928
|
+
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
1929
|
+
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
1930
|
+
var { pathExists: pathExists2 } = require_path_exists();
|
|
1931
|
+
var { areIdentical } = require_stat();
|
|
1932
|
+
async function createSymlink(srcpath, dstpath, type) {
|
|
1933
|
+
let stats;
|
|
1934
|
+
try {
|
|
1935
|
+
stats = await fs5.lstat(dstpath);
|
|
1936
|
+
} catch {
|
|
1937
|
+
}
|
|
1938
|
+
if (stats && stats.isSymbolicLink()) {
|
|
1939
|
+
const [srcStat, dstStat] = await Promise.all([
|
|
1940
|
+
fs5.stat(srcpath),
|
|
1941
|
+
fs5.stat(dstpath)
|
|
1942
|
+
]);
|
|
1943
|
+
if (areIdentical(srcStat, dstStat))
|
|
1944
|
+
return;
|
|
1945
|
+
}
|
|
1946
|
+
const relative2 = await symlinkPaths(srcpath, dstpath);
|
|
1947
|
+
srcpath = relative2.toDst;
|
|
1948
|
+
const toType = await symlinkType(relative2.toCwd, type);
|
|
1949
|
+
const dir = path5.dirname(dstpath);
|
|
1950
|
+
if (!await pathExists2(dir)) {
|
|
1951
|
+
await mkdirs(dir);
|
|
1952
|
+
}
|
|
1953
|
+
return fs5.symlink(srcpath, dstpath, toType);
|
|
1954
|
+
}
|
|
1955
|
+
function createSymlinkSync(srcpath, dstpath, type) {
|
|
1956
|
+
let stats;
|
|
1957
|
+
try {
|
|
1958
|
+
stats = fs5.lstatSync(dstpath);
|
|
1959
|
+
} catch {
|
|
1960
|
+
}
|
|
1961
|
+
if (stats && stats.isSymbolicLink()) {
|
|
1962
|
+
const srcStat = fs5.statSync(srcpath);
|
|
1963
|
+
const dstStat = fs5.statSync(dstpath);
|
|
1964
|
+
if (areIdentical(srcStat, dstStat))
|
|
1965
|
+
return;
|
|
1966
|
+
}
|
|
1967
|
+
const relative2 = symlinkPathsSync(srcpath, dstpath);
|
|
1968
|
+
srcpath = relative2.toDst;
|
|
1969
|
+
type = symlinkTypeSync(relative2.toCwd, type);
|
|
1970
|
+
const dir = path5.dirname(dstpath);
|
|
1971
|
+
const exists = fs5.existsSync(dir);
|
|
1972
|
+
if (exists)
|
|
1973
|
+
return fs5.symlinkSync(srcpath, dstpath, type);
|
|
1974
|
+
mkdirsSync(dir);
|
|
1975
|
+
return fs5.symlinkSync(srcpath, dstpath, type);
|
|
1976
|
+
}
|
|
1977
|
+
module.exports = {
|
|
1978
|
+
createSymlink: u(createSymlink),
|
|
1979
|
+
createSymlinkSync
|
|
1980
|
+
};
|
|
1981
|
+
}
|
|
1982
|
+
});
|
|
1983
|
+
|
|
1984
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js
|
|
1985
|
+
var require_ensure = __commonJS({
|
|
1986
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js"(exports, module) {
|
|
1987
|
+
init_cjs_shims();
|
|
1988
|
+
var { createFile, createFileSync } = require_file();
|
|
1989
|
+
var { createLink, createLinkSync } = require_link();
|
|
1990
|
+
var { createSymlink, createSymlinkSync } = require_symlink();
|
|
1991
|
+
module.exports = {
|
|
1992
|
+
// file
|
|
1993
|
+
createFile,
|
|
1994
|
+
createFileSync,
|
|
1995
|
+
ensureFile: createFile,
|
|
1996
|
+
ensureFileSync: createFileSync,
|
|
1997
|
+
// link
|
|
1998
|
+
createLink,
|
|
1999
|
+
createLinkSync,
|
|
2000
|
+
ensureLink: createLink,
|
|
2001
|
+
ensureLinkSync: createLinkSync,
|
|
2002
|
+
// symlink
|
|
2003
|
+
createSymlink,
|
|
2004
|
+
createSymlinkSync,
|
|
2005
|
+
ensureSymlink: createSymlink,
|
|
2006
|
+
ensureSymlinkSync: createSymlinkSync
|
|
2007
|
+
};
|
|
2008
|
+
}
|
|
2009
|
+
});
|
|
2010
|
+
|
|
2011
|
+
// ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js
|
|
2012
|
+
var require_utils2 = __commonJS({
|
|
2013
|
+
"../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports, module) {
|
|
2014
|
+
init_cjs_shims();
|
|
2015
|
+
function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
|
|
2016
|
+
const EOF = finalEOL ? EOL : "";
|
|
2017
|
+
const str = JSON.stringify(obj, replacer, spaces);
|
|
2018
|
+
return str.replace(/\n/g, EOL) + EOF;
|
|
2019
|
+
}
|
|
2020
|
+
function stripBom(content) {
|
|
2021
|
+
if (Buffer.isBuffer(content))
|
|
2022
|
+
content = content.toString("utf8");
|
|
2023
|
+
return content.replace(/^\uFEFF/, "");
|
|
2024
|
+
}
|
|
2025
|
+
module.exports = { stringify, stripBom };
|
|
2026
|
+
}
|
|
2027
|
+
});
|
|
2028
|
+
|
|
2029
|
+
// ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js
|
|
2030
|
+
var require_jsonfile = __commonJS({
|
|
2031
|
+
"../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js"(exports, module) {
|
|
2032
|
+
init_cjs_shims();
|
|
2033
|
+
var _fs;
|
|
2034
|
+
try {
|
|
2035
|
+
_fs = require_graceful_fs();
|
|
2036
|
+
} catch (_) {
|
|
2037
|
+
_fs = __require("fs");
|
|
2038
|
+
}
|
|
2039
|
+
var universalify = require_universalify();
|
|
2040
|
+
var { stringify, stripBom } = require_utils2();
|
|
2041
|
+
async function _readFile(file, options = {}) {
|
|
2042
|
+
if (typeof options === "string") {
|
|
2043
|
+
options = { encoding: options };
|
|
2044
|
+
}
|
|
2045
|
+
const fs5 = options.fs || _fs;
|
|
2046
|
+
const shouldThrow = "throws" in options ? options.throws : true;
|
|
2047
|
+
let data = await universalify.fromCallback(fs5.readFile)(file, options);
|
|
2048
|
+
data = stripBom(data);
|
|
2049
|
+
let obj;
|
|
2050
|
+
try {
|
|
2051
|
+
obj = JSON.parse(data, options ? options.reviver : null);
|
|
2052
|
+
} catch (err) {
|
|
2053
|
+
if (shouldThrow) {
|
|
2054
|
+
err.message = `${file}: ${err.message}`;
|
|
2055
|
+
throw err;
|
|
2056
|
+
} else {
|
|
2057
|
+
return null;
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
return obj;
|
|
2061
|
+
}
|
|
2062
|
+
var readFile = universalify.fromPromise(_readFile);
|
|
2063
|
+
function readFileSync(file, options = {}) {
|
|
2064
|
+
if (typeof options === "string") {
|
|
2065
|
+
options = { encoding: options };
|
|
2066
|
+
}
|
|
2067
|
+
const fs5 = options.fs || _fs;
|
|
2068
|
+
const shouldThrow = "throws" in options ? options.throws : true;
|
|
2069
|
+
try {
|
|
2070
|
+
let content = fs5.readFileSync(file, options);
|
|
2071
|
+
content = stripBom(content);
|
|
2072
|
+
return JSON.parse(content, options.reviver);
|
|
2073
|
+
} catch (err) {
|
|
2074
|
+
if (shouldThrow) {
|
|
2075
|
+
err.message = `${file}: ${err.message}`;
|
|
2076
|
+
throw err;
|
|
2077
|
+
} else {
|
|
2078
|
+
return null;
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
async function _writeFile(file, obj, options = {}) {
|
|
2083
|
+
const fs5 = options.fs || _fs;
|
|
2084
|
+
const str = stringify(obj, options);
|
|
2085
|
+
await universalify.fromCallback(fs5.writeFile)(file, str, options);
|
|
2086
|
+
}
|
|
2087
|
+
var writeFile = universalify.fromPromise(_writeFile);
|
|
2088
|
+
function writeFileSync(file, obj, options = {}) {
|
|
2089
|
+
const fs5 = options.fs || _fs;
|
|
2090
|
+
const str = stringify(obj, options);
|
|
2091
|
+
return fs5.writeFileSync(file, str, options);
|
|
2092
|
+
}
|
|
2093
|
+
var jsonfile = {
|
|
2094
|
+
readFile,
|
|
2095
|
+
readFileSync,
|
|
2096
|
+
writeFile,
|
|
2097
|
+
writeFileSync
|
|
2098
|
+
};
|
|
2099
|
+
module.exports = jsonfile;
|
|
2100
|
+
}
|
|
2101
|
+
});
|
|
2102
|
+
|
|
2103
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js
|
|
2104
|
+
var require_jsonfile2 = __commonJS({
|
|
2105
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module) {
|
|
2106
|
+
init_cjs_shims();
|
|
2107
|
+
var jsonFile = require_jsonfile();
|
|
2108
|
+
module.exports = {
|
|
2109
|
+
// jsonfile exports
|
|
2110
|
+
readJson: jsonFile.readFile,
|
|
2111
|
+
readJsonSync: jsonFile.readFileSync,
|
|
2112
|
+
writeJson: jsonFile.writeFile,
|
|
2113
|
+
writeJsonSync: jsonFile.writeFileSync
|
|
2114
|
+
};
|
|
2115
|
+
}
|
|
2116
|
+
});
|
|
2117
|
+
|
|
2118
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js
|
|
2119
|
+
var require_output_file = __commonJS({
|
|
2120
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js"(exports, module) {
|
|
2121
|
+
init_cjs_shims();
|
|
2122
|
+
var u = require_universalify().fromPromise;
|
|
2123
|
+
var fs5 = require_fs();
|
|
2124
|
+
var path5 = __require("path");
|
|
2125
|
+
var mkdir = require_mkdirs();
|
|
2126
|
+
var pathExists2 = require_path_exists().pathExists;
|
|
2127
|
+
async function outputFile(file, data, encoding = "utf-8") {
|
|
2128
|
+
const dir = path5.dirname(file);
|
|
2129
|
+
if (!await pathExists2(dir)) {
|
|
2130
|
+
await mkdir.mkdirs(dir);
|
|
2131
|
+
}
|
|
2132
|
+
return fs5.writeFile(file, data, encoding);
|
|
2133
|
+
}
|
|
2134
|
+
function outputFileSync(file, ...args) {
|
|
2135
|
+
const dir = path5.dirname(file);
|
|
2136
|
+
if (!fs5.existsSync(dir)) {
|
|
2137
|
+
mkdir.mkdirsSync(dir);
|
|
2138
|
+
}
|
|
2139
|
+
fs5.writeFileSync(file, ...args);
|
|
2140
|
+
}
|
|
2141
|
+
module.exports = {
|
|
2142
|
+
outputFile: u(outputFile),
|
|
2143
|
+
outputFileSync
|
|
2144
|
+
};
|
|
2145
|
+
}
|
|
2146
|
+
});
|
|
2147
|
+
|
|
2148
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js
|
|
2149
|
+
var require_output_json = __commonJS({
|
|
2150
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js"(exports, module) {
|
|
2151
|
+
init_cjs_shims();
|
|
2152
|
+
var { stringify } = require_utils2();
|
|
2153
|
+
var { outputFile } = require_output_file();
|
|
2154
|
+
async function outputJson(file, data, options = {}) {
|
|
2155
|
+
const str = stringify(data, options);
|
|
2156
|
+
await outputFile(file, str, options);
|
|
2157
|
+
}
|
|
2158
|
+
module.exports = outputJson;
|
|
2159
|
+
}
|
|
2160
|
+
});
|
|
2161
|
+
|
|
2162
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js
|
|
2163
|
+
var require_output_json_sync = __commonJS({
|
|
2164
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module) {
|
|
2165
|
+
init_cjs_shims();
|
|
2166
|
+
var { stringify } = require_utils2();
|
|
2167
|
+
var { outputFileSync } = require_output_file();
|
|
2168
|
+
function outputJsonSync(file, data, options) {
|
|
2169
|
+
const str = stringify(data, options);
|
|
2170
|
+
outputFileSync(file, str, options);
|
|
2171
|
+
}
|
|
2172
|
+
module.exports = outputJsonSync;
|
|
2173
|
+
}
|
|
2174
|
+
});
|
|
2175
|
+
|
|
2176
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js
|
|
2177
|
+
var require_json = __commonJS({
|
|
2178
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js"(exports, module) {
|
|
2179
|
+
init_cjs_shims();
|
|
2180
|
+
var u = require_universalify().fromPromise;
|
|
2181
|
+
var jsonFile = require_jsonfile2();
|
|
2182
|
+
jsonFile.outputJson = u(require_output_json());
|
|
2183
|
+
jsonFile.outputJsonSync = require_output_json_sync();
|
|
2184
|
+
jsonFile.outputJSON = jsonFile.outputJson;
|
|
2185
|
+
jsonFile.outputJSONSync = jsonFile.outputJsonSync;
|
|
2186
|
+
jsonFile.writeJSON = jsonFile.writeJson;
|
|
2187
|
+
jsonFile.writeJSONSync = jsonFile.writeJsonSync;
|
|
2188
|
+
jsonFile.readJSON = jsonFile.readJson;
|
|
2189
|
+
jsonFile.readJSONSync = jsonFile.readJsonSync;
|
|
2190
|
+
module.exports = jsonFile;
|
|
2191
|
+
}
|
|
2192
|
+
});
|
|
2193
|
+
|
|
2194
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js
|
|
2195
|
+
var require_move = __commonJS({
|
|
2196
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js"(exports, module) {
|
|
2197
|
+
init_cjs_shims();
|
|
2198
|
+
var fs5 = require_fs();
|
|
2199
|
+
var path5 = __require("path");
|
|
2200
|
+
var { copy } = require_copy2();
|
|
2201
|
+
var { remove: remove2 } = require_remove();
|
|
2202
|
+
var { mkdirp } = require_mkdirs();
|
|
2203
|
+
var { pathExists: pathExists2 } = require_path_exists();
|
|
2204
|
+
var stat = require_stat();
|
|
2205
|
+
async function move(src, dest, opts = {}) {
|
|
2206
|
+
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2207
|
+
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
|
2208
|
+
await stat.checkParentPaths(src, srcStat, dest, "move");
|
|
2209
|
+
const destParent = path5.dirname(dest);
|
|
2210
|
+
const parsedParentPath = path5.parse(destParent);
|
|
2211
|
+
if (parsedParentPath.root !== destParent) {
|
|
2212
|
+
await mkdirp(destParent);
|
|
2213
|
+
}
|
|
2214
|
+
return doRename(src, dest, overwrite, isChangingCase);
|
|
2215
|
+
}
|
|
2216
|
+
async function doRename(src, dest, overwrite, isChangingCase) {
|
|
2217
|
+
if (!isChangingCase) {
|
|
2218
|
+
if (overwrite) {
|
|
2219
|
+
await remove2(dest);
|
|
2220
|
+
} else if (await pathExists2(dest)) {
|
|
2221
|
+
throw new Error("dest already exists.");
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
try {
|
|
2225
|
+
await fs5.rename(src, dest);
|
|
2226
|
+
} catch (err) {
|
|
2227
|
+
if (err.code !== "EXDEV") {
|
|
2228
|
+
throw err;
|
|
2229
|
+
}
|
|
2230
|
+
await moveAcrossDevice(src, dest, overwrite);
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
async function moveAcrossDevice(src, dest, overwrite) {
|
|
2234
|
+
const opts = {
|
|
2235
|
+
overwrite,
|
|
2236
|
+
errorOnExist: true,
|
|
2237
|
+
preserveTimestamps: true
|
|
2238
|
+
};
|
|
2239
|
+
await copy(src, dest, opts);
|
|
2240
|
+
return remove2(src);
|
|
2241
|
+
}
|
|
2242
|
+
module.exports = move;
|
|
285
2243
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
2244
|
+
});
|
|
2245
|
+
|
|
2246
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js
|
|
2247
|
+
var require_move_sync = __commonJS({
|
|
2248
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js"(exports, module) {
|
|
2249
|
+
init_cjs_shims();
|
|
2250
|
+
var fs5 = require_graceful_fs();
|
|
2251
|
+
var path5 = __require("path");
|
|
2252
|
+
var copySync = require_copy2().copySync;
|
|
2253
|
+
var removeSync = require_remove().removeSync;
|
|
2254
|
+
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
2255
|
+
var stat = require_stat();
|
|
2256
|
+
function moveSync(src, dest, opts) {
|
|
2257
|
+
opts = opts || {};
|
|
2258
|
+
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2259
|
+
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
2260
|
+
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
2261
|
+
if (!isParentRoot(dest))
|
|
2262
|
+
mkdirpSync(path5.dirname(dest));
|
|
2263
|
+
return doRename(src, dest, overwrite, isChangingCase);
|
|
2264
|
+
}
|
|
2265
|
+
function isParentRoot(dest) {
|
|
2266
|
+
const parent = path5.dirname(dest);
|
|
2267
|
+
const parsedPath = path5.parse(parent);
|
|
2268
|
+
return parsedPath.root === parent;
|
|
2269
|
+
}
|
|
2270
|
+
function doRename(src, dest, overwrite, isChangingCase) {
|
|
2271
|
+
if (isChangingCase)
|
|
2272
|
+
return rename(src, dest, overwrite);
|
|
2273
|
+
if (overwrite) {
|
|
2274
|
+
removeSync(dest);
|
|
2275
|
+
return rename(src, dest, overwrite);
|
|
2276
|
+
}
|
|
2277
|
+
if (fs5.existsSync(dest))
|
|
2278
|
+
throw new Error("dest already exists.");
|
|
2279
|
+
return rename(src, dest, overwrite);
|
|
2280
|
+
}
|
|
2281
|
+
function rename(src, dest, overwrite) {
|
|
2282
|
+
try {
|
|
2283
|
+
fs5.renameSync(src, dest);
|
|
2284
|
+
} catch (err) {
|
|
2285
|
+
if (err.code !== "EXDEV")
|
|
2286
|
+
throw err;
|
|
2287
|
+
return moveAcrossDevice(src, dest, overwrite);
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
function moveAcrossDevice(src, dest, overwrite) {
|
|
2291
|
+
const opts = {
|
|
2292
|
+
overwrite,
|
|
2293
|
+
errorOnExist: true,
|
|
2294
|
+
preserveTimestamps: true
|
|
2295
|
+
};
|
|
2296
|
+
copySync(src, dest, opts);
|
|
2297
|
+
return removeSync(src);
|
|
2298
|
+
}
|
|
2299
|
+
module.exports = moveSync;
|
|
292
2300
|
}
|
|
293
|
-
};
|
|
2301
|
+
});
|
|
294
2302
|
|
|
295
|
-
//
|
|
296
|
-
|
|
297
|
-
|
|
2303
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js
|
|
2304
|
+
var require_move2 = __commonJS({
|
|
2305
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js"(exports, module) {
|
|
2306
|
+
init_cjs_shims();
|
|
2307
|
+
var u = require_universalify().fromPromise;
|
|
2308
|
+
module.exports = {
|
|
2309
|
+
move: u(require_move()),
|
|
2310
|
+
moveSync: require_move_sync()
|
|
2311
|
+
};
|
|
2312
|
+
}
|
|
2313
|
+
});
|
|
2314
|
+
|
|
2315
|
+
// ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js
|
|
2316
|
+
var require_lib = __commonJS({
|
|
2317
|
+
"../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js"(exports, module) {
|
|
2318
|
+
init_cjs_shims();
|
|
2319
|
+
module.exports = {
|
|
2320
|
+
// Export promiseified graceful-fs:
|
|
2321
|
+
...require_fs(),
|
|
2322
|
+
// Export extra methods:
|
|
2323
|
+
...require_copy2(),
|
|
2324
|
+
...require_empty(),
|
|
2325
|
+
...require_ensure(),
|
|
2326
|
+
...require_json(),
|
|
2327
|
+
...require_mkdirs(),
|
|
2328
|
+
...require_move2(),
|
|
2329
|
+
...require_output_file(),
|
|
2330
|
+
...require_path_exists(),
|
|
2331
|
+
...require_remove()
|
|
2332
|
+
};
|
|
2333
|
+
}
|
|
2334
|
+
});
|
|
2335
|
+
|
|
2336
|
+
// ../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js
|
|
2337
|
+
var require_lodash = __commonJS({
|
|
2338
|
+
"../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js"(exports, module) {
|
|
2339
|
+
init_cjs_shims();
|
|
2340
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
2341
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
2342
|
+
var COMPARE_PARTIAL_FLAG = 1;
|
|
2343
|
+
var COMPARE_UNORDERED_FLAG = 2;
|
|
2344
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
2345
|
+
var argsTag = "[object Arguments]";
|
|
2346
|
+
var arrayTag = "[object Array]";
|
|
2347
|
+
var asyncTag = "[object AsyncFunction]";
|
|
2348
|
+
var boolTag = "[object Boolean]";
|
|
2349
|
+
var dateTag = "[object Date]";
|
|
2350
|
+
var errorTag = "[object Error]";
|
|
2351
|
+
var funcTag = "[object Function]";
|
|
2352
|
+
var genTag = "[object GeneratorFunction]";
|
|
2353
|
+
var mapTag = "[object Map]";
|
|
2354
|
+
var numberTag = "[object Number]";
|
|
2355
|
+
var nullTag = "[object Null]";
|
|
2356
|
+
var objectTag = "[object Object]";
|
|
2357
|
+
var promiseTag = "[object Promise]";
|
|
2358
|
+
var proxyTag = "[object Proxy]";
|
|
2359
|
+
var regexpTag = "[object RegExp]";
|
|
2360
|
+
var setTag = "[object Set]";
|
|
2361
|
+
var stringTag = "[object String]";
|
|
2362
|
+
var symbolTag = "[object Symbol]";
|
|
2363
|
+
var undefinedTag = "[object Undefined]";
|
|
2364
|
+
var weakMapTag = "[object WeakMap]";
|
|
2365
|
+
var arrayBufferTag = "[object ArrayBuffer]";
|
|
2366
|
+
var dataViewTag = "[object DataView]";
|
|
2367
|
+
var float32Tag = "[object Float32Array]";
|
|
2368
|
+
var float64Tag = "[object Float64Array]";
|
|
2369
|
+
var int8Tag = "[object Int8Array]";
|
|
2370
|
+
var int16Tag = "[object Int16Array]";
|
|
2371
|
+
var int32Tag = "[object Int32Array]";
|
|
2372
|
+
var uint8Tag = "[object Uint8Array]";
|
|
2373
|
+
var uint8ClampedTag = "[object Uint8ClampedArray]";
|
|
2374
|
+
var uint16Tag = "[object Uint16Array]";
|
|
2375
|
+
var uint32Tag = "[object Uint32Array]";
|
|
2376
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
2377
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
2378
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
2379
|
+
var typedArrayTags = {};
|
|
2380
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
2381
|
+
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
|
2382
|
+
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
2383
|
+
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
2384
|
+
var root = freeGlobal || freeSelf || Function("return this")();
|
|
2385
|
+
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
2386
|
+
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
2387
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2388
|
+
var freeProcess = moduleExports && freeGlobal.process;
|
|
2389
|
+
var nodeUtil = function() {
|
|
2390
|
+
try {
|
|
2391
|
+
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
2392
|
+
} catch (e) {
|
|
2393
|
+
}
|
|
2394
|
+
}();
|
|
2395
|
+
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
2396
|
+
function arrayFilter(array, predicate) {
|
|
2397
|
+
var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
|
|
2398
|
+
while (++index < length) {
|
|
2399
|
+
var value = array[index];
|
|
2400
|
+
if (predicate(value, index, array)) {
|
|
2401
|
+
result[resIndex++] = value;
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
return result;
|
|
2405
|
+
}
|
|
2406
|
+
function arrayPush(array, values) {
|
|
2407
|
+
var index = -1, length = values.length, offset = array.length;
|
|
2408
|
+
while (++index < length) {
|
|
2409
|
+
array[offset + index] = values[index];
|
|
2410
|
+
}
|
|
2411
|
+
return array;
|
|
2412
|
+
}
|
|
2413
|
+
function arraySome(array, predicate) {
|
|
2414
|
+
var index = -1, length = array == null ? 0 : array.length;
|
|
2415
|
+
while (++index < length) {
|
|
2416
|
+
if (predicate(array[index], index, array)) {
|
|
2417
|
+
return true;
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
return false;
|
|
2421
|
+
}
|
|
2422
|
+
function baseTimes(n, iteratee) {
|
|
2423
|
+
var index = -1, result = Array(n);
|
|
2424
|
+
while (++index < n) {
|
|
2425
|
+
result[index] = iteratee(index);
|
|
2426
|
+
}
|
|
2427
|
+
return result;
|
|
2428
|
+
}
|
|
2429
|
+
function baseUnary(func) {
|
|
2430
|
+
return function(value) {
|
|
2431
|
+
return func(value);
|
|
2432
|
+
};
|
|
2433
|
+
}
|
|
2434
|
+
function cacheHas(cache, key) {
|
|
2435
|
+
return cache.has(key);
|
|
2436
|
+
}
|
|
2437
|
+
function getValue(object, key) {
|
|
2438
|
+
return object == null ? void 0 : object[key];
|
|
2439
|
+
}
|
|
2440
|
+
function mapToArray(map) {
|
|
2441
|
+
var index = -1, result = Array(map.size);
|
|
2442
|
+
map.forEach(function(value, key) {
|
|
2443
|
+
result[++index] = [key, value];
|
|
2444
|
+
});
|
|
2445
|
+
return result;
|
|
2446
|
+
}
|
|
2447
|
+
function overArg(func, transform) {
|
|
2448
|
+
return function(arg) {
|
|
2449
|
+
return func(transform(arg));
|
|
2450
|
+
};
|
|
2451
|
+
}
|
|
2452
|
+
function setToArray(set) {
|
|
2453
|
+
var index = -1, result = Array(set.size);
|
|
2454
|
+
set.forEach(function(value) {
|
|
2455
|
+
result[++index] = value;
|
|
2456
|
+
});
|
|
2457
|
+
return result;
|
|
2458
|
+
}
|
|
2459
|
+
var arrayProto = Array.prototype;
|
|
2460
|
+
var funcProto = Function.prototype;
|
|
2461
|
+
var objectProto = Object.prototype;
|
|
2462
|
+
var coreJsData = root["__core-js_shared__"];
|
|
2463
|
+
var funcToString = funcProto.toString;
|
|
2464
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2465
|
+
var maskSrcKey = function() {
|
|
2466
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
2467
|
+
return uid ? "Symbol(src)_1." + uid : "";
|
|
2468
|
+
}();
|
|
2469
|
+
var nativeObjectToString = objectProto.toString;
|
|
2470
|
+
var reIsNative = RegExp(
|
|
2471
|
+
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
2472
|
+
);
|
|
2473
|
+
var Buffer2 = moduleExports ? root.Buffer : void 0;
|
|
2474
|
+
var Symbol2 = root.Symbol;
|
|
2475
|
+
var Uint8Array2 = root.Uint8Array;
|
|
2476
|
+
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
2477
|
+
var splice = arrayProto.splice;
|
|
2478
|
+
var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
2479
|
+
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
2480
|
+
var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
|
|
2481
|
+
var nativeKeys = overArg(Object.keys, Object);
|
|
2482
|
+
var DataView = getNative(root, "DataView");
|
|
2483
|
+
var Map2 = getNative(root, "Map");
|
|
2484
|
+
var Promise2 = getNative(root, "Promise");
|
|
2485
|
+
var Set2 = getNative(root, "Set");
|
|
2486
|
+
var WeakMap2 = getNative(root, "WeakMap");
|
|
2487
|
+
var nativeCreate = getNative(Object, "create");
|
|
2488
|
+
var dataViewCtorString = toSource(DataView);
|
|
2489
|
+
var mapCtorString = toSource(Map2);
|
|
2490
|
+
var promiseCtorString = toSource(Promise2);
|
|
2491
|
+
var setCtorString = toSource(Set2);
|
|
2492
|
+
var weakMapCtorString = toSource(WeakMap2);
|
|
2493
|
+
var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
|
|
2494
|
+
var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
2495
|
+
function Hash(entries) {
|
|
2496
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
2497
|
+
this.clear();
|
|
2498
|
+
while (++index < length) {
|
|
2499
|
+
var entry = entries[index];
|
|
2500
|
+
this.set(entry[0], entry[1]);
|
|
2501
|
+
}
|
|
2502
|
+
}
|
|
2503
|
+
function hashClear() {
|
|
2504
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
2505
|
+
this.size = 0;
|
|
2506
|
+
}
|
|
2507
|
+
function hashDelete(key) {
|
|
2508
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
2509
|
+
this.size -= result ? 1 : 0;
|
|
2510
|
+
return result;
|
|
2511
|
+
}
|
|
2512
|
+
function hashGet(key) {
|
|
2513
|
+
var data = this.__data__;
|
|
2514
|
+
if (nativeCreate) {
|
|
2515
|
+
var result = data[key];
|
|
2516
|
+
return result === HASH_UNDEFINED ? void 0 : result;
|
|
2517
|
+
}
|
|
2518
|
+
return hasOwnProperty.call(data, key) ? data[key] : void 0;
|
|
2519
|
+
}
|
|
2520
|
+
function hashHas(key) {
|
|
2521
|
+
var data = this.__data__;
|
|
2522
|
+
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
2523
|
+
}
|
|
2524
|
+
function hashSet(key, value) {
|
|
2525
|
+
var data = this.__data__;
|
|
2526
|
+
this.size += this.has(key) ? 0 : 1;
|
|
2527
|
+
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
|
|
2528
|
+
return this;
|
|
2529
|
+
}
|
|
2530
|
+
Hash.prototype.clear = hashClear;
|
|
2531
|
+
Hash.prototype["delete"] = hashDelete;
|
|
2532
|
+
Hash.prototype.get = hashGet;
|
|
2533
|
+
Hash.prototype.has = hashHas;
|
|
2534
|
+
Hash.prototype.set = hashSet;
|
|
2535
|
+
function ListCache(entries) {
|
|
2536
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
2537
|
+
this.clear();
|
|
2538
|
+
while (++index < length) {
|
|
2539
|
+
var entry = entries[index];
|
|
2540
|
+
this.set(entry[0], entry[1]);
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
function listCacheClear() {
|
|
2544
|
+
this.__data__ = [];
|
|
2545
|
+
this.size = 0;
|
|
2546
|
+
}
|
|
2547
|
+
function listCacheDelete(key) {
|
|
2548
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2549
|
+
if (index < 0) {
|
|
2550
|
+
return false;
|
|
2551
|
+
}
|
|
2552
|
+
var lastIndex = data.length - 1;
|
|
2553
|
+
if (index == lastIndex) {
|
|
2554
|
+
data.pop();
|
|
2555
|
+
} else {
|
|
2556
|
+
splice.call(data, index, 1);
|
|
2557
|
+
}
|
|
2558
|
+
--this.size;
|
|
2559
|
+
return true;
|
|
2560
|
+
}
|
|
2561
|
+
function listCacheGet(key) {
|
|
2562
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2563
|
+
return index < 0 ? void 0 : data[index][1];
|
|
2564
|
+
}
|
|
2565
|
+
function listCacheHas(key) {
|
|
2566
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
2567
|
+
}
|
|
2568
|
+
function listCacheSet(key, value) {
|
|
2569
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2570
|
+
if (index < 0) {
|
|
2571
|
+
++this.size;
|
|
2572
|
+
data.push([key, value]);
|
|
2573
|
+
} else {
|
|
2574
|
+
data[index][1] = value;
|
|
2575
|
+
}
|
|
2576
|
+
return this;
|
|
2577
|
+
}
|
|
2578
|
+
ListCache.prototype.clear = listCacheClear;
|
|
2579
|
+
ListCache.prototype["delete"] = listCacheDelete;
|
|
2580
|
+
ListCache.prototype.get = listCacheGet;
|
|
2581
|
+
ListCache.prototype.has = listCacheHas;
|
|
2582
|
+
ListCache.prototype.set = listCacheSet;
|
|
2583
|
+
function MapCache(entries) {
|
|
2584
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
2585
|
+
this.clear();
|
|
2586
|
+
while (++index < length) {
|
|
2587
|
+
var entry = entries[index];
|
|
2588
|
+
this.set(entry[0], entry[1]);
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
function mapCacheClear() {
|
|
2592
|
+
this.size = 0;
|
|
2593
|
+
this.__data__ = {
|
|
2594
|
+
"hash": new Hash(),
|
|
2595
|
+
"map": new (Map2 || ListCache)(),
|
|
2596
|
+
"string": new Hash()
|
|
2597
|
+
};
|
|
2598
|
+
}
|
|
2599
|
+
function mapCacheDelete(key) {
|
|
2600
|
+
var result = getMapData(this, key)["delete"](key);
|
|
2601
|
+
this.size -= result ? 1 : 0;
|
|
2602
|
+
return result;
|
|
2603
|
+
}
|
|
2604
|
+
function mapCacheGet(key) {
|
|
2605
|
+
return getMapData(this, key).get(key);
|
|
2606
|
+
}
|
|
2607
|
+
function mapCacheHas(key) {
|
|
2608
|
+
return getMapData(this, key).has(key);
|
|
2609
|
+
}
|
|
2610
|
+
function mapCacheSet(key, value) {
|
|
2611
|
+
var data = getMapData(this, key), size = data.size;
|
|
2612
|
+
data.set(key, value);
|
|
2613
|
+
this.size += data.size == size ? 0 : 1;
|
|
2614
|
+
return this;
|
|
2615
|
+
}
|
|
2616
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
2617
|
+
MapCache.prototype["delete"] = mapCacheDelete;
|
|
2618
|
+
MapCache.prototype.get = mapCacheGet;
|
|
2619
|
+
MapCache.prototype.has = mapCacheHas;
|
|
2620
|
+
MapCache.prototype.set = mapCacheSet;
|
|
2621
|
+
function SetCache(values) {
|
|
2622
|
+
var index = -1, length = values == null ? 0 : values.length;
|
|
2623
|
+
this.__data__ = new MapCache();
|
|
2624
|
+
while (++index < length) {
|
|
2625
|
+
this.add(values[index]);
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
function setCacheAdd(value) {
|
|
2629
|
+
this.__data__.set(value, HASH_UNDEFINED);
|
|
2630
|
+
return this;
|
|
2631
|
+
}
|
|
2632
|
+
function setCacheHas(value) {
|
|
2633
|
+
return this.__data__.has(value);
|
|
2634
|
+
}
|
|
2635
|
+
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
|
2636
|
+
SetCache.prototype.has = setCacheHas;
|
|
2637
|
+
function Stack(entries) {
|
|
2638
|
+
var data = this.__data__ = new ListCache(entries);
|
|
2639
|
+
this.size = data.size;
|
|
2640
|
+
}
|
|
2641
|
+
function stackClear() {
|
|
2642
|
+
this.__data__ = new ListCache();
|
|
2643
|
+
this.size = 0;
|
|
2644
|
+
}
|
|
2645
|
+
function stackDelete(key) {
|
|
2646
|
+
var data = this.__data__, result = data["delete"](key);
|
|
2647
|
+
this.size = data.size;
|
|
2648
|
+
return result;
|
|
2649
|
+
}
|
|
2650
|
+
function stackGet(key) {
|
|
2651
|
+
return this.__data__.get(key);
|
|
2652
|
+
}
|
|
2653
|
+
function stackHas(key) {
|
|
2654
|
+
return this.__data__.has(key);
|
|
2655
|
+
}
|
|
2656
|
+
function stackSet(key, value) {
|
|
2657
|
+
var data = this.__data__;
|
|
2658
|
+
if (data instanceof ListCache) {
|
|
2659
|
+
var pairs = data.__data__;
|
|
2660
|
+
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
2661
|
+
pairs.push([key, value]);
|
|
2662
|
+
this.size = ++data.size;
|
|
2663
|
+
return this;
|
|
2664
|
+
}
|
|
2665
|
+
data = this.__data__ = new MapCache(pairs);
|
|
2666
|
+
}
|
|
2667
|
+
data.set(key, value);
|
|
2668
|
+
this.size = data.size;
|
|
2669
|
+
return this;
|
|
2670
|
+
}
|
|
2671
|
+
Stack.prototype.clear = stackClear;
|
|
2672
|
+
Stack.prototype["delete"] = stackDelete;
|
|
2673
|
+
Stack.prototype.get = stackGet;
|
|
2674
|
+
Stack.prototype.has = stackHas;
|
|
2675
|
+
Stack.prototype.set = stackSet;
|
|
2676
|
+
function arrayLikeKeys(value, inherited) {
|
|
2677
|
+
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
2678
|
+
for (var key in value) {
|
|
2679
|
+
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
2680
|
+
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
2681
|
+
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
2682
|
+
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
2683
|
+
isIndex(key, length)))) {
|
|
2684
|
+
result.push(key);
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
return result;
|
|
2688
|
+
}
|
|
2689
|
+
function assocIndexOf(array, key) {
|
|
2690
|
+
var length = array.length;
|
|
2691
|
+
while (length--) {
|
|
2692
|
+
if (eq(array[length][0], key)) {
|
|
2693
|
+
return length;
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2696
|
+
return -1;
|
|
2697
|
+
}
|
|
2698
|
+
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
2699
|
+
var result = keysFunc(object);
|
|
2700
|
+
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
2701
|
+
}
|
|
2702
|
+
function baseGetTag(value) {
|
|
2703
|
+
if (value == null) {
|
|
2704
|
+
return value === void 0 ? undefinedTag : nullTag;
|
|
2705
|
+
}
|
|
2706
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
2707
|
+
}
|
|
2708
|
+
function baseIsArguments(value) {
|
|
2709
|
+
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
2710
|
+
}
|
|
2711
|
+
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
2712
|
+
if (value === other) {
|
|
2713
|
+
return true;
|
|
2714
|
+
}
|
|
2715
|
+
if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
|
|
2716
|
+
return value !== value && other !== other;
|
|
2717
|
+
}
|
|
2718
|
+
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
2719
|
+
}
|
|
2720
|
+
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
2721
|
+
var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
|
|
2722
|
+
objTag = objTag == argsTag ? objectTag : objTag;
|
|
2723
|
+
othTag = othTag == argsTag ? objectTag : othTag;
|
|
2724
|
+
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
2725
|
+
if (isSameTag && isBuffer(object)) {
|
|
2726
|
+
if (!isBuffer(other)) {
|
|
2727
|
+
return false;
|
|
2728
|
+
}
|
|
2729
|
+
objIsArr = true;
|
|
2730
|
+
objIsObj = false;
|
|
2731
|
+
}
|
|
2732
|
+
if (isSameTag && !objIsObj) {
|
|
2733
|
+
stack || (stack = new Stack());
|
|
2734
|
+
return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
2735
|
+
}
|
|
2736
|
+
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
2737
|
+
var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
|
|
2738
|
+
if (objIsWrapped || othIsWrapped) {
|
|
2739
|
+
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
2740
|
+
stack || (stack = new Stack());
|
|
2741
|
+
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
if (!isSameTag) {
|
|
2745
|
+
return false;
|
|
2746
|
+
}
|
|
2747
|
+
stack || (stack = new Stack());
|
|
2748
|
+
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
2749
|
+
}
|
|
2750
|
+
function baseIsNative(value) {
|
|
2751
|
+
if (!isObject(value) || isMasked(value)) {
|
|
2752
|
+
return false;
|
|
2753
|
+
}
|
|
2754
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
2755
|
+
return pattern.test(toSource(value));
|
|
2756
|
+
}
|
|
2757
|
+
function baseIsTypedArray(value) {
|
|
2758
|
+
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
2759
|
+
}
|
|
2760
|
+
function baseKeys(object) {
|
|
2761
|
+
if (!isPrototype(object)) {
|
|
2762
|
+
return nativeKeys(object);
|
|
2763
|
+
}
|
|
2764
|
+
var result = [];
|
|
2765
|
+
for (var key in Object(object)) {
|
|
2766
|
+
if (hasOwnProperty.call(object, key) && key != "constructor") {
|
|
2767
|
+
result.push(key);
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
return result;
|
|
2771
|
+
}
|
|
2772
|
+
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
2773
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
|
|
2774
|
+
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
2775
|
+
return false;
|
|
2776
|
+
}
|
|
2777
|
+
var stacked = stack.get(array);
|
|
2778
|
+
if (stacked && stack.get(other)) {
|
|
2779
|
+
return stacked == other;
|
|
2780
|
+
}
|
|
2781
|
+
var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
|
|
2782
|
+
stack.set(array, other);
|
|
2783
|
+
stack.set(other, array);
|
|
2784
|
+
while (++index < arrLength) {
|
|
2785
|
+
var arrValue = array[index], othValue = other[index];
|
|
2786
|
+
if (customizer) {
|
|
2787
|
+
var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
|
|
2788
|
+
}
|
|
2789
|
+
if (compared !== void 0) {
|
|
2790
|
+
if (compared) {
|
|
2791
|
+
continue;
|
|
2792
|
+
}
|
|
2793
|
+
result = false;
|
|
2794
|
+
break;
|
|
2795
|
+
}
|
|
2796
|
+
if (seen) {
|
|
2797
|
+
if (!arraySome(other, function(othValue2, othIndex) {
|
|
2798
|
+
if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
|
|
2799
|
+
return seen.push(othIndex);
|
|
2800
|
+
}
|
|
2801
|
+
})) {
|
|
2802
|
+
result = false;
|
|
2803
|
+
break;
|
|
2804
|
+
}
|
|
2805
|
+
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
2806
|
+
result = false;
|
|
2807
|
+
break;
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
stack["delete"](array);
|
|
2811
|
+
stack["delete"](other);
|
|
2812
|
+
return result;
|
|
2813
|
+
}
|
|
2814
|
+
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
2815
|
+
switch (tag) {
|
|
2816
|
+
case dataViewTag:
|
|
2817
|
+
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
|
|
2818
|
+
return false;
|
|
2819
|
+
}
|
|
2820
|
+
object = object.buffer;
|
|
2821
|
+
other = other.buffer;
|
|
2822
|
+
case arrayBufferTag:
|
|
2823
|
+
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
|
|
2824
|
+
return false;
|
|
2825
|
+
}
|
|
2826
|
+
return true;
|
|
2827
|
+
case boolTag:
|
|
2828
|
+
case dateTag:
|
|
2829
|
+
case numberTag:
|
|
2830
|
+
return eq(+object, +other);
|
|
2831
|
+
case errorTag:
|
|
2832
|
+
return object.name == other.name && object.message == other.message;
|
|
2833
|
+
case regexpTag:
|
|
2834
|
+
case stringTag:
|
|
2835
|
+
return object == other + "";
|
|
2836
|
+
case mapTag:
|
|
2837
|
+
var convert = mapToArray;
|
|
2838
|
+
case setTag:
|
|
2839
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
|
|
2840
|
+
convert || (convert = setToArray);
|
|
2841
|
+
if (object.size != other.size && !isPartial) {
|
|
2842
|
+
return false;
|
|
2843
|
+
}
|
|
2844
|
+
var stacked = stack.get(object);
|
|
2845
|
+
if (stacked) {
|
|
2846
|
+
return stacked == other;
|
|
2847
|
+
}
|
|
2848
|
+
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
2849
|
+
stack.set(object, other);
|
|
2850
|
+
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
2851
|
+
stack["delete"](object);
|
|
2852
|
+
return result;
|
|
2853
|
+
case symbolTag:
|
|
2854
|
+
if (symbolValueOf) {
|
|
2855
|
+
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
return false;
|
|
2859
|
+
}
|
|
2860
|
+
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
2861
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
|
|
2862
|
+
if (objLength != othLength && !isPartial) {
|
|
2863
|
+
return false;
|
|
2864
|
+
}
|
|
2865
|
+
var index = objLength;
|
|
2866
|
+
while (index--) {
|
|
2867
|
+
var key = objProps[index];
|
|
2868
|
+
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
|
|
2869
|
+
return false;
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
var stacked = stack.get(object);
|
|
2873
|
+
if (stacked && stack.get(other)) {
|
|
2874
|
+
return stacked == other;
|
|
2875
|
+
}
|
|
2876
|
+
var result = true;
|
|
2877
|
+
stack.set(object, other);
|
|
2878
|
+
stack.set(other, object);
|
|
2879
|
+
var skipCtor = isPartial;
|
|
2880
|
+
while (++index < objLength) {
|
|
2881
|
+
key = objProps[index];
|
|
2882
|
+
var objValue = object[key], othValue = other[key];
|
|
2883
|
+
if (customizer) {
|
|
2884
|
+
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
|
|
2885
|
+
}
|
|
2886
|
+
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
|
|
2887
|
+
result = false;
|
|
2888
|
+
break;
|
|
2889
|
+
}
|
|
2890
|
+
skipCtor || (skipCtor = key == "constructor");
|
|
2891
|
+
}
|
|
2892
|
+
if (result && !skipCtor) {
|
|
2893
|
+
var objCtor = object.constructor, othCtor = other.constructor;
|
|
2894
|
+
if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
|
|
2895
|
+
result = false;
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
stack["delete"](object);
|
|
2899
|
+
stack["delete"](other);
|
|
2900
|
+
return result;
|
|
2901
|
+
}
|
|
2902
|
+
function getAllKeys(object) {
|
|
2903
|
+
return baseGetAllKeys(object, keys, getSymbols);
|
|
2904
|
+
}
|
|
2905
|
+
function getMapData(map, key) {
|
|
2906
|
+
var data = map.__data__;
|
|
2907
|
+
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
2908
|
+
}
|
|
2909
|
+
function getNative(object, key) {
|
|
2910
|
+
var value = getValue(object, key);
|
|
2911
|
+
return baseIsNative(value) ? value : void 0;
|
|
2912
|
+
}
|
|
2913
|
+
function getRawTag(value) {
|
|
2914
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
2915
|
+
try {
|
|
2916
|
+
value[symToStringTag] = void 0;
|
|
2917
|
+
var unmasked = true;
|
|
2918
|
+
} catch (e) {
|
|
2919
|
+
}
|
|
2920
|
+
var result = nativeObjectToString.call(value);
|
|
2921
|
+
if (unmasked) {
|
|
2922
|
+
if (isOwn) {
|
|
2923
|
+
value[symToStringTag] = tag;
|
|
2924
|
+
} else {
|
|
2925
|
+
delete value[symToStringTag];
|
|
2926
|
+
}
|
|
2927
|
+
}
|
|
2928
|
+
return result;
|
|
2929
|
+
}
|
|
2930
|
+
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
|
|
2931
|
+
if (object == null) {
|
|
2932
|
+
return [];
|
|
2933
|
+
}
|
|
2934
|
+
object = Object(object);
|
|
2935
|
+
return arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
2936
|
+
return propertyIsEnumerable.call(object, symbol);
|
|
2937
|
+
});
|
|
2938
|
+
};
|
|
2939
|
+
var getTag = baseGetTag;
|
|
2940
|
+
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
|
|
2941
|
+
getTag = function(value) {
|
|
2942
|
+
var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
|
2943
|
+
if (ctorString) {
|
|
2944
|
+
switch (ctorString) {
|
|
2945
|
+
case dataViewCtorString:
|
|
2946
|
+
return dataViewTag;
|
|
2947
|
+
case mapCtorString:
|
|
2948
|
+
return mapTag;
|
|
2949
|
+
case promiseCtorString:
|
|
2950
|
+
return promiseTag;
|
|
2951
|
+
case setCtorString:
|
|
2952
|
+
return setTag;
|
|
2953
|
+
case weakMapCtorString:
|
|
2954
|
+
return weakMapTag;
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
return result;
|
|
2958
|
+
};
|
|
2959
|
+
}
|
|
2960
|
+
function isIndex(value, length) {
|
|
2961
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
2962
|
+
return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
2963
|
+
}
|
|
2964
|
+
function isKeyable(value) {
|
|
2965
|
+
var type = typeof value;
|
|
2966
|
+
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
2967
|
+
}
|
|
2968
|
+
function isMasked(func) {
|
|
2969
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
2970
|
+
}
|
|
2971
|
+
function isPrototype(value) {
|
|
2972
|
+
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
2973
|
+
return value === proto;
|
|
2974
|
+
}
|
|
2975
|
+
function objectToString(value) {
|
|
2976
|
+
return nativeObjectToString.call(value);
|
|
2977
|
+
}
|
|
2978
|
+
function toSource(func) {
|
|
2979
|
+
if (func != null) {
|
|
2980
|
+
try {
|
|
2981
|
+
return funcToString.call(func);
|
|
2982
|
+
} catch (e) {
|
|
2983
|
+
}
|
|
2984
|
+
try {
|
|
2985
|
+
return func + "";
|
|
2986
|
+
} catch (e) {
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
return "";
|
|
2990
|
+
}
|
|
2991
|
+
function eq(value, other) {
|
|
2992
|
+
return value === other || value !== value && other !== other;
|
|
2993
|
+
}
|
|
2994
|
+
var isArguments = baseIsArguments(/* @__PURE__ */ function() {
|
|
2995
|
+
return arguments;
|
|
2996
|
+
}()) ? baseIsArguments : function(value) {
|
|
2997
|
+
return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
2998
|
+
};
|
|
2999
|
+
var isArray = Array.isArray;
|
|
3000
|
+
function isArrayLike(value) {
|
|
3001
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
|
3002
|
+
}
|
|
3003
|
+
var isBuffer = nativeIsBuffer || stubFalse;
|
|
3004
|
+
function isEqual2(value, other) {
|
|
3005
|
+
return baseIsEqual(value, other);
|
|
3006
|
+
}
|
|
3007
|
+
function isFunction(value) {
|
|
3008
|
+
if (!isObject(value)) {
|
|
3009
|
+
return false;
|
|
3010
|
+
}
|
|
3011
|
+
var tag = baseGetTag(value);
|
|
3012
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
3013
|
+
}
|
|
3014
|
+
function isLength(value) {
|
|
3015
|
+
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
3016
|
+
}
|
|
3017
|
+
function isObject(value) {
|
|
3018
|
+
var type = typeof value;
|
|
3019
|
+
return value != null && (type == "object" || type == "function");
|
|
3020
|
+
}
|
|
3021
|
+
function isObjectLike(value) {
|
|
3022
|
+
return value != null && typeof value == "object";
|
|
3023
|
+
}
|
|
3024
|
+
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
3025
|
+
function keys(object) {
|
|
3026
|
+
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
3027
|
+
}
|
|
3028
|
+
function stubArray() {
|
|
3029
|
+
return [];
|
|
3030
|
+
}
|
|
3031
|
+
function stubFalse() {
|
|
3032
|
+
return false;
|
|
3033
|
+
}
|
|
3034
|
+
module.exports = isEqual2;
|
|
3035
|
+
}
|
|
3036
|
+
});
|
|
3037
|
+
|
|
3038
|
+
// src/index.ts
|
|
3039
|
+
init_cjs_shims();
|
|
3040
|
+
|
|
3041
|
+
// src/build.ts
|
|
3042
|
+
init_cjs_shims();
|
|
3043
|
+
|
|
3044
|
+
// src/fs/clean.ts
|
|
3045
|
+
init_cjs_shims();
|
|
3046
|
+
var import_fs_extra = __toESM(require_lib(), 1);
|
|
3047
|
+
async function clean(path5) {
|
|
3048
|
+
return (0, import_fs_extra.remove)(path5);
|
|
298
3049
|
}
|
|
299
|
-
|
|
300
|
-
|
|
3050
|
+
|
|
3051
|
+
// src/fs/read.ts
|
|
3052
|
+
init_cjs_shims();
|
|
3053
|
+
var import_fs_extra2 = __toESM(require_lib(), 1);
|
|
3054
|
+
function slash(path5, platform = "linux") {
|
|
3055
|
+
const isWindowsPath = /^\\\\\?\\/.test(path5);
|
|
3056
|
+
if (["linux", "mac"].includes(platform) && !isWindowsPath) {
|
|
3057
|
+
return path5.replaceAll(/\\/g, "/").replace("../", "").trimEnd();
|
|
3058
|
+
}
|
|
3059
|
+
return path5.replaceAll(/\\/g, "/").replace("../", "").trimEnd();
|
|
3060
|
+
}
|
|
3061
|
+
function getRelativePath(rootDir, filePath, platform = "linux") {
|
|
3062
|
+
if (!rootDir || !filePath) {
|
|
3063
|
+
throw new Error(`Root and file should be filled in when retrieving the relativePath, ${rootDir || ""} ${filePath || ""}`);
|
|
3064
|
+
}
|
|
3065
|
+
const relativePath = path4.relative(rootDir, filePath);
|
|
3066
|
+
const slashedPath = slash(relativePath, platform);
|
|
3067
|
+
if (slashedPath.startsWith("../")) {
|
|
3068
|
+
return slashedPath.replace(path4.basename(slashedPath), path4.basename(slashedPath, path4.extname(filePath)));
|
|
3069
|
+
}
|
|
3070
|
+
return `./${slashedPath.replace(path4.basename(slashedPath), path4.basename(slashedPath, path4.extname(filePath)))}`;
|
|
3071
|
+
}
|
|
3072
|
+
var reader = jsRuntime.switcher(
|
|
3073
|
+
{
|
|
3074
|
+
node: async (path5) => {
|
|
3075
|
+
return import_fs_extra2.default.readFile(path5, { encoding: "utf8" });
|
|
3076
|
+
},
|
|
3077
|
+
bun: async (path5) => {
|
|
3078
|
+
const file = Bun.file(path5);
|
|
3079
|
+
return file.text();
|
|
3080
|
+
}
|
|
3081
|
+
},
|
|
3082
|
+
"node"
|
|
3083
|
+
);
|
|
3084
|
+
jsRuntime.switcher(
|
|
3085
|
+
{
|
|
3086
|
+
node: (path5) => {
|
|
3087
|
+
return import_fs_extra2.default.readFileSync(path5, { encoding: "utf8" });
|
|
3088
|
+
},
|
|
3089
|
+
bun: () => {
|
|
3090
|
+
throw new Error("Bun cannot read sync");
|
|
3091
|
+
}
|
|
3092
|
+
},
|
|
3093
|
+
"node"
|
|
3094
|
+
);
|
|
3095
|
+
async function read(path5) {
|
|
3096
|
+
return reader(path5);
|
|
301
3097
|
}
|
|
302
3098
|
|
|
303
|
-
// src/utils/
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
3099
|
+
// src/utils/URLPath.ts
|
|
3100
|
+
init_cjs_shims();
|
|
3101
|
+
|
|
3102
|
+
// src/transformers/index.ts
|
|
3103
|
+
init_cjs_shims();
|
|
3104
|
+
|
|
3105
|
+
// src/transformers/casing.ts
|
|
3106
|
+
init_cjs_shims();
|
|
3107
|
+
function camelCase(text) {
|
|
3108
|
+
return changeCase.camelCase(text, { delimiter: "", stripRegexp: /[^A-Z0-9$]/gi, transform: changeCase.camelCaseTransformMerge });
|
|
3109
|
+
}
|
|
3110
|
+
function pascalCase(text) {
|
|
3111
|
+
return changeCase.pascalCase(text, { delimiter: "", stripRegexp: /[^A-Z0-9$]/gi, transform: changeCase.pascalCaseTransformMerge });
|
|
310
3112
|
}
|
|
311
3113
|
|
|
312
|
-
// src/
|
|
3114
|
+
// src/transformers/combineCodes.ts
|
|
3115
|
+
init_cjs_shims();
|
|
313
3116
|
function combineCodes(codes) {
|
|
314
3117
|
return codes.join("\n");
|
|
315
3118
|
}
|
|
316
3119
|
|
|
317
|
-
// src/
|
|
318
|
-
|
|
3120
|
+
// src/transformers/createJSDocBlockText.ts
|
|
3121
|
+
init_cjs_shims();
|
|
3122
|
+
function createJSDocBlockText({ comments }) {
|
|
319
3123
|
const filteredComments = comments.filter(Boolean);
|
|
320
3124
|
if (!filteredComments.length) {
|
|
321
3125
|
return "";
|
|
322
3126
|
}
|
|
323
|
-
|
|
3127
|
+
return `/**
|
|
324
3128
|
* ${filteredComments.join("\n * ")}
|
|
325
3129
|
*/`;
|
|
326
|
-
if (newLine) {
|
|
327
|
-
return `${source}
|
|
328
|
-
`;
|
|
329
|
-
}
|
|
330
|
-
return source;
|
|
331
3130
|
}
|
|
332
3131
|
|
|
333
|
-
// src/
|
|
3132
|
+
// src/transformers/escape.ts
|
|
3133
|
+
init_cjs_shims();
|
|
334
3134
|
function escape(text) {
|
|
335
3135
|
return text ? text.replaceAll("`", "\\`") : "";
|
|
336
3136
|
}
|
|
@@ -355,12 +3155,14 @@ function jsStringEscape(input) {
|
|
|
355
3155
|
});
|
|
356
3156
|
}
|
|
357
3157
|
|
|
358
|
-
// src/
|
|
3158
|
+
// src/transformers/indent.ts
|
|
3159
|
+
init_cjs_shims();
|
|
359
3160
|
function createIndent(size) {
|
|
360
3161
|
return Array.from({ length: size + 1 }).join(" ");
|
|
361
3162
|
}
|
|
362
3163
|
|
|
363
|
-
// src/
|
|
3164
|
+
// src/transformers/nameSorter.ts
|
|
3165
|
+
init_cjs_shims();
|
|
364
3166
|
function nameSorter(a, b) {
|
|
365
3167
|
if (a.name < b.name) {
|
|
366
3168
|
return -1;
|
|
@@ -371,7 +3173,8 @@ function nameSorter(a, b) {
|
|
|
371
3173
|
return 0;
|
|
372
3174
|
}
|
|
373
3175
|
|
|
374
|
-
// src/
|
|
3176
|
+
// src/transformers/searchAndReplace.ts
|
|
3177
|
+
init_cjs_shims();
|
|
375
3178
|
function searchAndReplace(options) {
|
|
376
3179
|
const { text, replaceBy, prefix = "", key } = options;
|
|
377
3180
|
const searchValues = options.searchValues?.(prefix, key) || [
|
|
@@ -388,7 +3191,8 @@ function searchAndReplace(options) {
|
|
|
388
3191
|
}, text);
|
|
389
3192
|
}
|
|
390
3193
|
|
|
391
|
-
// src/
|
|
3194
|
+
// src/transformers/transformReservedWord.ts
|
|
3195
|
+
init_cjs_shims();
|
|
392
3196
|
var reservedWords = [
|
|
393
3197
|
"abstract",
|
|
394
3198
|
"arguments",
|
|
@@ -481,13 +3285,17 @@ function transformReservedWord(word) {
|
|
|
481
3285
|
return word;
|
|
482
3286
|
}
|
|
483
3287
|
|
|
484
|
-
// src/
|
|
3288
|
+
// src/transformers/trim.ts
|
|
3289
|
+
init_cjs_shims();
|
|
485
3290
|
function trim(text) {
|
|
486
3291
|
return text.replaceAll(/\n/g, "").trim();
|
|
487
3292
|
}
|
|
3293
|
+
function trimExtName(text) {
|
|
3294
|
+
return text.replace(/\.[^/.]+$/, "");
|
|
3295
|
+
}
|
|
488
3296
|
|
|
489
|
-
// src/
|
|
490
|
-
var
|
|
3297
|
+
// src/transformers/index.ts
|
|
3298
|
+
var transformers_default = {
|
|
491
3299
|
combineCodes,
|
|
492
3300
|
escape,
|
|
493
3301
|
jsStringEscape,
|
|
@@ -496,28 +3304,145 @@ var transformers = {
|
|
|
496
3304
|
nameSorter,
|
|
497
3305
|
searchAndReplace,
|
|
498
3306
|
trim,
|
|
3307
|
+
trimExtName,
|
|
499
3308
|
JSDoc: {
|
|
500
3309
|
createJSDocBlockText
|
|
3310
|
+
},
|
|
3311
|
+
camelCase,
|
|
3312
|
+
pascalCase
|
|
3313
|
+
};
|
|
3314
|
+
|
|
3315
|
+
// src/utils/URLPath.ts
|
|
3316
|
+
var URLPath = class {
|
|
3317
|
+
constructor(path5) {
|
|
3318
|
+
this.path = path5;
|
|
3319
|
+
return this;
|
|
3320
|
+
}
|
|
3321
|
+
/**
|
|
3322
|
+
* Convert Swagger path to URLPath(syntax of Express)
|
|
3323
|
+
* @example /pet/{petId} => /pet/:petId
|
|
3324
|
+
*/
|
|
3325
|
+
get URL() {
|
|
3326
|
+
return this.toURLPath();
|
|
3327
|
+
}
|
|
3328
|
+
get isURL() {
|
|
3329
|
+
try {
|
|
3330
|
+
const url = new URL(this.path);
|
|
3331
|
+
if (url?.href) {
|
|
3332
|
+
return true;
|
|
3333
|
+
}
|
|
3334
|
+
} catch (error) {
|
|
3335
|
+
return false;
|
|
3336
|
+
}
|
|
3337
|
+
return false;
|
|
3338
|
+
}
|
|
3339
|
+
/**
|
|
3340
|
+
* Convert Swagger path to template literals/ template strings(camelcase)
|
|
3341
|
+
* @example /pet/{petId} => `/pet/${petId}`
|
|
3342
|
+
* @example /account/monetary-accountID => `/account/${monetaryAccountId}`
|
|
3343
|
+
* @example /account/userID => `/account/${userId}`
|
|
3344
|
+
*/
|
|
3345
|
+
get template() {
|
|
3346
|
+
return this.toTemplateString();
|
|
3347
|
+
}
|
|
3348
|
+
get object() {
|
|
3349
|
+
return this.toObject();
|
|
3350
|
+
}
|
|
3351
|
+
get params() {
|
|
3352
|
+
return this.getParams();
|
|
3353
|
+
}
|
|
3354
|
+
toObject({ type = "path", replacer, stringify } = {}) {
|
|
3355
|
+
const object = {
|
|
3356
|
+
url: type === "path" ? this.toURLPath() : this.toTemplateString(replacer),
|
|
3357
|
+
params: this.getParams()
|
|
3358
|
+
};
|
|
3359
|
+
if (stringify) {
|
|
3360
|
+
if (type === "template") {
|
|
3361
|
+
return JSON.stringify(object).replaceAll("'", "").replaceAll(`"`, "");
|
|
3362
|
+
}
|
|
3363
|
+
if (object.params) {
|
|
3364
|
+
return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll("'", "").replaceAll(`"`, "")} }`;
|
|
3365
|
+
}
|
|
3366
|
+
return `{ url: '${object.url}' }`;
|
|
3367
|
+
}
|
|
3368
|
+
return object;
|
|
3369
|
+
}
|
|
3370
|
+
/**
|
|
3371
|
+
* Convert Swagger path to template literals/ template strings(camelcase)
|
|
3372
|
+
* @example /pet/{petId} => `/pet/${petId}`
|
|
3373
|
+
* @example /account/monetary-accountID => `/account/${monetaryAccountId}`
|
|
3374
|
+
* @example /account/userID => `/account/${userId}`
|
|
3375
|
+
*/
|
|
3376
|
+
toTemplateString(replacer) {
|
|
3377
|
+
const regex = /{(\w|-)*}/g;
|
|
3378
|
+
const found = this.path.match(regex);
|
|
3379
|
+
let newPath = this.path.replaceAll("{", "${");
|
|
3380
|
+
if (found) {
|
|
3381
|
+
newPath = found.reduce((prev, curr) => {
|
|
3382
|
+
const pathParam = replacer ? replacer(transformers_default.camelCase(curr)) : transformers_default.camelCase(curr);
|
|
3383
|
+
const replacement = `\${${pathParam}}`;
|
|
3384
|
+
return prev.replace(curr, replacement);
|
|
3385
|
+
}, this.path);
|
|
3386
|
+
}
|
|
3387
|
+
return `\`${newPath}\``;
|
|
3388
|
+
}
|
|
3389
|
+
getParams(replacer) {
|
|
3390
|
+
const regex = /{(\w|-)*}/g;
|
|
3391
|
+
const found = this.path.match(regex);
|
|
3392
|
+
if (!found) {
|
|
3393
|
+
return void 0;
|
|
3394
|
+
}
|
|
3395
|
+
const params = {};
|
|
3396
|
+
found.forEach((item) => {
|
|
3397
|
+
item = item.replaceAll("{", "").replaceAll("}", "");
|
|
3398
|
+
const pathParam = replacer ? replacer(transformers_default.camelCase(item)) : transformers_default.camelCase(item);
|
|
3399
|
+
params[pathParam] = pathParam;
|
|
3400
|
+
}, this.path);
|
|
3401
|
+
return params;
|
|
3402
|
+
}
|
|
3403
|
+
/**
|
|
3404
|
+
* Convert Swagger path to URLPath(syntax of Express)
|
|
3405
|
+
* @example /pet/{petId} => /pet/:petId
|
|
3406
|
+
*/
|
|
3407
|
+
toURLPath() {
|
|
3408
|
+
return this.path.replaceAll("{", ":").replaceAll("}", "");
|
|
501
3409
|
}
|
|
502
3410
|
};
|
|
3411
|
+
|
|
3412
|
+
// src/config.ts
|
|
3413
|
+
init_cjs_shims();
|
|
3414
|
+
function defineConfig(options) {
|
|
3415
|
+
return options;
|
|
3416
|
+
}
|
|
3417
|
+
function isInputPath(result) {
|
|
3418
|
+
return !!result && "path" in result;
|
|
3419
|
+
}
|
|
3420
|
+
|
|
3421
|
+
// src/FileManager.ts
|
|
3422
|
+
init_cjs_shims();
|
|
3423
|
+
var import_lodash = __toESM(require_lodash(), 1);
|
|
3424
|
+
|
|
3425
|
+
// src/fs/write.ts
|
|
3426
|
+
init_cjs_shims();
|
|
3427
|
+
var import_fs_extra3 = __toESM(require_lib(), 1);
|
|
503
3428
|
async function saveCreateDirectory(path5) {
|
|
504
3429
|
const passedPath = path4.dirname(path4.resolve(path5));
|
|
505
|
-
await
|
|
3430
|
+
await import_fs_extra3.default.mkdir(passedPath, { recursive: true });
|
|
506
3431
|
}
|
|
507
3432
|
var writer = jsRuntime.switcher(
|
|
508
3433
|
{
|
|
509
3434
|
node: async (path5, data) => {
|
|
510
3435
|
try {
|
|
511
|
-
await
|
|
512
|
-
const oldContent = await
|
|
3436
|
+
await import_fs_extra3.default.stat(path4.resolve(path5));
|
|
3437
|
+
const oldContent = await import_fs_extra3.default.readFile(path4.resolve(path5), { encoding: "utf-8" });
|
|
513
3438
|
if (oldContent?.toString() === data?.toString()) {
|
|
514
3439
|
return;
|
|
515
3440
|
}
|
|
516
3441
|
} catch (_err) {
|
|
517
3442
|
}
|
|
518
3443
|
await saveCreateDirectory(path5);
|
|
519
|
-
await
|
|
520
|
-
const savedData = await
|
|
3444
|
+
await import_fs_extra3.default.writeFile(path4.resolve(path5), data, { encoding: "utf-8" });
|
|
3445
|
+
const savedData = await import_fs_extra3.default.readFile(path4.resolve(path5), { encoding: "utf-8" });
|
|
521
3446
|
if (savedData?.toString() !== data?.toString()) {
|
|
522
3447
|
throw new Error(`Sanity check failed for ${path5}
|
|
523
3448
|
|
|
@@ -560,6 +3485,22 @@ async function write(data, path5) {
|
|
|
560
3485
|
}
|
|
561
3486
|
return writer(path5, data.trim());
|
|
562
3487
|
}
|
|
3488
|
+
|
|
3489
|
+
// src/utils/timeout.ts
|
|
3490
|
+
init_cjs_shims();
|
|
3491
|
+
async function timeout(ms) {
|
|
3492
|
+
return new Promise((resolve3) => {
|
|
3493
|
+
setTimeout(() => {
|
|
3494
|
+
resolve3(true);
|
|
3495
|
+
}, ms);
|
|
3496
|
+
});
|
|
3497
|
+
}
|
|
3498
|
+
|
|
3499
|
+
// src/BarrelManager.ts
|
|
3500
|
+
init_cjs_shims();
|
|
3501
|
+
|
|
3502
|
+
// src/utils/TreeNode.ts
|
|
3503
|
+
init_cjs_shims();
|
|
563
3504
|
var TreeNode = class _TreeNode {
|
|
564
3505
|
constructor(data, parent) {
|
|
565
3506
|
this.children = [];
|
|
@@ -650,78 +3591,67 @@ var TreeNode = class _TreeNode {
|
|
|
650
3591
|
var _options;
|
|
651
3592
|
var BarrelManager = class {
|
|
652
3593
|
constructor(options = {}) {
|
|
653
|
-
__privateAdd(this, _options,
|
|
3594
|
+
__privateAdd(this, _options, void 0);
|
|
654
3595
|
__privateSet(this, _options, options);
|
|
655
3596
|
return this;
|
|
656
3597
|
}
|
|
657
|
-
getIndexes(
|
|
658
|
-
const { treeNode = {}, isTypeOnly,
|
|
659
|
-
const
|
|
660
|
-
".ts": {
|
|
661
|
-
extensions: /\.ts/,
|
|
662
|
-
exclude: [/schemas/, /json/]
|
|
663
|
-
},
|
|
664
|
-
".json": {
|
|
665
|
-
extensions: /\.json/,
|
|
666
|
-
exclude: []
|
|
667
|
-
}
|
|
668
|
-
};
|
|
669
|
-
const tree = TreeNode.build(root, { ...extMapper[extName] || {}, ...treeNode });
|
|
3598
|
+
getIndexes(pathToBuild) {
|
|
3599
|
+
const { treeNode = {}, isTypeOnly, extName } = __privateGet(this, _options);
|
|
3600
|
+
const tree = TreeNode.build(pathToBuild, treeNode);
|
|
670
3601
|
if (!tree) {
|
|
671
3602
|
return null;
|
|
672
3603
|
}
|
|
673
|
-
const fileReducer = (
|
|
674
|
-
if (!
|
|
3604
|
+
const fileReducer = (files, treeNode2) => {
|
|
3605
|
+
if (!treeNode2.children) {
|
|
675
3606
|
return [];
|
|
676
3607
|
}
|
|
677
|
-
if (
|
|
678
|
-
const indexPath = path4__default.default.resolve(
|
|
679
|
-
const exports =
|
|
680
|
-
const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${file.data.name
|
|
681
|
-
if (importPath.
|
|
3608
|
+
if (treeNode2.children.length > 1) {
|
|
3609
|
+
const indexPath = path4__default.default.resolve(treeNode2.data.path, "index.ts");
|
|
3610
|
+
const exports = treeNode2.children.filter(Boolean).map((file) => {
|
|
3611
|
+
const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${transformers_default.trimExtName(file.data.name)}`;
|
|
3612
|
+
if (importPath.endsWith("index") && file.data.type === "file") {
|
|
682
3613
|
return void 0;
|
|
683
3614
|
}
|
|
684
3615
|
return {
|
|
685
|
-
path:
|
|
3616
|
+
path: extName ? `${importPath}${extName}` : importPath,
|
|
686
3617
|
isTypeOnly
|
|
687
3618
|
};
|
|
688
3619
|
}).filter(Boolean);
|
|
689
|
-
|
|
3620
|
+
files.push({
|
|
690
3621
|
path: indexPath,
|
|
691
3622
|
baseName: "index.ts",
|
|
692
3623
|
source: "",
|
|
693
|
-
exports
|
|
694
|
-
|
|
695
|
-
|
|
3624
|
+
exports,
|
|
3625
|
+
meta: {
|
|
3626
|
+
treeNode: treeNode2
|
|
3627
|
+
}
|
|
696
3628
|
});
|
|
697
|
-
} else {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
}
|
|
3629
|
+
} else if (treeNode2.children.length === 1) {
|
|
3630
|
+
const [treeNodeChild] = treeNode2.children;
|
|
3631
|
+
const indexPath = path4__default.default.resolve(treeNode2.data.path, "index.ts");
|
|
3632
|
+
const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${transformers_default.trimExtName(treeNodeChild.data.name)}`;
|
|
3633
|
+
const exports = [
|
|
3634
|
+
{
|
|
3635
|
+
path: extName ? `${importPath}${extName}` : importPath,
|
|
3636
|
+
isTypeOnly
|
|
3637
|
+
}
|
|
3638
|
+
];
|
|
3639
|
+
files.push({
|
|
3640
|
+
path: indexPath,
|
|
3641
|
+
baseName: "index.ts",
|
|
3642
|
+
source: "",
|
|
3643
|
+
exports,
|
|
3644
|
+
meta: {
|
|
3645
|
+
treeNode: treeNode2
|
|
3646
|
+
}
|
|
715
3647
|
});
|
|
716
3648
|
}
|
|
717
|
-
|
|
718
|
-
fileReducer(
|
|
3649
|
+
treeNode2.children.forEach((childItem) => {
|
|
3650
|
+
fileReducer(files, childItem);
|
|
719
3651
|
});
|
|
720
|
-
return
|
|
3652
|
+
return files;
|
|
721
3653
|
};
|
|
722
|
-
|
|
723
|
-
const filteredFiles = filter ? files.filter(filter) : files;
|
|
724
|
-
return map ? filteredFiles.map(map) : filteredFiles;
|
|
3654
|
+
return fileReducer([], tree).reverse();
|
|
725
3655
|
}
|
|
726
3656
|
};
|
|
727
3657
|
_options = new WeakMap();
|
|
@@ -730,7 +3660,7 @@ _options = new WeakMap();
|
|
|
730
3660
|
exports.KubbFile = void 0;
|
|
731
3661
|
((KubbFile2) => {
|
|
732
3662
|
})(exports.KubbFile || (exports.KubbFile = {}));
|
|
733
|
-
var _cache, _task, _isWriting, _timeout, _queue, _validate,
|
|
3663
|
+
var _cache, _task, _isWriting, _timeout, _queue, _validate, _add, add_fn, _addOrAppend, addOrAppend_fn;
|
|
734
3664
|
var _FileManager = class _FileManager {
|
|
735
3665
|
constructor(options) {
|
|
736
3666
|
__privateAdd(this, _validate);
|
|
@@ -763,7 +3693,6 @@ var _FileManager = class _FileManager {
|
|
|
763
3693
|
}
|
|
764
3694
|
async add(...files) {
|
|
765
3695
|
const promises = files.map((file) => {
|
|
766
|
-
__privateMethod(this, _validate, validate_fn).call(this, file);
|
|
767
3696
|
if (file.override) {
|
|
768
3697
|
return __privateMethod(this, _add, add_fn).call(this, file);
|
|
769
3698
|
}
|
|
@@ -775,12 +3704,37 @@ var _FileManager = class _FileManager {
|
|
|
775
3704
|
}
|
|
776
3705
|
return resolvedFiles[0];
|
|
777
3706
|
}
|
|
778
|
-
async addIndexes({ root,
|
|
779
|
-
const
|
|
780
|
-
|
|
3707
|
+
async addIndexes({ root, output, meta, options = {} }) {
|
|
3708
|
+
const { exportType = "barrel" } = output;
|
|
3709
|
+
if (!exportType) {
|
|
3710
|
+
return void 0;
|
|
3711
|
+
}
|
|
3712
|
+
const exportPath = output.path.startsWith("./") ? output.path : `./${output.path}`;
|
|
3713
|
+
const barrelManager = new BarrelManager({ extName: output.extName, ...options });
|
|
3714
|
+
const files = barrelManager.getIndexes(path4.resolve(root, output.path));
|
|
781
3715
|
if (!files) {
|
|
782
3716
|
return void 0;
|
|
783
3717
|
}
|
|
3718
|
+
const rootFile = {
|
|
3719
|
+
path: path4.resolve(root, "index.ts"),
|
|
3720
|
+
baseName: "index.ts",
|
|
3721
|
+
source: "",
|
|
3722
|
+
exports: [
|
|
3723
|
+
output.exportAs ? {
|
|
3724
|
+
name: output.exportAs,
|
|
3725
|
+
asAlias: true,
|
|
3726
|
+
path: exportPath,
|
|
3727
|
+
isTypeOnly: options.isTypeOnly
|
|
3728
|
+
} : {
|
|
3729
|
+
path: exportPath,
|
|
3730
|
+
isTypeOnly: options.isTypeOnly
|
|
3731
|
+
}
|
|
3732
|
+
]
|
|
3733
|
+
};
|
|
3734
|
+
await __privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
3735
|
+
...rootFile,
|
|
3736
|
+
meta: meta ? meta : rootFile.meta
|
|
3737
|
+
});
|
|
784
3738
|
return await Promise.all(
|
|
785
3739
|
files.map((file) => {
|
|
786
3740
|
return __privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
|
|
@@ -822,44 +3776,7 @@ var _FileManager = class _FileManager {
|
|
|
822
3776
|
}
|
|
823
3777
|
// statics
|
|
824
3778
|
static getSource(file) {
|
|
825
|
-
|
|
826
|
-
return file.source;
|
|
827
|
-
}
|
|
828
|
-
const exports = file.exports ? combineExports(file.exports) : [];
|
|
829
|
-
const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
|
|
830
|
-
const importNodes = imports.map((item) => factory__namespace.createImportDeclaration({ name: item.name, path: item.path, isTypeOnly: item.isTypeOnly }));
|
|
831
|
-
const exportNodes = exports.map(
|
|
832
|
-
(item) => factory__namespace.createExportDeclaration({ name: item.name, path: item.path, isTypeOnly: item.isTypeOnly, asAlias: item.asAlias })
|
|
833
|
-
);
|
|
834
|
-
return [parser.print([...importNodes, ...exportNodes]), getEnvSource(file.source, file.env)].join("\n");
|
|
835
|
-
}
|
|
836
|
-
static combineFiles(files) {
|
|
837
|
-
return files.filter(Boolean).reduce((acc, file) => {
|
|
838
|
-
const prevIndex = acc.findIndex((item) => item.path === file.path);
|
|
839
|
-
if (prevIndex === -1) {
|
|
840
|
-
return [...acc, file];
|
|
841
|
-
}
|
|
842
|
-
const prev = acc[prevIndex];
|
|
843
|
-
if (prev && file.override) {
|
|
844
|
-
acc[prevIndex] = {
|
|
845
|
-
imports: [],
|
|
846
|
-
exports: [],
|
|
847
|
-
...file
|
|
848
|
-
};
|
|
849
|
-
return acc;
|
|
850
|
-
}
|
|
851
|
-
if (prev) {
|
|
852
|
-
acc[prevIndex] = {
|
|
853
|
-
...file,
|
|
854
|
-
source: prev.source && file.source ? `${prev.source}
|
|
855
|
-
${file.source}` : "",
|
|
856
|
-
imports: [...prev.imports || [], ...file.imports || []],
|
|
857
|
-
exports: [...prev.exports || [], ...file.exports || []],
|
|
858
|
-
env: { ...prev.env || {}, ...file.env || {} }
|
|
859
|
-
};
|
|
860
|
-
}
|
|
861
|
-
return acc;
|
|
862
|
-
}, []);
|
|
3779
|
+
return getSource(file);
|
|
863
3780
|
}
|
|
864
3781
|
static getMode(path5) {
|
|
865
3782
|
if (!path5) {
|
|
@@ -880,18 +3797,10 @@ _isWriting = new WeakMap();
|
|
|
880
3797
|
_timeout = new WeakMap();
|
|
881
3798
|
_queue = new WeakMap();
|
|
882
3799
|
_validate = new WeakSet();
|
|
883
|
-
validate_fn = function(file) {
|
|
884
|
-
if (!file.validate) {
|
|
885
|
-
return;
|
|
886
|
-
}
|
|
887
|
-
if (!file.path.toLowerCase().endsWith(file.baseName.toLowerCase())) {
|
|
888
|
-
throw new Error(`${file.path} should end with the baseName ${file.baseName}`);
|
|
889
|
-
}
|
|
890
|
-
};
|
|
891
3800
|
_add = new WeakSet();
|
|
892
3801
|
add_fn = async function(file) {
|
|
893
3802
|
const controller = new AbortController();
|
|
894
|
-
const resolvedFile = { id: crypto2__default.default.randomUUID(), ...file };
|
|
3803
|
+
const resolvedFile = { id: crypto2__default.default.randomUUID(), name: transformers_default.trimExtName(file.baseName), ...file };
|
|
895
3804
|
__privateGet(this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
|
|
896
3805
|
if (__privateGet(this, _queue)) {
|
|
897
3806
|
await __privateGet(this, _queue).run(
|
|
@@ -922,16 +3831,41 @@ ${file.source}` : "",
|
|
|
922
3831
|
return __privateMethod(this, _add, add_fn).call(this, file);
|
|
923
3832
|
};
|
|
924
3833
|
var FileManager = _FileManager;
|
|
3834
|
+
function getSource(file) {
|
|
3835
|
+
if (!FileManager.isExtensionAllowed(file.baseName)) {
|
|
3836
|
+
return file.source;
|
|
3837
|
+
}
|
|
3838
|
+
const exports = file.exports ? combineExports(file.exports) : [];
|
|
3839
|
+
const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
|
|
3840
|
+
const importNodes = imports.filter((item) => {
|
|
3841
|
+
return item.path !== transformers_default.trimExtName(file.path);
|
|
3842
|
+
}).map((item) => {
|
|
3843
|
+
return factory__namespace.createImportDeclaration({
|
|
3844
|
+
name: item.name,
|
|
3845
|
+
path: item.root ? getRelativePath(item.root, item.path) : item.path,
|
|
3846
|
+
isTypeOnly: item.isTypeOnly
|
|
3847
|
+
});
|
|
3848
|
+
});
|
|
3849
|
+
const exportNodes = exports.map(
|
|
3850
|
+
(item) => factory__namespace.createExportDeclaration({
|
|
3851
|
+
name: item.name,
|
|
3852
|
+
path: item.path,
|
|
3853
|
+
isTypeOnly: item.isTypeOnly,
|
|
3854
|
+
asAlias: item.asAlias
|
|
3855
|
+
})
|
|
3856
|
+
);
|
|
3857
|
+
return [parser.print([...importNodes, ...exportNodes]), getEnvSource(file.source, file.env)].join("\n");
|
|
3858
|
+
}
|
|
925
3859
|
function combineExports(exports) {
|
|
926
3860
|
const combinedExports = naturalOrderby.orderBy(exports, [(v) => !v.isTypeOnly], ["asc"]).reduce((prev, curr) => {
|
|
927
3861
|
const name = curr.name;
|
|
928
3862
|
const prevByPath = prev.findLast((imp) => imp.path === curr.path);
|
|
929
|
-
const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path &&
|
|
3863
|
+
const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly);
|
|
930
3864
|
if (prevByPathAndIsTypeOnly) {
|
|
931
3865
|
return prev;
|
|
932
3866
|
}
|
|
933
3867
|
const uniquePrev = prev.findLast(
|
|
934
|
-
(imp) => imp.path === curr.path &&
|
|
3868
|
+
(imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly && imp.asAlias === curr.asAlias
|
|
935
3869
|
);
|
|
936
3870
|
if (uniquePrev || Array.isArray(name) && !name.length || prevByPath?.asAlias && !curr.asAlias) {
|
|
937
3871
|
return prev;
|
|
@@ -964,11 +3898,11 @@ function combineImports(imports, exports, source) {
|
|
|
964
3898
|
return checker(importName) || exports.some(({ name: name2 }) => Array.isArray(name2) ? name2.some(checker) : checker(name2));
|
|
965
3899
|
};
|
|
966
3900
|
if (Array.isArray(name)) {
|
|
967
|
-
name = name.filter((item) => hasImportInSource(item));
|
|
3901
|
+
name = name.filter((item) => typeof item === "string" ? hasImportInSource(item) : hasImportInSource(item.propertyName));
|
|
968
3902
|
}
|
|
969
3903
|
const prevByPath = prev.findLast((imp) => imp.path === curr.path && imp.isTypeOnly === curr.isTypeOnly);
|
|
970
|
-
const uniquePrev = prev.findLast((imp) => imp.path === curr.path &&
|
|
971
|
-
const prevByPathNameAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path &&
|
|
3904
|
+
const uniquePrev = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly);
|
|
3905
|
+
const prevByPathNameAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly);
|
|
972
3906
|
if (prevByPathNameAndIsTypeOnly) {
|
|
973
3907
|
return prev;
|
|
974
3908
|
}
|
|
@@ -1010,13 +3944,90 @@ function getEnvSource(source, env) {
|
|
|
1010
3944
|
throw new TypeError(`Environment should be in upperCase for ${key}`);
|
|
1011
3945
|
}
|
|
1012
3946
|
if (typeof replaceBy === "string") {
|
|
1013
|
-
prev =
|
|
1014
|
-
prev =
|
|
3947
|
+
prev = transformers_default.searchAndReplace({ text: prev.replaceAll(`process.env.${key}`, replaceBy), replaceBy, prefix: "process.env", key });
|
|
3948
|
+
prev = transformers_default.searchAndReplace({ text: prev.replaceAll(new RegExp(`(declare const).*
|
|
1015
3949
|
`, "ig"), ""), replaceBy, key });
|
|
1016
3950
|
}
|
|
1017
3951
|
return prev;
|
|
1018
3952
|
}, source);
|
|
1019
3953
|
}
|
|
3954
|
+
|
|
3955
|
+
// src/logger.ts
|
|
3956
|
+
init_cjs_shims();
|
|
3957
|
+
var LogLevel = {
|
|
3958
|
+
silent: "silent",
|
|
3959
|
+
info: "info",
|
|
3960
|
+
debug: "debug"
|
|
3961
|
+
};
|
|
3962
|
+
function createLogger({ logLevel, name, spinner }) {
|
|
3963
|
+
const logs = [];
|
|
3964
|
+
const log = (message) => {
|
|
3965
|
+
if (message && spinner) {
|
|
3966
|
+
spinner.text = message;
|
|
3967
|
+
logs.push(message);
|
|
3968
|
+
}
|
|
3969
|
+
};
|
|
3970
|
+
const error = (message) => {
|
|
3971
|
+
if (message) {
|
|
3972
|
+
throw new Error(message || "Something went wrong");
|
|
3973
|
+
}
|
|
3974
|
+
};
|
|
3975
|
+
const warn = (message) => {
|
|
3976
|
+
if (message && spinner) {
|
|
3977
|
+
spinner.warn(pc2__default.default.yellow(message));
|
|
3978
|
+
logs.push(message);
|
|
3979
|
+
}
|
|
3980
|
+
};
|
|
3981
|
+
const info = (message) => {
|
|
3982
|
+
if (message && spinner && logLevel !== LogLevel.silent) {
|
|
3983
|
+
spinner.info(message);
|
|
3984
|
+
logs.push(message);
|
|
3985
|
+
}
|
|
3986
|
+
};
|
|
3987
|
+
const logger = {
|
|
3988
|
+
name,
|
|
3989
|
+
logLevel,
|
|
3990
|
+
log,
|
|
3991
|
+
error,
|
|
3992
|
+
warn,
|
|
3993
|
+
info,
|
|
3994
|
+
spinner,
|
|
3995
|
+
logs
|
|
3996
|
+
};
|
|
3997
|
+
return logger;
|
|
3998
|
+
}
|
|
3999
|
+
var defaultColours = ["black", "blue", "darkBlue", "cyan", "gray", "green", "darkGreen", "magenta", "red", "darkRed", "yellow", "darkYellow"];
|
|
4000
|
+
function randomColour(text, colours = defaultColours) {
|
|
4001
|
+
if (!text) {
|
|
4002
|
+
return "white";
|
|
4003
|
+
}
|
|
4004
|
+
const random = seedrandom__default.default(text);
|
|
4005
|
+
const colour = colours.at(Math.floor(random() * colours.length)) || "white";
|
|
4006
|
+
return colour;
|
|
4007
|
+
}
|
|
4008
|
+
function randomPicoColour(text, colors = defaultColours) {
|
|
4009
|
+
const colours = pc2__default.default.createColors(true);
|
|
4010
|
+
if (!text) {
|
|
4011
|
+
return colours.white(text);
|
|
4012
|
+
}
|
|
4013
|
+
const colour = randomColour(text, colors);
|
|
4014
|
+
const isDark = colour.includes("dark");
|
|
4015
|
+
const key = colour.replace("dark", "").toLowerCase();
|
|
4016
|
+
const formatter = colours[key];
|
|
4017
|
+
if (isDark) {
|
|
4018
|
+
return pc2__default.default.bold(formatter(text));
|
|
4019
|
+
}
|
|
4020
|
+
if (typeof formatter !== "function") {
|
|
4021
|
+
throw new Error("Formatter for picoColor is not of type function/Formatter");
|
|
4022
|
+
}
|
|
4023
|
+
return formatter(text);
|
|
4024
|
+
}
|
|
4025
|
+
|
|
4026
|
+
// src/PluginManager.ts
|
|
4027
|
+
init_cjs_shims();
|
|
4028
|
+
|
|
4029
|
+
// src/utils/EventEmitter.ts
|
|
4030
|
+
init_cjs_shims();
|
|
1020
4031
|
var _emitter;
|
|
1021
4032
|
var EventEmitter = class {
|
|
1022
4033
|
constructor() {
|
|
@@ -1037,6 +4048,9 @@ var EventEmitter = class {
|
|
|
1037
4048
|
}
|
|
1038
4049
|
};
|
|
1039
4050
|
_emitter = new WeakMap();
|
|
4051
|
+
|
|
4052
|
+
// src/utils/Queue.ts
|
|
4053
|
+
init_cjs_shims();
|
|
1040
4054
|
var _queue2, _workerCount, _maxParallel, _debug, _work, work_fn;
|
|
1041
4055
|
var Queue = class {
|
|
1042
4056
|
constructor(maxParallel, debug = false) {
|
|
@@ -1050,8 +4064,8 @@ var Queue = class {
|
|
|
1050
4064
|
__privateSet(this, _debug, debug);
|
|
1051
4065
|
}
|
|
1052
4066
|
run(job, options = { controller: new AbortController(), name: crypto2__default.default.randomUUID(), description: "" }) {
|
|
1053
|
-
return new Promise((
|
|
1054
|
-
const item = { reject, resolve:
|
|
4067
|
+
return new Promise((resolve3, reject) => {
|
|
4068
|
+
const item = { reject, resolve: resolve3, job, name: options.name, description: options.description || options.name };
|
|
1055
4069
|
options.controller?.signal.addEventListener("abort", () => {
|
|
1056
4070
|
__privateSet(this, _queue2, __privateGet(this, _queue2).filter((queueItem) => queueItem.name === item.name));
|
|
1057
4071
|
reject("Aborted");
|
|
@@ -1061,8 +4075,8 @@ var Queue = class {
|
|
|
1061
4075
|
});
|
|
1062
4076
|
}
|
|
1063
4077
|
runSync(job, options = { controller: new AbortController(), name: crypto2__default.default.randomUUID(), description: "" }) {
|
|
1064
|
-
new Promise((
|
|
1065
|
-
const item = { reject, resolve:
|
|
4078
|
+
new Promise((resolve3, reject) => {
|
|
4079
|
+
const item = { reject, resolve: resolve3, job, name: options.name, description: options.description || options.name };
|
|
1066
4080
|
options.controller?.signal.addEventListener("abort", () => {
|
|
1067
4081
|
__privateSet(this, _queue2, __privateGet(this, _queue2).filter((queueItem) => queueItem.name === item.name));
|
|
1068
4082
|
});
|
|
@@ -1089,13 +4103,13 @@ work_fn = function() {
|
|
|
1089
4103
|
__privateWrapper(this, _workerCount)._++;
|
|
1090
4104
|
let entry;
|
|
1091
4105
|
while (entry = __privateGet(this, _queue2).shift()) {
|
|
1092
|
-
const { reject, resolve:
|
|
4106
|
+
const { reject, resolve: resolve3, job, name, description } = entry;
|
|
1093
4107
|
if (__privateGet(this, _debug)) {
|
|
1094
4108
|
perf_hooks.performance.mark(name + "_start");
|
|
1095
4109
|
}
|
|
1096
4110
|
job().then((result) => {
|
|
1097
4111
|
this.eventEmitter.emit("jobDone", result);
|
|
1098
|
-
|
|
4112
|
+
resolve3(result);
|
|
1099
4113
|
if (__privateGet(this, _debug)) {
|
|
1100
4114
|
perf_hooks.performance.mark(name + "_stop");
|
|
1101
4115
|
perf_hooks.performance.measure(description, name + "_start", name + "_stop");
|
|
@@ -1109,6 +4123,7 @@ work_fn = function() {
|
|
|
1109
4123
|
};
|
|
1110
4124
|
|
|
1111
4125
|
// src/utils/uniqueName.ts
|
|
4126
|
+
init_cjs_shims();
|
|
1112
4127
|
function setUniqueName(originalName, data) {
|
|
1113
4128
|
let used = data[originalName] || 0;
|
|
1114
4129
|
if (used) {
|
|
@@ -1120,6 +4135,7 @@ function setUniqueName(originalName, data) {
|
|
|
1120
4135
|
}
|
|
1121
4136
|
|
|
1122
4137
|
// src/errors.ts
|
|
4138
|
+
init_cjs_shims();
|
|
1123
4139
|
var Warning = class extends Error {
|
|
1124
4140
|
constructor(message, options) {
|
|
1125
4141
|
super(message, { cause: options?.cause });
|
|
@@ -1129,7 +4145,11 @@ var Warning = class extends Error {
|
|
|
1129
4145
|
var ValidationPluginError = class extends Error {
|
|
1130
4146
|
};
|
|
1131
4147
|
|
|
4148
|
+
// src/plugin.ts
|
|
4149
|
+
init_cjs_shims();
|
|
4150
|
+
|
|
1132
4151
|
// src/utils/cache.ts
|
|
4152
|
+
init_cjs_shims();
|
|
1133
4153
|
function createPluginCache(Store = /* @__PURE__ */ Object.create(null)) {
|
|
1134
4154
|
return {
|
|
1135
4155
|
set(id, value) {
|
|
@@ -1169,8 +4189,7 @@ var definePlugin = createPlugin((options) => {
|
|
|
1169
4189
|
return {
|
|
1170
4190
|
name: pluginName,
|
|
1171
4191
|
options,
|
|
1172
|
-
key: ["
|
|
1173
|
-
kind: "controller",
|
|
4192
|
+
key: ["core"],
|
|
1174
4193
|
api() {
|
|
1175
4194
|
return {
|
|
1176
4195
|
get config() {
|
|
@@ -1207,7 +4226,11 @@ var definePlugin = createPlugin((options) => {
|
|
|
1207
4226
|
};
|
|
1208
4227
|
});
|
|
1209
4228
|
|
|
4229
|
+
// src/PromiseManager.ts
|
|
4230
|
+
init_cjs_shims();
|
|
4231
|
+
|
|
1210
4232
|
// src/utils/executeStrategies.ts
|
|
4233
|
+
init_cjs_shims();
|
|
1211
4234
|
function hookSeq(promises) {
|
|
1212
4235
|
return promises.filter(Boolean).reduce(
|
|
1213
4236
|
(promise, func) => {
|
|
@@ -1294,7 +4317,7 @@ var PluginManager = class {
|
|
|
1294
4317
|
__privateAdd(this, _executeSync);
|
|
1295
4318
|
__privateAdd(this, _catcher);
|
|
1296
4319
|
__privateAdd(this, _parse);
|
|
1297
|
-
this.
|
|
4320
|
+
this.events = new EventEmitter();
|
|
1298
4321
|
this.executed = [];
|
|
1299
4322
|
__privateAdd(this, _core, void 0);
|
|
1300
4323
|
__privateAdd(this, _usedPluginNames, {});
|
|
@@ -1306,11 +4329,14 @@ var PluginManager = class {
|
|
|
1306
4329
|
hookName: "resolvePath",
|
|
1307
4330
|
parameters: [params.baseName, params.directory, params.options]
|
|
1308
4331
|
});
|
|
1309
|
-
if (paths && paths?.length > 1) {
|
|
1310
|
-
|
|
4332
|
+
if (paths && paths?.length > 1 && this.logger.logLevel === LogLevel.debug) {
|
|
4333
|
+
this.logger.warn(
|
|
1311
4334
|
`Cannot return a path where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
1312
4335
|
|
|
1313
|
-
Paths: ${JSON.stringify(paths, void 0, 2)}
|
|
4336
|
+
Paths: ${JSON.stringify(paths, void 0, 2)}
|
|
4337
|
+
|
|
4338
|
+
Falling back on the first item.
|
|
4339
|
+
`
|
|
1314
4340
|
);
|
|
1315
4341
|
}
|
|
1316
4342
|
return paths?.at(0);
|
|
@@ -1327,11 +4353,14 @@ Paths: ${JSON.stringify(paths, void 0, 2)}`
|
|
|
1327
4353
|
hookName: "resolveName",
|
|
1328
4354
|
parameters: [params.name, params.type]
|
|
1329
4355
|
});
|
|
1330
|
-
if (names && names?.length > 1) {
|
|
1331
|
-
|
|
4356
|
+
if (names && names?.length > 1 && this.logger.logLevel === LogLevel.debug) {
|
|
4357
|
+
this.logger.warn(
|
|
1332
4358
|
`Cannot return a name where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
|
|
1333
4359
|
|
|
1334
|
-
Names: ${JSON.stringify(names, void 0, 2)}
|
|
4360
|
+
Names: ${JSON.stringify(names, void 0, 2)}
|
|
4361
|
+
|
|
4362
|
+
Falling back on the first item.
|
|
4363
|
+
`
|
|
1335
4364
|
);
|
|
1336
4365
|
}
|
|
1337
4366
|
return transformReservedWord(names?.at(0) || params.name);
|
|
@@ -1363,11 +4392,14 @@ Names: ${JSON.stringify(names, void 0, 2)}`
|
|
|
1363
4392
|
});
|
|
1364
4393
|
return this;
|
|
1365
4394
|
}
|
|
4395
|
+
/**
|
|
4396
|
+
* Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
|
|
4397
|
+
*/
|
|
1366
4398
|
on(eventName, handler) {
|
|
1367
|
-
this.
|
|
4399
|
+
this.events.on(eventName, handler);
|
|
1368
4400
|
}
|
|
1369
4401
|
/**
|
|
1370
|
-
* Run
|
|
4402
|
+
* Run a specific hookName for plugin x.
|
|
1371
4403
|
*/
|
|
1372
4404
|
hookForPlugin({
|
|
1373
4405
|
pluginKey,
|
|
@@ -1385,6 +4417,9 @@ Names: ${JSON.stringify(names, void 0, 2)}`
|
|
|
1385
4417
|
}).filter(Boolean);
|
|
1386
4418
|
return Promise.all(promises);
|
|
1387
4419
|
}
|
|
4420
|
+
/**
|
|
4421
|
+
* Run a specific hookName for plugin x.
|
|
4422
|
+
*/
|
|
1388
4423
|
hookForPluginSync({
|
|
1389
4424
|
pluginKey,
|
|
1390
4425
|
hookName,
|
|
@@ -1401,7 +4436,7 @@ Names: ${JSON.stringify(names, void 0, 2)}`
|
|
|
1401
4436
|
}).filter(Boolean);
|
|
1402
4437
|
}
|
|
1403
4438
|
/**
|
|
1404
|
-
*
|
|
4439
|
+
* First non-null result stops and will return it's value.
|
|
1405
4440
|
*/
|
|
1406
4441
|
async hookFirst({
|
|
1407
4442
|
hookName,
|
|
@@ -1429,7 +4464,7 @@ Names: ${JSON.stringify(names, void 0, 2)}`
|
|
|
1429
4464
|
return __privateGet(this, _promiseManager).run("first", promises);
|
|
1430
4465
|
}
|
|
1431
4466
|
/**
|
|
1432
|
-
*
|
|
4467
|
+
* First non-null result stops and will return it's value.
|
|
1433
4468
|
*/
|
|
1434
4469
|
hookFirstSync({
|
|
1435
4470
|
hookName,
|
|
@@ -1457,7 +4492,7 @@ Names: ${JSON.stringify(names, void 0, 2)}`
|
|
|
1457
4492
|
return parseResult;
|
|
1458
4493
|
}
|
|
1459
4494
|
/**
|
|
1460
|
-
*
|
|
4495
|
+
* Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).
|
|
1461
4496
|
*/
|
|
1462
4497
|
async hookParallel({
|
|
1463
4498
|
hookName,
|
|
@@ -1476,7 +4511,7 @@ Names: ${JSON.stringify(names, void 0, 2)}`
|
|
|
1476
4511
|
return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
1477
4512
|
}
|
|
1478
4513
|
/**
|
|
1479
|
-
*
|
|
4514
|
+
* Chain all plugins, `reduce` can be passed through to handle every returned value. The return value of the first plugin will be used as the first parameter for the plugin after that.
|
|
1480
4515
|
*/
|
|
1481
4516
|
hookReduceArg0({
|
|
1482
4517
|
hookName,
|
|
@@ -1514,20 +4549,19 @@ Names: ${JSON.stringify(names, void 0, 2)}`
|
|
|
1514
4549
|
}
|
|
1515
4550
|
getPluginsByKey(hookName, pluginKey) {
|
|
1516
4551
|
const plugins = [...this.plugins];
|
|
1517
|
-
const [
|
|
4552
|
+
const [searchPluginName, searchIdentifier] = pluginKey;
|
|
1518
4553
|
const pluginByPluginName = plugins.filter((plugin) => plugin[hookName]).filter((item) => {
|
|
1519
|
-
const [
|
|
4554
|
+
const [name, identifier] = item.key;
|
|
1520
4555
|
const identifierCheck = identifier?.toString() === searchIdentifier?.toString();
|
|
1521
|
-
const kindCheck = kind === searchKind;
|
|
1522
4556
|
const nameCheck = name === searchPluginName;
|
|
1523
4557
|
if (searchIdentifier) {
|
|
1524
|
-
return identifierCheck &&
|
|
4558
|
+
return identifierCheck && nameCheck;
|
|
1525
4559
|
}
|
|
1526
|
-
return
|
|
4560
|
+
return nameCheck;
|
|
1527
4561
|
});
|
|
1528
4562
|
if (!pluginByPluginName?.length) {
|
|
1529
4563
|
const corePlugin = plugins.find((plugin) => plugin.name === "core" && plugin[hookName]);
|
|
1530
|
-
if (this.logger.logLevel ===
|
|
4564
|
+
if (this.logger.logLevel === LogLevel.debug) {
|
|
1531
4565
|
if (corePlugin) {
|
|
1532
4566
|
this.logger.warn(`No hook '${hookName}' for pluginKey '${JSON.stringify(pluginKey)}' found, falling back on the '@kubb/core' plugin`);
|
|
1533
4567
|
} else {
|
|
@@ -1555,7 +4589,7 @@ Names: ${JSON.stringify(names, void 0, 2)}`
|
|
|
1555
4589
|
}
|
|
1556
4590
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
1557
4591
|
static get hooks() {
|
|
1558
|
-
return ["
|
|
4592
|
+
return ["buildStart", "resolvePath", "resolveName", "load", "transform", "writeFile", "buildEnd"];
|
|
1559
4593
|
}
|
|
1560
4594
|
};
|
|
1561
4595
|
_core = new WeakMap();
|
|
@@ -1565,7 +4599,7 @@ _getSortedPlugins = new WeakSet();
|
|
|
1565
4599
|
getSortedPlugins_fn = function(hookName) {
|
|
1566
4600
|
const plugins = [...this.plugins].filter((plugin) => plugin.name !== "core");
|
|
1567
4601
|
if (hookName) {
|
|
1568
|
-
if (this.logger.logLevel ===
|
|
4602
|
+
if (this.logger.logLevel === LogLevel.info) {
|
|
1569
4603
|
const containsHookName = plugins.some((item) => item[hookName]);
|
|
1570
4604
|
if (!containsHookName) {
|
|
1571
4605
|
this.logger.warn(`No hook ${hookName} found`);
|
|
@@ -1573,12 +4607,28 @@ getSortedPlugins_fn = function(hookName) {
|
|
|
1573
4607
|
}
|
|
1574
4608
|
return plugins.filter((item) => item[hookName]);
|
|
1575
4609
|
}
|
|
1576
|
-
return plugins
|
|
4610
|
+
return plugins.map((plugin) => {
|
|
4611
|
+
if (plugin.pre) {
|
|
4612
|
+
const isValid = plugin.pre.every((pluginName2) => plugins.find((pluginToFind) => pluginToFind.name === pluginName2));
|
|
4613
|
+
if (!isValid) {
|
|
4614
|
+
throw new ValidationPluginError(`This plugin has a pre set that is not valid(${JSON.stringify(plugin.pre, void 0, 2)})`);
|
|
4615
|
+
}
|
|
4616
|
+
}
|
|
4617
|
+
return plugin;
|
|
4618
|
+
}).sort((a, b) => {
|
|
4619
|
+
if (b.pre?.includes(a.name)) {
|
|
4620
|
+
return 1;
|
|
4621
|
+
}
|
|
4622
|
+
if (b.post?.includes(a.name)) {
|
|
4623
|
+
return -1;
|
|
4624
|
+
}
|
|
4625
|
+
return 0;
|
|
4626
|
+
});
|
|
1577
4627
|
};
|
|
1578
4628
|
_addExecutedToCallStack = new WeakSet();
|
|
1579
4629
|
addExecutedToCallStack_fn = function(executer) {
|
|
1580
4630
|
if (executer) {
|
|
1581
|
-
this.
|
|
4631
|
+
this.events.emit("executed", executer);
|
|
1582
4632
|
this.executed.push(executer);
|
|
1583
4633
|
}
|
|
1584
4634
|
};
|
|
@@ -1594,7 +4644,7 @@ execute_fn = function({
|
|
|
1594
4644
|
if (!hook) {
|
|
1595
4645
|
return null;
|
|
1596
4646
|
}
|
|
1597
|
-
this.
|
|
4647
|
+
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
1598
4648
|
const task = Promise.resolve().then(() => {
|
|
1599
4649
|
if (typeof hook === "function") {
|
|
1600
4650
|
const possiblePromiseResult = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
|
|
@@ -1632,7 +4682,7 @@ executeSync_fn = function({
|
|
|
1632
4682
|
if (!hook) {
|
|
1633
4683
|
return null;
|
|
1634
4684
|
}
|
|
1635
|
-
this.
|
|
4685
|
+
this.events.emit("execute", { strategy, hookName, parameters, plugin });
|
|
1636
4686
|
try {
|
|
1637
4687
|
if (typeof hook === "function") {
|
|
1638
4688
|
const fn = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
|
|
@@ -1658,13 +4708,13 @@ catcher_fn = function(e, plugin, hookName) {
|
|
|
1658
4708
|
const text = `${e.message} (plugin: ${plugin?.name || "unknown"}, hook: ${hookName || "unknown"})
|
|
1659
4709
|
`;
|
|
1660
4710
|
this.logger.error(text);
|
|
1661
|
-
this.
|
|
4711
|
+
this.events.emit("error", e);
|
|
1662
4712
|
};
|
|
1663
4713
|
_parse = new WeakSet();
|
|
1664
4714
|
parse_fn = function(plugin, pluginManager, context) {
|
|
1665
4715
|
const usedPluginNames = __privateGet(pluginManager, _usedPluginNames);
|
|
1666
4716
|
setUniqueName(plugin.name, usedPluginNames);
|
|
1667
|
-
const key =
|
|
4717
|
+
const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
|
|
1668
4718
|
if (plugin.name !== "core" && usedPluginNames[plugin.name] >= 2) {
|
|
1669
4719
|
pluginManager.logger.warn("Using multiple of the same plugin is an experimental feature");
|
|
1670
4720
|
}
|
|
@@ -1700,7 +4750,7 @@ async function setup(options) {
|
|
|
1700
4750
|
} catch (e) {
|
|
1701
4751
|
if (isInputPath(config)) {
|
|
1702
4752
|
throw new Error(
|
|
1703
|
-
"Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " +
|
|
4753
|
+
"Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + pc2__default.default.dim(config.input.path),
|
|
1704
4754
|
{
|
|
1705
4755
|
cause: e
|
|
1706
4756
|
}
|
|
@@ -1752,8 +4802,8 @@ async function setup(options) {
|
|
|
1752
4802
|
if (logger.logLevel === LogLevel.info) {
|
|
1753
4803
|
logger.spinner.start(`\u{1F4BE} Writing`);
|
|
1754
4804
|
}
|
|
1755
|
-
if (logger.logLevel ===
|
|
1756
|
-
logger.info(`PluginKey ${
|
|
4805
|
+
if (logger.logLevel === LogLevel.debug) {
|
|
4806
|
+
logger.info(`PluginKey ${pc2__default.default.dim(JSON.stringify(plugin.key))}
|
|
1757
4807
|
with source
|
|
1758
4808
|
|
|
1759
4809
|
${code}`);
|
|
@@ -1766,7 +4816,7 @@ ${code}`);
|
|
|
1766
4816
|
if (logger.logLevel === LogLevel.info && logger.spinner) {
|
|
1767
4817
|
if (hookName === "writeFile") {
|
|
1768
4818
|
const [_code, path5] = parameters;
|
|
1769
|
-
logger.spinner.suffixText =
|
|
4819
|
+
logger.spinner.suffixText = pc2__default.default.dim(path5);
|
|
1770
4820
|
} else {
|
|
1771
4821
|
logger.spinner.suffixText = messsage;
|
|
1772
4822
|
}
|
|
@@ -1774,9 +4824,9 @@ ${code}`);
|
|
|
1774
4824
|
if (logger.logLevel === LogLevel.debug) {
|
|
1775
4825
|
logger.info(messsage);
|
|
1776
4826
|
const logs = [
|
|
1777
|
-
parameters && `${
|
|
4827
|
+
parameters && `${pc2__default.default.bgWhite(`Parameters`)} ${randomPicoColour(plugin.name)} ${hookName}`,
|
|
1778
4828
|
JSON.stringify(parameters, void 0, 2),
|
|
1779
|
-
output && `${
|
|
4829
|
+
output && `${pc2__default.default.bgWhite("Output")} ${randomPicoColour(plugin.name)} ${hookName}`,
|
|
1780
4830
|
output
|
|
1781
4831
|
].filter(Boolean);
|
|
1782
4832
|
console.log(logs.join("\n"));
|
|
@@ -1787,10 +4837,6 @@ ${code}`);
|
|
|
1787
4837
|
async function build(options) {
|
|
1788
4838
|
const pluginManager = await setup(options);
|
|
1789
4839
|
const { fileManager, logger } = pluginManager;
|
|
1790
|
-
await pluginManager.hookParallel({
|
|
1791
|
-
hookName: "validate",
|
|
1792
|
-
parameters: [pluginManager.plugins]
|
|
1793
|
-
});
|
|
1794
4840
|
await pluginManager.hookParallel({
|
|
1795
4841
|
hookName: "buildStart",
|
|
1796
4842
|
parameters: [options.config]
|
|
@@ -1806,10 +4852,6 @@ async function safeBuild(options) {
|
|
|
1806
4852
|
const pluginManager = await setup(options);
|
|
1807
4853
|
const { fileManager, logger } = pluginManager;
|
|
1808
4854
|
try {
|
|
1809
|
-
await pluginManager.hookParallel({
|
|
1810
|
-
hookName: "validate",
|
|
1811
|
-
parameters: [pluginManager.plugins]
|
|
1812
|
-
});
|
|
1813
4855
|
await pluginManager.hookParallel({
|
|
1814
4856
|
hookName: "buildStart",
|
|
1815
4857
|
parameters: [options.config]
|
|
@@ -1826,6 +4868,7 @@ async function safeBuild(options) {
|
|
|
1826
4868
|
}
|
|
1827
4869
|
|
|
1828
4870
|
// src/Generator.ts
|
|
4871
|
+
init_cjs_shims();
|
|
1829
4872
|
var _options3, _context;
|
|
1830
4873
|
var Generator = class {
|
|
1831
4874
|
constructor(options, context) {
|
|
@@ -1852,7 +4895,23 @@ var Generator = class {
|
|
|
1852
4895
|
_options3 = new WeakMap();
|
|
1853
4896
|
_context = new WeakMap();
|
|
1854
4897
|
|
|
4898
|
+
// src/PackageManager.ts
|
|
4899
|
+
init_cjs_shims();
|
|
4900
|
+
|
|
4901
|
+
// ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
|
|
4902
|
+
init_cjs_shims();
|
|
4903
|
+
|
|
4904
|
+
// ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
4905
|
+
init_cjs_shims();
|
|
4906
|
+
|
|
4907
|
+
// ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
|
|
4908
|
+
init_cjs_shims();
|
|
4909
|
+
|
|
4910
|
+
// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
|
|
4911
|
+
init_cjs_shims();
|
|
4912
|
+
|
|
1855
4913
|
// ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
|
|
4914
|
+
init_cjs_shims();
|
|
1856
4915
|
var Node = class {
|
|
1857
4916
|
constructor(value) {
|
|
1858
4917
|
__publicField(this, "value");
|
|
@@ -1921,18 +4980,18 @@ function pLimit(concurrency) {
|
|
|
1921
4980
|
queue.dequeue()();
|
|
1922
4981
|
}
|
|
1923
4982
|
};
|
|
1924
|
-
const run = async (fn,
|
|
4983
|
+
const run = async (fn, resolve3, args) => {
|
|
1925
4984
|
activeCount++;
|
|
1926
4985
|
const result = (async () => fn(...args))();
|
|
1927
|
-
|
|
4986
|
+
resolve3(result);
|
|
1928
4987
|
try {
|
|
1929
4988
|
await result;
|
|
1930
4989
|
} catch {
|
|
1931
4990
|
}
|
|
1932
4991
|
next();
|
|
1933
4992
|
};
|
|
1934
|
-
const enqueue = (fn,
|
|
1935
|
-
queue.enqueue(run.bind(void 0, fn,
|
|
4993
|
+
const enqueue = (fn, resolve3, args) => {
|
|
4994
|
+
queue.enqueue(run.bind(void 0, fn, resolve3, args));
|
|
1936
4995
|
(async () => {
|
|
1937
4996
|
await Promise.resolve();
|
|
1938
4997
|
if (activeCount < concurrency && queue.size > 0) {
|
|
@@ -1940,8 +4999,8 @@ function pLimit(concurrency) {
|
|
|
1940
4999
|
}
|
|
1941
5000
|
})();
|
|
1942
5001
|
};
|
|
1943
|
-
const generator = (fn, ...args) => new Promise((
|
|
1944
|
-
enqueue(fn,
|
|
5002
|
+
const generator = (fn, ...args) => new Promise((resolve3) => {
|
|
5003
|
+
enqueue(fn, resolve3, args);
|
|
1945
5004
|
});
|
|
1946
5005
|
Object.defineProperties(generator, {
|
|
1947
5006
|
activeCount: {
|
|
@@ -2005,7 +5064,7 @@ function checkType(type) {
|
|
|
2005
5064
|
var matchType = (type, stat) => stat[typeMappings[type]]();
|
|
2006
5065
|
var toPath = (urlOrPath) => urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
2007
5066
|
async function locatePath(paths, {
|
|
2008
|
-
cwd =
|
|
5067
|
+
cwd = process2__default.default.cwd(),
|
|
2009
5068
|
type = "file",
|
|
2010
5069
|
allowSymlinks = true,
|
|
2011
5070
|
concurrency,
|
|
@@ -2024,7 +5083,7 @@ async function locatePath(paths, {
|
|
|
2024
5083
|
}, { concurrency, preserveOrder });
|
|
2025
5084
|
}
|
|
2026
5085
|
function locatePathSync(paths, {
|
|
2027
|
-
cwd =
|
|
5086
|
+
cwd = process2__default.default.cwd(),
|
|
2028
5087
|
type = "file",
|
|
2029
5088
|
allowSymlinks = true
|
|
2030
5089
|
} = {}) {
|
|
@@ -2047,6 +5106,9 @@ function locatePathSync(paths, {
|
|
|
2047
5106
|
}
|
|
2048
5107
|
}
|
|
2049
5108
|
|
|
5109
|
+
// ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
|
|
5110
|
+
init_cjs_shims();
|
|
5111
|
+
|
|
2050
5112
|
// ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
|
|
2051
5113
|
var toPath2 = (urlOrPath) => urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
2052
5114
|
var findUpStop = Symbol("findUpStop");
|
|
@@ -2251,10 +5313,6 @@ match_fn = function(packageJSON, dependency) {
|
|
|
2251
5313
|
__privateAdd(_PackageManager, _cache2, {});
|
|
2252
5314
|
var PackageManager = _PackageManager;
|
|
2253
5315
|
|
|
2254
|
-
// src/SchemaGenerator.ts
|
|
2255
|
-
var SchemaGenerator = class extends Generator {
|
|
2256
|
-
};
|
|
2257
|
-
|
|
2258
5316
|
// src/index.ts
|
|
2259
5317
|
var src_default = build;
|
|
2260
5318
|
|
|
@@ -2263,12 +5321,8 @@ exports.Generator = Generator;
|
|
|
2263
5321
|
exports.PackageManager = PackageManager;
|
|
2264
5322
|
exports.PluginManager = PluginManager;
|
|
2265
5323
|
exports.PromiseManager = PromiseManager;
|
|
2266
|
-
exports.SchemaGenerator = SchemaGenerator;
|
|
2267
|
-
exports.ValidationPluginError = ValidationPluginError;
|
|
2268
5324
|
exports.Warning = Warning;
|
|
2269
5325
|
exports.build = build;
|
|
2270
|
-
exports.combineExports = combineExports;
|
|
2271
|
-
exports.combineImports = combineImports;
|
|
2272
5326
|
exports.createPlugin = createPlugin;
|
|
2273
5327
|
exports.default = src_default;
|
|
2274
5328
|
exports.defineConfig = defineConfig;
|