@modern-js/repo-generator 0.0.0-next-20240307035738 → 0.0.0-next-20240313070132
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/index.js +1685 -1742
- package/package.json +13 -13
- package/src/index.ts +2 -11
package/dist/index.js
CHANGED
|
@@ -18187,9 +18187,9 @@ var require_src3 = __commonJS({
|
|
|
18187
18187
|
}
|
|
18188
18188
|
});
|
|
18189
18189
|
|
|
18190
|
-
// ../../../../node_modules/.pnpm/follow-redirects@1.15.
|
|
18190
|
+
// ../../../../node_modules/.pnpm/follow-redirects@1.15.5/node_modules/follow-redirects/debug.js
|
|
18191
18191
|
var require_debug = __commonJS({
|
|
18192
|
-
"../../../../node_modules/.pnpm/follow-redirects@1.15.
|
|
18192
|
+
"../../../../node_modules/.pnpm/follow-redirects@1.15.5/node_modules/follow-redirects/debug.js"(exports, module2) {
|
|
18193
18193
|
"use strict";
|
|
18194
18194
|
var debug;
|
|
18195
18195
|
module2.exports = function() {
|
|
@@ -18208,9 +18208,9 @@ var require_debug = __commonJS({
|
|
|
18208
18208
|
}
|
|
18209
18209
|
});
|
|
18210
18210
|
|
|
18211
|
-
// ../../../../node_modules/.pnpm/follow-redirects@1.15.
|
|
18211
|
+
// ../../../../node_modules/.pnpm/follow-redirects@1.15.5/node_modules/follow-redirects/index.js
|
|
18212
18212
|
var require_follow_redirects = __commonJS({
|
|
18213
|
-
"../../../../node_modules/.pnpm/follow-redirects@1.15.
|
|
18213
|
+
"../../../../node_modules/.pnpm/follow-redirects@1.15.5/node_modules/follow-redirects/index.js"(exports, module2) {
|
|
18214
18214
|
"use strict";
|
|
18215
18215
|
var url2 = require("url");
|
|
18216
18216
|
var URL2 = url2.URL;
|
|
@@ -18219,6 +18219,25 @@ var require_follow_redirects = __commonJS({
|
|
|
18219
18219
|
var Writable = require("stream").Writable;
|
|
18220
18220
|
var assert = require("assert");
|
|
18221
18221
|
var debug = require_debug();
|
|
18222
|
+
var useNativeURL = false;
|
|
18223
|
+
try {
|
|
18224
|
+
assert(new URL2());
|
|
18225
|
+
} catch (error) {
|
|
18226
|
+
useNativeURL = error.code === "ERR_INVALID_URL";
|
|
18227
|
+
}
|
|
18228
|
+
var preservedUrlFields = [
|
|
18229
|
+
"auth",
|
|
18230
|
+
"host",
|
|
18231
|
+
"hostname",
|
|
18232
|
+
"href",
|
|
18233
|
+
"path",
|
|
18234
|
+
"pathname",
|
|
18235
|
+
"port",
|
|
18236
|
+
"protocol",
|
|
18237
|
+
"query",
|
|
18238
|
+
"search",
|
|
18239
|
+
"hash"
|
|
18240
|
+
];
|
|
18222
18241
|
var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
|
|
18223
18242
|
var eventHandlers = /* @__PURE__ */ Object.create(null);
|
|
18224
18243
|
events.forEach(function(event) {
|
|
@@ -18226,13 +18245,19 @@ var require_follow_redirects = __commonJS({
|
|
|
18226
18245
|
this._redirectable.emit(event, arg1, arg2, arg3);
|
|
18227
18246
|
};
|
|
18228
18247
|
});
|
|
18248
|
+
var InvalidUrlError = createErrorType(
|
|
18249
|
+
"ERR_INVALID_URL",
|
|
18250
|
+
"Invalid URL",
|
|
18251
|
+
TypeError
|
|
18252
|
+
);
|
|
18229
18253
|
var RedirectionError = createErrorType(
|
|
18230
18254
|
"ERR_FR_REDIRECTION_FAILURE",
|
|
18231
18255
|
"Redirected request failed"
|
|
18232
18256
|
);
|
|
18233
18257
|
var TooManyRedirectsError = createErrorType(
|
|
18234
18258
|
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
18235
|
-
"Maximum number of redirects exceeded"
|
|
18259
|
+
"Maximum number of redirects exceeded",
|
|
18260
|
+
RedirectionError
|
|
18236
18261
|
);
|
|
18237
18262
|
var MaxBodyLengthExceededError = createErrorType(
|
|
18238
18263
|
"ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
|
|
@@ -18242,6 +18267,7 @@ var require_follow_redirects = __commonJS({
|
|
|
18242
18267
|
"ERR_STREAM_WRITE_AFTER_END",
|
|
18243
18268
|
"write after end"
|
|
18244
18269
|
);
|
|
18270
|
+
var destroy2 = Writable.prototype.destroy || noop2;
|
|
18245
18271
|
function RedirectableRequest(options, responseCallback) {
|
|
18246
18272
|
Writable.call(this);
|
|
18247
18273
|
this._sanitizeOptions(options);
|
|
@@ -18257,23 +18283,33 @@ var require_follow_redirects = __commonJS({
|
|
|
18257
18283
|
}
|
|
18258
18284
|
var self3 = this;
|
|
18259
18285
|
this._onNativeResponse = function(response) {
|
|
18260
|
-
|
|
18286
|
+
try {
|
|
18287
|
+
self3._processResponse(response);
|
|
18288
|
+
} catch (cause) {
|
|
18289
|
+
self3.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
|
|
18290
|
+
}
|
|
18261
18291
|
};
|
|
18262
18292
|
this._performRequest();
|
|
18263
18293
|
}
|
|
18264
18294
|
RedirectableRequest.prototype = Object.create(Writable.prototype);
|
|
18265
18295
|
RedirectableRequest.prototype.abort = function() {
|
|
18266
|
-
|
|
18296
|
+
destroyRequest(this._currentRequest);
|
|
18297
|
+
this._currentRequest.abort();
|
|
18267
18298
|
this.emit("abort");
|
|
18268
18299
|
};
|
|
18300
|
+
RedirectableRequest.prototype.destroy = function(error) {
|
|
18301
|
+
destroyRequest(this._currentRequest, error);
|
|
18302
|
+
destroy2.call(this, error);
|
|
18303
|
+
return this;
|
|
18304
|
+
};
|
|
18269
18305
|
RedirectableRequest.prototype.write = function(data, encoding, callback) {
|
|
18270
18306
|
if (this._ending) {
|
|
18271
18307
|
throw new WriteAfterEndError();
|
|
18272
18308
|
}
|
|
18273
|
-
if (!(
|
|
18309
|
+
if (!isString5(data) && !isBuffer2(data)) {
|
|
18274
18310
|
throw new TypeError("data should be a string, Buffer or Uint8Array");
|
|
18275
18311
|
}
|
|
18276
|
-
if (
|
|
18312
|
+
if (isFunction5(encoding)) {
|
|
18277
18313
|
callback = encoding;
|
|
18278
18314
|
encoding = null;
|
|
18279
18315
|
}
|
|
@@ -18293,10 +18329,10 @@ var require_follow_redirects = __commonJS({
|
|
|
18293
18329
|
}
|
|
18294
18330
|
};
|
|
18295
18331
|
RedirectableRequest.prototype.end = function(data, encoding, callback) {
|
|
18296
|
-
if (
|
|
18332
|
+
if (isFunction5(data)) {
|
|
18297
18333
|
callback = data;
|
|
18298
18334
|
data = encoding = null;
|
|
18299
|
-
} else if (
|
|
18335
|
+
} else if (isFunction5(encoding)) {
|
|
18300
18336
|
callback = encoding;
|
|
18301
18337
|
encoding = null;
|
|
18302
18338
|
}
|
|
@@ -18346,6 +18382,7 @@ var require_follow_redirects = __commonJS({
|
|
|
18346
18382
|
self3.removeListener("abort", clearTimer);
|
|
18347
18383
|
self3.removeListener("error", clearTimer);
|
|
18348
18384
|
self3.removeListener("response", clearTimer);
|
|
18385
|
+
self3.removeListener("close", clearTimer);
|
|
18349
18386
|
if (callback) {
|
|
18350
18387
|
self3.removeListener("timeout", callback);
|
|
18351
18388
|
}
|
|
@@ -18365,6 +18402,7 @@ var require_follow_redirects = __commonJS({
|
|
|
18365
18402
|
this.on("abort", clearTimer);
|
|
18366
18403
|
this.on("error", clearTimer);
|
|
18367
18404
|
this.on("response", clearTimer);
|
|
18405
|
+
this.on("close", clearTimer);
|
|
18368
18406
|
return this;
|
|
18369
18407
|
};
|
|
18370
18408
|
[
|
|
@@ -18408,8 +18446,7 @@ var require_follow_redirects = __commonJS({
|
|
|
18408
18446
|
var protocol = this._options.protocol;
|
|
18409
18447
|
var nativeProtocol = this._options.nativeProtocols[protocol];
|
|
18410
18448
|
if (!nativeProtocol) {
|
|
18411
|
-
|
|
18412
|
-
return;
|
|
18449
|
+
throw new TypeError("Unsupported protocol " + protocol);
|
|
18413
18450
|
}
|
|
18414
18451
|
if (this._options.agents) {
|
|
18415
18452
|
var scheme = protocol.slice(0, -1);
|
|
@@ -18423,7 +18460,7 @@ var require_follow_redirects = __commonJS({
|
|
|
18423
18460
|
this._currentUrl = /^\//.test(this._options.path) ? url2.format(this._options) : (
|
|
18424
18461
|
// When making a request to a proxy, […]
|
|
18425
18462
|
// a client MUST send the target URI in absolute-form […].
|
|
18426
|
-
this.
|
|
18463
|
+
this._options.path
|
|
18427
18464
|
);
|
|
18428
18465
|
if (this._isRedirect) {
|
|
18429
18466
|
var i = 0;
|
|
@@ -18462,11 +18499,10 @@ var require_follow_redirects = __commonJS({
|
|
|
18462
18499
|
this._requestBodyBuffers = [];
|
|
18463
18500
|
return;
|
|
18464
18501
|
}
|
|
18465
|
-
|
|
18502
|
+
destroyRequest(this._currentRequest);
|
|
18466
18503
|
response.destroy();
|
|
18467
18504
|
if (++this._redirectCount > this._options.maxRedirects) {
|
|
18468
|
-
|
|
18469
|
-
return;
|
|
18505
|
+
throw new TooManyRedirectsError();
|
|
18470
18506
|
}
|
|
18471
18507
|
var requestHeaders;
|
|
18472
18508
|
var beforeRedirect = this._options.beforeRedirect;
|
|
@@ -18487,24 +18523,17 @@ var require_follow_redirects = __commonJS({
|
|
|
18487
18523
|
removeMatchingHeaders(/^content-/i, this._options.headers);
|
|
18488
18524
|
}
|
|
18489
18525
|
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
|
18490
|
-
var currentUrlParts =
|
|
18526
|
+
var currentUrlParts = parseUrl(this._currentUrl);
|
|
18491
18527
|
var currentHost = currentHostHeader || currentUrlParts.host;
|
|
18492
18528
|
var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url2.format(Object.assign(currentUrlParts, { host: currentHost }));
|
|
18493
|
-
var redirectUrl;
|
|
18494
|
-
|
|
18495
|
-
redirectUrl = url2.resolve(currentUrl, location);
|
|
18496
|
-
} catch (cause) {
|
|
18497
|
-
this.emit("error", new RedirectionError(cause));
|
|
18498
|
-
return;
|
|
18499
|
-
}
|
|
18500
|
-
debug("redirecting to", redirectUrl);
|
|
18529
|
+
var redirectUrl = resolveUrl(location, currentUrl);
|
|
18530
|
+
debug("redirecting to", redirectUrl.href);
|
|
18501
18531
|
this._isRedirect = true;
|
|
18502
|
-
|
|
18503
|
-
|
|
18504
|
-
if (redirectUrlParts.protocol !== currentUrlParts.protocol && redirectUrlParts.protocol !== "https:" || redirectUrlParts.host !== currentHost && !isSubdomain(redirectUrlParts.host, currentHost)) {
|
|
18532
|
+
spreadUrlObject(redirectUrl, this._options);
|
|
18533
|
+
if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
|
|
18505
18534
|
removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
|
|
18506
18535
|
}
|
|
18507
|
-
if (
|
|
18536
|
+
if (isFunction5(beforeRedirect)) {
|
|
18508
18537
|
var responseDetails = {
|
|
18509
18538
|
headers: response.headers,
|
|
18510
18539
|
statusCode
|
|
@@ -18514,19 +18543,10 @@ var require_follow_redirects = __commonJS({
|
|
|
18514
18543
|
method,
|
|
18515
18544
|
headers: requestHeaders
|
|
18516
18545
|
};
|
|
18517
|
-
|
|
18518
|
-
beforeRedirect(this._options, responseDetails, requestDetails);
|
|
18519
|
-
} catch (err) {
|
|
18520
|
-
this.emit("error", err);
|
|
18521
|
-
return;
|
|
18522
|
-
}
|
|
18546
|
+
beforeRedirect(this._options, responseDetails, requestDetails);
|
|
18523
18547
|
this._sanitizeOptions(this._options);
|
|
18524
18548
|
}
|
|
18525
|
-
|
|
18526
|
-
this._performRequest();
|
|
18527
|
-
} catch (cause) {
|
|
18528
|
-
this.emit("error", new RedirectionError(cause));
|
|
18529
|
-
}
|
|
18549
|
+
this._performRequest();
|
|
18530
18550
|
};
|
|
18531
18551
|
function wrap(protocols) {
|
|
18532
18552
|
var exports2 = {
|
|
@@ -18539,21 +18559,16 @@ var require_follow_redirects = __commonJS({
|
|
|
18539
18559
|
var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
|
|
18540
18560
|
var wrappedProtocol = exports2[scheme] = Object.create(nativeProtocol);
|
|
18541
18561
|
function request(input, options, callback) {
|
|
18542
|
-
if (
|
|
18543
|
-
|
|
18544
|
-
|
|
18545
|
-
|
|
18546
|
-
} catch (err) {
|
|
18547
|
-
input = url2.parse(urlStr);
|
|
18548
|
-
}
|
|
18549
|
-
} else if (URL2 && input instanceof URL2) {
|
|
18550
|
-
input = urlToOptions(input);
|
|
18562
|
+
if (isURL(input)) {
|
|
18563
|
+
input = spreadUrlObject(input);
|
|
18564
|
+
} else if (isString5(input)) {
|
|
18565
|
+
input = spreadUrlObject(parseUrl(input));
|
|
18551
18566
|
} else {
|
|
18552
18567
|
callback = options;
|
|
18553
|
-
options = input;
|
|
18568
|
+
options = validateUrl(input);
|
|
18554
18569
|
input = { protocol };
|
|
18555
18570
|
}
|
|
18556
|
-
if (
|
|
18571
|
+
if (isFunction5(options)) {
|
|
18557
18572
|
callback = options;
|
|
18558
18573
|
options = null;
|
|
18559
18574
|
}
|
|
@@ -18562,6 +18577,9 @@ var require_follow_redirects = __commonJS({
|
|
|
18562
18577
|
maxBodyLength: exports2.maxBodyLength
|
|
18563
18578
|
}, input, options);
|
|
18564
18579
|
options.nativeProtocols = nativeProtocols;
|
|
18580
|
+
if (!isString5(options.host) && !isString5(options.hostname)) {
|
|
18581
|
+
options.hostname = "::1";
|
|
18582
|
+
}
|
|
18565
18583
|
assert.equal(options.protocol, protocol, "protocol mismatch");
|
|
18566
18584
|
debug("options", options);
|
|
18567
18585
|
return new RedirectableRequest(options, callback);
|
|
@@ -18580,23 +18598,43 @@ var require_follow_redirects = __commonJS({
|
|
|
18580
18598
|
}
|
|
18581
18599
|
function noop2() {
|
|
18582
18600
|
}
|
|
18583
|
-
function
|
|
18584
|
-
var
|
|
18585
|
-
|
|
18586
|
-
|
|
18587
|
-
|
|
18588
|
-
|
|
18589
|
-
)
|
|
18590
|
-
|
|
18591
|
-
|
|
18592
|
-
pathname: urlObject.pathname,
|
|
18593
|
-
path: urlObject.pathname + urlObject.search,
|
|
18594
|
-
href: urlObject.href
|
|
18595
|
-
};
|
|
18596
|
-
if (urlObject.port !== "") {
|
|
18597
|
-
options.port = Number(urlObject.port);
|
|
18601
|
+
function parseUrl(input) {
|
|
18602
|
+
var parsed;
|
|
18603
|
+
if (useNativeURL) {
|
|
18604
|
+
parsed = new URL2(input);
|
|
18605
|
+
} else {
|
|
18606
|
+
parsed = validateUrl(url2.parse(input));
|
|
18607
|
+
if (!isString5(parsed.protocol)) {
|
|
18608
|
+
throw new InvalidUrlError({ input });
|
|
18609
|
+
}
|
|
18598
18610
|
}
|
|
18599
|
-
return
|
|
18611
|
+
return parsed;
|
|
18612
|
+
}
|
|
18613
|
+
function resolveUrl(relative, base) {
|
|
18614
|
+
return useNativeURL ? new URL2(relative, base) : parseUrl(url2.resolve(base, relative));
|
|
18615
|
+
}
|
|
18616
|
+
function validateUrl(input) {
|
|
18617
|
+
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
18618
|
+
throw new InvalidUrlError({ input: input.href || input });
|
|
18619
|
+
}
|
|
18620
|
+
if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
|
|
18621
|
+
throw new InvalidUrlError({ input: input.href || input });
|
|
18622
|
+
}
|
|
18623
|
+
return input;
|
|
18624
|
+
}
|
|
18625
|
+
function spreadUrlObject(urlObject, target) {
|
|
18626
|
+
var spread3 = target || {};
|
|
18627
|
+
for (var key of preservedUrlFields) {
|
|
18628
|
+
spread3[key] = urlObject[key];
|
|
18629
|
+
}
|
|
18630
|
+
if (spread3.hostname.startsWith("[")) {
|
|
18631
|
+
spread3.hostname = spread3.hostname.slice(1, -1);
|
|
18632
|
+
}
|
|
18633
|
+
if (spread3.port !== "") {
|
|
18634
|
+
spread3.port = Number(spread3.port);
|
|
18635
|
+
}
|
|
18636
|
+
spread3.path = spread3.search ? spread3.pathname + spread3.search : spread3.pathname;
|
|
18637
|
+
return spread3;
|
|
18600
18638
|
}
|
|
18601
18639
|
function removeMatchingHeaders(regex2, headers) {
|
|
18602
18640
|
var lastValue;
|
|
@@ -18608,33 +18646,50 @@ var require_follow_redirects = __commonJS({
|
|
|
18608
18646
|
}
|
|
18609
18647
|
return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim();
|
|
18610
18648
|
}
|
|
18611
|
-
function createErrorType(code,
|
|
18612
|
-
function CustomError(
|
|
18649
|
+
function createErrorType(code, message, baseClass) {
|
|
18650
|
+
function CustomError(properties) {
|
|
18613
18651
|
Error.captureStackTrace(this, this.constructor);
|
|
18614
|
-
|
|
18615
|
-
|
|
18616
|
-
|
|
18617
|
-
this.message = defaultMessage + ": " + cause.message;
|
|
18618
|
-
this.cause = cause;
|
|
18619
|
-
}
|
|
18652
|
+
Object.assign(this, properties || {});
|
|
18653
|
+
this.code = code;
|
|
18654
|
+
this.message = this.cause ? message + ": " + this.cause.message : message;
|
|
18620
18655
|
}
|
|
18621
|
-
CustomError.prototype = new Error();
|
|
18622
|
-
CustomError.prototype
|
|
18623
|
-
|
|
18624
|
-
|
|
18656
|
+
CustomError.prototype = new (baseClass || Error)();
|
|
18657
|
+
Object.defineProperties(CustomError.prototype, {
|
|
18658
|
+
constructor: {
|
|
18659
|
+
value: CustomError,
|
|
18660
|
+
enumerable: false
|
|
18661
|
+
},
|
|
18662
|
+
name: {
|
|
18663
|
+
value: "Error [" + code + "]",
|
|
18664
|
+
enumerable: false
|
|
18665
|
+
}
|
|
18666
|
+
});
|
|
18625
18667
|
return CustomError;
|
|
18626
18668
|
}
|
|
18627
|
-
function
|
|
18669
|
+
function destroyRequest(request, error) {
|
|
18628
18670
|
for (var event of events) {
|
|
18629
18671
|
request.removeListener(event, eventHandlers[event]);
|
|
18630
18672
|
}
|
|
18631
18673
|
request.on("error", noop2);
|
|
18632
|
-
request.
|
|
18674
|
+
request.destroy(error);
|
|
18633
18675
|
}
|
|
18634
18676
|
function isSubdomain(subdomain, domain) {
|
|
18635
|
-
|
|
18677
|
+
assert(isString5(subdomain) && isString5(domain));
|
|
18678
|
+
var dot = subdomain.length - domain.length - 1;
|
|
18636
18679
|
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
|
|
18637
18680
|
}
|
|
18681
|
+
function isString5(value) {
|
|
18682
|
+
return typeof value === "string" || value instanceof String;
|
|
18683
|
+
}
|
|
18684
|
+
function isFunction5(value) {
|
|
18685
|
+
return typeof value === "function";
|
|
18686
|
+
}
|
|
18687
|
+
function isBuffer2(value) {
|
|
18688
|
+
return typeof value === "object" && "length" in value;
|
|
18689
|
+
}
|
|
18690
|
+
function isURL(value) {
|
|
18691
|
+
return URL2 && value instanceof URL2;
|
|
18692
|
+
}
|
|
18638
18693
|
module2.exports = wrap({ http: http2, https: https2 });
|
|
18639
18694
|
module2.exports.wrap = wrap;
|
|
18640
18695
|
}
|
|
@@ -28508,7 +28563,7 @@ var require_binary_search = __commonJS({
|
|
|
28508
28563
|
var require_quick_sort = __commonJS({
|
|
28509
28564
|
"../../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js"(exports) {
|
|
28510
28565
|
"use strict";
|
|
28511
|
-
function
|
|
28566
|
+
function swap2(ary, x, y) {
|
|
28512
28567
|
var temp = ary[x];
|
|
28513
28568
|
ary[x] = ary[y];
|
|
28514
28569
|
ary[y] = temp;
|
|
@@ -28520,15 +28575,15 @@ var require_quick_sort = __commonJS({
|
|
|
28520
28575
|
if (p < r) {
|
|
28521
28576
|
var pivotIndex = randomIntInRange(p, r);
|
|
28522
28577
|
var i = p - 1;
|
|
28523
|
-
|
|
28578
|
+
swap2(ary, pivotIndex, r);
|
|
28524
28579
|
var pivot = ary[r];
|
|
28525
28580
|
for (var j = p; j < r; j++) {
|
|
28526
28581
|
if (comparator(ary[j], pivot) <= 0) {
|
|
28527
28582
|
i += 1;
|
|
28528
|
-
|
|
28583
|
+
swap2(ary, i, j);
|
|
28529
28584
|
}
|
|
28530
28585
|
}
|
|
28531
|
-
|
|
28586
|
+
swap2(ary, i + 1, j);
|
|
28532
28587
|
var q = i + 1;
|
|
28533
28588
|
doQuickSort(ary, comparator, p, q - 1);
|
|
28534
28589
|
doQuickSort(ary, comparator, q + 1, r);
|
|
@@ -31404,9 +31459,9 @@ var require_ejs = __commonJS({
|
|
|
31404
31459
|
}
|
|
31405
31460
|
});
|
|
31406
31461
|
|
|
31407
|
-
// ../../../../node_modules/.pnpm/@modern-js+utils@2.
|
|
31462
|
+
// ../../../../node_modules/.pnpm/@modern-js+utils@2.39.2/node_modules/@modern-js/utils/dist/compiled/chalk/index.js
|
|
31408
31463
|
var require_chalk = __commonJS({
|
|
31409
|
-
"../../../../node_modules/.pnpm/@modern-js+utils@2.
|
|
31464
|
+
"../../../../node_modules/.pnpm/@modern-js+utils@2.39.2/node_modules/@modern-js/utils/dist/compiled/chalk/index.js"(exports, module2) {
|
|
31410
31465
|
"use strict";
|
|
31411
31466
|
(() => {
|
|
31412
31467
|
var e = { 44: (e2, t2, n2) => {
|
|
@@ -64208,10 +64263,10 @@ var require_extend_node = __commonJS({
|
|
|
64208
64263
|
length = void 0;
|
|
64209
64264
|
}
|
|
64210
64265
|
} else {
|
|
64211
|
-
var
|
|
64266
|
+
var swap2 = encoding;
|
|
64212
64267
|
encoding = offset;
|
|
64213
64268
|
offset = length;
|
|
64214
|
-
length =
|
|
64269
|
+
length = swap2;
|
|
64215
64270
|
}
|
|
64216
64271
|
offset = +offset || 0;
|
|
64217
64272
|
var remaining = this.length - offset;
|
|
@@ -64265,10 +64320,10 @@ var require_extend_node = __commonJS({
|
|
|
64265
64320
|
length = void 0;
|
|
64266
64321
|
}
|
|
64267
64322
|
} else {
|
|
64268
|
-
var
|
|
64323
|
+
var swap2 = encoding;
|
|
64269
64324
|
encoding = offset;
|
|
64270
64325
|
offset = length;
|
|
64271
|
-
length =
|
|
64326
|
+
length = swap2;
|
|
64272
64327
|
}
|
|
64273
64328
|
encoding = String(encoding || "utf8").toLowerCase();
|
|
64274
64329
|
if (Buffer2.isNativeEncoding(encoding))
|
|
@@ -68789,7 +68844,6 @@ __export(src_exports, {
|
|
|
68789
68844
|
default: () => src_default
|
|
68790
68845
|
});
|
|
68791
68846
|
module.exports = __toCommonJS(src_exports);
|
|
68792
|
-
var import_path18 = __toESM(require("path"));
|
|
68793
68847
|
var import_lodash15 = require("@modern-js/utils/lodash");
|
|
68794
68848
|
|
|
68795
68849
|
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/esm/_define_property.js
|
|
@@ -68801,12 +68855,12 @@ function _define_property(obj, key, value) {
|
|
|
68801
68855
|
return obj;
|
|
68802
68856
|
}
|
|
68803
68857
|
|
|
68804
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
68858
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
|
|
68805
68859
|
var import_utils46 = require("@modern-js/utils");
|
|
68806
68860
|
var import_lodash6 = require("@modern-js/utils/lodash");
|
|
68807
68861
|
var import_comment_json = __toESM(require_src2());
|
|
68808
68862
|
|
|
68809
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.
|
|
68863
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.5/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
|
|
68810
68864
|
var import_utils = require("@modern-js/utils");
|
|
68811
68865
|
async function canUseNvm() {
|
|
68812
68866
|
try {
|
|
@@ -68856,7 +68910,7 @@ async function canUsePnpm() {
|
|
|
68856
68910
|
}
|
|
68857
68911
|
}
|
|
68858
68912
|
|
|
68859
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.
|
|
68913
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.5/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
|
|
68860
68914
|
var import_utils2 = require("@modern-js/utils");
|
|
68861
68915
|
function execaWithStreamLog(command, args, options) {
|
|
68862
68916
|
const promise = (0, import_utils2.execa)(command, args, {
|
|
@@ -68952,7 +69006,7 @@ async function pnpmInstall({ cwd, registryUrl, ignoreScripts, useNvm }) {
|
|
|
68952
69006
|
throw new Error("please install pnpm first");
|
|
68953
69007
|
}
|
|
68954
69008
|
|
|
68955
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.
|
|
69009
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.5/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
|
|
68956
69010
|
var NpmAPI = class {
|
|
68957
69011
|
npmInstall({ cwd, registryUrl, ignoreScripts }) {
|
|
68958
69012
|
return npmInstall({
|
|
@@ -68981,7 +69035,7 @@ var NpmAPI = class {
|
|
|
68981
69035
|
}
|
|
68982
69036
|
};
|
|
68983
69037
|
|
|
68984
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.
|
|
69038
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-git/dist/esm-node/utils/index.js
|
|
68985
69039
|
var import_utils4 = require("@modern-js/utils");
|
|
68986
69040
|
async function canUseGit() {
|
|
68987
69041
|
try {
|
|
@@ -69056,7 +69110,7 @@ async function gitCommit(cwd, commitMessage) {
|
|
|
69056
69110
|
});
|
|
69057
69111
|
}
|
|
69058
69112
|
|
|
69059
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.
|
|
69113
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-git/dist/esm-node/index.js
|
|
69060
69114
|
var GitAPI = class {
|
|
69061
69115
|
async isInGitRepo(cwd = this.generatorCore.outputPath) {
|
|
69062
69116
|
const canUse = await canUseGit();
|
|
@@ -69108,7 +69162,7 @@ var GitAPI = class {
|
|
|
69108
69162
|
}
|
|
69109
69163
|
};
|
|
69110
69164
|
|
|
69111
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69165
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/logger/constants.js
|
|
69112
69166
|
var LoggerLevel;
|
|
69113
69167
|
(function(LoggerLevel2) {
|
|
69114
69168
|
LoggerLevel2["Error"] = "error";
|
|
@@ -69129,7 +69183,7 @@ var LevelPriority = [
|
|
|
69129
69183
|
LoggerLevel.Stream
|
|
69130
69184
|
];
|
|
69131
69185
|
|
|
69132
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69186
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/logger/index.js
|
|
69133
69187
|
var import_utils6 = require("@modern-js/utils");
|
|
69134
69188
|
var Logger = class {
|
|
69135
69189
|
get currentLevelIndex() {
|
|
@@ -69190,23 +69244,23 @@ var Logger = class {
|
|
|
69190
69244
|
}
|
|
69191
69245
|
};
|
|
69192
69246
|
|
|
69193
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69247
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/codesmith/index.js
|
|
69194
69248
|
var import_path7 = __toESM(require("path"));
|
|
69195
69249
|
|
|
69196
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69250
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/generator/index.js
|
|
69197
69251
|
var import_path4 = __toESM(require("path"));
|
|
69198
69252
|
var import_events = require("events");
|
|
69199
69253
|
var import_utils11 = require("@modern-js/utils");
|
|
69200
69254
|
|
|
69201
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69255
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsMaterial.js
|
|
69202
69256
|
var import_path2 = __toESM(require("path"));
|
|
69203
69257
|
var import_utils8 = require("@modern-js/utils");
|
|
69204
69258
|
|
|
69205
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69259
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
|
|
69206
69260
|
var import_path = __toESM(require("path"));
|
|
69207
69261
|
var import_utils7 = require("@modern-js/utils");
|
|
69208
69262
|
|
|
69209
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69263
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/constants.js
|
|
69210
69264
|
var IMAGE_EXT_LIST = [
|
|
69211
69265
|
".jpg",
|
|
69212
69266
|
".jpeg",
|
|
@@ -69220,7 +69274,7 @@ var IMAGE_EXT_LIST = [
|
|
|
69220
69274
|
".wmf"
|
|
69221
69275
|
];
|
|
69222
69276
|
|
|
69223
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69277
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
|
|
69224
69278
|
var FS_RESOURCE = "_codesmith_core_fs_resource";
|
|
69225
69279
|
var FsResource = class {
|
|
69226
69280
|
async value() {
|
|
@@ -69246,7 +69300,7 @@ var FsResource = class {
|
|
|
69246
69300
|
}
|
|
69247
69301
|
};
|
|
69248
69302
|
|
|
69249
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69303
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsMaterial.js
|
|
69250
69304
|
var promisifyGlob = function(pattern, options) {
|
|
69251
69305
|
return new Promise((resolve, reject) => {
|
|
69252
69306
|
(0, import_utils8.glob)(pattern, options, (err, files) => err === null ? resolve(files) : reject(err));
|
|
@@ -69274,7 +69328,7 @@ var FsMaterial = class {
|
|
|
69274
69328
|
}
|
|
69275
69329
|
};
|
|
69276
69330
|
|
|
69277
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69331
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/nodeRequire.js
|
|
69278
69332
|
var nodeRequire = (path18) => {
|
|
69279
69333
|
try {
|
|
69280
69334
|
const module2 = __non_webpack_require__(path18);
|
|
@@ -69291,11 +69345,11 @@ var nodeRequire = (path18) => {
|
|
|
69291
69345
|
}
|
|
69292
69346
|
};
|
|
69293
69347
|
|
|
69294
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69348
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getGeneratorDir.js
|
|
69295
69349
|
var import_path3 = __toESM(require("path"));
|
|
69296
69350
|
var import_utils10 = require("@modern-js/utils");
|
|
69297
69351
|
|
|
69298
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69352
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
|
|
69299
69353
|
var import_utils9 = require("@modern-js/utils");
|
|
69300
69354
|
async function fsExists(path18) {
|
|
69301
69355
|
try {
|
|
@@ -69306,7 +69360,7 @@ async function fsExists(path18) {
|
|
|
69306
69360
|
}
|
|
69307
69361
|
}
|
|
69308
69362
|
|
|
69309
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69363
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getGeneratorDir.js
|
|
69310
69364
|
var MaxTimes = 5;
|
|
69311
69365
|
async function getGeneratorDir(generator) {
|
|
69312
69366
|
let result = generator;
|
|
@@ -69325,7 +69379,7 @@ async function getGeneratorDir(generator) {
|
|
|
69325
69379
|
return result;
|
|
69326
69380
|
}
|
|
69327
69381
|
|
|
69328
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69382
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/generator/index.js
|
|
69329
69383
|
var GeneratorCore = class {
|
|
69330
69384
|
get lifeCycleMethod() {
|
|
69331
69385
|
return {
|
|
@@ -69530,10 +69584,10 @@ check path: ${import_utils11.chalk.blue.underline(generator)} exist a package.js
|
|
|
69530
69584
|
}
|
|
69531
69585
|
};
|
|
69532
69586
|
|
|
69533
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69587
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/index.js
|
|
69534
69588
|
var import_path6 = __toESM(require("path"));
|
|
69535
69589
|
|
|
69536
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69590
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/packageManager.js
|
|
69537
69591
|
var import_path5 = __toESM(require("path"));
|
|
69538
69592
|
var import_utils12 = require("@modern-js/utils");
|
|
69539
69593
|
async function canUseYarn2() {
|
|
@@ -69581,7 +69635,6 @@ async function runInstall(targetDir, registryUrl) {
|
|
|
69581
69635
|
"install",
|
|
69582
69636
|
"--prod",
|
|
69583
69637
|
"--reporter=silent",
|
|
69584
|
-
"--prefer-offline",
|
|
69585
69638
|
"--ignore-scripts"
|
|
69586
69639
|
];
|
|
69587
69640
|
if (registryUrl) {
|
|
@@ -69604,7 +69657,6 @@ async function runInstall(targetDir, registryUrl) {
|
|
|
69604
69657
|
"install",
|
|
69605
69658
|
"--production",
|
|
69606
69659
|
"--loglevel=error",
|
|
69607
|
-
"--prefer-offline",
|
|
69608
69660
|
"--ignore-scripts"
|
|
69609
69661
|
];
|
|
69610
69662
|
if (registryUrl) {
|
|
@@ -69614,7 +69666,7 @@ async function runInstall(targetDir, registryUrl) {
|
|
|
69614
69666
|
}
|
|
69615
69667
|
}
|
|
69616
69668
|
|
|
69617
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69669
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/timeoutPromise.js
|
|
69618
69670
|
async function timeoutPromise(promise, ms, reason = "Operation") {
|
|
69619
69671
|
let timeoutId = null;
|
|
69620
69672
|
const delayPromise = (ms2) => new Promise((resolve) => {
|
|
@@ -69636,18 +69688,18 @@ async function timeoutPromise(promise, ms, reason = "Operation") {
|
|
|
69636
69688
|
}
|
|
69637
69689
|
}
|
|
69638
69690
|
|
|
69639
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
69691
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
|
|
69640
69692
|
var import_os = __toESM(require("os"));
|
|
69641
69693
|
var import_utils38 = require("@modern-js/utils");
|
|
69642
69694
|
|
|
69643
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
69695
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/bind.js
|
|
69644
69696
|
function bind(fn, thisArg) {
|
|
69645
69697
|
return function wrap() {
|
|
69646
69698
|
return fn.apply(thisArg, arguments);
|
|
69647
69699
|
};
|
|
69648
69700
|
}
|
|
69649
69701
|
|
|
69650
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
69702
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/utils.js
|
|
69651
69703
|
var { toString } = Object.prototype;
|
|
69652
69704
|
var { getPrototypeOf } = Object;
|
|
69653
69705
|
var kindOf = ((cache) => (thing) => {
|
|
@@ -70006,7 +70058,7 @@ var utils_default = {
|
|
|
70006
70058
|
isThenable
|
|
70007
70059
|
};
|
|
70008
70060
|
|
|
70009
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70061
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/AxiosError.js
|
|
70010
70062
|
function AxiosError(message, code, config, request, response) {
|
|
70011
70063
|
Error.call(this);
|
|
70012
70064
|
if (Error.captureStackTrace) {
|
|
@@ -70078,11 +70130,11 @@ AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
|
70078
70130
|
};
|
|
70079
70131
|
var AxiosError_default = AxiosError;
|
|
70080
70132
|
|
|
70081
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70133
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/platform/node/classes/FormData.js
|
|
70082
70134
|
var import_form_data = __toESM(require_form_data());
|
|
70083
70135
|
var FormData_default = import_form_data.default;
|
|
70084
70136
|
|
|
70085
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70137
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/toFormData.js
|
|
70086
70138
|
function isVisitable(thing) {
|
|
70087
70139
|
return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
|
|
70088
70140
|
}
|
|
@@ -70197,7 +70249,7 @@ function toFormData(obj, formData, options) {
|
|
|
70197
70249
|
}
|
|
70198
70250
|
var toFormData_default = toFormData;
|
|
70199
70251
|
|
|
70200
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70252
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
|
|
70201
70253
|
function encode(str) {
|
|
70202
70254
|
const charMap = {
|
|
70203
70255
|
"!": "%21",
|
|
@@ -70230,7 +70282,7 @@ prototype2.toString = function toString2(encoder) {
|
|
|
70230
70282
|
};
|
|
70231
70283
|
var AxiosURLSearchParams_default = AxiosURLSearchParams;
|
|
70232
70284
|
|
|
70233
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70285
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/buildURL.js
|
|
70234
70286
|
function encode2(val) {
|
|
70235
70287
|
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
70236
70288
|
}
|
|
@@ -70256,7 +70308,7 @@ function buildURL(url2, params, options) {
|
|
|
70256
70308
|
return url2;
|
|
70257
70309
|
}
|
|
70258
70310
|
|
|
70259
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70311
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/InterceptorManager.js
|
|
70260
70312
|
var InterceptorManager = class {
|
|
70261
70313
|
constructor() {
|
|
70262
70314
|
this.handlers = [];
|
|
@@ -70320,18 +70372,18 @@ var InterceptorManager = class {
|
|
|
70320
70372
|
};
|
|
70321
70373
|
var InterceptorManager_default = InterceptorManager;
|
|
70322
70374
|
|
|
70323
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70375
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/defaults/transitional.js
|
|
70324
70376
|
var transitional_default = {
|
|
70325
70377
|
silentJSONParsing: true,
|
|
70326
70378
|
forcedJSONParsing: true,
|
|
70327
70379
|
clarifyTimeoutError: false
|
|
70328
70380
|
};
|
|
70329
70381
|
|
|
70330
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70382
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
|
|
70331
70383
|
var import_url = __toESM(require("url"));
|
|
70332
70384
|
var URLSearchParams_default = import_url.default.URLSearchParams;
|
|
70333
70385
|
|
|
70334
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70386
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/platform/node/index.js
|
|
70335
70387
|
var node_default = {
|
|
70336
70388
|
isNode: true,
|
|
70337
70389
|
classes: {
|
|
@@ -70342,11 +70394,33 @@ var node_default = {
|
|
|
70342
70394
|
protocols: ["http", "https", "file", "data"]
|
|
70343
70395
|
};
|
|
70344
70396
|
|
|
70345
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70397
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/platform/common/utils.js
|
|
70398
|
+
var utils_exports = {};
|
|
70399
|
+
__export(utils_exports, {
|
|
70400
|
+
hasBrowserEnv: () => hasBrowserEnv,
|
|
70401
|
+
hasStandardBrowserEnv: () => hasStandardBrowserEnv,
|
|
70402
|
+
hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv
|
|
70403
|
+
});
|
|
70404
|
+
var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
70405
|
+
var hasStandardBrowserEnv = ((product) => {
|
|
70406
|
+
return hasBrowserEnv && ["ReactNative", "NativeScript", "NS"].indexOf(product) < 0;
|
|
70407
|
+
})(typeof navigator !== "undefined" && navigator.product);
|
|
70408
|
+
var hasStandardBrowserWebWorkerEnv = (() => {
|
|
70409
|
+
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
70410
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
70411
|
+
})();
|
|
70412
|
+
|
|
70413
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/platform/index.js
|
|
70414
|
+
var platform_default = {
|
|
70415
|
+
...utils_exports,
|
|
70416
|
+
...node_default
|
|
70417
|
+
};
|
|
70418
|
+
|
|
70419
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
70346
70420
|
function toURLEncodedForm(data, options) {
|
|
70347
|
-
return toFormData_default(data, new
|
|
70421
|
+
return toFormData_default(data, new platform_default.classes.URLSearchParams(), Object.assign({
|
|
70348
70422
|
visitor: function(value, key, path18, helpers) {
|
|
70349
|
-
if (
|
|
70423
|
+
if (platform_default.isNode && utils_default.isBuffer(value)) {
|
|
70350
70424
|
this.append(key, value.toString("base64"));
|
|
70351
70425
|
return false;
|
|
70352
70426
|
}
|
|
@@ -70355,7 +70429,7 @@ function toURLEncodedForm(data, options) {
|
|
|
70355
70429
|
}, options));
|
|
70356
70430
|
}
|
|
70357
70431
|
|
|
70358
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70432
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/formDataToJSON.js
|
|
70359
70433
|
function parsePropPath(name) {
|
|
70360
70434
|
return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
70361
70435
|
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
@@ -70376,6 +70450,8 @@ function arrayToObject(arr) {
|
|
|
70376
70450
|
function formDataToJSON(formData) {
|
|
70377
70451
|
function buildPath(path18, value, target, index) {
|
|
70378
70452
|
let name = path18[index++];
|
|
70453
|
+
if (name === "__proto__")
|
|
70454
|
+
return true;
|
|
70379
70455
|
const isNumericKey = Number.isFinite(+name);
|
|
70380
70456
|
const isLast = index >= path18.length;
|
|
70381
70457
|
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
@@ -70407,7 +70483,7 @@ function formDataToJSON(formData) {
|
|
|
70407
70483
|
}
|
|
70408
70484
|
var formDataToJSON_default = formDataToJSON;
|
|
70409
70485
|
|
|
70410
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70486
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/defaults/index.js
|
|
70411
70487
|
function stringifySafely(rawValue, parser, encoder) {
|
|
70412
70488
|
if (utils_default.isString(rawValue)) {
|
|
70413
70489
|
try {
|
|
@@ -70433,9 +70509,6 @@ var defaults = {
|
|
|
70433
70509
|
}
|
|
70434
70510
|
const isFormData2 = utils_default.isFormData(data);
|
|
70435
70511
|
if (isFormData2) {
|
|
70436
|
-
if (!hasJSONContentType) {
|
|
70437
|
-
return data;
|
|
70438
|
-
}
|
|
70439
70512
|
return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
|
|
70440
70513
|
}
|
|
70441
70514
|
if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)) {
|
|
@@ -70498,8 +70571,8 @@ var defaults = {
|
|
|
70498
70571
|
maxContentLength: -1,
|
|
70499
70572
|
maxBodyLength: -1,
|
|
70500
70573
|
env: {
|
|
70501
|
-
FormData:
|
|
70502
|
-
Blob:
|
|
70574
|
+
FormData: platform_default.classes.FormData,
|
|
70575
|
+
Blob: platform_default.classes.Blob
|
|
70503
70576
|
},
|
|
70504
70577
|
validateStatus: function validateStatus(status) {
|
|
70505
70578
|
return status >= 200 && status < 300;
|
|
@@ -70516,7 +70589,7 @@ utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method
|
|
|
70516
70589
|
});
|
|
70517
70590
|
var defaults_default = defaults;
|
|
70518
70591
|
|
|
70519
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70592
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/parseHeaders.js
|
|
70520
70593
|
var ignoreDuplicateOf = utils_default.toObjectSet([
|
|
70521
70594
|
"age",
|
|
70522
70595
|
"authorization",
|
|
@@ -70561,7 +70634,7 @@ var parseHeaders_default = (rawHeaders) => {
|
|
|
70561
70634
|
return parsed;
|
|
70562
70635
|
};
|
|
70563
70636
|
|
|
70564
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70637
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/AxiosHeaders.js
|
|
70565
70638
|
var $internals = Symbol("internals");
|
|
70566
70639
|
function normalizeHeader(header) {
|
|
70567
70640
|
return header && String(header).trim().toLowerCase();
|
|
@@ -70779,7 +70852,7 @@ utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
|
70779
70852
|
utils_default.freezeMethods(AxiosHeaders);
|
|
70780
70853
|
var AxiosHeaders_default = AxiosHeaders;
|
|
70781
70854
|
|
|
70782
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70855
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/transformData.js
|
|
70783
70856
|
function transformData(fns, response) {
|
|
70784
70857
|
const config = this || defaults_default;
|
|
70785
70858
|
const context = response || config;
|
|
@@ -70792,12 +70865,12 @@ function transformData(fns, response) {
|
|
|
70792
70865
|
return data;
|
|
70793
70866
|
}
|
|
70794
70867
|
|
|
70795
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70868
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/cancel/isCancel.js
|
|
70796
70869
|
function isCancel(value) {
|
|
70797
70870
|
return !!(value && value.__CANCEL__);
|
|
70798
70871
|
}
|
|
70799
70872
|
|
|
70800
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70873
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/cancel/CanceledError.js
|
|
70801
70874
|
function CanceledError(message, config, request) {
|
|
70802
70875
|
AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
|
|
70803
70876
|
this.name = "CanceledError";
|
|
@@ -70807,7 +70880,7 @@ utils_default.inherits(CanceledError, AxiosError_default, {
|
|
|
70807
70880
|
});
|
|
70808
70881
|
var CanceledError_default = CanceledError;
|
|
70809
70882
|
|
|
70810
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70883
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/settle.js
|
|
70811
70884
|
function settle(resolve, reject, response) {
|
|
70812
70885
|
const validateStatus2 = response.config.validateStatus;
|
|
70813
70886
|
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
@@ -70823,17 +70896,17 @@ function settle(resolve, reject, response) {
|
|
|
70823
70896
|
}
|
|
70824
70897
|
}
|
|
70825
70898
|
|
|
70826
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70899
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/isAbsoluteURL.js
|
|
70827
70900
|
function isAbsoluteURL(url2) {
|
|
70828
70901
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
|
|
70829
70902
|
}
|
|
70830
70903
|
|
|
70831
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70904
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/combineURLs.js
|
|
70832
70905
|
function combineURLs(baseURL, relativeURL) {
|
|
70833
|
-
return relativeURL ? baseURL.replace(
|
|
70906
|
+
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
70834
70907
|
}
|
|
70835
70908
|
|
|
70836
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70909
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/buildFullPath.js
|
|
70837
70910
|
function buildFullPath(baseURL, requestedURL) {
|
|
70838
70911
|
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
70839
70912
|
return combineURLs(baseURL, requestedURL);
|
|
@@ -70841,7 +70914,7 @@ function buildFullPath(baseURL, requestedURL) {
|
|
|
70841
70914
|
return requestedURL;
|
|
70842
70915
|
}
|
|
70843
70916
|
|
|
70844
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70917
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/http.js
|
|
70845
70918
|
var import_proxy_from_env = __toESM(require_proxy_from_env());
|
|
70846
70919
|
var import_http = __toESM(require("http"));
|
|
70847
70920
|
var import_https = __toESM(require("https"));
|
|
@@ -70849,19 +70922,19 @@ var import_util2 = __toESM(require("util"));
|
|
|
70849
70922
|
var import_follow_redirects = __toESM(require_follow_redirects());
|
|
70850
70923
|
var import_zlib = __toESM(require("zlib"));
|
|
70851
70924
|
|
|
70852
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70853
|
-
var VERSION = "1.6.
|
|
70925
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/env/data.js
|
|
70926
|
+
var VERSION = "1.6.7";
|
|
70854
70927
|
|
|
70855
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70928
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/parseProtocol.js
|
|
70856
70929
|
function parseProtocol(url2) {
|
|
70857
70930
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
|
|
70858
70931
|
return match && match[1] || "";
|
|
70859
70932
|
}
|
|
70860
70933
|
|
|
70861
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70934
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/fromDataURI.js
|
|
70862
70935
|
var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
|
|
70863
70936
|
function fromDataURI(uri, asBlob, options) {
|
|
70864
|
-
const _Blob = options && options.Blob ||
|
|
70937
|
+
const _Blob = options && options.Blob || platform_default.classes.Blob;
|
|
70865
70938
|
const protocol = parseProtocol(uri);
|
|
70866
70939
|
if (asBlob === void 0 && _Blob) {
|
|
70867
70940
|
asBlob = true;
|
|
@@ -70887,13 +70960,13 @@ function fromDataURI(uri, asBlob, options) {
|
|
|
70887
70960
|
throw new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_NOT_SUPPORT);
|
|
70888
70961
|
}
|
|
70889
70962
|
|
|
70890
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70963
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/http.js
|
|
70891
70964
|
var import_stream4 = __toESM(require("stream"));
|
|
70892
70965
|
|
|
70893
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70966
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/AxiosTransformStream.js
|
|
70894
70967
|
var import_stream = __toESM(require("stream"));
|
|
70895
70968
|
|
|
70896
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70969
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/throttle.js
|
|
70897
70970
|
function throttle(fn, freq) {
|
|
70898
70971
|
let timestamp = 0;
|
|
70899
70972
|
const threshold = 1e3 / freq;
|
|
@@ -70919,7 +70992,7 @@ function throttle(fn, freq) {
|
|
|
70919
70992
|
}
|
|
70920
70993
|
var throttle_default = throttle;
|
|
70921
70994
|
|
|
70922
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
70995
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/speedometer.js
|
|
70923
70996
|
function speedometer(samplesCount, min) {
|
|
70924
70997
|
samplesCount = samplesCount || 10;
|
|
70925
70998
|
const bytes = new Array(samplesCount);
|
|
@@ -70955,7 +71028,7 @@ function speedometer(samplesCount, min) {
|
|
|
70955
71028
|
}
|
|
70956
71029
|
var speedometer_default = speedometer;
|
|
70957
71030
|
|
|
70958
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
71031
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/AxiosTransformStream.js
|
|
70959
71032
|
var kInternals = Symbol("internals");
|
|
70960
71033
|
var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
70961
71034
|
constructor(options) {
|
|
@@ -71105,14 +71178,14 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
|
71105
71178
|
};
|
|
71106
71179
|
var AxiosTransformStream_default = AxiosTransformStream;
|
|
71107
71180
|
|
|
71108
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
71181
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/http.js
|
|
71109
71182
|
var import_events2 = __toESM(require("events"));
|
|
71110
71183
|
|
|
71111
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
71184
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/formDataToStream.js
|
|
71112
71185
|
var import_util = require("util");
|
|
71113
71186
|
var import_stream2 = require("stream");
|
|
71114
71187
|
|
|
71115
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
71188
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/readBlob.js
|
|
71116
71189
|
var { asyncIterator } = Symbol;
|
|
71117
71190
|
var readBlob = async function* (blob) {
|
|
71118
71191
|
if (blob.stream) {
|
|
@@ -71127,7 +71200,7 @@ var readBlob = async function* (blob) {
|
|
|
71127
71200
|
};
|
|
71128
71201
|
var readBlob_default = readBlob;
|
|
71129
71202
|
|
|
71130
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
71203
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/formDataToStream.js
|
|
71131
71204
|
var BOUNDARY_ALPHABET = utils_default.ALPHABET.ALPHA_DIGIT + "-_";
|
|
71132
71205
|
var textEncoder = new import_util.TextEncoder();
|
|
71133
71206
|
var CRLF = "\r\n";
|
|
@@ -71206,7 +71279,7 @@ var formDataToStream = (form, headersHandler, options) => {
|
|
|
71206
71279
|
};
|
|
71207
71280
|
var formDataToStream_default = formDataToStream;
|
|
71208
71281
|
|
|
71209
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
71282
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
|
|
71210
71283
|
var import_stream3 = __toESM(require("stream"));
|
|
71211
71284
|
var ZlibHeaderTransformStream = class extends import_stream3.default.Transform {
|
|
71212
71285
|
__transform(chunk, encoding, callback) {
|
|
@@ -71228,7 +71301,7 @@ var ZlibHeaderTransformStream = class extends import_stream3.default.Transform {
|
|
|
71228
71301
|
};
|
|
71229
71302
|
var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream;
|
|
71230
71303
|
|
|
71231
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
71304
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/callbackify.js
|
|
71232
71305
|
var callbackify = (fn, reducer) => {
|
|
71233
71306
|
return utils_default.isAsyncFn(fn) ? function(...args) {
|
|
71234
71307
|
const cb = args.pop();
|
|
@@ -71243,7 +71316,7 @@ var callbackify = (fn, reducer) => {
|
|
|
71243
71316
|
};
|
|
71244
71317
|
var callbackify_default = callbackify;
|
|
71245
71318
|
|
|
71246
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
71319
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/http.js
|
|
71247
71320
|
var zlibOptions = {
|
|
71248
71321
|
flush: import_zlib.default.constants.Z_SYNC_FLUSH,
|
|
71249
71322
|
finishFlush: import_zlib.default.constants.Z_SYNC_FLUSH
|
|
@@ -71255,15 +71328,15 @@ var brotliOptions = {
|
|
|
71255
71328
|
var isBrotliSupported = utils_default.isFunction(import_zlib.default.createBrotliDecompress);
|
|
71256
71329
|
var { http: httpFollow, https: httpsFollow } = import_follow_redirects.default;
|
|
71257
71330
|
var isHttps = /https:?/;
|
|
71258
|
-
var supportedProtocols =
|
|
71331
|
+
var supportedProtocols = platform_default.protocols.map((protocol) => {
|
|
71259
71332
|
return protocol + ":";
|
|
71260
71333
|
});
|
|
71261
|
-
function dispatchBeforeRedirect(options) {
|
|
71334
|
+
function dispatchBeforeRedirect(options, responseDetails) {
|
|
71262
71335
|
if (options.beforeRedirects.proxy) {
|
|
71263
71336
|
options.beforeRedirects.proxy(options);
|
|
71264
71337
|
}
|
|
71265
71338
|
if (options.beforeRedirects.config) {
|
|
71266
|
-
options.beforeRedirects.config(options);
|
|
71339
|
+
options.beforeRedirects.config(options, responseDetails);
|
|
71267
71340
|
}
|
|
71268
71341
|
}
|
|
71269
71342
|
function setProxy(options, configProxy, location) {
|
|
@@ -71343,6 +71416,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
71343
71416
|
const _lookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]);
|
|
71344
71417
|
lookup = (hostname, opt, cb) => {
|
|
71345
71418
|
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
71419
|
+
if (err) {
|
|
71420
|
+
return cb(err);
|
|
71421
|
+
}
|
|
71346
71422
|
const addresses = utils_default.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
|
|
71347
71423
|
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
71348
71424
|
});
|
|
@@ -71739,57 +71815,44 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
71739
71815
|
});
|
|
71740
71816
|
};
|
|
71741
71817
|
|
|
71742
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
71743
|
-
var cookies_default =
|
|
71818
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/cookies.js
|
|
71819
|
+
var cookies_default = platform_default.hasStandardBrowserEnv ? (
|
|
71744
71820
|
// Standard browser envs support document.cookie
|
|
71745
|
-
|
|
71746
|
-
|
|
71747
|
-
|
|
71748
|
-
|
|
71749
|
-
|
|
71750
|
-
|
|
71751
|
-
|
|
71752
|
-
|
|
71753
|
-
|
|
71754
|
-
|
|
71755
|
-
|
|
71756
|
-
|
|
71757
|
-
|
|
71758
|
-
|
|
71759
|
-
|
|
71760
|
-
|
|
71761
|
-
|
|
71762
|
-
document.cookie = cookie.join("; ");
|
|
71763
|
-
},
|
|
71764
|
-
read: function read(name) {
|
|
71765
|
-
const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
|
|
71766
|
-
return match ? decodeURIComponent(match[3]) : null;
|
|
71767
|
-
},
|
|
71768
|
-
remove: function remove(name) {
|
|
71769
|
-
this.write(name, "", Date.now() - 864e5);
|
|
71770
|
-
}
|
|
71771
|
-
};
|
|
71772
|
-
}()
|
|
71821
|
+
{
|
|
71822
|
+
write(name, value, expires, path18, domain, secure) {
|
|
71823
|
+
const cookie = [name + "=" + encodeURIComponent(value)];
|
|
71824
|
+
utils_default.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
|
|
71825
|
+
utils_default.isString(path18) && cookie.push("path=" + path18);
|
|
71826
|
+
utils_default.isString(domain) && cookie.push("domain=" + domain);
|
|
71827
|
+
secure === true && cookie.push("secure");
|
|
71828
|
+
document.cookie = cookie.join("; ");
|
|
71829
|
+
},
|
|
71830
|
+
read(name) {
|
|
71831
|
+
const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
|
|
71832
|
+
return match ? decodeURIComponent(match[3]) : null;
|
|
71833
|
+
},
|
|
71834
|
+
remove(name) {
|
|
71835
|
+
this.write(name, "", Date.now() - 864e5);
|
|
71836
|
+
}
|
|
71837
|
+
}
|
|
71773
71838
|
) : (
|
|
71774
|
-
// Non
|
|
71775
|
-
|
|
71776
|
-
|
|
71777
|
-
|
|
71778
|
-
|
|
71779
|
-
|
|
71780
|
-
|
|
71781
|
-
|
|
71782
|
-
|
|
71783
|
-
|
|
71784
|
-
};
|
|
71785
|
-
}()
|
|
71839
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
71840
|
+
{
|
|
71841
|
+
write() {
|
|
71842
|
+
},
|
|
71843
|
+
read() {
|
|
71844
|
+
return null;
|
|
71845
|
+
},
|
|
71846
|
+
remove() {
|
|
71847
|
+
}
|
|
71848
|
+
}
|
|
71786
71849
|
);
|
|
71787
71850
|
|
|
71788
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
71789
|
-
var isURLSameOrigin_default =
|
|
71851
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/isURLSameOrigin.js
|
|
71852
|
+
var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? (
|
|
71790
71853
|
// Standard browser envs have full support of the APIs needed to test
|
|
71791
71854
|
// whether the request URL is of the same origin as current location.
|
|
71792
|
-
function
|
|
71855
|
+
function standardBrowserEnv() {
|
|
71793
71856
|
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
71794
71857
|
const urlParsingNode = document.createElement("a");
|
|
71795
71858
|
let originURL;
|
|
@@ -71819,14 +71882,14 @@ var isURLSameOrigin_default = node_default.isStandardBrowserEnv ? (
|
|
|
71819
71882
|
}()
|
|
71820
71883
|
) : (
|
|
71821
71884
|
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
71822
|
-
function
|
|
71885
|
+
function nonStandardBrowserEnv() {
|
|
71823
71886
|
return function isURLSameOrigin() {
|
|
71824
71887
|
return true;
|
|
71825
71888
|
};
|
|
71826
71889
|
}()
|
|
71827
71890
|
);
|
|
71828
71891
|
|
|
71829
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
71892
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/xhr.js
|
|
71830
71893
|
function progressEventReducer(listener, isDownloadStream) {
|
|
71831
71894
|
let bytesNotified = 0;
|
|
71832
71895
|
const _speedometer = speedometer_default(50, 250);
|
|
@@ -71855,7 +71918,7 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
71855
71918
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
71856
71919
|
let requestData = config.data;
|
|
71857
71920
|
const requestHeaders = AxiosHeaders_default.from(config.headers).normalize();
|
|
71858
|
-
|
|
71921
|
+
let { responseType, withXSRFToken } = config;
|
|
71859
71922
|
let onCanceled;
|
|
71860
71923
|
function done() {
|
|
71861
71924
|
if (config.cancelToken) {
|
|
@@ -71867,12 +71930,11 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
71867
71930
|
}
|
|
71868
71931
|
let contentType;
|
|
71869
71932
|
if (utils_default.isFormData(requestData)) {
|
|
71870
|
-
if (
|
|
71933
|
+
if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
|
|
71871
71934
|
requestHeaders.setContentType(false);
|
|
71872
|
-
} else if (
|
|
71873
|
-
|
|
71874
|
-
|
|
71875
|
-
requestHeaders.setContentType(contentType.replace(/^\s*(multipart\/form-data);+/, "$1"));
|
|
71935
|
+
} else if ((contentType = requestHeaders.getContentType()) !== false) {
|
|
71936
|
+
const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
|
|
71937
|
+
requestHeaders.setContentType([type || "multipart/form-data", ...tokens].join("; "));
|
|
71876
71938
|
}
|
|
71877
71939
|
}
|
|
71878
71940
|
let request = new XMLHttpRequest();
|
|
@@ -71947,10 +72009,13 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
71947
72009
|
));
|
|
71948
72010
|
request = null;
|
|
71949
72011
|
};
|
|
71950
|
-
if (
|
|
71951
|
-
|
|
71952
|
-
if (
|
|
71953
|
-
|
|
72012
|
+
if (platform_default.hasStandardBrowserEnv) {
|
|
72013
|
+
withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
|
|
72014
|
+
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(fullPath)) {
|
|
72015
|
+
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies_default.read(config.xsrfCookieName);
|
|
72016
|
+
if (xsrfValue) {
|
|
72017
|
+
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
|
72018
|
+
}
|
|
71954
72019
|
}
|
|
71955
72020
|
}
|
|
71956
72021
|
requestData === void 0 && requestHeaders.setContentType(null);
|
|
@@ -71986,7 +72051,7 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
71986
72051
|
}
|
|
71987
72052
|
}
|
|
71988
72053
|
const protocol = parseProtocol(fullPath);
|
|
71989
|
-
if (protocol &&
|
|
72054
|
+
if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
|
|
71990
72055
|
reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
|
|
71991
72056
|
return;
|
|
71992
72057
|
}
|
|
@@ -71994,7 +72059,7 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
71994
72059
|
});
|
|
71995
72060
|
};
|
|
71996
72061
|
|
|
71997
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
72062
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/adapters.js
|
|
71998
72063
|
var knownAdapters = {
|
|
71999
72064
|
http: http_default,
|
|
72000
72065
|
xhr: xhr_default
|
|
@@ -72047,7 +72112,7 @@ var adapters_default = {
|
|
|
72047
72112
|
adapters: knownAdapters
|
|
72048
72113
|
};
|
|
72049
72114
|
|
|
72050
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
72115
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/dispatchRequest.js
|
|
72051
72116
|
function throwIfCancellationRequested(config) {
|
|
72052
72117
|
if (config.cancelToken) {
|
|
72053
72118
|
config.cancelToken.throwIfRequested();
|
|
@@ -72092,7 +72157,7 @@ function dispatchRequest(config) {
|
|
|
72092
72157
|
});
|
|
72093
72158
|
}
|
|
72094
72159
|
|
|
72095
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
72160
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/mergeConfig.js
|
|
72096
72161
|
var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? thing.toJSON() : thing;
|
|
72097
72162
|
function mergeConfig(config1, config2) {
|
|
72098
72163
|
config2 = config2 || {};
|
|
@@ -72144,6 +72209,7 @@ function mergeConfig(config1, config2) {
|
|
|
72144
72209
|
timeout: defaultToConfig2,
|
|
72145
72210
|
timeoutMessage: defaultToConfig2,
|
|
72146
72211
|
withCredentials: defaultToConfig2,
|
|
72212
|
+
withXSRFToken: defaultToConfig2,
|
|
72147
72213
|
adapter: defaultToConfig2,
|
|
72148
72214
|
responseType: defaultToConfig2,
|
|
72149
72215
|
xsrfCookieName: defaultToConfig2,
|
|
@@ -72171,7 +72237,7 @@ function mergeConfig(config1, config2) {
|
|
|
72171
72237
|
return config;
|
|
72172
72238
|
}
|
|
72173
72239
|
|
|
72174
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
72240
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/validator.js
|
|
72175
72241
|
var validators = {};
|
|
72176
72242
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
72177
72243
|
validators[type] = function validator(thing) {
|
|
@@ -72229,7 +72295,7 @@ var validator_default = {
|
|
|
72229
72295
|
validators
|
|
72230
72296
|
};
|
|
72231
72297
|
|
|
72232
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
72298
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/Axios.js
|
|
72233
72299
|
var validators2 = validator_default.validators;
|
|
72234
72300
|
var Axios = class {
|
|
72235
72301
|
constructor(instanceConfig) {
|
|
@@ -72247,7 +72313,24 @@ var Axios = class {
|
|
|
72247
72313
|
*
|
|
72248
72314
|
* @returns {Promise} The Promise to be fulfilled
|
|
72249
72315
|
*/
|
|
72250
|
-
request(configOrUrl, config) {
|
|
72316
|
+
async request(configOrUrl, config) {
|
|
72317
|
+
try {
|
|
72318
|
+
return await this._request(configOrUrl, config);
|
|
72319
|
+
} catch (err) {
|
|
72320
|
+
if (err instanceof Error) {
|
|
72321
|
+
let dummy;
|
|
72322
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
|
|
72323
|
+
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
|
|
72324
|
+
if (!err.stack) {
|
|
72325
|
+
err.stack = stack;
|
|
72326
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
|
|
72327
|
+
err.stack += "\n" + stack;
|
|
72328
|
+
}
|
|
72329
|
+
}
|
|
72330
|
+
throw err;
|
|
72331
|
+
}
|
|
72332
|
+
}
|
|
72333
|
+
_request(configOrUrl, config) {
|
|
72251
72334
|
if (typeof configOrUrl === "string") {
|
|
72252
72335
|
config = config || {};
|
|
72253
72336
|
config.url = configOrUrl;
|
|
@@ -72372,7 +72455,7 @@ utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(m
|
|
|
72372
72455
|
});
|
|
72373
72456
|
var Axios_default = Axios;
|
|
72374
72457
|
|
|
72375
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
72458
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/cancel/CancelToken.js
|
|
72376
72459
|
var CancelToken = class _CancelToken {
|
|
72377
72460
|
constructor(executor) {
|
|
72378
72461
|
if (typeof executor !== "function") {
|
|
@@ -72462,19 +72545,19 @@ var CancelToken = class _CancelToken {
|
|
|
72462
72545
|
};
|
|
72463
72546
|
var CancelToken_default = CancelToken;
|
|
72464
72547
|
|
|
72465
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
72548
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/spread.js
|
|
72466
72549
|
function spread(callback) {
|
|
72467
72550
|
return function wrap(arr) {
|
|
72468
72551
|
return callback.apply(null, arr);
|
|
72469
72552
|
};
|
|
72470
72553
|
}
|
|
72471
72554
|
|
|
72472
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
72555
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/isAxiosError.js
|
|
72473
72556
|
function isAxiosError(payload) {
|
|
72474
72557
|
return utils_default.isObject(payload) && payload.isAxiosError === true;
|
|
72475
72558
|
}
|
|
72476
72559
|
|
|
72477
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
72560
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/HttpStatusCode.js
|
|
72478
72561
|
var HttpStatusCode = {
|
|
72479
72562
|
Continue: 100,
|
|
72480
72563
|
SwitchingProtocols: 101,
|
|
@@ -72545,7 +72628,7 @@ Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
|
72545
72628
|
});
|
|
72546
72629
|
var HttpStatusCode_default = HttpStatusCode;
|
|
72547
72630
|
|
|
72548
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
72631
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/axios.js
|
|
72549
72632
|
function createInstance(defaultConfig) {
|
|
72550
72633
|
const context = new Axios_default(defaultConfig);
|
|
72551
72634
|
const instance = bind(Axios_default.prototype.request, context);
|
|
@@ -72578,7 +72661,7 @@ axios.HttpStatusCode = HttpStatusCode_default;
|
|
|
72578
72661
|
axios.default = axios;
|
|
72579
72662
|
var axios_default = axios;
|
|
72580
72663
|
|
|
72581
|
-
// ../../../../node_modules/.pnpm/axios@1.6.
|
|
72664
|
+
// ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/index.js
|
|
72582
72665
|
var {
|
|
72583
72666
|
Axios: Axios2,
|
|
72584
72667
|
AxiosError: AxiosError2,
|
|
@@ -72598,17 +72681,17 @@ var {
|
|
|
72598
72681
|
mergeConfig: mergeConfig2
|
|
72599
72682
|
} = axios_default;
|
|
72600
72683
|
|
|
72601
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
72684
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
|
|
72602
72685
|
var import_tar = __toESM(require_tar());
|
|
72603
72686
|
|
|
72604
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
72687
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmTarballUrl.js
|
|
72605
72688
|
var import_utils36 = require("@modern-js/utils");
|
|
72606
72689
|
|
|
72607
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
72690
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/constants.js
|
|
72608
72691
|
var NPM_API_TIMEOUT = 3e4;
|
|
72609
72692
|
var CATCHE_VALIDITY_PREIOD = 12 * 3600 * 1e3;
|
|
72610
72693
|
|
|
72611
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
72694
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmTarballUrl.js
|
|
72612
72695
|
async function getNpmTarballUrl(pkgName, pkgVersion, options) {
|
|
72613
72696
|
const { registryUrl } = options || {};
|
|
72614
72697
|
const params = [
|
|
@@ -72631,7 +72714,7 @@ async function getNpmTarballUrl(pkgName, pkgVersion, options) {
|
|
|
72631
72714
|
}
|
|
72632
72715
|
}
|
|
72633
72716
|
|
|
72634
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
72717
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmVersion.js
|
|
72635
72718
|
var import_utils37 = require("@modern-js/utils");
|
|
72636
72719
|
async function getNpmVersion(packageName, options) {
|
|
72637
72720
|
const { version, registryUrl } = options || {};
|
|
@@ -72653,7 +72736,7 @@ async function getNpmVersion(packageName, options) {
|
|
|
72653
72736
|
return stdout;
|
|
72654
72737
|
}
|
|
72655
72738
|
|
|
72656
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
72739
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
|
|
72657
72740
|
async function isValidCache(cacheDir) {
|
|
72658
72741
|
if (await fsExists(`${cacheDir}/.codesmith.completed`)) {
|
|
72659
72742
|
const preCacheTimeStr = await import_utils38.fs.readFile(`${cacheDir}/.codesmith.completed`, {
|
|
@@ -72733,7 +72816,7 @@ async function downloadPackage(pkgName, pkgVersion = "latest", options = {}) {
|
|
|
72733
72816
|
return targetDir;
|
|
72734
72817
|
}
|
|
72735
72818
|
|
|
72736
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
72819
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getPackageInfo.js
|
|
72737
72820
|
var import_utils39 = require("@modern-js/utils");
|
|
72738
72821
|
function getPackageInfo(packageName) {
|
|
72739
72822
|
if (!packageName) {
|
|
@@ -72758,7 +72841,7 @@ function getPackageInfo(packageName) {
|
|
|
72758
72841
|
};
|
|
72759
72842
|
}
|
|
72760
72843
|
|
|
72761
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
72844
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/index.js
|
|
72762
72845
|
var MaterialsManager = class {
|
|
72763
72846
|
loadLocalGenerator(generator) {
|
|
72764
72847
|
if (!import_path6.default.isAbsolute(generator)) {
|
|
@@ -72789,7 +72872,7 @@ var MaterialsManager = class {
|
|
|
72789
72872
|
}
|
|
72790
72873
|
};
|
|
72791
72874
|
|
|
72792
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
72875
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/codesmith/index.js
|
|
72793
72876
|
var CodeSmith = class {
|
|
72794
72877
|
async forge({ tasks, pwd }) {
|
|
72795
72878
|
var _this_logger_timing, _this_logger;
|
|
@@ -72833,7 +72916,7 @@ var CodeSmith = class {
|
|
|
72833
72916
|
}
|
|
72834
72917
|
};
|
|
72835
72918
|
|
|
72836
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.
|
|
72919
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/utils/renderString.js
|
|
72837
72920
|
var import_handlebars = __toESM(require_lib());
|
|
72838
72921
|
function renderString(template, fullData, registers) {
|
|
72839
72922
|
const helpers = {
|
|
@@ -72847,7 +72930,7 @@ function renderString(template, fullData, registers) {
|
|
|
72847
72930
|
return import_handlebars.default.compile(template)(fullData) || "";
|
|
72848
72931
|
}
|
|
72849
72932
|
|
|
72850
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.
|
|
72933
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/index.js
|
|
72851
72934
|
var HandlebarsAPI = class {
|
|
72852
72935
|
async registerHelp(helpers) {
|
|
72853
72936
|
this.registers.helpers = {
|
|
@@ -72897,13 +72980,13 @@ var HandlebarsAPI = class {
|
|
|
72897
72980
|
}
|
|
72898
72981
|
};
|
|
72899
72982
|
|
|
72900
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.
|
|
72983
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/utils/renderString.js
|
|
72901
72984
|
var import_ejs = __toESM(require_ejs());
|
|
72902
72985
|
function renderString2(template, fullData) {
|
|
72903
72986
|
return import_ejs.default.render(template, fullData) || "";
|
|
72904
72987
|
}
|
|
72905
72988
|
|
|
72906
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.
|
|
72989
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/index.js
|
|
72907
72990
|
var EjsAPI = class {
|
|
72908
72991
|
async renderTemplate(templateResource, target, parameters = {}) {
|
|
72909
72992
|
if (templateResource._type !== FS_RESOURCE) {
|
|
@@ -72936,7 +73019,7 @@ var EjsAPI = class {
|
|
|
72936
73019
|
}
|
|
72937
73020
|
};
|
|
72938
73021
|
|
|
72939
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.3.
|
|
73022
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-fs/dist/esm-node/index.js
|
|
72940
73023
|
var import_path8 = __toESM(require("path"));
|
|
72941
73024
|
var import_utils43 = require("@modern-js/utils");
|
|
72942
73025
|
var FsAPI = class {
|
|
@@ -72964,7 +73047,7 @@ var FsAPI = class {
|
|
|
72964
73047
|
}
|
|
72965
73048
|
};
|
|
72966
73049
|
|
|
72967
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
|
73050
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/index.js
|
|
72968
73051
|
var import_lodash2 = require("@modern-js/utils/lodash");
|
|
72969
73052
|
|
|
72970
73053
|
// ../../../../node_modules/.pnpm/@formily+shared@2.2.24/node_modules/@formily/shared/esm/checkers.js
|
|
@@ -82599,10 +82682,10 @@ var Schema = (
|
|
|
82599
82682
|
}()
|
|
82600
82683
|
);
|
|
82601
82684
|
|
|
82602
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
|
82685
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
|
|
82603
82686
|
var import_inquirer = __toESM(require_inquirer());
|
|
82604
82687
|
|
|
82605
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
|
82688
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/transform.js
|
|
82606
82689
|
var import_lodash = require("@modern-js/utils/lodash");
|
|
82607
82690
|
function validateSchema(schema) {
|
|
82608
82691
|
const { type, properties } = schema;
|
|
@@ -82694,7 +82777,7 @@ function transformForm(schema, configValue = {}, validateMap, initValue) {
|
|
|
82694
82777
|
return getQuestionFromSchema(schema, configValue, validateMap, initValue);
|
|
82695
82778
|
}
|
|
82696
82779
|
|
|
82697
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
|
82780
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
|
|
82698
82781
|
var compileRule = (rule, scope) => {
|
|
82699
82782
|
const state = Schema.compile(rule, {
|
|
82700
82783
|
$self: {},
|
|
@@ -82798,7 +82881,7 @@ async function prompt(schema, configValue = {}, validateMap, initValue) {
|
|
|
82798
82881
|
return answers;
|
|
82799
82882
|
}
|
|
82800
82883
|
|
|
82801
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
|
82884
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/inquirer.js
|
|
82802
82885
|
var CLIReader = class {
|
|
82803
82886
|
getAnswers() {
|
|
82804
82887
|
return this.answers;
|
|
@@ -82829,7 +82912,7 @@ var CLIReader = class {
|
|
|
82829
82912
|
}
|
|
82830
82913
|
};
|
|
82831
82914
|
|
|
82832
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
|
82915
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/index.js
|
|
82833
82916
|
var FormilyAPI = class {
|
|
82834
82917
|
mergeAnswers(answers, configValue) {
|
|
82835
82918
|
const inputData = (0, import_lodash2.merge)(answers, configValue);
|
|
@@ -82852,7 +82935,7 @@ var FormilyAPI = class {
|
|
|
82852
82935
|
}
|
|
82853
82936
|
};
|
|
82854
82937
|
|
|
82855
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
82938
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
|
|
82856
82939
|
var import_inquirer3 = __toESM(require_inquirer2());
|
|
82857
82940
|
|
|
82858
82941
|
// ../../../../node_modules/.pnpm/@modern-js+plugin-i18n@2.37.2/node_modules/@modern-js/plugin-i18n/dist/esm-node/index.js
|
|
@@ -82918,7 +83001,7 @@ var I18n = class {
|
|
|
82918
83001
|
}
|
|
82919
83002
|
};
|
|
82920
83003
|
|
|
82921
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
83004
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/zh.js
|
|
82922
83005
|
var ZH_LOCALE = {
|
|
82923
83006
|
environment: {
|
|
82924
83007
|
node_version: "请升级 Node 版本至 LIS",
|
|
@@ -82945,7 +83028,7 @@ var ZH_LOCALE = {
|
|
|
82945
83028
|
}
|
|
82946
83029
|
};
|
|
82947
83030
|
|
|
82948
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
83031
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/en.js
|
|
82949
83032
|
var EN_LOCALE = {
|
|
82950
83033
|
environment: {
|
|
82951
83034
|
node_version: "please upgrade node to lts version",
|
|
@@ -82972,14 +83055,14 @@ var EN_LOCALE = {
|
|
|
82972
83055
|
}
|
|
82973
83056
|
};
|
|
82974
83057
|
|
|
82975
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
83058
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/index.js
|
|
82976
83059
|
var i18n = new I18n();
|
|
82977
83060
|
var localeKeys = i18n.init("zh", {
|
|
82978
83061
|
zh: ZH_LOCALE,
|
|
82979
83062
|
en: EN_LOCALE
|
|
82980
83063
|
});
|
|
82981
83064
|
|
|
82982
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
83065
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/transform.js
|
|
82983
83066
|
var import_lodash5 = require("@modern-js/utils/lodash");
|
|
82984
83067
|
function transformInquirerSchema(questions, configValue = {}, validateMap = {}, initValue = {}) {
|
|
82985
83068
|
for (const question of questions) {
|
|
@@ -83007,7 +83090,7 @@ function transformInquirerSchema(questions, configValue = {}, validateMap = {},
|
|
|
83007
83090
|
return questions;
|
|
83008
83091
|
}
|
|
83009
83092
|
|
|
83010
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
83093
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/checkUseNvm.js
|
|
83011
83094
|
var import_path10 = __toESM(require("path"));
|
|
83012
83095
|
var import_utils45 = require("@modern-js/utils");
|
|
83013
83096
|
var NODE_MAJOR_VERSION_MAP = {
|
|
@@ -83055,7 +83138,7 @@ async function checkUseNvm(cwd, logger2) {
|
|
|
83055
83138
|
}
|
|
83056
83139
|
}
|
|
83057
83140
|
|
|
83058
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
83141
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
|
|
83059
83142
|
var AppAPI = class {
|
|
83060
83143
|
async checkEnvironment(nodeVersion) {
|
|
83061
83144
|
if (import_utils46.semver.lt(process.versions.node, nodeVersion || "12.22.12")) {
|
|
@@ -83295,15 +83378,6 @@ var AppAPI = class {
|
|
|
83295
83378
|
}
|
|
83296
83379
|
};
|
|
83297
83380
|
|
|
83298
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_define_property.js
|
|
83299
|
-
function _define_property2(obj, key, value) {
|
|
83300
|
-
if (key in obj) {
|
|
83301
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
83302
|
-
} else
|
|
83303
|
-
obj[key] = value;
|
|
83304
|
-
return obj;
|
|
83305
|
-
}
|
|
83306
|
-
|
|
83307
83381
|
// ../../../cli/plugin-i18n/dist/esm-node/index.js
|
|
83308
83382
|
var import_lodash8 = require("@modern-js/utils/lodash");
|
|
83309
83383
|
|
|
@@ -83362,8 +83436,8 @@ var I18n2 = class {
|
|
|
83362
83436
|
};
|
|
83363
83437
|
}
|
|
83364
83438
|
constructor() {
|
|
83365
|
-
|
|
83366
|
-
|
|
83439
|
+
this.language = "en";
|
|
83440
|
+
this.languageMap = {};
|
|
83367
83441
|
}
|
|
83368
83442
|
};
|
|
83369
83443
|
|
|
@@ -83396,10 +83470,8 @@ var ZH_LOCALE2 = {
|
|
|
83396
83470
|
i18n: "启用「国际化(i18n)」功能",
|
|
83397
83471
|
test: "启用「单元测试 / 集成测试」功能",
|
|
83398
83472
|
e2e_test: "启用「E2E 测试」功能",
|
|
83399
|
-
storybook: "启用「Storybook」",
|
|
83400
83473
|
storybookV7: "启用「Storybook」V7",
|
|
83401
83474
|
runtime_api: "启用「Runtime API」",
|
|
83402
|
-
mwa_storybook: "启用「Visual Testing (Storybook)」模式",
|
|
83403
83475
|
ssg: "启用「SSG」功能",
|
|
83404
83476
|
polyfill: "启用「基于 UA 的 Polyfill」功能",
|
|
83405
83477
|
proxy: "启用「全局代理」",
|
|
@@ -83494,10 +83566,8 @@ var EN_LOCALE2 = {
|
|
|
83494
83566
|
i18n: "Enable Internationalization (i18n)",
|
|
83495
83567
|
test: "Enable Unit Test / Integration Test",
|
|
83496
83568
|
e2e_test: "Enable E2E Test",
|
|
83497
|
-
storybook: "Enable Storybook",
|
|
83498
83569
|
storybookV7: "Enable Storybook V7",
|
|
83499
83570
|
runtime_api: "Enable Runtime API",
|
|
83500
|
-
mwa_storybook: "Enable Visual Testing (Storybook)",
|
|
83501
83571
|
ssg: "Enable SSG",
|
|
83502
83572
|
polyfill: "Enable UA-based Polyfill Feature",
|
|
83503
83573
|
proxy: "Enable Global Proxy",
|
|
@@ -83887,7 +83957,6 @@ var ActionFunction;
|
|
|
83887
83957
|
ActionFunction2["I18n"] = "i18n";
|
|
83888
83958
|
ActionFunction2["Test"] = "test";
|
|
83889
83959
|
ActionFunction2["E2ETest"] = "e2e_test";
|
|
83890
|
-
ActionFunction2["Storybook"] = "storybook";
|
|
83891
83960
|
ActionFunction2["StorybookV7"] = "storybookV7";
|
|
83892
83961
|
ActionFunction2["RuntimeApi"] = "runtimeApi";
|
|
83893
83962
|
ActionFunction2["SSG"] = "ssg";
|
|
@@ -83921,7 +83990,6 @@ var ActionFunctionText = {
|
|
|
83921
83990
|
["i18n"]: () => i18n2.t(localeKeys2.action.function.i18n),
|
|
83922
83991
|
["test"]: () => i18n2.t(localeKeys2.action.function.test),
|
|
83923
83992
|
["e2e_test"]: () => i18n2.t(localeKeys2.action.function.e2e_test),
|
|
83924
|
-
["storybook"]: () => i18n2.t(localeKeys2.action.function.storybook),
|
|
83925
83993
|
["storybookV7"]: () => i18n2.t(localeKeys2.action.function.storybookV7),
|
|
83926
83994
|
["runtimeApi"]: () => i18n2.t(localeKeys2.action.function.runtime_api),
|
|
83927
83995
|
["ssg"]: () => i18n2.t(localeKeys2.action.function.ssg),
|
|
@@ -83949,7 +84017,6 @@ var MWAActionFunctions = [
|
|
|
83949
84017
|
ActionFunction.Test,
|
|
83950
84018
|
ActionFunction.Polyfill,
|
|
83951
84019
|
ActionFunction.Proxy,
|
|
83952
|
-
ActionFunction.Storybook,
|
|
83953
84020
|
ActionFunction.StorybookV7
|
|
83954
84021
|
];
|
|
83955
84022
|
var MWAActionElements = [
|
|
@@ -84007,7 +84074,7 @@ var getMWANewActionSchema = (extra = {}) => {
|
|
|
84007
84074
|
title: ActionTypeQuestionText[ActionType.Function](),
|
|
84008
84075
|
enum: funcs.map((func) => ({
|
|
84009
84076
|
value: func,
|
|
84010
|
-
label:
|
|
84077
|
+
label: ActionFunctionText[func]()
|
|
84011
84078
|
})),
|
|
84012
84079
|
"x-reactions": [
|
|
84013
84080
|
{
|
|
@@ -84048,7 +84115,6 @@ var getMWANewActionSchema = (extra = {}) => {
|
|
|
84048
84115
|
var MWAActionFunctionsDevDependencies = {
|
|
84049
84116
|
[ActionFunction.SSG]: "@modern-js/plugin-ssg",
|
|
84050
84117
|
[ActionFunction.Test]: "@modern-js/plugin-testing",
|
|
84051
|
-
[ActionFunction.Storybook]: "@modern-js/plugin-storybook",
|
|
84052
84118
|
[ActionFunction.StorybookV7]: "@modern-js/storybook",
|
|
84053
84119
|
[ActionFunction.Proxy]: "@modern-js/plugin-proxy",
|
|
84054
84120
|
[ActionFunction.TailwindCSS]: "tailwindcss",
|
|
@@ -84080,7 +84146,6 @@ var MWANewActionGenerators = {
|
|
|
84080
84146
|
[ActionFunction.BFF]: "@modern-js/bff-generator",
|
|
84081
84147
|
[ActionFunction.MicroFrontend]: "@modern-js/dependence-generator",
|
|
84082
84148
|
[ActionFunction.Test]: "@modern-js/test-generator",
|
|
84083
|
-
[ActionFunction.Storybook]: "@modern-js/dependence-generator",
|
|
84084
84149
|
[ActionFunction.StorybookV7]: "@modern-js/storybook-next-generator",
|
|
84085
84150
|
[ActionFunction.SSG]: "@modern-js/ssg-generator",
|
|
84086
84151
|
[ActionFunction.Polyfill]: "@modern-js/dependence-generator",
|
|
@@ -84100,7 +84165,6 @@ var MWANewActionPluginName = {
|
|
|
84100
84165
|
[ActionFunction.BFF]: "bffPlugin",
|
|
84101
84166
|
[ActionFunction.MicroFrontend]: "garfishPlugin",
|
|
84102
84167
|
[ActionFunction.Test]: "testingPlugin",
|
|
84103
|
-
[ActionFunction.Storybook]: "storybookPlugin",
|
|
84104
84168
|
[ActionFunction.SSG]: "ssgPlugin",
|
|
84105
84169
|
[ActionFunction.Polyfill]: "polyfillPlugin",
|
|
84106
84170
|
[ActionFunction.Proxy]: "proxyPlugin",
|
|
@@ -84119,7 +84183,6 @@ var MWANewActionPluginDependence = {
|
|
|
84119
84183
|
[ActionFunction.BFF]: "@modern-js/plugin-bff",
|
|
84120
84184
|
[ActionFunction.MicroFrontend]: "@modern-js/plugin-garfish",
|
|
84121
84185
|
[ActionFunction.Test]: "@modern-js/plugin-testing",
|
|
84122
|
-
[ActionFunction.Storybook]: "@modern-js/plugin-storybook",
|
|
84123
84186
|
[ActionFunction.SSG]: "@modern-js/plugin-ssg",
|
|
84124
84187
|
[ActionFunction.Polyfill]: "@modern-js/plugin-polyfill",
|
|
84125
84188
|
[ActionFunction.Proxy]: "@modern-js/plugin-proxy",
|
|
@@ -84260,194 +84323,8 @@ var SolutionSchemas = {
|
|
|
84260
84323
|
custom: getBaseSchema
|
|
84261
84324
|
};
|
|
84262
84325
|
|
|
84263
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_async_to_generator.js
|
|
84264
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
84265
|
-
try {
|
|
84266
|
-
var info = gen[key](arg);
|
|
84267
|
-
var value = info.value;
|
|
84268
|
-
} catch (error) {
|
|
84269
|
-
reject(error);
|
|
84270
|
-
return;
|
|
84271
|
-
}
|
|
84272
|
-
if (info.done)
|
|
84273
|
-
resolve(value);
|
|
84274
|
-
else
|
|
84275
|
-
Promise.resolve(value).then(_next, _throw);
|
|
84276
|
-
}
|
|
84277
|
-
function _async_to_generator(fn) {
|
|
84278
|
-
return function() {
|
|
84279
|
-
var self3 = this, args = arguments;
|
|
84280
|
-
return new Promise(function(resolve, reject) {
|
|
84281
|
-
var gen = fn.apply(self3, args);
|
|
84282
|
-
function _next(value) {
|
|
84283
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
84284
|
-
}
|
|
84285
|
-
function _throw(err) {
|
|
84286
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
84287
|
-
}
|
|
84288
|
-
_next(void 0);
|
|
84289
|
-
});
|
|
84290
|
-
};
|
|
84291
|
-
}
|
|
84292
|
-
|
|
84293
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_class_call_check.js
|
|
84294
|
-
function _class_call_check(instance, Constructor) {
|
|
84295
|
-
if (!(instance instanceof Constructor))
|
|
84296
|
-
throw new TypeError("Cannot call a class as a function");
|
|
84297
|
-
}
|
|
84298
|
-
|
|
84299
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_create_class.js
|
|
84300
|
-
function _defineProperties(target, props) {
|
|
84301
|
-
for (var i = 0; i < props.length; i++) {
|
|
84302
|
-
var descriptor = props[i];
|
|
84303
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
84304
|
-
descriptor.configurable = true;
|
|
84305
|
-
if ("value" in descriptor)
|
|
84306
|
-
descriptor.writable = true;
|
|
84307
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
84308
|
-
}
|
|
84309
|
-
}
|
|
84310
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
84311
|
-
if (protoProps)
|
|
84312
|
-
_defineProperties(Constructor.prototype, protoProps);
|
|
84313
|
-
if (staticProps)
|
|
84314
|
-
_defineProperties(Constructor, staticProps);
|
|
84315
|
-
return Constructor;
|
|
84316
|
-
}
|
|
84317
|
-
|
|
84318
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_spread.js
|
|
84319
|
-
function _object_spread(target) {
|
|
84320
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
84321
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
84322
|
-
var ownKeys2 = Object.keys(source);
|
|
84323
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
84324
|
-
ownKeys2 = ownKeys2.concat(
|
|
84325
|
-
Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
84326
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
84327
|
-
})
|
|
84328
|
-
);
|
|
84329
|
-
}
|
|
84330
|
-
ownKeys2.forEach(function(key) {
|
|
84331
|
-
_define_property2(target, key, source[key]);
|
|
84332
|
-
});
|
|
84333
|
-
}
|
|
84334
|
-
return target;
|
|
84335
|
-
}
|
|
84336
|
-
|
|
84337
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_spread_props.js
|
|
84338
|
-
function ownKeys(object, enumerableOnly) {
|
|
84339
|
-
var keys = Object.keys(object);
|
|
84340
|
-
if (Object.getOwnPropertySymbols) {
|
|
84341
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
84342
|
-
if (enumerableOnly) {
|
|
84343
|
-
symbols = symbols.filter(function(sym) {
|
|
84344
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
84345
|
-
});
|
|
84346
|
-
}
|
|
84347
|
-
keys.push.apply(keys, symbols);
|
|
84348
|
-
}
|
|
84349
|
-
return keys;
|
|
84350
|
-
}
|
|
84351
|
-
function _object_spread_props(target, source) {
|
|
84352
|
-
source = source != null ? source : {};
|
|
84353
|
-
if (Object.getOwnPropertyDescriptors)
|
|
84354
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
84355
|
-
else {
|
|
84356
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
84357
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
84358
|
-
});
|
|
84359
|
-
}
|
|
84360
|
-
return target;
|
|
84361
|
-
}
|
|
84362
|
-
|
|
84363
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_without_properties_loose.js
|
|
84364
|
-
function _object_without_properties_loose(source, excluded) {
|
|
84365
|
-
if (source == null)
|
|
84366
|
-
return {};
|
|
84367
|
-
var target = {};
|
|
84368
|
-
var sourceKeys = Object.keys(source);
|
|
84369
|
-
var key, i;
|
|
84370
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
84371
|
-
key = sourceKeys[i];
|
|
84372
|
-
if (excluded.indexOf(key) >= 0)
|
|
84373
|
-
continue;
|
|
84374
|
-
target[key] = source[key];
|
|
84375
|
-
}
|
|
84376
|
-
return target;
|
|
84377
|
-
}
|
|
84378
|
-
|
|
84379
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_without_properties.js
|
|
84380
|
-
function _object_without_properties(source, excluded) {
|
|
84381
|
-
if (source == null)
|
|
84382
|
-
return {};
|
|
84383
|
-
var target = _object_without_properties_loose(source, excluded);
|
|
84384
|
-
var key, i;
|
|
84385
|
-
if (Object.getOwnPropertySymbols) {
|
|
84386
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
84387
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
84388
|
-
key = sourceSymbolKeys[i];
|
|
84389
|
-
if (excluded.indexOf(key) >= 0)
|
|
84390
|
-
continue;
|
|
84391
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
|
84392
|
-
continue;
|
|
84393
|
-
target[key] = source[key];
|
|
84394
|
-
}
|
|
84395
|
-
}
|
|
84396
|
-
return target;
|
|
84397
|
-
}
|
|
84398
|
-
|
|
84399
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_array_like_to_array.js
|
|
84400
|
-
function _array_like_to_array(arr, len) {
|
|
84401
|
-
if (len == null || len > arr.length)
|
|
84402
|
-
len = arr.length;
|
|
84403
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
84404
|
-
arr2[i] = arr[i];
|
|
84405
|
-
return arr2;
|
|
84406
|
-
}
|
|
84407
|
-
|
|
84408
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_array_without_holes.js
|
|
84409
|
-
function _array_without_holes(arr) {
|
|
84410
|
-
if (Array.isArray(arr))
|
|
84411
|
-
return _array_like_to_array(arr);
|
|
84412
|
-
}
|
|
84413
|
-
|
|
84414
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_iterable_to_array.js
|
|
84415
|
-
function _iterable_to_array(iter) {
|
|
84416
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
|
|
84417
|
-
return Array.from(iter);
|
|
84418
|
-
}
|
|
84419
|
-
}
|
|
84420
|
-
|
|
84421
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_non_iterable_spread.js
|
|
84422
|
-
function _non_iterable_spread() {
|
|
84423
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
84424
|
-
}
|
|
84425
|
-
|
|
84426
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_unsupported_iterable_to_array.js
|
|
84427
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
84428
|
-
if (!o)
|
|
84429
|
-
return;
|
|
84430
|
-
if (typeof o === "string")
|
|
84431
|
-
return _array_like_to_array(o, minLen);
|
|
84432
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
84433
|
-
if (n === "Object" && o.constructor)
|
|
84434
|
-
n = o.constructor.name;
|
|
84435
|
-
if (n === "Map" || n === "Set")
|
|
84436
|
-
return Array.from(n);
|
|
84437
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
84438
|
-
return _array_like_to_array(o, minLen);
|
|
84439
|
-
}
|
|
84440
|
-
|
|
84441
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_to_consumable_array.js
|
|
84442
|
-
function _to_consumable_array(arr) {
|
|
84443
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
84444
|
-
}
|
|
84445
|
-
|
|
84446
|
-
// ../../generator-plugin/dist/esm/index.js
|
|
84447
|
-
var import_path17 = __toESM(require("path"));
|
|
84448
|
-
|
|
84449
84326
|
// ../../generator-utils/dist/esm/index.js
|
|
84450
|
-
var
|
|
84327
|
+
var import_path12 = __toESM(require("path"));
|
|
84451
84328
|
var import_utils49 = require("@modern-js/utils");
|
|
84452
84329
|
|
|
84453
84330
|
// ../../generator-utils/dist/esm/utils/stripAnsi.js
|
|
@@ -84568,6 +84445,21 @@ async function getAvailableVersion(packageName, currentVersion, registry2) {
|
|
|
84568
84445
|
return currentVersion;
|
|
84569
84446
|
}
|
|
84570
84447
|
|
|
84448
|
+
// ../../generator-utils/dist/esm/utils/getGeneratorPath.js
|
|
84449
|
+
var import_path11 = __toESM(require("path"));
|
|
84450
|
+
var getGeneratorPath = (generator, distTag, paths) => {
|
|
84451
|
+
if (process.env.CODESMITH_ENV === "development") {
|
|
84452
|
+
return import_path11.default.dirname(require.resolve(generator, {
|
|
84453
|
+
paths: paths !== null && paths !== void 0 ? paths : [
|
|
84454
|
+
process.cwd()
|
|
84455
|
+
]
|
|
84456
|
+
}));
|
|
84457
|
+
} else if (distTag) {
|
|
84458
|
+
return `${generator}@${distTag}`;
|
|
84459
|
+
}
|
|
84460
|
+
return generator;
|
|
84461
|
+
};
|
|
84462
|
+
|
|
84571
84463
|
// ../../generator-utils/dist/esm/index.js
|
|
84572
84464
|
var import_utils50 = require("@modern-js/utils");
|
|
84573
84465
|
async function getPackageVersion(packageName, registry2) {
|
|
@@ -84615,13 +84507,13 @@ async function getModernPluginVersion(solution, packageName, options = {
|
|
|
84615
84507
|
if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
|
|
84616
84508
|
return getLatetPluginVersion("latest");
|
|
84617
84509
|
}
|
|
84618
|
-
let pkgPath =
|
|
84510
|
+
let pkgPath = import_path12.default.join(require.resolve(SolutionToolsMap[solution], {
|
|
84619
84511
|
paths: [
|
|
84620
84512
|
cwd
|
|
84621
84513
|
]
|
|
84622
84514
|
}), "../../..", "package.json");
|
|
84623
84515
|
if (solution === Solution.Module) {
|
|
84624
|
-
pkgPath =
|
|
84516
|
+
pkgPath = import_path12.default.join(require.resolve(SolutionToolsMap[solution], {
|
|
84625
84517
|
paths: [
|
|
84626
84518
|
cwd
|
|
84627
84519
|
]
|
|
@@ -84642,17 +84534,210 @@ async function getModernPluginVersion(solution, packageName, options = {
|
|
|
84642
84534
|
return getLatetPluginVersion();
|
|
84643
84535
|
}
|
|
84644
84536
|
|
|
84537
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_async_to_generator.js
|
|
84538
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
84539
|
+
try {
|
|
84540
|
+
var info = gen[key](arg);
|
|
84541
|
+
var value = info.value;
|
|
84542
|
+
} catch (error) {
|
|
84543
|
+
reject(error);
|
|
84544
|
+
return;
|
|
84545
|
+
}
|
|
84546
|
+
if (info.done)
|
|
84547
|
+
resolve(value);
|
|
84548
|
+
else
|
|
84549
|
+
Promise.resolve(value).then(_next, _throw);
|
|
84550
|
+
}
|
|
84551
|
+
function _async_to_generator(fn) {
|
|
84552
|
+
return function() {
|
|
84553
|
+
var self3 = this, args = arguments;
|
|
84554
|
+
return new Promise(function(resolve, reject) {
|
|
84555
|
+
var gen = fn.apply(self3, args);
|
|
84556
|
+
function _next(value) {
|
|
84557
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
84558
|
+
}
|
|
84559
|
+
function _throw(err) {
|
|
84560
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
84561
|
+
}
|
|
84562
|
+
_next(void 0);
|
|
84563
|
+
});
|
|
84564
|
+
};
|
|
84565
|
+
}
|
|
84566
|
+
|
|
84567
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_class_call_check.js
|
|
84568
|
+
function _class_call_check(instance, Constructor) {
|
|
84569
|
+
if (!(instance instanceof Constructor))
|
|
84570
|
+
throw new TypeError("Cannot call a class as a function");
|
|
84571
|
+
}
|
|
84572
|
+
|
|
84573
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_define_property.js
|
|
84574
|
+
function _define_property2(obj, key, value) {
|
|
84575
|
+
if (key in obj) {
|
|
84576
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
84577
|
+
} else
|
|
84578
|
+
obj[key] = value;
|
|
84579
|
+
return obj;
|
|
84580
|
+
}
|
|
84581
|
+
|
|
84582
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_spread.js
|
|
84583
|
+
function _object_spread(target) {
|
|
84584
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
84585
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
84586
|
+
var ownKeys2 = Object.keys(source);
|
|
84587
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
84588
|
+
ownKeys2 = ownKeys2.concat(
|
|
84589
|
+
Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
84590
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
84591
|
+
})
|
|
84592
|
+
);
|
|
84593
|
+
}
|
|
84594
|
+
ownKeys2.forEach(function(key) {
|
|
84595
|
+
_define_property2(target, key, source[key]);
|
|
84596
|
+
});
|
|
84597
|
+
}
|
|
84598
|
+
return target;
|
|
84599
|
+
}
|
|
84600
|
+
|
|
84601
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_spread_props.js
|
|
84602
|
+
function ownKeys(object, enumerableOnly) {
|
|
84603
|
+
var keys = Object.keys(object);
|
|
84604
|
+
if (Object.getOwnPropertySymbols) {
|
|
84605
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
84606
|
+
if (enumerableOnly) {
|
|
84607
|
+
symbols = symbols.filter(function(sym) {
|
|
84608
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
84609
|
+
});
|
|
84610
|
+
}
|
|
84611
|
+
keys.push.apply(keys, symbols);
|
|
84612
|
+
}
|
|
84613
|
+
return keys;
|
|
84614
|
+
}
|
|
84615
|
+
function _object_spread_props(target, source) {
|
|
84616
|
+
source = source != null ? source : {};
|
|
84617
|
+
if (Object.getOwnPropertyDescriptors)
|
|
84618
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
84619
|
+
else {
|
|
84620
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
84621
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
84622
|
+
});
|
|
84623
|
+
}
|
|
84624
|
+
return target;
|
|
84625
|
+
}
|
|
84626
|
+
|
|
84627
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_without_properties_loose.js
|
|
84628
|
+
function _object_without_properties_loose(source, excluded) {
|
|
84629
|
+
if (source == null)
|
|
84630
|
+
return {};
|
|
84631
|
+
var target = {};
|
|
84632
|
+
var sourceKeys = Object.keys(source);
|
|
84633
|
+
var key, i;
|
|
84634
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
84635
|
+
key = sourceKeys[i];
|
|
84636
|
+
if (excluded.indexOf(key) >= 0)
|
|
84637
|
+
continue;
|
|
84638
|
+
target[key] = source[key];
|
|
84639
|
+
}
|
|
84640
|
+
return target;
|
|
84641
|
+
}
|
|
84642
|
+
|
|
84643
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_without_properties.js
|
|
84644
|
+
function _object_without_properties(source, excluded) {
|
|
84645
|
+
if (source == null)
|
|
84646
|
+
return {};
|
|
84647
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
84648
|
+
var key, i;
|
|
84649
|
+
if (Object.getOwnPropertySymbols) {
|
|
84650
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
84651
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
84652
|
+
key = sourceSymbolKeys[i];
|
|
84653
|
+
if (excluded.indexOf(key) >= 0)
|
|
84654
|
+
continue;
|
|
84655
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
|
84656
|
+
continue;
|
|
84657
|
+
target[key] = source[key];
|
|
84658
|
+
}
|
|
84659
|
+
}
|
|
84660
|
+
return target;
|
|
84661
|
+
}
|
|
84662
|
+
|
|
84663
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_array_like_to_array.js
|
|
84664
|
+
function _array_like_to_array(arr, len) {
|
|
84665
|
+
if (len == null || len > arr.length)
|
|
84666
|
+
len = arr.length;
|
|
84667
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
84668
|
+
arr2[i] = arr[i];
|
|
84669
|
+
return arr2;
|
|
84670
|
+
}
|
|
84671
|
+
|
|
84672
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_array_without_holes.js
|
|
84673
|
+
function _array_without_holes(arr) {
|
|
84674
|
+
if (Array.isArray(arr))
|
|
84675
|
+
return _array_like_to_array(arr);
|
|
84676
|
+
}
|
|
84677
|
+
|
|
84678
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_iterable_to_array.js
|
|
84679
|
+
function _iterable_to_array(iter) {
|
|
84680
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
|
|
84681
|
+
return Array.from(iter);
|
|
84682
|
+
}
|
|
84683
|
+
}
|
|
84684
|
+
|
|
84685
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_non_iterable_spread.js
|
|
84686
|
+
function _non_iterable_spread() {
|
|
84687
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
84688
|
+
}
|
|
84689
|
+
|
|
84690
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_unsupported_iterable_to_array.js
|
|
84691
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
84692
|
+
if (!o)
|
|
84693
|
+
return;
|
|
84694
|
+
if (typeof o === "string")
|
|
84695
|
+
return _array_like_to_array(o, minLen);
|
|
84696
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
84697
|
+
if (n === "Object" && o.constructor)
|
|
84698
|
+
n = o.constructor.name;
|
|
84699
|
+
if (n === "Map" || n === "Set")
|
|
84700
|
+
return Array.from(n);
|
|
84701
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
84702
|
+
return _array_like_to_array(o, minLen);
|
|
84703
|
+
}
|
|
84704
|
+
|
|
84705
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_to_consumable_array.js
|
|
84706
|
+
function _to_consumable_array(arr) {
|
|
84707
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
84708
|
+
}
|
|
84709
|
+
|
|
84645
84710
|
// ../../generator-plugin/dist/esm/index.js
|
|
84711
|
+
var import_path18 = __toESM(require("path"));
|
|
84646
84712
|
var import_lodash14 = require("@modern-js/utils/lodash");
|
|
84647
84713
|
|
|
84714
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_create_class.js
|
|
84715
|
+
function _defineProperties(target, props) {
|
|
84716
|
+
for (var i = 0; i < props.length; i++) {
|
|
84717
|
+
var descriptor = props[i];
|
|
84718
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
84719
|
+
descriptor.configurable = true;
|
|
84720
|
+
if ("value" in descriptor)
|
|
84721
|
+
descriptor.writable = true;
|
|
84722
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
84723
|
+
}
|
|
84724
|
+
}
|
|
84725
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
84726
|
+
if (protoProps)
|
|
84727
|
+
_defineProperties(Constructor.prototype, protoProps);
|
|
84728
|
+
if (staticProps)
|
|
84729
|
+
_defineProperties(Constructor, staticProps);
|
|
84730
|
+
return Constructor;
|
|
84731
|
+
}
|
|
84732
|
+
|
|
84648
84733
|
// ../../generator-plugin/dist/esm/context/file.js
|
|
84649
|
-
var
|
|
84734
|
+
var import_path14 = __toESM(require("path"));
|
|
84650
84735
|
|
|
84651
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.
|
|
84736
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.5/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
|
|
84652
84737
|
var import_comment_json2 = __toESM(require_src2());
|
|
84653
84738
|
var declarationUpdate = __toESM(require_dist());
|
|
84654
84739
|
|
|
84655
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.
|
|
84740
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.5/node_modules/@modern-js/codesmith-api-json/dist/esm-node/utils/index.js
|
|
84656
84741
|
async function editJson(generatorCore, resource, getNewJsonValue) {
|
|
84657
84742
|
const originJsonValue = await resource.value();
|
|
84658
84743
|
const newJsonString = await getNewJsonValue(originJsonValue.content);
|
|
@@ -84665,7 +84750,7 @@ async function editJson(generatorCore, resource, getNewJsonValue) {
|
|
|
84665
84750
|
return newJsonString;
|
|
84666
84751
|
}
|
|
84667
84752
|
|
|
84668
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.
|
|
84753
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.5/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
|
|
84669
84754
|
var JsonAPI = class {
|
|
84670
84755
|
async get(resource) {
|
|
84671
84756
|
const originJsonValue = await resource.value();
|
|
@@ -84711,7 +84796,7 @@ var JsonAPI = class {
|
|
|
84711
84796
|
};
|
|
84712
84797
|
|
|
84713
84798
|
// ../../generator-plugin/dist/esm/utils/file.js
|
|
84714
|
-
var
|
|
84799
|
+
var import_path13 = __toESM(require("path"));
|
|
84715
84800
|
var import_utils52 = require("@modern-js/utils");
|
|
84716
84801
|
var FileType;
|
|
84717
84802
|
(function(FileType22) {
|
|
@@ -84761,20 +84846,20 @@ function _fileExists() {
|
|
|
84761
84846
|
return _fileExists.apply(this, arguments);
|
|
84762
84847
|
}
|
|
84763
84848
|
function dropFileRootFolder(file) {
|
|
84764
|
-
var fileParts =
|
|
84849
|
+
var fileParts = import_path13.default.normalize(file).split(import_path13.default.sep);
|
|
84765
84850
|
fileParts.shift();
|
|
84766
|
-
return fileParts.join(
|
|
84851
|
+
return fileParts.join(import_path13.default.sep);
|
|
84767
84852
|
}
|
|
84768
84853
|
function dropFileRootPath(file, rootPath) {
|
|
84769
84854
|
var fileRootPath = rootPath ? file.replace(rootPath, "") : dropFileRootFolder(file);
|
|
84770
|
-
return fileRootPath.startsWith(
|
|
84855
|
+
return fileRootPath.startsWith(import_path13.default.sep) ? fileRootPath : "".concat(import_path13.default.sep).concat(fileRootPath);
|
|
84771
84856
|
}
|
|
84772
84857
|
function isAbsoluteOrRelativeFileTo(relativePath) {
|
|
84773
84858
|
var isFile2 = function(file) {
|
|
84774
84859
|
return import_utils50.fs.existsSync(file) && import_utils50.fs.lstatSync(file).isFile();
|
|
84775
84860
|
};
|
|
84776
84861
|
return function(fileName) {
|
|
84777
|
-
return isFile2(fileName) || isFile2(
|
|
84862
|
+
return isFile2(fileName) || isFile2(import_path13.default.join(relativePath, fileName));
|
|
84778
84863
|
};
|
|
84779
84864
|
}
|
|
84780
84865
|
function addFile(config, projectPath, templatePath, renderString3) {
|
|
@@ -84786,7 +84871,7 @@ function _addFile() {
|
|
|
84786
84871
|
return __generator(this, function(_state) {
|
|
84787
84872
|
switch (_state.label) {
|
|
84788
84873
|
case 0:
|
|
84789
|
-
fileDestPath =
|
|
84874
|
+
fileDestPath = import_path13.default.join(projectPath, config.file);
|
|
84790
84875
|
return [
|
|
84791
84876
|
4,
|
|
84792
84877
|
fileExists(fileDestPath)
|
|
@@ -84798,13 +84883,13 @@ function _addFile() {
|
|
|
84798
84883
|
}
|
|
84799
84884
|
return [
|
|
84800
84885
|
4,
|
|
84801
|
-
import_utils50.fs.mkdir(
|
|
84886
|
+
import_utils50.fs.mkdir(import_path13.default.dirname(fileDestPath), {
|
|
84802
84887
|
recursive: true
|
|
84803
84888
|
})
|
|
84804
84889
|
];
|
|
84805
84890
|
case 2:
|
|
84806
84891
|
_state.sent();
|
|
84807
|
-
absTemplatePath = config.templateFile ?
|
|
84892
|
+
absTemplatePath = config.templateFile ? import_path13.default.join(templatePath, config.templateFile) : null;
|
|
84808
84893
|
if (!(absTemplatePath != null && (config.type === "binary" || Object.keys(config.data || {}).length === 0)))
|
|
84809
84894
|
return [
|
|
84810
84895
|
3,
|
|
@@ -84874,9 +84959,9 @@ function _addManyFiles() {
|
|
|
84874
84959
|
config.templateFiles = config.templateFiles();
|
|
84875
84960
|
}
|
|
84876
84961
|
config.templateFiles = config.templateFiles.map(function(templateFile2) {
|
|
84877
|
-
return
|
|
84962
|
+
return import_path13.default.join(templatePath, templateFile2);
|
|
84878
84963
|
});
|
|
84879
|
-
config.templateBase = ((_config_templateBase = config.templateBase) === null || _config_templateBase === void 0 ? void 0 : _config_templateBase.startsWith(
|
|
84964
|
+
config.templateBase = ((_config_templateBase = config.templateBase) === null || _config_templateBase === void 0 ? void 0 : _config_templateBase.startsWith(import_path13.default.sep)) ? config.templateBase : "".concat(import_path13.default.sep).concat(config.templateBase || "");
|
|
84880
84965
|
templateFiles = import_utils52.globby.sync(config.templateFiles, {
|
|
84881
84966
|
braceExpansion: false,
|
|
84882
84967
|
dot: config.dot
|
|
@@ -84904,10 +84989,10 @@ function _addManyFiles() {
|
|
|
84904
84989
|
5
|
|
84905
84990
|
];
|
|
84906
84991
|
templateFile = _step.value;
|
|
84907
|
-
absTemplatePath =
|
|
84992
|
+
absTemplatePath = import_path13.default.resolve(templatePath, templateFile);
|
|
84908
84993
|
targetFile = dropFileRootPath(templateFile, config.templateBase);
|
|
84909
84994
|
fileCfg = _object_spread_props(_object_spread({}, config), {
|
|
84910
|
-
file:
|
|
84995
|
+
file: import_path13.default.join(config.destination, config.fileNameFunc ? config.fileNameFunc(targetFile) : targetFile),
|
|
84911
84996
|
templateFile: absTemplatePath,
|
|
84912
84997
|
force: true
|
|
84913
84998
|
});
|
|
@@ -84967,36 +85052,28 @@ var PluginHandlebarsAPI = /* @__PURE__ */ function() {
|
|
|
84967
85052
|
"use strict";
|
|
84968
85053
|
function PluginHandlebarsAPI2() {
|
|
84969
85054
|
_class_call_check(this, PluginHandlebarsAPI2);
|
|
84970
|
-
|
|
84971
|
-
|
|
84972
|
-
}
|
|
85055
|
+
this.helpers = {};
|
|
85056
|
+
this.partials = {};
|
|
85057
|
+
}
|
|
85058
|
+
var _proto = PluginHandlebarsAPI2.prototype;
|
|
85059
|
+
_proto.renderString = function renderString3(template, data) {
|
|
85060
|
+
var helpers = _object_spread({}, this.helpers);
|
|
85061
|
+
var partials = _object_spread({}, this.partials);
|
|
85062
|
+
Object.keys(helpers).forEach(function(h) {
|
|
85063
|
+
return handlebars2.registerHelper(h, helpers[h]);
|
|
85064
|
+
});
|
|
85065
|
+
Object.keys(partials).forEach(function(p) {
|
|
85066
|
+
return handlebars2.registerPartial(p, partials[p]);
|
|
85067
|
+
});
|
|
85068
|
+
return handlebars2.compile(template)(data) || "";
|
|
85069
|
+
};
|
|
85070
|
+
_proto.addHelper = function addHelper(name, fn) {
|
|
85071
|
+
this.helpers[name] = fn;
|
|
85072
|
+
};
|
|
85073
|
+
_proto.addPartial = function addPartial(name, str) {
|
|
85074
|
+
this.partials[name] = str;
|
|
85075
|
+
};
|
|
84973
85076
|
_create_class(PluginHandlebarsAPI2, [
|
|
84974
|
-
{
|
|
84975
|
-
key: "renderString",
|
|
84976
|
-
value: function renderString3(template, data) {
|
|
84977
|
-
var helpers = _object_spread({}, this.helpers);
|
|
84978
|
-
var partials = _object_spread({}, this.partials);
|
|
84979
|
-
Object.keys(helpers).forEach(function(h) {
|
|
84980
|
-
return handlebars2.registerHelper(h, helpers[h]);
|
|
84981
|
-
});
|
|
84982
|
-
Object.keys(partials).forEach(function(p) {
|
|
84983
|
-
return handlebars2.registerPartial(p, partials[p]);
|
|
84984
|
-
});
|
|
84985
|
-
return handlebars2.compile(template)(data) || "";
|
|
84986
|
-
}
|
|
84987
|
-
},
|
|
84988
|
-
{
|
|
84989
|
-
key: "addHelper",
|
|
84990
|
-
value: function addHelper(name, fn) {
|
|
84991
|
-
this.helpers[name] = fn;
|
|
84992
|
-
}
|
|
84993
|
-
},
|
|
84994
|
-
{
|
|
84995
|
-
key: "addPartial",
|
|
84996
|
-
value: function addPartial(name, str) {
|
|
84997
|
-
this.partials[name] = str;
|
|
84998
|
-
}
|
|
84999
|
-
},
|
|
85000
85077
|
{
|
|
85001
85078
|
key: "method",
|
|
85002
85079
|
get: function get4() {
|
|
@@ -85017,14 +85094,10 @@ var PluginEjsAPI = /* @__PURE__ */ function() {
|
|
|
85017
85094
|
function PluginEjsAPI2() {
|
|
85018
85095
|
_class_call_check(this, PluginEjsAPI2);
|
|
85019
85096
|
}
|
|
85020
|
-
|
|
85021
|
-
|
|
85022
|
-
|
|
85023
|
-
|
|
85024
|
-
return import_ejs2.default.render(template, data) || "";
|
|
85025
|
-
}
|
|
85026
|
-
}
|
|
85027
|
-
]);
|
|
85097
|
+
var _proto = PluginEjsAPI2.prototype;
|
|
85098
|
+
_proto.renderString = function renderString3(template, data) {
|
|
85099
|
+
return import_ejs2.default.render(template, data) || "";
|
|
85100
|
+
};
|
|
85028
85101
|
return PluginEjsAPI2;
|
|
85029
85102
|
}();
|
|
85030
85103
|
|
|
@@ -85040,13 +85113,250 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
|
85040
85113
|
"use strict";
|
|
85041
85114
|
function PluginFileAPI2() {
|
|
85042
85115
|
_class_call_check(this, PluginFileAPI2);
|
|
85043
|
-
|
|
85044
|
-
|
|
85045
|
-
|
|
85046
|
-
|
|
85047
|
-
_define_property2(this, "jsonAPI", void 0);
|
|
85116
|
+
this.projectPath = "";
|
|
85117
|
+
this.templatePath = "";
|
|
85118
|
+
this.handlebarAPI = new PluginHandlebarsAPI();
|
|
85119
|
+
this.ejsAPI = new PluginEjsAPI();
|
|
85048
85120
|
this.renderString = this.renderString.bind(this);
|
|
85049
85121
|
}
|
|
85122
|
+
var _proto = PluginFileAPI2.prototype;
|
|
85123
|
+
_proto.renderString = function renderString3() {
|
|
85124
|
+
var template = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", data = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "handlebars";
|
|
85125
|
+
if (type === "ejs") {
|
|
85126
|
+
return this.ejsAPI.renderString(template, data);
|
|
85127
|
+
}
|
|
85128
|
+
return this.handlebarAPI.renderString(template, data);
|
|
85129
|
+
};
|
|
85130
|
+
_proto.prepare = function prepare(generator, projectPath, templatePath) {
|
|
85131
|
+
this.projectPath = projectPath;
|
|
85132
|
+
this.jsonAPI = new JsonAPI(generator);
|
|
85133
|
+
this.templatePath = templatePath;
|
|
85134
|
+
};
|
|
85135
|
+
_proto.addFile = function addFile1(params) {
|
|
85136
|
+
var _this = this;
|
|
85137
|
+
return _async_to_generator(function() {
|
|
85138
|
+
return __generator(this, function(_state) {
|
|
85139
|
+
switch (_state.label) {
|
|
85140
|
+
case 0:
|
|
85141
|
+
return [
|
|
85142
|
+
4,
|
|
85143
|
+
addFile(params, _this.projectPath, _this.templatePath, _this.renderString)
|
|
85144
|
+
];
|
|
85145
|
+
case 1:
|
|
85146
|
+
_state.sent();
|
|
85147
|
+
return [
|
|
85148
|
+
2
|
|
85149
|
+
];
|
|
85150
|
+
}
|
|
85151
|
+
});
|
|
85152
|
+
})();
|
|
85153
|
+
};
|
|
85154
|
+
_proto.addManyFiles = function addManyFiles1(params) {
|
|
85155
|
+
var _this = this;
|
|
85156
|
+
return _async_to_generator(function() {
|
|
85157
|
+
return __generator(this, function(_state) {
|
|
85158
|
+
switch (_state.label) {
|
|
85159
|
+
case 0:
|
|
85160
|
+
return [
|
|
85161
|
+
4,
|
|
85162
|
+
addManyFiles(params, _this.projectPath, _this.templatePath, _this.renderString)
|
|
85163
|
+
];
|
|
85164
|
+
case 1:
|
|
85165
|
+
_state.sent();
|
|
85166
|
+
return [
|
|
85167
|
+
2
|
|
85168
|
+
];
|
|
85169
|
+
}
|
|
85170
|
+
});
|
|
85171
|
+
})();
|
|
85172
|
+
};
|
|
85173
|
+
_proto.updateJSONFile = function updateJSONFile(fileName, updateInfo) {
|
|
85174
|
+
var _this = this;
|
|
85175
|
+
return _async_to_generator(function() {
|
|
85176
|
+
var fsMaterial;
|
|
85177
|
+
return __generator(this, function(_state) {
|
|
85178
|
+
switch (_state.label) {
|
|
85179
|
+
case 0:
|
|
85180
|
+
fsMaterial = new FsMaterial(_this.projectPath);
|
|
85181
|
+
return [
|
|
85182
|
+
4,
|
|
85183
|
+
_this.jsonAPI.update(fsMaterial.get(fileName), {
|
|
85184
|
+
query: {},
|
|
85185
|
+
update: {
|
|
85186
|
+
$set: _object_spread({}, updateInfo)
|
|
85187
|
+
}
|
|
85188
|
+
})
|
|
85189
|
+
];
|
|
85190
|
+
case 1:
|
|
85191
|
+
_state.sent();
|
|
85192
|
+
return [
|
|
85193
|
+
2
|
|
85194
|
+
];
|
|
85195
|
+
}
|
|
85196
|
+
});
|
|
85197
|
+
})();
|
|
85198
|
+
};
|
|
85199
|
+
_proto.updateModernConfig = function updateModernConfig(updateInfo) {
|
|
85200
|
+
var _this = this;
|
|
85201
|
+
return _async_to_generator(function() {
|
|
85202
|
+
var update;
|
|
85203
|
+
return __generator(this, function(_state) {
|
|
85204
|
+
switch (_state.label) {
|
|
85205
|
+
case 0:
|
|
85206
|
+
update = {};
|
|
85207
|
+
Object.keys(updateInfo).forEach(function(key) {
|
|
85208
|
+
update["modernConfig.".concat(key)] = updateInfo[key];
|
|
85209
|
+
});
|
|
85210
|
+
return [
|
|
85211
|
+
4,
|
|
85212
|
+
_this.updateJSONFile("package.json", update)
|
|
85213
|
+
];
|
|
85214
|
+
case 1:
|
|
85215
|
+
_state.sent();
|
|
85216
|
+
return [
|
|
85217
|
+
2
|
|
85218
|
+
];
|
|
85219
|
+
}
|
|
85220
|
+
});
|
|
85221
|
+
})();
|
|
85222
|
+
};
|
|
85223
|
+
_proto.updateTextRawFile = function updateTextRawFile(fileName, update) {
|
|
85224
|
+
var _this = this;
|
|
85225
|
+
return _async_to_generator(function() {
|
|
85226
|
+
var content, newContent;
|
|
85227
|
+
return __generator(this, function(_state) {
|
|
85228
|
+
switch (_state.label) {
|
|
85229
|
+
case 0:
|
|
85230
|
+
return [
|
|
85231
|
+
4,
|
|
85232
|
+
import_utils50.fs.readFile(import_path14.default.join(_this.projectPath, fileName), "utf-8")
|
|
85233
|
+
];
|
|
85234
|
+
case 1:
|
|
85235
|
+
content = _state.sent();
|
|
85236
|
+
newContent = update(content.split("\n"));
|
|
85237
|
+
return [
|
|
85238
|
+
4,
|
|
85239
|
+
import_utils50.fs.writeFile(import_path14.default.join(_this.projectPath, fileName), newContent.join("\n"), "utf-8")
|
|
85240
|
+
];
|
|
85241
|
+
case 2:
|
|
85242
|
+
_state.sent();
|
|
85243
|
+
return [
|
|
85244
|
+
2
|
|
85245
|
+
];
|
|
85246
|
+
}
|
|
85247
|
+
});
|
|
85248
|
+
})();
|
|
85249
|
+
};
|
|
85250
|
+
_proto.rmFile = function rmFile(fileName) {
|
|
85251
|
+
var _this = this;
|
|
85252
|
+
return _async_to_generator(function() {
|
|
85253
|
+
var file;
|
|
85254
|
+
return __generator(this, function(_state) {
|
|
85255
|
+
switch (_state.label) {
|
|
85256
|
+
case 0:
|
|
85257
|
+
file = import_path14.default.join(_this.projectPath, fileName);
|
|
85258
|
+
return [
|
|
85259
|
+
4,
|
|
85260
|
+
fileExists(file)
|
|
85261
|
+
];
|
|
85262
|
+
case 1:
|
|
85263
|
+
if (!_state.sent())
|
|
85264
|
+
return [
|
|
85265
|
+
3,
|
|
85266
|
+
3
|
|
85267
|
+
];
|
|
85268
|
+
return [
|
|
85269
|
+
4,
|
|
85270
|
+
import_utils50.fs.rm(file)
|
|
85271
|
+
];
|
|
85272
|
+
case 2:
|
|
85273
|
+
_state.sent();
|
|
85274
|
+
_state.label = 3;
|
|
85275
|
+
case 3:
|
|
85276
|
+
return [
|
|
85277
|
+
2
|
|
85278
|
+
];
|
|
85279
|
+
}
|
|
85280
|
+
});
|
|
85281
|
+
})();
|
|
85282
|
+
};
|
|
85283
|
+
_proto.rmDir = function rmDir(dirName) {
|
|
85284
|
+
var _this = this;
|
|
85285
|
+
return _async_to_generator(function() {
|
|
85286
|
+
var dir, stat, e;
|
|
85287
|
+
return __generator(this, function(_state) {
|
|
85288
|
+
switch (_state.label) {
|
|
85289
|
+
case 0:
|
|
85290
|
+
dir = import_path14.default.join(_this.projectPath, dirName);
|
|
85291
|
+
_state.label = 1;
|
|
85292
|
+
case 1:
|
|
85293
|
+
_state.trys.push([
|
|
85294
|
+
1,
|
|
85295
|
+
5,
|
|
85296
|
+
,
|
|
85297
|
+
6
|
|
85298
|
+
]);
|
|
85299
|
+
return [
|
|
85300
|
+
4,
|
|
85301
|
+
import_utils50.fs.stat(dir)
|
|
85302
|
+
];
|
|
85303
|
+
case 2:
|
|
85304
|
+
stat = _state.sent();
|
|
85305
|
+
if (!stat.isDirectory())
|
|
85306
|
+
return [
|
|
85307
|
+
3,
|
|
85308
|
+
4
|
|
85309
|
+
];
|
|
85310
|
+
return [
|
|
85311
|
+
4,
|
|
85312
|
+
import_utils50.fs.rm(dir, {
|
|
85313
|
+
recursive: true
|
|
85314
|
+
})
|
|
85315
|
+
];
|
|
85316
|
+
case 3:
|
|
85317
|
+
_state.sent();
|
|
85318
|
+
_state.label = 4;
|
|
85319
|
+
case 4:
|
|
85320
|
+
return [
|
|
85321
|
+
3,
|
|
85322
|
+
6
|
|
85323
|
+
];
|
|
85324
|
+
case 5:
|
|
85325
|
+
e = _state.sent();
|
|
85326
|
+
return [
|
|
85327
|
+
3,
|
|
85328
|
+
6
|
|
85329
|
+
];
|
|
85330
|
+
case 6:
|
|
85331
|
+
return [
|
|
85332
|
+
2
|
|
85333
|
+
];
|
|
85334
|
+
}
|
|
85335
|
+
});
|
|
85336
|
+
})();
|
|
85337
|
+
};
|
|
85338
|
+
_proto.isFileExist = function isFileExist(fileName) {
|
|
85339
|
+
var _this = this;
|
|
85340
|
+
return _async_to_generator(function() {
|
|
85341
|
+
return __generator(this, function(_state) {
|
|
85342
|
+
return [
|
|
85343
|
+
2,
|
|
85344
|
+
fileExists(import_path14.default.join(_this.projectPath, fileName))
|
|
85345
|
+
];
|
|
85346
|
+
});
|
|
85347
|
+
})();
|
|
85348
|
+
};
|
|
85349
|
+
_proto.readDir = function readDir(dir) {
|
|
85350
|
+
var _this = this;
|
|
85351
|
+
return _async_to_generator(function() {
|
|
85352
|
+
return __generator(this, function(_state) {
|
|
85353
|
+
return [
|
|
85354
|
+
2,
|
|
85355
|
+
import_utils50.fs.readdir(import_path14.default.join(_this.projectPath, dir))
|
|
85356
|
+
];
|
|
85357
|
+
});
|
|
85358
|
+
})();
|
|
85359
|
+
};
|
|
85050
85360
|
_create_class(PluginFileAPI2, [
|
|
85051
85361
|
{
|
|
85052
85362
|
key: "context",
|
|
@@ -85072,276 +85382,6 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
|
85072
85382
|
addPartial: this.handlebarAPI.addPartial.bind(this.handlebarAPI)
|
|
85073
85383
|
};
|
|
85074
85384
|
}
|
|
85075
|
-
},
|
|
85076
|
-
{
|
|
85077
|
-
key: "renderString",
|
|
85078
|
-
value: function renderString3() {
|
|
85079
|
-
var template = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", data = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "handlebars";
|
|
85080
|
-
if (type === "ejs") {
|
|
85081
|
-
return this.ejsAPI.renderString(template, data);
|
|
85082
|
-
}
|
|
85083
|
-
return this.handlebarAPI.renderString(template, data);
|
|
85084
|
-
}
|
|
85085
|
-
},
|
|
85086
|
-
{
|
|
85087
|
-
key: "prepare",
|
|
85088
|
-
value: function prepare(generator, projectPath, templatePath) {
|
|
85089
|
-
this.projectPath = projectPath;
|
|
85090
|
-
this.jsonAPI = new JsonAPI(generator);
|
|
85091
|
-
this.templatePath = templatePath;
|
|
85092
|
-
}
|
|
85093
|
-
},
|
|
85094
|
-
{
|
|
85095
|
-
key: "addFile",
|
|
85096
|
-
value: function addFile1(params) {
|
|
85097
|
-
var _this = this;
|
|
85098
|
-
return _async_to_generator(function() {
|
|
85099
|
-
return __generator(this, function(_state) {
|
|
85100
|
-
switch (_state.label) {
|
|
85101
|
-
case 0:
|
|
85102
|
-
return [
|
|
85103
|
-
4,
|
|
85104
|
-
addFile(params, _this.projectPath, _this.templatePath, _this.renderString)
|
|
85105
|
-
];
|
|
85106
|
-
case 1:
|
|
85107
|
-
_state.sent();
|
|
85108
|
-
return [
|
|
85109
|
-
2
|
|
85110
|
-
];
|
|
85111
|
-
}
|
|
85112
|
-
});
|
|
85113
|
-
})();
|
|
85114
|
-
}
|
|
85115
|
-
},
|
|
85116
|
-
{
|
|
85117
|
-
key: "addManyFiles",
|
|
85118
|
-
value: function addManyFiles1(params) {
|
|
85119
|
-
var _this = this;
|
|
85120
|
-
return _async_to_generator(function() {
|
|
85121
|
-
return __generator(this, function(_state) {
|
|
85122
|
-
switch (_state.label) {
|
|
85123
|
-
case 0:
|
|
85124
|
-
return [
|
|
85125
|
-
4,
|
|
85126
|
-
addManyFiles(params, _this.projectPath, _this.templatePath, _this.renderString)
|
|
85127
|
-
];
|
|
85128
|
-
case 1:
|
|
85129
|
-
_state.sent();
|
|
85130
|
-
return [
|
|
85131
|
-
2
|
|
85132
|
-
];
|
|
85133
|
-
}
|
|
85134
|
-
});
|
|
85135
|
-
})();
|
|
85136
|
-
}
|
|
85137
|
-
},
|
|
85138
|
-
{
|
|
85139
|
-
key: "updateJSONFile",
|
|
85140
|
-
value: function updateJSONFile(fileName, updateInfo) {
|
|
85141
|
-
var _this = this;
|
|
85142
|
-
return _async_to_generator(function() {
|
|
85143
|
-
var fsMaterial;
|
|
85144
|
-
return __generator(this, function(_state) {
|
|
85145
|
-
switch (_state.label) {
|
|
85146
|
-
case 0:
|
|
85147
|
-
fsMaterial = new FsMaterial(_this.projectPath);
|
|
85148
|
-
return [
|
|
85149
|
-
4,
|
|
85150
|
-
_this.jsonAPI.update(fsMaterial.get(fileName), {
|
|
85151
|
-
query: {},
|
|
85152
|
-
update: {
|
|
85153
|
-
$set: _object_spread({}, updateInfo)
|
|
85154
|
-
}
|
|
85155
|
-
})
|
|
85156
|
-
];
|
|
85157
|
-
case 1:
|
|
85158
|
-
_state.sent();
|
|
85159
|
-
return [
|
|
85160
|
-
2
|
|
85161
|
-
];
|
|
85162
|
-
}
|
|
85163
|
-
});
|
|
85164
|
-
})();
|
|
85165
|
-
}
|
|
85166
|
-
},
|
|
85167
|
-
{
|
|
85168
|
-
key: "updateModernConfig",
|
|
85169
|
-
value: function updateModernConfig(updateInfo) {
|
|
85170
|
-
var _this = this;
|
|
85171
|
-
return _async_to_generator(function() {
|
|
85172
|
-
var update;
|
|
85173
|
-
return __generator(this, function(_state) {
|
|
85174
|
-
switch (_state.label) {
|
|
85175
|
-
case 0:
|
|
85176
|
-
update = {};
|
|
85177
|
-
Object.keys(updateInfo).forEach(function(key) {
|
|
85178
|
-
update["modernConfig.".concat(key)] = updateInfo[key];
|
|
85179
|
-
});
|
|
85180
|
-
return [
|
|
85181
|
-
4,
|
|
85182
|
-
_this.updateJSONFile("package.json", update)
|
|
85183
|
-
];
|
|
85184
|
-
case 1:
|
|
85185
|
-
_state.sent();
|
|
85186
|
-
return [
|
|
85187
|
-
2
|
|
85188
|
-
];
|
|
85189
|
-
}
|
|
85190
|
-
});
|
|
85191
|
-
})();
|
|
85192
|
-
}
|
|
85193
|
-
},
|
|
85194
|
-
{
|
|
85195
|
-
key: "updateTextRawFile",
|
|
85196
|
-
value: function updateTextRawFile(fileName, update) {
|
|
85197
|
-
var _this = this;
|
|
85198
|
-
return _async_to_generator(function() {
|
|
85199
|
-
var content, newContent;
|
|
85200
|
-
return __generator(this, function(_state) {
|
|
85201
|
-
switch (_state.label) {
|
|
85202
|
-
case 0:
|
|
85203
|
-
return [
|
|
85204
|
-
4,
|
|
85205
|
-
import_utils50.fs.readFile(import_path13.default.join(_this.projectPath, fileName), "utf-8")
|
|
85206
|
-
];
|
|
85207
|
-
case 1:
|
|
85208
|
-
content = _state.sent();
|
|
85209
|
-
newContent = update(content.split("\n"));
|
|
85210
|
-
return [
|
|
85211
|
-
4,
|
|
85212
|
-
import_utils50.fs.writeFile(import_path13.default.join(_this.projectPath, fileName), newContent.join("\n"), "utf-8")
|
|
85213
|
-
];
|
|
85214
|
-
case 2:
|
|
85215
|
-
_state.sent();
|
|
85216
|
-
return [
|
|
85217
|
-
2
|
|
85218
|
-
];
|
|
85219
|
-
}
|
|
85220
|
-
});
|
|
85221
|
-
})();
|
|
85222
|
-
}
|
|
85223
|
-
},
|
|
85224
|
-
{
|
|
85225
|
-
key: "rmFile",
|
|
85226
|
-
value: function rmFile(fileName) {
|
|
85227
|
-
var _this = this;
|
|
85228
|
-
return _async_to_generator(function() {
|
|
85229
|
-
var file;
|
|
85230
|
-
return __generator(this, function(_state) {
|
|
85231
|
-
switch (_state.label) {
|
|
85232
|
-
case 0:
|
|
85233
|
-
file = import_path13.default.join(_this.projectPath, fileName);
|
|
85234
|
-
return [
|
|
85235
|
-
4,
|
|
85236
|
-
fileExists(file)
|
|
85237
|
-
];
|
|
85238
|
-
case 1:
|
|
85239
|
-
if (!_state.sent())
|
|
85240
|
-
return [
|
|
85241
|
-
3,
|
|
85242
|
-
3
|
|
85243
|
-
];
|
|
85244
|
-
return [
|
|
85245
|
-
4,
|
|
85246
|
-
import_utils50.fs.rm(file)
|
|
85247
|
-
];
|
|
85248
|
-
case 2:
|
|
85249
|
-
_state.sent();
|
|
85250
|
-
_state.label = 3;
|
|
85251
|
-
case 3:
|
|
85252
|
-
return [
|
|
85253
|
-
2
|
|
85254
|
-
];
|
|
85255
|
-
}
|
|
85256
|
-
});
|
|
85257
|
-
})();
|
|
85258
|
-
}
|
|
85259
|
-
},
|
|
85260
|
-
{
|
|
85261
|
-
key: "rmDir",
|
|
85262
|
-
value: function rmDir(dirName) {
|
|
85263
|
-
var _this = this;
|
|
85264
|
-
return _async_to_generator(function() {
|
|
85265
|
-
var dir, stat, e;
|
|
85266
|
-
return __generator(this, function(_state) {
|
|
85267
|
-
switch (_state.label) {
|
|
85268
|
-
case 0:
|
|
85269
|
-
dir = import_path13.default.join(_this.projectPath, dirName);
|
|
85270
|
-
_state.label = 1;
|
|
85271
|
-
case 1:
|
|
85272
|
-
_state.trys.push([
|
|
85273
|
-
1,
|
|
85274
|
-
5,
|
|
85275
|
-
,
|
|
85276
|
-
6
|
|
85277
|
-
]);
|
|
85278
|
-
return [
|
|
85279
|
-
4,
|
|
85280
|
-
import_utils50.fs.stat(dir)
|
|
85281
|
-
];
|
|
85282
|
-
case 2:
|
|
85283
|
-
stat = _state.sent();
|
|
85284
|
-
if (!stat.isDirectory())
|
|
85285
|
-
return [
|
|
85286
|
-
3,
|
|
85287
|
-
4
|
|
85288
|
-
];
|
|
85289
|
-
return [
|
|
85290
|
-
4,
|
|
85291
|
-
import_utils50.fs.rm(dir, {
|
|
85292
|
-
recursive: true
|
|
85293
|
-
})
|
|
85294
|
-
];
|
|
85295
|
-
case 3:
|
|
85296
|
-
_state.sent();
|
|
85297
|
-
_state.label = 4;
|
|
85298
|
-
case 4:
|
|
85299
|
-
return [
|
|
85300
|
-
3,
|
|
85301
|
-
6
|
|
85302
|
-
];
|
|
85303
|
-
case 5:
|
|
85304
|
-
e = _state.sent();
|
|
85305
|
-
return [
|
|
85306
|
-
3,
|
|
85307
|
-
6
|
|
85308
|
-
];
|
|
85309
|
-
case 6:
|
|
85310
|
-
return [
|
|
85311
|
-
2
|
|
85312
|
-
];
|
|
85313
|
-
}
|
|
85314
|
-
});
|
|
85315
|
-
})();
|
|
85316
|
-
}
|
|
85317
|
-
},
|
|
85318
|
-
{
|
|
85319
|
-
key: "isFileExist",
|
|
85320
|
-
value: function isFileExist(fileName) {
|
|
85321
|
-
var _this = this;
|
|
85322
|
-
return _async_to_generator(function() {
|
|
85323
|
-
return __generator(this, function(_state) {
|
|
85324
|
-
return [
|
|
85325
|
-
2,
|
|
85326
|
-
fileExists(import_path13.default.join(_this.projectPath, fileName))
|
|
85327
|
-
];
|
|
85328
|
-
});
|
|
85329
|
-
})();
|
|
85330
|
-
}
|
|
85331
|
-
},
|
|
85332
|
-
{
|
|
85333
|
-
key: "readDir",
|
|
85334
|
-
value: function readDir(dir) {
|
|
85335
|
-
var _this = this;
|
|
85336
|
-
return _async_to_generator(function() {
|
|
85337
|
-
return __generator(this, function(_state) {
|
|
85338
|
-
return [
|
|
85339
|
-
2,
|
|
85340
|
-
import_utils50.fs.readdir(import_path13.default.join(_this.projectPath, dir))
|
|
85341
|
-
];
|
|
85342
|
-
});
|
|
85343
|
-
})();
|
|
85344
|
-
}
|
|
85345
85385
|
}
|
|
85346
85386
|
]);
|
|
85347
85387
|
return PluginFileAPI2;
|
|
@@ -85352,10 +85392,66 @@ var PluginGitAPI = /* @__PURE__ */ function() {
|
|
|
85352
85392
|
"use strict";
|
|
85353
85393
|
function PluginGitAPI2() {
|
|
85354
85394
|
_class_call_check(this, PluginGitAPI2);
|
|
85355
|
-
|
|
85356
|
-
_define_property2(this, "gitApi", void 0);
|
|
85357
|
-
_define_property2(this, "projectPath", void 0);
|
|
85395
|
+
this.gitMessage = "";
|
|
85358
85396
|
}
|
|
85397
|
+
var _proto = PluginGitAPI2.prototype;
|
|
85398
|
+
_proto.setGitMessage = function setGitMessage(gitMessage) {
|
|
85399
|
+
this.gitMessage = gitMessage;
|
|
85400
|
+
};
|
|
85401
|
+
_proto.prepare = function prepare(generator, projectPath) {
|
|
85402
|
+
this.gitApi = new GitAPI(generator);
|
|
85403
|
+
this.projectPath = projectPath;
|
|
85404
|
+
};
|
|
85405
|
+
_proto.isInGitRepo = function isInGitRepo2() {
|
|
85406
|
+
var _this = this;
|
|
85407
|
+
return _async_to_generator(function() {
|
|
85408
|
+
return __generator(this, function(_state) {
|
|
85409
|
+
return [
|
|
85410
|
+
2,
|
|
85411
|
+
_this.gitApi.isInGitRepo(_this.projectPath)
|
|
85412
|
+
];
|
|
85413
|
+
});
|
|
85414
|
+
})();
|
|
85415
|
+
};
|
|
85416
|
+
_proto.initGitRepo = function initGitRepo2() {
|
|
85417
|
+
var _this = this;
|
|
85418
|
+
return _async_to_generator(function() {
|
|
85419
|
+
return __generator(this, function(_state) {
|
|
85420
|
+
switch (_state.label) {
|
|
85421
|
+
case 0:
|
|
85422
|
+
return [
|
|
85423
|
+
4,
|
|
85424
|
+
_this.gitApi.initGitRepo(_this.projectPath)
|
|
85425
|
+
];
|
|
85426
|
+
case 1:
|
|
85427
|
+
_state.sent();
|
|
85428
|
+
return [
|
|
85429
|
+
2
|
|
85430
|
+
];
|
|
85431
|
+
}
|
|
85432
|
+
});
|
|
85433
|
+
})();
|
|
85434
|
+
};
|
|
85435
|
+
_proto.gitAddAndCommit = function gitAddAndCommit() {
|
|
85436
|
+
var commitMessage = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "feat: init";
|
|
85437
|
+
var _this = this;
|
|
85438
|
+
return _async_to_generator(function() {
|
|
85439
|
+
return __generator(this, function(_state) {
|
|
85440
|
+
switch (_state.label) {
|
|
85441
|
+
case 0:
|
|
85442
|
+
return [
|
|
85443
|
+
4,
|
|
85444
|
+
_this.gitApi.addAndCommit(commitMessage, _this.projectPath)
|
|
85445
|
+
];
|
|
85446
|
+
case 1:
|
|
85447
|
+
_state.sent();
|
|
85448
|
+
return [
|
|
85449
|
+
2
|
|
85450
|
+
];
|
|
85451
|
+
}
|
|
85452
|
+
});
|
|
85453
|
+
})();
|
|
85454
|
+
};
|
|
85359
85455
|
_create_class(PluginGitAPI2, [
|
|
85360
85456
|
{
|
|
85361
85457
|
key: "context",
|
|
@@ -85374,78 +85470,6 @@ var PluginGitAPI = /* @__PURE__ */ function() {
|
|
|
85374
85470
|
gitAddAndCommit: this.gitAddAndCommit.bind(this)
|
|
85375
85471
|
};
|
|
85376
85472
|
}
|
|
85377
|
-
},
|
|
85378
|
-
{
|
|
85379
|
-
key: "setGitMessage",
|
|
85380
|
-
value: function setGitMessage(gitMessage) {
|
|
85381
|
-
this.gitMessage = gitMessage;
|
|
85382
|
-
}
|
|
85383
|
-
},
|
|
85384
|
-
{
|
|
85385
|
-
key: "prepare",
|
|
85386
|
-
value: function prepare(generator, projectPath) {
|
|
85387
|
-
this.gitApi = new GitAPI(generator);
|
|
85388
|
-
this.projectPath = projectPath;
|
|
85389
|
-
}
|
|
85390
|
-
},
|
|
85391
|
-
{
|
|
85392
|
-
key: "isInGitRepo",
|
|
85393
|
-
value: function isInGitRepo2() {
|
|
85394
|
-
var _this = this;
|
|
85395
|
-
return _async_to_generator(function() {
|
|
85396
|
-
return __generator(this, function(_state) {
|
|
85397
|
-
return [
|
|
85398
|
-
2,
|
|
85399
|
-
_this.gitApi.isInGitRepo(_this.projectPath)
|
|
85400
|
-
];
|
|
85401
|
-
});
|
|
85402
|
-
})();
|
|
85403
|
-
}
|
|
85404
|
-
},
|
|
85405
|
-
{
|
|
85406
|
-
key: "initGitRepo",
|
|
85407
|
-
value: function initGitRepo2() {
|
|
85408
|
-
var _this = this;
|
|
85409
|
-
return _async_to_generator(function() {
|
|
85410
|
-
return __generator(this, function(_state) {
|
|
85411
|
-
switch (_state.label) {
|
|
85412
|
-
case 0:
|
|
85413
|
-
return [
|
|
85414
|
-
4,
|
|
85415
|
-
_this.gitApi.initGitRepo(_this.projectPath)
|
|
85416
|
-
];
|
|
85417
|
-
case 1:
|
|
85418
|
-
_state.sent();
|
|
85419
|
-
return [
|
|
85420
|
-
2
|
|
85421
|
-
];
|
|
85422
|
-
}
|
|
85423
|
-
});
|
|
85424
|
-
})();
|
|
85425
|
-
}
|
|
85426
|
-
},
|
|
85427
|
-
{
|
|
85428
|
-
key: "gitAddAndCommit",
|
|
85429
|
-
value: function gitAddAndCommit() {
|
|
85430
|
-
var commitMessage = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "feat: init";
|
|
85431
|
-
var _this = this;
|
|
85432
|
-
return _async_to_generator(function() {
|
|
85433
|
-
return __generator(this, function(_state) {
|
|
85434
|
-
switch (_state.label) {
|
|
85435
|
-
case 0:
|
|
85436
|
-
return [
|
|
85437
|
-
4,
|
|
85438
|
-
_this.gitApi.addAndCommit(commitMessage, _this.projectPath)
|
|
85439
|
-
];
|
|
85440
|
-
case 1:
|
|
85441
|
-
_state.sent();
|
|
85442
|
-
return [
|
|
85443
|
-
2
|
|
85444
|
-
];
|
|
85445
|
-
}
|
|
85446
|
-
});
|
|
85447
|
-
})();
|
|
85448
|
-
}
|
|
85449
85473
|
}
|
|
85450
85474
|
]);
|
|
85451
85475
|
return PluginGitAPI2;
|
|
@@ -85457,200 +85481,173 @@ var PluginInputContext = /* @__PURE__ */ function() {
|
|
|
85457
85481
|
"use strict";
|
|
85458
85482
|
function PluginInputContext2(solutionSchema) {
|
|
85459
85483
|
_class_call_check(this, PluginInputContext2);
|
|
85460
|
-
|
|
85461
|
-
|
|
85462
|
-
|
|
85463
|
-
|
|
85464
|
-
_define_property2(this, "extendInputMap", {});
|
|
85484
|
+
this.inputValue = {};
|
|
85485
|
+
this.defaultConfig = {};
|
|
85486
|
+
this.solutionSchema = {};
|
|
85487
|
+
this.extendInputMap = {};
|
|
85465
85488
|
this.solutionSchemaFunc = solutionSchema;
|
|
85466
85489
|
}
|
|
85467
|
-
|
|
85468
|
-
|
|
85469
|
-
|
|
85470
|
-
|
|
85471
|
-
|
|
85472
|
-
|
|
85473
|
-
|
|
85474
|
-
|
|
85475
|
-
|
|
85476
|
-
|
|
85477
|
-
|
|
85478
|
-
|
|
85479
|
-
|
|
85480
|
-
|
|
85481
|
-
|
|
85482
|
-
|
|
85483
|
-
|
|
85490
|
+
var _proto = PluginInputContext2.prototype;
|
|
85491
|
+
_proto.prepare = function prepare(inputData) {
|
|
85492
|
+
this.solutionSchema = this.solutionSchemaFunc(inputData).properties;
|
|
85493
|
+
};
|
|
85494
|
+
_proto.validateInputKey = function validateInputKey(inputKey) {
|
|
85495
|
+
if (!this.solutionSchema[inputKey]) {
|
|
85496
|
+
throw new Error("the input key ".concat(inputKey, " not found"));
|
|
85497
|
+
}
|
|
85498
|
+
};
|
|
85499
|
+
_proto.validateInput = function validateInput(inputKey) {
|
|
85500
|
+
var _this = this;
|
|
85501
|
+
if (this.solutionSchema[inputKey]) {
|
|
85502
|
+
throw new Error("the input key ".concat(inputKey, " already exists"));
|
|
85503
|
+
}
|
|
85504
|
+
Object.keys(this.extendInputMap).forEach(function(key) {
|
|
85505
|
+
if (_this.extendInputMap[key].before[inputKey] || _this.extendInputMap[key].after[inputKey]) {
|
|
85506
|
+
throw new Error("the input key ".concat(inputKey, " is already added"));
|
|
85484
85507
|
}
|
|
85485
|
-
}
|
|
85486
|
-
|
|
85487
|
-
|
|
85488
|
-
|
|
85489
|
-
|
|
85490
|
-
|
|
85508
|
+
});
|
|
85509
|
+
};
|
|
85510
|
+
_proto.addInputBefore = function addInputBefore(key, input) {
|
|
85511
|
+
this.validateInputKey(key);
|
|
85512
|
+
var properties = input.properties || {};
|
|
85513
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
85514
|
+
try {
|
|
85515
|
+
for (var _iterator = Object.keys(properties)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
85516
|
+
var inputKey = _step.value;
|
|
85517
|
+
this.validateInput(inputKey);
|
|
85518
|
+
if (this.extendInputMap[key]) {
|
|
85519
|
+
this.extendInputMap[key].before[inputKey] = properties[inputKey];
|
|
85520
|
+
} else {
|
|
85521
|
+
this.extendInputMap[key] = {
|
|
85522
|
+
before: _define_property2({}, inputKey, properties[inputKey]),
|
|
85523
|
+
after: {}
|
|
85524
|
+
};
|
|
85491
85525
|
}
|
|
85492
85526
|
}
|
|
85493
|
-
}
|
|
85494
|
-
|
|
85495
|
-
|
|
85496
|
-
|
|
85497
|
-
|
|
85498
|
-
if (
|
|
85499
|
-
|
|
85527
|
+
} catch (err) {
|
|
85528
|
+
_didIteratorError = true;
|
|
85529
|
+
_iteratorError = err;
|
|
85530
|
+
} finally {
|
|
85531
|
+
try {
|
|
85532
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
85533
|
+
_iterator.return();
|
|
85500
85534
|
}
|
|
85501
|
-
|
|
85502
|
-
|
|
85503
|
-
|
|
85504
|
-
}
|
|
85505
|
-
});
|
|
85506
|
-
}
|
|
85507
|
-
},
|
|
85508
|
-
{
|
|
85509
|
-
key: "addInputBefore",
|
|
85510
|
-
value: function addInputBefore(key, input) {
|
|
85511
|
-
this.validateInputKey(key);
|
|
85512
|
-
var properties = input.properties || {};
|
|
85513
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
85514
|
-
try {
|
|
85515
|
-
for (var _iterator = Object.keys(properties)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
85516
|
-
var inputKey = _step.value;
|
|
85517
|
-
this.validateInput(inputKey);
|
|
85518
|
-
if (this.extendInputMap[key]) {
|
|
85519
|
-
this.extendInputMap[key].before[inputKey] = properties[inputKey];
|
|
85520
|
-
} else {
|
|
85521
|
-
this.extendInputMap[key] = {
|
|
85522
|
-
before: _define_property2({}, inputKey, properties[inputKey]),
|
|
85523
|
-
after: {}
|
|
85524
|
-
};
|
|
85525
|
-
}
|
|
85526
|
-
}
|
|
85527
|
-
} catch (err) {
|
|
85528
|
-
_didIteratorError = true;
|
|
85529
|
-
_iteratorError = err;
|
|
85530
|
-
} finally {
|
|
85531
|
-
try {
|
|
85532
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
85533
|
-
_iterator.return();
|
|
85534
|
-
}
|
|
85535
|
-
} finally {
|
|
85536
|
-
if (_didIteratorError) {
|
|
85537
|
-
throw _iteratorError;
|
|
85538
|
-
}
|
|
85539
|
-
}
|
|
85535
|
+
} finally {
|
|
85536
|
+
if (_didIteratorError) {
|
|
85537
|
+
throw _iteratorError;
|
|
85540
85538
|
}
|
|
85541
85539
|
}
|
|
85542
|
-
}
|
|
85543
|
-
|
|
85544
|
-
|
|
85545
|
-
|
|
85546
|
-
|
|
85547
|
-
|
|
85548
|
-
|
|
85549
|
-
|
|
85550
|
-
|
|
85551
|
-
|
|
85552
|
-
|
|
85553
|
-
|
|
85554
|
-
|
|
85555
|
-
|
|
85556
|
-
|
|
85557
|
-
|
|
85558
|
-
|
|
85559
|
-
};
|
|
85560
|
-
}
|
|
85561
|
-
}
|
|
85562
|
-
} catch (err) {
|
|
85563
|
-
_didIteratorError = true;
|
|
85564
|
-
_iteratorError = err;
|
|
85565
|
-
} finally {
|
|
85566
|
-
try {
|
|
85567
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
85568
|
-
_iterator.return();
|
|
85569
|
-
}
|
|
85570
|
-
} finally {
|
|
85571
|
-
if (_didIteratorError) {
|
|
85572
|
-
throw _iteratorError;
|
|
85573
|
-
}
|
|
85574
|
-
}
|
|
85540
|
+
}
|
|
85541
|
+
};
|
|
85542
|
+
_proto.addInputAfter = function addInputAfter(key, input) {
|
|
85543
|
+
this.validateInputKey(key);
|
|
85544
|
+
var properties = input.properties || {};
|
|
85545
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
85546
|
+
try {
|
|
85547
|
+
for (var _iterator = Object.keys(properties)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
85548
|
+
var inputKey = _step.value;
|
|
85549
|
+
this.validateInput(inputKey);
|
|
85550
|
+
if (this.extendInputMap[key]) {
|
|
85551
|
+
this.extendInputMap[key].after[inputKey] = properties[inputKey];
|
|
85552
|
+
} else {
|
|
85553
|
+
this.extendInputMap[key] = {
|
|
85554
|
+
before: {},
|
|
85555
|
+
after: _define_property2({}, inputKey, properties[inputKey])
|
|
85556
|
+
};
|
|
85575
85557
|
}
|
|
85576
85558
|
}
|
|
85577
|
-
}
|
|
85578
|
-
|
|
85579
|
-
|
|
85580
|
-
|
|
85581
|
-
|
|
85582
|
-
if (
|
|
85583
|
-
|
|
85584
|
-
return;
|
|
85585
|
-
}
|
|
85586
|
-
var findFlag = false;
|
|
85587
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
85588
|
-
try {
|
|
85589
|
-
for (var _iterator = Object.keys(this.extendInputMap)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
85590
|
-
var inputKey = _step.value;
|
|
85591
|
-
var beforeSchema = this.extendInputMap[inputKey].before[key];
|
|
85592
|
-
if (beforeSchema) {
|
|
85593
|
-
findFlag = true;
|
|
85594
|
-
beforeSchema[field] = (0, import_lodash9.isFunction)(value) ? value(schema) : value;
|
|
85595
|
-
break;
|
|
85596
|
-
}
|
|
85597
|
-
var afterSchema = this.extendInputMap[inputKey].after[key];
|
|
85598
|
-
if (afterSchema) {
|
|
85599
|
-
findFlag = true;
|
|
85600
|
-
afterSchema[field] = (0, import_lodash9.isFunction)(value) ? value(schema) : value;
|
|
85601
|
-
break;
|
|
85602
|
-
}
|
|
85603
|
-
}
|
|
85604
|
-
} catch (err) {
|
|
85605
|
-
_didIteratorError = true;
|
|
85606
|
-
_iteratorError = err;
|
|
85607
|
-
} finally {
|
|
85608
|
-
try {
|
|
85609
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
85610
|
-
_iterator.return();
|
|
85611
|
-
}
|
|
85612
|
-
} finally {
|
|
85613
|
-
if (_didIteratorError) {
|
|
85614
|
-
throw _iteratorError;
|
|
85615
|
-
}
|
|
85616
|
-
}
|
|
85559
|
+
} catch (err) {
|
|
85560
|
+
_didIteratorError = true;
|
|
85561
|
+
_iteratorError = err;
|
|
85562
|
+
} finally {
|
|
85563
|
+
try {
|
|
85564
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
85565
|
+
_iterator.return();
|
|
85617
85566
|
}
|
|
85618
|
-
|
|
85619
|
-
|
|
85567
|
+
} finally {
|
|
85568
|
+
if (_didIteratorError) {
|
|
85569
|
+
throw _iteratorError;
|
|
85620
85570
|
}
|
|
85621
85571
|
}
|
|
85622
|
-
}
|
|
85623
|
-
|
|
85624
|
-
|
|
85625
|
-
|
|
85626
|
-
|
|
85627
|
-
|
|
85628
|
-
|
|
85629
|
-
|
|
85630
|
-
|
|
85631
|
-
|
|
85632
|
-
|
|
85633
|
-
|
|
85634
|
-
|
|
85635
|
-
|
|
85636
|
-
|
|
85637
|
-
|
|
85638
|
-
|
|
85639
|
-
|
|
85640
|
-
}
|
|
85641
|
-
|
|
85572
|
+
}
|
|
85573
|
+
};
|
|
85574
|
+
_proto.setInput = function setInput(key, field, value) {
|
|
85575
|
+
var schema = this.solutionSchema[key];
|
|
85576
|
+
if (schema) {
|
|
85577
|
+
schema[field] = (0, import_lodash9.isFunction)(value) ? value(schema) : value;
|
|
85578
|
+
return;
|
|
85579
|
+
}
|
|
85580
|
+
var findFlag = false;
|
|
85581
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
85582
|
+
try {
|
|
85583
|
+
for (var _iterator = Object.keys(this.extendInputMap)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
85584
|
+
var inputKey = _step.value;
|
|
85585
|
+
var beforeSchema = this.extendInputMap[inputKey].before[key];
|
|
85586
|
+
if (beforeSchema) {
|
|
85587
|
+
findFlag = true;
|
|
85588
|
+
beforeSchema[field] = (0, import_lodash9.isFunction)(value) ? value(schema) : value;
|
|
85589
|
+
break;
|
|
85590
|
+
}
|
|
85591
|
+
var afterSchema = this.extendInputMap[inputKey].after[key];
|
|
85592
|
+
if (afterSchema) {
|
|
85593
|
+
findFlag = true;
|
|
85594
|
+
afterSchema[field] = (0, import_lodash9.isFunction)(value) ? value(schema) : value;
|
|
85595
|
+
break;
|
|
85596
|
+
}
|
|
85642
85597
|
}
|
|
85643
|
-
}
|
|
85644
|
-
|
|
85645
|
-
|
|
85646
|
-
|
|
85647
|
-
|
|
85598
|
+
} catch (err) {
|
|
85599
|
+
_didIteratorError = true;
|
|
85600
|
+
_iteratorError = err;
|
|
85601
|
+
} finally {
|
|
85602
|
+
try {
|
|
85603
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
85604
|
+
_iterator.return();
|
|
85605
|
+
}
|
|
85606
|
+
} finally {
|
|
85607
|
+
if (_didIteratorError) {
|
|
85608
|
+
throw _iteratorError;
|
|
85609
|
+
}
|
|
85648
85610
|
}
|
|
85649
|
-
}
|
|
85611
|
+
}
|
|
85612
|
+
if (!findFlag) {
|
|
85613
|
+
throw new Error("the input ".concat(key, " not found"));
|
|
85614
|
+
}
|
|
85615
|
+
};
|
|
85616
|
+
_proto.getFinalInputs = function getFinalInputs() {
|
|
85617
|
+
var _this = this;
|
|
85618
|
+
var result = {};
|
|
85619
|
+
Object.keys(this.solutionSchema).forEach(function(key) {
|
|
85620
|
+
var _ref = _this.extendInputMap[key] || {
|
|
85621
|
+
before: {},
|
|
85622
|
+
after: {}
|
|
85623
|
+
}, before = _ref.before, after = _ref.after;
|
|
85624
|
+
Object.keys(before).forEach(function(beforeKey) {
|
|
85625
|
+
return result[beforeKey] = before[beforeKey];
|
|
85626
|
+
});
|
|
85627
|
+
result[key] = _this.solutionSchema[key];
|
|
85628
|
+
Object.keys(after).forEach(function(afterKey) {
|
|
85629
|
+
return result[afterKey] = after[afterKey];
|
|
85630
|
+
});
|
|
85631
|
+
});
|
|
85632
|
+
return result;
|
|
85633
|
+
};
|
|
85634
|
+
_proto.setInputValue = function setInputValue(value) {
|
|
85635
|
+
this.inputValue = value;
|
|
85636
|
+
};
|
|
85637
|
+
_proto.setDefualtConfig = function setDefualtConfig(value) {
|
|
85638
|
+
this.defaultConfig = value;
|
|
85639
|
+
};
|
|
85640
|
+
_create_class(PluginInputContext2, [
|
|
85650
85641
|
{
|
|
85651
|
-
key: "
|
|
85652
|
-
|
|
85653
|
-
|
|
85642
|
+
key: "context",
|
|
85643
|
+
get: function get4() {
|
|
85644
|
+
return {
|
|
85645
|
+
addInputBefore: this.addInputBefore.bind(this),
|
|
85646
|
+
addInputAfter: this.addInputAfter.bind(this),
|
|
85647
|
+
setInput: this.setInput.bind(this),
|
|
85648
|
+
setInputValue: this.setInputValue.bind(this),
|
|
85649
|
+
setDefaultConfig: this.setDefualtConfig.bind(this)
|
|
85650
|
+
};
|
|
85654
85651
|
}
|
|
85655
85652
|
}
|
|
85656
85653
|
]);
|
|
@@ -85662,11 +85659,70 @@ var PluginNpmAPI = /* @__PURE__ */ function() {
|
|
|
85662
85659
|
"use strict";
|
|
85663
85660
|
function PluginNpmAPI2(projectPath, packageManager) {
|
|
85664
85661
|
_class_call_check(this, PluginNpmAPI2);
|
|
85665
|
-
|
|
85666
|
-
_define_property2(this, "packageManager", void 0);
|
|
85662
|
+
this.projectPath = "";
|
|
85667
85663
|
this.projectPath = projectPath;
|
|
85668
85664
|
this.packageManager = packageManager;
|
|
85669
85665
|
}
|
|
85666
|
+
var _proto = PluginNpmAPI2.prototype;
|
|
85667
|
+
_proto.install = function install() {
|
|
85668
|
+
var _this = this;
|
|
85669
|
+
return _async_to_generator(function() {
|
|
85670
|
+
return __generator(this, function(_state) {
|
|
85671
|
+
switch (_state.label) {
|
|
85672
|
+
case 0:
|
|
85673
|
+
if (!(_this.packageManager === PackageManager.Pnpm))
|
|
85674
|
+
return [
|
|
85675
|
+
3,
|
|
85676
|
+
2
|
|
85677
|
+
];
|
|
85678
|
+
return [
|
|
85679
|
+
4,
|
|
85680
|
+
pnpmInstall({
|
|
85681
|
+
cwd: _this.projectPath
|
|
85682
|
+
})
|
|
85683
|
+
];
|
|
85684
|
+
case 1:
|
|
85685
|
+
_state.sent();
|
|
85686
|
+
return [
|
|
85687
|
+
3,
|
|
85688
|
+
6
|
|
85689
|
+
];
|
|
85690
|
+
case 2:
|
|
85691
|
+
if (!(_this.packageManager === PackageManager.Yarn))
|
|
85692
|
+
return [
|
|
85693
|
+
3,
|
|
85694
|
+
4
|
|
85695
|
+
];
|
|
85696
|
+
return [
|
|
85697
|
+
4,
|
|
85698
|
+
yarnInstall({
|
|
85699
|
+
cwd: _this.projectPath
|
|
85700
|
+
})
|
|
85701
|
+
];
|
|
85702
|
+
case 3:
|
|
85703
|
+
_state.sent();
|
|
85704
|
+
return [
|
|
85705
|
+
3,
|
|
85706
|
+
6
|
|
85707
|
+
];
|
|
85708
|
+
case 4:
|
|
85709
|
+
return [
|
|
85710
|
+
4,
|
|
85711
|
+
npmInstall({
|
|
85712
|
+
cwd: _this.projectPath
|
|
85713
|
+
})
|
|
85714
|
+
];
|
|
85715
|
+
case 5:
|
|
85716
|
+
_state.sent();
|
|
85717
|
+
_state.label = 6;
|
|
85718
|
+
case 6:
|
|
85719
|
+
return [
|
|
85720
|
+
2
|
|
85721
|
+
];
|
|
85722
|
+
}
|
|
85723
|
+
});
|
|
85724
|
+
})();
|
|
85725
|
+
};
|
|
85670
85726
|
_create_class(PluginNpmAPI2, [
|
|
85671
85727
|
{
|
|
85672
85728
|
key: "method",
|
|
@@ -85675,79 +85731,24 @@ var PluginNpmAPI = /* @__PURE__ */ function() {
|
|
|
85675
85731
|
install: this.install.bind(this)
|
|
85676
85732
|
};
|
|
85677
85733
|
}
|
|
85678
|
-
},
|
|
85679
|
-
{
|
|
85680
|
-
key: "install",
|
|
85681
|
-
value: function install() {
|
|
85682
|
-
var _this = this;
|
|
85683
|
-
return _async_to_generator(function() {
|
|
85684
|
-
return __generator(this, function(_state) {
|
|
85685
|
-
switch (_state.label) {
|
|
85686
|
-
case 0:
|
|
85687
|
-
if (!(_this.packageManager === PackageManager.Pnpm))
|
|
85688
|
-
return [
|
|
85689
|
-
3,
|
|
85690
|
-
2
|
|
85691
|
-
];
|
|
85692
|
-
return [
|
|
85693
|
-
4,
|
|
85694
|
-
pnpmInstall({
|
|
85695
|
-
cwd: _this.projectPath
|
|
85696
|
-
})
|
|
85697
|
-
];
|
|
85698
|
-
case 1:
|
|
85699
|
-
_state.sent();
|
|
85700
|
-
return [
|
|
85701
|
-
3,
|
|
85702
|
-
6
|
|
85703
|
-
];
|
|
85704
|
-
case 2:
|
|
85705
|
-
if (!(_this.packageManager === PackageManager.Yarn))
|
|
85706
|
-
return [
|
|
85707
|
-
3,
|
|
85708
|
-
4
|
|
85709
|
-
];
|
|
85710
|
-
return [
|
|
85711
|
-
4,
|
|
85712
|
-
yarnInstall({
|
|
85713
|
-
cwd: _this.projectPath
|
|
85714
|
-
})
|
|
85715
|
-
];
|
|
85716
|
-
case 3:
|
|
85717
|
-
_state.sent();
|
|
85718
|
-
return [
|
|
85719
|
-
3,
|
|
85720
|
-
6
|
|
85721
|
-
];
|
|
85722
|
-
case 4:
|
|
85723
|
-
return [
|
|
85724
|
-
4,
|
|
85725
|
-
npmInstall({
|
|
85726
|
-
cwd: _this.projectPath
|
|
85727
|
-
})
|
|
85728
|
-
];
|
|
85729
|
-
case 5:
|
|
85730
|
-
_state.sent();
|
|
85731
|
-
_state.label = 6;
|
|
85732
|
-
case 6:
|
|
85733
|
-
return [
|
|
85734
|
-
2
|
|
85735
|
-
];
|
|
85736
|
-
}
|
|
85737
|
-
});
|
|
85738
|
-
})();
|
|
85739
|
-
}
|
|
85740
85734
|
}
|
|
85741
85735
|
]);
|
|
85742
85736
|
return PluginNpmAPI2;
|
|
85743
85737
|
}();
|
|
85744
85738
|
|
|
85745
85739
|
// ../../new-action/dist/esm/utils/index.js
|
|
85746
|
-
var
|
|
85740
|
+
var import_path15 = __toESM(require("path"));
|
|
85747
85741
|
var import_utils53 = require("@modern-js/utils");
|
|
85742
|
+
var swap = (obj) => {
|
|
85743
|
+
return Object.keys(obj).reduce((acc, key) => {
|
|
85744
|
+
acc[obj[key]] = key;
|
|
85745
|
+
return acc;
|
|
85746
|
+
}, {});
|
|
85747
|
+
};
|
|
85748
|
+
var dependenceToSolution = swap(SolutionToolsMap);
|
|
85748
85749
|
function alreadyRepo(cwd = process.cwd()) {
|
|
85749
85750
|
try {
|
|
85750
|
-
return import_utils50.fs.existsSync(
|
|
85751
|
+
return import_utils50.fs.existsSync(import_path15.default.resolve(cwd, "package.json"));
|
|
85751
85752
|
} catch (e) {
|
|
85752
85753
|
return false;
|
|
85753
85754
|
}
|
|
@@ -85766,7 +85767,7 @@ var readJson = (jsonPath) => {
|
|
|
85766
85767
|
}
|
|
85767
85768
|
};
|
|
85768
85769
|
function hasEnabledFunction(action2, dependencies, devDependencies, peerDependencies, cwd) {
|
|
85769
|
-
const packageJsonPath =
|
|
85770
|
+
const packageJsonPath = import_path15.default.normalize(`${cwd}/package.json`);
|
|
85770
85771
|
const packageJson = readJson(packageJsonPath);
|
|
85771
85772
|
if (!dependencies[action2] && !devDependencies[action2]) {
|
|
85772
85773
|
return false;
|
|
@@ -85785,9 +85786,9 @@ function hasEnabledFunction(action2, dependencies, devDependencies, peerDependen
|
|
|
85785
85786
|
}
|
|
85786
85787
|
return false;
|
|
85787
85788
|
}
|
|
85788
|
-
function
|
|
85789
|
+
function getGeneratorPath2(generator, distTag) {
|
|
85789
85790
|
if (process.env.CODESMITH_ENV === "development") {
|
|
85790
|
-
return
|
|
85791
|
+
return import_path15.default.dirname(require.resolve(generator));
|
|
85791
85792
|
} else if (distTag) {
|
|
85792
85793
|
return `${generator}@${distTag}`;
|
|
85793
85794
|
}
|
|
@@ -85844,7 +85845,7 @@ var MWANewAction = async (options) => {
|
|
|
85844
85845
|
});
|
|
85845
85846
|
const actionType = ans.actionType;
|
|
85846
85847
|
const action2 = ans[actionType];
|
|
85847
|
-
const generator =
|
|
85848
|
+
const generator = getGeneratorPath2(MWANewActionGenerators[actionType][action2], distTag);
|
|
85848
85849
|
if (!generator) {
|
|
85849
85850
|
throw new Error(`no valid option`);
|
|
85850
85851
|
}
|
|
@@ -85940,7 +85941,7 @@ var ModuleNewAction = async (options) => {
|
|
|
85940
85941
|
});
|
|
85941
85942
|
const actionType = ans.actionType;
|
|
85942
85943
|
const action2 = ans[actionType];
|
|
85943
|
-
const generator =
|
|
85944
|
+
const generator = getGeneratorPath2(ModuleNewActionGenerators[actionType][action2], distTag);
|
|
85944
85945
|
if (!generator) {
|
|
85945
85946
|
throw new Error(`no valid option`);
|
|
85946
85947
|
}
|
|
@@ -85996,7 +85997,7 @@ var ModuleNewAction = async (options) => {
|
|
|
85996
85997
|
};
|
|
85997
85998
|
|
|
85998
85999
|
// ../../new-action/dist/esm/monorepo.js
|
|
85999
|
-
var
|
|
86000
|
+
var import_path16 = __toESM(require("path"));
|
|
86000
86001
|
var import_lodash12 = require("@modern-js/utils/lodash");
|
|
86001
86002
|
var REPO_GENERATOR = "@modern-js/repo-generator";
|
|
86002
86003
|
var MonorepoNewAction = async (options) => {
|
|
@@ -86019,10 +86020,10 @@ var MonorepoNewAction = async (options) => {
|
|
|
86019
86020
|
}
|
|
86020
86021
|
const plugins = plugin.map((plugin2) => {
|
|
86021
86022
|
try {
|
|
86022
|
-
return
|
|
86023
|
+
return import_path16.default.join(require.resolve(plugin2), "../../");
|
|
86023
86024
|
} catch (e) {
|
|
86024
86025
|
try {
|
|
86025
|
-
return
|
|
86026
|
+
return import_path16.default.join(require.resolve(plugin2), "../../../../");
|
|
86026
86027
|
} catch (e2) {
|
|
86027
86028
|
return plugin2;
|
|
86028
86029
|
}
|
|
@@ -86062,14 +86063,141 @@ var PluginNewAPI = /* @__PURE__ */ function() {
|
|
|
86062
86063
|
"use strict";
|
|
86063
86064
|
function PluginNewAPI2(solution, projectPath, inputData) {
|
|
86064
86065
|
_class_call_check(this, PluginNewAPI2);
|
|
86065
|
-
_define_property2(this, "solution", void 0);
|
|
86066
|
-
_define_property2(this, "projectPath", void 0);
|
|
86067
|
-
_define_property2(this, "inputData", void 0);
|
|
86068
86066
|
this.solution = solution;
|
|
86069
86067
|
this.projectPath = projectPath;
|
|
86070
86068
|
this.inputData = inputData;
|
|
86071
86069
|
process.setMaxListeners(20);
|
|
86072
86070
|
}
|
|
86071
|
+
var _proto = PluginNewAPI2.prototype;
|
|
86072
|
+
_proto.createElement = function createElement(element, params) {
|
|
86073
|
+
var _this = this;
|
|
86074
|
+
return _async_to_generator(function() {
|
|
86075
|
+
return __generator(this, function(_state) {
|
|
86076
|
+
switch (_state.label) {
|
|
86077
|
+
case 0:
|
|
86078
|
+
if (!(_this.solution === Solution.MWA))
|
|
86079
|
+
return [
|
|
86080
|
+
3,
|
|
86081
|
+
2
|
|
86082
|
+
];
|
|
86083
|
+
if (!MWAActionElements.includes(element)) {
|
|
86084
|
+
throw new Error("the element ".concat(element, " not support to create"));
|
|
86085
|
+
}
|
|
86086
|
+
return [
|
|
86087
|
+
4,
|
|
86088
|
+
MWANewAction({
|
|
86089
|
+
config: JSON.stringify(_object_spread({
|
|
86090
|
+
actionType: ActionType.Element,
|
|
86091
|
+
element,
|
|
86092
|
+
noNeedInstall: true
|
|
86093
|
+
}, _this.inputData, params)),
|
|
86094
|
+
cwd: _this.projectPath
|
|
86095
|
+
})
|
|
86096
|
+
];
|
|
86097
|
+
case 1:
|
|
86098
|
+
_state.sent();
|
|
86099
|
+
return [
|
|
86100
|
+
2
|
|
86101
|
+
];
|
|
86102
|
+
case 2:
|
|
86103
|
+
throw new Error("this solution project not support create element");
|
|
86104
|
+
}
|
|
86105
|
+
});
|
|
86106
|
+
})();
|
|
86107
|
+
};
|
|
86108
|
+
_proto.enableFunc = function enableFunc(func, params) {
|
|
86109
|
+
var _this = this;
|
|
86110
|
+
return _async_to_generator(function() {
|
|
86111
|
+
return __generator(this, function(_state) {
|
|
86112
|
+
switch (_state.label) {
|
|
86113
|
+
case 0:
|
|
86114
|
+
if (!(_this.solution === Solution.MWA))
|
|
86115
|
+
return [
|
|
86116
|
+
3,
|
|
86117
|
+
2
|
|
86118
|
+
];
|
|
86119
|
+
if (!MWAActionFunctions.includes(func)) {
|
|
86120
|
+
throw new Error("the func ".concat(func, " not support to enable"));
|
|
86121
|
+
}
|
|
86122
|
+
return [
|
|
86123
|
+
4,
|
|
86124
|
+
MWANewAction({
|
|
86125
|
+
config: JSON.stringify(_object_spread({
|
|
86126
|
+
actionType: ActionType.Function,
|
|
86127
|
+
function: func,
|
|
86128
|
+
noNeedInstall: true
|
|
86129
|
+
}, _this.inputData, params)),
|
|
86130
|
+
cwd: _this.projectPath
|
|
86131
|
+
})
|
|
86132
|
+
];
|
|
86133
|
+
case 1:
|
|
86134
|
+
_state.sent();
|
|
86135
|
+
return [
|
|
86136
|
+
2
|
|
86137
|
+
];
|
|
86138
|
+
case 2:
|
|
86139
|
+
if (!(_this.solution === Solution.Module))
|
|
86140
|
+
return [
|
|
86141
|
+
3,
|
|
86142
|
+
4
|
|
86143
|
+
];
|
|
86144
|
+
if (!ModuleActionFunctions.includes(func)) {
|
|
86145
|
+
throw new Error("the func ".concat(func, " not support to enable"));
|
|
86146
|
+
}
|
|
86147
|
+
return [
|
|
86148
|
+
4,
|
|
86149
|
+
ModuleNewAction({
|
|
86150
|
+
config: JSON.stringify(_object_spread({
|
|
86151
|
+
actionType: ActionType.Function,
|
|
86152
|
+
function: func,
|
|
86153
|
+
noNeedInstall: true
|
|
86154
|
+
}, _this.inputData, params)),
|
|
86155
|
+
cwd: _this.projectPath
|
|
86156
|
+
})
|
|
86157
|
+
];
|
|
86158
|
+
case 3:
|
|
86159
|
+
_state.sent();
|
|
86160
|
+
return [
|
|
86161
|
+
2
|
|
86162
|
+
];
|
|
86163
|
+
case 4:
|
|
86164
|
+
throw new Error("this solution project not support enable function");
|
|
86165
|
+
}
|
|
86166
|
+
});
|
|
86167
|
+
})();
|
|
86168
|
+
};
|
|
86169
|
+
_proto.createSubProject = function createSubProject(solution, params) {
|
|
86170
|
+
var _this = this;
|
|
86171
|
+
return _async_to_generator(function() {
|
|
86172
|
+
return __generator(this, function(_state) {
|
|
86173
|
+
switch (_state.label) {
|
|
86174
|
+
case 0:
|
|
86175
|
+
if (!(_this.solution === Solution.Monorepo))
|
|
86176
|
+
return [
|
|
86177
|
+
3,
|
|
86178
|
+
2
|
|
86179
|
+
];
|
|
86180
|
+
return [
|
|
86181
|
+
4,
|
|
86182
|
+
MonorepoNewAction({
|
|
86183
|
+
config: JSON.stringify(_object_spread({
|
|
86184
|
+
solution,
|
|
86185
|
+
noNeedInstall: true
|
|
86186
|
+
}, _this.inputData, params)),
|
|
86187
|
+
cwd: _this.projectPath
|
|
86188
|
+
})
|
|
86189
|
+
];
|
|
86190
|
+
case 1:
|
|
86191
|
+
_state.sent();
|
|
86192
|
+
return [
|
|
86193
|
+
2
|
|
86194
|
+
];
|
|
86195
|
+
case 2:
|
|
86196
|
+
throw new Error("this solution project not support create subproject");
|
|
86197
|
+
}
|
|
86198
|
+
});
|
|
86199
|
+
})();
|
|
86200
|
+
};
|
|
86073
86201
|
_create_class(PluginNewAPI2, [
|
|
86074
86202
|
{
|
|
86075
86203
|
key: "method",
|
|
@@ -86080,144 +86208,6 @@ var PluginNewAPI = /* @__PURE__ */ function() {
|
|
|
86080
86208
|
createSubProject: this.createSubProject.bind(this)
|
|
86081
86209
|
};
|
|
86082
86210
|
}
|
|
86083
|
-
},
|
|
86084
|
-
{
|
|
86085
|
-
key: "createElement",
|
|
86086
|
-
value: function createElement(element, params) {
|
|
86087
|
-
var _this = this;
|
|
86088
|
-
return _async_to_generator(function() {
|
|
86089
|
-
return __generator(this, function(_state) {
|
|
86090
|
-
switch (_state.label) {
|
|
86091
|
-
case 0:
|
|
86092
|
-
if (!(_this.solution === Solution.MWA))
|
|
86093
|
-
return [
|
|
86094
|
-
3,
|
|
86095
|
-
2
|
|
86096
|
-
];
|
|
86097
|
-
if (!MWAActionElements.includes(element)) {
|
|
86098
|
-
throw new Error("the element ".concat(element, " not support to create"));
|
|
86099
|
-
}
|
|
86100
|
-
return [
|
|
86101
|
-
4,
|
|
86102
|
-
MWANewAction({
|
|
86103
|
-
config: JSON.stringify(_object_spread({
|
|
86104
|
-
actionType: ActionType.Element,
|
|
86105
|
-
element,
|
|
86106
|
-
noNeedInstall: true
|
|
86107
|
-
}, _this.inputData, params)),
|
|
86108
|
-
cwd: _this.projectPath
|
|
86109
|
-
})
|
|
86110
|
-
];
|
|
86111
|
-
case 1:
|
|
86112
|
-
_state.sent();
|
|
86113
|
-
return [
|
|
86114
|
-
2
|
|
86115
|
-
];
|
|
86116
|
-
case 2:
|
|
86117
|
-
throw new Error("this solution project not support create element");
|
|
86118
|
-
}
|
|
86119
|
-
});
|
|
86120
|
-
})();
|
|
86121
|
-
}
|
|
86122
|
-
},
|
|
86123
|
-
{
|
|
86124
|
-
key: "enableFunc",
|
|
86125
|
-
value: function enableFunc(func, params) {
|
|
86126
|
-
var _this = this;
|
|
86127
|
-
return _async_to_generator(function() {
|
|
86128
|
-
return __generator(this, function(_state) {
|
|
86129
|
-
switch (_state.label) {
|
|
86130
|
-
case 0:
|
|
86131
|
-
if (!(_this.solution === Solution.MWA))
|
|
86132
|
-
return [
|
|
86133
|
-
3,
|
|
86134
|
-
2
|
|
86135
|
-
];
|
|
86136
|
-
if (!MWAActionFunctions.includes(func)) {
|
|
86137
|
-
throw new Error("the func ".concat(func, " not support to enable"));
|
|
86138
|
-
}
|
|
86139
|
-
return [
|
|
86140
|
-
4,
|
|
86141
|
-
MWANewAction({
|
|
86142
|
-
config: JSON.stringify(_object_spread({
|
|
86143
|
-
actionType: ActionType.Function,
|
|
86144
|
-
function: func,
|
|
86145
|
-
noNeedInstall: true
|
|
86146
|
-
}, _this.inputData, params)),
|
|
86147
|
-
cwd: _this.projectPath
|
|
86148
|
-
})
|
|
86149
|
-
];
|
|
86150
|
-
case 1:
|
|
86151
|
-
_state.sent();
|
|
86152
|
-
return [
|
|
86153
|
-
2
|
|
86154
|
-
];
|
|
86155
|
-
case 2:
|
|
86156
|
-
if (!(_this.solution === Solution.Module))
|
|
86157
|
-
return [
|
|
86158
|
-
3,
|
|
86159
|
-
4
|
|
86160
|
-
];
|
|
86161
|
-
if (!ModuleActionFunctions.includes(func)) {
|
|
86162
|
-
throw new Error("the func ".concat(func, " not support to enable"));
|
|
86163
|
-
}
|
|
86164
|
-
return [
|
|
86165
|
-
4,
|
|
86166
|
-
ModuleNewAction({
|
|
86167
|
-
config: JSON.stringify(_object_spread({
|
|
86168
|
-
actionType: ActionType.Function,
|
|
86169
|
-
function: func,
|
|
86170
|
-
noNeedInstall: true
|
|
86171
|
-
}, _this.inputData, params)),
|
|
86172
|
-
cwd: _this.projectPath
|
|
86173
|
-
})
|
|
86174
|
-
];
|
|
86175
|
-
case 3:
|
|
86176
|
-
_state.sent();
|
|
86177
|
-
return [
|
|
86178
|
-
2
|
|
86179
|
-
];
|
|
86180
|
-
case 4:
|
|
86181
|
-
throw new Error("this solution project not support enable function");
|
|
86182
|
-
}
|
|
86183
|
-
});
|
|
86184
|
-
})();
|
|
86185
|
-
}
|
|
86186
|
-
},
|
|
86187
|
-
{
|
|
86188
|
-
key: "createSubProject",
|
|
86189
|
-
value: function createSubProject(solution, params) {
|
|
86190
|
-
var _this = this;
|
|
86191
|
-
return _async_to_generator(function() {
|
|
86192
|
-
return __generator(this, function(_state) {
|
|
86193
|
-
switch (_state.label) {
|
|
86194
|
-
case 0:
|
|
86195
|
-
if (!(_this.solution === Solution.Monorepo))
|
|
86196
|
-
return [
|
|
86197
|
-
3,
|
|
86198
|
-
2
|
|
86199
|
-
];
|
|
86200
|
-
return [
|
|
86201
|
-
4,
|
|
86202
|
-
MonorepoNewAction({
|
|
86203
|
-
config: JSON.stringify(_object_spread({
|
|
86204
|
-
solution,
|
|
86205
|
-
noNeedInstall: true
|
|
86206
|
-
}, _this.inputData, params)),
|
|
86207
|
-
cwd: _this.projectPath
|
|
86208
|
-
})
|
|
86209
|
-
];
|
|
86210
|
-
case 1:
|
|
86211
|
-
_state.sent();
|
|
86212
|
-
return [
|
|
86213
|
-
2
|
|
86214
|
-
];
|
|
86215
|
-
case 2:
|
|
86216
|
-
throw new Error("this solution project not support create subproject");
|
|
86217
|
-
}
|
|
86218
|
-
});
|
|
86219
|
-
})();
|
|
86220
|
-
}
|
|
86221
86211
|
}
|
|
86222
86212
|
]);
|
|
86223
86213
|
return PluginNewAPI2;
|
|
@@ -86233,22 +86223,29 @@ var PluginContext = /* @__PURE__ */ function() {
|
|
|
86233
86223
|
"use strict";
|
|
86234
86224
|
function PluginContext2(solutionSchema, locale) {
|
|
86235
86225
|
_class_call_check(this, PluginContext2);
|
|
86236
|
-
_define_property2(this, "generator", void 0);
|
|
86237
|
-
_define_property2(this, "inputContext", void 0);
|
|
86238
|
-
_define_property2(this, "gitAPI", void 0);
|
|
86239
|
-
_define_property2(this, "fileAPI", void 0);
|
|
86240
|
-
_define_property2(this, "npmAPI", void 0);
|
|
86241
|
-
_define_property2(this, "newAPI", void 0);
|
|
86242
|
-
_define_property2(this, "locale", void 0);
|
|
86243
86226
|
var _obj;
|
|
86244
|
-
|
|
86227
|
+
this.lifeCycleFuncMap = (_obj = {}, _define_property2(_obj, "onForged", function() {
|
|
86245
86228
|
}), _define_property2(_obj, "afterForged", function() {
|
|
86246
|
-
}), _obj)
|
|
86229
|
+
}), _obj);
|
|
86247
86230
|
this.inputContext = new PluginInputContext(solutionSchema);
|
|
86248
86231
|
this.gitAPI = new PluginGitAPI();
|
|
86249
86232
|
this.fileAPI = new PluginFileAPI();
|
|
86250
86233
|
this.locale = locale;
|
|
86251
86234
|
}
|
|
86235
|
+
var _proto = PluginContext2.prototype;
|
|
86236
|
+
_proto.handlePrepareContext = function handlePrepareContext(generator, solution, projectPath, templatePath, inputData) {
|
|
86237
|
+
this.generator = generator;
|
|
86238
|
+
this.gitAPI.prepare(generator, projectPath);
|
|
86239
|
+
this.fileAPI.prepare(generator, projectPath, templatePath);
|
|
86240
|
+
this.npmAPI = new PluginNpmAPI(projectPath, inputData.packageManager);
|
|
86241
|
+
this.newAPI = new PluginNewAPI(solution, projectPath, inputData);
|
|
86242
|
+
};
|
|
86243
|
+
_proto.onForged = function onForged(func) {
|
|
86244
|
+
this.lifeCycleFuncMap["onForged"] = func;
|
|
86245
|
+
};
|
|
86246
|
+
_proto.afterForged = function afterForged(func) {
|
|
86247
|
+
this.lifeCycleFuncMap["afterForged"] = func;
|
|
86248
|
+
};
|
|
86252
86249
|
_create_class(PluginContext2, [
|
|
86253
86250
|
{
|
|
86254
86251
|
key: "context",
|
|
@@ -86272,35 +86269,13 @@ var PluginContext = /* @__PURE__ */ function() {
|
|
|
86272
86269
|
get: function get4() {
|
|
86273
86270
|
return _object_spread({}, this.gitAPI.method, this.npmAPI.method);
|
|
86274
86271
|
}
|
|
86275
|
-
},
|
|
86276
|
-
{
|
|
86277
|
-
key: "handlePrepareContext",
|
|
86278
|
-
value: function handlePrepareContext(generator, solution, projectPath, templatePath, inputData) {
|
|
86279
|
-
this.generator = generator;
|
|
86280
|
-
this.gitAPI.prepare(generator, projectPath);
|
|
86281
|
-
this.fileAPI.prepare(generator, projectPath, templatePath);
|
|
86282
|
-
this.npmAPI = new PluginNpmAPI(projectPath, inputData.packageManager);
|
|
86283
|
-
this.newAPI = new PluginNewAPI(solution, projectPath, inputData);
|
|
86284
|
-
}
|
|
86285
|
-
},
|
|
86286
|
-
{
|
|
86287
|
-
key: "onForged",
|
|
86288
|
-
value: function onForged(func) {
|
|
86289
|
-
this.lifeCycleFuncMap["onForged"] = func;
|
|
86290
|
-
}
|
|
86291
|
-
},
|
|
86292
|
-
{
|
|
86293
|
-
key: "afterForged",
|
|
86294
|
-
value: function afterForged(func) {
|
|
86295
|
-
this.lifeCycleFuncMap["afterForged"] = func;
|
|
86296
|
-
}
|
|
86297
86272
|
}
|
|
86298
86273
|
]);
|
|
86299
86274
|
return PluginContext2;
|
|
86300
86275
|
}();
|
|
86301
86276
|
|
|
86302
86277
|
// ../../generator-plugin/dist/esm/utils/index.js
|
|
86303
|
-
var
|
|
86278
|
+
var import_path17 = __toESM(require("path"));
|
|
86304
86279
|
|
|
86305
86280
|
// ../../generator-plugin/dist/esm/utils/module.js
|
|
86306
86281
|
var import_lodash13 = require("@modern-js/utils/lodash");
|
|
@@ -86384,7 +86359,7 @@ function _installPlugins() {
|
|
|
86384
86359
|
switch (_state2.label) {
|
|
86385
86360
|
case 0:
|
|
86386
86361
|
if (plugin.startsWith("file:")) {
|
|
86387
|
-
pluginPath =
|
|
86362
|
+
pluginPath = import_path17.default.join(process.cwd(), plugin.slice(5));
|
|
86388
86363
|
return [
|
|
86389
86364
|
2,
|
|
86390
86365
|
{
|
|
@@ -86393,7 +86368,7 @@ function _installPlugins() {
|
|
|
86393
86368
|
}
|
|
86394
86369
|
];
|
|
86395
86370
|
}
|
|
86396
|
-
if (
|
|
86371
|
+
if (import_path17.default.isAbsolute(plugin)) {
|
|
86397
86372
|
return [
|
|
86398
86373
|
2,
|
|
86399
86374
|
{
|
|
@@ -86461,11 +86436,9 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
|
86461
86436
|
function GeneratorPlugin2(logger2, event) {
|
|
86462
86437
|
var locale = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "en";
|
|
86463
86438
|
_class_call_check(this, GeneratorPlugin2);
|
|
86464
|
-
|
|
86465
|
-
|
|
86466
|
-
|
|
86467
|
-
_define_property2(this, "event", void 0);
|
|
86468
|
-
_define_property2(this, "logger", void 0);
|
|
86439
|
+
this.plugins = [];
|
|
86440
|
+
this.extendPlugin = {};
|
|
86441
|
+
this.customPlugin = {};
|
|
86469
86442
|
this.event = event;
|
|
86470
86443
|
this.logger = logger2;
|
|
86471
86444
|
if (event) {
|
|
@@ -86481,451 +86454,421 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
|
86481
86454
|
locale
|
|
86482
86455
|
});
|
|
86483
86456
|
}
|
|
86484
|
-
|
|
86485
|
-
|
|
86486
|
-
|
|
86487
|
-
|
|
86488
|
-
|
|
86489
|
-
|
|
86490
|
-
|
|
86491
|
-
|
|
86492
|
-
|
|
86493
|
-
|
|
86494
|
-
|
|
86495
|
-
|
|
86496
|
-
|
|
86497
|
-
|
|
86498
|
-
|
|
86499
|
-
|
|
86500
|
-
|
|
86501
|
-
|
|
86502
|
-
|
|
86503
|
-
|
|
86504
|
-
|
|
86505
|
-
|
|
86506
|
-
|
|
86507
|
-
|
|
86508
|
-
|
|
86509
|
-
|
|
86510
|
-
|
|
86511
|
-
|
|
86512
|
-
|
|
86513
|
-
|
|
86514
|
-
|
|
86515
|
-
|
|
86516
|
-
|
|
86517
|
-
|
|
86518
|
-
|
|
86519
|
-
|
|
86520
|
-
|
|
86521
|
-
|
|
86522
|
-
|
|
86523
|
-
|
|
86524
|
-
|
|
86525
|
-
|
|
86526
|
-
|
|
86527
|
-
|
|
86528
|
-
|
|
86529
|
-
|
|
86530
|
-
|
|
86531
|
-
|
|
86532
|
-
|
|
86533
|
-
|
|
86534
|
-
|
|
86535
|
-
|
|
86536
|
-
|
|
86537
|
-
|
|
86538
|
-
|
|
86539
|
-
|
|
86540
|
-
|
|
86541
|
-
|
|
86542
|
-
|
|
86543
|
-
|
|
86544
|
-
|
|
86545
|
-
|
|
86546
|
-
|
|
86547
|
-
plugin
|
|
86548
|
-
}));
|
|
86549
|
-
}
|
|
86550
|
-
if (meta.extend) {
|
|
86551
|
-
_this.extendPlugin[meta.extend] = _to_consumable_array(_this.extendPlugin[meta.extend] || []).concat([
|
|
86552
|
-
plugin
|
|
86553
|
-
]);
|
|
86554
|
-
} else if (meta.type && meta.key) {
|
|
86555
|
-
_this.customPlugin[meta.type] = _to_consumable_array(_this.customPlugin[meta.type] || []).concat([
|
|
86556
|
-
_object_spread_props(_object_spread({}, meta), {
|
|
86557
|
-
plugin
|
|
86558
|
-
})
|
|
86559
|
-
]);
|
|
86560
|
-
}
|
|
86561
|
-
return [
|
|
86562
|
-
2
|
|
86563
|
-
];
|
|
86457
|
+
var _proto = GeneratorPlugin2.prototype;
|
|
86458
|
+
_proto.setupPlugin = function setupPlugin(plugins, registry2) {
|
|
86459
|
+
var _this = this;
|
|
86460
|
+
return _async_to_generator(function() {
|
|
86461
|
+
return __generator(this, function(_state) {
|
|
86462
|
+
switch (_state.label) {
|
|
86463
|
+
case 0:
|
|
86464
|
+
return [
|
|
86465
|
+
4,
|
|
86466
|
+
Promise.all(plugins.map(function() {
|
|
86467
|
+
var _ref = _async_to_generator(function(plugin) {
|
|
86468
|
+
var pkgJSON, _getPackageInfo, name, pkgVersion, meta;
|
|
86469
|
+
return __generator(this, function(_state2) {
|
|
86470
|
+
switch (_state2.label) {
|
|
86471
|
+
case 0:
|
|
86472
|
+
if (!plugin.startsWith("file:"))
|
|
86473
|
+
return [
|
|
86474
|
+
3,
|
|
86475
|
+
2
|
|
86476
|
+
];
|
|
86477
|
+
return [
|
|
86478
|
+
4,
|
|
86479
|
+
import_utils50.fs.readJSON(import_path18.default.join(process.cwd(), plugin.slice(5), "package.json"))
|
|
86480
|
+
];
|
|
86481
|
+
case 1:
|
|
86482
|
+
pkgJSON = _state2.sent();
|
|
86483
|
+
return [
|
|
86484
|
+
3,
|
|
86485
|
+
6
|
|
86486
|
+
];
|
|
86487
|
+
case 2:
|
|
86488
|
+
if (!import_path18.default.isAbsolute(plugin))
|
|
86489
|
+
return [
|
|
86490
|
+
3,
|
|
86491
|
+
4
|
|
86492
|
+
];
|
|
86493
|
+
return [
|
|
86494
|
+
4,
|
|
86495
|
+
import_utils50.fs.readJSON(import_path18.default.join(plugin, "package.json"))
|
|
86496
|
+
];
|
|
86497
|
+
case 3:
|
|
86498
|
+
pkgJSON = _state2.sent();
|
|
86499
|
+
return [
|
|
86500
|
+
3,
|
|
86501
|
+
6
|
|
86502
|
+
];
|
|
86503
|
+
case 4:
|
|
86504
|
+
_getPackageInfo = getPackageInfo(plugin), name = _getPackageInfo.name, pkgVersion = _getPackageInfo.version;
|
|
86505
|
+
return [
|
|
86506
|
+
4,
|
|
86507
|
+
getPackageMeta(name, pkgVersion, {
|
|
86508
|
+
registryUrl: registry2
|
|
86509
|
+
})
|
|
86510
|
+
];
|
|
86511
|
+
case 5:
|
|
86512
|
+
pkgJSON = _state2.sent();
|
|
86513
|
+
_state2.label = 6;
|
|
86514
|
+
case 6:
|
|
86515
|
+
meta = pkgJSON.meta;
|
|
86516
|
+
if (!meta) {
|
|
86517
|
+
throw new Error(i18n4.t(localeKeys4.plugin_no_meta_error, {
|
|
86518
|
+
plugin
|
|
86519
|
+
}));
|
|
86564
86520
|
}
|
|
86565
|
-
|
|
86566
|
-
|
|
86567
|
-
|
|
86568
|
-
|
|
86569
|
-
|
|
86570
|
-
|
|
86571
|
-
|
|
86572
|
-
|
|
86573
|
-
|
|
86574
|
-
|
|
86575
|
-
|
|
86576
|
-
|
|
86577
|
-
|
|
86578
|
-
|
|
86579
|
-
|
|
86580
|
-
|
|
86581
|
-
|
|
86582
|
-
|
|
86583
|
-
|
|
86584
|
-
|
|
86585
|
-
|
|
86586
|
-
|
|
86587
|
-
|
|
86588
|
-
|
|
86589
|
-
|
|
86590
|
-
|
|
86591
|
-
|
|
86592
|
-
} catch (err) {
|
|
86593
|
-
_didIteratorError = true;
|
|
86594
|
-
_iteratorError = err;
|
|
86595
|
-
} finally {
|
|
86596
|
-
try {
|
|
86597
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
86598
|
-
_iterator.return();
|
|
86599
|
-
}
|
|
86600
|
-
} finally {
|
|
86601
|
-
if (_didIteratorError) {
|
|
86602
|
-
throw _iteratorError;
|
|
86603
|
-
}
|
|
86604
|
-
}
|
|
86521
|
+
if (meta.extend) {
|
|
86522
|
+
_this.extendPlugin[meta.extend] = _to_consumable_array(_this.extendPlugin[meta.extend] || []).concat([
|
|
86523
|
+
plugin
|
|
86524
|
+
]);
|
|
86525
|
+
} else if (meta.type && meta.key) {
|
|
86526
|
+
_this.customPlugin[meta.type] = _to_consumable_array(_this.customPlugin[meta.type] || []).concat([
|
|
86527
|
+
_object_spread_props(_object_spread({}, meta), {
|
|
86528
|
+
plugin
|
|
86529
|
+
})
|
|
86530
|
+
]);
|
|
86531
|
+
}
|
|
86532
|
+
return [
|
|
86533
|
+
2
|
|
86534
|
+
];
|
|
86535
|
+
}
|
|
86536
|
+
});
|
|
86537
|
+
});
|
|
86538
|
+
return function(plugin) {
|
|
86539
|
+
return _ref.apply(this, arguments);
|
|
86540
|
+
};
|
|
86541
|
+
}()))
|
|
86542
|
+
];
|
|
86543
|
+
case 1:
|
|
86544
|
+
_state.sent();
|
|
86545
|
+
return [
|
|
86546
|
+
2
|
|
86547
|
+
];
|
|
86605
86548
|
}
|
|
86606
|
-
|
|
86607
|
-
|
|
86608
|
-
|
|
86609
|
-
|
|
86549
|
+
});
|
|
86550
|
+
})();
|
|
86551
|
+
};
|
|
86552
|
+
_proto.getInputSchema = function getInputSchema() {
|
|
86553
|
+
var properties = {};
|
|
86554
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
86555
|
+
try {
|
|
86556
|
+
for (var _iterator = this.plugins[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
86557
|
+
var info = _step.value;
|
|
86558
|
+
properties = _object_spread({}, properties, info.context.inputContext.getFinalInputs());
|
|
86610
86559
|
}
|
|
86611
|
-
}
|
|
86612
|
-
|
|
86613
|
-
|
|
86614
|
-
|
|
86615
|
-
|
|
86616
|
-
|
|
86617
|
-
|
|
86618
|
-
|
|
86619
|
-
|
|
86620
|
-
|
|
86621
|
-
|
|
86622
|
-
} catch (err) {
|
|
86623
|
-
_didIteratorError = true;
|
|
86624
|
-
_iteratorError = err;
|
|
86625
|
-
} finally {
|
|
86626
|
-
try {
|
|
86627
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
86628
|
-
_iterator.return();
|
|
86629
|
-
}
|
|
86630
|
-
} finally {
|
|
86631
|
-
if (_didIteratorError) {
|
|
86632
|
-
throw _iteratorError;
|
|
86633
|
-
}
|
|
86634
|
-
}
|
|
86560
|
+
} catch (err) {
|
|
86561
|
+
_didIteratorError = true;
|
|
86562
|
+
_iteratorError = err;
|
|
86563
|
+
} finally {
|
|
86564
|
+
try {
|
|
86565
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
86566
|
+
_iterator.return();
|
|
86567
|
+
}
|
|
86568
|
+
} finally {
|
|
86569
|
+
if (_didIteratorError) {
|
|
86570
|
+
throw _iteratorError;
|
|
86635
86571
|
}
|
|
86636
|
-
return result;
|
|
86637
86572
|
}
|
|
86638
|
-
}
|
|
86639
|
-
{
|
|
86640
|
-
|
|
86641
|
-
|
|
86642
|
-
|
|
86643
|
-
|
|
86644
|
-
|
|
86645
|
-
|
|
86646
|
-
|
|
86647
|
-
|
|
86648
|
-
|
|
86649
|
-
|
|
86650
|
-
|
|
86651
|
-
|
|
86652
|
-
|
|
86653
|
-
|
|
86654
|
-
|
|
86655
|
-
|
|
86656
|
-
|
|
86657
|
-
|
|
86658
|
-
|
|
86659
|
-
|
|
86660
|
-
|
|
86661
|
-
|
|
86573
|
+
}
|
|
86574
|
+
return {
|
|
86575
|
+
type: "object",
|
|
86576
|
+
properties
|
|
86577
|
+
};
|
|
86578
|
+
};
|
|
86579
|
+
_proto.getInputValue = function getInputValue() {
|
|
86580
|
+
var result = {};
|
|
86581
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
86582
|
+
try {
|
|
86583
|
+
for (var _iterator = this.plugins[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
86584
|
+
var info = _step.value;
|
|
86585
|
+
result = (0, import_lodash14.merge)(result, info.context.inputContext.inputValue);
|
|
86586
|
+
}
|
|
86587
|
+
} catch (err) {
|
|
86588
|
+
_didIteratorError = true;
|
|
86589
|
+
_iteratorError = err;
|
|
86590
|
+
} finally {
|
|
86591
|
+
try {
|
|
86592
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
86593
|
+
_iterator.return();
|
|
86594
|
+
}
|
|
86595
|
+
} finally {
|
|
86596
|
+
if (_didIteratorError) {
|
|
86597
|
+
throw _iteratorError;
|
|
86662
86598
|
}
|
|
86663
|
-
return result;
|
|
86664
86599
|
}
|
|
86665
|
-
}
|
|
86666
|
-
|
|
86667
|
-
|
|
86668
|
-
|
|
86669
|
-
|
|
86670
|
-
|
|
86671
|
-
|
|
86672
|
-
|
|
86673
|
-
|
|
86674
|
-
|
|
86675
|
-
plugins = [];
|
|
86676
|
-
if (_this.extendPlugin[solution] && _this.extendPlugin[solution].length > 0) {
|
|
86677
|
-
plugins = _to_consumable_array(plugins).concat(_to_consumable_array(_this.extendPlugin[solution]));
|
|
86678
|
-
}
|
|
86679
|
-
if (_this.customPlugin[solution]) {
|
|
86680
|
-
plugin = _this.customPlugin[solution].find(function(item) {
|
|
86681
|
-
return item.key === inputData.scenes;
|
|
86682
|
-
});
|
|
86683
|
-
if (plugin) {
|
|
86684
|
-
plugins.push(plugin.plugin);
|
|
86685
|
-
}
|
|
86686
|
-
}
|
|
86687
|
-
_this.logger.info(i18n4.t(localeKeys4.install_plugin));
|
|
86688
|
-
return [
|
|
86689
|
-
4,
|
|
86690
|
-
installPlugins(plugins, inputData.registry)
|
|
86691
|
-
];
|
|
86692
|
-
case 1:
|
|
86693
|
-
_this.plugins = _state.sent();
|
|
86694
|
-
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
86695
|
-
try {
|
|
86696
|
-
for (_iterator = _this.plugins[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
86697
|
-
info = _step.value;
|
|
86698
|
-
info.context = new PluginContext(SolutionSchemas[solution], inputData.locale);
|
|
86699
|
-
info.context.inputContext.prepare(inputData);
|
|
86700
|
-
info.module(info.context.context);
|
|
86701
|
-
}
|
|
86702
|
-
} catch (err) {
|
|
86703
|
-
_didIteratorError = true;
|
|
86704
|
-
_iteratorError = err;
|
|
86705
|
-
} finally {
|
|
86706
|
-
try {
|
|
86707
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
86708
|
-
_iterator.return();
|
|
86709
|
-
}
|
|
86710
|
-
} finally {
|
|
86711
|
-
if (_didIteratorError) {
|
|
86712
|
-
throw _iteratorError;
|
|
86713
|
-
}
|
|
86714
|
-
}
|
|
86715
|
-
}
|
|
86716
|
-
return [
|
|
86717
|
-
2
|
|
86718
|
-
];
|
|
86719
|
-
}
|
|
86720
|
-
});
|
|
86721
|
-
})();
|
|
86600
|
+
}
|
|
86601
|
+
return result;
|
|
86602
|
+
};
|
|
86603
|
+
_proto.getDefaultConfig = function getDefaultConfig() {
|
|
86604
|
+
var result = {};
|
|
86605
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
86606
|
+
try {
|
|
86607
|
+
for (var _iterator = this.plugins[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
86608
|
+
var info = _step.value;
|
|
86609
|
+
result = (0, import_lodash14.merge)(result, info.context.inputContext.defaultConfig);
|
|
86722
86610
|
}
|
|
86723
|
-
}
|
|
86724
|
-
|
|
86725
|
-
|
|
86726
|
-
|
|
86727
|
-
|
|
86728
|
-
|
|
86729
|
-
|
|
86730
|
-
|
|
86731
|
-
|
|
86732
|
-
|
|
86733
|
-
|
|
86734
|
-
var _info_context1;
|
|
86735
|
-
result = ((_info_context1 = info.context) === null || _info_context1 === void 0 ? void 0 : _info_context1.gitAPI.gitMessage) || "";
|
|
86736
|
-
}
|
|
86737
|
-
}
|
|
86738
|
-
} catch (err) {
|
|
86739
|
-
_didIteratorError = true;
|
|
86740
|
-
_iteratorError = err;
|
|
86741
|
-
} finally {
|
|
86742
|
-
try {
|
|
86743
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
86744
|
-
_iterator.return();
|
|
86745
|
-
}
|
|
86746
|
-
} finally {
|
|
86747
|
-
if (_didIteratorError) {
|
|
86748
|
-
throw _iteratorError;
|
|
86749
|
-
}
|
|
86750
|
-
}
|
|
86611
|
+
} catch (err) {
|
|
86612
|
+
_didIteratorError = true;
|
|
86613
|
+
_iteratorError = err;
|
|
86614
|
+
} finally {
|
|
86615
|
+
try {
|
|
86616
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
86617
|
+
_iterator.return();
|
|
86618
|
+
}
|
|
86619
|
+
} finally {
|
|
86620
|
+
if (_didIteratorError) {
|
|
86621
|
+
throw _iteratorError;
|
|
86751
86622
|
}
|
|
86752
|
-
return result;
|
|
86753
86623
|
}
|
|
86754
|
-
}
|
|
86755
|
-
|
|
86756
|
-
|
|
86757
|
-
|
|
86758
|
-
|
|
86759
|
-
|
|
86760
|
-
|
|
86761
|
-
|
|
86762
|
-
|
|
86763
|
-
|
|
86764
|
-
|
|
86765
|
-
|
|
86766
|
-
|
|
86767
|
-
|
|
86768
|
-
|
|
86769
|
-
|
|
86770
|
-
|
|
86771
|
-
|
|
86772
|
-
|
|
86773
|
-
|
|
86774
|
-
|
|
86775
|
-
|
|
86776
|
-
|
|
86777
|
-
|
|
86778
|
-
|
|
86779
|
-
|
|
86780
|
-
|
|
86781
|
-
|
|
86782
|
-
|
|
86783
|
-
|
|
86784
|
-
|
|
86785
|
-
|
|
86786
|
-
_state.label = 2;
|
|
86787
|
-
case 2:
|
|
86788
|
-
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done))
|
|
86789
|
-
return [
|
|
86790
|
-
3,
|
|
86791
|
-
5
|
|
86792
|
-
];
|
|
86624
|
+
}
|
|
86625
|
+
return result;
|
|
86626
|
+
};
|
|
86627
|
+
_proto.installPlugins = function installPlugins1(solution, inputData) {
|
|
86628
|
+
var _this = this;
|
|
86629
|
+
return _async_to_generator(function() {
|
|
86630
|
+
var plugins, plugin, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, info;
|
|
86631
|
+
return __generator(this, function(_state) {
|
|
86632
|
+
switch (_state.label) {
|
|
86633
|
+
case 0:
|
|
86634
|
+
plugins = [];
|
|
86635
|
+
if (_this.extendPlugin[solution] && _this.extendPlugin[solution].length > 0) {
|
|
86636
|
+
plugins = _to_consumable_array(plugins).concat(_to_consumable_array(_this.extendPlugin[solution]));
|
|
86637
|
+
}
|
|
86638
|
+
if (_this.customPlugin[solution]) {
|
|
86639
|
+
plugin = _this.customPlugin[solution].find(function(item) {
|
|
86640
|
+
return item.key === inputData.scenes;
|
|
86641
|
+
});
|
|
86642
|
+
if (plugin) {
|
|
86643
|
+
plugins.push(plugin.plugin);
|
|
86644
|
+
}
|
|
86645
|
+
}
|
|
86646
|
+
_this.logger.info(i18n4.t(localeKeys4.install_plugin));
|
|
86647
|
+
return [
|
|
86648
|
+
4,
|
|
86649
|
+
installPlugins(plugins, inputData.registry)
|
|
86650
|
+
];
|
|
86651
|
+
case 1:
|
|
86652
|
+
_this.plugins = _state.sent();
|
|
86653
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
86654
|
+
try {
|
|
86655
|
+
for (_iterator = _this.plugins[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
86793
86656
|
info = _step.value;
|
|
86794
|
-
|
|
86795
|
-
|
|
86796
|
-
|
|
86797
|
-
|
|
86798
|
-
|
|
86799
|
-
|
|
86800
|
-
|
|
86801
|
-
|
|
86802
|
-
|
|
86803
|
-
|
|
86804
|
-
|
|
86805
|
-
case 3:
|
|
86806
|
-
_state.sent();
|
|
86807
|
-
_state.label = 4;
|
|
86808
|
-
case 4:
|
|
86809
|
-
_iteratorNormalCompletion = true;
|
|
86810
|
-
return [
|
|
86811
|
-
3,
|
|
86812
|
-
2
|
|
86813
|
-
];
|
|
86814
|
-
case 5:
|
|
86815
|
-
return [
|
|
86816
|
-
3,
|
|
86817
|
-
8
|
|
86818
|
-
];
|
|
86819
|
-
case 6:
|
|
86820
|
-
err = _state.sent();
|
|
86821
|
-
_didIteratorError = true;
|
|
86822
|
-
_iteratorError = err;
|
|
86823
|
-
return [
|
|
86824
|
-
3,
|
|
86825
|
-
8
|
|
86826
|
-
];
|
|
86827
|
-
case 7:
|
|
86828
|
-
try {
|
|
86829
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
86830
|
-
_iterator.return();
|
|
86831
|
-
}
|
|
86832
|
-
} finally {
|
|
86833
|
-
if (_didIteratorError) {
|
|
86834
|
-
throw _iteratorError;
|
|
86835
|
-
}
|
|
86836
|
-
}
|
|
86837
|
-
return [
|
|
86838
|
-
7
|
|
86839
|
-
];
|
|
86840
|
-
case 8:
|
|
86841
|
-
_iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
86842
|
-
_state.label = 9;
|
|
86843
|
-
case 9:
|
|
86844
|
-
_state.trys.push([
|
|
86845
|
-
9,
|
|
86846
|
-
14,
|
|
86847
|
-
15,
|
|
86848
|
-
16
|
|
86849
|
-
]);
|
|
86850
|
-
_iterator1 = _this.plugins[Symbol.iterator]();
|
|
86851
|
-
_state.label = 10;
|
|
86852
|
-
case 10:
|
|
86853
|
-
if (!!(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done))
|
|
86854
|
-
return [
|
|
86855
|
-
3,
|
|
86856
|
-
13
|
|
86857
|
-
];
|
|
86858
|
-
info1 = _step1.value;
|
|
86859
|
-
afterForged = (_info_context2 = info1.context) === null || _info_context2 === void 0 ? void 0 : _info_context2.lifeCycleFuncMap[LifeCycle2.AfterForged];
|
|
86860
|
-
if (!(afterForged && (0, import_lodash14.isFunction)(afterForged)))
|
|
86861
|
-
return [
|
|
86862
|
-
3,
|
|
86863
|
-
12
|
|
86864
|
-
];
|
|
86865
|
-
return [
|
|
86866
|
-
4,
|
|
86867
|
-
afterForged(info1.context.afterForgedAPI, restData)
|
|
86868
|
-
];
|
|
86869
|
-
case 11:
|
|
86870
|
-
_state.sent();
|
|
86871
|
-
_state.label = 12;
|
|
86872
|
-
case 12:
|
|
86873
|
-
_iteratorNormalCompletion1 = true;
|
|
86874
|
-
return [
|
|
86875
|
-
3,
|
|
86876
|
-
10
|
|
86877
|
-
];
|
|
86878
|
-
case 13:
|
|
86879
|
-
return [
|
|
86880
|
-
3,
|
|
86881
|
-
16
|
|
86882
|
-
];
|
|
86883
|
-
case 14:
|
|
86884
|
-
err = _state.sent();
|
|
86885
|
-
_didIteratorError1 = true;
|
|
86886
|
-
_iteratorError1 = err;
|
|
86887
|
-
return [
|
|
86888
|
-
3,
|
|
86889
|
-
16
|
|
86890
|
-
];
|
|
86891
|
-
case 15:
|
|
86892
|
-
try {
|
|
86893
|
-
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
86894
|
-
_iterator1.return();
|
|
86895
|
-
}
|
|
86896
|
-
} finally {
|
|
86897
|
-
if (_didIteratorError1) {
|
|
86898
|
-
throw _iteratorError1;
|
|
86899
|
-
}
|
|
86657
|
+
info.context = new PluginContext(SolutionSchemas[solution], inputData.locale);
|
|
86658
|
+
info.context.inputContext.prepare(inputData);
|
|
86659
|
+
info.module(info.context.context);
|
|
86660
|
+
}
|
|
86661
|
+
} catch (err) {
|
|
86662
|
+
_didIteratorError = true;
|
|
86663
|
+
_iteratorError = err;
|
|
86664
|
+
} finally {
|
|
86665
|
+
try {
|
|
86666
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
86667
|
+
_iterator.return();
|
|
86900
86668
|
}
|
|
86901
|
-
|
|
86902
|
-
|
|
86903
|
-
|
|
86904
|
-
case 16:
|
|
86905
|
-
if (_this.event) {
|
|
86906
|
-
_this.event.emit("handle forged success");
|
|
86669
|
+
} finally {
|
|
86670
|
+
if (_didIteratorError) {
|
|
86671
|
+
throw _iteratorError;
|
|
86907
86672
|
}
|
|
86908
|
-
|
|
86909
|
-
2
|
|
86910
|
-
];
|
|
86673
|
+
}
|
|
86911
86674
|
}
|
|
86912
|
-
|
|
86913
|
-
|
|
86675
|
+
return [
|
|
86676
|
+
2
|
|
86677
|
+
];
|
|
86678
|
+
}
|
|
86679
|
+
});
|
|
86680
|
+
})();
|
|
86681
|
+
};
|
|
86682
|
+
_proto.getGitMessage = function getGitMessage() {
|
|
86683
|
+
var result = "";
|
|
86684
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
86685
|
+
try {
|
|
86686
|
+
for (var _iterator = this.plugins[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
86687
|
+
var info = _step.value;
|
|
86688
|
+
var _info_context;
|
|
86689
|
+
if ((_info_context = info.context) === null || _info_context === void 0 ? void 0 : _info_context.gitAPI.gitMessage) {
|
|
86690
|
+
var _info_context1;
|
|
86691
|
+
result = ((_info_context1 = info.context) === null || _info_context1 === void 0 ? void 0 : _info_context1.gitAPI.gitMessage) || "";
|
|
86692
|
+
}
|
|
86693
|
+
}
|
|
86694
|
+
} catch (err) {
|
|
86695
|
+
_didIteratorError = true;
|
|
86696
|
+
_iteratorError = err;
|
|
86697
|
+
} finally {
|
|
86698
|
+
try {
|
|
86699
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
86700
|
+
_iterator.return();
|
|
86701
|
+
}
|
|
86702
|
+
} finally {
|
|
86703
|
+
if (_didIteratorError) {
|
|
86704
|
+
throw _iteratorError;
|
|
86705
|
+
}
|
|
86914
86706
|
}
|
|
86915
86707
|
}
|
|
86916
|
-
|
|
86708
|
+
return result;
|
|
86709
|
+
};
|
|
86710
|
+
_proto.handleForged = function handleForged(solution, basePath, inputData, projectPath, generatorCore) {
|
|
86711
|
+
var _this = this;
|
|
86712
|
+
return _async_to_generator(function() {
|
|
86713
|
+
var generatorPlugin, restData, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, info, _info_context, _info_context1, onForgedFunc, err, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, info1, _info_context2, afterForged, err;
|
|
86714
|
+
return __generator(this, function(_state) {
|
|
86715
|
+
switch (_state.label) {
|
|
86716
|
+
case 0:
|
|
86717
|
+
_this.logger.info(i18n4.t(localeKeys4.run_plugin));
|
|
86718
|
+
generatorPlugin = inputData.generatorPlugin, restData = _object_without_properties(inputData, [
|
|
86719
|
+
"generatorPlugin"
|
|
86720
|
+
]);
|
|
86721
|
+
if (solution !== restData.solution) {
|
|
86722
|
+
if (_this.event) {
|
|
86723
|
+
_this.event.emit("handle forged success");
|
|
86724
|
+
}
|
|
86725
|
+
return [
|
|
86726
|
+
2
|
|
86727
|
+
];
|
|
86728
|
+
}
|
|
86729
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
86730
|
+
_state.label = 1;
|
|
86731
|
+
case 1:
|
|
86732
|
+
_state.trys.push([
|
|
86733
|
+
1,
|
|
86734
|
+
6,
|
|
86735
|
+
7,
|
|
86736
|
+
8
|
|
86737
|
+
]);
|
|
86738
|
+
_iterator = _this.plugins[Symbol.iterator]();
|
|
86739
|
+
_state.label = 2;
|
|
86740
|
+
case 2:
|
|
86741
|
+
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done))
|
|
86742
|
+
return [
|
|
86743
|
+
3,
|
|
86744
|
+
5
|
|
86745
|
+
];
|
|
86746
|
+
info = _step.value;
|
|
86747
|
+
(_info_context = info.context) === null || _info_context === void 0 ? void 0 : _info_context.handlePrepareContext(generatorCore, solution, import_path18.default.join(basePath, projectPath), import_path18.default.join(info.templatePath, "templates"), restData);
|
|
86748
|
+
onForgedFunc = (_info_context1 = info.context) === null || _info_context1 === void 0 ? void 0 : _info_context1.lifeCycleFuncMap[LifeCycle2.OnForged];
|
|
86749
|
+
if (!(onForgedFunc && (0, import_lodash14.isFunction)(onForgedFunc)))
|
|
86750
|
+
return [
|
|
86751
|
+
3,
|
|
86752
|
+
4
|
|
86753
|
+
];
|
|
86754
|
+
return [
|
|
86755
|
+
4,
|
|
86756
|
+
onForgedFunc(info.context.forgedAPI, restData)
|
|
86757
|
+
];
|
|
86758
|
+
case 3:
|
|
86759
|
+
_state.sent();
|
|
86760
|
+
_state.label = 4;
|
|
86761
|
+
case 4:
|
|
86762
|
+
_iteratorNormalCompletion = true;
|
|
86763
|
+
return [
|
|
86764
|
+
3,
|
|
86765
|
+
2
|
|
86766
|
+
];
|
|
86767
|
+
case 5:
|
|
86768
|
+
return [
|
|
86769
|
+
3,
|
|
86770
|
+
8
|
|
86771
|
+
];
|
|
86772
|
+
case 6:
|
|
86773
|
+
err = _state.sent();
|
|
86774
|
+
_didIteratorError = true;
|
|
86775
|
+
_iteratorError = err;
|
|
86776
|
+
return [
|
|
86777
|
+
3,
|
|
86778
|
+
8
|
|
86779
|
+
];
|
|
86780
|
+
case 7:
|
|
86781
|
+
try {
|
|
86782
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
86783
|
+
_iterator.return();
|
|
86784
|
+
}
|
|
86785
|
+
} finally {
|
|
86786
|
+
if (_didIteratorError) {
|
|
86787
|
+
throw _iteratorError;
|
|
86788
|
+
}
|
|
86789
|
+
}
|
|
86790
|
+
return [
|
|
86791
|
+
7
|
|
86792
|
+
];
|
|
86793
|
+
case 8:
|
|
86794
|
+
_iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
86795
|
+
_state.label = 9;
|
|
86796
|
+
case 9:
|
|
86797
|
+
_state.trys.push([
|
|
86798
|
+
9,
|
|
86799
|
+
14,
|
|
86800
|
+
15,
|
|
86801
|
+
16
|
|
86802
|
+
]);
|
|
86803
|
+
_iterator1 = _this.plugins[Symbol.iterator]();
|
|
86804
|
+
_state.label = 10;
|
|
86805
|
+
case 10:
|
|
86806
|
+
if (!!(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done))
|
|
86807
|
+
return [
|
|
86808
|
+
3,
|
|
86809
|
+
13
|
|
86810
|
+
];
|
|
86811
|
+
info1 = _step1.value;
|
|
86812
|
+
afterForged = (_info_context2 = info1.context) === null || _info_context2 === void 0 ? void 0 : _info_context2.lifeCycleFuncMap[LifeCycle2.AfterForged];
|
|
86813
|
+
if (!(afterForged && (0, import_lodash14.isFunction)(afterForged)))
|
|
86814
|
+
return [
|
|
86815
|
+
3,
|
|
86816
|
+
12
|
|
86817
|
+
];
|
|
86818
|
+
return [
|
|
86819
|
+
4,
|
|
86820
|
+
afterForged(info1.context.afterForgedAPI, restData)
|
|
86821
|
+
];
|
|
86822
|
+
case 11:
|
|
86823
|
+
_state.sent();
|
|
86824
|
+
_state.label = 12;
|
|
86825
|
+
case 12:
|
|
86826
|
+
_iteratorNormalCompletion1 = true;
|
|
86827
|
+
return [
|
|
86828
|
+
3,
|
|
86829
|
+
10
|
|
86830
|
+
];
|
|
86831
|
+
case 13:
|
|
86832
|
+
return [
|
|
86833
|
+
3,
|
|
86834
|
+
16
|
|
86835
|
+
];
|
|
86836
|
+
case 14:
|
|
86837
|
+
err = _state.sent();
|
|
86838
|
+
_didIteratorError1 = true;
|
|
86839
|
+
_iteratorError1 = err;
|
|
86840
|
+
return [
|
|
86841
|
+
3,
|
|
86842
|
+
16
|
|
86843
|
+
];
|
|
86844
|
+
case 15:
|
|
86845
|
+
try {
|
|
86846
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
86847
|
+
_iterator1.return();
|
|
86848
|
+
}
|
|
86849
|
+
} finally {
|
|
86850
|
+
if (_didIteratorError1) {
|
|
86851
|
+
throw _iteratorError1;
|
|
86852
|
+
}
|
|
86853
|
+
}
|
|
86854
|
+
return [
|
|
86855
|
+
7
|
|
86856
|
+
];
|
|
86857
|
+
case 16:
|
|
86858
|
+
if (_this.event) {
|
|
86859
|
+
_this.event.emit("handle forged success");
|
|
86860
|
+
}
|
|
86861
|
+
return [
|
|
86862
|
+
2
|
|
86863
|
+
];
|
|
86864
|
+
}
|
|
86865
|
+
});
|
|
86866
|
+
})();
|
|
86867
|
+
};
|
|
86917
86868
|
return GeneratorPlugin2;
|
|
86918
86869
|
}();
|
|
86919
86870
|
|
|
86920
86871
|
// src/index.ts
|
|
86921
|
-
var getGeneratorPath2 = (generator, distTag) => {
|
|
86922
|
-
if (process.env.CODESMITH_ENV === "development") {
|
|
86923
|
-
return import_path18.default.dirname(require.resolve(generator));
|
|
86924
|
-
} else if (distTag) {
|
|
86925
|
-
return `${generator}@${distTag}`;
|
|
86926
|
-
}
|
|
86927
|
-
return generator;
|
|
86928
|
-
};
|
|
86929
86872
|
var mergeDefaultConfig = (context) => {
|
|
86930
86873
|
const { defaultSolution } = context.config;
|
|
86931
86874
|
if (defaultSolution) {
|
|
@@ -86966,7 +86909,7 @@ var handleTemplateFile = async (context, generator, appApi, generatorPlugin) =>
|
|
|
86966
86909
|
generator.logger.error("solution is not valid ");
|
|
86967
86910
|
}
|
|
86968
86911
|
await appApi.runSubGenerator(
|
|
86969
|
-
|
|
86912
|
+
getGeneratorPath(solutionGenerator, context.config.distTag, [__dirname]),
|
|
86970
86913
|
void 0,
|
|
86971
86914
|
{
|
|
86972
86915
|
...isMonorepo ? MonorepoNewActionConfig[solution] || {} : {},
|