@modern-js/entry-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.
Files changed (3) hide show
  1. package/dist/index.js +25 -25
  2. package/package.json +10 -10
  3. package/src/index.ts +1 -2
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.0/node_modules/@modern-js/utils/dist/compiled/chalk/index.js
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.0/node_modules/@modern-js/utils/dist/compiled/chalk/index.js"(exports, module2) {
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) => {
@@ -51375,12 +51375,12 @@ async function getPackageObj(context) {
51375
51375
  return JSON.parse(pkgStr);
51376
51376
  }
51377
51377
 
51378
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
51378
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
51379
51379
  var import_path2 = __toESM(require("path"));
51380
51380
  var import_utils4 = require("@modern-js/utils");
51381
51381
  var FS_RESOURCE = "_codesmith_core_fs_resource";
51382
51382
 
51383
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
51383
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.4.1/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
51384
51384
  var import_utils5 = require("@modern-js/utils");
51385
51385
  async function fsExists(path7) {
51386
51386
  try {
@@ -51391,13 +51391,13 @@ async function fsExists(path7) {
51391
51391
  }
51392
51392
  }
51393
51393
 
51394
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.0_@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/utils/renderString.js
51394
+ // ../../../../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
51395
51395
  var import_ejs = __toESM(require_ejs());
51396
51396
  function renderString(template, fullData) {
51397
51397
  return import_ejs.default.render(template, fullData) || "";
51398
51398
  }
51399
51399
 
51400
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.4.0_@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/index.js
51400
+ // ../../../../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
51401
51401
  var EjsAPI = class {
51402
51402
  async renderTemplate(templateResource, target, parameters = {}) {
51403
51403
  if (templateResource._type !== FS_RESOURCE) {
@@ -51429,7 +51429,7 @@ var EjsAPI = class {
51429
51429
  }
51430
51430
  };
51431
51431
 
51432
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.4.0_@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith-api-fs/dist/esm-node/index.js
51432
+ // ../../../../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
51433
51433
  var import_path3 = __toESM(require("path"));
51434
51434
  var import_utils7 = require("@modern-js/utils");
51435
51435
  var FsAPI = class {
@@ -51456,7 +51456,7 @@ var FsAPI = class {
51456
51456
  }
51457
51457
  };
51458
51458
 
51459
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.0_@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith-api-git/dist/esm-node/utils/index.js
51459
+ // ../../../../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
51460
51460
  var import_utils8 = require("@modern-js/utils");
51461
51461
  async function canUseGit() {
51462
51462
  try {
@@ -51531,7 +51531,7 @@ async function gitCommit(cwd, commitMessage) {
51531
51531
  });
51532
51532
  }
51533
51533
 
51534
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.4.0_@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith-api-git/dist/esm-node/index.js
51534
+ // ../../../../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
51535
51535
  var GitAPI = class {
51536
51536
  async isInGitRepo(cwd = this.generatorCore.outputPath) {
51537
51537
  const canUse = await canUseGit();
@@ -51581,7 +51581,7 @@ var GitAPI = class {
51581
51581
  }
51582
51582
  };
51583
51583
 
51584
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.0_@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/utils/renderString.js
51584
+ // ../../../../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
51585
51585
  var import_handlebars = __toESM(require_lib());
51586
51586
  function renderString2(template, fullData, registers) {
51587
51587
  const helpers = {
@@ -51595,7 +51595,7 @@ function renderString2(template, fullData, registers) {
51595
51595
  return import_handlebars.default.compile(template)(fullData) || "";
51596
51596
  }
51597
51597
 
51598
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.4.0_@modern-js+codesmith@2.4.0/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/index.js
51598
+ // ../../../../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
51599
51599
  var HandlebarsAPI = class {
51600
51600
  async registerHelp(helpers) {
51601
51601
  this.registers.helpers = {
@@ -51643,7 +51643,7 @@ var HandlebarsAPI = class {
51643
51643
  }
51644
51644
  };
51645
51645
 
51646
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.0/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
51646
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
51647
51647
  var import_utils11 = require("@modern-js/utils");
51648
51648
  async function canUseNvm() {
51649
51649
  try {
@@ -51693,7 +51693,7 @@ async function canUsePnpm3() {
51693
51693
  }
51694
51694
  }
51695
51695
 
51696
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.0/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
51696
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
51697
51697
  var import_utils12 = require("@modern-js/utils");
51698
51698
  function execaWithStreamLog(command, args, options) {
51699
51699
  const promise = (0, import_utils12.execa)(command, args, {
@@ -51789,7 +51789,7 @@ async function pnpmInstall({ cwd, registryUrl, ignoreScripts, useNvm }) {
51789
51789
  throw new Error("please install pnpm first");
51790
51790
  }
51791
51791
 
51792
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.0/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
51792
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.4.1/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
51793
51793
  var NpmAPI = class {
51794
51794
  npmInstall({ cwd, registryUrl, ignoreScripts }) {
51795
51795
  return npmInstall({
@@ -61373,10 +61373,10 @@ var Schema = (
61373
61373
  }()
61374
61374
  );
61375
61375
 
61376
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
61376
+ // ../../../../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
61377
61377
  var import_inquirer = __toESM(require_inquirer());
61378
61378
 
61379
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/transform.js
61379
+ // ../../../../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
61380
61380
  var import_lodash3 = require("@modern-js/utils/lodash");
61381
61381
  function validateSchema(schema) {
61382
61382
  const { type, properties } = schema;
@@ -61468,7 +61468,7 @@ function transformForm(schema, configValue = {}, validateMap, initValue) {
61468
61468
  return getQuestionFromSchema(schema, configValue, validateMap, initValue);
61469
61469
  }
61470
61470
 
61471
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
61471
+ // ../../../../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
61472
61472
  var compileRule = (rule, scope) => {
61473
61473
  const state = Schema.compile(rule, {
61474
61474
  $self: {},
@@ -61572,7 +61572,7 @@ async function prompt(schema, configValue = {}, validateMap, initValue) {
61572
61572
  return answers;
61573
61573
  }
61574
61574
 
61575
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/inquirer.js
61575
+ // ../../../../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
61576
61576
  var CLIReader = class {
61577
61577
  getAnswers() {
61578
61578
  return this.answers;
@@ -61601,7 +61601,7 @@ var CLIReader = class {
61601
61601
  }
61602
61602
  };
61603
61603
 
61604
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
61604
+ // ../../../../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
61605
61605
  var import_utils16 = require("@modern-js/utils");
61606
61606
  var import_lodash7 = require("@modern-js/utils/lodash");
61607
61607
  var import_comment_json = __toESM(require_src2());
@@ -61670,7 +61670,7 @@ var I18n2 = class {
61670
61670
  }
61671
61671
  };
61672
61672
 
61673
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/en.js
61673
+ // ../../../../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
61674
61674
  var EN_LOCALE2 = {
61675
61675
  environment: {
61676
61676
  node_version: "please upgrade node to lts version",
@@ -61697,7 +61697,7 @@ var EN_LOCALE2 = {
61697
61697
  }
61698
61698
  };
61699
61699
 
61700
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/zh.js
61700
+ // ../../../../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
61701
61701
  var ZH_LOCALE2 = {
61702
61702
  environment: {
61703
61703
  node_version: "请升级 Node 版本至 LIS",
@@ -61724,14 +61724,14 @@ var ZH_LOCALE2 = {
61724
61724
  }
61725
61725
  };
61726
61726
 
61727
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/index.js
61727
+ // ../../../../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
61728
61728
  var i18n2 = new I18n2();
61729
61729
  var localeKeys2 = i18n2.init("zh", {
61730
61730
  zh: ZH_LOCALE2,
61731
61731
  en: EN_LOCALE2
61732
61732
  });
61733
61733
 
61734
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/checkUseNvm.js
61734
+ // ../../../../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
61735
61735
  var import_path5 = __toESM(require("path"));
61736
61736
  var import_utils15 = require("@modern-js/utils");
61737
61737
  var NODE_MAJOR_VERSION_MAP = {
@@ -61779,7 +61779,7 @@ async function checkUseNvm(cwd, logger) {
61779
61779
  }
61780
61780
  }
61781
61781
 
61782
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/transform.js
61782
+ // ../../../../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
61783
61783
  var import_lodash6 = require("@modern-js/utils/lodash");
61784
61784
  function transformInquirerSchema(questions, configValue = {}, validateMap = {}, initValue = {}) {
61785
61785
  for (const question of questions) {
@@ -61807,7 +61807,7 @@ function transformInquirerSchema(questions, configValue = {}, validateMap = {},
61807
61807
  return questions;
61808
61808
  }
61809
61809
 
61810
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.4.0_@modern-js+codesmith@2.4.0_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
61810
+ // ../../../../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
61811
61811
  var AppAPI = class {
61812
61812
  async checkEnvironment(nodeVersion) {
61813
61813
  if (import_utils16.semver.lt(process.versions.node, nodeVersion || "12.22.12")) {
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.4.15",
18
+ "version": "3.4.16",
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.58.1"
26
+ "@modern-js/utils": "2.58.2"
27
27
  },
28
28
  "devDependencies": {
29
- "@modern-js/codesmith": "2.4.0",
30
- "@modern-js/codesmith-api-app": "2.4.0",
31
- "@modern-js/codesmith-api-handlebars": "2.4.0",
29
+ "@modern-js/codesmith": "2.4.1",
30
+ "@modern-js/codesmith-api-app": "2.4.1",
31
+ "@modern-js/codesmith-api-handlebars": "2.4.1",
32
32
  "@types/jest": "^29",
33
33
  "@types/node": "^14",
34
34
  "jest": "^29",
35
35
  "typescript": "^5",
36
- "@modern-js/generator-common": "3.4.15",
37
- "@modern-js/generator-utils": "3.4.15",
38
- "@modern-js/plugin-i18n": "2.58.1",
39
- "@scripts/build": "2.58.1",
40
- "@scripts/jest-config": "2.58.1"
36
+ "@modern-js/generator-utils": "3.4.16",
37
+ "@modern-js/generator-common": "3.4.16",
38
+ "@modern-js/plugin-i18n": "2.58.2",
39
+ "@scripts/build": "2.58.2",
40
+ "@scripts/jest-config": "2.58.2"
41
41
  },
42
42
  "sideEffects": false,
43
43
  "publishConfig": {
package/src/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import path from 'path';
2
2
  import { merge } from '@modern-js/utils/lodash';
3
3
  import { fs, getPackageObj, isTsProject } from '@modern-js/generator-utils';
4
- import { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
4
+ import type { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
5
5
  import { AppAPI } from '@modern-js/codesmith-api-app';
6
6
  import {
7
7
  i18n as commonI18n,
@@ -116,7 +116,6 @@ export default async (context: GeneratorContext, generator: GeneratorCore) => {
116
116
  i18n.changeLanguage({ locale });
117
117
 
118
118
  if (!(await appApi.checkEnvironment())) {
119
- // eslint-disable-next-line no-process-exit
120
119
  process.exit(1);
121
120
  }
122
121