@modern-js/server-generator 3.2.11 → 3.3.1
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 +74 -79
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -14527,9 +14527,9 @@ var require_ejs = __commonJS({
|
|
|
14527
14527
|
}
|
|
14528
14528
|
});
|
|
14529
14529
|
|
|
14530
|
-
// ../../../../node_modules/.pnpm/@modern-js+utils@2.
|
|
14530
|
+
// ../../../../node_modules/.pnpm/@modern-js+utils@2.39.2/node_modules/@modern-js/utils/dist/compiled/chalk/index.js
|
|
14531
14531
|
var require_chalk = __commonJS({
|
|
14532
|
-
"../../../../node_modules/.pnpm/@modern-js+utils@2.
|
|
14532
|
+
"../../../../node_modules/.pnpm/@modern-js+utils@2.39.2/node_modules/@modern-js/utils/dist/compiled/chalk/index.js"(exports, module2) {
|
|
14533
14533
|
"use strict";
|
|
14534
14534
|
(() => {
|
|
14535
14535
|
var e = { 44: (e2, t2, n2) => {
|
|
@@ -52692,7 +52692,7 @@ var import_path6 = __toESM(require("path"));
|
|
|
52692
52692
|
var import_path = __toESM(require("path"));
|
|
52693
52693
|
var import_utils3 = require("@modern-js/utils");
|
|
52694
52694
|
|
|
52695
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.
|
|
52695
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_define_property.js
|
|
52696
52696
|
function _define_property(obj, key, value) {
|
|
52697
52697
|
if (key in obj) {
|
|
52698
52698
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
@@ -52801,7 +52801,8 @@ var ZH_LOCALE = {
|
|
|
52801
52801
|
polyfill: "启用「基于 UA 的 Polyfill」功能",
|
|
52802
52802
|
proxy: "启用「全局代理」",
|
|
52803
52803
|
swc: "启用「SWC 编译」",
|
|
52804
|
-
rspack: "启用「Rspack 构建」(实验性)"
|
|
52804
|
+
rspack: "启用「Rspack 构建」(实验性)",
|
|
52805
|
+
module_doc: "启动「模块文档」功能"
|
|
52805
52806
|
},
|
|
52806
52807
|
element: {
|
|
52807
52808
|
self: "创建工程元素",
|
|
@@ -52899,7 +52900,8 @@ var EN_LOCALE = {
|
|
|
52899
52900
|
polyfill: "Enable UA-based Polyfill Feature",
|
|
52900
52901
|
proxy: "Enable Global Proxy",
|
|
52901
52902
|
swc: "Enable SWC Compile",
|
|
52902
|
-
rspack: "Enable Rspack Build (experimental)"
|
|
52903
|
+
rspack: "Enable Rspack Build (experimental)",
|
|
52904
|
+
module_doc: "Enable Module Doc"
|
|
52903
52905
|
},
|
|
52904
52906
|
element: {
|
|
52905
52907
|
self: "Create Element",
|
|
@@ -52978,28 +52980,10 @@ var SubSolution;
|
|
|
52978
52980
|
SubSolution2["MWA"] = "mwa";
|
|
52979
52981
|
SubSolution2["Module"] = "module";
|
|
52980
52982
|
})(SubSolution || (SubSolution = {}));
|
|
52981
|
-
var SolutionText = {
|
|
52982
|
-
[Solution.MWA]: () => i18n.t(localeKeys.solution.mwa),
|
|
52983
|
-
[Solution.Module]: () => i18n.t(localeKeys.solution.module),
|
|
52984
|
-
[Solution.Monorepo]: () => i18n.t(localeKeys.solution.monorepo)
|
|
52985
|
-
};
|
|
52986
|
-
var SubSolutionText = {
|
|
52987
|
-
[SubSolution.MWA]: () => i18n.t(localeKeys.sub_solution.mwa),
|
|
52988
|
-
[SubSolution.Module]: () => i18n.t(localeKeys.sub_solution.module)
|
|
52989
|
-
};
|
|
52990
52983
|
var SolutionToolsMap = {
|
|
52991
|
-
[
|
|
52992
|
-
[
|
|
52993
|
-
[
|
|
52994
|
-
};
|
|
52995
|
-
var SolutionGenerator = {
|
|
52996
|
-
[Solution.MWA]: "@modern-js/mwa-generator",
|
|
52997
|
-
[Solution.Module]: "@modern-js/module-generator",
|
|
52998
|
-
[Solution.Monorepo]: "@modern-js/monorepo-generator"
|
|
52999
|
-
};
|
|
53000
|
-
var SubSolutionGenerator = {
|
|
53001
|
-
[SubSolution.MWA]: "@modern-js/mwa-generator",
|
|
53002
|
-
[SubSolution.Module]: "@modern-js/module-generator"
|
|
52984
|
+
["mwa"]: "@modern-js/app-tools",
|
|
52985
|
+
["module"]: "@modern-js/module-tools",
|
|
52986
|
+
["monorepo"]: "@modern-js/monorepo-tools"
|
|
53003
52987
|
};
|
|
53004
52988
|
var DependenceGenerator = "@modern-js/dependence-generator";
|
|
53005
52989
|
|
|
@@ -53009,10 +52993,6 @@ var Language;
|
|
|
53009
52993
|
Language2["TS"] = "ts";
|
|
53010
52994
|
Language2["JS"] = "js";
|
|
53011
52995
|
})(Language || (Language = {}));
|
|
53012
|
-
var LanguageName = {
|
|
53013
|
-
[Language.TS]: "TS",
|
|
53014
|
-
[Language.JS]: "ES6+"
|
|
53015
|
-
};
|
|
53016
52996
|
|
|
53017
52997
|
// ../../generator-utils/dist/esm/utils/stripAnsi.js
|
|
53018
52998
|
function ansiRegex({ onlyFirst = false } = {}) {
|
|
@@ -53182,12 +53162,21 @@ function isTsProject(appDir) {
|
|
|
53182
53162
|
return import_utils3.fs.existsSync(import_path.default.join(appDir, "tsconfig.json"));
|
|
53183
53163
|
}
|
|
53184
53164
|
|
|
53185
|
-
// ../../../../node_modules/.pnpm/@
|
|
53165
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/esm/_define_property.js
|
|
53166
|
+
function _define_property2(obj, key, value) {
|
|
53167
|
+
if (key in obj) {
|
|
53168
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
53169
|
+
} else
|
|
53170
|
+
obj[key] = value;
|
|
53171
|
+
return obj;
|
|
53172
|
+
}
|
|
53173
|
+
|
|
53174
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
|
|
53186
53175
|
var import_utils17 = require("@modern-js/utils");
|
|
53187
53176
|
var import_lodash7 = require("@modern-js/utils/lodash");
|
|
53188
53177
|
var import_comment_json = __toESM(require_src2());
|
|
53189
53178
|
|
|
53190
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.
|
|
53179
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
|
|
53191
53180
|
var import_utils5 = require("@modern-js/utils");
|
|
53192
53181
|
async function canUseNvm() {
|
|
53193
53182
|
try {
|
|
@@ -53237,7 +53226,7 @@ async function canUsePnpm3() {
|
|
|
53237
53226
|
}
|
|
53238
53227
|
}
|
|
53239
53228
|
|
|
53240
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.
|
|
53229
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
|
|
53241
53230
|
var import_utils6 = require("@modern-js/utils");
|
|
53242
53231
|
function execaWithStreamLog(command, args, options) {
|
|
53243
53232
|
const promise = (0, import_utils6.execa)(command, args, {
|
|
@@ -53333,7 +53322,7 @@ async function pnpmInstall({ cwd, registryUrl, ignoreScripts, useNvm }) {
|
|
|
53333
53322
|
throw new Error("please install pnpm first");
|
|
53334
53323
|
}
|
|
53335
53324
|
|
|
53336
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.
|
|
53325
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
|
|
53337
53326
|
var NpmAPI = class {
|
|
53338
53327
|
npmInstall({ cwd, registryUrl, ignoreScripts }) {
|
|
53339
53328
|
return npmInstall({
|
|
@@ -53357,12 +53346,12 @@ var NpmAPI = class {
|
|
|
53357
53346
|
});
|
|
53358
53347
|
}
|
|
53359
53348
|
constructor(generatorCore) {
|
|
53360
|
-
|
|
53349
|
+
_define_property2(this, "generatorCore", void 0);
|
|
53361
53350
|
this.generatorCore = generatorCore;
|
|
53362
53351
|
}
|
|
53363
53352
|
};
|
|
53364
53353
|
|
|
53365
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.
|
|
53354
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.1_@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith-api-git/dist/esm-node/utils/index.js
|
|
53366
53355
|
var import_utils8 = require("@modern-js/utils");
|
|
53367
53356
|
async function canUseGit() {
|
|
53368
53357
|
try {
|
|
@@ -53437,7 +53426,7 @@ async function gitCommit(cwd, commitMessage) {
|
|
|
53437
53426
|
});
|
|
53438
53427
|
}
|
|
53439
53428
|
|
|
53440
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.
|
|
53429
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.1_@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith-api-git/dist/esm-node/index.js
|
|
53441
53430
|
var GitAPI = class {
|
|
53442
53431
|
async isInGitRepo(cwd = this.generatorCore.outputPath) {
|
|
53443
53432
|
const canUse = await canUseGit();
|
|
@@ -53482,19 +53471,19 @@ var GitAPI = class {
|
|
|
53482
53471
|
}
|
|
53483
53472
|
}
|
|
53484
53473
|
constructor(generatorCore, generatorContext) {
|
|
53485
|
-
|
|
53486
|
-
|
|
53474
|
+
_define_property2(this, "generatorCore", void 0);
|
|
53475
|
+
_define_property2(this, "generatorContext", void 0);
|
|
53487
53476
|
this.generatorCore = generatorCore;
|
|
53488
53477
|
this.generatorContext = generatorContext;
|
|
53489
53478
|
}
|
|
53490
53479
|
};
|
|
53491
53480
|
|
|
53492
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
53481
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
|
|
53493
53482
|
var import_path2 = __toESM(require("path"));
|
|
53494
53483
|
var import_utils10 = require("@modern-js/utils");
|
|
53495
53484
|
var FS_RESOURCE = "_codesmith_core_fs_resource";
|
|
53496
53485
|
|
|
53497
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
53486
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
|
|
53498
53487
|
var import_utils11 = require("@modern-js/utils");
|
|
53499
53488
|
async function fsExists(path6) {
|
|
53500
53489
|
try {
|
|
@@ -53505,7 +53494,7 @@ async function fsExists(path6) {
|
|
|
53505
53494
|
}
|
|
53506
53495
|
}
|
|
53507
53496
|
|
|
53508
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.
|
|
53497
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.1_@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/utils/renderString.js
|
|
53509
53498
|
var import_handlebars = __toESM(require_lib());
|
|
53510
53499
|
function renderString(template, fullData, registers) {
|
|
53511
53500
|
const helpers = {
|
|
@@ -53519,7 +53508,7 @@ function renderString(template, fullData, registers) {
|
|
|
53519
53508
|
return import_handlebars.default.compile(template)(fullData) || "";
|
|
53520
53509
|
}
|
|
53521
53510
|
|
|
53522
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.
|
|
53511
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.1_@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/index.js
|
|
53523
53512
|
var HandlebarsAPI = class {
|
|
53524
53513
|
async registerHelp(helpers) {
|
|
53525
53514
|
this.registers.helpers = {
|
|
@@ -53559,8 +53548,8 @@ var HandlebarsAPI = class {
|
|
|
53559
53548
|
);
|
|
53560
53549
|
}
|
|
53561
53550
|
constructor(generatorCore, registers) {
|
|
53562
|
-
|
|
53563
|
-
|
|
53551
|
+
_define_property2(this, "generatorCore", void 0);
|
|
53552
|
+
_define_property2(this, "registers", void 0);
|
|
53564
53553
|
this.generatorCore = generatorCore;
|
|
53565
53554
|
this.registers = registers || {
|
|
53566
53555
|
helpers: {},
|
|
@@ -53569,13 +53558,13 @@ var HandlebarsAPI = class {
|
|
|
53569
53558
|
}
|
|
53570
53559
|
};
|
|
53571
53560
|
|
|
53572
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.
|
|
53561
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.1_@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/utils/renderString.js
|
|
53573
53562
|
var import_ejs = __toESM(require_ejs());
|
|
53574
53563
|
function renderString2(template, fullData) {
|
|
53575
53564
|
return import_ejs.default.render(template, fullData) || "";
|
|
53576
53565
|
}
|
|
53577
53566
|
|
|
53578
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.
|
|
53567
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.1_@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/index.js
|
|
53579
53568
|
var EjsAPI = class {
|
|
53580
53569
|
async renderTemplate(templateResource, target, parameters = {}) {
|
|
53581
53570
|
if (templateResource._type !== FS_RESOURCE) {
|
|
@@ -53603,12 +53592,12 @@ var EjsAPI = class {
|
|
|
53603
53592
|
);
|
|
53604
53593
|
}
|
|
53605
53594
|
constructor(generatorCore) {
|
|
53606
|
-
|
|
53595
|
+
_define_property2(this, "generatorCore", void 0);
|
|
53607
53596
|
this.generatorCore = generatorCore;
|
|
53608
53597
|
}
|
|
53609
53598
|
};
|
|
53610
53599
|
|
|
53611
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.3.
|
|
53600
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.3.1_@modern-js+codesmith@2.3.1/node_modules/@modern-js/codesmith-api-fs/dist/esm-node/index.js
|
|
53612
53601
|
var import_path3 = __toESM(require("path"));
|
|
53613
53602
|
var import_utils14 = require("@modern-js/utils");
|
|
53614
53603
|
var FsAPI = class {
|
|
@@ -53631,7 +53620,7 @@ var FsAPI = class {
|
|
|
53631
53620
|
}));
|
|
53632
53621
|
}
|
|
53633
53622
|
constructor(generatorCore) {
|
|
53634
|
-
|
|
53623
|
+
_define_property2(this, "generatorCore", void 0);
|
|
53635
53624
|
this.generatorCore = generatorCore;
|
|
53636
53625
|
}
|
|
53637
53626
|
};
|
|
@@ -63192,10 +63181,10 @@ var Schema = (
|
|
|
63192
63181
|
}()
|
|
63193
63182
|
);
|
|
63194
63183
|
|
|
63195
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
|
63184
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
|
|
63196
63185
|
var import_inquirer = __toESM(require_inquirer());
|
|
63197
63186
|
|
|
63198
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
|
63187
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm-node/transform.js
|
|
63199
63188
|
var import_lodash3 = require("@modern-js/utils/lodash");
|
|
63200
63189
|
function validateSchema(schema) {
|
|
63201
63190
|
const { type, properties } = schema;
|
|
@@ -63287,7 +63276,7 @@ function transformForm(schema, configValue = {}, validateMap, initValue) {
|
|
|
63287
63276
|
return getQuestionFromSchema(schema, configValue, validateMap, initValue);
|
|
63288
63277
|
}
|
|
63289
63278
|
|
|
63290
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
|
63279
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
|
|
63291
63280
|
var compileRule = (rule, scope) => {
|
|
63292
63281
|
const state = Schema.compile(rule, {
|
|
63293
63282
|
$self: {},
|
|
@@ -63391,7 +63380,7 @@ async function prompt(schema, configValue = {}, validateMap, initValue) {
|
|
|
63391
63380
|
return answers;
|
|
63392
63381
|
}
|
|
63393
63382
|
|
|
63394
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
|
63383
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-formily/dist/esm-node/inquirer.js
|
|
63395
63384
|
var CLIReader = class {
|
|
63396
63385
|
getAnswers() {
|
|
63397
63386
|
return this.answers;
|
|
@@ -63411,10 +63400,10 @@ var CLIReader = class {
|
|
|
63411
63400
|
return answers;
|
|
63412
63401
|
}
|
|
63413
63402
|
constructor(options) {
|
|
63414
|
-
|
|
63415
|
-
|
|
63416
|
-
|
|
63417
|
-
|
|
63403
|
+
_define_property2(this, "schema", null);
|
|
63404
|
+
_define_property2(this, "validateMap", void 0);
|
|
63405
|
+
_define_property2(this, "initValue", void 0);
|
|
63406
|
+
_define_property2(this, "answers", {});
|
|
63418
63407
|
const { schema, validateMap, initValue } = options;
|
|
63419
63408
|
this.schema = schema;
|
|
63420
63409
|
this.validateMap = validateMap || {};
|
|
@@ -63422,7 +63411,7 @@ var CLIReader = class {
|
|
|
63422
63411
|
}
|
|
63423
63412
|
};
|
|
63424
63413
|
|
|
63425
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
63414
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
|
|
63426
63415
|
var import_inquirer2 = __toESM(require_inquirer2());
|
|
63427
63416
|
|
|
63428
63417
|
// ../../../../node_modules/.pnpm/@modern-js+plugin-i18n@2.37.2/node_modules/@modern-js/plugin-i18n/dist/esm-node/index.js
|
|
@@ -63483,12 +63472,12 @@ var I18n2 = class {
|
|
|
63483
63472
|
};
|
|
63484
63473
|
}
|
|
63485
63474
|
constructor() {
|
|
63486
|
-
|
|
63487
|
-
|
|
63475
|
+
_define_property2(this, "language", "en");
|
|
63476
|
+
_define_property2(this, "languageMap", {});
|
|
63488
63477
|
}
|
|
63489
63478
|
};
|
|
63490
63479
|
|
|
63491
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
63480
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/zh.js
|
|
63492
63481
|
var ZH_LOCALE2 = {
|
|
63493
63482
|
environment: {
|
|
63494
63483
|
node_version: "请升级 Node 版本至 LIS",
|
|
@@ -63515,7 +63504,7 @@ var ZH_LOCALE2 = {
|
|
|
63515
63504
|
}
|
|
63516
63505
|
};
|
|
63517
63506
|
|
|
63518
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
63507
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/en.js
|
|
63519
63508
|
var EN_LOCALE2 = {
|
|
63520
63509
|
environment: {
|
|
63521
63510
|
node_version: "please upgrade node to lts version",
|
|
@@ -63542,14 +63531,14 @@ var EN_LOCALE2 = {
|
|
|
63542
63531
|
}
|
|
63543
63532
|
};
|
|
63544
63533
|
|
|
63545
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
63534
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/index.js
|
|
63546
63535
|
var i18n2 = new I18n2();
|
|
63547
63536
|
var localeKeys2 = i18n2.init("zh", {
|
|
63548
63537
|
zh: ZH_LOCALE2,
|
|
63549
63538
|
en: EN_LOCALE2
|
|
63550
63539
|
});
|
|
63551
63540
|
|
|
63552
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
63541
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/transform.js
|
|
63553
63542
|
var import_lodash6 = require("@modern-js/utils/lodash");
|
|
63554
63543
|
function transformInquirerSchema(questions, configValue = {}, validateMap = {}, initValue = {}) {
|
|
63555
63544
|
for (const question of questions) {
|
|
@@ -63577,7 +63566,7 @@ function transformInquirerSchema(questions, configValue = {}, validateMap = {},
|
|
|
63577
63566
|
return questions;
|
|
63578
63567
|
}
|
|
63579
63568
|
|
|
63580
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
63569
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/checkUseNvm.js
|
|
63581
63570
|
var import_path5 = __toESM(require("path"));
|
|
63582
63571
|
var import_utils16 = require("@modern-js/utils");
|
|
63583
63572
|
var NODE_MAJOR_VERSION_MAP = {
|
|
@@ -63625,7 +63614,7 @@ async function checkUseNvm(cwd, logger2) {
|
|
|
63625
63614
|
}
|
|
63626
63615
|
}
|
|
63627
63616
|
|
|
63628
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
63617
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.1_@modern-js+codesmith@2.3.1_typescript@5.0.4/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
|
|
63629
63618
|
var AppAPI = class {
|
|
63630
63619
|
async checkEnvironment(nodeVersion) {
|
|
63631
63620
|
if (import_utils17.semver.lt(process.versions.node, nodeVersion || "12.22.12")) {
|
|
@@ -63714,6 +63703,7 @@ var AppAPI = class {
|
|
|
63714
63703
|
}
|
|
63715
63704
|
async forgeTemplate(templatePattern, filter, rename, parameters, type = "handlebars") {
|
|
63716
63705
|
try {
|
|
63706
|
+
this.generatorCore.logger.timing(`forgeTemplate`);
|
|
63717
63707
|
const { material } = this.generatorContext.current;
|
|
63718
63708
|
const resourceMap = await material.find(templatePattern, {
|
|
63719
63709
|
nodir: true,
|
|
@@ -63734,10 +63724,13 @@ var AppAPI = class {
|
|
|
63734
63724
|
this.generatorCore.logger.debug("base forging failed:", e);
|
|
63735
63725
|
this.generatorCore.logger.warn(i18n2.t(localeKeys2.templated.failed));
|
|
63736
63726
|
throw new Error("base forging failed");
|
|
63727
|
+
} finally {
|
|
63728
|
+
this.generatorCore.logger.timing(`forgeTemplate`, true);
|
|
63737
63729
|
}
|
|
63738
63730
|
}
|
|
63739
63731
|
async renderTemplateByFileType(templatePattern, filter, rename, parameters) {
|
|
63740
63732
|
try {
|
|
63733
|
+
this.generatorCore.logger.timing(`renderTemplateByFileType`);
|
|
63741
63734
|
const { material } = this.generatorContext.current;
|
|
63742
63735
|
const resourceMap = await material.find(templatePattern, {
|
|
63743
63736
|
nodir: true,
|
|
@@ -63768,6 +63761,8 @@ var AppAPI = class {
|
|
|
63768
63761
|
this.generatorCore.logger.debug("base forging failed:", e);
|
|
63769
63762
|
this.generatorCore.logger.warn(i18n2.t(localeKeys2.templated.failed));
|
|
63770
63763
|
throw new Error("base forging failed");
|
|
63764
|
+
} finally {
|
|
63765
|
+
this.generatorCore.logger.timing(`renderTemplateByFileType`, true);
|
|
63771
63766
|
}
|
|
63772
63767
|
}
|
|
63773
63768
|
async updateWorkspace(folder, workspaceName = "monorepo.code-workspace") {
|
|
@@ -63837,14 +63832,14 @@ var AppAPI = class {
|
|
|
63837
63832
|
}
|
|
63838
63833
|
}
|
|
63839
63834
|
constructor(generatorContext, generatorCore) {
|
|
63840
|
-
|
|
63841
|
-
|
|
63842
|
-
|
|
63843
|
-
|
|
63844
|
-
|
|
63845
|
-
|
|
63846
|
-
|
|
63847
|
-
|
|
63835
|
+
_define_property2(this, "i18n", i18n2);
|
|
63836
|
+
_define_property2(this, "npmApi", void 0);
|
|
63837
|
+
_define_property2(this, "gitApi", void 0);
|
|
63838
|
+
_define_property2(this, "handlebarsAPI", void 0);
|
|
63839
|
+
_define_property2(this, "ejsAPI", void 0);
|
|
63840
|
+
_define_property2(this, "fsAPI", void 0);
|
|
63841
|
+
_define_property2(this, "generatorCore", void 0);
|
|
63842
|
+
_define_property2(this, "generatorContext", void 0);
|
|
63848
63843
|
this.generatorCore = generatorCore;
|
|
63849
63844
|
this.generatorContext = generatorContext;
|
|
63850
63845
|
this.npmApi = new NpmAPI(generatorCore);
|
|
@@ -63855,11 +63850,11 @@ var AppAPI = class {
|
|
|
63855
63850
|
}
|
|
63856
63851
|
};
|
|
63857
63852
|
|
|
63858
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.
|
|
63853
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.1/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
|
|
63859
63854
|
var import_comment_json2 = __toESM(require_src2());
|
|
63860
63855
|
var declarationUpdate = __toESM(require_dist());
|
|
63861
63856
|
|
|
63862
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.
|
|
63857
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.1/node_modules/@modern-js/codesmith-api-json/dist/esm-node/utils/index.js
|
|
63863
63858
|
async function editJson(generatorCore, resource, getNewJsonValue) {
|
|
63864
63859
|
const originJsonValue = await resource.value();
|
|
63865
63860
|
const newJsonString = await getNewJsonValue(originJsonValue.content);
|
|
@@ -63872,7 +63867,7 @@ async function editJson(generatorCore, resource, getNewJsonValue) {
|
|
|
63872
63867
|
return newJsonString;
|
|
63873
63868
|
}
|
|
63874
63869
|
|
|
63875
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.
|
|
63870
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.1/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
|
|
63876
63871
|
var JsonAPI = class {
|
|
63877
63872
|
async get(resource) {
|
|
63878
63873
|
const originJsonValue = await resource.value();
|
|
@@ -63912,7 +63907,7 @@ var JsonAPI = class {
|
|
|
63912
63907
|
});
|
|
63913
63908
|
}
|
|
63914
63909
|
constructor(generatorCore) {
|
|
63915
|
-
|
|
63910
|
+
_define_property2(this, "generatorCore", void 0);
|
|
63916
63911
|
this.generatorCore = generatorCore;
|
|
63917
63912
|
}
|
|
63918
63913
|
};
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.
|
|
18
|
+
"version": "3.3.1",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./src/index.ts",
|
|
21
21
|
"main": "./dist/index.js",
|
|
@@ -24,21 +24,21 @@
|
|
|
24
24
|
"/dist/index.js"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@modern-js/utils": "2.
|
|
27
|
+
"@modern-js/utils": "2.42.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@modern-js/codesmith": "2.3.
|
|
31
|
-
"@modern-js/codesmith-api-app": "2.3.
|
|
32
|
-
"@modern-js/codesmith-api-json": "2.3.
|
|
30
|
+
"@modern-js/codesmith": "2.3.1",
|
|
31
|
+
"@modern-js/codesmith-api-app": "2.3.1",
|
|
32
|
+
"@modern-js/codesmith-api-json": "2.3.1",
|
|
33
33
|
"@types/jest": "^29",
|
|
34
34
|
"@types/node": "^14",
|
|
35
35
|
"jest": "^29",
|
|
36
36
|
"typescript": "^5",
|
|
37
|
-
"@modern-js/generator-common": "3.
|
|
38
|
-
"@modern-js/generator
|
|
39
|
-
"@modern-js/
|
|
40
|
-
"@scripts/build": "2.
|
|
41
|
-
"@scripts/jest-config": "2.
|
|
37
|
+
"@modern-js/generator-common": "3.3.1",
|
|
38
|
+
"@modern-js/dependence-generator": "3.3.1",
|
|
39
|
+
"@modern-js/generator-utils": "3.3.1",
|
|
40
|
+
"@scripts/build": "2.42.0",
|
|
41
|
+
"@scripts/jest-config": "2.42.0"
|
|
42
42
|
},
|
|
43
43
|
"sideEffects": false,
|
|
44
44
|
"publishConfig": {
|