@modern-js/repo-generator 3.3.9 → 3.3.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +308 -299
- package/package.json +13 -13
- package/src/index.ts +2 -11
package/dist/index.js
CHANGED
@@ -28563,7 +28563,7 @@ var require_binary_search = __commonJS({
|
|
28563
28563
|
var require_quick_sort = __commonJS({
|
28564
28564
|
"../../../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js"(exports) {
|
28565
28565
|
"use strict";
|
28566
|
-
function
|
28566
|
+
function swap2(ary, x, y) {
|
28567
28567
|
var temp = ary[x];
|
28568
28568
|
ary[x] = ary[y];
|
28569
28569
|
ary[y] = temp;
|
@@ -28575,15 +28575,15 @@ var require_quick_sort = __commonJS({
|
|
28575
28575
|
if (p < r) {
|
28576
28576
|
var pivotIndex = randomIntInRange(p, r);
|
28577
28577
|
var i = p - 1;
|
28578
|
-
|
28578
|
+
swap2(ary, pivotIndex, r);
|
28579
28579
|
var pivot = ary[r];
|
28580
28580
|
for (var j = p; j < r; j++) {
|
28581
28581
|
if (comparator(ary[j], pivot) <= 0) {
|
28582
28582
|
i += 1;
|
28583
|
-
|
28583
|
+
swap2(ary, i, j);
|
28584
28584
|
}
|
28585
28585
|
}
|
28586
|
-
|
28586
|
+
swap2(ary, i + 1, j);
|
28587
28587
|
var q = i + 1;
|
28588
28588
|
doQuickSort(ary, comparator, p, q - 1);
|
28589
28589
|
doQuickSort(ary, comparator, q + 1, r);
|
@@ -64263,10 +64263,10 @@ var require_extend_node = __commonJS({
|
|
64263
64263
|
length = void 0;
|
64264
64264
|
}
|
64265
64265
|
} else {
|
64266
|
-
var
|
64266
|
+
var swap2 = encoding;
|
64267
64267
|
encoding = offset;
|
64268
64268
|
offset = length;
|
64269
|
-
length =
|
64269
|
+
length = swap2;
|
64270
64270
|
}
|
64271
64271
|
offset = +offset || 0;
|
64272
64272
|
var remaining = this.length - offset;
|
@@ -64320,10 +64320,10 @@ var require_extend_node = __commonJS({
|
|
64320
64320
|
length = void 0;
|
64321
64321
|
}
|
64322
64322
|
} else {
|
64323
|
-
var
|
64323
|
+
var swap2 = encoding;
|
64324
64324
|
encoding = offset;
|
64325
64325
|
offset = length;
|
64326
|
-
length =
|
64326
|
+
length = swap2;
|
64327
64327
|
}
|
64328
64328
|
encoding = String(encoding || "utf8").toLowerCase();
|
64329
64329
|
if (Buffer2.isNativeEncoding(encoding))
|
@@ -68844,7 +68844,6 @@ __export(src_exports, {
|
|
68844
68844
|
default: () => src_default
|
68845
68845
|
});
|
68846
68846
|
module.exports = __toCommonJS(src_exports);
|
68847
|
-
var import_path18 = __toESM(require("path"));
|
68848
68847
|
var import_lodash15 = require("@modern-js/utils/lodash");
|
68849
68848
|
|
68850
68849
|
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/esm/_define_property.js
|
@@ -68856,12 +68855,12 @@ function _define_property(obj, key, value) {
|
|
68856
68855
|
return obj;
|
68857
68856
|
}
|
68858
68857
|
|
68859
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
68858
|
+
// ../../../../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
|
68860
68859
|
var import_utils46 = require("@modern-js/utils");
|
68861
68860
|
var import_lodash6 = require("@modern-js/utils/lodash");
|
68862
68861
|
var import_comment_json = __toESM(require_src2());
|
68863
68862
|
|
68864
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.
|
68863
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.5/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
|
68865
68864
|
var import_utils = require("@modern-js/utils");
|
68866
68865
|
async function canUseNvm() {
|
68867
68866
|
try {
|
@@ -68911,7 +68910,7 @@ async function canUsePnpm() {
|
|
68911
68910
|
}
|
68912
68911
|
}
|
68913
68912
|
|
68914
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.
|
68913
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.5/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
|
68915
68914
|
var import_utils2 = require("@modern-js/utils");
|
68916
68915
|
function execaWithStreamLog(command, args, options) {
|
68917
68916
|
const promise = (0, import_utils2.execa)(command, args, {
|
@@ -69007,7 +69006,7 @@ async function pnpmInstall({ cwd, registryUrl, ignoreScripts, useNvm }) {
|
|
69007
69006
|
throw new Error("please install pnpm first");
|
69008
69007
|
}
|
69009
69008
|
|
69010
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.
|
69009
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.5/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
|
69011
69010
|
var NpmAPI = class {
|
69012
69011
|
npmInstall({ cwd, registryUrl, ignoreScripts }) {
|
69013
69012
|
return npmInstall({
|
@@ -69036,7 +69035,7 @@ var NpmAPI = class {
|
|
69036
69035
|
}
|
69037
69036
|
};
|
69038
69037
|
|
69039
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.
|
69038
|
+
// ../../../../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
|
69040
69039
|
var import_utils4 = require("@modern-js/utils");
|
69041
69040
|
async function canUseGit() {
|
69042
69041
|
try {
|
@@ -69111,7 +69110,7 @@ async function gitCommit(cwd, commitMessage) {
|
|
69111
69110
|
});
|
69112
69111
|
}
|
69113
69112
|
|
69114
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.
|
69113
|
+
// ../../../../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
|
69115
69114
|
var GitAPI = class {
|
69116
69115
|
async isInGitRepo(cwd = this.generatorCore.outputPath) {
|
69117
69116
|
const canUse = await canUseGit();
|
@@ -69163,7 +69162,7 @@ var GitAPI = class {
|
|
69163
69162
|
}
|
69164
69163
|
};
|
69165
69164
|
|
69166
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69165
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/logger/constants.js
|
69167
69166
|
var LoggerLevel;
|
69168
69167
|
(function(LoggerLevel2) {
|
69169
69168
|
LoggerLevel2["Error"] = "error";
|
@@ -69184,7 +69183,7 @@ var LevelPriority = [
|
|
69184
69183
|
LoggerLevel.Stream
|
69185
69184
|
];
|
69186
69185
|
|
69187
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69186
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/logger/index.js
|
69188
69187
|
var import_utils6 = require("@modern-js/utils");
|
69189
69188
|
var Logger = class {
|
69190
69189
|
get currentLevelIndex() {
|
@@ -69245,23 +69244,23 @@ var Logger = class {
|
|
69245
69244
|
}
|
69246
69245
|
};
|
69247
69246
|
|
69248
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69247
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/codesmith/index.js
|
69249
69248
|
var import_path7 = __toESM(require("path"));
|
69250
69249
|
|
69251
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69250
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/generator/index.js
|
69252
69251
|
var import_path4 = __toESM(require("path"));
|
69253
69252
|
var import_events = require("events");
|
69254
69253
|
var import_utils11 = require("@modern-js/utils");
|
69255
69254
|
|
69256
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69255
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsMaterial.js
|
69257
69256
|
var import_path2 = __toESM(require("path"));
|
69258
69257
|
var import_utils8 = require("@modern-js/utils");
|
69259
69258
|
|
69260
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69259
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
|
69261
69260
|
var import_path = __toESM(require("path"));
|
69262
69261
|
var import_utils7 = require("@modern-js/utils");
|
69263
69262
|
|
69264
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69263
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/constants.js
|
69265
69264
|
var IMAGE_EXT_LIST = [
|
69266
69265
|
".jpg",
|
69267
69266
|
".jpeg",
|
@@ -69275,7 +69274,7 @@ var IMAGE_EXT_LIST = [
|
|
69275
69274
|
".wmf"
|
69276
69275
|
];
|
69277
69276
|
|
69278
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69277
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
|
69279
69278
|
var FS_RESOURCE = "_codesmith_core_fs_resource";
|
69280
69279
|
var FsResource = class {
|
69281
69280
|
async value() {
|
@@ -69301,7 +69300,7 @@ var FsResource = class {
|
|
69301
69300
|
}
|
69302
69301
|
};
|
69303
69302
|
|
69304
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69303
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsMaterial.js
|
69305
69304
|
var promisifyGlob = function(pattern, options) {
|
69306
69305
|
return new Promise((resolve, reject) => {
|
69307
69306
|
(0, import_utils8.glob)(pattern, options, (err, files) => err === null ? resolve(files) : reject(err));
|
@@ -69329,7 +69328,7 @@ var FsMaterial = class {
|
|
69329
69328
|
}
|
69330
69329
|
};
|
69331
69330
|
|
69332
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69331
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/nodeRequire.js
|
69333
69332
|
var nodeRequire = (path18) => {
|
69334
69333
|
try {
|
69335
69334
|
const module2 = __non_webpack_require__(path18);
|
@@ -69346,11 +69345,11 @@ var nodeRequire = (path18) => {
|
|
69346
69345
|
}
|
69347
69346
|
};
|
69348
69347
|
|
69349
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69348
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getGeneratorDir.js
|
69350
69349
|
var import_path3 = __toESM(require("path"));
|
69351
69350
|
var import_utils10 = require("@modern-js/utils");
|
69352
69351
|
|
69353
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69352
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
|
69354
69353
|
var import_utils9 = require("@modern-js/utils");
|
69355
69354
|
async function fsExists(path18) {
|
69356
69355
|
try {
|
@@ -69361,7 +69360,7 @@ async function fsExists(path18) {
|
|
69361
69360
|
}
|
69362
69361
|
}
|
69363
69362
|
|
69364
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69363
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getGeneratorDir.js
|
69365
69364
|
var MaxTimes = 5;
|
69366
69365
|
async function getGeneratorDir(generator) {
|
69367
69366
|
let result = generator;
|
@@ -69380,7 +69379,7 @@ async function getGeneratorDir(generator) {
|
|
69380
69379
|
return result;
|
69381
69380
|
}
|
69382
69381
|
|
69383
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69382
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/generator/index.js
|
69384
69383
|
var GeneratorCore = class {
|
69385
69384
|
get lifeCycleMethod() {
|
69386
69385
|
return {
|
@@ -69585,10 +69584,10 @@ check path: ${import_utils11.chalk.blue.underline(generator)} exist a package.js
|
|
69585
69584
|
}
|
69586
69585
|
};
|
69587
69586
|
|
69588
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69587
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/index.js
|
69589
69588
|
var import_path6 = __toESM(require("path"));
|
69590
69589
|
|
69591
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69590
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/packageManager.js
|
69592
69591
|
var import_path5 = __toESM(require("path"));
|
69593
69592
|
var import_utils12 = require("@modern-js/utils");
|
69594
69593
|
async function canUseYarn2() {
|
@@ -69636,7 +69635,6 @@ async function runInstall(targetDir, registryUrl) {
|
|
69636
69635
|
"install",
|
69637
69636
|
"--prod",
|
69638
69637
|
"--reporter=silent",
|
69639
|
-
"--prefer-offline",
|
69640
69638
|
"--ignore-scripts"
|
69641
69639
|
];
|
69642
69640
|
if (registryUrl) {
|
@@ -69659,7 +69657,6 @@ async function runInstall(targetDir, registryUrl) {
|
|
69659
69657
|
"install",
|
69660
69658
|
"--production",
|
69661
69659
|
"--loglevel=error",
|
69662
|
-
"--prefer-offline",
|
69663
69660
|
"--ignore-scripts"
|
69664
69661
|
];
|
69665
69662
|
if (registryUrl) {
|
@@ -69669,7 +69666,7 @@ async function runInstall(targetDir, registryUrl) {
|
|
69669
69666
|
}
|
69670
69667
|
}
|
69671
69668
|
|
69672
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69669
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/timeoutPromise.js
|
69673
69670
|
async function timeoutPromise(promise, ms, reason = "Operation") {
|
69674
69671
|
let timeoutId = null;
|
69675
69672
|
const delayPromise = (ms2) => new Promise((resolve) => {
|
@@ -69691,7 +69688,7 @@ async function timeoutPromise(promise, ms, reason = "Operation") {
|
|
69691
69688
|
}
|
69692
69689
|
}
|
69693
69690
|
|
69694
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
69691
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
|
69695
69692
|
var import_os = __toESM(require("os"));
|
69696
69693
|
var import_utils38 = require("@modern-js/utils");
|
69697
69694
|
|
@@ -72684,17 +72681,17 @@ var {
|
|
72684
72681
|
mergeConfig: mergeConfig2
|
72685
72682
|
} = axios_default;
|
72686
72683
|
|
72687
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
72684
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
|
72688
72685
|
var import_tar = __toESM(require_tar());
|
72689
72686
|
|
72690
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
72687
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmTarballUrl.js
|
72691
72688
|
var import_utils36 = require("@modern-js/utils");
|
72692
72689
|
|
72693
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
72690
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/constants.js
|
72694
72691
|
var NPM_API_TIMEOUT = 3e4;
|
72695
72692
|
var CATCHE_VALIDITY_PREIOD = 12 * 3600 * 1e3;
|
72696
72693
|
|
72697
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
72694
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmTarballUrl.js
|
72698
72695
|
async function getNpmTarballUrl(pkgName, pkgVersion, options) {
|
72699
72696
|
const { registryUrl } = options || {};
|
72700
72697
|
const params = [
|
@@ -72717,7 +72714,7 @@ async function getNpmTarballUrl(pkgName, pkgVersion, options) {
|
|
72717
72714
|
}
|
72718
72715
|
}
|
72719
72716
|
|
72720
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
72717
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getNpmVersion.js
|
72721
72718
|
var import_utils37 = require("@modern-js/utils");
|
72722
72719
|
async function getNpmVersion(packageName, options) {
|
72723
72720
|
const { version, registryUrl } = options || {};
|
@@ -72739,7 +72736,7 @@ async function getNpmVersion(packageName, options) {
|
|
72739
72736
|
return stdout;
|
72740
72737
|
}
|
72741
72738
|
|
72742
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
72739
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/downloadPackage.js
|
72743
72740
|
async function isValidCache(cacheDir) {
|
72744
72741
|
if (await fsExists(`${cacheDir}/.codesmith.completed`)) {
|
72745
72742
|
const preCacheTimeStr = await import_utils38.fs.readFile(`${cacheDir}/.codesmith.completed`, {
|
@@ -72819,7 +72816,7 @@ async function downloadPackage(pkgName, pkgVersion = "latest", options = {}) {
|
|
72819
72816
|
return targetDir;
|
72820
72817
|
}
|
72821
72818
|
|
72822
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
72819
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/getPackageInfo.js
|
72823
72820
|
var import_utils39 = require("@modern-js/utils");
|
72824
72821
|
function getPackageInfo(packageName) {
|
72825
72822
|
if (!packageName) {
|
@@ -72844,7 +72841,7 @@ function getPackageInfo(packageName) {
|
|
72844
72841
|
};
|
72845
72842
|
}
|
72846
72843
|
|
72847
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
72844
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/index.js
|
72848
72845
|
var MaterialsManager = class {
|
72849
72846
|
loadLocalGenerator(generator) {
|
72850
72847
|
if (!import_path6.default.isAbsolute(generator)) {
|
@@ -72875,7 +72872,7 @@ var MaterialsManager = class {
|
|
72875
72872
|
}
|
72876
72873
|
};
|
72877
72874
|
|
72878
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
72875
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/codesmith/index.js
|
72879
72876
|
var CodeSmith = class {
|
72880
72877
|
async forge({ tasks, pwd }) {
|
72881
72878
|
var _this_logger_timing, _this_logger;
|
@@ -72919,7 +72916,7 @@ var CodeSmith = class {
|
|
72919
72916
|
}
|
72920
72917
|
};
|
72921
72918
|
|
72922
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.
|
72919
|
+
// ../../../../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
|
72923
72920
|
var import_handlebars = __toESM(require_lib());
|
72924
72921
|
function renderString(template, fullData, registers) {
|
72925
72922
|
const helpers = {
|
@@ -72933,7 +72930,7 @@ function renderString(template, fullData, registers) {
|
|
72933
72930
|
return import_handlebars.default.compile(template)(fullData) || "";
|
72934
72931
|
}
|
72935
72932
|
|
72936
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.
|
72933
|
+
// ../../../../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
|
72937
72934
|
var HandlebarsAPI = class {
|
72938
72935
|
async registerHelp(helpers) {
|
72939
72936
|
this.registers.helpers = {
|
@@ -72983,13 +72980,13 @@ var HandlebarsAPI = class {
|
|
72983
72980
|
}
|
72984
72981
|
};
|
72985
72982
|
|
72986
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.
|
72983
|
+
// ../../../../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
|
72987
72984
|
var import_ejs = __toESM(require_ejs());
|
72988
72985
|
function renderString2(template, fullData) {
|
72989
72986
|
return import_ejs.default.render(template, fullData) || "";
|
72990
72987
|
}
|
72991
72988
|
|
72992
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.
|
72989
|
+
// ../../../../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
|
72993
72990
|
var EjsAPI = class {
|
72994
72991
|
async renderTemplate(templateResource, target, parameters = {}) {
|
72995
72992
|
if (templateResource._type !== FS_RESOURCE) {
|
@@ -73022,7 +73019,7 @@ var EjsAPI = class {
|
|
73022
73019
|
}
|
73023
73020
|
};
|
73024
73021
|
|
73025
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.3.
|
73022
|
+
// ../../../../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
|
73026
73023
|
var import_path8 = __toESM(require("path"));
|
73027
73024
|
var import_utils43 = require("@modern-js/utils");
|
73028
73025
|
var FsAPI = class {
|
@@ -73050,7 +73047,7 @@ var FsAPI = class {
|
|
73050
73047
|
}
|
73051
73048
|
};
|
73052
73049
|
|
73053
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
73050
|
+
// ../../../../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/index.js
|
73054
73051
|
var import_lodash2 = require("@modern-js/utils/lodash");
|
73055
73052
|
|
73056
73053
|
// ../../../../node_modules/.pnpm/@formily+shared@2.2.24/node_modules/@formily/shared/esm/checkers.js
|
@@ -82685,10 +82682,10 @@ var Schema = (
|
|
82685
82682
|
}()
|
82686
82683
|
);
|
82687
82684
|
|
82688
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
82685
|
+
// ../../../../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
|
82689
82686
|
var import_inquirer = __toESM(require_inquirer());
|
82690
82687
|
|
82691
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
82688
|
+
// ../../../../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
|
82692
82689
|
var import_lodash = require("@modern-js/utils/lodash");
|
82693
82690
|
function validateSchema(schema) {
|
82694
82691
|
const { type, properties } = schema;
|
@@ -82780,7 +82777,7 @@ function transformForm(schema, configValue = {}, validateMap, initValue) {
|
|
82780
82777
|
return getQuestionFromSchema(schema, configValue, validateMap, initValue);
|
82781
82778
|
}
|
82782
82779
|
|
82783
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
82780
|
+
// ../../../../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
|
82784
82781
|
var compileRule = (rule, scope) => {
|
82785
82782
|
const state = Schema.compile(rule, {
|
82786
82783
|
$self: {},
|
@@ -82884,7 +82881,7 @@ async function prompt(schema, configValue = {}, validateMap, initValue) {
|
|
82884
82881
|
return answers;
|
82885
82882
|
}
|
82886
82883
|
|
82887
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
82884
|
+
// ../../../../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
|
82888
82885
|
var CLIReader = class {
|
82889
82886
|
getAnswers() {
|
82890
82887
|
return this.answers;
|
@@ -82915,7 +82912,7 @@ var CLIReader = class {
|
|
82915
82912
|
}
|
82916
82913
|
};
|
82917
82914
|
|
82918
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
82915
|
+
// ../../../../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/index.js
|
82919
82916
|
var FormilyAPI = class {
|
82920
82917
|
mergeAnswers(answers, configValue) {
|
82921
82918
|
const inputData = (0, import_lodash2.merge)(answers, configValue);
|
@@ -82938,7 +82935,7 @@ var FormilyAPI = class {
|
|
82938
82935
|
}
|
82939
82936
|
};
|
82940
82937
|
|
82941
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
82938
|
+
// ../../../../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
|
82942
82939
|
var import_inquirer3 = __toESM(require_inquirer2());
|
82943
82940
|
|
82944
82941
|
// ../../../../node_modules/.pnpm/@modern-js+plugin-i18n@2.37.2/node_modules/@modern-js/plugin-i18n/dist/esm-node/index.js
|
@@ -83004,7 +83001,7 @@ var I18n = class {
|
|
83004
83001
|
}
|
83005
83002
|
};
|
83006
83003
|
|
83007
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
83004
|
+
// ../../../../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
|
83008
83005
|
var ZH_LOCALE = {
|
83009
83006
|
environment: {
|
83010
83007
|
node_version: "请升级 Node 版本至 LIS",
|
@@ -83031,7 +83028,7 @@ var ZH_LOCALE = {
|
|
83031
83028
|
}
|
83032
83029
|
};
|
83033
83030
|
|
83034
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
83031
|
+
// ../../../../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
|
83035
83032
|
var EN_LOCALE = {
|
83036
83033
|
environment: {
|
83037
83034
|
node_version: "please upgrade node to lts version",
|
@@ -83058,14 +83055,14 @@ var EN_LOCALE = {
|
|
83058
83055
|
}
|
83059
83056
|
};
|
83060
83057
|
|
83061
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
83058
|
+
// ../../../../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
|
83062
83059
|
var i18n = new I18n();
|
83063
83060
|
var localeKeys = i18n.init("zh", {
|
83064
83061
|
zh: ZH_LOCALE,
|
83065
83062
|
en: EN_LOCALE
|
83066
83063
|
});
|
83067
83064
|
|
83068
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
83065
|
+
// ../../../../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
|
83069
83066
|
var import_lodash5 = require("@modern-js/utils/lodash");
|
83070
83067
|
function transformInquirerSchema(questions, configValue = {}, validateMap = {}, initValue = {}) {
|
83071
83068
|
for (const question of questions) {
|
@@ -83093,7 +83090,7 @@ function transformInquirerSchema(questions, configValue = {}, validateMap = {},
|
|
83093
83090
|
return questions;
|
83094
83091
|
}
|
83095
83092
|
|
83096
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
83093
|
+
// ../../../../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
|
83097
83094
|
var import_path10 = __toESM(require("path"));
|
83098
83095
|
var import_utils45 = require("@modern-js/utils");
|
83099
83096
|
var NODE_MAJOR_VERSION_MAP = {
|
@@ -83141,7 +83138,7 @@ async function checkUseNvm(cwd, logger2) {
|
|
83141
83138
|
}
|
83142
83139
|
}
|
83143
83140
|
|
83144
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
83141
|
+
// ../../../../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
|
83145
83142
|
var AppAPI = class {
|
83146
83143
|
async checkEnvironment(nodeVersion) {
|
83147
83144
|
if (import_utils46.semver.lt(process.versions.node, nodeVersion || "12.22.12")) {
|
@@ -84346,194 +84343,8 @@ var SolutionSchemas = {
|
|
84346
84343
|
custom: getBaseSchema
|
84347
84344
|
};
|
84348
84345
|
|
84349
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_async_to_generator.js
|
84350
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
84351
|
-
try {
|
84352
|
-
var info = gen[key](arg);
|
84353
|
-
var value = info.value;
|
84354
|
-
} catch (error) {
|
84355
|
-
reject(error);
|
84356
|
-
return;
|
84357
|
-
}
|
84358
|
-
if (info.done)
|
84359
|
-
resolve(value);
|
84360
|
-
else
|
84361
|
-
Promise.resolve(value).then(_next, _throw);
|
84362
|
-
}
|
84363
|
-
function _async_to_generator(fn) {
|
84364
|
-
return function() {
|
84365
|
-
var self3 = this, args = arguments;
|
84366
|
-
return new Promise(function(resolve, reject) {
|
84367
|
-
var gen = fn.apply(self3, args);
|
84368
|
-
function _next(value) {
|
84369
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
84370
|
-
}
|
84371
|
-
function _throw(err) {
|
84372
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
84373
|
-
}
|
84374
|
-
_next(void 0);
|
84375
|
-
});
|
84376
|
-
};
|
84377
|
-
}
|
84378
|
-
|
84379
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_class_call_check.js
|
84380
|
-
function _class_call_check(instance, Constructor) {
|
84381
|
-
if (!(instance instanceof Constructor))
|
84382
|
-
throw new TypeError("Cannot call a class as a function");
|
84383
|
-
}
|
84384
|
-
|
84385
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_create_class.js
|
84386
|
-
function _defineProperties(target, props) {
|
84387
|
-
for (var i = 0; i < props.length; i++) {
|
84388
|
-
var descriptor = props[i];
|
84389
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
84390
|
-
descriptor.configurable = true;
|
84391
|
-
if ("value" in descriptor)
|
84392
|
-
descriptor.writable = true;
|
84393
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
84394
|
-
}
|
84395
|
-
}
|
84396
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
84397
|
-
if (protoProps)
|
84398
|
-
_defineProperties(Constructor.prototype, protoProps);
|
84399
|
-
if (staticProps)
|
84400
|
-
_defineProperties(Constructor, staticProps);
|
84401
|
-
return Constructor;
|
84402
|
-
}
|
84403
|
-
|
84404
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_spread.js
|
84405
|
-
function _object_spread(target) {
|
84406
|
-
for (var i = 1; i < arguments.length; i++) {
|
84407
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
84408
|
-
var ownKeys2 = Object.keys(source);
|
84409
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
84410
|
-
ownKeys2 = ownKeys2.concat(
|
84411
|
-
Object.getOwnPropertySymbols(source).filter(function(sym) {
|
84412
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
84413
|
-
})
|
84414
|
-
);
|
84415
|
-
}
|
84416
|
-
ownKeys2.forEach(function(key) {
|
84417
|
-
_define_property2(target, key, source[key]);
|
84418
|
-
});
|
84419
|
-
}
|
84420
|
-
return target;
|
84421
|
-
}
|
84422
|
-
|
84423
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_spread_props.js
|
84424
|
-
function ownKeys(object, enumerableOnly) {
|
84425
|
-
var keys = Object.keys(object);
|
84426
|
-
if (Object.getOwnPropertySymbols) {
|
84427
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
84428
|
-
if (enumerableOnly) {
|
84429
|
-
symbols = symbols.filter(function(sym) {
|
84430
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
84431
|
-
});
|
84432
|
-
}
|
84433
|
-
keys.push.apply(keys, symbols);
|
84434
|
-
}
|
84435
|
-
return keys;
|
84436
|
-
}
|
84437
|
-
function _object_spread_props(target, source) {
|
84438
|
-
source = source != null ? source : {};
|
84439
|
-
if (Object.getOwnPropertyDescriptors)
|
84440
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
84441
|
-
else {
|
84442
|
-
ownKeys(Object(source)).forEach(function(key) {
|
84443
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
84444
|
-
});
|
84445
|
-
}
|
84446
|
-
return target;
|
84447
|
-
}
|
84448
|
-
|
84449
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_without_properties_loose.js
|
84450
|
-
function _object_without_properties_loose(source, excluded) {
|
84451
|
-
if (source == null)
|
84452
|
-
return {};
|
84453
|
-
var target = {};
|
84454
|
-
var sourceKeys = Object.keys(source);
|
84455
|
-
var key, i;
|
84456
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
84457
|
-
key = sourceKeys[i];
|
84458
|
-
if (excluded.indexOf(key) >= 0)
|
84459
|
-
continue;
|
84460
|
-
target[key] = source[key];
|
84461
|
-
}
|
84462
|
-
return target;
|
84463
|
-
}
|
84464
|
-
|
84465
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_without_properties.js
|
84466
|
-
function _object_without_properties(source, excluded) {
|
84467
|
-
if (source == null)
|
84468
|
-
return {};
|
84469
|
-
var target = _object_without_properties_loose(source, excluded);
|
84470
|
-
var key, i;
|
84471
|
-
if (Object.getOwnPropertySymbols) {
|
84472
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
84473
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
84474
|
-
key = sourceSymbolKeys[i];
|
84475
|
-
if (excluded.indexOf(key) >= 0)
|
84476
|
-
continue;
|
84477
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
84478
|
-
continue;
|
84479
|
-
target[key] = source[key];
|
84480
|
-
}
|
84481
|
-
}
|
84482
|
-
return target;
|
84483
|
-
}
|
84484
|
-
|
84485
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_array_like_to_array.js
|
84486
|
-
function _array_like_to_array(arr, len) {
|
84487
|
-
if (len == null || len > arr.length)
|
84488
|
-
len = arr.length;
|
84489
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
84490
|
-
arr2[i] = arr[i];
|
84491
|
-
return arr2;
|
84492
|
-
}
|
84493
|
-
|
84494
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_array_without_holes.js
|
84495
|
-
function _array_without_holes(arr) {
|
84496
|
-
if (Array.isArray(arr))
|
84497
|
-
return _array_like_to_array(arr);
|
84498
|
-
}
|
84499
|
-
|
84500
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_iterable_to_array.js
|
84501
|
-
function _iterable_to_array(iter) {
|
84502
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
|
84503
|
-
return Array.from(iter);
|
84504
|
-
}
|
84505
|
-
}
|
84506
|
-
|
84507
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_non_iterable_spread.js
|
84508
|
-
function _non_iterable_spread() {
|
84509
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
84510
|
-
}
|
84511
|
-
|
84512
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_unsupported_iterable_to_array.js
|
84513
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
84514
|
-
if (!o)
|
84515
|
-
return;
|
84516
|
-
if (typeof o === "string")
|
84517
|
-
return _array_like_to_array(o, minLen);
|
84518
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
84519
|
-
if (n === "Object" && o.constructor)
|
84520
|
-
n = o.constructor.name;
|
84521
|
-
if (n === "Map" || n === "Set")
|
84522
|
-
return Array.from(n);
|
84523
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
84524
|
-
return _array_like_to_array(o, minLen);
|
84525
|
-
}
|
84526
|
-
|
84527
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_to_consumable_array.js
|
84528
|
-
function _to_consumable_array(arr) {
|
84529
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
84530
|
-
}
|
84531
|
-
|
84532
|
-
// ../../generator-plugin/dist/esm/index.js
|
84533
|
-
var import_path17 = __toESM(require("path"));
|
84534
|
-
|
84535
84346
|
// ../../generator-utils/dist/esm/index.js
|
84536
|
-
var
|
84347
|
+
var import_path12 = __toESM(require("path"));
|
84537
84348
|
var import_utils49 = require("@modern-js/utils");
|
84538
84349
|
|
84539
84350
|
// ../../generator-utils/dist/esm/utils/stripAnsi.js
|
@@ -84654,6 +84465,21 @@ async function getAvailableVersion(packageName, currentVersion, registry2) {
|
|
84654
84465
|
return currentVersion;
|
84655
84466
|
}
|
84656
84467
|
|
84468
|
+
// ../../generator-utils/dist/esm/utils/getGeneratorPath.js
|
84469
|
+
var import_path11 = __toESM(require("path"));
|
84470
|
+
var getGeneratorPath = (generator, distTag, paths) => {
|
84471
|
+
if (process.env.CODESMITH_ENV === "development") {
|
84472
|
+
return import_path11.default.dirname(require.resolve(generator, {
|
84473
|
+
paths: paths !== null && paths !== void 0 ? paths : [
|
84474
|
+
process.cwd()
|
84475
|
+
]
|
84476
|
+
}));
|
84477
|
+
} else if (distTag) {
|
84478
|
+
return `${generator}@${distTag}`;
|
84479
|
+
}
|
84480
|
+
return generator;
|
84481
|
+
};
|
84482
|
+
|
84657
84483
|
// ../../generator-utils/dist/esm/index.js
|
84658
84484
|
var import_utils50 = require("@modern-js/utils");
|
84659
84485
|
async function getPackageVersion(packageName, registry2) {
|
@@ -84701,13 +84527,13 @@ async function getModernPluginVersion(solution, packageName, options = {
|
|
84701
84527
|
if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
|
84702
84528
|
return getLatetPluginVersion("latest");
|
84703
84529
|
}
|
84704
|
-
let pkgPath =
|
84530
|
+
let pkgPath = import_path12.default.join(require.resolve(SolutionToolsMap[solution], {
|
84705
84531
|
paths: [
|
84706
84532
|
cwd
|
84707
84533
|
]
|
84708
84534
|
}), "../../..", "package.json");
|
84709
84535
|
if (solution === Solution.Module) {
|
84710
|
-
pkgPath =
|
84536
|
+
pkgPath = import_path12.default.join(require.resolve(SolutionToolsMap[solution], {
|
84711
84537
|
paths: [
|
84712
84538
|
cwd
|
84713
84539
|
]
|
@@ -84728,17 +84554,201 @@ async function getModernPluginVersion(solution, packageName, options = {
|
|
84728
84554
|
return getLatetPluginVersion();
|
84729
84555
|
}
|
84730
84556
|
|
84557
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_async_to_generator.js
|
84558
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
84559
|
+
try {
|
84560
|
+
var info = gen[key](arg);
|
84561
|
+
var value = info.value;
|
84562
|
+
} catch (error) {
|
84563
|
+
reject(error);
|
84564
|
+
return;
|
84565
|
+
}
|
84566
|
+
if (info.done)
|
84567
|
+
resolve(value);
|
84568
|
+
else
|
84569
|
+
Promise.resolve(value).then(_next, _throw);
|
84570
|
+
}
|
84571
|
+
function _async_to_generator(fn) {
|
84572
|
+
return function() {
|
84573
|
+
var self3 = this, args = arguments;
|
84574
|
+
return new Promise(function(resolve, reject) {
|
84575
|
+
var gen = fn.apply(self3, args);
|
84576
|
+
function _next(value) {
|
84577
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
84578
|
+
}
|
84579
|
+
function _throw(err) {
|
84580
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
84581
|
+
}
|
84582
|
+
_next(void 0);
|
84583
|
+
});
|
84584
|
+
};
|
84585
|
+
}
|
84586
|
+
|
84587
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_class_call_check.js
|
84588
|
+
function _class_call_check(instance, Constructor) {
|
84589
|
+
if (!(instance instanceof Constructor))
|
84590
|
+
throw new TypeError("Cannot call a class as a function");
|
84591
|
+
}
|
84592
|
+
|
84593
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_create_class.js
|
84594
|
+
function _defineProperties(target, props) {
|
84595
|
+
for (var i = 0; i < props.length; i++) {
|
84596
|
+
var descriptor = props[i];
|
84597
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
84598
|
+
descriptor.configurable = true;
|
84599
|
+
if ("value" in descriptor)
|
84600
|
+
descriptor.writable = true;
|
84601
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
84602
|
+
}
|
84603
|
+
}
|
84604
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
84605
|
+
if (protoProps)
|
84606
|
+
_defineProperties(Constructor.prototype, protoProps);
|
84607
|
+
if (staticProps)
|
84608
|
+
_defineProperties(Constructor, staticProps);
|
84609
|
+
return Constructor;
|
84610
|
+
}
|
84611
|
+
|
84612
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_spread.js
|
84613
|
+
function _object_spread(target) {
|
84614
|
+
for (var i = 1; i < arguments.length; i++) {
|
84615
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
84616
|
+
var ownKeys2 = Object.keys(source);
|
84617
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
84618
|
+
ownKeys2 = ownKeys2.concat(
|
84619
|
+
Object.getOwnPropertySymbols(source).filter(function(sym) {
|
84620
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
84621
|
+
})
|
84622
|
+
);
|
84623
|
+
}
|
84624
|
+
ownKeys2.forEach(function(key) {
|
84625
|
+
_define_property2(target, key, source[key]);
|
84626
|
+
});
|
84627
|
+
}
|
84628
|
+
return target;
|
84629
|
+
}
|
84630
|
+
|
84631
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_spread_props.js
|
84632
|
+
function ownKeys(object, enumerableOnly) {
|
84633
|
+
var keys = Object.keys(object);
|
84634
|
+
if (Object.getOwnPropertySymbols) {
|
84635
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
84636
|
+
if (enumerableOnly) {
|
84637
|
+
symbols = symbols.filter(function(sym) {
|
84638
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
84639
|
+
});
|
84640
|
+
}
|
84641
|
+
keys.push.apply(keys, symbols);
|
84642
|
+
}
|
84643
|
+
return keys;
|
84644
|
+
}
|
84645
|
+
function _object_spread_props(target, source) {
|
84646
|
+
source = source != null ? source : {};
|
84647
|
+
if (Object.getOwnPropertyDescriptors)
|
84648
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
84649
|
+
else {
|
84650
|
+
ownKeys(Object(source)).forEach(function(key) {
|
84651
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
84652
|
+
});
|
84653
|
+
}
|
84654
|
+
return target;
|
84655
|
+
}
|
84656
|
+
|
84657
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_without_properties_loose.js
|
84658
|
+
function _object_without_properties_loose(source, excluded) {
|
84659
|
+
if (source == null)
|
84660
|
+
return {};
|
84661
|
+
var target = {};
|
84662
|
+
var sourceKeys = Object.keys(source);
|
84663
|
+
var key, i;
|
84664
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
84665
|
+
key = sourceKeys[i];
|
84666
|
+
if (excluded.indexOf(key) >= 0)
|
84667
|
+
continue;
|
84668
|
+
target[key] = source[key];
|
84669
|
+
}
|
84670
|
+
return target;
|
84671
|
+
}
|
84672
|
+
|
84673
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_without_properties.js
|
84674
|
+
function _object_without_properties(source, excluded) {
|
84675
|
+
if (source == null)
|
84676
|
+
return {};
|
84677
|
+
var target = _object_without_properties_loose(source, excluded);
|
84678
|
+
var key, i;
|
84679
|
+
if (Object.getOwnPropertySymbols) {
|
84680
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
84681
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
84682
|
+
key = sourceSymbolKeys[i];
|
84683
|
+
if (excluded.indexOf(key) >= 0)
|
84684
|
+
continue;
|
84685
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
84686
|
+
continue;
|
84687
|
+
target[key] = source[key];
|
84688
|
+
}
|
84689
|
+
}
|
84690
|
+
return target;
|
84691
|
+
}
|
84692
|
+
|
84693
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_array_like_to_array.js
|
84694
|
+
function _array_like_to_array(arr, len) {
|
84695
|
+
if (len == null || len > arr.length)
|
84696
|
+
len = arr.length;
|
84697
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
84698
|
+
arr2[i] = arr[i];
|
84699
|
+
return arr2;
|
84700
|
+
}
|
84701
|
+
|
84702
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_array_without_holes.js
|
84703
|
+
function _array_without_holes(arr) {
|
84704
|
+
if (Array.isArray(arr))
|
84705
|
+
return _array_like_to_array(arr);
|
84706
|
+
}
|
84707
|
+
|
84708
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_iterable_to_array.js
|
84709
|
+
function _iterable_to_array(iter) {
|
84710
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
|
84711
|
+
return Array.from(iter);
|
84712
|
+
}
|
84713
|
+
}
|
84714
|
+
|
84715
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_non_iterable_spread.js
|
84716
|
+
function _non_iterable_spread() {
|
84717
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
84718
|
+
}
|
84719
|
+
|
84720
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_unsupported_iterable_to_array.js
|
84721
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
84722
|
+
if (!o)
|
84723
|
+
return;
|
84724
|
+
if (typeof o === "string")
|
84725
|
+
return _array_like_to_array(o, minLen);
|
84726
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
84727
|
+
if (n === "Object" && o.constructor)
|
84728
|
+
n = o.constructor.name;
|
84729
|
+
if (n === "Map" || n === "Set")
|
84730
|
+
return Array.from(n);
|
84731
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
84732
|
+
return _array_like_to_array(o, minLen);
|
84733
|
+
}
|
84734
|
+
|
84735
|
+
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_to_consumable_array.js
|
84736
|
+
function _to_consumable_array(arr) {
|
84737
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
84738
|
+
}
|
84739
|
+
|
84731
84740
|
// ../../generator-plugin/dist/esm/index.js
|
84741
|
+
var import_path18 = __toESM(require("path"));
|
84732
84742
|
var import_lodash14 = require("@modern-js/utils/lodash");
|
84733
84743
|
|
84734
84744
|
// ../../generator-plugin/dist/esm/context/file.js
|
84735
|
-
var
|
84745
|
+
var import_path14 = __toESM(require("path"));
|
84736
84746
|
|
84737
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.
|
84747
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.5/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
|
84738
84748
|
var import_comment_json2 = __toESM(require_src2());
|
84739
84749
|
var declarationUpdate = __toESM(require_dist());
|
84740
84750
|
|
84741
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.
|
84751
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.5/node_modules/@modern-js/codesmith-api-json/dist/esm-node/utils/index.js
|
84742
84752
|
async function editJson(generatorCore, resource, getNewJsonValue) {
|
84743
84753
|
const originJsonValue = await resource.value();
|
84744
84754
|
const newJsonString = await getNewJsonValue(originJsonValue.content);
|
@@ -84751,7 +84761,7 @@ async function editJson(generatorCore, resource, getNewJsonValue) {
|
|
84751
84761
|
return newJsonString;
|
84752
84762
|
}
|
84753
84763
|
|
84754
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.
|
84764
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.5/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
|
84755
84765
|
var JsonAPI = class {
|
84756
84766
|
async get(resource) {
|
84757
84767
|
const originJsonValue = await resource.value();
|
@@ -84797,7 +84807,7 @@ var JsonAPI = class {
|
|
84797
84807
|
};
|
84798
84808
|
|
84799
84809
|
// ../../generator-plugin/dist/esm/utils/file.js
|
84800
|
-
var
|
84810
|
+
var import_path13 = __toESM(require("path"));
|
84801
84811
|
var import_utils52 = require("@modern-js/utils");
|
84802
84812
|
var FileType;
|
84803
84813
|
(function(FileType22) {
|
@@ -84847,20 +84857,20 @@ function _fileExists() {
|
|
84847
84857
|
return _fileExists.apply(this, arguments);
|
84848
84858
|
}
|
84849
84859
|
function dropFileRootFolder(file) {
|
84850
|
-
var fileParts =
|
84860
|
+
var fileParts = import_path13.default.normalize(file).split(import_path13.default.sep);
|
84851
84861
|
fileParts.shift();
|
84852
|
-
return fileParts.join(
|
84862
|
+
return fileParts.join(import_path13.default.sep);
|
84853
84863
|
}
|
84854
84864
|
function dropFileRootPath(file, rootPath) {
|
84855
84865
|
var fileRootPath = rootPath ? file.replace(rootPath, "") : dropFileRootFolder(file);
|
84856
|
-
return fileRootPath.startsWith(
|
84866
|
+
return fileRootPath.startsWith(import_path13.default.sep) ? fileRootPath : "".concat(import_path13.default.sep).concat(fileRootPath);
|
84857
84867
|
}
|
84858
84868
|
function isAbsoluteOrRelativeFileTo(relativePath) {
|
84859
84869
|
var isFile2 = function(file) {
|
84860
84870
|
return import_utils50.fs.existsSync(file) && import_utils50.fs.lstatSync(file).isFile();
|
84861
84871
|
};
|
84862
84872
|
return function(fileName) {
|
84863
|
-
return isFile2(fileName) || isFile2(
|
84873
|
+
return isFile2(fileName) || isFile2(import_path13.default.join(relativePath, fileName));
|
84864
84874
|
};
|
84865
84875
|
}
|
84866
84876
|
function addFile(config, projectPath, templatePath, renderString3) {
|
@@ -84872,7 +84882,7 @@ function _addFile() {
|
|
84872
84882
|
return __generator(this, function(_state) {
|
84873
84883
|
switch (_state.label) {
|
84874
84884
|
case 0:
|
84875
|
-
fileDestPath =
|
84885
|
+
fileDestPath = import_path13.default.join(projectPath, config.file);
|
84876
84886
|
return [
|
84877
84887
|
4,
|
84878
84888
|
fileExists(fileDestPath)
|
@@ -84884,13 +84894,13 @@ function _addFile() {
|
|
84884
84894
|
}
|
84885
84895
|
return [
|
84886
84896
|
4,
|
84887
|
-
import_utils50.fs.mkdir(
|
84897
|
+
import_utils50.fs.mkdir(import_path13.default.dirname(fileDestPath), {
|
84888
84898
|
recursive: true
|
84889
84899
|
})
|
84890
84900
|
];
|
84891
84901
|
case 2:
|
84892
84902
|
_state.sent();
|
84893
|
-
absTemplatePath = config.templateFile ?
|
84903
|
+
absTemplatePath = config.templateFile ? import_path13.default.join(templatePath, config.templateFile) : null;
|
84894
84904
|
if (!(absTemplatePath != null && (config.type === "binary" || Object.keys(config.data || {}).length === 0)))
|
84895
84905
|
return [
|
84896
84906
|
3,
|
@@ -84960,9 +84970,9 @@ function _addManyFiles() {
|
|
84960
84970
|
config.templateFiles = config.templateFiles();
|
84961
84971
|
}
|
84962
84972
|
config.templateFiles = config.templateFiles.map(function(templateFile2) {
|
84963
|
-
return
|
84973
|
+
return import_path13.default.join(templatePath, templateFile2);
|
84964
84974
|
});
|
84965
|
-
config.templateBase = ((_config_templateBase = config.templateBase) === null || _config_templateBase === void 0 ? void 0 : _config_templateBase.startsWith(
|
84975
|
+
config.templateBase = ((_config_templateBase = config.templateBase) === null || _config_templateBase === void 0 ? void 0 : _config_templateBase.startsWith(import_path13.default.sep)) ? config.templateBase : "".concat(import_path13.default.sep).concat(config.templateBase || "");
|
84966
84976
|
templateFiles = import_utils52.globby.sync(config.templateFiles, {
|
84967
84977
|
braceExpansion: false,
|
84968
84978
|
dot: config.dot
|
@@ -84990,10 +85000,10 @@ function _addManyFiles() {
|
|
84990
85000
|
5
|
84991
85001
|
];
|
84992
85002
|
templateFile = _step.value;
|
84993
|
-
absTemplatePath =
|
85003
|
+
absTemplatePath = import_path13.default.resolve(templatePath, templateFile);
|
84994
85004
|
targetFile = dropFileRootPath(templateFile, config.templateBase);
|
84995
85005
|
fileCfg = _object_spread_props(_object_spread({}, config), {
|
84996
|
-
file:
|
85006
|
+
file: import_path13.default.join(config.destination, config.fileNameFunc ? config.fileNameFunc(targetFile) : targetFile),
|
84997
85007
|
templateFile: absTemplatePath,
|
84998
85008
|
force: true
|
84999
85009
|
});
|
@@ -85288,14 +85298,14 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
85288
85298
|
case 0:
|
85289
85299
|
return [
|
85290
85300
|
4,
|
85291
|
-
import_utils50.fs.readFile(
|
85301
|
+
import_utils50.fs.readFile(import_path14.default.join(_this.projectPath, fileName), "utf-8")
|
85292
85302
|
];
|
85293
85303
|
case 1:
|
85294
85304
|
content = _state.sent();
|
85295
85305
|
newContent = update(content.split("\n"));
|
85296
85306
|
return [
|
85297
85307
|
4,
|
85298
|
-
import_utils50.fs.writeFile(
|
85308
|
+
import_utils50.fs.writeFile(import_path14.default.join(_this.projectPath, fileName), newContent.join("\n"), "utf-8")
|
85299
85309
|
];
|
85300
85310
|
case 2:
|
85301
85311
|
_state.sent();
|
@@ -85316,7 +85326,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
85316
85326
|
return __generator(this, function(_state) {
|
85317
85327
|
switch (_state.label) {
|
85318
85328
|
case 0:
|
85319
|
-
file =
|
85329
|
+
file = import_path14.default.join(_this.projectPath, fileName);
|
85320
85330
|
return [
|
85321
85331
|
4,
|
85322
85332
|
fileExists(file)
|
@@ -85352,7 +85362,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
85352
85362
|
return __generator(this, function(_state) {
|
85353
85363
|
switch (_state.label) {
|
85354
85364
|
case 0:
|
85355
|
-
dir =
|
85365
|
+
dir = import_path14.default.join(_this.projectPath, dirName);
|
85356
85366
|
_state.label = 1;
|
85357
85367
|
case 1:
|
85358
85368
|
_state.trys.push([
|
@@ -85409,7 +85419,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
85409
85419
|
return __generator(this, function(_state) {
|
85410
85420
|
return [
|
85411
85421
|
2,
|
85412
|
-
fileExists(
|
85422
|
+
fileExists(import_path14.default.join(_this.projectPath, fileName))
|
85413
85423
|
];
|
85414
85424
|
});
|
85415
85425
|
})();
|
@@ -85423,7 +85433,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
85423
85433
|
return __generator(this, function(_state) {
|
85424
85434
|
return [
|
85425
85435
|
2,
|
85426
|
-
import_utils50.fs.readdir(
|
85436
|
+
import_utils50.fs.readdir(import_path14.default.join(_this.projectPath, dir))
|
85427
85437
|
];
|
85428
85438
|
});
|
85429
85439
|
})();
|
@@ -85829,11 +85839,18 @@ var PluginNpmAPI = /* @__PURE__ */ function() {
|
|
85829
85839
|
}();
|
85830
85840
|
|
85831
85841
|
// ../../new-action/dist/esm/utils/index.js
|
85832
|
-
var
|
85842
|
+
var import_path15 = __toESM(require("path"));
|
85833
85843
|
var import_utils53 = require("@modern-js/utils");
|
85844
|
+
var swap = (obj) => {
|
85845
|
+
return Object.keys(obj).reduce((acc, key) => {
|
85846
|
+
acc[obj[key]] = key;
|
85847
|
+
return acc;
|
85848
|
+
}, {});
|
85849
|
+
};
|
85850
|
+
var dependenceToSolution = swap(SolutionToolsMap);
|
85834
85851
|
function alreadyRepo(cwd = process.cwd()) {
|
85835
85852
|
try {
|
85836
|
-
return import_utils50.fs.existsSync(
|
85853
|
+
return import_utils50.fs.existsSync(import_path15.default.resolve(cwd, "package.json"));
|
85837
85854
|
} catch (e) {
|
85838
85855
|
return false;
|
85839
85856
|
}
|
@@ -85852,7 +85869,7 @@ var readJson = (jsonPath) => {
|
|
85852
85869
|
}
|
85853
85870
|
};
|
85854
85871
|
function hasEnabledFunction(action2, dependencies, devDependencies, peerDependencies, cwd) {
|
85855
|
-
const packageJsonPath =
|
85872
|
+
const packageJsonPath = import_path15.default.normalize(`${cwd}/package.json`);
|
85856
85873
|
const packageJson = readJson(packageJsonPath);
|
85857
85874
|
if (!dependencies[action2] && !devDependencies[action2]) {
|
85858
85875
|
return false;
|
@@ -85871,9 +85888,9 @@ function hasEnabledFunction(action2, dependencies, devDependencies, peerDependen
|
|
85871
85888
|
}
|
85872
85889
|
return false;
|
85873
85890
|
}
|
85874
|
-
function
|
85891
|
+
function getGeneratorPath2(generator, distTag) {
|
85875
85892
|
if (process.env.CODESMITH_ENV === "development") {
|
85876
|
-
return
|
85893
|
+
return import_path15.default.dirname(require.resolve(generator));
|
85877
85894
|
} else if (distTag) {
|
85878
85895
|
return `${generator}@${distTag}`;
|
85879
85896
|
}
|
@@ -85930,7 +85947,7 @@ var MWANewAction = async (options) => {
|
|
85930
85947
|
});
|
85931
85948
|
const actionType = ans.actionType;
|
85932
85949
|
const action2 = ans[actionType];
|
85933
|
-
const generator =
|
85950
|
+
const generator = getGeneratorPath2(MWANewActionGenerators[actionType][action2], distTag);
|
85934
85951
|
if (!generator) {
|
85935
85952
|
throw new Error(`no valid option`);
|
85936
85953
|
}
|
@@ -86026,7 +86043,7 @@ var ModuleNewAction = async (options) => {
|
|
86026
86043
|
});
|
86027
86044
|
const actionType = ans.actionType;
|
86028
86045
|
const action2 = ans[actionType];
|
86029
|
-
const generator =
|
86046
|
+
const generator = getGeneratorPath2(ModuleNewActionGenerators[actionType][action2], distTag);
|
86030
86047
|
if (!generator) {
|
86031
86048
|
throw new Error(`no valid option`);
|
86032
86049
|
}
|
@@ -86082,7 +86099,7 @@ var ModuleNewAction = async (options) => {
|
|
86082
86099
|
};
|
86083
86100
|
|
86084
86101
|
// ../../new-action/dist/esm/monorepo.js
|
86085
|
-
var
|
86102
|
+
var import_path16 = __toESM(require("path"));
|
86086
86103
|
var import_lodash12 = require("@modern-js/utils/lodash");
|
86087
86104
|
var REPO_GENERATOR = "@modern-js/repo-generator";
|
86088
86105
|
var MonorepoNewAction = async (options) => {
|
@@ -86105,10 +86122,10 @@ var MonorepoNewAction = async (options) => {
|
|
86105
86122
|
}
|
86106
86123
|
const plugins = plugin.map((plugin2) => {
|
86107
86124
|
try {
|
86108
|
-
return
|
86125
|
+
return import_path16.default.join(require.resolve(plugin2), "../../");
|
86109
86126
|
} catch (e) {
|
86110
86127
|
try {
|
86111
|
-
return
|
86128
|
+
return import_path16.default.join(require.resolve(plugin2), "../../../../");
|
86112
86129
|
} catch (e2) {
|
86113
86130
|
return plugin2;
|
86114
86131
|
}
|
@@ -86386,7 +86403,7 @@ var PluginContext = /* @__PURE__ */ function() {
|
|
86386
86403
|
}();
|
86387
86404
|
|
86388
86405
|
// ../../generator-plugin/dist/esm/utils/index.js
|
86389
|
-
var
|
86406
|
+
var import_path17 = __toESM(require("path"));
|
86390
86407
|
|
86391
86408
|
// ../../generator-plugin/dist/esm/utils/module.js
|
86392
86409
|
var import_lodash13 = require("@modern-js/utils/lodash");
|
@@ -86470,7 +86487,7 @@ function _installPlugins() {
|
|
86470
86487
|
switch (_state2.label) {
|
86471
86488
|
case 0:
|
86472
86489
|
if (plugin.startsWith("file:")) {
|
86473
|
-
pluginPath =
|
86490
|
+
pluginPath = import_path17.default.join(process.cwd(), plugin.slice(5));
|
86474
86491
|
return [
|
86475
86492
|
2,
|
86476
86493
|
{
|
@@ -86479,7 +86496,7 @@ function _installPlugins() {
|
|
86479
86496
|
}
|
86480
86497
|
];
|
86481
86498
|
}
|
86482
|
-
if (
|
86499
|
+
if (import_path17.default.isAbsolute(plugin)) {
|
86483
86500
|
return [
|
86484
86501
|
2,
|
86485
86502
|
{
|
@@ -86591,7 +86608,7 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
86591
86608
|
];
|
86592
86609
|
return [
|
86593
86610
|
4,
|
86594
|
-
import_utils50.fs.readJSON(
|
86611
|
+
import_utils50.fs.readJSON(import_path18.default.join(process.cwd(), plugin.slice(5), "package.json"))
|
86595
86612
|
];
|
86596
86613
|
case 1:
|
86597
86614
|
pkgJSON = _state2.sent();
|
@@ -86600,14 +86617,14 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
86600
86617
|
6
|
86601
86618
|
];
|
86602
86619
|
case 2:
|
86603
|
-
if (!
|
86620
|
+
if (!import_path18.default.isAbsolute(plugin))
|
86604
86621
|
return [
|
86605
86622
|
3,
|
86606
86623
|
4
|
86607
86624
|
];
|
86608
86625
|
return [
|
86609
86626
|
4,
|
86610
|
-
import_utils50.fs.readJSON(
|
86627
|
+
import_utils50.fs.readJSON(import_path18.default.join(plugin, "package.json"))
|
86611
86628
|
];
|
86612
86629
|
case 3:
|
86613
86630
|
pkgJSON = _state2.sent();
|
@@ -86877,7 +86894,7 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
86877
86894
|
5
|
86878
86895
|
];
|
86879
86896
|
info = _step.value;
|
86880
|
-
(_info_context = info.context) === null || _info_context === void 0 ? void 0 : _info_context.handlePrepareContext(generatorCore, solution,
|
86897
|
+
(_info_context = info.context) === null || _info_context === void 0 ? void 0 : _info_context.handlePrepareContext(generatorCore, solution, import_path18.default.join(basePath, projectPath), import_path18.default.join(info.templatePath, "templates"), restData);
|
86881
86898
|
onForgedFunc = (_info_context1 = info.context) === null || _info_context1 === void 0 ? void 0 : _info_context1.lifeCycleFuncMap[LifeCycle2.OnForged];
|
86882
86899
|
if (!(onForgedFunc && (0, import_lodash14.isFunction)(onForgedFunc)))
|
86883
86900
|
return [
|
@@ -87004,14 +87021,6 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
87004
87021
|
}();
|
87005
87022
|
|
87006
87023
|
// src/index.ts
|
87007
|
-
var getGeneratorPath2 = (generator, distTag) => {
|
87008
|
-
if (process.env.CODESMITH_ENV === "development") {
|
87009
|
-
return import_path18.default.dirname(require.resolve(generator));
|
87010
|
-
} else if (distTag) {
|
87011
|
-
return `${generator}@${distTag}`;
|
87012
|
-
}
|
87013
|
-
return generator;
|
87014
|
-
};
|
87015
87024
|
var mergeDefaultConfig = (context) => {
|
87016
87025
|
const { defaultSolution } = context.config;
|
87017
87026
|
if (defaultSolution) {
|
@@ -87052,7 +87061,7 @@ var handleTemplateFile = async (context, generator, appApi, generatorPlugin) =>
|
|
87052
87061
|
generator.logger.error("solution is not valid ");
|
87053
87062
|
}
|
87054
87063
|
await appApi.runSubGenerator(
|
87055
|
-
|
87064
|
+
getGeneratorPath(solutionGenerator, context.config.distTag, [__dirname]),
|
87056
87065
|
void 0,
|
87057
87066
|
{
|
87058
87067
|
...isMonorepo ? MonorepoNewActionConfig[solution] || {} : {},
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "3.3.
|
18
|
+
"version": "3.3.11",
|
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.
|
26
|
+
"@modern-js/utils": "2.48.0"
|
27
27
|
},
|
28
28
|
"devDependencies": {
|
29
|
-
"@modern-js/codesmith": "2.3.
|
30
|
-
"@modern-js/codesmith-api-app": "2.3.
|
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/
|
36
|
-
"@modern-js/generator
|
37
|
-
"@modern-js/generator-utils": "3.3.
|
38
|
-
"@modern-js/generator
|
39
|
-
"@modern-js/
|
40
|
-
"@modern-js/monorepo-generator": "3.3.
|
41
|
-
"@
|
42
|
-
"@
|
43
|
-
"@scripts/build": "2.
|
35
|
+
"@modern-js/generator-common": "3.3.11",
|
36
|
+
"@modern-js/base-generator": "3.3.11",
|
37
|
+
"@modern-js/generator-utils": "3.3.11",
|
38
|
+
"@modern-js/module-generator": "3.3.11",
|
39
|
+
"@modern-js/generator-plugin": "3.3.11",
|
40
|
+
"@modern-js/monorepo-generator": "3.3.11",
|
41
|
+
"@modern-js/mwa-generator": "3.3.11",
|
42
|
+
"@scripts/jest-config": "2.48.0",
|
43
|
+
"@scripts/build": "2.48.0"
|
44
44
|
},
|
45
45
|
"sideEffects": false,
|
46
46
|
"publishConfig": {
|
package/src/index.ts
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import path from 'path';
|
2
1
|
import { merge } from '@modern-js/utils/lodash';
|
3
2
|
import { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
|
4
3
|
import { AppAPI } from '@modern-js/codesmith-api-app';
|
@@ -15,17 +14,9 @@ import {
|
|
15
14
|
MonorepoNewActionConfig,
|
16
15
|
getScenesSchema,
|
17
16
|
} from '@modern-js/generator-common';
|
17
|
+
import { getGeneratorPath } from '@modern-js/generator-utils';
|
18
18
|
import { GeneratorPlugin } from '@modern-js/generator-plugin';
|
19
19
|
|
20
|
-
const getGeneratorPath = (generator: string, distTag: string) => {
|
21
|
-
if (process.env.CODESMITH_ENV === 'development') {
|
22
|
-
return path.dirname(require.resolve(generator));
|
23
|
-
} else if (distTag) {
|
24
|
-
return `${generator}@${distTag}`;
|
25
|
-
}
|
26
|
-
return generator;
|
27
|
-
};
|
28
|
-
|
29
20
|
const mergeDefaultConfig = (context: GeneratorContext) => {
|
30
21
|
const { defaultSolution } = context.config;
|
31
22
|
|
@@ -84,7 +75,7 @@ const handleTemplateFile = async (
|
|
84
75
|
}
|
85
76
|
|
86
77
|
await appApi.runSubGenerator(
|
87
|
-
getGeneratorPath(solutionGenerator, context.config.distTag),
|
78
|
+
getGeneratorPath(solutionGenerator, context.config.distTag, [__dirname]),
|
88
79
|
undefined,
|
89
80
|
{
|
90
81
|
...(isMonorepo
|