@modern-js/server-generator 3.3.10 → 3.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +294 -287
  2. package/package.json +7 -7
  3. package/src/index.ts +2 -10
package/dist/index.js CHANGED
@@ -9104,13 +9104,13 @@ var require_ast = __commonJS({
9104
9104
  helperExpression: function helperExpression(node) {
9105
9105
  return node.type === "SubExpression" || (node.type === "MustacheStatement" || node.type === "BlockStatement") && !!(node.params && node.params.length || node.hash);
9106
9106
  },
9107
- scopedId: function scopedId(path6) {
9108
- return /^\.|this\b/.test(path6.original);
9107
+ scopedId: function scopedId(path7) {
9108
+ return /^\.|this\b/.test(path7.original);
9109
9109
  },
9110
9110
  // an ID is simple if it only has one part, and that part is not
9111
9111
  // `..` or `this`.
9112
- simpleId: function simpleId(path6) {
9113
- return path6.parts.length === 1 && !AST.helpers.scopedId(path6) && !path6.depth;
9112
+ simpleId: function simpleId(path7) {
9113
+ return path7.parts.length === 1 && !AST.helpers.scopedId(path7) && !path7.depth;
9114
9114
  }
9115
9115
  }
9116
9116
  };
@@ -10194,12 +10194,12 @@ var require_helpers2 = __commonJS({
10194
10194
  loc
10195
10195
  };
10196
10196
  }
10197
- function prepareMustache(path6, params, hash, open, strip, locInfo) {
10197
+ function prepareMustache(path7, params, hash, open, strip, locInfo) {
10198
10198
  var escapeFlag = open.charAt(3) || open.charAt(2), escaped = escapeFlag !== "{" && escapeFlag !== "&";
10199
10199
  var decorator = /\*/.test(open);
10200
10200
  return {
10201
10201
  type: decorator ? "Decorator" : "MustacheStatement",
10202
- path: path6,
10202
+ path: path7,
10203
10203
  params,
10204
10204
  hash,
10205
10205
  escaped,
@@ -10470,9 +10470,9 @@ var require_compiler = __commonJS({
10470
10470
  },
10471
10471
  DecoratorBlock: function DecoratorBlock(decorator) {
10472
10472
  var program = decorator.program && this.compileProgram(decorator.program);
10473
- var params = this.setupFullMustacheParams(decorator, program, void 0), path6 = decorator.path;
10473
+ var params = this.setupFullMustacheParams(decorator, program, void 0), path7 = decorator.path;
10474
10474
  this.useDecorators = true;
10475
- this.opcode("registerDecorator", params.length, path6.original);
10475
+ this.opcode("registerDecorator", params.length, path7.original);
10476
10476
  },
10477
10477
  PartialStatement: function PartialStatement(partial) {
10478
10478
  this.usePartial = true;
@@ -10536,46 +10536,46 @@ var require_compiler = __commonJS({
10536
10536
  }
10537
10537
  },
10538
10538
  ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
10539
- var path6 = sexpr.path, name = path6.parts[0], isBlock = program != null || inverse != null;
10540
- this.opcode("getContext", path6.depth);
10539
+ var path7 = sexpr.path, name = path7.parts[0], isBlock = program != null || inverse != null;
10540
+ this.opcode("getContext", path7.depth);
10541
10541
  this.opcode("pushProgram", program);
10542
10542
  this.opcode("pushProgram", inverse);
10543
- path6.strict = true;
10544
- this.accept(path6);
10543
+ path7.strict = true;
10544
+ this.accept(path7);
10545
10545
  this.opcode("invokeAmbiguous", name, isBlock);
10546
10546
  },
10547
10547
  simpleSexpr: function simpleSexpr(sexpr) {
10548
- var path6 = sexpr.path;
10549
- path6.strict = true;
10550
- this.accept(path6);
10548
+ var path7 = sexpr.path;
10549
+ path7.strict = true;
10550
+ this.accept(path7);
10551
10551
  this.opcode("resolvePossibleLambda");
10552
10552
  },
10553
10553
  helperSexpr: function helperSexpr(sexpr, program, inverse) {
10554
- var params = this.setupFullMustacheParams(sexpr, program, inverse), path6 = sexpr.path, name = path6.parts[0];
10554
+ var params = this.setupFullMustacheParams(sexpr, program, inverse), path7 = sexpr.path, name = path7.parts[0];
10555
10555
  if (this.options.knownHelpers[name]) {
10556
10556
  this.opcode("invokeKnownHelper", params.length, name);
10557
10557
  } else if (this.options.knownHelpersOnly) {
10558
10558
  throw new _exception2["default"]("You specified knownHelpersOnly, but used the unknown helper " + name, sexpr);
10559
10559
  } else {
10560
- path6.strict = true;
10561
- path6.falsy = true;
10562
- this.accept(path6);
10563
- this.opcode("invokeHelper", params.length, path6.original, _ast2["default"].helpers.simpleId(path6));
10560
+ path7.strict = true;
10561
+ path7.falsy = true;
10562
+ this.accept(path7);
10563
+ this.opcode("invokeHelper", params.length, path7.original, _ast2["default"].helpers.simpleId(path7));
10564
10564
  }
10565
10565
  },
10566
- PathExpression: function PathExpression(path6) {
10567
- this.addDepth(path6.depth);
10568
- this.opcode("getContext", path6.depth);
10569
- var name = path6.parts[0], scoped = _ast2["default"].helpers.scopedId(path6), blockParamId = !path6.depth && !scoped && this.blockParamIndex(name);
10566
+ PathExpression: function PathExpression(path7) {
10567
+ this.addDepth(path7.depth);
10568
+ this.opcode("getContext", path7.depth);
10569
+ var name = path7.parts[0], scoped = _ast2["default"].helpers.scopedId(path7), blockParamId = !path7.depth && !scoped && this.blockParamIndex(name);
10570
10570
  if (blockParamId) {
10571
- this.opcode("lookupBlockParam", blockParamId, path6.parts);
10571
+ this.opcode("lookupBlockParam", blockParamId, path7.parts);
10572
10572
  } else if (!name) {
10573
10573
  this.opcode("pushContext");
10574
- } else if (path6.data) {
10574
+ } else if (path7.data) {
10575
10575
  this.options.data = true;
10576
- this.opcode("lookupData", path6.depth, path6.parts, path6.strict);
10576
+ this.opcode("lookupData", path7.depth, path7.parts, path7.strict);
10577
10577
  } else {
10578
- this.opcode("lookupOnContext", path6.parts, path6.falsy, path6.strict, scoped);
10578
+ this.opcode("lookupOnContext", path7.parts, path7.falsy, path7.strict, scoped);
10579
10579
  }
10580
10580
  },
10581
10581
  StringLiteral: function StringLiteral(string) {
@@ -10929,16 +10929,16 @@ var require_util2 = __commonJS({
10929
10929
  }
10930
10930
  exports.urlGenerate = urlGenerate;
10931
10931
  function normalize(aPath) {
10932
- var path6 = aPath;
10932
+ var path7 = aPath;
10933
10933
  var url = urlParse(aPath);
10934
10934
  if (url) {
10935
10935
  if (!url.path) {
10936
10936
  return aPath;
10937
10937
  }
10938
- path6 = url.path;
10938
+ path7 = url.path;
10939
10939
  }
10940
- var isAbsolute = exports.isAbsolute(path6);
10941
- var parts = path6.split(/\/+/);
10940
+ var isAbsolute = exports.isAbsolute(path7);
10941
+ var parts = path7.split(/\/+/);
10942
10942
  for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
10943
10943
  part = parts[i];
10944
10944
  if (part === ".") {
@@ -10955,15 +10955,15 @@ var require_util2 = __commonJS({
10955
10955
  }
10956
10956
  }
10957
10957
  }
10958
- path6 = parts.join("/");
10959
- if (path6 === "") {
10960
- path6 = isAbsolute ? "/" : ".";
10958
+ path7 = parts.join("/");
10959
+ if (path7 === "") {
10960
+ path7 = isAbsolute ? "/" : ".";
10961
10961
  }
10962
10962
  if (url) {
10963
- url.path = path6;
10963
+ url.path = path7;
10964
10964
  return urlGenerate(url);
10965
10965
  }
10966
- return path6;
10966
+ return path7;
10967
10967
  }
10968
10968
  exports.normalize = normalize;
10969
10969
  function join(aRoot, aPath) {
@@ -13753,8 +13753,8 @@ var require_printer = __commonJS({
13753
13753
  return this.accept(sexpr.path) + " " + params + hash;
13754
13754
  };
13755
13755
  PrintVisitor.prototype.PathExpression = function(id) {
13756
- var path6 = id.parts.join("/");
13757
- return (id.data ? "@" : "") + "PATH:" + path6;
13756
+ var path7 = id.parts.join("/");
13757
+ return (id.data ? "@" : "") + "PATH:" + path7;
13758
13758
  };
13759
13759
  PrintVisitor.prototype.StringLiteral = function(string) {
13760
13760
  return '"' + string.value + '"';
@@ -13983,7 +13983,7 @@ var require_ejs = __commonJS({
13983
13983
  "../../../../node_modules/.pnpm/ejs@3.1.9/node_modules/ejs/lib/ejs.js"(exports) {
13984
13984
  "use strict";
13985
13985
  var fs8 = require("fs");
13986
- var path6 = require("path");
13986
+ var path7 = require("path");
13987
13987
  var utils = require_utils2();
13988
13988
  var scopeOptionWarned = false;
13989
13989
  var _VERSION_STRING = require_package().version;
@@ -14014,9 +14014,9 @@ var require_ejs = __commonJS({
14014
14014
  exports.localsName = _DEFAULT_LOCALS_NAME;
14015
14015
  exports.promiseImpl = new Function("return this;")().Promise;
14016
14016
  exports.resolveInclude = function(name, filename, isDir) {
14017
- var dirname = path6.dirname;
14018
- var extname = path6.extname;
14019
- var resolve = path6.resolve;
14017
+ var dirname = path7.dirname;
14018
+ var extname = path7.extname;
14019
+ var resolve = path7.resolve;
14020
14020
  var includePath = resolve(isDir ? filename : dirname(filename), name);
14021
14021
  var ext = extname(name);
14022
14022
  if (!ext) {
@@ -14033,30 +14033,30 @@ var require_ejs = __commonJS({
14033
14033
  return filePath;
14034
14034
  }
14035
14035
  }
14036
- function getIncludePath(path7, options) {
14036
+ function getIncludePath(path8, options) {
14037
14037
  var includePath;
14038
14038
  var filePath;
14039
14039
  var views = options.views;
14040
- var match = /^[A-Za-z]+:\\|^\//.exec(path7);
14040
+ var match = /^[A-Za-z]+:\\|^\//.exec(path8);
14041
14041
  if (match && match.length) {
14042
- path7 = path7.replace(/^\/*/, "");
14042
+ path8 = path8.replace(/^\/*/, "");
14043
14043
  if (Array.isArray(options.root)) {
14044
- includePath = resolvePaths(path7, options.root);
14044
+ includePath = resolvePaths(path8, options.root);
14045
14045
  } else {
14046
- includePath = exports.resolveInclude(path7, options.root || "/", true);
14046
+ includePath = exports.resolveInclude(path8, options.root || "/", true);
14047
14047
  }
14048
14048
  } else {
14049
14049
  if (options.filename) {
14050
- filePath = exports.resolveInclude(path7, options.filename);
14050
+ filePath = exports.resolveInclude(path8, options.filename);
14051
14051
  if (fs8.existsSync(filePath)) {
14052
14052
  includePath = filePath;
14053
14053
  }
14054
14054
  }
14055
14055
  if (!includePath && Array.isArray(views)) {
14056
- includePath = resolvePaths(path7, views);
14056
+ includePath = resolvePaths(path8, views);
14057
14057
  }
14058
14058
  if (!includePath && typeof options.includer !== "function") {
14059
- throw new Error('Could not find the include file "' + options.escapeFunction(path7) + '"');
14059
+ throw new Error('Could not find the include file "' + options.escapeFunction(path8) + '"');
14060
14060
  }
14061
14061
  }
14062
14062
  return includePath;
@@ -14115,11 +14115,11 @@ var require_ejs = __commonJS({
14115
14115
  function fileLoader(filePath) {
14116
14116
  return exports.fileLoader(filePath);
14117
14117
  }
14118
- function includeFile(path7, options) {
14118
+ function includeFile(path8, options) {
14119
14119
  var opts = utils.shallowCopy(utils.createNullProtoObjWherePossible(), options);
14120
- opts.filename = getIncludePath(path7, opts);
14120
+ opts.filename = getIncludePath(path8, opts);
14121
14121
  if (typeof options.includer === "function") {
14122
- var includerResult = options.includer(path7, opts.filename);
14122
+ var includerResult = options.includer(path8, opts.filename);
14123
14123
  if (includerResult) {
14124
14124
  if (includerResult.filename) {
14125
14125
  opts.filename = includerResult.filename;
@@ -14354,12 +14354,12 @@ var require_ejs = __commonJS({
14354
14354
  throw e;
14355
14355
  }
14356
14356
  var returnedFn = opts.client ? fn : function anonymous(data) {
14357
- var include = function(path7, includeData) {
14357
+ var include = function(path8, includeData) {
14358
14358
  var d = utils.shallowCopy(utils.createNullProtoObjWherePossible(), data);
14359
14359
  if (includeData) {
14360
14360
  d = utils.shallowCopy(d, includeData);
14361
14361
  }
14362
- return includeFile(path7, opts)(d);
14362
+ return includeFile(path8, opts)(d);
14363
14363
  };
14364
14364
  return fn.apply(
14365
14365
  opts.context,
@@ -14368,7 +14368,7 @@ var require_ejs = __commonJS({
14368
14368
  };
14369
14369
  if (opts.filename && typeof Object.defineProperty === "function") {
14370
14370
  var filename = opts.filename;
14371
- var basename = path6.basename(filename, path6.extname(filename));
14371
+ var basename = path7.basename(filename, path7.extname(filename));
14372
14372
  try {
14373
14373
  Object.defineProperty(returnedFn, "name", {
14374
14374
  value: basename,
@@ -17348,11 +17348,11 @@ var require_baseGet = __commonJS({
17348
17348
  "use strict";
17349
17349
  var castPath = require_castPath();
17350
17350
  var toKey = require_toKey();
17351
- function baseGet(object, path6) {
17352
- path6 = castPath(path6, object);
17353
- var index = 0, length = path6.length;
17351
+ function baseGet(object, path7) {
17352
+ path7 = castPath(path7, object);
17353
+ var index = 0, length = path7.length;
17354
17354
  while (object != null && index < length) {
17355
- object = object[toKey(path6[index++])];
17355
+ object = object[toKey(path7[index++])];
17356
17356
  }
17357
17357
  return index && index == length ? object : void 0;
17358
17358
  }
@@ -17365,8 +17365,8 @@ var require_get = __commonJS({
17365
17365
  "../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/get.js"(exports, module2) {
17366
17366
  "use strict";
17367
17367
  var baseGet = require_baseGet();
17368
- function get3(object, path6, defaultValue) {
17369
- var result = object == null ? void 0 : baseGet(object, path6);
17368
+ function get3(object, path7, defaultValue) {
17369
+ var result = object == null ? void 0 : baseGet(object, path7);
17370
17370
  return result === void 0 ? defaultValue : result;
17371
17371
  }
17372
17372
  module2.exports = get3;
@@ -17453,14 +17453,14 @@ var require_baseSet = __commonJS({
17453
17453
  var isIndex = require_isIndex();
17454
17454
  var isObject4 = require_isObject();
17455
17455
  var toKey = require_toKey();
17456
- function baseSet(object, path6, value, customizer) {
17456
+ function baseSet(object, path7, value, customizer) {
17457
17457
  if (!isObject4(object)) {
17458
17458
  return object;
17459
17459
  }
17460
- path6 = castPath(path6, object);
17461
- var index = -1, length = path6.length, lastIndex = length - 1, nested = object;
17460
+ path7 = castPath(path7, object);
17461
+ var index = -1, length = path7.length, lastIndex = length - 1, nested = object;
17462
17462
  while (nested != null && ++index < length) {
17463
- var key = toKey(path6[index]), newValue = value;
17463
+ var key = toKey(path7[index]), newValue = value;
17464
17464
  if (key === "__proto__" || key === "constructor" || key === "prototype") {
17465
17465
  return object;
17466
17466
  }
@@ -17468,7 +17468,7 @@ var require_baseSet = __commonJS({
17468
17468
  var objValue = nested[key];
17469
17469
  newValue = customizer ? customizer(objValue, key, nested) : void 0;
17470
17470
  if (newValue === void 0) {
17471
- newValue = isObject4(objValue) ? objValue : isIndex(path6[index + 1]) ? [] : {};
17471
+ newValue = isObject4(objValue) ? objValue : isIndex(path7[index + 1]) ? [] : {};
17472
17472
  }
17473
17473
  }
17474
17474
  assignValue(nested, key, newValue);
@@ -17485,8 +17485,8 @@ var require_set = __commonJS({
17485
17485
  "../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/set.js"(exports, module2) {
17486
17486
  "use strict";
17487
17487
  var baseSet = require_baseSet();
17488
- function set(object, path6, value) {
17489
- return object == null ? object : baseSet(object, path6, value);
17488
+ function set(object, path7, value) {
17489
+ return object == null ? object : baseSet(object, path7, value);
17490
17490
  }
17491
17491
  module2.exports = set;
17492
17492
  }
@@ -30107,11 +30107,11 @@ var require_hasPath = __commonJS({
30107
30107
  var isIndex = require_isIndex();
30108
30108
  var isLength = require_isLength();
30109
30109
  var toKey = require_toKey();
30110
- function hasPath(object, path6, hasFunc) {
30111
- path6 = castPath(path6, object);
30112
- var index = -1, length = path6.length, result = false;
30110
+ function hasPath(object, path7, hasFunc) {
30111
+ path7 = castPath(path7, object);
30112
+ var index = -1, length = path7.length, result = false;
30113
30113
  while (++index < length) {
30114
- var key = toKey(path6[index]);
30114
+ var key = toKey(path7[index]);
30115
30115
  if (!(result = object != null && hasFunc(object, key))) {
30116
30116
  break;
30117
30117
  }
@@ -30133,8 +30133,8 @@ var require_hasIn = __commonJS({
30133
30133
  "use strict";
30134
30134
  var baseHasIn = require_baseHasIn();
30135
30135
  var hasPath = require_hasPath();
30136
- function hasIn(object, path6) {
30137
- return object != null && hasPath(object, path6, baseHasIn);
30136
+ function hasIn(object, path7) {
30137
+ return object != null && hasPath(object, path7, baseHasIn);
30138
30138
  }
30139
30139
  module2.exports = hasIn;
30140
30140
  }
@@ -30153,13 +30153,13 @@ var require_baseMatchesProperty = __commonJS({
30153
30153
  var toKey = require_toKey();
30154
30154
  var COMPARE_PARTIAL_FLAG = 1;
30155
30155
  var COMPARE_UNORDERED_FLAG = 2;
30156
- function baseMatchesProperty(path6, srcValue) {
30157
- if (isKey(path6) && isStrictComparable(srcValue)) {
30158
- return matchesStrictComparable(toKey(path6), srcValue);
30156
+ function baseMatchesProperty(path7, srcValue) {
30157
+ if (isKey(path7) && isStrictComparable(srcValue)) {
30158
+ return matchesStrictComparable(toKey(path7), srcValue);
30159
30159
  }
30160
30160
  return function(object) {
30161
- var objValue = get3(object, path6);
30162
- return objValue === void 0 && objValue === srcValue ? hasIn(object, path6) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
30161
+ var objValue = get3(object, path7);
30162
+ return objValue === void 0 && objValue === srcValue ? hasIn(object, path7) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
30163
30163
  };
30164
30164
  }
30165
30165
  module2.exports = baseMatchesProperty;
@@ -30184,9 +30184,9 @@ var require_basePropertyDeep = __commonJS({
30184
30184
  "../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_basePropertyDeep.js"(exports, module2) {
30185
30185
  "use strict";
30186
30186
  var baseGet = require_baseGet();
30187
- function basePropertyDeep(path6) {
30187
+ function basePropertyDeep(path7) {
30188
30188
  return function(object) {
30189
- return baseGet(object, path6);
30189
+ return baseGet(object, path7);
30190
30190
  };
30191
30191
  }
30192
30192
  module2.exports = basePropertyDeep;
@@ -30201,8 +30201,8 @@ var require_property = __commonJS({
30201
30201
  var basePropertyDeep = require_basePropertyDeep();
30202
30202
  var isKey = require_isKey();
30203
30203
  var toKey = require_toKey();
30204
- function property(path6) {
30205
- return isKey(path6) ? baseProperty(toKey(path6)) : basePropertyDeep(path6);
30204
+ function property(path7) {
30205
+ return isKey(path7) ? baseProperty(toKey(path7)) : basePropertyDeep(path7);
30206
30206
  }
30207
30207
  module2.exports = property;
30208
30208
  }
@@ -31431,15 +31431,15 @@ var require_route = __commonJS({
31431
31431
  };
31432
31432
  }
31433
31433
  function wrapConversion(toModel, graph) {
31434
- const path6 = [graph[toModel].parent, toModel];
31434
+ const path7 = [graph[toModel].parent, toModel];
31435
31435
  let fn = conversions[graph[toModel].parent][toModel];
31436
31436
  let cur = graph[toModel].parent;
31437
31437
  while (graph[cur].parent) {
31438
- path6.unshift(graph[cur].parent);
31438
+ path7.unshift(graph[cur].parent);
31439
31439
  fn = link(conversions[graph[cur].parent][cur], fn);
31440
31440
  cur = graph[cur].parent;
31441
31441
  }
31442
- fn.conversion = path6;
31442
+ fn.conversion = path7;
31443
31443
  return fn;
31444
31444
  }
31445
31445
  module2.exports = function(fromModel) {
@@ -47555,16 +47555,16 @@ var require_os_tmpdir = __commonJS({
47555
47555
  var isWindows = process.platform === "win32";
47556
47556
  var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/;
47557
47557
  module2.exports = function() {
47558
- var path6;
47558
+ var path7;
47559
47559
  if (isWindows) {
47560
- path6 = process.env.TEMP || process.env.TMP || (process.env.SystemRoot || process.env.windir) + "\\temp";
47560
+ path7 = process.env.TEMP || process.env.TMP || (process.env.SystemRoot || process.env.windir) + "\\temp";
47561
47561
  } else {
47562
- path6 = process.env.TMPDIR || process.env.TMP || process.env.TEMP || "/tmp";
47562
+ path7 = process.env.TMPDIR || process.env.TMP || process.env.TEMP || "/tmp";
47563
47563
  }
47564
- if (trailingSlashRe.test(path6)) {
47565
- path6 = path6.slice(0, -1);
47564
+ if (trailingSlashRe.test(path7)) {
47565
+ path7 = path7.slice(0, -1);
47566
47566
  }
47567
- return path6;
47567
+ return path7;
47568
47568
  };
47569
47569
  }
47570
47570
  });
@@ -47574,7 +47574,7 @@ var require_tmp = __commonJS({
47574
47574
  "../../../../node_modules/.pnpm/tmp@0.0.33/node_modules/tmp/lib/tmp.js"(exports, module2) {
47575
47575
  "use strict";
47576
47576
  var fs8 = require("fs");
47577
- var path6 = require("path");
47577
+ var path7 = require("path");
47578
47578
  var crypto = require("crypto");
47579
47579
  var osTmpDir = require_os_tmpdir();
47580
47580
  var _c = process.binding("constants");
@@ -47616,7 +47616,7 @@ var require_tmp = __commonJS({
47616
47616
  }
47617
47617
  function _generateTmpName(opts) {
47618
47618
  if (opts.name) {
47619
- return path6.join(opts.dir || tmpDir, opts.name);
47619
+ return path7.join(opts.dir || tmpDir, opts.name);
47620
47620
  }
47621
47621
  if (opts.template) {
47622
47622
  return opts.template.replace(TEMPLATE_PATTERN, _randomChars(6));
@@ -47627,7 +47627,7 @@ var require_tmp = __commonJS({
47627
47627
  _randomChars(12),
47628
47628
  opts.postfix || ""
47629
47629
  ].join("");
47630
- return path6.join(opts.dir || tmpDir, name);
47630
+ return path7.join(opts.dir || tmpDir, name);
47631
47631
  }
47632
47632
  function tmpName(options, callback) {
47633
47633
  var args = _parseArguments(options, callback), opts = args[0], cb = args[1], tries = opts.name ? 1 : opts.tries || DEFAULT_TRIES;
@@ -47715,7 +47715,7 @@ var require_tmp = __commonJS({
47715
47715
  do {
47716
47716
  var dir2 = dirs.pop(), deferred = false, files = fs8.readdirSync(dir2);
47717
47717
  for (var i = 0, length = files.length; i < length; i++) {
47718
- var file2 = path6.join(dir2, files[i]), stat = fs8.lstatSync(file2);
47718
+ var file2 = path7.join(dir2, files[i]), stat = fs8.lstatSync(file2);
47719
47719
  if (stat.isDirectory()) {
47720
47720
  if (!deferred) {
47721
47721
  deferred = true;
@@ -48473,8 +48473,8 @@ var require_parent = __commonJS({
48473
48473
  "use strict";
48474
48474
  var baseGet = require_baseGet();
48475
48475
  var baseSlice = require_baseSlice();
48476
- function parent(object, path6) {
48477
- return path6.length < 2 ? object : baseGet(object, baseSlice(path6, 0, -1));
48476
+ function parent(object, path7) {
48477
+ return path7.length < 2 ? object : baseGet(object, baseSlice(path7, 0, -1));
48478
48478
  }
48479
48479
  module2.exports = parent;
48480
48480
  }
@@ -48488,10 +48488,10 @@ var require_baseUnset = __commonJS({
48488
48488
  var last = require_last2();
48489
48489
  var parent = require_parent();
48490
48490
  var toKey = require_toKey();
48491
- function baseUnset(object, path6) {
48492
- path6 = castPath(path6, object);
48493
- object = parent(object, path6);
48494
- return object == null || delete object[toKey(last(path6))];
48491
+ function baseUnset(object, path7) {
48492
+ path7 = castPath(path7, object);
48493
+ object = parent(object, path7);
48494
+ return object == null || delete object[toKey(last(path7))];
48495
48495
  }
48496
48496
  module2.exports = baseUnset;
48497
48497
  }
@@ -48600,10 +48600,10 @@ var require_omit = __commonJS({
48600
48600
  return result;
48601
48601
  }
48602
48602
  var isDeep = false;
48603
- paths = arrayMap(paths, function(path6) {
48604
- path6 = castPath(path6, object);
48605
- isDeep || (isDeep = path6.length > 1);
48606
- return path6;
48603
+ paths = arrayMap(paths, function(path7) {
48604
+ path7 = castPath(path7, object);
48605
+ isDeep || (isDeep = path7.length > 1);
48606
+ return path7;
48607
48607
  });
48608
48608
  copyObject(object, getAllKeysIn(object), result);
48609
48609
  if (isDeep) {
@@ -52068,26 +52068,26 @@ var require_mongo_dot = __commonJS({
52068
52068
  }
52069
52069
  }
52070
52070
  exports.parent = parent;
52071
- var get3 = function(obj, path6) {
52072
- if (path6.includes(".")) {
52073
- var par = parent(obj, path6);
52074
- var mainKey = path6.split(".").pop();
52071
+ var get3 = function(obj, path7) {
52072
+ if (path7.includes(".")) {
52073
+ var par = parent(obj, path7);
52074
+ var mainKey = path7.split(".").pop();
52075
52075
  var t = get_type_1.default(par);
52076
52076
  if ("object" === t || "array" === t)
52077
52077
  return par[mainKey];
52078
52078
  } else {
52079
- return obj[path6];
52079
+ return obj[path7];
52080
52080
  }
52081
52081
  };
52082
52082
  exports.get = get3;
52083
- var set = function(obj, path6, val) {
52084
- if (path6.includes(".")) {
52085
- var par = parent(obj, path6, true);
52086
- var mainKey = path6.split(".").pop();
52083
+ var set = function(obj, path7, val) {
52084
+ if (path7.includes(".")) {
52085
+ var par = parent(obj, path7, true);
52086
+ var mainKey = path7.split(".").pop();
52087
52087
  if (par && "object" === get_type_1.default(par))
52088
52088
  par[mainKey] = val;
52089
52089
  } else {
52090
- obj[path6] = val;
52090
+ obj[path7] = val;
52091
52091
  }
52092
52092
  };
52093
52093
  exports.set = set;
@@ -52169,9 +52169,9 @@ var require_mods = __commonJS({
52169
52169
  }
52170
52170
  };
52171
52171
  }
52172
- var $set = function $set2(obj, path6, val) {
52173
- var key = path6.split(".").pop();
52174
- obj = mongoDot.parent(obj, path6, true);
52172
+ var $set = function $set2(obj, path7, val) {
52173
+ var key = path7.split(".").pop();
52174
+ obj = mongoDot.parent(obj, path7, true);
52175
52175
  switch (get_type_1.default(obj)) {
52176
52176
  case "object":
52177
52177
  if (!mongo_eql_1.default(obj[key], val)) {
@@ -52198,9 +52198,9 @@ var require_mods = __commonJS({
52198
52198
  }
52199
52199
  };
52200
52200
  exports.$set = $set;
52201
- var $unset = function $unset2(obj, path6) {
52202
- var key = path6.split(".").pop();
52203
- obj = mongoDot.parent(obj, path6);
52201
+ var $unset = function $unset2(obj, path7) {
52202
+ var key = path7.split(".").pop();
52203
+ obj = mongoDot.parent(obj, path7);
52204
52204
  switch (get_type_1.default(obj)) {
52205
52205
  case "array":
52206
52206
  case "object":
@@ -52214,17 +52214,17 @@ var require_mods = __commonJS({
52214
52214
  }
52215
52215
  };
52216
52216
  exports.$unset = $unset;
52217
- var $rename = function $rename2(obj, path6, newKey) {
52218
- if (path6 === newKey) {
52217
+ var $rename = function $rename2(obj, path7, newKey) {
52218
+ if (path7 === newKey) {
52219
52219
  throw new Error("$rename source must differ from target");
52220
52220
  }
52221
- if (0 === path6.indexOf(newKey + ".")) {
52221
+ if (0 === path7.indexOf(newKey + ".")) {
52222
52222
  throw new Error("$rename target may not be a parent of source");
52223
52223
  }
52224
- var p = mongoDot.parent(obj, path6);
52224
+ var p = mongoDot.parent(obj, path7);
52225
52225
  var t = get_type_1.default(p);
52226
52226
  if ("object" === t) {
52227
- var key_1 = path6.split(".").pop();
52227
+ var key_1 = path7.split(".").pop();
52228
52228
  if (p.hasOwnProperty(key_1)) {
52229
52229
  return function() {
52230
52230
  var val = p[key_1];
@@ -52245,12 +52245,12 @@ var require_mods = __commonJS({
52245
52245
  }
52246
52246
  };
52247
52247
  exports.$rename = $rename;
52248
- var $inc = function $inc2(obj, path6, inc) {
52248
+ var $inc = function $inc2(obj, path7, inc) {
52249
52249
  if ("number" !== get_type_1.default(inc)) {
52250
52250
  throw new Error("Modifier $inc allowed for numbers only");
52251
52251
  }
52252
- obj = mongoDot.parent(obj, path6, true);
52253
- var key = path6.split(".").pop();
52252
+ obj = mongoDot.parent(obj, path7, true);
52253
+ var key = path7.split(".").pop();
52254
52254
  switch (get_type_1.default(obj)) {
52255
52255
  case "array":
52256
52256
  case "object":
@@ -52276,9 +52276,9 @@ var require_mods = __commonJS({
52276
52276
  }
52277
52277
  };
52278
52278
  exports.$inc = $inc;
52279
- var $pop = function $pop2(obj, path6, val) {
52280
- obj = mongoDot.parent(obj, path6);
52281
- var key = path6.split(".").pop();
52279
+ var $pop = function $pop2(obj, path7, val) {
52280
+ obj = mongoDot.parent(obj, path7);
52281
+ var key = path7.split(".").pop();
52282
52282
  switch (get_type_1.default(obj)) {
52283
52283
  case "array":
52284
52284
  case "object":
@@ -52311,9 +52311,9 @@ var require_mods = __commonJS({
52311
52311
  }
52312
52312
  };
52313
52313
  exports.$pop = $pop;
52314
- var $push = function $push2(obj, path6, val) {
52315
- obj = mongoDot.parent(obj, path6, true);
52316
- var key = path6.split(".").pop();
52314
+ var $push = function $push2(obj, path7, val) {
52315
+ obj = mongoDot.parent(obj, path7, true);
52316
+ var key = path7.split(".").pop();
52317
52317
  switch (get_type_1.default(obj)) {
52318
52318
  case "object":
52319
52319
  if (obj.hasOwnProperty(key)) {
@@ -52354,12 +52354,12 @@ var require_mods = __commonJS({
52354
52354
  }
52355
52355
  };
52356
52356
  exports.$push = $push;
52357
- var $pushAll = function $pushAll2(obj, path6, val) {
52357
+ var $pushAll = function $pushAll2(obj, path7, val) {
52358
52358
  if ("array" !== get_type_1.default(val)) {
52359
52359
  throw new Error("Modifier $pushAll/pullAll allowed for arrays only");
52360
52360
  }
52361
- obj = mongoDot.parent(obj, path6, true);
52362
- var key = path6.split(".").pop();
52361
+ obj = mongoDot.parent(obj, path7, true);
52362
+ var key = path7.split(".").pop();
52363
52363
  switch (get_type_1.default(obj)) {
52364
52364
  case "object":
52365
52365
  if (obj.hasOwnProperty(key)) {
@@ -52400,9 +52400,9 @@ var require_mods = __commonJS({
52400
52400
  }
52401
52401
  };
52402
52402
  exports.$pushAll = $pushAll;
52403
- var $pull = function $pull2(obj, path6, val) {
52404
- obj = mongoDot.parent(obj, path6, true);
52405
- var key = path6.split(".").pop();
52403
+ var $pull = function $pull2(obj, path7, val) {
52404
+ obj = mongoDot.parent(obj, path7, true);
52405
+ var key = path7.split(".").pop();
52406
52406
  var t = get_type_1.default(obj);
52407
52407
  switch (t) {
52408
52408
  case "object":
@@ -52446,12 +52446,12 @@ var require_mods = __commonJS({
52446
52446
  }
52447
52447
  };
52448
52448
  exports.$pull = $pull;
52449
- var $pullAll = function $pullAll2(obj, path6, val) {
52449
+ var $pullAll = function $pullAll2(obj, path7, val) {
52450
52450
  if ("array" !== get_type_1.default(val)) {
52451
52451
  throw new Error("Modifier $pushAll/pullAll allowed for arrays only");
52452
52452
  }
52453
- obj = mongoDot.parent(obj, path6, true);
52454
- var key = path6.split(".").pop();
52453
+ obj = mongoDot.parent(obj, path7, true);
52454
+ var key = path7.split(".").pop();
52455
52455
  var t = get_type_1.default(obj);
52456
52456
  switch (t) {
52457
52457
  case "object":
@@ -52495,11 +52495,11 @@ var require_mods = __commonJS({
52495
52495
  }
52496
52496
  };
52497
52497
  exports.$pullAll = $pullAll;
52498
- var $addToSet = function $addToSet2(obj, path6, val, recursing) {
52498
+ var $addToSet = function $addToSet2(obj, path7, val, recursing) {
52499
52499
  if (!recursing && "array" === get_type_1.default(val.$each)) {
52500
52500
  var fns_1 = [];
52501
52501
  for (var i = 0, l = val.$each.length; i < l; i++) {
52502
- var fn = $addToSet2(obj, path6, val.$each[i], true);
52502
+ var fn = $addToSet2(obj, path7, val.$each[i], true);
52503
52503
  if (fn)
52504
52504
  fns_1.push(fn);
52505
52505
  }
@@ -52514,8 +52514,8 @@ var require_mods = __commonJS({
52514
52514
  return;
52515
52515
  }
52516
52516
  }
52517
- obj = mongoDot.parent(obj, path6, true);
52518
- var key = path6.split(".").pop();
52517
+ obj = mongoDot.parent(obj, path7, true);
52518
+ var key = path7.split(".").pop();
52519
52519
  switch (get_type_1.default(obj)) {
52520
52520
  case "object":
52521
52521
  if (obj.hasOwnProperty(key)) {
@@ -52656,10 +52656,10 @@ __export(src_exports, {
52656
52656
  default: () => src_default
52657
52657
  });
52658
52658
  module.exports = __toCommonJS(src_exports);
52659
- var import_path6 = __toESM(require("path"));
52659
+ var import_path7 = __toESM(require("path"));
52660
52660
 
52661
52661
  // ../../generator-utils/dist/esm/index.js
52662
- var import_path = __toESM(require("path"));
52662
+ var import_path2 = __toESM(require("path"));
52663
52663
  var import_utils3 = require("@modern-js/utils");
52664
52664
 
52665
52665
  // ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_define_property.js
@@ -53053,6 +53053,21 @@ async function getAvailableVersion(packageName, currentVersion, registry2) {
53053
53053
  return currentVersion;
53054
53054
  }
53055
53055
 
53056
+ // ../../generator-utils/dist/esm/utils/getGeneratorPath.js
53057
+ var import_path = __toESM(require("path"));
53058
+ var getGeneratorPath = (generator, distTag, paths) => {
53059
+ if (process.env.CODESMITH_ENV === "development") {
53060
+ return import_path.default.dirname(require.resolve(generator, {
53061
+ paths: paths !== null && paths !== void 0 ? paths : [
53062
+ process.cwd()
53063
+ ]
53064
+ }));
53065
+ } else if (distTag) {
53066
+ return `${generator}@${distTag}`;
53067
+ }
53068
+ return generator;
53069
+ };
53070
+
53056
53071
  // ../../generator-utils/dist/esm/index.js
53057
53072
  var import_utils4 = require("@modern-js/utils");
53058
53073
  async function getPackageVersion(packageName, registry2) {
@@ -53100,13 +53115,13 @@ async function getModernPluginVersion(solution, packageName, options = {
53100
53115
  if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
53101
53116
  return getLatetPluginVersion("latest");
53102
53117
  }
53103
- let pkgPath = import_path.default.join(require.resolve(SolutionToolsMap[solution], {
53118
+ let pkgPath = import_path2.default.join(require.resolve(SolutionToolsMap[solution], {
53104
53119
  paths: [
53105
53120
  cwd
53106
53121
  ]
53107
53122
  }), "../../..", "package.json");
53108
53123
  if (solution === Solution.Module) {
53109
- pkgPath = import_path.default.join(require.resolve(SolutionToolsMap[solution], {
53124
+ pkgPath = import_path2.default.join(require.resolve(SolutionToolsMap[solution], {
53110
53125
  paths: [
53111
53126
  cwd
53112
53127
  ]
@@ -53127,7 +53142,7 @@ async function getModernPluginVersion(solution, packageName, options = {
53127
53142
  return getLatetPluginVersion();
53128
53143
  }
53129
53144
  function isTsProject(appDir) {
53130
- return import_utils3.fs.existsSync(import_path.default.join(appDir, "tsconfig.json"));
53145
+ return import_utils3.fs.existsSync(import_path2.default.join(appDir, "tsconfig.json"));
53131
53146
  }
53132
53147
 
53133
53148
  // ../../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/esm/_define_property.js
@@ -53447,15 +53462,15 @@ var GitAPI = class {
53447
53462
  };
53448
53463
 
53449
53464
  // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
53450
- var import_path2 = __toESM(require("path"));
53465
+ var import_path3 = __toESM(require("path"));
53451
53466
  var import_utils10 = require("@modern-js/utils");
53452
53467
  var FS_RESOURCE = "_codesmith_core_fs_resource";
53453
53468
 
53454
53469
  // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
53455
53470
  var import_utils11 = require("@modern-js/utils");
53456
- async function fsExists(path6) {
53471
+ async function fsExists(path7) {
53457
53472
  try {
53458
- await import_utils11.fs.access(path6);
53473
+ await import_utils11.fs.access(path7);
53459
53474
  return true;
53460
53475
  } catch (e) {
53461
53476
  return false;
@@ -53566,15 +53581,15 @@ var EjsAPI = class {
53566
53581
  };
53567
53582
 
53568
53583
  // ../../../../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
53569
- var import_path3 = __toESM(require("path"));
53584
+ var import_path4 = __toESM(require("path"));
53570
53585
  var import_utils14 = require("@modern-js/utils");
53571
53586
  var FsAPI = class {
53572
53587
  async renderFile(resource, target) {
53573
53588
  if (resource._type !== FS_RESOURCE) {
53574
53589
  throw new Error("resource not match");
53575
53590
  }
53576
- const filePath = import_path3.default.resolve(this.generatorCore.outputPath, target.toString());
53577
- await import_utils14.fs.mkdirp(import_path3.default.dirname(filePath));
53591
+ const filePath = import_path4.default.resolve(this.generatorCore.outputPath, target.toString());
53592
+ await import_utils14.fs.mkdirp(import_path4.default.dirname(filePath));
53578
53593
  await import_utils14.fs.copyFile(resource.filePath, filePath);
53579
53594
  }
53580
53595
  async renderDir(material, findGlob, target, options) {
@@ -54618,8 +54633,8 @@ var parseDestructorRules = function(node) {
54618
54633
  };
54619
54634
  var setInByDestructor = function(source, rules, value, mutators) {
54620
54635
  rules.forEach(function(_a2) {
54621
- var key = _a2.key, path6 = _a2.path;
54622
- mutators.setIn([key], source, mutators.getIn(path6, value));
54636
+ var key = _a2.key, path7 = _a2.path;
54637
+ mutators.setIn([key], source, mutators.getIn(path7, value));
54623
54638
  });
54624
54639
  };
54625
54640
  var getInByDestructor = function(source, rules, mutators) {
@@ -54631,8 +54646,8 @@ var getInByDestructor = function(source, rules, mutators) {
54631
54646
  }
54632
54647
  source = isValid2(source) ? source : {};
54633
54648
  rules.forEach(function(_a2) {
54634
- var key = _a2.key, path6 = _a2.path;
54635
- mutators.setIn(path6, response, source[key]);
54649
+ var key = _a2.key, path7 = _a2.path;
54650
+ mutators.setIn(path7, response, source[key]);
54636
54651
  });
54637
54652
  return response;
54638
54653
  };
@@ -55199,8 +55214,8 @@ var Matcher = (
55199
55214
  }
55200
55215
  return false;
55201
55216
  };
55202
- Matcher2.prototype.match = function(path6) {
55203
- this.path = path6;
55217
+ Matcher2.prototype.match = function(path7) {
55218
+ this.path = path7;
55204
55219
  return { matched: this.matchNode(this.tree), record: this.record };
55205
55220
  };
55206
55221
  Matcher2.matchSegments = function(source, target, record) {
@@ -55490,21 +55505,21 @@ var Path = (
55490
55505
  if (_this.isMatchPattern || _this.isRegExp) {
55491
55506
  throw new Error("".concat(_this.entire, " cannot be concat"));
55492
55507
  }
55493
- var path6 = new Path2("");
55494
- path6.segments = (_a3 = _this.segments).concat.apply(_a3, __spreadArray([], __read(args.map(function(s) {
55508
+ var path7 = new Path2("");
55509
+ path7.segments = (_a3 = _this.segments).concat.apply(_a3, __spreadArray([], __read(args.map(function(s) {
55495
55510
  return parseString(s);
55496
55511
  })), false));
55497
- path6.entire = path6.segments.join(".");
55498
- return path6;
55512
+ path7.entire = path7.segments.join(".");
55513
+ return path7;
55499
55514
  };
55500
55515
  this.slice = function(start, end) {
55501
55516
  if (_this.isMatchPattern || _this.isRegExp) {
55502
55517
  throw new Error("".concat(_this.entire, " cannot be slice"));
55503
55518
  }
55504
- var path6 = new Path2("");
55505
- path6.segments = _this.segments.slice(start, end);
55506
- path6.entire = path6.segments.join(".");
55507
- return path6;
55519
+ var path7 = new Path2("");
55520
+ path7.segments = _this.segments.slice(start, end);
55521
+ path7.entire = path7.segments.join(".");
55522
+ return path7;
55508
55523
  };
55509
55524
  this.push = function() {
55510
55525
  var items = [];
@@ -55596,8 +55611,8 @@ var Path = (
55596
55611
  };
55597
55612
  this.match = function(pattern) {
55598
55613
  var _a3, _b;
55599
- var path6 = Path2.parse(pattern);
55600
- var cache = _this.matchCache.get(path6.entire);
55614
+ var path7 = Path2.parse(pattern);
55615
+ var cache = _this.matchCache.get(path7.entire);
55601
55616
  if (cache !== void 0) {
55602
55617
  if (cache.record && cache.record.score !== void 0) {
55603
55618
  _this.matchScore = cache.record.score;
@@ -55605,21 +55620,21 @@ var Path = (
55605
55620
  return cache.matched;
55606
55621
  }
55607
55622
  var cacheWith = function(value) {
55608
- _this.matchCache.set(path6.entire, value);
55623
+ _this.matchCache.set(path7.entire, value);
55609
55624
  return value;
55610
55625
  };
55611
- if (path6.isMatchPattern) {
55626
+ if (path7.isMatchPattern) {
55612
55627
  if (_this.isMatchPattern) {
55613
- throw new Error("".concat(path6.entire, " cannot match ").concat(_this.entire));
55628
+ throw new Error("".concat(path7.entire, " cannot match ").concat(_this.entire));
55614
55629
  } else {
55615
55630
  _this.matchScore = 0;
55616
- return cacheWith(path6.match(_this.segments));
55631
+ return cacheWith(path7.match(_this.segments));
55617
55632
  }
55618
55633
  } else {
55619
55634
  if (_this.isMatchPattern) {
55620
55635
  if (_this.isRegExp) {
55621
55636
  try {
55622
- return (_b = (_a3 = _this["entire"]) === null || _a3 === void 0 ? void 0 : _a3["test"]) === null || _b === void 0 ? void 0 : _b.call(_a3, path6.entire);
55637
+ return (_b = (_a3 = _this["entire"]) === null || _a3 === void 0 ? void 0 : _a3["test"]) === null || _b === void 0 ? void 0 : _b.call(_a3, path7.entire);
55623
55638
  } finally {
55624
55639
  ;
55625
55640
  _this.entire.lastIndex = 0;
@@ -55628,14 +55643,14 @@ var Path = (
55628
55643
  var record = {
55629
55644
  score: 0
55630
55645
  };
55631
- var result = cacheWith(new Matcher(_this.tree, record).match(path6.segments));
55646
+ var result = cacheWith(new Matcher(_this.tree, record).match(path7.segments));
55632
55647
  _this.matchScore = record.score;
55633
55648
  return result.matched;
55634
55649
  } else {
55635
55650
  var record = {
55636
55651
  score: 0
55637
55652
  };
55638
- var result = cacheWith(Matcher.matchSegments(_this.segments, path6.segments, record));
55653
+ var result = cacheWith(Matcher.matchSegments(_this.segments, path7.segments, record));
55639
55654
  _this.matchScore = record.score;
55640
55655
  return result.matched;
55641
55656
  }
@@ -55711,12 +55726,12 @@ var Path = (
55711
55726
  configurable: true
55712
55727
  });
55713
55728
  Path2.match = function(pattern) {
55714
- var path6 = Path2.parse(pattern);
55729
+ var path7 = Path2.parse(pattern);
55715
55730
  var matcher = function(target) {
55716
- return path6.match(target);
55731
+ return path7.match(target);
55717
55732
  };
55718
55733
  matcher[isMatcher] = true;
55719
- matcher.path = path6;
55734
+ matcher.path = path7;
55720
55735
  return matcher;
55721
55736
  };
55722
55737
  Path2.isPathPattern = function(target) {
@@ -55725,52 +55740,52 @@ var Path = (
55725
55740
  Path2.transform = function(pattern, regexp, callback) {
55726
55741
  return Path2.parse(pattern).transform(regexp, callback);
55727
55742
  };
55728
- Path2.parse = function(path6, base) {
55729
- if (path6 === void 0) {
55730
- path6 = "";
55743
+ Path2.parse = function(path7, base) {
55744
+ if (path7 === void 0) {
55745
+ path7 = "";
55731
55746
  }
55732
- if (path6 instanceof Path2) {
55733
- var found = pathCache.get(path6.entire);
55747
+ if (path7 instanceof Path2) {
55748
+ var found = pathCache.get(path7.entire);
55734
55749
  if (found) {
55735
55750
  return found;
55736
55751
  } else {
55737
- pathCache.set(path6.entire, path6);
55738
- return path6;
55752
+ pathCache.set(path7.entire, path7);
55753
+ return path7;
55739
55754
  }
55740
- } else if (path6 && path6[isMatcher]) {
55741
- return Path2.parse(path6["path"]);
55755
+ } else if (path7 && path7[isMatcher]) {
55756
+ return Path2.parse(path7["path"]);
55742
55757
  } else {
55743
55758
  var key_ = base ? Path2.parse(base) : "";
55744
- var key = "".concat(path6, ":").concat(key_);
55759
+ var key = "".concat(path7, ":").concat(key_);
55745
55760
  var found = pathCache.get(key);
55746
55761
  if (found) {
55747
55762
  return found;
55748
55763
  } else {
55749
- path6 = new Path2(path6, base);
55750
- pathCache.set(key, path6);
55751
- return path6;
55764
+ path7 = new Path2(path7, base);
55765
+ pathCache.set(key, path7);
55766
+ return path7;
55752
55767
  }
55753
55768
  }
55754
55769
  };
55755
55770
  Path2.getIn = function(source, pattern) {
55756
- var path6 = Path2.parse(pattern);
55757
- return path6.getIn(source);
55771
+ var path7 = Path2.parse(pattern);
55772
+ return path7.getIn(source);
55758
55773
  };
55759
55774
  Path2.setIn = function(source, pattern, value) {
55760
- var path6 = Path2.parse(pattern);
55761
- return path6.setIn(source, value);
55775
+ var path7 = Path2.parse(pattern);
55776
+ return path7.setIn(source, value);
55762
55777
  };
55763
55778
  Path2.deleteIn = function(source, pattern) {
55764
- var path6 = Path2.parse(pattern);
55765
- return path6.deleteIn(source);
55779
+ var path7 = Path2.parse(pattern);
55780
+ return path7.deleteIn(source);
55766
55781
  };
55767
55782
  Path2.existIn = function(source, pattern, start) {
55768
- var path6 = Path2.parse(pattern);
55769
- return path6.existIn(source, start);
55783
+ var path7 = Path2.parse(pattern);
55784
+ return path7.existIn(source, start);
55770
55785
  };
55771
55786
  Path2.ensureIn = function(source, pattern, defaultValue) {
55772
- var path6 = Path2.parse(pattern);
55773
- return path6.ensureIn(source, defaultValue);
55787
+ var path7 = Path2.parse(pattern);
55788
+ return path7.ensureIn(source, defaultValue);
55774
55789
  };
55775
55790
  return Path2;
55776
55791
  }()
@@ -57589,9 +57604,9 @@ var hasOwnProperty4 = Object.prototype.hasOwnProperty;
57589
57604
  var traverse = function(target, visitor) {
57590
57605
  var seenObjects = [];
57591
57606
  var root = target;
57592
- var traverse2 = function(target2, path6) {
57593
- if (path6 === void 0) {
57594
- path6 = [];
57607
+ var traverse2 = function(target2, path7) {
57608
+ if (path7 === void 0) {
57609
+ path7 = [];
57595
57610
  }
57596
57611
  if (isPlainObj(target2)) {
57597
57612
  var seenIndex = seenObjects.indexOf(target2);
@@ -57601,15 +57616,15 @@ var traverse = function(target, visitor) {
57601
57616
  var addIndex = seenObjects.length;
57602
57617
  seenObjects.push(target2);
57603
57618
  if (isNoNeedCompileObject(target2) && root !== target2) {
57604
- visitor(target2, path6);
57619
+ visitor(target2, path7);
57605
57620
  return;
57606
57621
  }
57607
57622
  each(target2, function(value, key) {
57608
- traverse2(value, path6.concat(key));
57623
+ traverse2(value, path7.concat(key));
57609
57624
  });
57610
57625
  seenObjects.splice(addIndex, 1);
57611
57626
  } else {
57612
- visitor(target2, path6);
57627
+ visitor(target2, path7);
57613
57628
  }
57614
57629
  };
57615
57630
  traverse2(target);
@@ -57620,24 +57635,24 @@ var traverseSchema = function(schema, visitor) {
57620
57635
  }
57621
57636
  var seenObjects = [];
57622
57637
  var root = schema;
57623
- var traverse2 = function(target, path6) {
57638
+ var traverse2 = function(target, path7) {
57624
57639
  var _a2;
57625
- if (path6 === void 0) {
57626
- path6 = [];
57640
+ if (path7 === void 0) {
57641
+ path7 = [];
57627
57642
  }
57628
- if (path6[0] === "x-compile-omitted" || path6[0] === "x-validator" || path6[0] === "version" || path6[0] === "_isJSONSchemaObject")
57643
+ if (path7[0] === "x-compile-omitted" || path7[0] === "x-validator" || path7[0] === "version" || path7[0] === "_isJSONSchemaObject")
57629
57644
  return;
57630
- if (String(path6[0]).indexOf("x-") == -1 && isFn(target))
57645
+ if (String(path7[0]).indexOf("x-") == -1 && isFn(target))
57631
57646
  return;
57632
- if (SchemaNestedMap[path6[0]])
57647
+ if (SchemaNestedMap[path7[0]])
57633
57648
  return;
57634
- if (((_a2 = schema["x-compile-omitted"]) === null || _a2 === void 0 ? void 0 : _a2.indexOf(path6[0])) > -1) {
57635
- visitor(target, path6, true);
57649
+ if (((_a2 = schema["x-compile-omitted"]) === null || _a2 === void 0 ? void 0 : _a2.indexOf(path7[0])) > -1) {
57650
+ visitor(target, path7, true);
57636
57651
  return;
57637
57652
  }
57638
57653
  if (isPlainObj(target)) {
57639
- if (path6[0] === "default" || path6[0] === "x-value") {
57640
- visitor(target, path6);
57654
+ if (path7[0] === "default" || path7[0] === "x-value") {
57655
+ visitor(target, path7);
57641
57656
  return;
57642
57657
  }
57643
57658
  var seenIndex = seenObjects.indexOf(target);
@@ -57647,15 +57662,15 @@ var traverseSchema = function(schema, visitor) {
57647
57662
  var addIndex = seenObjects.length;
57648
57663
  seenObjects.push(target);
57649
57664
  if (isNoNeedCompileObject(target) && root !== target) {
57650
- visitor(target, path6);
57665
+ visitor(target, path7);
57651
57666
  return;
57652
57667
  }
57653
57668
  each(target, function(value, key) {
57654
- traverse2(value, path6.concat(key));
57669
+ traverse2(value, path7.concat(key));
57655
57670
  });
57656
57671
  seenObjects.splice(addIndex, 1);
57657
57672
  } else {
57658
- visitor(target, path6);
57673
+ visitor(target, path7);
57659
57674
  }
57660
57675
  };
57661
57676
  traverse2(schema);
@@ -57699,8 +57714,8 @@ var createDataSource = function(source) {
57699
57714
  var patchStateFormSchema = function(targetState, pattern, compiled) {
57700
57715
  untracked(function() {
57701
57716
  var _a2;
57702
- var path6 = Path.parse(pattern);
57703
- var segments = path6.segments;
57717
+ var path7 = Path.parse(pattern);
57718
+ var segments = path7.segments;
57704
57719
  var key = segments[0];
57705
57720
  var isEnum = key === "enum" && isArr(compiled);
57706
57721
  var schemaMapKey = SchemaStateMap[key];
@@ -57784,14 +57799,14 @@ var compile = function(source, scope) {
57784
57799
  };
57785
57800
  var patchCompile = function(targetState, sourceState, scope) {
57786
57801
  traverse(sourceState, function(value, pattern) {
57787
- var path6 = Path.parse(pattern);
57802
+ var path7 = Path.parse(pattern);
57788
57803
  var compiled = compile(value, scope);
57789
- var key = path6.segments[0];
57804
+ var key = path7.segments[0];
57790
57805
  if (compiled === void 0)
57791
57806
  return;
57792
57807
  if (hasOwnProperty4.call(targetState, key)) {
57793
57808
  untracked(function() {
57794
- return Path.setIn(targetState, path6, compiled);
57809
+ return Path.setIn(targetState, path7, compiled);
57795
57810
  });
57796
57811
  }
57797
57812
  });
@@ -57800,7 +57815,7 @@ var patchSchemaCompile = function(targetState, sourceSchema, scope, demand) {
57800
57815
  if (demand === void 0) {
57801
57816
  demand = false;
57802
57817
  }
57803
- traverseSchema(sourceSchema, function(value, path6, omitCompile) {
57818
+ traverseSchema(sourceSchema, function(value, path7, omitCompile) {
57804
57819
  var compiled = value;
57805
57820
  var collected = hasCollected(function() {
57806
57821
  if (!omitCompile) {
@@ -57811,10 +57826,10 @@ var patchSchemaCompile = function(targetState, sourceSchema, scope, demand) {
57811
57826
  return;
57812
57827
  if (demand) {
57813
57828
  if (collected || !targetState.initialized) {
57814
- patchStateFormSchema(targetState, path6, compiled);
57829
+ patchStateFormSchema(targetState, path7, compiled);
57815
57830
  }
57816
57831
  } else {
57817
- patchStateFormSchema(targetState, path6, compiled);
57832
+ patchStateFormSchema(targetState, path7, compiled);
57818
57833
  }
57819
57834
  });
57820
57835
  };
@@ -58098,14 +58113,14 @@ var getISOCode = function(language) {
58098
58113
  });
58099
58114
  return isoCode;
58100
58115
  };
58101
- var getLocaleByPath = function(path6, lang) {
58116
+ var getLocaleByPath = function(path7, lang) {
58102
58117
  if (lang === void 0) {
58103
58118
  lang = registry.locales.language;
58104
58119
  }
58105
- return getIn2(registry.locales.messages, "".concat(getISOCode(lang), ".").concat(path6));
58120
+ return getIn2(registry.locales.messages, "".concat(getISOCode(lang), ".").concat(path7));
58106
58121
  };
58107
- var getValidateLocale = function(path6) {
58108
- var message = getLocaleByPath(path6);
58122
+ var getValidateLocale = function(path7) {
58123
+ var message = getLocaleByPath(path7);
58109
58124
  return message || getLocaleByPath("pattern") || getLocaleByPath("pattern", defaultLanguage);
58110
58125
  };
58111
58126
  var getValidateMessageTemplateEngine = function() {
@@ -59366,15 +59381,15 @@ var buildFieldPath = function(field) {
59366
59381
  var buildDataPath = function(fields, pattern) {
59367
59382
  var prevArray = false;
59368
59383
  var segments = pattern.segments;
59369
- var path6 = segments.reduce(function(path7, key, index) {
59370
- var currentPath = path7.concat(key);
59384
+ var path7 = segments.reduce(function(path8, key, index) {
59385
+ var currentPath = path8.concat(key);
59371
59386
  var currentAddress = segments.slice(0, index + 1);
59372
59387
  var current = fields[currentAddress.join(".")];
59373
59388
  if (prevArray) {
59374
59389
  if (!isVoidField(current)) {
59375
59390
  prevArray = false;
59376
59391
  }
59377
- return path7;
59392
+ return path8;
59378
59393
  }
59379
59394
  if (index >= segments.length - 1) {
59380
59395
  return currentPath;
@@ -59386,13 +59401,13 @@ var buildDataPath = function(fields, pattern) {
59386
59401
  prevArray = true;
59387
59402
  return currentPath;
59388
59403
  }
59389
- return path7;
59404
+ return path8;
59390
59405
  } else {
59391
59406
  prevArray = false;
59392
59407
  }
59393
59408
  return currentPath;
59394
59409
  }, []);
59395
- return new Path(path6);
59410
+ return new Path(path7);
59396
59411
  };
59397
59412
  var locateNode = function(field, address) {
59398
59413
  field.address = Path.parse(address);
@@ -59426,33 +59441,33 @@ var destroy = function(target, address, forceClear) {
59426
59441
  field === null || field === void 0 ? void 0 : field.dispose();
59427
59442
  if (isDataField(field) && forceClear) {
59428
59443
  var form = field.form;
59429
- var path6 = field.path;
59430
- form.deleteValuesIn(path6);
59431
- form.deleteInitialValuesIn(path6);
59444
+ var path7 = field.path;
59445
+ form.deleteValuesIn(path7);
59446
+ form.deleteInitialValuesIn(path7);
59432
59447
  }
59433
59448
  delete target[address];
59434
59449
  };
59435
- var patchFormValues = function(form, path6, source) {
59436
- var update = function(path7, source2) {
59437
- if (path7.length) {
59438
- form.setValuesIn(path7, clone(source2));
59450
+ var patchFormValues = function(form, path7, source) {
59451
+ var update = function(path8, source2) {
59452
+ if (path8.length) {
59453
+ form.setValuesIn(path8, clone(source2));
59439
59454
  } else {
59440
59455
  Object.assign(form.values, clone(source2));
59441
59456
  }
59442
59457
  };
59443
- var patch = function(source2, path7) {
59444
- if (path7 === void 0) {
59445
- path7 = [];
59458
+ var patch = function(source2, path8) {
59459
+ if (path8 === void 0) {
59460
+ path8 = [];
59446
59461
  }
59447
- var targetValue = form.getValuesIn(path7);
59448
- var targetField = form.query(path7).take();
59462
+ var targetValue = form.getValuesIn(path8);
59463
+ var targetField = form.query(path8).take();
59449
59464
  var isUnVoidField = targetField && !isVoidField(targetField);
59450
59465
  if (isUnVoidField && targetField.display === "none") {
59451
59466
  targetField.caches.value = clone(source2);
59452
59467
  return;
59453
59468
  }
59454
59469
  if (allowAssignDefaultValue(targetValue, source2)) {
59455
- update(path7, source2);
59470
+ update(path8, source2);
59456
59471
  } else {
59457
59472
  if (isEmpty(source2))
59458
59473
  return;
@@ -59460,20 +59475,20 @@ var patchFormValues = function(form, path6, source) {
59460
59475
  return;
59461
59476
  if (isPlainObj(targetValue) && isPlainObj(source2)) {
59462
59477
  each(source2, function(value, key) {
59463
- patch(value, path7.concat(key));
59478
+ patch(value, path8.concat(key));
59464
59479
  });
59465
59480
  } else {
59466
59481
  if (targetField) {
59467
59482
  if (isUnVoidField && !targetField.selfModified) {
59468
- update(path7, source2);
59483
+ update(path8, source2);
59469
59484
  }
59470
59485
  } else if (form.initialized) {
59471
- update(path7, source2);
59486
+ update(path8, source2);
59472
59487
  }
59473
59488
  }
59474
59489
  }
59475
59490
  };
59476
- patch(source, path6);
59491
+ patch(source, path7);
59477
59492
  };
59478
59493
  var matchFeedback = function(search, feedback) {
59479
59494
  if (!search || !feedback)
@@ -59896,13 +59911,13 @@ var createBatchStateSetter = function(form) {
59896
59911
  } else if (isGeneralField(pattern)) {
59897
59912
  pattern.setState(payload);
59898
59913
  } else {
59899
- var matchCount_1 = 0, path6 = Path.parse(pattern);
59900
- form.query(path6).forEach(function(field) {
59914
+ var matchCount_1 = 0, path7 = Path.parse(pattern);
59915
+ form.query(path7).forEach(function(field) {
59901
59916
  field.setState(payload);
59902
59917
  matchCount_1++;
59903
59918
  });
59904
- if (matchCount_1 === 0 || path6.isWildMatchPattern) {
59905
- subscribeUpdate(form, path6, payload);
59919
+ if (matchCount_1 === 0 || path7.isWildMatchPattern) {
59920
+ subscribeUpdate(form, path7, payload);
59906
59921
  }
59907
59922
  }
59908
59923
  });
@@ -62518,8 +62533,8 @@ var FieldEffects = {
62518
62533
  };
62519
62534
  var DefaultFieldEffects = ["onFieldInit", "onFieldValueChange"];
62520
62535
  var getDependencyValue = function(field, pattern, property) {
62521
- var _a2 = __read7(String(pattern).split(/\s*#\s*/), 2), target = _a2[0], path6 = _a2[1];
62522
- return field.query(target).getIn(path6 || property || "value");
62536
+ var _a2 = __read7(String(pattern).split(/\s*#\s*/), 2), target = _a2[0], path7 = _a2[1];
62537
+ return field.query(target).getIn(path7 || property || "value");
62523
62538
  };
62524
62539
  var getDependencies = function(field, dependencies) {
62525
62540
  if (isArr(dependencies)) {
@@ -63535,7 +63550,7 @@ function transformInquirerSchema(questions, configValue = {}, validateMap = {},
63535
63550
  }
63536
63551
 
63537
63552
  // ../../../../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
63538
- var import_path5 = __toESM(require("path"));
63553
+ var import_path6 = __toESM(require("path"));
63539
63554
  var import_utils16 = require("@modern-js/utils");
63540
63555
  var NODE_MAJOR_VERSION_MAP = {
63541
63556
  "lts/*": 18,
@@ -63558,10 +63573,10 @@ async function checkUseNvm(cwd, logger2) {
63558
63573
  if (process.platform.startsWith("win")) {
63559
63574
  return false;
63560
63575
  }
63561
- if (!await fsExists(import_path5.default.join(cwd, ".nvmrc"))) {
63576
+ if (!await fsExists(import_path6.default.join(cwd, ".nvmrc"))) {
63562
63577
  return false;
63563
63578
  }
63564
- const nvmrcContent = (await import_utils16.fs.readFile(import_path5.default.join(cwd, ".nvmrc"), "utf-8")).replace("\n", "");
63579
+ const nvmrcContent = (await import_utils16.fs.readFile(import_path6.default.join(cwd, ".nvmrc"), "utf-8")).replace("\n", "");
63565
63580
  const expectNodeVersion = NODE_MAJOR_VERSION_MAP[nvmrcContent] || nvmrcContent;
63566
63581
  const currentNodeVersion = await getNoteVersion();
63567
63582
  if (expectNodeVersion === import_utils16.semver.major(currentNodeVersion)) {
@@ -63885,22 +63900,14 @@ var JsonAPI = class {
63885
63900
  };
63886
63901
 
63887
63902
  // src/index.ts
63888
- var getGeneratorPath = (generator, distTag) => {
63889
- if (process.env.CODESMITH_ENV === "development") {
63890
- return import_path6.default.dirname(require.resolve(generator));
63891
- } else if (distTag) {
63892
- return `${generator}@${distTag}`;
63893
- }
63894
- return generator;
63895
- };
63896
63903
  function isEmptyServerDir(serverDir) {
63897
63904
  const files = import_utils4.fs.readdirSync(serverDir);
63898
63905
  if (files.length === 0) {
63899
63906
  return true;
63900
63907
  }
63901
63908
  return files.every((file) => {
63902
- if (import_utils4.fs.statSync(import_path6.default.join(serverDir, file)).isDirectory()) {
63903
- const childFiles = import_utils4.fs.readdirSync(import_path6.default.join(serverDir, file));
63909
+ if (import_utils4.fs.statSync(import_path7.default.join(serverDir, file)).isDirectory()) {
63910
+ const childFiles = import_utils4.fs.readdirSync(import_path7.default.join(serverDir, file));
63904
63911
  return childFiles.length === 0;
63905
63912
  }
63906
63913
  return false;
@@ -63909,7 +63916,7 @@ function isEmptyServerDir(serverDir) {
63909
63916
  var handleTemplateFile = async (context, generator, appApi) => {
63910
63917
  const jsonAPI = new JsonAPI(generator);
63911
63918
  const appDir = context.materials.default.basePath;
63912
- const serverDir = import_path6.default.join(appDir, "server");
63919
+ const serverDir = import_path7.default.join(appDir, "server");
63913
63920
  if (import_utils4.fs.existsSync(serverDir) && !isEmptyServerDir(serverDir)) {
63914
63921
  const files = import_utils4.fs.readdirSync("server");
63915
63922
  if (files.length > 0) {
@@ -63920,7 +63927,7 @@ var handleTemplateFile = async (context, generator, appApi) => {
63920
63927
  const language = isTsProject(appDir) ? Language.TS : Language.JS;
63921
63928
  const serverPlugin = "@modern-js/plugin-server";
63922
63929
  await appApi.runSubGenerator(
63923
- getGeneratorPath(DependenceGenerator, context.config.distTag),
63930
+ getGeneratorPath(DependenceGenerator, context.config.distTag, [__dirname]),
63924
63931
  void 0,
63925
63932
  {
63926
63933
  ...context.config,
@@ -63946,10 +63953,10 @@ var handleTemplateFile = async (context, generator, appApi) => {
63946
63953
  (resourceKey) => resourceKey.replace(`templates/base-template/${language}/`, "").replace(".handlebars", "")
63947
63954
  );
63948
63955
  if (language === Language.TS) {
63949
- const tsconfigJSON = (0, import_utils4.readTsConfigByFile)(import_path6.default.join(appDir, "tsconfig.json"));
63956
+ const tsconfigJSON = (0, import_utils4.readTsConfigByFile)(import_path7.default.join(appDir, "tsconfig.json"));
63950
63957
  if (!(tsconfigJSON.include || []).includes("server")) {
63951
63958
  await jsonAPI.update(
63952
- context.materials.default.get(import_path6.default.join(appDir, "tsconfig.json")),
63959
+ context.materials.default.get(import_path7.default.join(appDir, "tsconfig.json")),
63953
63960
  {
63954
63961
  query: {},
63955
63962
  update: {