@modern-js/mwa-generator 3.4.15 → 3.4.16
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 +26 -26
- package/package.json +13 -13
- package/src/index.ts +1 -4
package/dist/index.js
CHANGED
|
@@ -6620,9 +6620,9 @@ var require_lib = __commonJS({
|
|
|
6620
6620
|
}
|
|
6621
6621
|
});
|
|
6622
6622
|
|
|
6623
|
-
// ../../../../node_modules/.pnpm/@modern-js+utils@2.58.
|
|
6623
|
+
// ../../../../node_modules/.pnpm/@modern-js+utils@2.58.1/node_modules/@modern-js/utils/dist/compiled/chalk/index.js
|
|
6624
6624
|
var require_chalk = __commonJS({
|
|
6625
|
-
"../../../../node_modules/.pnpm/@modern-js+utils@2.58.
|
|
6625
|
+
"../../../../node_modules/.pnpm/@modern-js+utils@2.58.1/node_modules/@modern-js/utils/dist/compiled/chalk/index.js"(exports, module2) {
|
|
6626
6626
|
"use strict";
|
|
6627
6627
|
(() => {
|
|
6628
6628
|
var e = { 44: (e2, t2, n2) => {
|
|
@@ -51057,12 +51057,12 @@ __export(src_exports, {
|
|
|
51057
51057
|
module.exports = __toCommonJS(src_exports);
|
|
51058
51058
|
var import_path7 = __toESM(require("path"));
|
|
51059
51059
|
|
|
51060
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.
|
|
51060
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
|
|
51061
51061
|
var import_path = __toESM(require("path"));
|
|
51062
51062
|
var import_utils = require("@modern-js/utils");
|
|
51063
51063
|
var FS_RESOURCE = "_codesmith_core_fs_resource";
|
|
51064
51064
|
|
|
51065
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.
|
|
51065
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
|
|
51066
51066
|
var import_utils2 = require("@modern-js/utils");
|
|
51067
51067
|
async function fsExists(path7) {
|
|
51068
51068
|
try {
|
|
@@ -51073,13 +51073,13 @@ async function fsExists(path7) {
|
|
|
51073
51073
|
}
|
|
51074
51074
|
}
|
|
51075
51075
|
|
|
51076
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.
|
|
51076
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/utils/renderString.js
|
|
51077
51077
|
var import_ejs = __toESM(require_ejs());
|
|
51078
51078
|
function renderString(template, fullData) {
|
|
51079
51079
|
return import_ejs.default.render(template, fullData) || "";
|
|
51080
51080
|
}
|
|
51081
51081
|
|
|
51082
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.
|
|
51082
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/index.js
|
|
51083
51083
|
var EjsAPI = class {
|
|
51084
51084
|
async renderTemplate(templateResource, target, parameters = {}) {
|
|
51085
51085
|
if (templateResource._type !== FS_RESOURCE) {
|
|
@@ -51111,7 +51111,7 @@ var EjsAPI = class {
|
|
|
51111
51111
|
}
|
|
51112
51112
|
};
|
|
51113
51113
|
|
|
51114
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.4.
|
|
51114
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-fs/dist/esm-node/index.js
|
|
51115
51115
|
var import_path2 = __toESM(require("path"));
|
|
51116
51116
|
var import_utils4 = require("@modern-js/utils");
|
|
51117
51117
|
var FsAPI = class {
|
|
@@ -51138,7 +51138,7 @@ var FsAPI = class {
|
|
|
51138
51138
|
}
|
|
51139
51139
|
};
|
|
51140
51140
|
|
|
51141
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.
|
|
51141
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-git/dist/esm-node/utils/index.js
|
|
51142
51142
|
var import_utils5 = require("@modern-js/utils");
|
|
51143
51143
|
async function canUseGit() {
|
|
51144
51144
|
try {
|
|
@@ -51213,7 +51213,7 @@ async function gitCommit(cwd, commitMessage) {
|
|
|
51213
51213
|
});
|
|
51214
51214
|
}
|
|
51215
51215
|
|
|
51216
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.
|
|
51216
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-git/dist/esm-node/index.js
|
|
51217
51217
|
var GitAPI = class {
|
|
51218
51218
|
async isInGitRepo(cwd = this.generatorCore.outputPath) {
|
|
51219
51219
|
const canUse = await canUseGit();
|
|
@@ -51263,7 +51263,7 @@ var GitAPI = class {
|
|
|
51263
51263
|
}
|
|
51264
51264
|
};
|
|
51265
51265
|
|
|
51266
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.
|
|
51266
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/utils/renderString.js
|
|
51267
51267
|
var import_handlebars = __toESM(require_lib());
|
|
51268
51268
|
function renderString2(template, fullData, registers) {
|
|
51269
51269
|
const helpers = {
|
|
@@ -51277,7 +51277,7 @@ function renderString2(template, fullData, registers) {
|
|
|
51277
51277
|
return import_handlebars.default.compile(template)(fullData) || "";
|
|
51278
51278
|
}
|
|
51279
51279
|
|
|
51280
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.
|
|
51280
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.1_@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/index.js
|
|
51281
51281
|
var HandlebarsAPI = class {
|
|
51282
51282
|
async registerHelp(helpers) {
|
|
51283
51283
|
this.registers.helpers = {
|
|
@@ -51325,7 +51325,7 @@ var HandlebarsAPI = class {
|
|
|
51325
51325
|
}
|
|
51326
51326
|
};
|
|
51327
51327
|
|
|
51328
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.
|
|
51328
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
|
|
51329
51329
|
var import_utils8 = require("@modern-js/utils");
|
|
51330
51330
|
async function canUseNvm() {
|
|
51331
51331
|
try {
|
|
@@ -51375,7 +51375,7 @@ async function canUsePnpm() {
|
|
|
51375
51375
|
}
|
|
51376
51376
|
}
|
|
51377
51377
|
|
|
51378
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.
|
|
51378
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
|
|
51379
51379
|
var import_utils9 = require("@modern-js/utils");
|
|
51380
51380
|
function execaWithStreamLog(command, args, options) {
|
|
51381
51381
|
const promise = (0, import_utils9.execa)(command, args, {
|
|
@@ -51471,7 +51471,7 @@ async function pnpmInstall({ cwd, registryUrl, ignoreScripts, useNvm }) {
|
|
|
51471
51471
|
throw new Error("please install pnpm first");
|
|
51472
51472
|
}
|
|
51473
51473
|
|
|
51474
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.
|
|
51474
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
|
|
51475
51475
|
var NpmAPI = class {
|
|
51476
51476
|
npmInstall({ cwd, registryUrl, ignoreScripts }) {
|
|
51477
51477
|
return npmInstall({
|
|
@@ -61055,10 +61055,10 @@ var Schema = (
|
|
|
61055
61055
|
}()
|
|
61056
61056
|
);
|
|
61057
61057
|
|
|
61058
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.
|
|
61058
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
|
|
61059
61059
|
var import_inquirer = __toESM(require_inquirer());
|
|
61060
61060
|
|
|
61061
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.
|
|
61061
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/transform.js
|
|
61062
61062
|
var import_lodash = require("@modern-js/utils/lodash");
|
|
61063
61063
|
function validateSchema(schema) {
|
|
61064
61064
|
const { type, properties } = schema;
|
|
@@ -61150,7 +61150,7 @@ function transformForm(schema, configValue = {}, validateMap, initValue) {
|
|
|
61150
61150
|
return getQuestionFromSchema(schema, configValue, validateMap, initValue);
|
|
61151
61151
|
}
|
|
61152
61152
|
|
|
61153
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.
|
|
61153
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
|
|
61154
61154
|
var compileRule = (rule, scope) => {
|
|
61155
61155
|
const state = Schema.compile(rule, {
|
|
61156
61156
|
$self: {},
|
|
@@ -61254,7 +61254,7 @@ async function prompt(schema, configValue = {}, validateMap, initValue) {
|
|
|
61254
61254
|
return answers;
|
|
61255
61255
|
}
|
|
61256
61256
|
|
|
61257
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.
|
|
61257
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/inquirer.js
|
|
61258
61258
|
var CLIReader = class {
|
|
61259
61259
|
getAnswers() {
|
|
61260
61260
|
return this.answers;
|
|
@@ -61283,7 +61283,7 @@ var CLIReader = class {
|
|
|
61283
61283
|
}
|
|
61284
61284
|
};
|
|
61285
61285
|
|
|
61286
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.
|
|
61286
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
|
|
61287
61287
|
var import_utils13 = require("@modern-js/utils");
|
|
61288
61288
|
var import_lodash5 = require("@modern-js/utils/lodash");
|
|
61289
61289
|
var import_comment_json = __toESM(require_src2());
|
|
@@ -61352,7 +61352,7 @@ var I18n = class {
|
|
|
61352
61352
|
}
|
|
61353
61353
|
};
|
|
61354
61354
|
|
|
61355
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.
|
|
61355
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/en.js
|
|
61356
61356
|
var EN_LOCALE = {
|
|
61357
61357
|
environment: {
|
|
61358
61358
|
node_version: "please upgrade node to lts version",
|
|
@@ -61379,7 +61379,7 @@ var EN_LOCALE = {
|
|
|
61379
61379
|
}
|
|
61380
61380
|
};
|
|
61381
61381
|
|
|
61382
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.
|
|
61382
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/zh.js
|
|
61383
61383
|
var ZH_LOCALE = {
|
|
61384
61384
|
environment: {
|
|
61385
61385
|
node_version: "请升级 Node 版本至 LIS",
|
|
@@ -61406,14 +61406,14 @@ var ZH_LOCALE = {
|
|
|
61406
61406
|
}
|
|
61407
61407
|
};
|
|
61408
61408
|
|
|
61409
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.
|
|
61409
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/index.js
|
|
61410
61410
|
var i18n = new I18n();
|
|
61411
61411
|
var localeKeys = i18n.init("zh", {
|
|
61412
61412
|
zh: ZH_LOCALE,
|
|
61413
61413
|
en: EN_LOCALE
|
|
61414
61414
|
});
|
|
61415
61415
|
|
|
61416
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.
|
|
61416
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/checkUseNvm.js
|
|
61417
61417
|
var import_path4 = __toESM(require("path"));
|
|
61418
61418
|
var import_utils12 = require("@modern-js/utils");
|
|
61419
61419
|
var NODE_MAJOR_VERSION_MAP = {
|
|
@@ -61461,7 +61461,7 @@ async function checkUseNvm(cwd, logger) {
|
|
|
61461
61461
|
}
|
|
61462
61462
|
}
|
|
61463
61463
|
|
|
61464
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.
|
|
61464
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/transform.js
|
|
61465
61465
|
var import_lodash4 = require("@modern-js/utils/lodash");
|
|
61466
61466
|
function transformInquirerSchema(questions, configValue = {}, validateMap = {}, initValue = {}) {
|
|
61467
61467
|
for (const question of questions) {
|
|
@@ -61489,7 +61489,7 @@ function transformInquirerSchema(questions, configValue = {}, validateMap = {},
|
|
|
61489
61489
|
return questions;
|
|
61490
61490
|
}
|
|
61491
61491
|
|
|
61492
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.
|
|
61492
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.1_@modern-js+codesmith@2.4.1_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
|
|
61493
61493
|
var AppAPI = class {
|
|
61494
61494
|
async checkEnvironment(nodeVersion) {
|
|
61495
61495
|
if (import_utils13.semver.lt(process.versions.node, nodeVersion || "12.22.12")) {
|
|
@@ -62075,7 +62075,7 @@ var getPackageNameSchema = (extra = {}) => {
|
|
|
62075
62075
|
};
|
|
62076
62076
|
|
|
62077
62077
|
// ../../generator-common/dist/esm-node/common/packagePath.js
|
|
62078
|
-
var PackagePathRegex =
|
|
62078
|
+
var PackagePathRegex = /^[a-z0-9-_]+[a-z0-9-\/_]*$/;
|
|
62079
62079
|
var getPackagePathSchema = (extra) => {
|
|
62080
62080
|
return {
|
|
62081
62081
|
type: "string",
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.4.
|
|
18
|
+
"version": "3.4.16",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
21
|
"files": [
|
|
@@ -23,24 +23,24 @@
|
|
|
23
23
|
"/dist/index.js"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@modern-js/utils": "2.58.
|
|
26
|
+
"@modern-js/utils": "2.58.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@modern-js/codesmith": "2.4.
|
|
30
|
-
"@modern-js/codesmith-api-app": "2.4.
|
|
29
|
+
"@modern-js/codesmith": "2.4.1",
|
|
30
|
+
"@modern-js/codesmith-api-app": "2.4.1",
|
|
31
31
|
"@types/jest": "^29",
|
|
32
32
|
"@types/node": "^14",
|
|
33
33
|
"jest": "^29",
|
|
34
34
|
"typescript": "^5",
|
|
35
|
-
"@modern-js/base-generator": "3.4.
|
|
36
|
-
"@modern-js/
|
|
37
|
-
"@modern-js/generator
|
|
38
|
-
"@modern-js/
|
|
39
|
-
"@modern-js/generator-utils": "3.4.
|
|
40
|
-
"@modern-js/packages-generator": "3.4.
|
|
41
|
-
"@modern-js/plugin-i18n": "2.58.
|
|
42
|
-
"@scripts/build": "2.58.
|
|
43
|
-
"@scripts/jest-config": "2.58.
|
|
35
|
+
"@modern-js/base-generator": "3.4.16",
|
|
36
|
+
"@modern-js/dependence-generator": "3.4.16",
|
|
37
|
+
"@modern-js/entry-generator": "3.4.16",
|
|
38
|
+
"@modern-js/generator-common": "3.4.16",
|
|
39
|
+
"@modern-js/generator-utils": "3.4.16",
|
|
40
|
+
"@modern-js/packages-generator": "3.4.16",
|
|
41
|
+
"@modern-js/plugin-i18n": "2.58.2",
|
|
42
|
+
"@scripts/build": "2.58.2",
|
|
43
|
+
"@scripts/jest-config": "2.58.2"
|
|
44
44
|
},
|
|
45
45
|
"sideEffects": false,
|
|
46
46
|
"publishConfig": {
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
-
import { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
|
|
2
|
+
import type { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
|
|
3
3
|
import { AppAPI } from '@modern-js/codesmith-api-app';
|
|
4
4
|
import {
|
|
5
5
|
i18n as commonI18n,
|
|
@@ -207,7 +207,6 @@ export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
|
|
207
207
|
i18n.changeLanguage({ locale });
|
|
208
208
|
|
|
209
209
|
if (!(await appApi.checkEnvironment())) {
|
|
210
|
-
// eslint-disable-next-line no-process-exit
|
|
211
210
|
process.exit(1);
|
|
212
211
|
}
|
|
213
212
|
|
|
@@ -220,7 +219,6 @@ export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
|
|
220
219
|
({ projectPath } = await handleTemplateFile(context, generator, appApi));
|
|
221
220
|
} catch (e) {
|
|
222
221
|
generator.logger.error(e);
|
|
223
|
-
// eslint-disable-next-line no-process-exit
|
|
224
222
|
process.exit(1);
|
|
225
223
|
}
|
|
226
224
|
|
|
@@ -237,7 +235,6 @@ export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
|
|
237
235
|
await appApi.runGitAndInstall(context.config.gitCommitMessage);
|
|
238
236
|
} catch (e) {
|
|
239
237
|
generator.logger.error(e);
|
|
240
|
-
// eslint-disable-next-line no-process-exit
|
|
241
238
|
process.exit(1);
|
|
242
239
|
}
|
|
243
240
|
|