@modern-js/entry-generator 3.4.17 → 3.6.0
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 +23 -33
- package/package.json +10 -10
- package/templates/routes/page.handlebars +4 -0
package/dist/index.js
CHANGED
|
@@ -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.2/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.2/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.2_@modern-js+codesmith@2.4.2/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.2_@modern-js+codesmith@2.4.2/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.2_@modern-js+codesmith@2.4.2/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.2_@modern-js+codesmith@2.4.2/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.2_@modern-js+codesmith@2.4.2/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.2_@modern-js+codesmith@2.4.2/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.2_@modern-js+codesmith@2.4.2/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.2/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.2/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.2/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.2_@modern-js+codesmith@2.4.2_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.2_@modern-js+codesmith@2.4.2_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.2_@modern-js+codesmith@2.4.2_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.2_@modern-js+codesmith@2.4.2_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.2_@modern-js+codesmith@2.4.2_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.2_@modern-js+codesmith@2.4.2_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.2_@modern-js+codesmith@2.4.2_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.2_@modern-js+codesmith@2.4.2_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.2_@modern-js+codesmith@2.4.2_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.2_@modern-js+codesmith@2.4.2_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.2_@modern-js+codesmith@2.4.2_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")) {
|
|
@@ -61868,11 +61868,6 @@ var EN_LOCALE2 = {
|
|
|
61868
61868
|
func: "Function",
|
|
61869
61869
|
framework: "Framework"
|
|
61870
61870
|
}
|
|
61871
|
-
},
|
|
61872
|
-
buildTools: {
|
|
61873
|
-
self: "Please select the bundler:",
|
|
61874
|
-
webpack: "webpack",
|
|
61875
|
-
rspack: "Rspack (experimental)"
|
|
61876
61871
|
}
|
|
61877
61872
|
};
|
|
61878
61873
|
|
|
@@ -61960,11 +61955,6 @@ var ZH_LOCALE2 = {
|
|
|
61960
61955
|
func: "函数模式",
|
|
61961
61956
|
framework: "框架模式"
|
|
61962
61957
|
}
|
|
61963
|
-
},
|
|
61964
|
-
buildTools: {
|
|
61965
|
-
self: "请选择构建工具",
|
|
61966
|
-
webpack: "webpack",
|
|
61967
|
-
rspack: "Rspack (实验性)"
|
|
61968
61958
|
}
|
|
61969
61959
|
};
|
|
61970
61960
|
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.
|
|
18
|
+
"version": "3.6.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
21
|
"files": [
|
|
@@ -23,21 +23,21 @@
|
|
|
23
23
|
"/dist/index.js"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@modern-js/utils": "2.
|
|
26
|
+
"@modern-js/utils": "2.60.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@modern-js/codesmith": "2.4.
|
|
30
|
-
"@modern-js/codesmith-api-app": "2.4.
|
|
31
|
-
"@modern-js/codesmith-api-handlebars": "2.4.
|
|
29
|
+
"@modern-js/codesmith": "2.4.2",
|
|
30
|
+
"@modern-js/codesmith-api-app": "2.4.2",
|
|
31
|
+
"@modern-js/codesmith-api-handlebars": "2.4.2",
|
|
32
32
|
"@types/jest": "^29",
|
|
33
33
|
"@types/node": "^14",
|
|
34
34
|
"jest": "^29",
|
|
35
35
|
"typescript": "^5",
|
|
36
|
-
"@modern-js/generator-common": "3.
|
|
37
|
-
"@modern-js/generator-utils": "3.
|
|
38
|
-
"@modern-js/plugin-i18n": "2.
|
|
39
|
-
"@scripts/
|
|
40
|
-
"@scripts/
|
|
36
|
+
"@modern-js/generator-common": "3.6.0",
|
|
37
|
+
"@modern-js/generator-utils": "3.6.0",
|
|
38
|
+
"@modern-js/plugin-i18n": "2.60.0",
|
|
39
|
+
"@scripts/build": "2.60.0",
|
|
40
|
+
"@scripts/jest-config": "2.60.0"
|
|
41
41
|
},
|
|
42
42
|
"sideEffects": false,
|
|
43
43
|
"publishConfig": {
|
|
@@ -35,6 +35,7 @@ const Index = () => (
|
|
|
35
35
|
<img
|
|
36
36
|
className="arrow-right"
|
|
37
37
|
src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"
|
|
38
|
+
alt="Guide"
|
|
38
39
|
/>
|
|
39
40
|
</h2>
|
|
40
41
|
<p>Follow the guides to use all features of Modern.js.</p>
|
|
@@ -50,6 +51,7 @@ const Index = () => (
|
|
|
50
51
|
<img
|
|
51
52
|
className="arrow-right"
|
|
52
53
|
src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"
|
|
54
|
+
alt="Tutorials"
|
|
53
55
|
/>
|
|
54
56
|
</h2>
|
|
55
57
|
<p>Learn to use Modern.js to create your first application.</p>
|
|
@@ -65,6 +67,7 @@ const Index = () => (
|
|
|
65
67
|
<img
|
|
66
68
|
className="arrow-right"
|
|
67
69
|
src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"
|
|
70
|
+
alt="Config"
|
|
68
71
|
/>
|
|
69
72
|
</h2>
|
|
70
73
|
<p>Find all configuration options provided by Modern.js.</p>
|
|
@@ -80,6 +83,7 @@ const Index = () => (
|
|
|
80
83
|
<img
|
|
81
84
|
className="arrow-right"
|
|
82
85
|
src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"
|
|
86
|
+
alt="Github"
|
|
83
87
|
/>
|
|
84
88
|
</h2>
|
|
85
89
|
<p>View the source code of Github, feel free to contribute.</p>
|