@modern-js/repo-generator 0.0.0-next-20240315021250 → 0.0.0-next-20240315022508

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.
Files changed (3) hide show
  1. package/dist/index.js +1755 -1698
  2. package/package.json +13 -13
  3. package/src/index.ts +11 -2
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.5/node_modules/follow-redirects/debug.js
18190
+ // ../../../../node_modules/.pnpm/follow-redirects@1.15.1/node_modules/follow-redirects/debug.js
18191
18191
  var require_debug = __commonJS({
18192
- "../../../../node_modules/.pnpm/follow-redirects@1.15.5/node_modules/follow-redirects/debug.js"(exports, module2) {
18192
+ "../../../../node_modules/.pnpm/follow-redirects@1.15.1/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.5/node_modules/follow-redirects/index.js
18211
+ // ../../../../node_modules/.pnpm/follow-redirects@1.15.1/node_modules/follow-redirects/index.js
18212
18212
  var require_follow_redirects = __commonJS({
18213
- "../../../../node_modules/.pnpm/follow-redirects@1.15.5/node_modules/follow-redirects/index.js"(exports, module2) {
18213
+ "../../../../node_modules/.pnpm/follow-redirects@1.15.1/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,25 +18219,6 @@ 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
- ];
18241
18222
  var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
18242
18223
  var eventHandlers = /* @__PURE__ */ Object.create(null);
18243
18224
  events.forEach(function(event) {
@@ -18245,19 +18226,13 @@ var require_follow_redirects = __commonJS({
18245
18226
  this._redirectable.emit(event, arg1, arg2, arg3);
18246
18227
  };
18247
18228
  });
18248
- var InvalidUrlError = createErrorType(
18249
- "ERR_INVALID_URL",
18250
- "Invalid URL",
18251
- TypeError
18252
- );
18253
18229
  var RedirectionError = createErrorType(
18254
18230
  "ERR_FR_REDIRECTION_FAILURE",
18255
18231
  "Redirected request failed"
18256
18232
  );
18257
18233
  var TooManyRedirectsError = createErrorType(
18258
18234
  "ERR_FR_TOO_MANY_REDIRECTS",
18259
- "Maximum number of redirects exceeded",
18260
- RedirectionError
18235
+ "Maximum number of redirects exceeded"
18261
18236
  );
18262
18237
  var MaxBodyLengthExceededError = createErrorType(
18263
18238
  "ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
@@ -18267,7 +18242,6 @@ var require_follow_redirects = __commonJS({
18267
18242
  "ERR_STREAM_WRITE_AFTER_END",
18268
18243
  "write after end"
18269
18244
  );
18270
- var destroy2 = Writable.prototype.destroy || noop2;
18271
18245
  function RedirectableRequest(options, responseCallback) {
18272
18246
  Writable.call(this);
18273
18247
  this._sanitizeOptions(options);
@@ -18283,33 +18257,23 @@ var require_follow_redirects = __commonJS({
18283
18257
  }
18284
18258
  var self3 = this;
18285
18259
  this._onNativeResponse = function(response) {
18286
- try {
18287
- self3._processResponse(response);
18288
- } catch (cause) {
18289
- self3.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
18290
- }
18260
+ self3._processResponse(response);
18291
18261
  };
18292
18262
  this._performRequest();
18293
18263
  }
18294
18264
  RedirectableRequest.prototype = Object.create(Writable.prototype);
18295
18265
  RedirectableRequest.prototype.abort = function() {
18296
- destroyRequest(this._currentRequest);
18297
- this._currentRequest.abort();
18266
+ abortRequest(this._currentRequest);
18298
18267
  this.emit("abort");
18299
18268
  };
18300
- RedirectableRequest.prototype.destroy = function(error) {
18301
- destroyRequest(this._currentRequest, error);
18302
- destroy2.call(this, error);
18303
- return this;
18304
- };
18305
18269
  RedirectableRequest.prototype.write = function(data, encoding, callback) {
18306
18270
  if (this._ending) {
18307
18271
  throw new WriteAfterEndError();
18308
18272
  }
18309
- if (!isString5(data) && !isBuffer2(data)) {
18273
+ if (!(typeof data === "string" || typeof data === "object" && "length" in data)) {
18310
18274
  throw new TypeError("data should be a string, Buffer or Uint8Array");
18311
18275
  }
18312
- if (isFunction5(encoding)) {
18276
+ if (typeof encoding === "function") {
18313
18277
  callback = encoding;
18314
18278
  encoding = null;
18315
18279
  }
@@ -18329,10 +18293,10 @@ var require_follow_redirects = __commonJS({
18329
18293
  }
18330
18294
  };
18331
18295
  RedirectableRequest.prototype.end = function(data, encoding, callback) {
18332
- if (isFunction5(data)) {
18296
+ if (typeof data === "function") {
18333
18297
  callback = data;
18334
18298
  data = encoding = null;
18335
- } else if (isFunction5(encoding)) {
18299
+ } else if (typeof encoding === "function") {
18336
18300
  callback = encoding;
18337
18301
  encoding = null;
18338
18302
  }
@@ -18382,7 +18346,6 @@ var require_follow_redirects = __commonJS({
18382
18346
  self3.removeListener("abort", clearTimer);
18383
18347
  self3.removeListener("error", clearTimer);
18384
18348
  self3.removeListener("response", clearTimer);
18385
- self3.removeListener("close", clearTimer);
18386
18349
  if (callback) {
18387
18350
  self3.removeListener("timeout", callback);
18388
18351
  }
@@ -18402,7 +18365,6 @@ var require_follow_redirects = __commonJS({
18402
18365
  this.on("abort", clearTimer);
18403
18366
  this.on("error", clearTimer);
18404
18367
  this.on("response", clearTimer);
18405
- this.on("close", clearTimer);
18406
18368
  return this;
18407
18369
  };
18408
18370
  [
@@ -18446,7 +18408,8 @@ var require_follow_redirects = __commonJS({
18446
18408
  var protocol = this._options.protocol;
18447
18409
  var nativeProtocol = this._options.nativeProtocols[protocol];
18448
18410
  if (!nativeProtocol) {
18449
- throw new TypeError("Unsupported protocol " + protocol);
18411
+ this.emit("error", new TypeError("Unsupported protocol " + protocol));
18412
+ return;
18450
18413
  }
18451
18414
  if (this._options.agents) {
18452
18415
  var scheme = protocol.slice(0, -1);
@@ -18460,7 +18423,7 @@ var require_follow_redirects = __commonJS({
18460
18423
  this._currentUrl = /^\//.test(this._options.path) ? url2.format(this._options) : (
18461
18424
  // When making a request to a proxy, […]
18462
18425
  // a client MUST send the target URI in absolute-form […].
18463
- this._options.path
18426
+ this._currentUrl = this._options.path
18464
18427
  );
18465
18428
  if (this._isRedirect) {
18466
18429
  var i = 0;
@@ -18499,10 +18462,11 @@ var require_follow_redirects = __commonJS({
18499
18462
  this._requestBodyBuffers = [];
18500
18463
  return;
18501
18464
  }
18502
- destroyRequest(this._currentRequest);
18465
+ abortRequest(this._currentRequest);
18503
18466
  response.destroy();
18504
18467
  if (++this._redirectCount > this._options.maxRedirects) {
18505
- throw new TooManyRedirectsError();
18468
+ this.emit("error", new TooManyRedirectsError());
18469
+ return;
18506
18470
  }
18507
18471
  var requestHeaders;
18508
18472
  var beforeRedirect = this._options.beforeRedirect;
@@ -18523,17 +18487,24 @@ var require_follow_redirects = __commonJS({
18523
18487
  removeMatchingHeaders(/^content-/i, this._options.headers);
18524
18488
  }
18525
18489
  var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
18526
- var currentUrlParts = parseUrl(this._currentUrl);
18490
+ var currentUrlParts = url2.parse(this._currentUrl);
18527
18491
  var currentHost = currentHostHeader || currentUrlParts.host;
18528
18492
  var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url2.format(Object.assign(currentUrlParts, { host: currentHost }));
18529
- var redirectUrl = resolveUrl(location, currentUrl);
18530
- debug("redirecting to", redirectUrl.href);
18493
+ var redirectUrl;
18494
+ try {
18495
+ redirectUrl = url2.resolve(currentUrl, location);
18496
+ } catch (cause) {
18497
+ this.emit("error", new RedirectionError(cause));
18498
+ return;
18499
+ }
18500
+ debug("redirecting to", redirectUrl);
18531
18501
  this._isRedirect = true;
18532
- spreadUrlObject(redirectUrl, this._options);
18533
- if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
18502
+ var redirectUrlParts = url2.parse(redirectUrl);
18503
+ Object.assign(this._options, redirectUrlParts);
18504
+ if (redirectUrlParts.protocol !== currentUrlParts.protocol && redirectUrlParts.protocol !== "https:" || redirectUrlParts.host !== currentHost && !isSubdomain(redirectUrlParts.host, currentHost)) {
18534
18505
  removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
18535
18506
  }
18536
- if (isFunction5(beforeRedirect)) {
18507
+ if (typeof beforeRedirect === "function") {
18537
18508
  var responseDetails = {
18538
18509
  headers: response.headers,
18539
18510
  statusCode
@@ -18543,10 +18514,19 @@ var require_follow_redirects = __commonJS({
18543
18514
  method,
18544
18515
  headers: requestHeaders
18545
18516
  };
18546
- beforeRedirect(this._options, responseDetails, requestDetails);
18517
+ try {
18518
+ beforeRedirect(this._options, responseDetails, requestDetails);
18519
+ } catch (err) {
18520
+ this.emit("error", err);
18521
+ return;
18522
+ }
18547
18523
  this._sanitizeOptions(this._options);
18548
18524
  }
18549
- this._performRequest();
18525
+ try {
18526
+ this._performRequest();
18527
+ } catch (cause) {
18528
+ this.emit("error", new RedirectionError(cause));
18529
+ }
18550
18530
  };
18551
18531
  function wrap(protocols) {
18552
18532
  var exports2 = {
@@ -18559,16 +18539,21 @@ var require_follow_redirects = __commonJS({
18559
18539
  var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
18560
18540
  var wrappedProtocol = exports2[scheme] = Object.create(nativeProtocol);
18561
18541
  function request(input, options, callback) {
18562
- if (isURL(input)) {
18563
- input = spreadUrlObject(input);
18564
- } else if (isString5(input)) {
18565
- input = spreadUrlObject(parseUrl(input));
18542
+ if (typeof input === "string") {
18543
+ var urlStr = input;
18544
+ try {
18545
+ input = urlToOptions(new URL2(urlStr));
18546
+ } catch (err) {
18547
+ input = url2.parse(urlStr);
18548
+ }
18549
+ } else if (URL2 && input instanceof URL2) {
18550
+ input = urlToOptions(input);
18566
18551
  } else {
18567
18552
  callback = options;
18568
- options = validateUrl(input);
18553
+ options = input;
18569
18554
  input = { protocol };
18570
18555
  }
18571
- if (isFunction5(options)) {
18556
+ if (typeof options === "function") {
18572
18557
  callback = options;
18573
18558
  options = null;
18574
18559
  }
@@ -18577,9 +18562,6 @@ var require_follow_redirects = __commonJS({
18577
18562
  maxBodyLength: exports2.maxBodyLength
18578
18563
  }, input, options);
18579
18564
  options.nativeProtocols = nativeProtocols;
18580
- if (!isString5(options.host) && !isString5(options.hostname)) {
18581
- options.hostname = "::1";
18582
- }
18583
18565
  assert.equal(options.protocol, protocol, "protocol mismatch");
18584
18566
  debug("options", options);
18585
18567
  return new RedirectableRequest(options, callback);
@@ -18598,43 +18580,23 @@ var require_follow_redirects = __commonJS({
18598
18580
  }
18599
18581
  function noop2() {
18600
18582
  }
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
- }
18583
+ function urlToOptions(urlObject) {
18584
+ var options = {
18585
+ protocol: urlObject.protocol,
18586
+ hostname: urlObject.hostname.startsWith("[") ? (
18587
+ /* istanbul ignore next */
18588
+ urlObject.hostname.slice(1, -1)
18589
+ ) : urlObject.hostname,
18590
+ hash: urlObject.hash,
18591
+ search: urlObject.search,
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);
18610
18598
  }
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;
18599
+ return options;
18638
18600
  }
18639
18601
  function removeMatchingHeaders(regex2, headers) {
18640
18602
  var lastValue;
@@ -18646,50 +18608,33 @@ var require_follow_redirects = __commonJS({
18646
18608
  }
18647
18609
  return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim();
18648
18610
  }
18649
- function createErrorType(code, message, baseClass) {
18650
- function CustomError(properties) {
18611
+ function createErrorType(code, defaultMessage) {
18612
+ function CustomError(cause) {
18651
18613
  Error.captureStackTrace(this, this.constructor);
18652
- Object.assign(this, properties || {});
18653
- this.code = code;
18654
- this.message = this.cause ? message + ": " + this.cause.message : message;
18655
- }
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
18614
+ if (!cause) {
18615
+ this.message = defaultMessage;
18616
+ } else {
18617
+ this.message = defaultMessage + ": " + cause.message;
18618
+ this.cause = cause;
18665
18619
  }
18666
- });
18620
+ }
18621
+ CustomError.prototype = new Error();
18622
+ CustomError.prototype.constructor = CustomError;
18623
+ CustomError.prototype.name = "Error [" + code + "]";
18624
+ CustomError.prototype.code = code;
18667
18625
  return CustomError;
18668
18626
  }
18669
- function destroyRequest(request, error) {
18627
+ function abortRequest(request) {
18670
18628
  for (var event of events) {
18671
18629
  request.removeListener(event, eventHandlers[event]);
18672
18630
  }
18673
18631
  request.on("error", noop2);
18674
- request.destroy(error);
18632
+ request.abort();
18675
18633
  }
18676
18634
  function isSubdomain(subdomain, domain) {
18677
- assert(isString5(subdomain) && isString5(domain));
18678
- var dot = subdomain.length - domain.length - 1;
18635
+ const dot = subdomain.length - domain.length - 1;
18679
18636
  return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
18680
18637
  }
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
- }
18693
18638
  module2.exports = wrap({ http: http2, https: https2 });
18694
18639
  module2.exports.wrap = wrap;
18695
18640
  }
@@ -28563,7 +28508,7 @@ var require_binary_search = __commonJS({
28563
28508
  var require_quick_sort = __commonJS({
28564
28509
  "../../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js"(exports) {
28565
28510
  "use strict";
28566
- function swap2(ary, x, y) {
28511
+ function swap(ary, x, y) {
28567
28512
  var temp = ary[x];
28568
28513
  ary[x] = ary[y];
28569
28514
  ary[y] = temp;
@@ -28575,15 +28520,15 @@ var require_quick_sort = __commonJS({
28575
28520
  if (p < r) {
28576
28521
  var pivotIndex = randomIntInRange(p, r);
28577
28522
  var i = p - 1;
28578
- swap2(ary, pivotIndex, r);
28523
+ swap(ary, pivotIndex, r);
28579
28524
  var pivot = ary[r];
28580
28525
  for (var j = p; j < r; j++) {
28581
28526
  if (comparator(ary[j], pivot) <= 0) {
28582
28527
  i += 1;
28583
- swap2(ary, i, j);
28528
+ swap(ary, i, j);
28584
28529
  }
28585
28530
  }
28586
- swap2(ary, i + 1, j);
28531
+ swap(ary, i + 1, j);
28587
28532
  var q = i + 1;
28588
28533
  doQuickSort(ary, comparator, p, q - 1);
28589
28534
  doQuickSort(ary, comparator, q + 1, r);
@@ -31459,9 +31404,9 @@ var require_ejs = __commonJS({
31459
31404
  }
31460
31405
  });
31461
31406
 
31462
- // ../../../../node_modules/.pnpm/@modern-js+utils@2.39.2/node_modules/@modern-js/utils/dist/compiled/chalk/index.js
31407
+ // ../../../../node_modules/.pnpm/@modern-js+utils@2.45.0/node_modules/@modern-js/utils/dist/compiled/chalk/index.js
31463
31408
  var require_chalk = __commonJS({
31464
- "../../../../node_modules/.pnpm/@modern-js+utils@2.39.2/node_modules/@modern-js/utils/dist/compiled/chalk/index.js"(exports, module2) {
31409
+ "../../../../node_modules/.pnpm/@modern-js+utils@2.45.0/node_modules/@modern-js/utils/dist/compiled/chalk/index.js"(exports, module2) {
31465
31410
  "use strict";
31466
31411
  (() => {
31467
31412
  var e = { 44: (e2, t2, n2) => {
@@ -64263,10 +64208,10 @@ var require_extend_node = __commonJS({
64263
64208
  length = void 0;
64264
64209
  }
64265
64210
  } else {
64266
- var swap2 = encoding;
64211
+ var swap = encoding;
64267
64212
  encoding = offset;
64268
64213
  offset = length;
64269
- length = swap2;
64214
+ length = swap;
64270
64215
  }
64271
64216
  offset = +offset || 0;
64272
64217
  var remaining = this.length - offset;
@@ -64320,10 +64265,10 @@ var require_extend_node = __commonJS({
64320
64265
  length = void 0;
64321
64266
  }
64322
64267
  } else {
64323
- var swap2 = encoding;
64268
+ var swap = encoding;
64324
64269
  encoding = offset;
64325
64270
  offset = length;
64326
- length = swap2;
64271
+ length = swap;
64327
64272
  }
64328
64273
  encoding = String(encoding || "utf8").toLowerCase();
64329
64274
  if (Buffer2.isNativeEncoding(encoding))
@@ -68844,6 +68789,7 @@ __export(src_exports, {
68844
68789
  default: () => src_default
68845
68790
  });
68846
68791
  module.exports = __toCommonJS(src_exports);
68792
+ var import_path18 = __toESM(require("path"));
68847
68793
  var import_lodash15 = require("@modern-js/utils/lodash");
68848
68794
 
68849
68795
  // ../../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/esm/_define_property.js
@@ -68855,12 +68801,12 @@ function _define_property(obj, key, value) {
68855
68801
  return obj;
68856
68802
  }
68857
68803
 
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
68804
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
68859
68805
  var import_utils46 = require("@modern-js/utils");
68860
68806
  var import_lodash6 = require("@modern-js/utils/lodash");
68861
68807
  var import_comment_json = __toESM(require_src2());
68862
68808
 
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
68809
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.4/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
68864
68810
  var import_utils = require("@modern-js/utils");
68865
68811
  async function canUseNvm() {
68866
68812
  try {
@@ -68910,7 +68856,7 @@ async function canUsePnpm() {
68910
68856
  }
68911
68857
  }
68912
68858
 
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
68859
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.4/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
68914
68860
  var import_utils2 = require("@modern-js/utils");
68915
68861
  function execaWithStreamLog(command, args, options) {
68916
68862
  const promise = (0, import_utils2.execa)(command, args, {
@@ -69006,7 +68952,7 @@ async function pnpmInstall({ cwd, registryUrl, ignoreScripts, useNvm }) {
69006
68952
  throw new Error("please install pnpm first");
69007
68953
  }
69008
68954
 
69009
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.5/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
68955
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.4/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
69010
68956
  var NpmAPI = class {
69011
68957
  npmInstall({ cwd, registryUrl, ignoreScripts }) {
69012
68958
  return npmInstall({
@@ -69035,7 +68981,7 @@ var NpmAPI = class {
69035
68981
  }
69036
68982
  };
69037
68983
 
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
68984
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.4_@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith-api-git/dist/esm-node/utils/index.js
69039
68985
  var import_utils4 = require("@modern-js/utils");
69040
68986
  async function canUseGit() {
69041
68987
  try {
@@ -69110,7 +69056,7 @@ async function gitCommit(cwd, commitMessage) {
69110
69056
  });
69111
69057
  }
69112
69058
 
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
69059
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.4_@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith-api-git/dist/esm-node/index.js
69114
69060
  var GitAPI = class {
69115
69061
  async isInGitRepo(cwd = this.generatorCore.outputPath) {
69116
69062
  const canUse = await canUseGit();
@@ -69162,7 +69108,7 @@ var GitAPI = class {
69162
69108
  }
69163
69109
  };
69164
69110
 
69165
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/logger/constants.js
69111
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/logger/constants.js
69166
69112
  var LoggerLevel;
69167
69113
  (function(LoggerLevel2) {
69168
69114
  LoggerLevel2["Error"] = "error";
@@ -69183,7 +69129,7 @@ var LevelPriority = [
69183
69129
  LoggerLevel.Stream
69184
69130
  ];
69185
69131
 
69186
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/logger/index.js
69132
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/logger/index.js
69187
69133
  var import_utils6 = require("@modern-js/utils");
69188
69134
  var Logger = class {
69189
69135
  get currentLevelIndex() {
@@ -69244,23 +69190,23 @@ var Logger = class {
69244
69190
  }
69245
69191
  };
69246
69192
 
69247
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/codesmith/index.js
69193
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/codesmith/index.js
69248
69194
  var import_path7 = __toESM(require("path"));
69249
69195
 
69250
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/generator/index.js
69196
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/generator/index.js
69251
69197
  var import_path4 = __toESM(require("path"));
69252
69198
  var import_events = require("events");
69253
69199
  var import_utils11 = require("@modern-js/utils");
69254
69200
 
69255
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsMaterial.js
69201
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsMaterial.js
69256
69202
  var import_path2 = __toESM(require("path"));
69257
69203
  var import_utils8 = require("@modern-js/utils");
69258
69204
 
69259
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
69205
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
69260
69206
  var import_path = __toESM(require("path"));
69261
69207
  var import_utils7 = require("@modern-js/utils");
69262
69208
 
69263
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/constants.js
69209
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/materials/constants.js
69264
69210
  var IMAGE_EXT_LIST = [
69265
69211
  ".jpg",
69266
69212
  ".jpeg",
@@ -69274,7 +69220,7 @@ var IMAGE_EXT_LIST = [
69274
69220
  ".wmf"
69275
69221
  ];
69276
69222
 
69277
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
69223
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
69278
69224
  var FS_RESOURCE = "_codesmith_core_fs_resource";
69279
69225
  var FsResource = class {
69280
69226
  async value() {
@@ -69300,7 +69246,7 @@ var FsResource = class {
69300
69246
  }
69301
69247
  };
69302
69248
 
69303
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsMaterial.js
69249
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsMaterial.js
69304
69250
  var promisifyGlob = function(pattern, options) {
69305
69251
  return new Promise((resolve, reject) => {
69306
69252
  (0, import_utils8.glob)(pattern, options, (err, files) => err === null ? resolve(files) : reject(err));
@@ -69328,7 +69274,7 @@ var FsMaterial = class {
69328
69274
  }
69329
69275
  };
69330
69276
 
69331
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/nodeRequire.js
69277
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/nodeRequire.js
69332
69278
  var nodeRequire = (path18) => {
69333
69279
  try {
69334
69280
  const module2 = __non_webpack_require__(path18);
@@ -69345,11 +69291,11 @@ var nodeRequire = (path18) => {
69345
69291
  }
69346
69292
  };
69347
69293
 
69348
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getGeneratorDir.js
69294
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/getGeneratorDir.js
69349
69295
  var import_path3 = __toESM(require("path"));
69350
69296
  var import_utils10 = require("@modern-js/utils");
69351
69297
 
69352
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
69298
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
69353
69299
  var import_utils9 = require("@modern-js/utils");
69354
69300
  async function fsExists(path18) {
69355
69301
  try {
@@ -69360,7 +69306,7 @@ async function fsExists(path18) {
69360
69306
  }
69361
69307
  }
69362
69308
 
69363
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getGeneratorDir.js
69309
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/getGeneratorDir.js
69364
69310
  var MaxTimes = 5;
69365
69311
  async function getGeneratorDir(generator) {
69366
69312
  let result = generator;
@@ -69379,7 +69325,7 @@ async function getGeneratorDir(generator) {
69379
69325
  return result;
69380
69326
  }
69381
69327
 
69382
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/generator/index.js
69328
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/generator/index.js
69383
69329
  var GeneratorCore = class {
69384
69330
  get lifeCycleMethod() {
69385
69331
  return {
@@ -69584,10 +69530,10 @@ check path: ${import_utils11.chalk.blue.underline(generator)} exist a package.js
69584
69530
  }
69585
69531
  };
69586
69532
 
69587
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/index.js
69533
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/materials/index.js
69588
69534
  var import_path6 = __toESM(require("path"));
69589
69535
 
69590
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/packageManager.js
69536
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/packageManager.js
69591
69537
  var import_path5 = __toESM(require("path"));
69592
69538
  var import_utils12 = require("@modern-js/utils");
69593
69539
  async function canUseYarn2() {
@@ -69635,6 +69581,7 @@ async function runInstall(targetDir, registryUrl) {
69635
69581
  "install",
69636
69582
  "--prod",
69637
69583
  "--reporter=silent",
69584
+ "--prefer-offline",
69638
69585
  "--ignore-scripts"
69639
69586
  ];
69640
69587
  if (registryUrl) {
@@ -69657,6 +69604,7 @@ async function runInstall(targetDir, registryUrl) {
69657
69604
  "install",
69658
69605
  "--production",
69659
69606
  "--loglevel=error",
69607
+ "--prefer-offline",
69660
69608
  "--ignore-scripts"
69661
69609
  ];
69662
69610
  if (registryUrl) {
@@ -69666,7 +69614,7 @@ async function runInstall(targetDir, registryUrl) {
69666
69614
  }
69667
69615
  }
69668
69616
 
69669
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/timeoutPromise.js
69617
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/timeoutPromise.js
69670
69618
  async function timeoutPromise(promise, ms, reason = "Operation") {
69671
69619
  let timeoutId = null;
69672
69620
  const delayPromise = (ms2) => new Promise((resolve) => {
@@ -69688,18 +69636,18 @@ async function timeoutPromise(promise, ms, reason = "Operation") {
69688
69636
  }
69689
69637
  }
69690
69638
 
69691
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
69639
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
69692
69640
  var import_os = __toESM(require("os"));
69693
69641
  var import_utils38 = require("@modern-js/utils");
69694
69642
 
69695
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/bind.js
69643
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/bind.js
69696
69644
  function bind(fn, thisArg) {
69697
69645
  return function wrap() {
69698
69646
  return fn.apply(thisArg, arguments);
69699
69647
  };
69700
69648
  }
69701
69649
 
69702
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/utils.js
69650
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/utils.js
69703
69651
  var { toString } = Object.prototype;
69704
69652
  var { getPrototypeOf } = Object;
69705
69653
  var kindOf = ((cache) => (thing) => {
@@ -70058,7 +70006,7 @@ var utils_default = {
70058
70006
  isThenable
70059
70007
  };
70060
70008
 
70061
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/AxiosError.js
70009
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/core/AxiosError.js
70062
70010
  function AxiosError(message, code, config, request, response) {
70063
70011
  Error.call(this);
70064
70012
  if (Error.captureStackTrace) {
@@ -70130,11 +70078,11 @@ AxiosError.from = (error, code, config, request, response, customProps) => {
70130
70078
  };
70131
70079
  var AxiosError_default = AxiosError;
70132
70080
 
70133
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/platform/node/classes/FormData.js
70081
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/platform/node/classes/FormData.js
70134
70082
  var import_form_data = __toESM(require_form_data());
70135
70083
  var FormData_default = import_form_data.default;
70136
70084
 
70137
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/toFormData.js
70085
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/toFormData.js
70138
70086
  function isVisitable(thing) {
70139
70087
  return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
70140
70088
  }
@@ -70249,7 +70197,7 @@ function toFormData(obj, formData, options) {
70249
70197
  }
70250
70198
  var toFormData_default = toFormData;
70251
70199
 
70252
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
70200
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
70253
70201
  function encode(str) {
70254
70202
  const charMap = {
70255
70203
  "!": "%21",
@@ -70282,7 +70230,7 @@ prototype2.toString = function toString2(encoder) {
70282
70230
  };
70283
70231
  var AxiosURLSearchParams_default = AxiosURLSearchParams;
70284
70232
 
70285
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/buildURL.js
70233
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/buildURL.js
70286
70234
  function encode2(val) {
70287
70235
  return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
70288
70236
  }
@@ -70308,7 +70256,7 @@ function buildURL(url2, params, options) {
70308
70256
  return url2;
70309
70257
  }
70310
70258
 
70311
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/InterceptorManager.js
70259
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/core/InterceptorManager.js
70312
70260
  var InterceptorManager = class {
70313
70261
  constructor() {
70314
70262
  this.handlers = [];
@@ -70372,18 +70320,18 @@ var InterceptorManager = class {
70372
70320
  };
70373
70321
  var InterceptorManager_default = InterceptorManager;
70374
70322
 
70375
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/defaults/transitional.js
70323
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/defaults/transitional.js
70376
70324
  var transitional_default = {
70377
70325
  silentJSONParsing: true,
70378
70326
  forcedJSONParsing: true,
70379
70327
  clarifyTimeoutError: false
70380
70328
  };
70381
70329
 
70382
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
70330
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
70383
70331
  var import_url = __toESM(require("url"));
70384
70332
  var URLSearchParams_default = import_url.default.URLSearchParams;
70385
70333
 
70386
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/platform/node/index.js
70334
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/platform/node/index.js
70387
70335
  var node_default = {
70388
70336
  isNode: true,
70389
70337
  classes: {
@@ -70394,33 +70342,11 @@ var node_default = {
70394
70342
  protocols: ["http", "https", "file", "data"]
70395
70343
  };
70396
70344
 
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
70345
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/toURLEncodedForm.js
70420
70346
  function toURLEncodedForm(data, options) {
70421
- return toFormData_default(data, new platform_default.classes.URLSearchParams(), Object.assign({
70347
+ return toFormData_default(data, new node_default.classes.URLSearchParams(), Object.assign({
70422
70348
  visitor: function(value, key, path18, helpers) {
70423
- if (platform_default.isNode && utils_default.isBuffer(value)) {
70349
+ if (node_default.isNode && utils_default.isBuffer(value)) {
70424
70350
  this.append(key, value.toString("base64"));
70425
70351
  return false;
70426
70352
  }
@@ -70429,7 +70355,7 @@ function toURLEncodedForm(data, options) {
70429
70355
  }, options));
70430
70356
  }
70431
70357
 
70432
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/formDataToJSON.js
70358
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/formDataToJSON.js
70433
70359
  function parsePropPath(name) {
70434
70360
  return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
70435
70361
  return match[0] === "[]" ? "" : match[1] || match[0];
@@ -70450,8 +70376,6 @@ function arrayToObject(arr) {
70450
70376
  function formDataToJSON(formData) {
70451
70377
  function buildPath(path18, value, target, index) {
70452
70378
  let name = path18[index++];
70453
- if (name === "__proto__")
70454
- return true;
70455
70379
  const isNumericKey = Number.isFinite(+name);
70456
70380
  const isLast = index >= path18.length;
70457
70381
  name = !name && utils_default.isArray(target) ? target.length : name;
@@ -70483,7 +70407,7 @@ function formDataToJSON(formData) {
70483
70407
  }
70484
70408
  var formDataToJSON_default = formDataToJSON;
70485
70409
 
70486
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/defaults/index.js
70410
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/defaults/index.js
70487
70411
  function stringifySafely(rawValue, parser, encoder) {
70488
70412
  if (utils_default.isString(rawValue)) {
70489
70413
  try {
@@ -70509,6 +70433,9 @@ var defaults = {
70509
70433
  }
70510
70434
  const isFormData2 = utils_default.isFormData(data);
70511
70435
  if (isFormData2) {
70436
+ if (!hasJSONContentType) {
70437
+ return data;
70438
+ }
70512
70439
  return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
70513
70440
  }
70514
70441
  if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)) {
@@ -70571,8 +70498,8 @@ var defaults = {
70571
70498
  maxContentLength: -1,
70572
70499
  maxBodyLength: -1,
70573
70500
  env: {
70574
- FormData: platform_default.classes.FormData,
70575
- Blob: platform_default.classes.Blob
70501
+ FormData: node_default.classes.FormData,
70502
+ Blob: node_default.classes.Blob
70576
70503
  },
70577
70504
  validateStatus: function validateStatus(status) {
70578
70505
  return status >= 200 && status < 300;
@@ -70589,7 +70516,7 @@ utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method
70589
70516
  });
70590
70517
  var defaults_default = defaults;
70591
70518
 
70592
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/parseHeaders.js
70519
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/parseHeaders.js
70593
70520
  var ignoreDuplicateOf = utils_default.toObjectSet([
70594
70521
  "age",
70595
70522
  "authorization",
@@ -70634,7 +70561,7 @@ var parseHeaders_default = (rawHeaders) => {
70634
70561
  return parsed;
70635
70562
  };
70636
70563
 
70637
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/AxiosHeaders.js
70564
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/core/AxiosHeaders.js
70638
70565
  var $internals = Symbol("internals");
70639
70566
  function normalizeHeader(header) {
70640
70567
  return header && String(header).trim().toLowerCase();
@@ -70852,7 +70779,7 @@ utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
70852
70779
  utils_default.freezeMethods(AxiosHeaders);
70853
70780
  var AxiosHeaders_default = AxiosHeaders;
70854
70781
 
70855
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/transformData.js
70782
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/core/transformData.js
70856
70783
  function transformData(fns, response) {
70857
70784
  const config = this || defaults_default;
70858
70785
  const context = response || config;
@@ -70865,12 +70792,12 @@ function transformData(fns, response) {
70865
70792
  return data;
70866
70793
  }
70867
70794
 
70868
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/cancel/isCancel.js
70795
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/cancel/isCancel.js
70869
70796
  function isCancel(value) {
70870
70797
  return !!(value && value.__CANCEL__);
70871
70798
  }
70872
70799
 
70873
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/cancel/CanceledError.js
70800
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/cancel/CanceledError.js
70874
70801
  function CanceledError(message, config, request) {
70875
70802
  AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
70876
70803
  this.name = "CanceledError";
@@ -70880,7 +70807,7 @@ utils_default.inherits(CanceledError, AxiosError_default, {
70880
70807
  });
70881
70808
  var CanceledError_default = CanceledError;
70882
70809
 
70883
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/settle.js
70810
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/core/settle.js
70884
70811
  function settle(resolve, reject, response) {
70885
70812
  const validateStatus2 = response.config.validateStatus;
70886
70813
  if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
@@ -70896,17 +70823,17 @@ function settle(resolve, reject, response) {
70896
70823
  }
70897
70824
  }
70898
70825
 
70899
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/isAbsoluteURL.js
70826
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/isAbsoluteURL.js
70900
70827
  function isAbsoluteURL(url2) {
70901
70828
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
70902
70829
  }
70903
70830
 
70904
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/combineURLs.js
70831
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/combineURLs.js
70905
70832
  function combineURLs(baseURL, relativeURL) {
70906
- return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
70833
+ return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
70907
70834
  }
70908
70835
 
70909
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/buildFullPath.js
70836
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/core/buildFullPath.js
70910
70837
  function buildFullPath(baseURL, requestedURL) {
70911
70838
  if (baseURL && !isAbsoluteURL(requestedURL)) {
70912
70839
  return combineURLs(baseURL, requestedURL);
@@ -70914,7 +70841,7 @@ function buildFullPath(baseURL, requestedURL) {
70914
70841
  return requestedURL;
70915
70842
  }
70916
70843
 
70917
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/http.js
70844
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/adapters/http.js
70918
70845
  var import_proxy_from_env = __toESM(require_proxy_from_env());
70919
70846
  var import_http = __toESM(require("http"));
70920
70847
  var import_https = __toESM(require("https"));
@@ -70922,19 +70849,19 @@ var import_util2 = __toESM(require("util"));
70922
70849
  var import_follow_redirects = __toESM(require_follow_redirects());
70923
70850
  var import_zlib = __toESM(require("zlib"));
70924
70851
 
70925
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/env/data.js
70926
- var VERSION = "1.6.7";
70852
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/env/data.js
70853
+ var VERSION = "1.6.0";
70927
70854
 
70928
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/parseProtocol.js
70855
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/parseProtocol.js
70929
70856
  function parseProtocol(url2) {
70930
70857
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
70931
70858
  return match && match[1] || "";
70932
70859
  }
70933
70860
 
70934
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/fromDataURI.js
70861
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/fromDataURI.js
70935
70862
  var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
70936
70863
  function fromDataURI(uri, asBlob, options) {
70937
- const _Blob = options && options.Blob || platform_default.classes.Blob;
70864
+ const _Blob = options && options.Blob || node_default.classes.Blob;
70938
70865
  const protocol = parseProtocol(uri);
70939
70866
  if (asBlob === void 0 && _Blob) {
70940
70867
  asBlob = true;
@@ -70960,13 +70887,13 @@ function fromDataURI(uri, asBlob, options) {
70960
70887
  throw new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_NOT_SUPPORT);
70961
70888
  }
70962
70889
 
70963
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/http.js
70890
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/adapters/http.js
70964
70891
  var import_stream4 = __toESM(require("stream"));
70965
70892
 
70966
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/AxiosTransformStream.js
70893
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/AxiosTransformStream.js
70967
70894
  var import_stream = __toESM(require("stream"));
70968
70895
 
70969
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/throttle.js
70896
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/throttle.js
70970
70897
  function throttle(fn, freq) {
70971
70898
  let timestamp = 0;
70972
70899
  const threshold = 1e3 / freq;
@@ -70992,7 +70919,7 @@ function throttle(fn, freq) {
70992
70919
  }
70993
70920
  var throttle_default = throttle;
70994
70921
 
70995
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/speedometer.js
70922
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/speedometer.js
70996
70923
  function speedometer(samplesCount, min) {
70997
70924
  samplesCount = samplesCount || 10;
70998
70925
  const bytes = new Array(samplesCount);
@@ -71028,7 +70955,7 @@ function speedometer(samplesCount, min) {
71028
70955
  }
71029
70956
  var speedometer_default = speedometer;
71030
70957
 
71031
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/AxiosTransformStream.js
70958
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/AxiosTransformStream.js
71032
70959
  var kInternals = Symbol("internals");
71033
70960
  var AxiosTransformStream = class extends import_stream.default.Transform {
71034
70961
  constructor(options) {
@@ -71178,14 +71105,14 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
71178
71105
  };
71179
71106
  var AxiosTransformStream_default = AxiosTransformStream;
71180
71107
 
71181
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/http.js
71108
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/adapters/http.js
71182
71109
  var import_events2 = __toESM(require("events"));
71183
71110
 
71184
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/formDataToStream.js
71111
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/formDataToStream.js
71185
71112
  var import_util = require("util");
71186
71113
  var import_stream2 = require("stream");
71187
71114
 
71188
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/readBlob.js
71115
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/readBlob.js
71189
71116
  var { asyncIterator } = Symbol;
71190
71117
  var readBlob = async function* (blob) {
71191
71118
  if (blob.stream) {
@@ -71200,7 +71127,7 @@ var readBlob = async function* (blob) {
71200
71127
  };
71201
71128
  var readBlob_default = readBlob;
71202
71129
 
71203
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/formDataToStream.js
71130
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/formDataToStream.js
71204
71131
  var BOUNDARY_ALPHABET = utils_default.ALPHABET.ALPHA_DIGIT + "-_";
71205
71132
  var textEncoder = new import_util.TextEncoder();
71206
71133
  var CRLF = "\r\n";
@@ -71279,7 +71206,7 @@ var formDataToStream = (form, headersHandler, options) => {
71279
71206
  };
71280
71207
  var formDataToStream_default = formDataToStream;
71281
71208
 
71282
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
71209
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
71283
71210
  var import_stream3 = __toESM(require("stream"));
71284
71211
  var ZlibHeaderTransformStream = class extends import_stream3.default.Transform {
71285
71212
  __transform(chunk, encoding, callback) {
@@ -71301,7 +71228,7 @@ var ZlibHeaderTransformStream = class extends import_stream3.default.Transform {
71301
71228
  };
71302
71229
  var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream;
71303
71230
 
71304
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/callbackify.js
71231
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/callbackify.js
71305
71232
  var callbackify = (fn, reducer) => {
71306
71233
  return utils_default.isAsyncFn(fn) ? function(...args) {
71307
71234
  const cb = args.pop();
@@ -71316,7 +71243,7 @@ var callbackify = (fn, reducer) => {
71316
71243
  };
71317
71244
  var callbackify_default = callbackify;
71318
71245
 
71319
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/http.js
71246
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/adapters/http.js
71320
71247
  var zlibOptions = {
71321
71248
  flush: import_zlib.default.constants.Z_SYNC_FLUSH,
71322
71249
  finishFlush: import_zlib.default.constants.Z_SYNC_FLUSH
@@ -71328,15 +71255,15 @@ var brotliOptions = {
71328
71255
  var isBrotliSupported = utils_default.isFunction(import_zlib.default.createBrotliDecompress);
71329
71256
  var { http: httpFollow, https: httpsFollow } = import_follow_redirects.default;
71330
71257
  var isHttps = /https:?/;
71331
- var supportedProtocols = platform_default.protocols.map((protocol) => {
71258
+ var supportedProtocols = node_default.protocols.map((protocol) => {
71332
71259
  return protocol + ":";
71333
71260
  });
71334
- function dispatchBeforeRedirect(options, responseDetails) {
71261
+ function dispatchBeforeRedirect(options) {
71335
71262
  if (options.beforeRedirects.proxy) {
71336
71263
  options.beforeRedirects.proxy(options);
71337
71264
  }
71338
71265
  if (options.beforeRedirects.config) {
71339
- options.beforeRedirects.config(options, responseDetails);
71266
+ options.beforeRedirects.config(options);
71340
71267
  }
71341
71268
  }
71342
71269
  function setProxy(options, configProxy, location) {
@@ -71416,9 +71343,6 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
71416
71343
  const _lookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]);
71417
71344
  lookup = (hostname, opt, cb) => {
71418
71345
  _lookup(hostname, opt, (err, arg0, arg1) => {
71419
- if (err) {
71420
- return cb(err);
71421
- }
71422
71346
  const addresses = utils_default.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
71423
71347
  opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
71424
71348
  });
@@ -71815,44 +71739,57 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
71815
71739
  });
71816
71740
  };
71817
71741
 
71818
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/cookies.js
71819
- var cookies_default = platform_default.hasStandardBrowserEnv ? (
71742
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/cookies.js
71743
+ var cookies_default = node_default.isStandardBrowserEnv ? (
71820
71744
  // Standard browser envs support document.cookie
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
- }
71745
+ function standardBrowserEnv() {
71746
+ return {
71747
+ write: function write(name, value, expires, path18, domain, secure) {
71748
+ const cookie = [];
71749
+ cookie.push(name + "=" + encodeURIComponent(value));
71750
+ if (utils_default.isNumber(expires)) {
71751
+ cookie.push("expires=" + new Date(expires).toGMTString());
71752
+ }
71753
+ if (utils_default.isString(path18)) {
71754
+ cookie.push("path=" + path18);
71755
+ }
71756
+ if (utils_default.isString(domain)) {
71757
+ cookie.push("domain=" + domain);
71758
+ }
71759
+ if (secure === true) {
71760
+ cookie.push("secure");
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
+ }()
71838
71773
  ) : (
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
- }
71774
+ // Non standard browser env (web workers, react-native) lack needed support.
71775
+ function nonStandardBrowserEnv() {
71776
+ return {
71777
+ write: function write() {
71778
+ },
71779
+ read: function read() {
71780
+ return null;
71781
+ },
71782
+ remove: function remove() {
71783
+ }
71784
+ };
71785
+ }()
71849
71786
  );
71850
71787
 
71851
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/isURLSameOrigin.js
71852
- var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? (
71788
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/isURLSameOrigin.js
71789
+ var isURLSameOrigin_default = node_default.isStandardBrowserEnv ? (
71853
71790
  // Standard browser envs have full support of the APIs needed to test
71854
71791
  // whether the request URL is of the same origin as current location.
71855
- function standardBrowserEnv() {
71792
+ function standardBrowserEnv2() {
71856
71793
  const msie = /(msie|trident)/i.test(navigator.userAgent);
71857
71794
  const urlParsingNode = document.createElement("a");
71858
71795
  let originURL;
@@ -71882,14 +71819,14 @@ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? (
71882
71819
  }()
71883
71820
  ) : (
71884
71821
  // Non standard browser envs (web workers, react-native) lack needed support.
71885
- function nonStandardBrowserEnv() {
71822
+ function nonStandardBrowserEnv2() {
71886
71823
  return function isURLSameOrigin() {
71887
71824
  return true;
71888
71825
  };
71889
71826
  }()
71890
71827
  );
71891
71828
 
71892
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/xhr.js
71829
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/adapters/xhr.js
71893
71830
  function progressEventReducer(listener, isDownloadStream) {
71894
71831
  let bytesNotified = 0;
71895
71832
  const _speedometer = speedometer_default(50, 250);
@@ -71918,7 +71855,7 @@ var xhr_default = isXHRAdapterSupported && function(config) {
71918
71855
  return new Promise(function dispatchXhrRequest(resolve, reject) {
71919
71856
  let requestData = config.data;
71920
71857
  const requestHeaders = AxiosHeaders_default.from(config.headers).normalize();
71921
- let { responseType, withXSRFToken } = config;
71858
+ const responseType = config.responseType;
71922
71859
  let onCanceled;
71923
71860
  function done() {
71924
71861
  if (config.cancelToken) {
@@ -71930,11 +71867,12 @@ var xhr_default = isXHRAdapterSupported && function(config) {
71930
71867
  }
71931
71868
  let contentType;
71932
71869
  if (utils_default.isFormData(requestData)) {
71933
- if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
71870
+ if (node_default.isStandardBrowserEnv || node_default.isStandardBrowserWebWorkerEnv) {
71934
71871
  requestHeaders.setContentType(false);
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("; "));
71872
+ } else if (!requestHeaders.getContentType(/^\s*multipart\/form-data/)) {
71873
+ requestHeaders.setContentType("multipart/form-data");
71874
+ } else if (utils_default.isString(contentType = requestHeaders.getContentType())) {
71875
+ requestHeaders.setContentType(contentType.replace(/^\s*(multipart\/form-data);+/, "$1"));
71938
71876
  }
71939
71877
  }
71940
71878
  let request = new XMLHttpRequest();
@@ -72009,13 +71947,10 @@ var xhr_default = isXHRAdapterSupported && function(config) {
72009
71947
  ));
72010
71948
  request = null;
72011
71949
  };
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
- }
71950
+ if (node_default.isStandardBrowserEnv) {
71951
+ const xsrfValue = isURLSameOrigin_default(fullPath) && config.xsrfCookieName && cookies_default.read(config.xsrfCookieName);
71952
+ if (xsrfValue) {
71953
+ requestHeaders.set(config.xsrfHeaderName, xsrfValue);
72019
71954
  }
72020
71955
  }
72021
71956
  requestData === void 0 && requestHeaders.setContentType(null);
@@ -72051,7 +71986,7 @@ var xhr_default = isXHRAdapterSupported && function(config) {
72051
71986
  }
72052
71987
  }
72053
71988
  const protocol = parseProtocol(fullPath);
72054
- if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
71989
+ if (protocol && node_default.protocols.indexOf(protocol) === -1) {
72055
71990
  reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
72056
71991
  return;
72057
71992
  }
@@ -72059,7 +71994,7 @@ var xhr_default = isXHRAdapterSupported && function(config) {
72059
71994
  });
72060
71995
  };
72061
71996
 
72062
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/adapters.js
71997
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/adapters/adapters.js
72063
71998
  var knownAdapters = {
72064
71999
  http: http_default,
72065
72000
  xhr: xhr_default
@@ -72112,7 +72047,7 @@ var adapters_default = {
72112
72047
  adapters: knownAdapters
72113
72048
  };
72114
72049
 
72115
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/dispatchRequest.js
72050
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/core/dispatchRequest.js
72116
72051
  function throwIfCancellationRequested(config) {
72117
72052
  if (config.cancelToken) {
72118
72053
  config.cancelToken.throwIfRequested();
@@ -72157,7 +72092,7 @@ function dispatchRequest(config) {
72157
72092
  });
72158
72093
  }
72159
72094
 
72160
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/mergeConfig.js
72095
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/core/mergeConfig.js
72161
72096
  var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? thing.toJSON() : thing;
72162
72097
  function mergeConfig(config1, config2) {
72163
72098
  config2 = config2 || {};
@@ -72209,7 +72144,6 @@ function mergeConfig(config1, config2) {
72209
72144
  timeout: defaultToConfig2,
72210
72145
  timeoutMessage: defaultToConfig2,
72211
72146
  withCredentials: defaultToConfig2,
72212
- withXSRFToken: defaultToConfig2,
72213
72147
  adapter: defaultToConfig2,
72214
72148
  responseType: defaultToConfig2,
72215
72149
  xsrfCookieName: defaultToConfig2,
@@ -72237,7 +72171,7 @@ function mergeConfig(config1, config2) {
72237
72171
  return config;
72238
72172
  }
72239
72173
 
72240
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/validator.js
72174
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/validator.js
72241
72175
  var validators = {};
72242
72176
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
72243
72177
  validators[type] = function validator(thing) {
@@ -72295,7 +72229,7 @@ var validator_default = {
72295
72229
  validators
72296
72230
  };
72297
72231
 
72298
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/Axios.js
72232
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/core/Axios.js
72299
72233
  var validators2 = validator_default.validators;
72300
72234
  var Axios = class {
72301
72235
  constructor(instanceConfig) {
@@ -72313,24 +72247,7 @@ var Axios = class {
72313
72247
  *
72314
72248
  * @returns {Promise} The Promise to be fulfilled
72315
72249
  */
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) {
72250
+ request(configOrUrl, config) {
72334
72251
  if (typeof configOrUrl === "string") {
72335
72252
  config = config || {};
72336
72253
  config.url = configOrUrl;
@@ -72455,7 +72372,7 @@ utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(m
72455
72372
  });
72456
72373
  var Axios_default = Axios;
72457
72374
 
72458
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/cancel/CancelToken.js
72375
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/cancel/CancelToken.js
72459
72376
  var CancelToken = class _CancelToken {
72460
72377
  constructor(executor) {
72461
72378
  if (typeof executor !== "function") {
@@ -72545,19 +72462,19 @@ var CancelToken = class _CancelToken {
72545
72462
  };
72546
72463
  var CancelToken_default = CancelToken;
72547
72464
 
72548
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/spread.js
72465
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/spread.js
72549
72466
  function spread(callback) {
72550
72467
  return function wrap(arr) {
72551
72468
  return callback.apply(null, arr);
72552
72469
  };
72553
72470
  }
72554
72471
 
72555
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/isAxiosError.js
72472
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/isAxiosError.js
72556
72473
  function isAxiosError(payload) {
72557
72474
  return utils_default.isObject(payload) && payload.isAxiosError === true;
72558
72475
  }
72559
72476
 
72560
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/HttpStatusCode.js
72477
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/helpers/HttpStatusCode.js
72561
72478
  var HttpStatusCode = {
72562
72479
  Continue: 100,
72563
72480
  SwitchingProtocols: 101,
@@ -72628,7 +72545,7 @@ Object.entries(HttpStatusCode).forEach(([key, value]) => {
72628
72545
  });
72629
72546
  var HttpStatusCode_default = HttpStatusCode;
72630
72547
 
72631
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/axios.js
72548
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/lib/axios.js
72632
72549
  function createInstance(defaultConfig) {
72633
72550
  const context = new Axios_default(defaultConfig);
72634
72551
  const instance = bind(Axios_default.prototype.request, context);
@@ -72661,7 +72578,7 @@ axios.HttpStatusCode = HttpStatusCode_default;
72661
72578
  axios.default = axios;
72662
72579
  var axios_default = axios;
72663
72580
 
72664
- // ../../../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/index.js
72581
+ // ../../../../node_modules/.pnpm/axios@1.6.0/node_modules/axios/index.js
72665
72582
  var {
72666
72583
  Axios: Axios2,
72667
72584
  AxiosError: AxiosError2,
@@ -72681,17 +72598,17 @@ var {
72681
72598
  mergeConfig: mergeConfig2
72682
72599
  } = axios_default;
72683
72600
 
72684
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
72601
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
72685
72602
  var import_tar = __toESM(require_tar());
72686
72603
 
72687
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmTarballUrl.js
72604
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmTarballUrl.js
72688
72605
  var import_utils36 = require("@modern-js/utils");
72689
72606
 
72690
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/constants.js
72607
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/constants.js
72691
72608
  var NPM_API_TIMEOUT = 3e4;
72692
72609
  var CATCHE_VALIDITY_PREIOD = 12 * 3600 * 1e3;
72693
72610
 
72694
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmTarballUrl.js
72611
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmTarballUrl.js
72695
72612
  async function getNpmTarballUrl(pkgName, pkgVersion, options) {
72696
72613
  const { registryUrl } = options || {};
72697
72614
  const params = [
@@ -72714,7 +72631,7 @@ async function getNpmTarballUrl(pkgName, pkgVersion, options) {
72714
72631
  }
72715
72632
  }
72716
72633
 
72717
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmVersion.js
72634
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmVersion.js
72718
72635
  var import_utils37 = require("@modern-js/utils");
72719
72636
  async function getNpmVersion(packageName, options) {
72720
72637
  const { version, registryUrl } = options || {};
@@ -72736,7 +72653,7 @@ async function getNpmVersion(packageName, options) {
72736
72653
  return stdout;
72737
72654
  }
72738
72655
 
72739
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
72656
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
72740
72657
  async function isValidCache(cacheDir) {
72741
72658
  if (await fsExists(`${cacheDir}/.codesmith.completed`)) {
72742
72659
  const preCacheTimeStr = await import_utils38.fs.readFile(`${cacheDir}/.codesmith.completed`, {
@@ -72816,7 +72733,7 @@ async function downloadPackage(pkgName, pkgVersion = "latest", options = {}) {
72816
72733
  return targetDir;
72817
72734
  }
72818
72735
 
72819
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getPackageInfo.js
72736
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/getPackageInfo.js
72820
72737
  var import_utils39 = require("@modern-js/utils");
72821
72738
  function getPackageInfo(packageName) {
72822
72739
  if (!packageName) {
@@ -72841,7 +72758,7 @@ function getPackageInfo(packageName) {
72841
72758
  };
72842
72759
  }
72843
72760
 
72844
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/index.js
72761
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/materials/index.js
72845
72762
  var MaterialsManager = class {
72846
72763
  loadLocalGenerator(generator) {
72847
72764
  if (!import_path6.default.isAbsolute(generator)) {
@@ -72872,7 +72789,7 @@ var MaterialsManager = class {
72872
72789
  }
72873
72790
  };
72874
72791
 
72875
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/codesmith/index.js
72792
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/codesmith/index.js
72876
72793
  var CodeSmith = class {
72877
72794
  async forge({ tasks, pwd }) {
72878
72795
  var _this_logger_timing, _this_logger;
@@ -72916,7 +72833,7 @@ var CodeSmith = class {
72916
72833
  }
72917
72834
  };
72918
72835
 
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
72836
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.4_@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/utils/renderString.js
72920
72837
  var import_handlebars = __toESM(require_lib());
72921
72838
  function renderString(template, fullData, registers) {
72922
72839
  const helpers = {
@@ -72930,7 +72847,7 @@ function renderString(template, fullData, registers) {
72930
72847
  return import_handlebars.default.compile(template)(fullData) || "";
72931
72848
  }
72932
72849
 
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
72850
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.4_@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/index.js
72934
72851
  var HandlebarsAPI = class {
72935
72852
  async registerHelp(helpers) {
72936
72853
  this.registers.helpers = {
@@ -72980,13 +72897,13 @@ var HandlebarsAPI = class {
72980
72897
  }
72981
72898
  };
72982
72899
 
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
72900
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.4_@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/utils/renderString.js
72984
72901
  var import_ejs = __toESM(require_ejs());
72985
72902
  function renderString2(template, fullData) {
72986
72903
  return import_ejs.default.render(template, fullData) || "";
72987
72904
  }
72988
72905
 
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
72906
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.4_@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/index.js
72990
72907
  var EjsAPI = class {
72991
72908
  async renderTemplate(templateResource, target, parameters = {}) {
72992
72909
  if (templateResource._type !== FS_RESOURCE) {
@@ -73019,7 +72936,7 @@ var EjsAPI = class {
73019
72936
  }
73020
72937
  };
73021
72938
 
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
72939
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.3.4_@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith-api-fs/dist/esm-node/index.js
73023
72940
  var import_path8 = __toESM(require("path"));
73024
72941
  var import_utils43 = require("@modern-js/utils");
73025
72942
  var FsAPI = class {
@@ -73047,7 +72964,7 @@ var FsAPI = class {
73047
72964
  }
73048
72965
  };
73049
72966
 
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
72967
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/index.js
73051
72968
  var import_lodash2 = require("@modern-js/utils/lodash");
73052
72969
 
73053
72970
  // ../../../../node_modules/.pnpm/@formily+shared@2.2.24/node_modules/@formily/shared/esm/checkers.js
@@ -82682,10 +82599,10 @@ var Schema = (
82682
82599
  }()
82683
82600
  );
82684
82601
 
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
82602
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
82686
82603
  var import_inquirer = __toESM(require_inquirer());
82687
82604
 
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
82605
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/transform.js
82689
82606
  var import_lodash = require("@modern-js/utils/lodash");
82690
82607
  function validateSchema(schema) {
82691
82608
  const { type, properties } = schema;
@@ -82777,7 +82694,7 @@ function transformForm(schema, configValue = {}, validateMap, initValue) {
82777
82694
  return getQuestionFromSchema(schema, configValue, validateMap, initValue);
82778
82695
  }
82779
82696
 
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
82697
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
82781
82698
  var compileRule = (rule, scope) => {
82782
82699
  const state = Schema.compile(rule, {
82783
82700
  $self: {},
@@ -82881,7 +82798,7 @@ async function prompt(schema, configValue = {}, validateMap, initValue) {
82881
82798
  return answers;
82882
82799
  }
82883
82800
 
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
82801
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/inquirer.js
82885
82802
  var CLIReader = class {
82886
82803
  getAnswers() {
82887
82804
  return this.answers;
@@ -82912,7 +82829,7 @@ var CLIReader = class {
82912
82829
  }
82913
82830
  };
82914
82831
 
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
82832
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/index.js
82916
82833
  var FormilyAPI = class {
82917
82834
  mergeAnswers(answers, configValue) {
82918
82835
  const inputData = (0, import_lodash2.merge)(answers, configValue);
@@ -82935,7 +82852,7 @@ var FormilyAPI = class {
82935
82852
  }
82936
82853
  };
82937
82854
 
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
82855
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
82939
82856
  var import_inquirer3 = __toESM(require_inquirer2());
82940
82857
 
82941
82858
  // ../../../../node_modules/.pnpm/@modern-js+plugin-i18n@2.37.2/node_modules/@modern-js/plugin-i18n/dist/esm-node/index.js
@@ -83001,7 +82918,7 @@ var I18n = class {
83001
82918
  }
83002
82919
  };
83003
82920
 
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
82921
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/zh.js
83005
82922
  var ZH_LOCALE = {
83006
82923
  environment: {
83007
82924
  node_version: "请升级 Node 版本至 LIS",
@@ -83028,7 +82945,7 @@ var ZH_LOCALE = {
83028
82945
  }
83029
82946
  };
83030
82947
 
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
82948
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/en.js
83032
82949
  var EN_LOCALE = {
83033
82950
  environment: {
83034
82951
  node_version: "please upgrade node to lts version",
@@ -83055,14 +82972,14 @@ var EN_LOCALE = {
83055
82972
  }
83056
82973
  };
83057
82974
 
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
82975
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/index.js
83059
82976
  var i18n = new I18n();
83060
82977
  var localeKeys = i18n.init("zh", {
83061
82978
  zh: ZH_LOCALE,
83062
82979
  en: EN_LOCALE
83063
82980
  });
83064
82981
 
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
82982
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/transform.js
83066
82983
  var import_lodash5 = require("@modern-js/utils/lodash");
83067
82984
  function transformInquirerSchema(questions, configValue = {}, validateMap = {}, initValue = {}) {
83068
82985
  for (const question of questions) {
@@ -83090,7 +83007,7 @@ function transformInquirerSchema(questions, configValue = {}, validateMap = {},
83090
83007
  return questions;
83091
83008
  }
83092
83009
 
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
83010
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/checkUseNvm.js
83094
83011
  var import_path10 = __toESM(require("path"));
83095
83012
  var import_utils45 = require("@modern-js/utils");
83096
83013
  var NODE_MAJOR_VERSION_MAP = {
@@ -83138,7 +83055,7 @@ async function checkUseNvm(cwd, logger2) {
83138
83055
  }
83139
83056
  }
83140
83057
 
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
83058
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
83142
83059
  var AppAPI = class {
83143
83060
  async checkEnvironment(nodeVersion) {
83144
83061
  if (import_utils46.semver.lt(process.versions.node, nodeVersion || "12.22.12")) {
@@ -83378,6 +83295,15 @@ var AppAPI = class {
83378
83295
  }
83379
83296
  };
83380
83297
 
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
+
83381
83307
  // ../../../cli/plugin-i18n/dist/esm-node/index.js
83382
83308
  var import_lodash8 = require("@modern-js/utils/lodash");
83383
83309
 
@@ -83436,8 +83362,8 @@ var I18n2 = class {
83436
83362
  };
83437
83363
  }
83438
83364
  constructor() {
83439
- this.language = "en";
83440
- this.languageMap = {};
83365
+ _define_property2(this, "language", "en");
83366
+ _define_property2(this, "languageMap", {});
83441
83367
  }
83442
83368
  };
83443
83369
 
@@ -83470,8 +83396,10 @@ var ZH_LOCALE2 = {
83470
83396
  i18n: "启用「国际化(i18n)」功能",
83471
83397
  test: "启用「单元测试 / 集成测试」功能",
83472
83398
  e2e_test: "启用「E2E 测试」功能",
83399
+ storybook: "启用「Storybook」",
83473
83400
  storybookV7: "启用「Storybook」V7",
83474
83401
  runtime_api: "启用「Runtime API」",
83402
+ mwa_storybook: "启用「Visual Testing (Storybook)」模式",
83475
83403
  ssg: "启用「SSG」功能",
83476
83404
  polyfill: "启用「基于 UA 的 Polyfill」功能",
83477
83405
  proxy: "启用「全局代理」",
@@ -83566,8 +83494,10 @@ var EN_LOCALE2 = {
83566
83494
  i18n: "Enable Internationalization (i18n)",
83567
83495
  test: "Enable Unit Test / Integration Test",
83568
83496
  e2e_test: "Enable E2E Test",
83497
+ storybook: "Enable Storybook",
83569
83498
  storybookV7: "Enable Storybook V7",
83570
83499
  runtime_api: "Enable Runtime API",
83500
+ mwa_storybook: "Enable Visual Testing (Storybook)",
83571
83501
  ssg: "Enable SSG",
83572
83502
  polyfill: "Enable UA-based Polyfill Feature",
83573
83503
  proxy: "Enable Global Proxy",
@@ -83957,6 +83887,7 @@ var ActionFunction;
83957
83887
  ActionFunction2["I18n"] = "i18n";
83958
83888
  ActionFunction2["Test"] = "test";
83959
83889
  ActionFunction2["E2ETest"] = "e2e_test";
83890
+ ActionFunction2["Storybook"] = "storybook";
83960
83891
  ActionFunction2["StorybookV7"] = "storybookV7";
83961
83892
  ActionFunction2["RuntimeApi"] = "runtimeApi";
83962
83893
  ActionFunction2["SSG"] = "ssg";
@@ -83990,6 +83921,7 @@ var ActionFunctionText = {
83990
83921
  ["i18n"]: () => i18n2.t(localeKeys2.action.function.i18n),
83991
83922
  ["test"]: () => i18n2.t(localeKeys2.action.function.test),
83992
83923
  ["e2e_test"]: () => i18n2.t(localeKeys2.action.function.e2e_test),
83924
+ ["storybook"]: () => i18n2.t(localeKeys2.action.function.storybook),
83993
83925
  ["storybookV7"]: () => i18n2.t(localeKeys2.action.function.storybookV7),
83994
83926
  ["runtimeApi"]: () => i18n2.t(localeKeys2.action.function.runtime_api),
83995
83927
  ["ssg"]: () => i18n2.t(localeKeys2.action.function.ssg),
@@ -84017,6 +83949,7 @@ var MWAActionFunctions = [
84017
83949
  ActionFunction.Test,
84018
83950
  ActionFunction.Polyfill,
84019
83951
  ActionFunction.Proxy,
83952
+ ActionFunction.Storybook,
84020
83953
  ActionFunction.StorybookV7
84021
83954
  ];
84022
83955
  var MWAActionElements = [
@@ -84074,7 +84007,7 @@ var getMWANewActionSchema = (extra = {}) => {
84074
84007
  title: ActionTypeQuestionText[ActionType.Function](),
84075
84008
  enum: funcs.map((func) => ({
84076
84009
  value: func,
84077
- label: ActionFunctionText[func]()
84010
+ label: func === ActionFunction.Storybook ? i18n2.t(localeKeys2.action.function.mwa_storybook) : ActionFunctionText[func]()
84078
84011
  })),
84079
84012
  "x-reactions": [
84080
84013
  {
@@ -84115,6 +84048,7 @@ var getMWANewActionSchema = (extra = {}) => {
84115
84048
  var MWAActionFunctionsDevDependencies = {
84116
84049
  [ActionFunction.SSG]: "@modern-js/plugin-ssg",
84117
84050
  [ActionFunction.Test]: "@modern-js/plugin-testing",
84051
+ [ActionFunction.Storybook]: "@modern-js/plugin-storybook",
84118
84052
  [ActionFunction.StorybookV7]: "@modern-js/storybook",
84119
84053
  [ActionFunction.Proxy]: "@modern-js/plugin-proxy",
84120
84054
  [ActionFunction.TailwindCSS]: "tailwindcss",
@@ -84146,6 +84080,7 @@ var MWANewActionGenerators = {
84146
84080
  [ActionFunction.BFF]: "@modern-js/bff-generator",
84147
84081
  [ActionFunction.MicroFrontend]: "@modern-js/dependence-generator",
84148
84082
  [ActionFunction.Test]: "@modern-js/test-generator",
84083
+ [ActionFunction.Storybook]: "@modern-js/dependence-generator",
84149
84084
  [ActionFunction.StorybookV7]: "@modern-js/storybook-next-generator",
84150
84085
  [ActionFunction.SSG]: "@modern-js/ssg-generator",
84151
84086
  [ActionFunction.Polyfill]: "@modern-js/dependence-generator",
@@ -84165,6 +84100,7 @@ var MWANewActionPluginName = {
84165
84100
  [ActionFunction.BFF]: "bffPlugin",
84166
84101
  [ActionFunction.MicroFrontend]: "garfishPlugin",
84167
84102
  [ActionFunction.Test]: "testingPlugin",
84103
+ [ActionFunction.Storybook]: "storybookPlugin",
84168
84104
  [ActionFunction.SSG]: "ssgPlugin",
84169
84105
  [ActionFunction.Polyfill]: "polyfillPlugin",
84170
84106
  [ActionFunction.Proxy]: "proxyPlugin",
@@ -84183,6 +84119,7 @@ var MWANewActionPluginDependence = {
84183
84119
  [ActionFunction.BFF]: "@modern-js/plugin-bff",
84184
84120
  [ActionFunction.MicroFrontend]: "@modern-js/plugin-garfish",
84185
84121
  [ActionFunction.Test]: "@modern-js/plugin-testing",
84122
+ [ActionFunction.Storybook]: "@modern-js/plugin-storybook",
84186
84123
  [ActionFunction.SSG]: "@modern-js/plugin-ssg",
84187
84124
  [ActionFunction.Polyfill]: "@modern-js/plugin-polyfill",
84188
84125
  [ActionFunction.Proxy]: "@modern-js/plugin-proxy",
@@ -84323,8 +84260,194 @@ var SolutionSchemas = {
84323
84260
  custom: getBaseSchema
84324
84261
  };
84325
84262
 
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
+
84326
84449
  // ../../generator-utils/dist/esm/index.js
84327
- var import_path12 = __toESM(require("path"));
84450
+ var import_path11 = __toESM(require("path"));
84328
84451
  var import_utils49 = require("@modern-js/utils");
84329
84452
 
84330
84453
  // ../../generator-utils/dist/esm/utils/stripAnsi.js
@@ -84445,21 +84568,6 @@ async function getAvailableVersion(packageName, currentVersion, registry2) {
84445
84568
  return currentVersion;
84446
84569
  }
84447
84570
 
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
-
84463
84571
  // ../../generator-utils/dist/esm/index.js
84464
84572
  var import_utils50 = require("@modern-js/utils");
84465
84573
  async function getPackageVersion(packageName, registry2) {
@@ -84507,13 +84615,13 @@ async function getModernPluginVersion(solution, packageName, options = {
84507
84615
  if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
84508
84616
  return getLatetPluginVersion("latest");
84509
84617
  }
84510
- let pkgPath = import_path12.default.join(require.resolve(SolutionToolsMap[solution], {
84618
+ let pkgPath = import_path11.default.join(require.resolve(SolutionToolsMap[solution], {
84511
84619
  paths: [
84512
84620
  cwd
84513
84621
  ]
84514
84622
  }), "../../..", "package.json");
84515
84623
  if (solution === Solution.Module) {
84516
- pkgPath = import_path12.default.join(require.resolve(SolutionToolsMap[solution], {
84624
+ pkgPath = import_path11.default.join(require.resolve(SolutionToolsMap[solution], {
84517
84625
  paths: [
84518
84626
  cwd
84519
84627
  ]
@@ -84534,210 +84642,17 @@ async function getModernPluginVersion(solution, packageName, options = {
84534
84642
  return getLatetPluginVersion();
84535
84643
  }
84536
84644
 
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
-
84710
84645
  // ../../generator-plugin/dist/esm/index.js
84711
- var import_path18 = __toESM(require("path"));
84712
84646
  var import_lodash14 = require("@modern-js/utils/lodash");
84713
84647
 
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
-
84733
84648
  // ../../generator-plugin/dist/esm/context/file.js
84734
- var import_path14 = __toESM(require("path"));
84649
+ var import_path13 = __toESM(require("path"));
84735
84650
 
84736
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.5/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
84651
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.4/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
84737
84652
  var import_comment_json2 = __toESM(require_src2());
84738
84653
  var declarationUpdate = __toESM(require_dist());
84739
84654
 
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
84655
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.4/node_modules/@modern-js/codesmith-api-json/dist/esm-node/utils/index.js
84741
84656
  async function editJson(generatorCore, resource, getNewJsonValue) {
84742
84657
  const originJsonValue = await resource.value();
84743
84658
  const newJsonString = await getNewJsonValue(originJsonValue.content);
@@ -84750,7 +84665,7 @@ async function editJson(generatorCore, resource, getNewJsonValue) {
84750
84665
  return newJsonString;
84751
84666
  }
84752
84667
 
84753
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.5/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
84668
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.4/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
84754
84669
  var JsonAPI = class {
84755
84670
  async get(resource) {
84756
84671
  const originJsonValue = await resource.value();
@@ -84796,7 +84711,7 @@ var JsonAPI = class {
84796
84711
  };
84797
84712
 
84798
84713
  // ../../generator-plugin/dist/esm/utils/file.js
84799
- var import_path13 = __toESM(require("path"));
84714
+ var import_path12 = __toESM(require("path"));
84800
84715
  var import_utils52 = require("@modern-js/utils");
84801
84716
  var FileType;
84802
84717
  (function(FileType22) {
@@ -84846,20 +84761,20 @@ function _fileExists() {
84846
84761
  return _fileExists.apply(this, arguments);
84847
84762
  }
84848
84763
  function dropFileRootFolder(file) {
84849
- var fileParts = import_path13.default.normalize(file).split(import_path13.default.sep);
84764
+ var fileParts = import_path12.default.normalize(file).split(import_path12.default.sep);
84850
84765
  fileParts.shift();
84851
- return fileParts.join(import_path13.default.sep);
84766
+ return fileParts.join(import_path12.default.sep);
84852
84767
  }
84853
84768
  function dropFileRootPath(file, rootPath) {
84854
84769
  var fileRootPath = rootPath ? file.replace(rootPath, "") : dropFileRootFolder(file);
84855
- return fileRootPath.startsWith(import_path13.default.sep) ? fileRootPath : "".concat(import_path13.default.sep).concat(fileRootPath);
84770
+ return fileRootPath.startsWith(import_path12.default.sep) ? fileRootPath : "".concat(import_path12.default.sep).concat(fileRootPath);
84856
84771
  }
84857
84772
  function isAbsoluteOrRelativeFileTo(relativePath) {
84858
84773
  var isFile2 = function(file) {
84859
84774
  return import_utils50.fs.existsSync(file) && import_utils50.fs.lstatSync(file).isFile();
84860
84775
  };
84861
84776
  return function(fileName) {
84862
- return isFile2(fileName) || isFile2(import_path13.default.join(relativePath, fileName));
84777
+ return isFile2(fileName) || isFile2(import_path12.default.join(relativePath, fileName));
84863
84778
  };
84864
84779
  }
84865
84780
  function addFile(config, projectPath, templatePath, renderString3) {
@@ -84871,7 +84786,7 @@ function _addFile() {
84871
84786
  return __generator(this, function(_state) {
84872
84787
  switch (_state.label) {
84873
84788
  case 0:
84874
- fileDestPath = import_path13.default.join(projectPath, config.file);
84789
+ fileDestPath = import_path12.default.join(projectPath, config.file);
84875
84790
  return [
84876
84791
  4,
84877
84792
  fileExists(fileDestPath)
@@ -84883,13 +84798,13 @@ function _addFile() {
84883
84798
  }
84884
84799
  return [
84885
84800
  4,
84886
- import_utils50.fs.mkdir(import_path13.default.dirname(fileDestPath), {
84801
+ import_utils50.fs.mkdir(import_path12.default.dirname(fileDestPath), {
84887
84802
  recursive: true
84888
84803
  })
84889
84804
  ];
84890
84805
  case 2:
84891
84806
  _state.sent();
84892
- absTemplatePath = config.templateFile ? import_path13.default.join(templatePath, config.templateFile) : null;
84807
+ absTemplatePath = config.templateFile ? import_path12.default.join(templatePath, config.templateFile) : null;
84893
84808
  if (!(absTemplatePath != null && (config.type === "binary" || Object.keys(config.data || {}).length === 0)))
84894
84809
  return [
84895
84810
  3,
@@ -84959,9 +84874,9 @@ function _addManyFiles() {
84959
84874
  config.templateFiles = config.templateFiles();
84960
84875
  }
84961
84876
  config.templateFiles = config.templateFiles.map(function(templateFile2) {
84962
- return import_path13.default.join(templatePath, templateFile2);
84877
+ return import_path12.default.join(templatePath, templateFile2);
84963
84878
  });
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 || "");
84879
+ config.templateBase = ((_config_templateBase = config.templateBase) === null || _config_templateBase === void 0 ? void 0 : _config_templateBase.startsWith(import_path12.default.sep)) ? config.templateBase : "".concat(import_path12.default.sep).concat(config.templateBase || "");
84965
84880
  templateFiles = import_utils52.globby.sync(config.templateFiles, {
84966
84881
  braceExpansion: false,
84967
84882
  dot: config.dot
@@ -84989,10 +84904,10 @@ function _addManyFiles() {
84989
84904
  5
84990
84905
  ];
84991
84906
  templateFile = _step.value;
84992
- absTemplatePath = import_path13.default.resolve(templatePath, templateFile);
84907
+ absTemplatePath = import_path12.default.resolve(templatePath, templateFile);
84993
84908
  targetFile = dropFileRootPath(templateFile, config.templateBase);
84994
84909
  fileCfg = _object_spread_props(_object_spread({}, config), {
84995
- file: import_path13.default.join(config.destination, config.fileNameFunc ? config.fileNameFunc(targetFile) : targetFile),
84910
+ file: import_path12.default.join(config.destination, config.fileNameFunc ? config.fileNameFunc(targetFile) : targetFile),
84996
84911
  templateFile: absTemplatePath,
84997
84912
  force: true
84998
84913
  });
@@ -85052,28 +84967,36 @@ var PluginHandlebarsAPI = /* @__PURE__ */ function() {
85052
84967
  "use strict";
85053
84968
  function PluginHandlebarsAPI2() {
85054
84969
  _class_call_check(this, PluginHandlebarsAPI2);
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
- };
84970
+ _define_property2(this, "helpers", {});
84971
+ _define_property2(this, "partials", {});
84972
+ }
85076
84973
  _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
+ },
85077
85000
  {
85078
85001
  key: "method",
85079
85002
  get: function get4() {
@@ -85094,10 +85017,14 @@ var PluginEjsAPI = /* @__PURE__ */ function() {
85094
85017
  function PluginEjsAPI2() {
85095
85018
  _class_call_check(this, PluginEjsAPI2);
85096
85019
  }
85097
- var _proto = PluginEjsAPI2.prototype;
85098
- _proto.renderString = function renderString3(template, data) {
85099
- return import_ejs2.default.render(template, data) || "";
85100
- };
85020
+ _create_class(PluginEjsAPI2, [
85021
+ {
85022
+ key: "renderString",
85023
+ value: function renderString3(template, data) {
85024
+ return import_ejs2.default.render(template, data) || "";
85025
+ }
85026
+ }
85027
+ ]);
85101
85028
  return PluginEjsAPI2;
85102
85029
  }();
85103
85030
 
@@ -85113,250 +85040,13 @@ var PluginFileAPI = /* @__PURE__ */ function() {
85113
85040
  "use strict";
85114
85041
  function PluginFileAPI2() {
85115
85042
  _class_call_check(this, PluginFileAPI2);
85116
- this.projectPath = "";
85117
- this.templatePath = "";
85118
- this.handlebarAPI = new PluginHandlebarsAPI();
85119
- this.ejsAPI = new PluginEjsAPI();
85043
+ _define_property2(this, "projectPath", "");
85044
+ _define_property2(this, "templatePath", "");
85045
+ _define_property2(this, "handlebarAPI", new PluginHandlebarsAPI());
85046
+ _define_property2(this, "ejsAPI", new PluginEjsAPI());
85047
+ _define_property2(this, "jsonAPI", void 0);
85120
85048
  this.renderString = this.renderString.bind(this);
85121
85049
  }
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
- };
85360
85050
  _create_class(PluginFileAPI2, [
85361
85051
  {
85362
85052
  key: "context",
@@ -85382,6 +85072,276 @@ var PluginFileAPI = /* @__PURE__ */ function() {
85382
85072
  addPartial: this.handlebarAPI.addPartial.bind(this.handlebarAPI)
85383
85073
  };
85384
85074
  }
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
+ }
85385
85345
  }
85386
85346
  ]);
85387
85347
  return PluginFileAPI2;
@@ -85392,66 +85352,10 @@ var PluginGitAPI = /* @__PURE__ */ function() {
85392
85352
  "use strict";
85393
85353
  function PluginGitAPI2() {
85394
85354
  _class_call_check(this, PluginGitAPI2);
85395
- this.gitMessage = "";
85355
+ _define_property2(this, "gitMessage", "");
85356
+ _define_property2(this, "gitApi", void 0);
85357
+ _define_property2(this, "projectPath", void 0);
85396
85358
  }
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
- };
85455
85359
  _create_class(PluginGitAPI2, [
85456
85360
  {
85457
85361
  key: "context",
@@ -85470,6 +85374,78 @@ var PluginGitAPI = /* @__PURE__ */ function() {
85470
85374
  gitAddAndCommit: this.gitAddAndCommit.bind(this)
85471
85375
  };
85472
85376
  }
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
+ }
85473
85449
  }
85474
85450
  ]);
85475
85451
  return PluginGitAPI2;
@@ -85481,248 +85457,216 @@ var PluginInputContext = /* @__PURE__ */ function() {
85481
85457
  "use strict";
85482
85458
  function PluginInputContext2(solutionSchema) {
85483
85459
  _class_call_check(this, PluginInputContext2);
85484
- this.inputValue = {};
85485
- this.defaultConfig = {};
85486
- this.solutionSchema = {};
85487
- this.extendInputMap = {};
85460
+ _define_property2(this, "inputValue", {});
85461
+ _define_property2(this, "defaultConfig", {});
85462
+ _define_property2(this, "solutionSchemaFunc", void 0);
85463
+ _define_property2(this, "solutionSchema", {});
85464
+ _define_property2(this, "extendInputMap", {});
85488
85465
  this.solutionSchemaFunc = solutionSchema;
85489
85466
  }
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"));
85467
+ _create_class(PluginInputContext2, [
85468
+ {
85469
+ key: "prepare",
85470
+ value: function prepare(inputData) {
85471
+ this.solutionSchema = this.solutionSchemaFunc(inputData).properties;
85507
85472
  }
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
- };
85525
- }
85473
+ },
85474
+ {
85475
+ key: "context",
85476
+ get: function get4() {
85477
+ return {
85478
+ addInputBefore: this.addInputBefore.bind(this),
85479
+ addInputAfter: this.addInputAfter.bind(this),
85480
+ setInput: this.setInput.bind(this),
85481
+ setInputValue: this.setInputValue.bind(this),
85482
+ setDefaultConfig: this.setDefualtConfig.bind(this)
85483
+ };
85526
85484
  }
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;
85485
+ },
85486
+ {
85487
+ key: "validateInputKey",
85488
+ value: function validateInputKey(inputKey) {
85489
+ if (!this.solutionSchema[inputKey]) {
85490
+ throw new Error("the input key ".concat(inputKey, " not found"));
85538
85491
  }
85539
85492
  }
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
- };
85493
+ },
85494
+ {
85495
+ key: "validateInput",
85496
+ value: function validateInput(inputKey) {
85497
+ var _this = this;
85498
+ if (this.solutionSchema[inputKey]) {
85499
+ throw new Error("the input key ".concat(inputKey, " already exists"));
85557
85500
  }
85501
+ Object.keys(this.extendInputMap).forEach(function(key) {
85502
+ if (_this.extendInputMap[key].before[inputKey] || _this.extendInputMap[key].after[inputKey]) {
85503
+ throw new Error("the input key ".concat(inputKey, " is already added"));
85504
+ }
85505
+ });
85558
85506
  }
85559
- } catch (err) {
85560
- _didIteratorError = true;
85561
- _iteratorError = err;
85562
- } finally {
85563
- try {
85564
- if (!_iteratorNormalCompletion && _iterator.return != null) {
85565
- _iterator.return();
85566
- }
85567
- } finally {
85568
- if (_didIteratorError) {
85569
- throw _iteratorError;
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
+ }
85570
85540
  }
85571
85541
  }
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;
85542
+ },
85543
+ {
85544
+ key: "addInputAfter",
85545
+ value: function addInputAfter(key, input) {
85546
+ this.validateInputKey(key);
85547
+ var properties = input.properties || {};
85548
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
85549
+ try {
85550
+ for (var _iterator = Object.keys(properties)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
85551
+ var inputKey = _step.value;
85552
+ this.validateInput(inputKey);
85553
+ if (this.extendInputMap[key]) {
85554
+ this.extendInputMap[key].after[inputKey] = properties[inputKey];
85555
+ } else {
85556
+ this.extendInputMap[key] = {
85557
+ before: {},
85558
+ after: _define_property2({}, inputKey, properties[inputKey])
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
+ }
85596
85575
  }
85597
85576
  }
85598
- } catch (err) {
85599
- _didIteratorError = true;
85600
- _iteratorError = err;
85601
- } finally {
85602
- try {
85603
- if (!_iteratorNormalCompletion && _iterator.return != null) {
85604
- _iterator.return();
85577
+ },
85578
+ {
85579
+ key: "setInput",
85580
+ value: function setInput(key, field, value) {
85581
+ var schema = this.solutionSchema[key];
85582
+ if (schema) {
85583
+ schema[field] = (0, import_lodash9.isFunction)(value) ? value(schema) : value;
85584
+ return;
85605
85585
  }
85606
- } finally {
85607
- if (_didIteratorError) {
85608
- throw _iteratorError;
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
+ }
85617
+ }
85618
+ if (!findFlag) {
85619
+ throw new Error("the input ".concat(key, " not found"));
85609
85620
  }
85610
85621
  }
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, [
85622
+ },
85641
85623
  {
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
- };
85624
+ key: "getFinalInputs",
85625
+ value: function getFinalInputs() {
85626
+ var _this = this;
85627
+ var result = {};
85628
+ Object.keys(this.solutionSchema).forEach(function(key) {
85629
+ var _ref = _this.extendInputMap[key] || {
85630
+ before: {},
85631
+ after: {}
85632
+ }, before = _ref.before, after = _ref.after;
85633
+ Object.keys(before).forEach(function(beforeKey) {
85634
+ return result[beforeKey] = before[beforeKey];
85635
+ });
85636
+ result[key] = _this.solutionSchema[key];
85637
+ Object.keys(after).forEach(function(afterKey) {
85638
+ return result[afterKey] = after[afterKey];
85639
+ });
85640
+ });
85641
+ return result;
85651
85642
  }
85652
- }
85653
- ]);
85654
- return PluginInputContext2;
85655
- }();
85656
-
85657
- // ../../generator-plugin/dist/esm/context/npm.js
85658
- var PluginNpmAPI = /* @__PURE__ */ function() {
85659
- "use strict";
85660
- function PluginNpmAPI2(projectPath, packageManager) {
85661
- _class_call_check(this, PluginNpmAPI2);
85662
- this.projectPath = "";
85663
- this.projectPath = projectPath;
85664
- this.packageManager = packageManager;
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
- };
85643
+ },
85644
+ {
85645
+ key: "setInputValue",
85646
+ value: function setInputValue(value) {
85647
+ this.inputValue = value;
85648
+ }
85649
+ },
85650
+ {
85651
+ key: "setDefualtConfig",
85652
+ value: function setDefualtConfig(value) {
85653
+ this.defaultConfig = value;
85654
+ }
85655
+ }
85656
+ ]);
85657
+ return PluginInputContext2;
85658
+ }();
85659
+
85660
+ // ../../generator-plugin/dist/esm/context/npm.js
85661
+ var PluginNpmAPI = /* @__PURE__ */ function() {
85662
+ "use strict";
85663
+ function PluginNpmAPI2(projectPath, packageManager) {
85664
+ _class_call_check(this, PluginNpmAPI2);
85665
+ _define_property2(this, "projectPath", "");
85666
+ _define_property2(this, "packageManager", void 0);
85667
+ this.projectPath = projectPath;
85668
+ this.packageManager = packageManager;
85669
+ }
85726
85670
  _create_class(PluginNpmAPI2, [
85727
85671
  {
85728
85672
  key: "method",
@@ -85731,24 +85675,79 @@ var PluginNpmAPI = /* @__PURE__ */ function() {
85731
85675
  install: this.install.bind(this)
85732
85676
  };
85733
85677
  }
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
+ }
85734
85740
  }
85735
85741
  ]);
85736
85742
  return PluginNpmAPI2;
85737
85743
  }();
85738
85744
 
85739
85745
  // ../../new-action/dist/esm/utils/index.js
85740
- var import_path15 = __toESM(require("path"));
85746
+ var import_path14 = __toESM(require("path"));
85741
85747
  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);
85749
85748
  function alreadyRepo(cwd = process.cwd()) {
85750
85749
  try {
85751
- return import_utils50.fs.existsSync(import_path15.default.resolve(cwd, "package.json"));
85750
+ return import_utils50.fs.existsSync(import_path14.default.resolve(cwd, "package.json"));
85752
85751
  } catch (e) {
85753
85752
  return false;
85754
85753
  }
@@ -85767,7 +85766,7 @@ var readJson = (jsonPath) => {
85767
85766
  }
85768
85767
  };
85769
85768
  function hasEnabledFunction(action2, dependencies, devDependencies, peerDependencies, cwd) {
85770
- const packageJsonPath = import_path15.default.normalize(`${cwd}/package.json`);
85769
+ const packageJsonPath = import_path14.default.normalize(`${cwd}/package.json`);
85771
85770
  const packageJson = readJson(packageJsonPath);
85772
85771
  if (!dependencies[action2] && !devDependencies[action2]) {
85773
85772
  return false;
@@ -85786,9 +85785,9 @@ function hasEnabledFunction(action2, dependencies, devDependencies, peerDependen
85786
85785
  }
85787
85786
  return false;
85788
85787
  }
85789
- function getGeneratorPath2(generator, distTag) {
85788
+ function getGeneratorPath(generator, distTag) {
85790
85789
  if (process.env.CODESMITH_ENV === "development") {
85791
- return import_path15.default.dirname(require.resolve(generator));
85790
+ return import_path14.default.dirname(require.resolve(generator));
85792
85791
  } else if (distTag) {
85793
85792
  return `${generator}@${distTag}`;
85794
85793
  }
@@ -85845,7 +85844,7 @@ var MWANewAction = async (options) => {
85845
85844
  });
85846
85845
  const actionType = ans.actionType;
85847
85846
  const action2 = ans[actionType];
85848
- const generator = getGeneratorPath2(MWANewActionGenerators[actionType][action2], distTag);
85847
+ const generator = getGeneratorPath(MWANewActionGenerators[actionType][action2], distTag);
85849
85848
  if (!generator) {
85850
85849
  throw new Error(`no valid option`);
85851
85850
  }
@@ -85941,7 +85940,7 @@ var ModuleNewAction = async (options) => {
85941
85940
  });
85942
85941
  const actionType = ans.actionType;
85943
85942
  const action2 = ans[actionType];
85944
- const generator = getGeneratorPath2(ModuleNewActionGenerators[actionType][action2], distTag);
85943
+ const generator = getGeneratorPath(ModuleNewActionGenerators[actionType][action2], distTag);
85945
85944
  if (!generator) {
85946
85945
  throw new Error(`no valid option`);
85947
85946
  }
@@ -85997,7 +85996,7 @@ var ModuleNewAction = async (options) => {
85997
85996
  };
85998
85997
 
85999
85998
  // ../../new-action/dist/esm/monorepo.js
86000
- var import_path16 = __toESM(require("path"));
85999
+ var import_path15 = __toESM(require("path"));
86001
86000
  var import_lodash12 = require("@modern-js/utils/lodash");
86002
86001
  var REPO_GENERATOR = "@modern-js/repo-generator";
86003
86002
  var MonorepoNewAction = async (options) => {
@@ -86020,10 +86019,10 @@ var MonorepoNewAction = async (options) => {
86020
86019
  }
86021
86020
  const plugins = plugin.map((plugin2) => {
86022
86021
  try {
86023
- return import_path16.default.join(require.resolve(plugin2), "../../");
86022
+ return import_path15.default.join(require.resolve(plugin2), "../../");
86024
86023
  } catch (e) {
86025
86024
  try {
86026
- return import_path16.default.join(require.resolve(plugin2), "../../../../");
86025
+ return import_path15.default.join(require.resolve(plugin2), "../../../../");
86027
86026
  } catch (e2) {
86028
86027
  return plugin2;
86029
86028
  }
@@ -86063,141 +86062,14 @@ var PluginNewAPI = /* @__PURE__ */ function() {
86063
86062
  "use strict";
86064
86063
  function PluginNewAPI2(solution, projectPath, inputData) {
86065
86064
  _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);
86066
86068
  this.solution = solution;
86067
86069
  this.projectPath = projectPath;
86068
86070
  this.inputData = inputData;
86069
86071
  process.setMaxListeners(20);
86070
86072
  }
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
- };
86201
86073
  _create_class(PluginNewAPI2, [
86202
86074
  {
86203
86075
  key: "method",
@@ -86208,6 +86080,144 @@ var PluginNewAPI = /* @__PURE__ */ function() {
86208
86080
  createSubProject: this.createSubProject.bind(this)
86209
86081
  };
86210
86082
  }
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
+ }
86211
86221
  }
86212
86222
  ]);
86213
86223
  return PluginNewAPI2;
@@ -86223,29 +86233,22 @@ var PluginContext = /* @__PURE__ */ function() {
86223
86233
  "use strict";
86224
86234
  function PluginContext2(solutionSchema, locale) {
86225
86235
  _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);
86226
86243
  var _obj;
86227
- this.lifeCycleFuncMap = (_obj = {}, _define_property2(_obj, "onForged", function() {
86244
+ _define_property2(this, "lifeCycleFuncMap", (_obj = {}, _define_property2(_obj, "onForged", function() {
86228
86245
  }), _define_property2(_obj, "afterForged", function() {
86229
- }), _obj);
86246
+ }), _obj));
86230
86247
  this.inputContext = new PluginInputContext(solutionSchema);
86231
86248
  this.gitAPI = new PluginGitAPI();
86232
86249
  this.fileAPI = new PluginFileAPI();
86233
86250
  this.locale = locale;
86234
86251
  }
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
- };
86249
86252
  _create_class(PluginContext2, [
86250
86253
  {
86251
86254
  key: "context",
@@ -86269,13 +86272,35 @@ var PluginContext = /* @__PURE__ */ function() {
86269
86272
  get: function get4() {
86270
86273
  return _object_spread({}, this.gitAPI.method, this.npmAPI.method);
86271
86274
  }
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
+ }
86272
86297
  }
86273
86298
  ]);
86274
86299
  return PluginContext2;
86275
86300
  }();
86276
86301
 
86277
86302
  // ../../generator-plugin/dist/esm/utils/index.js
86278
- var import_path17 = __toESM(require("path"));
86303
+ var import_path16 = __toESM(require("path"));
86279
86304
 
86280
86305
  // ../../generator-plugin/dist/esm/utils/module.js
86281
86306
  var import_lodash13 = require("@modern-js/utils/lodash");
@@ -86359,7 +86384,7 @@ function _installPlugins() {
86359
86384
  switch (_state2.label) {
86360
86385
  case 0:
86361
86386
  if (plugin.startsWith("file:")) {
86362
- pluginPath = import_path17.default.join(process.cwd(), plugin.slice(5));
86387
+ pluginPath = import_path16.default.join(process.cwd(), plugin.slice(5));
86363
86388
  return [
86364
86389
  2,
86365
86390
  {
@@ -86368,7 +86393,7 @@ function _installPlugins() {
86368
86393
  }
86369
86394
  ];
86370
86395
  }
86371
- if (import_path17.default.isAbsolute(plugin)) {
86396
+ if (import_path16.default.isAbsolute(plugin)) {
86372
86397
  return [
86373
86398
  2,
86374
86399
  {
@@ -86436,9 +86461,11 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
86436
86461
  function GeneratorPlugin2(logger2, event) {
86437
86462
  var locale = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "en";
86438
86463
  _class_call_check(this, GeneratorPlugin2);
86439
- this.plugins = [];
86440
- this.extendPlugin = {};
86441
- this.customPlugin = {};
86464
+ _define_property2(this, "plugins", []);
86465
+ _define_property2(this, "extendPlugin", {});
86466
+ _define_property2(this, "customPlugin", {});
86467
+ _define_property2(this, "event", void 0);
86468
+ _define_property2(this, "logger", void 0);
86442
86469
  this.event = event;
86443
86470
  this.logger = logger2;
86444
86471
  if (event) {
@@ -86454,421 +86481,451 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
86454
86481
  locale
86455
86482
  });
86456
86483
  }
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
- }));
86520
- }
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
- ]);
86484
+ _create_class(GeneratorPlugin2, [
86485
+ {
86486
+ key: "setupPlugin",
86487
+ value: function setupPlugin(plugins, registry2) {
86488
+ var _this = this;
86489
+ return _async_to_generator(function() {
86490
+ return __generator(this, function(_state) {
86491
+ switch (_state.label) {
86492
+ case 0:
86493
+ return [
86494
+ 4,
86495
+ Promise.all(plugins.map(function() {
86496
+ var _ref = _async_to_generator(function(plugin) {
86497
+ var pkgJSON, _getPackageInfo, name, pkgVersion, meta;
86498
+ return __generator(this, function(_state2) {
86499
+ switch (_state2.label) {
86500
+ case 0:
86501
+ if (!plugin.startsWith("file:"))
86502
+ return [
86503
+ 3,
86504
+ 2
86505
+ ];
86506
+ return [
86507
+ 4,
86508
+ import_utils50.fs.readJSON(import_path17.default.join(process.cwd(), plugin.slice(5), "package.json"))
86509
+ ];
86510
+ case 1:
86511
+ pkgJSON = _state2.sent();
86512
+ return [
86513
+ 3,
86514
+ 6
86515
+ ];
86516
+ case 2:
86517
+ if (!import_path17.default.isAbsolute(plugin))
86518
+ return [
86519
+ 3,
86520
+ 4
86521
+ ];
86522
+ return [
86523
+ 4,
86524
+ import_utils50.fs.readJSON(import_path17.default.join(plugin, "package.json"))
86525
+ ];
86526
+ case 3:
86527
+ pkgJSON = _state2.sent();
86528
+ return [
86529
+ 3,
86530
+ 6
86531
+ ];
86532
+ case 4:
86533
+ _getPackageInfo = getPackageInfo(plugin), name = _getPackageInfo.name, pkgVersion = _getPackageInfo.version;
86534
+ return [
86535
+ 4,
86536
+ getPackageMeta(name, pkgVersion, {
86537
+ registryUrl: registry2
86538
+ })
86539
+ ];
86540
+ case 5:
86541
+ pkgJSON = _state2.sent();
86542
+ _state2.label = 6;
86543
+ case 6:
86544
+ meta = pkgJSON.meta;
86545
+ if (!meta) {
86546
+ throw new Error(i18n4.t(localeKeys4.plugin_no_meta_error, {
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
+ ];
86531
86564
  }
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
- ];
86548
- }
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());
86559
- }
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;
86571
- }
86572
- }
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);
86565
+ });
86566
+ });
86567
+ return function(plugin) {
86568
+ return _ref.apply(this, arguments);
86569
+ };
86570
+ }()))
86571
+ ];
86572
+ case 1:
86573
+ _state.sent();
86574
+ return [
86575
+ 2
86576
+ ];
86577
+ }
86578
+ });
86579
+ })();
86586
86580
  }
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;
86581
+ },
86582
+ {
86583
+ key: "getInputSchema",
86584
+ value: function getInputSchema() {
86585
+ var properties = {};
86586
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
86587
+ try {
86588
+ for (var _iterator = this.plugins[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
86589
+ var info = _step.value;
86590
+ properties = _object_spread({}, properties, info.context.inputContext.getFinalInputs());
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
+ }
86598
86605
  }
86606
+ return {
86607
+ type: "object",
86608
+ properties
86609
+ };
86599
86610
  }
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);
86610
- }
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;
86611
+ },
86612
+ {
86613
+ key: "getInputValue",
86614
+ value: function getInputValue() {
86615
+ var result = {};
86616
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
86617
+ try {
86618
+ for (var _iterator = this.plugins[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
86619
+ var info = _step.value;
86620
+ result = (0, import_lodash14.merge)(result, info.context.inputContext.inputValue);
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
+ }
86622
86635
  }
86636
+ return result;
86623
86637
  }
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]));
86638
+ },
86639
+ {
86640
+ key: "getDefaultConfig",
86641
+ value: function getDefaultConfig() {
86642
+ var result = {};
86643
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
86644
+ try {
86645
+ for (var _iterator = this.plugins[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
86646
+ var info = _step.value;
86647
+ result = (0, import_lodash14.merge)(result, info.context.inputContext.defaultConfig);
86648
+ }
86649
+ } catch (err) {
86650
+ _didIteratorError = true;
86651
+ _iteratorError = err;
86652
+ } finally {
86653
+ try {
86654
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
86655
+ _iterator.return();
86637
86656
  }
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
- }
86657
+ } finally {
86658
+ if (_didIteratorError) {
86659
+ throw _iteratorError;
86645
86660
  }
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) {
86656
- info = _step.value;
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();
86661
+ }
86662
+ }
86663
+ return result;
86664
+ }
86665
+ },
86666
+ {
86667
+ key: "installPlugins",
86668
+ value: function installPlugins1(solution, inputData) {
86669
+ var _this = this;
86670
+ return _async_to_generator(function() {
86671
+ var plugins, plugin, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, info;
86672
+ return __generator(this, function(_state) {
86673
+ switch (_state.label) {
86674
+ case 0:
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]));
86668
86678
  }
86669
- } finally {
86670
- if (_didIteratorError) {
86671
- throw _iteratorError;
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
+ }
86672
86686
  }
86673
- }
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
+ ];
86674
86719
  }
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
- }
86720
+ });
86721
+ })();
86706
86722
  }
86707
- }
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
- }
86723
+ },
86724
+ {
86725
+ key: "getGitMessage",
86726
+ value: function getGitMessage() {
86727
+ var result = "";
86728
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
86729
+ try {
86730
+ for (var _iterator = this.plugins[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
86731
+ var info = _step.value;
86732
+ var _info_context;
86733
+ if ((_info_context = info.context) === null || _info_context === void 0 ? void 0 : _info_context.gitAPI.gitMessage) {
86734
+ var _info_context1;
86735
+ result = ((_info_context1 = info.context) === null || _info_context1 === void 0 ? void 0 : _info_context1.gitAPI.gitMessage) || "";
86789
86736
  }
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
- }
86737
+ }
86738
+ } catch (err) {
86739
+ _didIteratorError = true;
86740
+ _iteratorError = err;
86741
+ } finally {
86742
+ try {
86743
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
86744
+ _iterator.return();
86853
86745
  }
86854
- return [
86855
- 7
86856
- ];
86857
- case 16:
86858
- if (_this.event) {
86859
- _this.event.emit("handle forged success");
86746
+ } finally {
86747
+ if (_didIteratorError) {
86748
+ throw _iteratorError;
86860
86749
  }
86861
- return [
86862
- 2
86863
- ];
86750
+ }
86864
86751
  }
86865
- });
86866
- })();
86867
- };
86752
+ return result;
86753
+ }
86754
+ },
86755
+ {
86756
+ key: "handleForged",
86757
+ value: function handleForged(solution, basePath, inputData, projectPath, generatorCore) {
86758
+ var _this = this;
86759
+ return _async_to_generator(function() {
86760
+ 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;
86761
+ return __generator(this, function(_state) {
86762
+ switch (_state.label) {
86763
+ case 0:
86764
+ _this.logger.info(i18n4.t(localeKeys4.run_plugin));
86765
+ generatorPlugin = inputData.generatorPlugin, restData = _object_without_properties(inputData, [
86766
+ "generatorPlugin"
86767
+ ]);
86768
+ if (solution !== restData.solution) {
86769
+ if (_this.event) {
86770
+ _this.event.emit("handle forged success");
86771
+ }
86772
+ return [
86773
+ 2
86774
+ ];
86775
+ }
86776
+ _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
86777
+ _state.label = 1;
86778
+ case 1:
86779
+ _state.trys.push([
86780
+ 1,
86781
+ 6,
86782
+ 7,
86783
+ 8
86784
+ ]);
86785
+ _iterator = _this.plugins[Symbol.iterator]();
86786
+ _state.label = 2;
86787
+ case 2:
86788
+ if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done))
86789
+ return [
86790
+ 3,
86791
+ 5
86792
+ ];
86793
+ info = _step.value;
86794
+ (_info_context = info.context) === null || _info_context === void 0 ? void 0 : _info_context.handlePrepareContext(generatorCore, solution, import_path17.default.join(basePath, projectPath), import_path17.default.join(info.templatePath, "templates"), restData);
86795
+ onForgedFunc = (_info_context1 = info.context) === null || _info_context1 === void 0 ? void 0 : _info_context1.lifeCycleFuncMap[LifeCycle2.OnForged];
86796
+ if (!(onForgedFunc && (0, import_lodash14.isFunction)(onForgedFunc)))
86797
+ return [
86798
+ 3,
86799
+ 4
86800
+ ];
86801
+ return [
86802
+ 4,
86803
+ onForgedFunc(info.context.forgedAPI, restData)
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
+ }
86900
+ }
86901
+ return [
86902
+ 7
86903
+ ];
86904
+ case 16:
86905
+ if (_this.event) {
86906
+ _this.event.emit("handle forged success");
86907
+ }
86908
+ return [
86909
+ 2
86910
+ ];
86911
+ }
86912
+ });
86913
+ })();
86914
+ }
86915
+ }
86916
+ ]);
86868
86917
  return GeneratorPlugin2;
86869
86918
  }();
86870
86919
 
86871
86920
  // 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
+ };
86872
86929
  var mergeDefaultConfig = (context) => {
86873
86930
  const { defaultSolution } = context.config;
86874
86931
  if (defaultSolution) {
@@ -86909,7 +86966,7 @@ var handleTemplateFile = async (context, generator, appApi, generatorPlugin) =>
86909
86966
  generator.logger.error("solution is not valid ");
86910
86967
  }
86911
86968
  await appApi.runSubGenerator(
86912
- getGeneratorPath(solutionGenerator, context.config.distTag, [__dirname]),
86969
+ getGeneratorPath2(solutionGenerator, context.config.distTag),
86913
86970
  void 0,
86914
86971
  {
86915
86972
  ...isMonorepo ? MonorepoNewActionConfig[solution] || {} : {},