@modern-js/ssg-generator 3.3.9 → 3.3.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/dist/index.js +44 -38
  2. package/package.json +10 -10
  3. package/src/index.ts +6 -12
package/dist/index.js CHANGED
@@ -51054,7 +51054,6 @@ __export(src_exports, {
51054
51054
  default: () => src_default
51055
51055
  });
51056
51056
  module.exports = __toCommonJS(src_exports);
51057
- var import_path6 = __toESM(require("path"));
51058
51057
 
51059
51058
  // ../../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/esm/_define_property.js
51060
51059
  function _define_property(obj, key, value) {
@@ -51065,12 +51064,12 @@ function _define_property(obj, key, value) {
51065
51064
  return obj;
51066
51065
  }
51067
51066
 
51068
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
51067
+ // ../../../../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/index.js
51069
51068
  var import_utils13 = require("@modern-js/utils");
51070
51069
  var import_lodash5 = require("@modern-js/utils/lodash");
51071
51070
  var import_comment_json = __toESM(require_src2());
51072
51071
 
51073
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.4/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
51072
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.5/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
51074
51073
  var import_utils = require("@modern-js/utils");
51075
51074
  async function canUseNvm() {
51076
51075
  try {
@@ -51120,7 +51119,7 @@ async function canUsePnpm() {
51120
51119
  }
51121
51120
  }
51122
51121
 
51123
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.4/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
51122
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.5/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
51124
51123
  var import_utils2 = require("@modern-js/utils");
51125
51124
  function execaWithStreamLog(command, args, options) {
51126
51125
  const promise = (0, import_utils2.execa)(command, args, {
@@ -51216,7 +51215,7 @@ async function pnpmInstall({ cwd, registryUrl, ignoreScripts, useNvm }) {
51216
51215
  throw new Error("please install pnpm first");
51217
51216
  }
51218
51217
 
51219
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.4/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
51218
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.5/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
51220
51219
  var NpmAPI = class {
51221
51220
  npmInstall({ cwd, registryUrl, ignoreScripts }) {
51222
51221
  return npmInstall({
@@ -51245,7 +51244,7 @@ var NpmAPI = class {
51245
51244
  }
51246
51245
  };
51247
51246
 
51248
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.4_@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith-api-git/dist/esm-node/utils/index.js
51247
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-git/dist/esm-node/utils/index.js
51249
51248
  var import_utils4 = require("@modern-js/utils");
51250
51249
  async function canUseGit() {
51251
51250
  try {
@@ -51320,7 +51319,7 @@ async function gitCommit(cwd, commitMessage) {
51320
51319
  });
51321
51320
  }
51322
51321
 
51323
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.4_@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith-api-git/dist/esm-node/index.js
51322
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-git/dist/esm-node/index.js
51324
51323
  var GitAPI = class {
51325
51324
  async isInGitRepo(cwd = this.generatorCore.outputPath) {
51326
51325
  const canUse = await canUseGit();
@@ -51372,12 +51371,12 @@ var GitAPI = class {
51372
51371
  }
51373
51372
  };
51374
51373
 
51375
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
51374
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
51376
51375
  var import_path = __toESM(require("path"));
51377
51376
  var import_utils6 = require("@modern-js/utils");
51378
51377
  var FS_RESOURCE = "_codesmith_core_fs_resource";
51379
51378
 
51380
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
51379
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
51381
51380
  var import_utils7 = require("@modern-js/utils");
51382
51381
  async function fsExists(path6) {
51383
51382
  try {
@@ -51388,7 +51387,7 @@ async function fsExists(path6) {
51388
51387
  }
51389
51388
  }
51390
51389
 
51391
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.4_@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/utils/renderString.js
51390
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/utils/renderString.js
51392
51391
  var import_handlebars = __toESM(require_lib());
51393
51392
  function renderString(template, fullData, registers) {
51394
51393
  const helpers = {
@@ -51402,7 +51401,7 @@ function renderString(template, fullData, registers) {
51402
51401
  return import_handlebars.default.compile(template)(fullData) || "";
51403
51402
  }
51404
51403
 
51405
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.4_@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/index.js
51404
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/index.js
51406
51405
  var HandlebarsAPI = class {
51407
51406
  async registerHelp(helpers) {
51408
51407
  this.registers.helpers = {
@@ -51452,13 +51451,13 @@ var HandlebarsAPI = class {
51452
51451
  }
51453
51452
  };
51454
51453
 
51455
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.4_@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/utils/renderString.js
51454
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/utils/renderString.js
51456
51455
  var import_ejs = __toESM(require_ejs());
51457
51456
  function renderString2(template, fullData) {
51458
51457
  return import_ejs.default.render(template, fullData) || "";
51459
51458
  }
51460
51459
 
51461
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.4_@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/index.js
51460
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/index.js
51462
51461
  var EjsAPI = class {
51463
51462
  async renderTemplate(templateResource, target, parameters = {}) {
51464
51463
  if (templateResource._type !== FS_RESOURCE) {
@@ -51491,7 +51490,7 @@ var EjsAPI = class {
51491
51490
  }
51492
51491
  };
51493
51492
 
51494
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.3.4_@modern-js+codesmith@2.3.4/node_modules/@modern-js/codesmith-api-fs/dist/esm-node/index.js
51493
+ // ../../../../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
51495
51494
  var import_path2 = __toESM(require("path"));
51496
51495
  var import_utils10 = require("@modern-js/utils");
51497
51496
  var FsAPI = class {
@@ -61075,10 +61074,10 @@ var Schema = (
61075
61074
  }()
61076
61075
  );
61077
61076
 
61078
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
61077
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
61079
61078
  var import_inquirer = __toESM(require_inquirer());
61080
61079
 
61081
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/transform.js
61080
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/transform.js
61082
61081
  var import_lodash = require("@modern-js/utils/lodash");
61083
61082
  function validateSchema(schema) {
61084
61083
  const { type, properties } = schema;
@@ -61170,7 +61169,7 @@ function transformForm(schema, configValue = {}, validateMap, initValue) {
61170
61169
  return getQuestionFromSchema(schema, configValue, validateMap, initValue);
61171
61170
  }
61172
61171
 
61173
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
61172
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
61174
61173
  var compileRule = (rule, scope) => {
61175
61174
  const state = Schema.compile(rule, {
61176
61175
  $self: {},
@@ -61274,7 +61273,7 @@ async function prompt(schema, configValue = {}, validateMap, initValue) {
61274
61273
  return answers;
61275
61274
  }
61276
61275
 
61277
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/inquirer.js
61276
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/inquirer.js
61278
61277
  var CLIReader = class {
61279
61278
  getAnswers() {
61280
61279
  return this.answers;
@@ -61305,7 +61304,7 @@ var CLIReader = class {
61305
61304
  }
61306
61305
  };
61307
61306
 
61308
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
61307
+ // ../../../../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/index.js
61309
61308
  var import_inquirer2 = __toESM(require_inquirer2());
61310
61309
 
61311
61310
  // ../../../../node_modules/.pnpm/@modern-js+plugin-i18n@2.37.2/node_modules/@modern-js/plugin-i18n/dist/esm-node/index.js
@@ -61371,7 +61370,7 @@ var I18n = class {
61371
61370
  }
61372
61371
  };
61373
61372
 
61374
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/zh.js
61373
+ // ../../../../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/locale/zh.js
61375
61374
  var ZH_LOCALE = {
61376
61375
  environment: {
61377
61376
  node_version: "请升级 Node 版本至 LIS",
@@ -61398,7 +61397,7 @@ var ZH_LOCALE = {
61398
61397
  }
61399
61398
  };
61400
61399
 
61401
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/en.js
61400
+ // ../../../../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/locale/en.js
61402
61401
  var EN_LOCALE = {
61403
61402
  environment: {
61404
61403
  node_version: "please upgrade node to lts version",
@@ -61425,14 +61424,14 @@ var EN_LOCALE = {
61425
61424
  }
61426
61425
  };
61427
61426
 
61428
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/index.js
61427
+ // ../../../../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/locale/index.js
61429
61428
  var i18n = new I18n();
61430
61429
  var localeKeys = i18n.init("zh", {
61431
61430
  zh: ZH_LOCALE,
61432
61431
  en: EN_LOCALE
61433
61432
  });
61434
61433
 
61435
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/transform.js
61434
+ // ../../../../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/transform.js
61436
61435
  var import_lodash4 = require("@modern-js/utils/lodash");
61437
61436
  function transformInquirerSchema(questions, configValue = {}, validateMap = {}, initValue = {}) {
61438
61437
  for (const question of questions) {
@@ -61460,7 +61459,7 @@ function transformInquirerSchema(questions, configValue = {}, validateMap = {},
61460
61459
  return questions;
61461
61460
  }
61462
61461
 
61463
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/checkUseNvm.js
61462
+ // ../../../../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
61464
61463
  var import_path4 = __toESM(require("path"));
61465
61464
  var import_utils12 = require("@modern-js/utils");
61466
61465
  var NODE_MAJOR_VERSION_MAP = {
@@ -61508,7 +61507,7 @@ async function checkUseNvm(cwd, logger) {
61508
61507
  }
61509
61508
  }
61510
61509
 
61511
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.4_@modern-js+codesmith@2.3.4_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
61510
+ // ../../../../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/index.js
61512
61511
  var AppAPI = class {
61513
61512
  async checkEnvironment(nodeVersion) {
61514
61513
  if (import_utils13.semver.lt(process.versions.node, nodeVersion || "12.22.12")) {
@@ -61749,7 +61748,7 @@ var AppAPI = class {
61749
61748
  };
61750
61749
 
61751
61750
  // ../../generator-utils/dist/esm/index.js
61752
- var import_path5 = __toESM(require("path"));
61751
+ var import_path6 = __toESM(require("path"));
61753
61752
  var import_utils16 = require("@modern-js/utils");
61754
61753
 
61755
61754
  // ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_define_property.js
@@ -62054,17 +62053,32 @@ async function fileExist(filePath) {
62054
62053
  }
62055
62054
  }
62056
62055
 
62056
+ // ../../generator-utils/dist/esm/utils/getGeneratorPath.js
62057
+ var import_path5 = __toESM(require("path"));
62058
+ var getGeneratorPath = (generator, distTag, paths) => {
62059
+ if (process.env.CODESMITH_ENV === "development") {
62060
+ return import_path5.default.dirname(require.resolve(generator, {
62061
+ paths: paths !== null && paths !== void 0 ? paths : [
62062
+ process.cwd()
62063
+ ]
62064
+ }));
62065
+ } else if (distTag) {
62066
+ return `${generator}@${distTag}`;
62067
+ }
62068
+ return generator;
62069
+ };
62070
+
62057
62071
  // ../../generator-utils/dist/esm/index.js
62058
62072
  var import_utils17 = require("@modern-js/utils");
62059
62073
  function isTsProject(appDir) {
62060
- return import_utils16.fs.existsSync(import_path5.default.join(appDir, "tsconfig.json"));
62074
+ return import_utils16.fs.existsSync(import_path6.default.join(appDir, "tsconfig.json"));
62061
62075
  }
62062
62076
  async function getModernConfigFile(appDir) {
62063
- let exist = await fileExist(import_path5.default.join(appDir, "modern.config.ts"));
62077
+ let exist = await fileExist(import_path6.default.join(appDir, "modern.config.ts"));
62064
62078
  if (exist) {
62065
62079
  return "modern.config.ts";
62066
62080
  }
62067
- exist = await fileExist(import_path5.default.join(appDir, "modern.config.js"));
62081
+ exist = await fileExist(import_path6.default.join(appDir, "modern.config.js"));
62068
62082
  if (exist) {
62069
62083
  return "modern.config.js";
62070
62084
  }
@@ -62086,17 +62100,9 @@ var i18n3 = new I18n2();
62086
62100
  var localeKeys3 = i18n3.init("en", { zh: ZH_LOCALE3, en: EN_LOCALE3 });
62087
62101
 
62088
62102
  // src/index.ts
62089
- var getGeneratorPath = (generator, distTag) => {
62090
- if (process.env.CODESMITH_ENV === "development") {
62091
- return import_path6.default.dirname(require.resolve(generator));
62092
- } else if (distTag) {
62093
- return `${generator}@${distTag}`;
62094
- }
62095
- return generator;
62096
- };
62097
62103
  var handleTemplateFile = async (context, _generator, appApi) => {
62098
62104
  await appApi.runSubGenerator(
62099
- getGeneratorPath(DependenceGenerator, context.config.distTag),
62105
+ getGeneratorPath(DependenceGenerator, context.config.distTag, [__dirname]),
62100
62106
  void 0,
62101
62107
  {
62102
62108
  ...context.config,
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.3.9",
18
+ "version": "3.3.11",
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.47.0"
26
+ "@modern-js/utils": "2.48.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@modern-js/codesmith": "2.3.4",
30
- "@modern-js/codesmith-api-app": "2.3.4",
29
+ "@modern-js/codesmith": "2.3.5",
30
+ "@modern-js/codesmith-api-app": "2.3.5",
31
31
  "@types/jest": "^29",
32
32
  "@types/node": "^14",
33
33
  "jest": "^29",
34
34
  "typescript": "^5",
35
- "@modern-js/dependence-generator": "3.3.9",
36
- "@modern-js/generator-common": "3.3.9",
37
- "@modern-js/plugin-i18n": "2.47.0",
38
- "@modern-js/generator-utils": "3.3.9",
39
- "@scripts/build": "2.47.0",
40
- "@scripts/jest-config": "2.47.0"
35
+ "@modern-js/dependence-generator": "3.3.11",
36
+ "@modern-js/generator-common": "3.3.11",
37
+ "@modern-js/generator-utils": "3.3.11",
38
+ "@modern-js/plugin-i18n": "2.48.0",
39
+ "@scripts/build": "2.48.0",
40
+ "@scripts/jest-config": "2.48.0"
41
41
  },
42
42
  "sideEffects": false,
43
43
  "publishConfig": {
package/src/index.ts CHANGED
@@ -1,29 +1,23 @@
1
- import path from 'path';
2
1
  import { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
3
2
  import { AppAPI } from '@modern-js/codesmith-api-app';
4
- import { chalk, getModernConfigFile } from '@modern-js/generator-utils';
3
+ import {
4
+ chalk,
5
+ getModernConfigFile,
6
+ getGeneratorPath,
7
+ } from '@modern-js/generator-utils';
5
8
  import {
6
9
  DependenceGenerator,
7
10
  i18n as commonI18n,
8
11
  } from '@modern-js/generator-common';
9
12
  import { i18n, localeKeys } from './locale';
10
13
 
11
- const getGeneratorPath = (generator: string, distTag: string) => {
12
- if (process.env.CODESMITH_ENV === 'development') {
13
- return path.dirname(require.resolve(generator));
14
- } else if (distTag) {
15
- return `${generator}@${distTag}`;
16
- }
17
- return generator;
18
- };
19
-
20
14
  const handleTemplateFile = async (
21
15
  context: GeneratorContext,
22
16
  _generator: GeneratorCore,
23
17
  appApi: AppAPI,
24
18
  ) => {
25
19
  await appApi.runSubGenerator(
26
- getGeneratorPath(DependenceGenerator, context.config.distTag),
20
+ getGeneratorPath(DependenceGenerator, context.config.distTag, [__dirname]),
27
21
  undefined,
28
22
  {
29
23
  ...context.config,