@modern-js/repo-generator 0.0.0-next-20241016073741 → 0.0.0-next-20241016221457

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 (2) hide show
  1. package/dist/index.js +41 -37
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -33203,7 +33203,7 @@ __export(src_exports, {
33203
33203
  });
33204
33204
  module.exports = __toCommonJS(src_exports);
33205
33205
 
33206
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/logger/constants.js
33206
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/logger/constants.js
33207
33207
  var LoggerLevel;
33208
33208
  (function(LoggerLevel2) {
33209
33209
  LoggerLevel2["Error"] = "error";
@@ -33215,10 +33215,10 @@ var LoggerLevel;
33215
33215
  LoggerLevel2["Timing"] = "timing";
33216
33216
  })(LoggerLevel || (LoggerLevel = {}));
33217
33217
 
33218
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-utils@2.6.3/node_modules/@modern-js/codesmith-utils/dist/esm/chalk.js
33218
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-utils@2.6.4/node_modules/@modern-js/codesmith-utils/dist/esm/chalk.js
33219
33219
  var import_chalk = __toESM(require_source());
33220
33220
 
33221
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/logger/index.js
33221
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/logger/index.js
33222
33222
  var import_debug = __toESM(require_src());
33223
33223
  var Logger = class {
33224
33224
  info(...meta) {
@@ -33276,26 +33276,26 @@ var Logger = class {
33276
33276
  }
33277
33277
  };
33278
33278
 
33279
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/codesmith/index.js
33279
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/codesmith/index.js
33280
33280
  var import_path7 = __toESM(require("path"));
33281
33281
 
33282
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/generator/index.js
33282
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/generator/index.js
33283
33283
  var import_events2 = require("events");
33284
33284
  var import_path5 = __toESM(require("path"));
33285
33285
 
33286
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsMaterial.js
33286
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsMaterial.js
33287
33287
  var import_path2 = __toESM(require("path"));
33288
33288
 
33289
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-utils@2.6.3/node_modules/@modern-js/codesmith-utils/dist/esm/glob.js
33289
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-utils@2.6.4/node_modules/@modern-js/codesmith-utils/dist/esm/glob.js
33290
33290
  var import_glob = __toESM(require_glob());
33291
33291
 
33292
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
33292
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
33293
33293
  var import_path = __toESM(require("path"));
33294
33294
 
33295
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-utils@2.6.3/node_modules/@modern-js/codesmith-utils/dist/esm/fs-extra.js
33295
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-utils@2.6.4/node_modules/@modern-js/codesmith-utils/dist/esm/fs-extra.js
33296
33296
  var import_fs_extra = __toESM(require_lib());
33297
33297
 
33298
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/materials/constants.js
33298
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/materials/constants.js
33299
33299
  var IMAGE_EXT_LIST = [
33300
33300
  ".jpg",
33301
33301
  ".jpeg",
@@ -33309,7 +33309,7 @@ var IMAGE_EXT_LIST = [
33309
33309
  ".wmf"
33310
33310
  ];
33311
33311
 
33312
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
33312
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
33313
33313
  var FS_RESOURCE = "_codesmith_core_fs_resource";
33314
33314
  var FsResource = class {
33315
33315
  value() {
@@ -33334,7 +33334,7 @@ var FsResource = class {
33334
33334
  }
33335
33335
  };
33336
33336
 
33337
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsMaterial.js
33337
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsMaterial.js
33338
33338
  var promisifyGlob = (pattern, options) => new Promise((resolve, reject) => {
33339
33339
  (0, import_glob.default)(pattern, options, (err, files) => err === null ? resolve(files) : reject(err));
33340
33340
  });
@@ -33361,7 +33361,7 @@ var FsMaterial = class {
33361
33361
  }
33362
33362
  };
33363
33363
 
33364
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
33364
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
33365
33365
  function fsExists(path9) {
33366
33366
  return __async(this, null, function* () {
33367
33367
  try {
@@ -33373,7 +33373,7 @@ function fsExists(path9) {
33373
33373
  });
33374
33374
  }
33375
33375
 
33376
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/utils/nodeRequire.js
33376
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/nodeRequire.js
33377
33377
  var nodeRequire = (path9) => {
33378
33378
  try {
33379
33379
  const module2 = __non_webpack_require__(path9);
@@ -33390,13 +33390,13 @@ var nodeRequire = (path9) => {
33390
33390
  }
33391
33391
  };
33392
33392
 
33393
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/utils/packageManager.js
33393
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/packageManager.js
33394
33394
  var import_path3 = __toESM(require("path"));
33395
33395
 
33396
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-utils@2.6.3/node_modules/@modern-js/codesmith-utils/dist/esm/execa.js
33396
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-utils@2.6.4/node_modules/@modern-js/codesmith-utils/dist/esm/execa.js
33397
33397
  var import_execa = __toESM(require_execa());
33398
33398
 
33399
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/utils/packageManager.js
33399
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/packageManager.js
33400
33400
  function canUseYarn() {
33401
33401
  return __async(this, null, function* () {
33402
33402
  try {
@@ -33480,7 +33480,7 @@ function runInstall(targetDir, registryUrl, logger) {
33480
33480
  });
33481
33481
  }
33482
33482
 
33483
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/utils/timeoutPromise.js
33483
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/timeoutPromise.js
33484
33484
  function timeoutPromise(promise, ms, reason = "Operation") {
33485
33485
  return __async(this, null, function* () {
33486
33486
  let timeoutId = null;
@@ -33504,14 +33504,14 @@ function timeoutPromise(promise, ms, reason = "Operation") {
33504
33504
  });
33505
33505
  }
33506
33506
 
33507
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
33507
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
33508
33508
  var import_os = __toESM(require("os"));
33509
33509
 
33510
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/constants.js
33510
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/constants.js
33511
33511
  var NPM_API_TIMEOUT = 3e4;
33512
33512
  var CATCHE_VALIDITY_PREIOD = 7 * 24 * 3600 * 1e3;
33513
33513
 
33514
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-utils@2.6.3/node_modules/@modern-js/codesmith-utils/dist/esm/semver.js
33514
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-utils@2.6.4/node_modules/@modern-js/codesmith-utils/dist/esm/semver.js
33515
33515
  var import_semver = __toESM(require_semver2());
33516
33516
 
33517
33517
  // ../../../../node_modules/.pnpm/axios@1.7.7_debug@4.3.7/node_modules/axios/lib/helpers/bind.js
@@ -36858,10 +36858,10 @@ var {
36858
36858
  mergeConfig: mergeConfig2
36859
36859
  } = axios_default;
36860
36860
 
36861
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
36861
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
36862
36862
  var import_tar = __toESM(require_tar());
36863
36863
 
36864
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmRegistry.js
36864
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmRegistry.js
36865
36865
  function getNpmRegistry() {
36866
36866
  return __async(this, null, function* () {
36867
36867
  const { stdout } = yield (0, import_execa.default)("npm", [
@@ -36873,11 +36873,11 @@ function getNpmRegistry() {
36873
36873
  });
36874
36874
  }
36875
36875
 
36876
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmPackageInfo.js
36876
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmPackageInfo.js
36877
36877
  var NpmPackageInfoCache = /* @__PURE__ */ new Map();
36878
36878
  function getNpmPackageInfo(pkgName, pkgVersion, options) {
36879
36879
  return __async(this, null, function* () {
36880
- const packageName = `${pkgName}/${pkgVersion}`;
36880
+ const packageName = `${pkgName}@${pkgVersion}`;
36881
36881
  const packageInfo = NpmPackageInfoCache.get(packageName);
36882
36882
  if (packageInfo) {
36883
36883
  return packageInfo;
@@ -36885,12 +36885,13 @@ function getNpmPackageInfo(pkgName, pkgVersion, options) {
36885
36885
  const { registryUrl = yield getNpmRegistry() } = options || {};
36886
36886
  const url2 = `${registryUrl.replace(/\/$/, "")}/${pkgName}/${pkgVersion}`;
36887
36887
  const response = yield timeoutPromise(axios_default.get(url2), NPM_API_TIMEOUT, `Get npm package info of '${pkgName}'`);
36888
- NpmPackageInfoCache.set(packageName, response.data);
36888
+ const { version } = response.data;
36889
+ NpmPackageInfoCache.set(`${pkgName}@${version || pkgVersion}`, response.data);
36889
36890
  return response.data;
36890
36891
  });
36891
36892
  }
36892
36893
 
36893
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmTarballUrl.js
36894
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmTarballUrl.js
36894
36895
  function getNpmTarballUrl(pkgName, pkgVersion, options) {
36895
36896
  return __async(this, null, function* () {
36896
36897
  const packageInfo = yield getNpmPackageInfo(pkgName, pkgVersion, options);
@@ -36898,7 +36899,7 @@ function getNpmTarballUrl(pkgName, pkgVersion, options) {
36898
36899
  });
36899
36900
  }
36900
36901
 
36901
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmVersion.js
36902
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmVersion.js
36902
36903
  function getNpmVersion(packageName, options) {
36903
36904
  return __async(this, null, function* () {
36904
36905
  const { version = "latest" } = options || {};
@@ -36907,7 +36908,7 @@ function getNpmVersion(packageName, options) {
36907
36908
  });
36908
36909
  }
36909
36910
 
36910
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
36911
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
36911
36912
  var GeneratorVersionMap = /* @__PURE__ */ new Map();
36912
36913
  function getGeneratorVersion(_0) {
36913
36914
  return __async(this, arguments, function* (pkgName, pkgVersion = "latest", options = {}) {
@@ -36940,9 +36941,12 @@ function getGeneratorVersion(_0) {
36940
36941
  return version;
36941
36942
  });
36942
36943
  }
36943
- function isValidCache(cacheDir) {
36944
+ function isValidCache(cacheDir, pkgName) {
36944
36945
  return __async(this, null, function* () {
36945
36946
  if (yield fsExists(`${cacheDir}/.codesmith.completed`)) {
36947
+ if (pkgName === "@modern-js/codesmith-global") {
36948
+ return true;
36949
+ }
36946
36950
  const preCacheTimeStr = yield import_fs_extra.default.readFile(`${cacheDir}/.codesmith.completed`, {
36947
36951
  encoding: "utf-8"
36948
36952
  });
@@ -37010,7 +37014,7 @@ function downloadPackage(_0) {
37010
37014
  }
37011
37015
  const targetDir = `${import_os.default.tmpdir()}/csmith-generator/${pkgName}@${version}`;
37012
37016
  logger === null || logger === void 0 ? void 0 : (_logger_debug = logger.debug) === null || _logger_debug === void 0 ? void 0 : _logger_debug.call(logger, `💡 [Download Generator Package]: ${pkgName}@${version} to ${targetDir}`);
37013
- if ((yield fsExists(targetDir)) && (yield isValidCache(targetDir))) {
37017
+ if ((yield fsExists(targetDir)) && (yield isValidCache(targetDir, pkgName))) {
37014
37018
  return targetDir;
37015
37019
  }
37016
37020
  yield import_fs_extra.default.remove(targetDir);
@@ -37037,7 +37041,7 @@ function downloadPackage(_0) {
37037
37041
  });
37038
37042
  }
37039
37043
 
37040
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/utils/getPackageInfo.js
37044
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/getPackageInfo.js
37041
37045
  function getPackageInfo(packageName) {
37042
37046
  if (!packageName) {
37043
37047
  throw new Error("package is not exisit");
@@ -37061,7 +37065,7 @@ function getPackageInfo(packageName) {
37061
37065
  };
37062
37066
  }
37063
37067
 
37064
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/utils/getGeneratorDir.js
37068
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/utils/getGeneratorDir.js
37065
37069
  var import_path4 = __toESM(require("path"));
37066
37070
  var MaxTimes = 5;
37067
37071
  function getGeneratorDir(generator) {
@@ -37083,10 +37087,10 @@ function getGeneratorDir(generator) {
37083
37087
  });
37084
37088
  }
37085
37089
 
37086
- // ../../../../node_modules/.pnpm/@modern-js+codesmith-utils@2.6.3/node_modules/@modern-js/codesmith-utils/dist/esm/ora.js
37090
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith-utils@2.6.4/node_modules/@modern-js/codesmith-utils/dist/esm/ora.js
37087
37091
  var import_ora = __toESM(require_ora());
37088
37092
 
37089
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/generator/index.js
37093
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/generator/index.js
37090
37094
  var GeneratorCore = class {
37091
37095
  get lifeCycleMethod() {
37092
37096
  return {
@@ -37302,7 +37306,7 @@ check path: ${import_chalk.default.blue.underline(generator)} exist a package.js
37302
37306
  }
37303
37307
  };
37304
37308
 
37305
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/materials/index.js
37309
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/materials/index.js
37306
37310
  var import_path6 = __toESM(require("path"));
37307
37311
  var MaterialsManager = class {
37308
37312
  loadLocalGenerator(generator) {
@@ -37368,7 +37372,7 @@ var MaterialsManager = class {
37368
37372
  }
37369
37373
  };
37370
37374
 
37371
- // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.3/node_modules/@modern-js/codesmith/dist/esm-node/codesmith/index.js
37375
+ // ../../../../node_modules/.pnpm/@modern-js+codesmith@2.6.4/node_modules/@modern-js/codesmith/dist/esm-node/codesmith/index.js
37372
37376
  var CodeSmith = class {
37373
37377
  forge(_0) {
37374
37378
  return __async(this, arguments, function* ({ tasks, pwd }) {
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-next-20241016073741",
18
+ "version": "0.0.0-next-20241016221457",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "main": "./dist/index.js",
21
21
  "files": [
@@ -23,12 +23,12 @@
23
23
  "/dist/index.js"
24
24
  ],
25
25
  "devDependencies": {
26
- "@modern-js/codesmith": "2.6.3",
26
+ "@modern-js/codesmith": "2.6.4",
27
27
  "@types/node": "^14",
28
28
  "typescript": "^5",
29
- "@modern-js/repo-next-generator": "0.0.0-next-20241016073741",
30
- "@scripts/build": "0.0.0-next-20241016073741",
31
- "@modern-js/generator-utils": "0.0.0-next-20241016073741"
29
+ "@modern-js/generator-utils": "0.0.0-next-20241016221457",
30
+ "@modern-js/repo-next-generator": "0.0.0-next-20241016221457",
31
+ "@scripts/build": "0.0.0-next-20241016221457"
32
32
  },
33
33
  "sideEffects": false,
34
34
  "publishConfig": {