@modern-js/server-generator 3.3.10 → 3.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +319 -325
- package/package.json +7 -7
- 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(
|
|
9108
|
-
return /^\.|this\b/.test(
|
|
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(
|
|
9113
|
-
return
|
|
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(
|
|
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:
|
|
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),
|
|
10473
|
+
var params = this.setupFullMustacheParams(decorator, program, void 0), path7 = decorator.path;
|
|
10474
10474
|
this.useDecorators = true;
|
|
10475
|
-
this.opcode("registerDecorator", params.length,
|
|
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
|
|
10540
|
-
this.opcode("getContext",
|
|
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
|
-
|
|
10544
|
-
this.accept(
|
|
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
|
|
10549
|
-
|
|
10550
|
-
this.accept(
|
|
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),
|
|
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
|
-
|
|
10561
|
-
|
|
10562
|
-
this.accept(
|
|
10563
|
-
this.opcode("invokeHelper", params.length,
|
|
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(
|
|
10567
|
-
this.addDepth(
|
|
10568
|
-
this.opcode("getContext",
|
|
10569
|
-
var 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,
|
|
10571
|
+
this.opcode("lookupBlockParam", blockParamId, path7.parts);
|
|
10572
10572
|
} else if (!name) {
|
|
10573
10573
|
this.opcode("pushContext");
|
|
10574
|
-
} else if (
|
|
10574
|
+
} else if (path7.data) {
|
|
10575
10575
|
this.options.data = true;
|
|
10576
|
-
this.opcode("lookupData",
|
|
10576
|
+
this.opcode("lookupData", path7.depth, path7.parts, path7.strict);
|
|
10577
10577
|
} else {
|
|
10578
|
-
this.opcode("lookupOnContext",
|
|
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
|
|
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
|
-
|
|
10938
|
+
path7 = url.path;
|
|
10939
10939
|
}
|
|
10940
|
-
var isAbsolute = exports.isAbsolute(
|
|
10941
|
-
var parts =
|
|
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
|
-
|
|
10959
|
-
if (
|
|
10960
|
-
|
|
10958
|
+
path7 = parts.join("/");
|
|
10959
|
+
if (path7 === "") {
|
|
10960
|
+
path7 = isAbsolute ? "/" : ".";
|
|
10961
10961
|
}
|
|
10962
10962
|
if (url) {
|
|
10963
|
-
url.path =
|
|
10963
|
+
url.path = path7;
|
|
10964
10964
|
return urlGenerate(url);
|
|
10965
10965
|
}
|
|
10966
|
-
return
|
|
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
|
|
13757
|
-
return (id.data ? "@" : "") + "PATH:" +
|
|
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
|
|
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 =
|
|
14018
|
-
var extname =
|
|
14019
|
-
var 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(
|
|
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(
|
|
14040
|
+
var match = /^[A-Za-z]+:\\|^\//.exec(path8);
|
|
14041
14041
|
if (match && match.length) {
|
|
14042
|
-
|
|
14042
|
+
path8 = path8.replace(/^\/*/, "");
|
|
14043
14043
|
if (Array.isArray(options.root)) {
|
|
14044
|
-
includePath = resolvePaths(
|
|
14044
|
+
includePath = resolvePaths(path8, options.root);
|
|
14045
14045
|
} else {
|
|
14046
|
-
includePath = exports.resolveInclude(
|
|
14046
|
+
includePath = exports.resolveInclude(path8, options.root || "/", true);
|
|
14047
14047
|
}
|
|
14048
14048
|
} else {
|
|
14049
14049
|
if (options.filename) {
|
|
14050
|
-
filePath = exports.resolveInclude(
|
|
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(
|
|
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(
|
|
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(
|
|
14118
|
+
function includeFile(path8, options) {
|
|
14119
14119
|
var opts = utils.shallowCopy(utils.createNullProtoObjWherePossible(), options);
|
|
14120
|
-
opts.filename = getIncludePath(
|
|
14120
|
+
opts.filename = getIncludePath(path8, opts);
|
|
14121
14121
|
if (typeof options.includer === "function") {
|
|
14122
|
-
var includerResult = options.includer(
|
|
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(
|
|
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(
|
|
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 =
|
|
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,
|
|
17352
|
-
|
|
17353
|
-
var index = 0, 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(
|
|
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,
|
|
17369
|
-
var result = object == null ? void 0 : baseGet(object,
|
|
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,
|
|
17456
|
+
function baseSet(object, path7, value, customizer) {
|
|
17457
17457
|
if (!isObject4(object)) {
|
|
17458
17458
|
return object;
|
|
17459
17459
|
}
|
|
17460
|
-
|
|
17461
|
-
var index = -1, length =
|
|
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(
|
|
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(
|
|
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,
|
|
17489
|
-
return object == null ? object : baseSet(object,
|
|
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,
|
|
30111
|
-
|
|
30112
|
-
var index = -1, length =
|
|
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(
|
|
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,
|
|
30137
|
-
return object != null && hasPath(object,
|
|
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(
|
|
30157
|
-
if (isKey(
|
|
30158
|
-
return matchesStrictComparable(toKey(
|
|
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,
|
|
30162
|
-
return objValue === void 0 && objValue === srcValue ? hasIn(object,
|
|
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(
|
|
30187
|
+
function basePropertyDeep(path7) {
|
|
30188
30188
|
return function(object) {
|
|
30189
|
-
return baseGet(object,
|
|
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(
|
|
30205
|
-
return isKey(
|
|
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
|
|
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
|
-
|
|
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 =
|
|
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
|
|
47558
|
+
var path7;
|
|
47559
47559
|
if (isWindows) {
|
|
47560
|
-
|
|
47560
|
+
path7 = process.env.TEMP || process.env.TMP || (process.env.SystemRoot || process.env.windir) + "\\temp";
|
|
47561
47561
|
} else {
|
|
47562
|
-
|
|
47562
|
+
path7 = process.env.TMPDIR || process.env.TMP || process.env.TEMP || "/tmp";
|
|
47563
47563
|
}
|
|
47564
|
-
if (trailingSlashRe.test(
|
|
47565
|
-
|
|
47564
|
+
if (trailingSlashRe.test(path7)) {
|
|
47565
|
+
path7 = path7.slice(0, -1);
|
|
47566
47566
|
}
|
|
47567
|
-
return
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
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,
|
|
48477
|
-
return
|
|
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,
|
|
48492
|
-
|
|
48493
|
-
object = parent(object,
|
|
48494
|
-
return object == null || delete object[toKey(last(
|
|
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(
|
|
48604
|
-
|
|
48605
|
-
isDeep || (isDeep =
|
|
48606
|
-
return
|
|
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,
|
|
52072
|
-
if (
|
|
52073
|
-
var par = parent(obj,
|
|
52074
|
-
var mainKey =
|
|
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[
|
|
52079
|
+
return obj[path7];
|
|
52080
52080
|
}
|
|
52081
52081
|
};
|
|
52082
52082
|
exports.get = get3;
|
|
52083
|
-
var set = function(obj,
|
|
52084
|
-
if (
|
|
52085
|
-
var par = parent(obj,
|
|
52086
|
-
var mainKey =
|
|
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[
|
|
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,
|
|
52173
|
-
var key =
|
|
52174
|
-
obj = mongoDot.parent(obj,
|
|
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,
|
|
52202
|
-
var key =
|
|
52203
|
-
obj = mongoDot.parent(obj,
|
|
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,
|
|
52218
|
-
if (
|
|
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 ===
|
|
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,
|
|
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 =
|
|
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,
|
|
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,
|
|
52253
|
-
var key =
|
|
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,
|
|
52280
|
-
obj = mongoDot.parent(obj,
|
|
52281
|
-
var key =
|
|
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,
|
|
52315
|
-
obj = mongoDot.parent(obj,
|
|
52316
|
-
var key =
|
|
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,
|
|
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,
|
|
52362
|
-
var key =
|
|
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,
|
|
52404
|
-
obj = mongoDot.parent(obj,
|
|
52405
|
-
var key =
|
|
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,
|
|
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,
|
|
52454
|
-
var key =
|
|
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,
|
|
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,
|
|
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,
|
|
52518
|
-
var key =
|
|
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,21 +52656,12 @@ __export(src_exports, {
|
|
|
52656
52656
|
default: () => src_default
|
|
52657
52657
|
});
|
|
52658
52658
|
module.exports = __toCommonJS(src_exports);
|
|
52659
|
-
var
|
|
52659
|
+
var import_path7 = __toESM(require("path"));
|
|
52660
52660
|
|
|
52661
52661
|
// ../../generator-utils/dist/esm/index.js
|
|
52662
|
-
var
|
|
52662
|
+
var import_path2 = __toESM(require("path"));
|
|
52663
52663
|
var import_utils3 = require("@modern-js/utils");
|
|
52664
52664
|
|
|
52665
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_define_property.js
|
|
52666
|
-
function _define_property(obj, key, value) {
|
|
52667
|
-
if (key in obj) {
|
|
52668
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
52669
|
-
} else
|
|
52670
|
-
obj[key] = value;
|
|
52671
|
-
return obj;
|
|
52672
|
-
}
|
|
52673
|
-
|
|
52674
52665
|
// ../../../cli/plugin-i18n/dist/esm-node/index.js
|
|
52675
52666
|
var import_lodash2 = require("@modern-js/utils/lodash");
|
|
52676
52667
|
|
|
@@ -52729,8 +52720,8 @@ var I18n = class {
|
|
|
52729
52720
|
};
|
|
52730
52721
|
}
|
|
52731
52722
|
constructor() {
|
|
52732
|
-
|
|
52733
|
-
|
|
52723
|
+
this.language = "en";
|
|
52724
|
+
this.languageMap = {};
|
|
52734
52725
|
}
|
|
52735
52726
|
};
|
|
52736
52727
|
|
|
@@ -52763,10 +52754,8 @@ var ZH_LOCALE = {
|
|
|
52763
52754
|
i18n: "启用「国际化(i18n)」功能",
|
|
52764
52755
|
test: "启用「单元测试 / 集成测试」功能",
|
|
52765
52756
|
e2e_test: "启用「E2E 测试」功能",
|
|
52766
|
-
storybook: "启用「Storybook」",
|
|
52767
52757
|
storybookV7: "启用「Storybook」V7",
|
|
52768
52758
|
runtime_api: "启用「Runtime API」",
|
|
52769
|
-
mwa_storybook: "启用「Visual Testing (Storybook)」模式",
|
|
52770
52759
|
ssg: "启用「SSG」功能",
|
|
52771
52760
|
polyfill: "启用「基于 UA 的 Polyfill」功能",
|
|
52772
52761
|
proxy: "启用「全局代理」",
|
|
@@ -52861,10 +52850,8 @@ var EN_LOCALE = {
|
|
|
52861
52850
|
i18n: "Enable Internationalization (i18n)",
|
|
52862
52851
|
test: "Enable Unit Test / Integration Test",
|
|
52863
52852
|
e2e_test: "Enable E2E Test",
|
|
52864
|
-
storybook: "Enable Storybook",
|
|
52865
52853
|
storybookV7: "Enable Storybook V7",
|
|
52866
52854
|
runtime_api: "Enable Runtime API",
|
|
52867
|
-
mwa_storybook: "Enable Visual Testing (Storybook)",
|
|
52868
52855
|
ssg: "Enable SSG",
|
|
52869
52856
|
polyfill: "Enable UA-based Polyfill Feature",
|
|
52870
52857
|
proxy: "Enable Global Proxy",
|
|
@@ -53053,6 +53040,21 @@ async function getAvailableVersion(packageName, currentVersion, registry2) {
|
|
|
53053
53040
|
return currentVersion;
|
|
53054
53041
|
}
|
|
53055
53042
|
|
|
53043
|
+
// ../../generator-utils/dist/esm/utils/getGeneratorPath.js
|
|
53044
|
+
var import_path = __toESM(require("path"));
|
|
53045
|
+
var getGeneratorPath = (generator, distTag, paths) => {
|
|
53046
|
+
if (process.env.CODESMITH_ENV === "development") {
|
|
53047
|
+
return import_path.default.dirname(require.resolve(generator, {
|
|
53048
|
+
paths: paths !== null && paths !== void 0 ? paths : [
|
|
53049
|
+
process.cwd()
|
|
53050
|
+
]
|
|
53051
|
+
}));
|
|
53052
|
+
} else if (distTag) {
|
|
53053
|
+
return `${generator}@${distTag}`;
|
|
53054
|
+
}
|
|
53055
|
+
return generator;
|
|
53056
|
+
};
|
|
53057
|
+
|
|
53056
53058
|
// ../../generator-utils/dist/esm/index.js
|
|
53057
53059
|
var import_utils4 = require("@modern-js/utils");
|
|
53058
53060
|
async function getPackageVersion(packageName, registry2) {
|
|
@@ -53100,13 +53102,13 @@ async function getModernPluginVersion(solution, packageName, options = {
|
|
|
53100
53102
|
if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
|
|
53101
53103
|
return getLatetPluginVersion("latest");
|
|
53102
53104
|
}
|
|
53103
|
-
let pkgPath =
|
|
53105
|
+
let pkgPath = import_path2.default.join(require.resolve(SolutionToolsMap[solution], {
|
|
53104
53106
|
paths: [
|
|
53105
53107
|
cwd
|
|
53106
53108
|
]
|
|
53107
53109
|
}), "../../..", "package.json");
|
|
53108
53110
|
if (solution === Solution.Module) {
|
|
53109
|
-
pkgPath =
|
|
53111
|
+
pkgPath = import_path2.default.join(require.resolve(SolutionToolsMap[solution], {
|
|
53110
53112
|
paths: [
|
|
53111
53113
|
cwd
|
|
53112
53114
|
]
|
|
@@ -53127,11 +53129,11 @@ async function getModernPluginVersion(solution, packageName, options = {
|
|
|
53127
53129
|
return getLatetPluginVersion();
|
|
53128
53130
|
}
|
|
53129
53131
|
function isTsProject(appDir) {
|
|
53130
|
-
return import_utils3.fs.existsSync(
|
|
53132
|
+
return import_utils3.fs.existsSync(import_path2.default.join(appDir, "tsconfig.json"));
|
|
53131
53133
|
}
|
|
53132
53134
|
|
|
53133
53135
|
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/esm/_define_property.js
|
|
53134
|
-
function
|
|
53136
|
+
function _define_property(obj, key, value) {
|
|
53135
53137
|
if (key in obj) {
|
|
53136
53138
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
53137
53139
|
} else
|
|
@@ -53314,7 +53316,7 @@ var NpmAPI = class {
|
|
|
53314
53316
|
});
|
|
53315
53317
|
}
|
|
53316
53318
|
constructor(generatorCore) {
|
|
53317
|
-
|
|
53319
|
+
_define_property(this, "generatorCore", void 0);
|
|
53318
53320
|
this.generatorCore = generatorCore;
|
|
53319
53321
|
}
|
|
53320
53322
|
};
|
|
@@ -53439,23 +53441,23 @@ var GitAPI = class {
|
|
|
53439
53441
|
}
|
|
53440
53442
|
}
|
|
53441
53443
|
constructor(generatorCore, generatorContext) {
|
|
53442
|
-
|
|
53443
|
-
|
|
53444
|
+
_define_property(this, "generatorCore", void 0);
|
|
53445
|
+
_define_property(this, "generatorContext", void 0);
|
|
53444
53446
|
this.generatorCore = generatorCore;
|
|
53445
53447
|
this.generatorContext = generatorContext;
|
|
53446
53448
|
}
|
|
53447
53449
|
};
|
|
53448
53450
|
|
|
53449
53451
|
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
|
|
53450
|
-
var
|
|
53452
|
+
var import_path3 = __toESM(require("path"));
|
|
53451
53453
|
var import_utils10 = require("@modern-js/utils");
|
|
53452
53454
|
var FS_RESOURCE = "_codesmith_core_fs_resource";
|
|
53453
53455
|
|
|
53454
53456
|
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
|
|
53455
53457
|
var import_utils11 = require("@modern-js/utils");
|
|
53456
|
-
async function fsExists(
|
|
53458
|
+
async function fsExists(path7) {
|
|
53457
53459
|
try {
|
|
53458
|
-
await import_utils11.fs.access(
|
|
53460
|
+
await import_utils11.fs.access(path7);
|
|
53459
53461
|
return true;
|
|
53460
53462
|
} catch (e) {
|
|
53461
53463
|
return false;
|
|
@@ -53516,8 +53518,8 @@ var HandlebarsAPI = class {
|
|
|
53516
53518
|
);
|
|
53517
53519
|
}
|
|
53518
53520
|
constructor(generatorCore, registers) {
|
|
53519
|
-
|
|
53520
|
-
|
|
53521
|
+
_define_property(this, "generatorCore", void 0);
|
|
53522
|
+
_define_property(this, "registers", void 0);
|
|
53521
53523
|
this.generatorCore = generatorCore;
|
|
53522
53524
|
this.registers = registers || {
|
|
53523
53525
|
helpers: {},
|
|
@@ -53560,21 +53562,21 @@ var EjsAPI = class {
|
|
|
53560
53562
|
);
|
|
53561
53563
|
}
|
|
53562
53564
|
constructor(generatorCore) {
|
|
53563
|
-
|
|
53565
|
+
_define_property(this, "generatorCore", void 0);
|
|
53564
53566
|
this.generatorCore = generatorCore;
|
|
53565
53567
|
}
|
|
53566
53568
|
};
|
|
53567
53569
|
|
|
53568
53570
|
// ../../../../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
|
|
53571
|
+
var import_path4 = __toESM(require("path"));
|
|
53570
53572
|
var import_utils14 = require("@modern-js/utils");
|
|
53571
53573
|
var FsAPI = class {
|
|
53572
53574
|
async renderFile(resource, target) {
|
|
53573
53575
|
if (resource._type !== FS_RESOURCE) {
|
|
53574
53576
|
throw new Error("resource not match");
|
|
53575
53577
|
}
|
|
53576
|
-
const filePath =
|
|
53577
|
-
await import_utils14.fs.mkdirp(
|
|
53578
|
+
const filePath = import_path4.default.resolve(this.generatorCore.outputPath, target.toString());
|
|
53579
|
+
await import_utils14.fs.mkdirp(import_path4.default.dirname(filePath));
|
|
53578
53580
|
await import_utils14.fs.copyFile(resource.filePath, filePath);
|
|
53579
53581
|
}
|
|
53580
53582
|
async renderDir(material, findGlob, target, options) {
|
|
@@ -53588,7 +53590,7 @@ var FsAPI = class {
|
|
|
53588
53590
|
}));
|
|
53589
53591
|
}
|
|
53590
53592
|
constructor(generatorCore) {
|
|
53591
|
-
|
|
53593
|
+
_define_property(this, "generatorCore", void 0);
|
|
53592
53594
|
this.generatorCore = generatorCore;
|
|
53593
53595
|
}
|
|
53594
53596
|
};
|
|
@@ -54618,8 +54620,8 @@ var parseDestructorRules = function(node) {
|
|
|
54618
54620
|
};
|
|
54619
54621
|
var setInByDestructor = function(source, rules, value, mutators) {
|
|
54620
54622
|
rules.forEach(function(_a2) {
|
|
54621
|
-
var key = _a2.key,
|
|
54622
|
-
mutators.setIn([key], source, mutators.getIn(
|
|
54623
|
+
var key = _a2.key, path7 = _a2.path;
|
|
54624
|
+
mutators.setIn([key], source, mutators.getIn(path7, value));
|
|
54623
54625
|
});
|
|
54624
54626
|
};
|
|
54625
54627
|
var getInByDestructor = function(source, rules, mutators) {
|
|
@@ -54631,8 +54633,8 @@ var getInByDestructor = function(source, rules, mutators) {
|
|
|
54631
54633
|
}
|
|
54632
54634
|
source = isValid2(source) ? source : {};
|
|
54633
54635
|
rules.forEach(function(_a2) {
|
|
54634
|
-
var key = _a2.key,
|
|
54635
|
-
mutators.setIn(
|
|
54636
|
+
var key = _a2.key, path7 = _a2.path;
|
|
54637
|
+
mutators.setIn(path7, response, source[key]);
|
|
54636
54638
|
});
|
|
54637
54639
|
return response;
|
|
54638
54640
|
};
|
|
@@ -55199,8 +55201,8 @@ var Matcher = (
|
|
|
55199
55201
|
}
|
|
55200
55202
|
return false;
|
|
55201
55203
|
};
|
|
55202
|
-
Matcher2.prototype.match = function(
|
|
55203
|
-
this.path =
|
|
55204
|
+
Matcher2.prototype.match = function(path7) {
|
|
55205
|
+
this.path = path7;
|
|
55204
55206
|
return { matched: this.matchNode(this.tree), record: this.record };
|
|
55205
55207
|
};
|
|
55206
55208
|
Matcher2.matchSegments = function(source, target, record) {
|
|
@@ -55490,21 +55492,21 @@ var Path = (
|
|
|
55490
55492
|
if (_this.isMatchPattern || _this.isRegExp) {
|
|
55491
55493
|
throw new Error("".concat(_this.entire, " cannot be concat"));
|
|
55492
55494
|
}
|
|
55493
|
-
var
|
|
55494
|
-
|
|
55495
|
+
var path7 = new Path2("");
|
|
55496
|
+
path7.segments = (_a3 = _this.segments).concat.apply(_a3, __spreadArray([], __read(args.map(function(s) {
|
|
55495
55497
|
return parseString(s);
|
|
55496
55498
|
})), false));
|
|
55497
|
-
|
|
55498
|
-
return
|
|
55499
|
+
path7.entire = path7.segments.join(".");
|
|
55500
|
+
return path7;
|
|
55499
55501
|
};
|
|
55500
55502
|
this.slice = function(start, end) {
|
|
55501
55503
|
if (_this.isMatchPattern || _this.isRegExp) {
|
|
55502
55504
|
throw new Error("".concat(_this.entire, " cannot be slice"));
|
|
55503
55505
|
}
|
|
55504
|
-
var
|
|
55505
|
-
|
|
55506
|
-
|
|
55507
|
-
return
|
|
55506
|
+
var path7 = new Path2("");
|
|
55507
|
+
path7.segments = _this.segments.slice(start, end);
|
|
55508
|
+
path7.entire = path7.segments.join(".");
|
|
55509
|
+
return path7;
|
|
55508
55510
|
};
|
|
55509
55511
|
this.push = function() {
|
|
55510
55512
|
var items = [];
|
|
@@ -55596,8 +55598,8 @@ var Path = (
|
|
|
55596
55598
|
};
|
|
55597
55599
|
this.match = function(pattern) {
|
|
55598
55600
|
var _a3, _b;
|
|
55599
|
-
var
|
|
55600
|
-
var cache = _this.matchCache.get(
|
|
55601
|
+
var path7 = Path2.parse(pattern);
|
|
55602
|
+
var cache = _this.matchCache.get(path7.entire);
|
|
55601
55603
|
if (cache !== void 0) {
|
|
55602
55604
|
if (cache.record && cache.record.score !== void 0) {
|
|
55603
55605
|
_this.matchScore = cache.record.score;
|
|
@@ -55605,21 +55607,21 @@ var Path = (
|
|
|
55605
55607
|
return cache.matched;
|
|
55606
55608
|
}
|
|
55607
55609
|
var cacheWith = function(value) {
|
|
55608
|
-
_this.matchCache.set(
|
|
55610
|
+
_this.matchCache.set(path7.entire, value);
|
|
55609
55611
|
return value;
|
|
55610
55612
|
};
|
|
55611
|
-
if (
|
|
55613
|
+
if (path7.isMatchPattern) {
|
|
55612
55614
|
if (_this.isMatchPattern) {
|
|
55613
|
-
throw new Error("".concat(
|
|
55615
|
+
throw new Error("".concat(path7.entire, " cannot match ").concat(_this.entire));
|
|
55614
55616
|
} else {
|
|
55615
55617
|
_this.matchScore = 0;
|
|
55616
|
-
return cacheWith(
|
|
55618
|
+
return cacheWith(path7.match(_this.segments));
|
|
55617
55619
|
}
|
|
55618
55620
|
} else {
|
|
55619
55621
|
if (_this.isMatchPattern) {
|
|
55620
55622
|
if (_this.isRegExp) {
|
|
55621
55623
|
try {
|
|
55622
|
-
return (_b = (_a3 = _this["entire"]) === null || _a3 === void 0 ? void 0 : _a3["test"]) === null || _b === void 0 ? void 0 : _b.call(_a3,
|
|
55624
|
+
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
55625
|
} finally {
|
|
55624
55626
|
;
|
|
55625
55627
|
_this.entire.lastIndex = 0;
|
|
@@ -55628,14 +55630,14 @@ var Path = (
|
|
|
55628
55630
|
var record = {
|
|
55629
55631
|
score: 0
|
|
55630
55632
|
};
|
|
55631
|
-
var result = cacheWith(new Matcher(_this.tree, record).match(
|
|
55633
|
+
var result = cacheWith(new Matcher(_this.tree, record).match(path7.segments));
|
|
55632
55634
|
_this.matchScore = record.score;
|
|
55633
55635
|
return result.matched;
|
|
55634
55636
|
} else {
|
|
55635
55637
|
var record = {
|
|
55636
55638
|
score: 0
|
|
55637
55639
|
};
|
|
55638
|
-
var result = cacheWith(Matcher.matchSegments(_this.segments,
|
|
55640
|
+
var result = cacheWith(Matcher.matchSegments(_this.segments, path7.segments, record));
|
|
55639
55641
|
_this.matchScore = record.score;
|
|
55640
55642
|
return result.matched;
|
|
55641
55643
|
}
|
|
@@ -55711,12 +55713,12 @@ var Path = (
|
|
|
55711
55713
|
configurable: true
|
|
55712
55714
|
});
|
|
55713
55715
|
Path2.match = function(pattern) {
|
|
55714
|
-
var
|
|
55716
|
+
var path7 = Path2.parse(pattern);
|
|
55715
55717
|
var matcher = function(target) {
|
|
55716
|
-
return
|
|
55718
|
+
return path7.match(target);
|
|
55717
55719
|
};
|
|
55718
55720
|
matcher[isMatcher] = true;
|
|
55719
|
-
matcher.path =
|
|
55721
|
+
matcher.path = path7;
|
|
55720
55722
|
return matcher;
|
|
55721
55723
|
};
|
|
55722
55724
|
Path2.isPathPattern = function(target) {
|
|
@@ -55725,52 +55727,52 @@ var Path = (
|
|
|
55725
55727
|
Path2.transform = function(pattern, regexp, callback) {
|
|
55726
55728
|
return Path2.parse(pattern).transform(regexp, callback);
|
|
55727
55729
|
};
|
|
55728
|
-
Path2.parse = function(
|
|
55729
|
-
if (
|
|
55730
|
-
|
|
55730
|
+
Path2.parse = function(path7, base) {
|
|
55731
|
+
if (path7 === void 0) {
|
|
55732
|
+
path7 = "";
|
|
55731
55733
|
}
|
|
55732
|
-
if (
|
|
55733
|
-
var found = pathCache.get(
|
|
55734
|
+
if (path7 instanceof Path2) {
|
|
55735
|
+
var found = pathCache.get(path7.entire);
|
|
55734
55736
|
if (found) {
|
|
55735
55737
|
return found;
|
|
55736
55738
|
} else {
|
|
55737
|
-
pathCache.set(
|
|
55738
|
-
return
|
|
55739
|
+
pathCache.set(path7.entire, path7);
|
|
55740
|
+
return path7;
|
|
55739
55741
|
}
|
|
55740
|
-
} else if (
|
|
55741
|
-
return Path2.parse(
|
|
55742
|
+
} else if (path7 && path7[isMatcher]) {
|
|
55743
|
+
return Path2.parse(path7["path"]);
|
|
55742
55744
|
} else {
|
|
55743
55745
|
var key_ = base ? Path2.parse(base) : "";
|
|
55744
|
-
var key = "".concat(
|
|
55746
|
+
var key = "".concat(path7, ":").concat(key_);
|
|
55745
55747
|
var found = pathCache.get(key);
|
|
55746
55748
|
if (found) {
|
|
55747
55749
|
return found;
|
|
55748
55750
|
} else {
|
|
55749
|
-
|
|
55750
|
-
pathCache.set(key,
|
|
55751
|
-
return
|
|
55751
|
+
path7 = new Path2(path7, base);
|
|
55752
|
+
pathCache.set(key, path7);
|
|
55753
|
+
return path7;
|
|
55752
55754
|
}
|
|
55753
55755
|
}
|
|
55754
55756
|
};
|
|
55755
55757
|
Path2.getIn = function(source, pattern) {
|
|
55756
|
-
var
|
|
55757
|
-
return
|
|
55758
|
+
var path7 = Path2.parse(pattern);
|
|
55759
|
+
return path7.getIn(source);
|
|
55758
55760
|
};
|
|
55759
55761
|
Path2.setIn = function(source, pattern, value) {
|
|
55760
|
-
var
|
|
55761
|
-
return
|
|
55762
|
+
var path7 = Path2.parse(pattern);
|
|
55763
|
+
return path7.setIn(source, value);
|
|
55762
55764
|
};
|
|
55763
55765
|
Path2.deleteIn = function(source, pattern) {
|
|
55764
|
-
var
|
|
55765
|
-
return
|
|
55766
|
+
var path7 = Path2.parse(pattern);
|
|
55767
|
+
return path7.deleteIn(source);
|
|
55766
55768
|
};
|
|
55767
55769
|
Path2.existIn = function(source, pattern, start) {
|
|
55768
|
-
var
|
|
55769
|
-
return
|
|
55770
|
+
var path7 = Path2.parse(pattern);
|
|
55771
|
+
return path7.existIn(source, start);
|
|
55770
55772
|
};
|
|
55771
55773
|
Path2.ensureIn = function(source, pattern, defaultValue) {
|
|
55772
|
-
var
|
|
55773
|
-
return
|
|
55774
|
+
var path7 = Path2.parse(pattern);
|
|
55775
|
+
return path7.ensureIn(source, defaultValue);
|
|
55774
55776
|
};
|
|
55775
55777
|
return Path2;
|
|
55776
55778
|
}()
|
|
@@ -57589,9 +57591,9 @@ var hasOwnProperty4 = Object.prototype.hasOwnProperty;
|
|
|
57589
57591
|
var traverse = function(target, visitor) {
|
|
57590
57592
|
var seenObjects = [];
|
|
57591
57593
|
var root = target;
|
|
57592
|
-
var traverse2 = function(target2,
|
|
57593
|
-
if (
|
|
57594
|
-
|
|
57594
|
+
var traverse2 = function(target2, path7) {
|
|
57595
|
+
if (path7 === void 0) {
|
|
57596
|
+
path7 = [];
|
|
57595
57597
|
}
|
|
57596
57598
|
if (isPlainObj(target2)) {
|
|
57597
57599
|
var seenIndex = seenObjects.indexOf(target2);
|
|
@@ -57601,15 +57603,15 @@ var traverse = function(target, visitor) {
|
|
|
57601
57603
|
var addIndex = seenObjects.length;
|
|
57602
57604
|
seenObjects.push(target2);
|
|
57603
57605
|
if (isNoNeedCompileObject(target2) && root !== target2) {
|
|
57604
|
-
visitor(target2,
|
|
57606
|
+
visitor(target2, path7);
|
|
57605
57607
|
return;
|
|
57606
57608
|
}
|
|
57607
57609
|
each(target2, function(value, key) {
|
|
57608
|
-
traverse2(value,
|
|
57610
|
+
traverse2(value, path7.concat(key));
|
|
57609
57611
|
});
|
|
57610
57612
|
seenObjects.splice(addIndex, 1);
|
|
57611
57613
|
} else {
|
|
57612
|
-
visitor(target2,
|
|
57614
|
+
visitor(target2, path7);
|
|
57613
57615
|
}
|
|
57614
57616
|
};
|
|
57615
57617
|
traverse2(target);
|
|
@@ -57620,24 +57622,24 @@ var traverseSchema = function(schema, visitor) {
|
|
|
57620
57622
|
}
|
|
57621
57623
|
var seenObjects = [];
|
|
57622
57624
|
var root = schema;
|
|
57623
|
-
var traverse2 = function(target,
|
|
57625
|
+
var traverse2 = function(target, path7) {
|
|
57624
57626
|
var _a2;
|
|
57625
|
-
if (
|
|
57626
|
-
|
|
57627
|
+
if (path7 === void 0) {
|
|
57628
|
+
path7 = [];
|
|
57627
57629
|
}
|
|
57628
|
-
if (
|
|
57630
|
+
if (path7[0] === "x-compile-omitted" || path7[0] === "x-validator" || path7[0] === "version" || path7[0] === "_isJSONSchemaObject")
|
|
57629
57631
|
return;
|
|
57630
|
-
if (String(
|
|
57632
|
+
if (String(path7[0]).indexOf("x-") == -1 && isFn(target))
|
|
57631
57633
|
return;
|
|
57632
|
-
if (SchemaNestedMap[
|
|
57634
|
+
if (SchemaNestedMap[path7[0]])
|
|
57633
57635
|
return;
|
|
57634
|
-
if (((_a2 = schema["x-compile-omitted"]) === null || _a2 === void 0 ? void 0 : _a2.indexOf(
|
|
57635
|
-
visitor(target,
|
|
57636
|
+
if (((_a2 = schema["x-compile-omitted"]) === null || _a2 === void 0 ? void 0 : _a2.indexOf(path7[0])) > -1) {
|
|
57637
|
+
visitor(target, path7, true);
|
|
57636
57638
|
return;
|
|
57637
57639
|
}
|
|
57638
57640
|
if (isPlainObj(target)) {
|
|
57639
|
-
if (
|
|
57640
|
-
visitor(target,
|
|
57641
|
+
if (path7[0] === "default" || path7[0] === "x-value") {
|
|
57642
|
+
visitor(target, path7);
|
|
57641
57643
|
return;
|
|
57642
57644
|
}
|
|
57643
57645
|
var seenIndex = seenObjects.indexOf(target);
|
|
@@ -57647,15 +57649,15 @@ var traverseSchema = function(schema, visitor) {
|
|
|
57647
57649
|
var addIndex = seenObjects.length;
|
|
57648
57650
|
seenObjects.push(target);
|
|
57649
57651
|
if (isNoNeedCompileObject(target) && root !== target) {
|
|
57650
|
-
visitor(target,
|
|
57652
|
+
visitor(target, path7);
|
|
57651
57653
|
return;
|
|
57652
57654
|
}
|
|
57653
57655
|
each(target, function(value, key) {
|
|
57654
|
-
traverse2(value,
|
|
57656
|
+
traverse2(value, path7.concat(key));
|
|
57655
57657
|
});
|
|
57656
57658
|
seenObjects.splice(addIndex, 1);
|
|
57657
57659
|
} else {
|
|
57658
|
-
visitor(target,
|
|
57660
|
+
visitor(target, path7);
|
|
57659
57661
|
}
|
|
57660
57662
|
};
|
|
57661
57663
|
traverse2(schema);
|
|
@@ -57699,8 +57701,8 @@ var createDataSource = function(source) {
|
|
|
57699
57701
|
var patchStateFormSchema = function(targetState, pattern, compiled) {
|
|
57700
57702
|
untracked(function() {
|
|
57701
57703
|
var _a2;
|
|
57702
|
-
var
|
|
57703
|
-
var segments =
|
|
57704
|
+
var path7 = Path.parse(pattern);
|
|
57705
|
+
var segments = path7.segments;
|
|
57704
57706
|
var key = segments[0];
|
|
57705
57707
|
var isEnum = key === "enum" && isArr(compiled);
|
|
57706
57708
|
var schemaMapKey = SchemaStateMap[key];
|
|
@@ -57784,14 +57786,14 @@ var compile = function(source, scope) {
|
|
|
57784
57786
|
};
|
|
57785
57787
|
var patchCompile = function(targetState, sourceState, scope) {
|
|
57786
57788
|
traverse(sourceState, function(value, pattern) {
|
|
57787
|
-
var
|
|
57789
|
+
var path7 = Path.parse(pattern);
|
|
57788
57790
|
var compiled = compile(value, scope);
|
|
57789
|
-
var key =
|
|
57791
|
+
var key = path7.segments[0];
|
|
57790
57792
|
if (compiled === void 0)
|
|
57791
57793
|
return;
|
|
57792
57794
|
if (hasOwnProperty4.call(targetState, key)) {
|
|
57793
57795
|
untracked(function() {
|
|
57794
|
-
return Path.setIn(targetState,
|
|
57796
|
+
return Path.setIn(targetState, path7, compiled);
|
|
57795
57797
|
});
|
|
57796
57798
|
}
|
|
57797
57799
|
});
|
|
@@ -57800,7 +57802,7 @@ var patchSchemaCompile = function(targetState, sourceSchema, scope, demand) {
|
|
|
57800
57802
|
if (demand === void 0) {
|
|
57801
57803
|
demand = false;
|
|
57802
57804
|
}
|
|
57803
|
-
traverseSchema(sourceSchema, function(value,
|
|
57805
|
+
traverseSchema(sourceSchema, function(value, path7, omitCompile) {
|
|
57804
57806
|
var compiled = value;
|
|
57805
57807
|
var collected = hasCollected(function() {
|
|
57806
57808
|
if (!omitCompile) {
|
|
@@ -57811,10 +57813,10 @@ var patchSchemaCompile = function(targetState, sourceSchema, scope, demand) {
|
|
|
57811
57813
|
return;
|
|
57812
57814
|
if (demand) {
|
|
57813
57815
|
if (collected || !targetState.initialized) {
|
|
57814
|
-
patchStateFormSchema(targetState,
|
|
57816
|
+
patchStateFormSchema(targetState, path7, compiled);
|
|
57815
57817
|
}
|
|
57816
57818
|
} else {
|
|
57817
|
-
patchStateFormSchema(targetState,
|
|
57819
|
+
patchStateFormSchema(targetState, path7, compiled);
|
|
57818
57820
|
}
|
|
57819
57821
|
});
|
|
57820
57822
|
};
|
|
@@ -58098,14 +58100,14 @@ var getISOCode = function(language) {
|
|
|
58098
58100
|
});
|
|
58099
58101
|
return isoCode;
|
|
58100
58102
|
};
|
|
58101
|
-
var getLocaleByPath = function(
|
|
58103
|
+
var getLocaleByPath = function(path7, lang) {
|
|
58102
58104
|
if (lang === void 0) {
|
|
58103
58105
|
lang = registry.locales.language;
|
|
58104
58106
|
}
|
|
58105
|
-
return getIn2(registry.locales.messages, "".concat(getISOCode(lang), ".").concat(
|
|
58107
|
+
return getIn2(registry.locales.messages, "".concat(getISOCode(lang), ".").concat(path7));
|
|
58106
58108
|
};
|
|
58107
|
-
var getValidateLocale = function(
|
|
58108
|
-
var message = getLocaleByPath(
|
|
58109
|
+
var getValidateLocale = function(path7) {
|
|
58110
|
+
var message = getLocaleByPath(path7);
|
|
58109
58111
|
return message || getLocaleByPath("pattern") || getLocaleByPath("pattern", defaultLanguage);
|
|
58110
58112
|
};
|
|
58111
58113
|
var getValidateMessageTemplateEngine = function() {
|
|
@@ -59366,15 +59368,15 @@ var buildFieldPath = function(field) {
|
|
|
59366
59368
|
var buildDataPath = function(fields, pattern) {
|
|
59367
59369
|
var prevArray = false;
|
|
59368
59370
|
var segments = pattern.segments;
|
|
59369
|
-
var
|
|
59370
|
-
var currentPath =
|
|
59371
|
+
var path7 = segments.reduce(function(path8, key, index) {
|
|
59372
|
+
var currentPath = path8.concat(key);
|
|
59371
59373
|
var currentAddress = segments.slice(0, index + 1);
|
|
59372
59374
|
var current = fields[currentAddress.join(".")];
|
|
59373
59375
|
if (prevArray) {
|
|
59374
59376
|
if (!isVoidField(current)) {
|
|
59375
59377
|
prevArray = false;
|
|
59376
59378
|
}
|
|
59377
|
-
return
|
|
59379
|
+
return path8;
|
|
59378
59380
|
}
|
|
59379
59381
|
if (index >= segments.length - 1) {
|
|
59380
59382
|
return currentPath;
|
|
@@ -59386,13 +59388,13 @@ var buildDataPath = function(fields, pattern) {
|
|
|
59386
59388
|
prevArray = true;
|
|
59387
59389
|
return currentPath;
|
|
59388
59390
|
}
|
|
59389
|
-
return
|
|
59391
|
+
return path8;
|
|
59390
59392
|
} else {
|
|
59391
59393
|
prevArray = false;
|
|
59392
59394
|
}
|
|
59393
59395
|
return currentPath;
|
|
59394
59396
|
}, []);
|
|
59395
|
-
return new Path(
|
|
59397
|
+
return new Path(path7);
|
|
59396
59398
|
};
|
|
59397
59399
|
var locateNode = function(field, address) {
|
|
59398
59400
|
field.address = Path.parse(address);
|
|
@@ -59426,33 +59428,33 @@ var destroy = function(target, address, forceClear) {
|
|
|
59426
59428
|
field === null || field === void 0 ? void 0 : field.dispose();
|
|
59427
59429
|
if (isDataField(field) && forceClear) {
|
|
59428
59430
|
var form = field.form;
|
|
59429
|
-
var
|
|
59430
|
-
form.deleteValuesIn(
|
|
59431
|
-
form.deleteInitialValuesIn(
|
|
59431
|
+
var path7 = field.path;
|
|
59432
|
+
form.deleteValuesIn(path7);
|
|
59433
|
+
form.deleteInitialValuesIn(path7);
|
|
59432
59434
|
}
|
|
59433
59435
|
delete target[address];
|
|
59434
59436
|
};
|
|
59435
|
-
var patchFormValues = function(form,
|
|
59436
|
-
var update = function(
|
|
59437
|
-
if (
|
|
59438
|
-
form.setValuesIn(
|
|
59437
|
+
var patchFormValues = function(form, path7, source) {
|
|
59438
|
+
var update = function(path8, source2) {
|
|
59439
|
+
if (path8.length) {
|
|
59440
|
+
form.setValuesIn(path8, clone(source2));
|
|
59439
59441
|
} else {
|
|
59440
59442
|
Object.assign(form.values, clone(source2));
|
|
59441
59443
|
}
|
|
59442
59444
|
};
|
|
59443
|
-
var patch = function(source2,
|
|
59444
|
-
if (
|
|
59445
|
-
|
|
59445
|
+
var patch = function(source2, path8) {
|
|
59446
|
+
if (path8 === void 0) {
|
|
59447
|
+
path8 = [];
|
|
59446
59448
|
}
|
|
59447
|
-
var targetValue = form.getValuesIn(
|
|
59448
|
-
var targetField = form.query(
|
|
59449
|
+
var targetValue = form.getValuesIn(path8);
|
|
59450
|
+
var targetField = form.query(path8).take();
|
|
59449
59451
|
var isUnVoidField = targetField && !isVoidField(targetField);
|
|
59450
59452
|
if (isUnVoidField && targetField.display === "none") {
|
|
59451
59453
|
targetField.caches.value = clone(source2);
|
|
59452
59454
|
return;
|
|
59453
59455
|
}
|
|
59454
59456
|
if (allowAssignDefaultValue(targetValue, source2)) {
|
|
59455
|
-
update(
|
|
59457
|
+
update(path8, source2);
|
|
59456
59458
|
} else {
|
|
59457
59459
|
if (isEmpty(source2))
|
|
59458
59460
|
return;
|
|
@@ -59460,20 +59462,20 @@ var patchFormValues = function(form, path6, source) {
|
|
|
59460
59462
|
return;
|
|
59461
59463
|
if (isPlainObj(targetValue) && isPlainObj(source2)) {
|
|
59462
59464
|
each(source2, function(value, key) {
|
|
59463
|
-
patch(value,
|
|
59465
|
+
patch(value, path8.concat(key));
|
|
59464
59466
|
});
|
|
59465
59467
|
} else {
|
|
59466
59468
|
if (targetField) {
|
|
59467
59469
|
if (isUnVoidField && !targetField.selfModified) {
|
|
59468
|
-
update(
|
|
59470
|
+
update(path8, source2);
|
|
59469
59471
|
}
|
|
59470
59472
|
} else if (form.initialized) {
|
|
59471
|
-
update(
|
|
59473
|
+
update(path8, source2);
|
|
59472
59474
|
}
|
|
59473
59475
|
}
|
|
59474
59476
|
}
|
|
59475
59477
|
};
|
|
59476
|
-
patch(source,
|
|
59478
|
+
patch(source, path7);
|
|
59477
59479
|
};
|
|
59478
59480
|
var matchFeedback = function(search, feedback) {
|
|
59479
59481
|
if (!search || !feedback)
|
|
@@ -59896,13 +59898,13 @@ var createBatchStateSetter = function(form) {
|
|
|
59896
59898
|
} else if (isGeneralField(pattern)) {
|
|
59897
59899
|
pattern.setState(payload);
|
|
59898
59900
|
} else {
|
|
59899
|
-
var matchCount_1 = 0,
|
|
59900
|
-
form.query(
|
|
59901
|
+
var matchCount_1 = 0, path7 = Path.parse(pattern);
|
|
59902
|
+
form.query(path7).forEach(function(field) {
|
|
59901
59903
|
field.setState(payload);
|
|
59902
59904
|
matchCount_1++;
|
|
59903
59905
|
});
|
|
59904
|
-
if (matchCount_1 === 0 ||
|
|
59905
|
-
subscribeUpdate(form,
|
|
59906
|
+
if (matchCount_1 === 0 || path7.isWildMatchPattern) {
|
|
59907
|
+
subscribeUpdate(form, path7, payload);
|
|
59906
59908
|
}
|
|
59907
59909
|
}
|
|
59908
59910
|
});
|
|
@@ -62518,8 +62520,8 @@ var FieldEffects = {
|
|
|
62518
62520
|
};
|
|
62519
62521
|
var DefaultFieldEffects = ["onFieldInit", "onFieldValueChange"];
|
|
62520
62522
|
var getDependencyValue = function(field, pattern, property) {
|
|
62521
|
-
var _a2 = __read7(String(pattern).split(/\s*#\s*/), 2), target = _a2[0],
|
|
62522
|
-
return field.query(target).getIn(
|
|
62523
|
+
var _a2 = __read7(String(pattern).split(/\s*#\s*/), 2), target = _a2[0], path7 = _a2[1];
|
|
62524
|
+
return field.query(target).getIn(path7 || property || "value");
|
|
62523
62525
|
};
|
|
62524
62526
|
var getDependencies = function(field, dependencies) {
|
|
62525
62527
|
if (isArr(dependencies)) {
|
|
@@ -63368,10 +63370,10 @@ var CLIReader = class {
|
|
|
63368
63370
|
return answers;
|
|
63369
63371
|
}
|
|
63370
63372
|
constructor(options) {
|
|
63371
|
-
|
|
63372
|
-
|
|
63373
|
-
|
|
63374
|
-
|
|
63373
|
+
_define_property(this, "schema", null);
|
|
63374
|
+
_define_property(this, "validateMap", void 0);
|
|
63375
|
+
_define_property(this, "initValue", void 0);
|
|
63376
|
+
_define_property(this, "answers", {});
|
|
63375
63377
|
const { schema, validateMap, initValue } = options;
|
|
63376
63378
|
this.schema = schema;
|
|
63377
63379
|
this.validateMap = validateMap || {};
|
|
@@ -63440,8 +63442,8 @@ var I18n2 = class {
|
|
|
63440
63442
|
};
|
|
63441
63443
|
}
|
|
63442
63444
|
constructor() {
|
|
63443
|
-
|
|
63444
|
-
|
|
63445
|
+
_define_property(this, "language", "en");
|
|
63446
|
+
_define_property(this, "languageMap", {});
|
|
63445
63447
|
}
|
|
63446
63448
|
};
|
|
63447
63449
|
|
|
@@ -63535,7 +63537,7 @@ function transformInquirerSchema(questions, configValue = {}, validateMap = {},
|
|
|
63535
63537
|
}
|
|
63536
63538
|
|
|
63537
63539
|
// ../../../../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
|
|
63540
|
+
var import_path6 = __toESM(require("path"));
|
|
63539
63541
|
var import_utils16 = require("@modern-js/utils");
|
|
63540
63542
|
var NODE_MAJOR_VERSION_MAP = {
|
|
63541
63543
|
"lts/*": 18,
|
|
@@ -63558,10 +63560,10 @@ async function checkUseNvm(cwd, logger2) {
|
|
|
63558
63560
|
if (process.platform.startsWith("win")) {
|
|
63559
63561
|
return false;
|
|
63560
63562
|
}
|
|
63561
|
-
if (!await fsExists(
|
|
63563
|
+
if (!await fsExists(import_path6.default.join(cwd, ".nvmrc"))) {
|
|
63562
63564
|
return false;
|
|
63563
63565
|
}
|
|
63564
|
-
const nvmrcContent = (await import_utils16.fs.readFile(
|
|
63566
|
+
const nvmrcContent = (await import_utils16.fs.readFile(import_path6.default.join(cwd, ".nvmrc"), "utf-8")).replace("\n", "");
|
|
63565
63567
|
const expectNodeVersion = NODE_MAJOR_VERSION_MAP[nvmrcContent] || nvmrcContent;
|
|
63566
63568
|
const currentNodeVersion = await getNoteVersion();
|
|
63567
63569
|
if (expectNodeVersion === import_utils16.semver.major(currentNodeVersion)) {
|
|
@@ -63804,14 +63806,14 @@ var AppAPI = class {
|
|
|
63804
63806
|
}
|
|
63805
63807
|
}
|
|
63806
63808
|
constructor(generatorContext, generatorCore) {
|
|
63807
|
-
|
|
63808
|
-
|
|
63809
|
-
|
|
63810
|
-
|
|
63811
|
-
|
|
63812
|
-
|
|
63813
|
-
|
|
63814
|
-
|
|
63809
|
+
_define_property(this, "i18n", i18n2);
|
|
63810
|
+
_define_property(this, "npmApi", void 0);
|
|
63811
|
+
_define_property(this, "gitApi", void 0);
|
|
63812
|
+
_define_property(this, "handlebarsAPI", void 0);
|
|
63813
|
+
_define_property(this, "ejsAPI", void 0);
|
|
63814
|
+
_define_property(this, "fsAPI", void 0);
|
|
63815
|
+
_define_property(this, "generatorCore", void 0);
|
|
63816
|
+
_define_property(this, "generatorContext", void 0);
|
|
63815
63817
|
this.generatorCore = generatorCore;
|
|
63816
63818
|
this.generatorContext = generatorContext;
|
|
63817
63819
|
this.npmApi = new NpmAPI(generatorCore);
|
|
@@ -63879,28 +63881,20 @@ var JsonAPI = class {
|
|
|
63879
63881
|
});
|
|
63880
63882
|
}
|
|
63881
63883
|
constructor(generatorCore) {
|
|
63882
|
-
|
|
63884
|
+
_define_property(this, "generatorCore", void 0);
|
|
63883
63885
|
this.generatorCore = generatorCore;
|
|
63884
63886
|
}
|
|
63885
63887
|
};
|
|
63886
63888
|
|
|
63887
63889
|
// 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
63890
|
function isEmptyServerDir(serverDir) {
|
|
63897
63891
|
const files = import_utils4.fs.readdirSync(serverDir);
|
|
63898
63892
|
if (files.length === 0) {
|
|
63899
63893
|
return true;
|
|
63900
63894
|
}
|
|
63901
63895
|
return files.every((file) => {
|
|
63902
|
-
if (import_utils4.fs.statSync(
|
|
63903
|
-
const childFiles = import_utils4.fs.readdirSync(
|
|
63896
|
+
if (import_utils4.fs.statSync(import_path7.default.join(serverDir, file)).isDirectory()) {
|
|
63897
|
+
const childFiles = import_utils4.fs.readdirSync(import_path7.default.join(serverDir, file));
|
|
63904
63898
|
return childFiles.length === 0;
|
|
63905
63899
|
}
|
|
63906
63900
|
return false;
|
|
@@ -63909,7 +63903,7 @@ function isEmptyServerDir(serverDir) {
|
|
|
63909
63903
|
var handleTemplateFile = async (context, generator, appApi) => {
|
|
63910
63904
|
const jsonAPI = new JsonAPI(generator);
|
|
63911
63905
|
const appDir = context.materials.default.basePath;
|
|
63912
|
-
const serverDir =
|
|
63906
|
+
const serverDir = import_path7.default.join(appDir, "server");
|
|
63913
63907
|
if (import_utils4.fs.existsSync(serverDir) && !isEmptyServerDir(serverDir)) {
|
|
63914
63908
|
const files = import_utils4.fs.readdirSync("server");
|
|
63915
63909
|
if (files.length > 0) {
|
|
@@ -63920,7 +63914,7 @@ var handleTemplateFile = async (context, generator, appApi) => {
|
|
|
63920
63914
|
const language = isTsProject(appDir) ? Language.TS : Language.JS;
|
|
63921
63915
|
const serverPlugin = "@modern-js/plugin-server";
|
|
63922
63916
|
await appApi.runSubGenerator(
|
|
63923
|
-
getGeneratorPath(DependenceGenerator, context.config.distTag),
|
|
63917
|
+
getGeneratorPath(DependenceGenerator, context.config.distTag, [__dirname]),
|
|
63924
63918
|
void 0,
|
|
63925
63919
|
{
|
|
63926
63920
|
...context.config,
|
|
@@ -63946,10 +63940,10 @@ var handleTemplateFile = async (context, generator, appApi) => {
|
|
|
63946
63940
|
(resourceKey) => resourceKey.replace(`templates/base-template/${language}/`, "").replace(".handlebars", "")
|
|
63947
63941
|
);
|
|
63948
63942
|
if (language === Language.TS) {
|
|
63949
|
-
const tsconfigJSON = (0, import_utils4.readTsConfigByFile)(
|
|
63943
|
+
const tsconfigJSON = (0, import_utils4.readTsConfigByFile)(import_path7.default.join(appDir, "tsconfig.json"));
|
|
63950
63944
|
if (!(tsconfigJSON.include || []).includes("server")) {
|
|
63951
63945
|
await jsonAPI.update(
|
|
63952
|
-
context.materials.default.get(
|
|
63946
|
+
context.materials.default.get(import_path7.default.join(appDir, "tsconfig.json")),
|
|
63953
63947
|
{
|
|
63954
63948
|
query: {},
|
|
63955
63949
|
update: {
|