@modern-js/repo-generator 3.3.10 → 3.3.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +254 -243
- package/package.json +11 -11
- 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
|
@@ -84344,194 +84343,8 @@ var SolutionSchemas = {
|
|
84344
84343
|
custom: getBaseSchema
|
84345
84344
|
};
|
84346
84345
|
|
84347
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_async_to_generator.js
|
84348
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
84349
|
-
try {
|
84350
|
-
var info = gen[key](arg);
|
84351
|
-
var value = info.value;
|
84352
|
-
} catch (error) {
|
84353
|
-
reject(error);
|
84354
|
-
return;
|
84355
|
-
}
|
84356
|
-
if (info.done)
|
84357
|
-
resolve(value);
|
84358
|
-
else
|
84359
|
-
Promise.resolve(value).then(_next, _throw);
|
84360
|
-
}
|
84361
|
-
function _async_to_generator(fn) {
|
84362
|
-
return function() {
|
84363
|
-
var self3 = this, args = arguments;
|
84364
|
-
return new Promise(function(resolve, reject) {
|
84365
|
-
var gen = fn.apply(self3, args);
|
84366
|
-
function _next(value) {
|
84367
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
84368
|
-
}
|
84369
|
-
function _throw(err) {
|
84370
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
84371
|
-
}
|
84372
|
-
_next(void 0);
|
84373
|
-
});
|
84374
|
-
};
|
84375
|
-
}
|
84376
|
-
|
84377
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_class_call_check.js
|
84378
|
-
function _class_call_check(instance, Constructor) {
|
84379
|
-
if (!(instance instanceof Constructor))
|
84380
|
-
throw new TypeError("Cannot call a class as a function");
|
84381
|
-
}
|
84382
|
-
|
84383
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_create_class.js
|
84384
|
-
function _defineProperties(target, props) {
|
84385
|
-
for (var i = 0; i < props.length; i++) {
|
84386
|
-
var descriptor = props[i];
|
84387
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
84388
|
-
descriptor.configurable = true;
|
84389
|
-
if ("value" in descriptor)
|
84390
|
-
descriptor.writable = true;
|
84391
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
84392
|
-
}
|
84393
|
-
}
|
84394
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
84395
|
-
if (protoProps)
|
84396
|
-
_defineProperties(Constructor.prototype, protoProps);
|
84397
|
-
if (staticProps)
|
84398
|
-
_defineProperties(Constructor, staticProps);
|
84399
|
-
return Constructor;
|
84400
|
-
}
|
84401
|
-
|
84402
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_spread.js
|
84403
|
-
function _object_spread(target) {
|
84404
|
-
for (var i = 1; i < arguments.length; i++) {
|
84405
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
84406
|
-
var ownKeys2 = Object.keys(source);
|
84407
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
84408
|
-
ownKeys2 = ownKeys2.concat(
|
84409
|
-
Object.getOwnPropertySymbols(source).filter(function(sym) {
|
84410
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
84411
|
-
})
|
84412
|
-
);
|
84413
|
-
}
|
84414
|
-
ownKeys2.forEach(function(key) {
|
84415
|
-
_define_property2(target, key, source[key]);
|
84416
|
-
});
|
84417
|
-
}
|
84418
|
-
return target;
|
84419
|
-
}
|
84420
|
-
|
84421
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_spread_props.js
|
84422
|
-
function ownKeys(object, enumerableOnly) {
|
84423
|
-
var keys = Object.keys(object);
|
84424
|
-
if (Object.getOwnPropertySymbols) {
|
84425
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
84426
|
-
if (enumerableOnly) {
|
84427
|
-
symbols = symbols.filter(function(sym) {
|
84428
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
84429
|
-
});
|
84430
|
-
}
|
84431
|
-
keys.push.apply(keys, symbols);
|
84432
|
-
}
|
84433
|
-
return keys;
|
84434
|
-
}
|
84435
|
-
function _object_spread_props(target, source) {
|
84436
|
-
source = source != null ? source : {};
|
84437
|
-
if (Object.getOwnPropertyDescriptors)
|
84438
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
84439
|
-
else {
|
84440
|
-
ownKeys(Object(source)).forEach(function(key) {
|
84441
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
84442
|
-
});
|
84443
|
-
}
|
84444
|
-
return target;
|
84445
|
-
}
|
84446
|
-
|
84447
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_without_properties_loose.js
|
84448
|
-
function _object_without_properties_loose(source, excluded) {
|
84449
|
-
if (source == null)
|
84450
|
-
return {};
|
84451
|
-
var target = {};
|
84452
|
-
var sourceKeys = Object.keys(source);
|
84453
|
-
var key, i;
|
84454
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
84455
|
-
key = sourceKeys[i];
|
84456
|
-
if (excluded.indexOf(key) >= 0)
|
84457
|
-
continue;
|
84458
|
-
target[key] = source[key];
|
84459
|
-
}
|
84460
|
-
return target;
|
84461
|
-
}
|
84462
|
-
|
84463
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_object_without_properties.js
|
84464
|
-
function _object_without_properties(source, excluded) {
|
84465
|
-
if (source == null)
|
84466
|
-
return {};
|
84467
|
-
var target = _object_without_properties_loose(source, excluded);
|
84468
|
-
var key, i;
|
84469
|
-
if (Object.getOwnPropertySymbols) {
|
84470
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
84471
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
84472
|
-
key = sourceSymbolKeys[i];
|
84473
|
-
if (excluded.indexOf(key) >= 0)
|
84474
|
-
continue;
|
84475
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
84476
|
-
continue;
|
84477
|
-
target[key] = source[key];
|
84478
|
-
}
|
84479
|
-
}
|
84480
|
-
return target;
|
84481
|
-
}
|
84482
|
-
|
84483
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_array_like_to_array.js
|
84484
|
-
function _array_like_to_array(arr, len) {
|
84485
|
-
if (len == null || len > arr.length)
|
84486
|
-
len = arr.length;
|
84487
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
84488
|
-
arr2[i] = arr[i];
|
84489
|
-
return arr2;
|
84490
|
-
}
|
84491
|
-
|
84492
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_array_without_holes.js
|
84493
|
-
function _array_without_holes(arr) {
|
84494
|
-
if (Array.isArray(arr))
|
84495
|
-
return _array_like_to_array(arr);
|
84496
|
-
}
|
84497
|
-
|
84498
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_iterable_to_array.js
|
84499
|
-
function _iterable_to_array(iter) {
|
84500
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
|
84501
|
-
return Array.from(iter);
|
84502
|
-
}
|
84503
|
-
}
|
84504
|
-
|
84505
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_non_iterable_spread.js
|
84506
|
-
function _non_iterable_spread() {
|
84507
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
84508
|
-
}
|
84509
|
-
|
84510
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_unsupported_iterable_to_array.js
|
84511
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
84512
|
-
if (!o)
|
84513
|
-
return;
|
84514
|
-
if (typeof o === "string")
|
84515
|
-
return _array_like_to_array(o, minLen);
|
84516
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
84517
|
-
if (n === "Object" && o.constructor)
|
84518
|
-
n = o.constructor.name;
|
84519
|
-
if (n === "Map" || n === "Set")
|
84520
|
-
return Array.from(n);
|
84521
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
84522
|
-
return _array_like_to_array(o, minLen);
|
84523
|
-
}
|
84524
|
-
|
84525
|
-
// ../../../../node_modules/.pnpm/@swc+helpers@0.5.3/node_modules/@swc/helpers/esm/_to_consumable_array.js
|
84526
|
-
function _to_consumable_array(arr) {
|
84527
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
84528
|
-
}
|
84529
|
-
|
84530
|
-
// ../../generator-plugin/dist/esm/index.js
|
84531
|
-
var import_path17 = __toESM(require("path"));
|
84532
|
-
|
84533
84346
|
// ../../generator-utils/dist/esm/index.js
|
84534
|
-
var
|
84347
|
+
var import_path12 = __toESM(require("path"));
|
84535
84348
|
var import_utils49 = require("@modern-js/utils");
|
84536
84349
|
|
84537
84350
|
// ../../generator-utils/dist/esm/utils/stripAnsi.js
|
@@ -84652,6 +84465,21 @@ async function getAvailableVersion(packageName, currentVersion, registry2) {
|
|
84652
84465
|
return currentVersion;
|
84653
84466
|
}
|
84654
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
|
+
|
84655
84483
|
// ../../generator-utils/dist/esm/index.js
|
84656
84484
|
var import_utils50 = require("@modern-js/utils");
|
84657
84485
|
async function getPackageVersion(packageName, registry2) {
|
@@ -84699,13 +84527,13 @@ async function getModernPluginVersion(solution, packageName, options = {
|
|
84699
84527
|
if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
|
84700
84528
|
return getLatetPluginVersion("latest");
|
84701
84529
|
}
|
84702
|
-
let pkgPath =
|
84530
|
+
let pkgPath = import_path12.default.join(require.resolve(SolutionToolsMap[solution], {
|
84703
84531
|
paths: [
|
84704
84532
|
cwd
|
84705
84533
|
]
|
84706
84534
|
}), "../../..", "package.json");
|
84707
84535
|
if (solution === Solution.Module) {
|
84708
|
-
pkgPath =
|
84536
|
+
pkgPath = import_path12.default.join(require.resolve(SolutionToolsMap[solution], {
|
84709
84537
|
paths: [
|
84710
84538
|
cwd
|
84711
84539
|
]
|
@@ -84726,11 +84554,195 @@ async function getModernPluginVersion(solution, packageName, options = {
|
|
84726
84554
|
return getLatetPluginVersion();
|
84727
84555
|
}
|
84728
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
|
+
|
84729
84740
|
// ../../generator-plugin/dist/esm/index.js
|
84741
|
+
var import_path18 = __toESM(require("path"));
|
84730
84742
|
var import_lodash14 = require("@modern-js/utils/lodash");
|
84731
84743
|
|
84732
84744
|
// ../../generator-plugin/dist/esm/context/file.js
|
84733
|
-
var
|
84745
|
+
var import_path14 = __toESM(require("path"));
|
84734
84746
|
|
84735
84747
|
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.5/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
|
84736
84748
|
var import_comment_json2 = __toESM(require_src2());
|
@@ -84795,7 +84807,7 @@ var JsonAPI = class {
|
|
84795
84807
|
};
|
84796
84808
|
|
84797
84809
|
// ../../generator-plugin/dist/esm/utils/file.js
|
84798
|
-
var
|
84810
|
+
var import_path13 = __toESM(require("path"));
|
84799
84811
|
var import_utils52 = require("@modern-js/utils");
|
84800
84812
|
var FileType;
|
84801
84813
|
(function(FileType22) {
|
@@ -84845,20 +84857,20 @@ function _fileExists() {
|
|
84845
84857
|
return _fileExists.apply(this, arguments);
|
84846
84858
|
}
|
84847
84859
|
function dropFileRootFolder(file) {
|
84848
|
-
var fileParts =
|
84860
|
+
var fileParts = import_path13.default.normalize(file).split(import_path13.default.sep);
|
84849
84861
|
fileParts.shift();
|
84850
|
-
return fileParts.join(
|
84862
|
+
return fileParts.join(import_path13.default.sep);
|
84851
84863
|
}
|
84852
84864
|
function dropFileRootPath(file, rootPath) {
|
84853
84865
|
var fileRootPath = rootPath ? file.replace(rootPath, "") : dropFileRootFolder(file);
|
84854
|
-
return fileRootPath.startsWith(
|
84866
|
+
return fileRootPath.startsWith(import_path13.default.sep) ? fileRootPath : "".concat(import_path13.default.sep).concat(fileRootPath);
|
84855
84867
|
}
|
84856
84868
|
function isAbsoluteOrRelativeFileTo(relativePath) {
|
84857
84869
|
var isFile2 = function(file) {
|
84858
84870
|
return import_utils50.fs.existsSync(file) && import_utils50.fs.lstatSync(file).isFile();
|
84859
84871
|
};
|
84860
84872
|
return function(fileName) {
|
84861
|
-
return isFile2(fileName) || isFile2(
|
84873
|
+
return isFile2(fileName) || isFile2(import_path13.default.join(relativePath, fileName));
|
84862
84874
|
};
|
84863
84875
|
}
|
84864
84876
|
function addFile(config, projectPath, templatePath, renderString3) {
|
@@ -84870,7 +84882,7 @@ function _addFile() {
|
|
84870
84882
|
return __generator(this, function(_state) {
|
84871
84883
|
switch (_state.label) {
|
84872
84884
|
case 0:
|
84873
|
-
fileDestPath =
|
84885
|
+
fileDestPath = import_path13.default.join(projectPath, config.file);
|
84874
84886
|
return [
|
84875
84887
|
4,
|
84876
84888
|
fileExists(fileDestPath)
|
@@ -84882,13 +84894,13 @@ function _addFile() {
|
|
84882
84894
|
}
|
84883
84895
|
return [
|
84884
84896
|
4,
|
84885
|
-
import_utils50.fs.mkdir(
|
84897
|
+
import_utils50.fs.mkdir(import_path13.default.dirname(fileDestPath), {
|
84886
84898
|
recursive: true
|
84887
84899
|
})
|
84888
84900
|
];
|
84889
84901
|
case 2:
|
84890
84902
|
_state.sent();
|
84891
|
-
absTemplatePath = config.templateFile ?
|
84903
|
+
absTemplatePath = config.templateFile ? import_path13.default.join(templatePath, config.templateFile) : null;
|
84892
84904
|
if (!(absTemplatePath != null && (config.type === "binary" || Object.keys(config.data || {}).length === 0)))
|
84893
84905
|
return [
|
84894
84906
|
3,
|
@@ -84958,9 +84970,9 @@ function _addManyFiles() {
|
|
84958
84970
|
config.templateFiles = config.templateFiles();
|
84959
84971
|
}
|
84960
84972
|
config.templateFiles = config.templateFiles.map(function(templateFile2) {
|
84961
|
-
return
|
84973
|
+
return import_path13.default.join(templatePath, templateFile2);
|
84962
84974
|
});
|
84963
|
-
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 || "");
|
84964
84976
|
templateFiles = import_utils52.globby.sync(config.templateFiles, {
|
84965
84977
|
braceExpansion: false,
|
84966
84978
|
dot: config.dot
|
@@ -84988,10 +85000,10 @@ function _addManyFiles() {
|
|
84988
85000
|
5
|
84989
85001
|
];
|
84990
85002
|
templateFile = _step.value;
|
84991
|
-
absTemplatePath =
|
85003
|
+
absTemplatePath = import_path13.default.resolve(templatePath, templateFile);
|
84992
85004
|
targetFile = dropFileRootPath(templateFile, config.templateBase);
|
84993
85005
|
fileCfg = _object_spread_props(_object_spread({}, config), {
|
84994
|
-
file:
|
85006
|
+
file: import_path13.default.join(config.destination, config.fileNameFunc ? config.fileNameFunc(targetFile) : targetFile),
|
84995
85007
|
templateFile: absTemplatePath,
|
84996
85008
|
force: true
|
84997
85009
|
});
|
@@ -85286,14 +85298,14 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
85286
85298
|
case 0:
|
85287
85299
|
return [
|
85288
85300
|
4,
|
85289
|
-
import_utils50.fs.readFile(
|
85301
|
+
import_utils50.fs.readFile(import_path14.default.join(_this.projectPath, fileName), "utf-8")
|
85290
85302
|
];
|
85291
85303
|
case 1:
|
85292
85304
|
content = _state.sent();
|
85293
85305
|
newContent = update(content.split("\n"));
|
85294
85306
|
return [
|
85295
85307
|
4,
|
85296
|
-
import_utils50.fs.writeFile(
|
85308
|
+
import_utils50.fs.writeFile(import_path14.default.join(_this.projectPath, fileName), newContent.join("\n"), "utf-8")
|
85297
85309
|
];
|
85298
85310
|
case 2:
|
85299
85311
|
_state.sent();
|
@@ -85314,7 +85326,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
85314
85326
|
return __generator(this, function(_state) {
|
85315
85327
|
switch (_state.label) {
|
85316
85328
|
case 0:
|
85317
|
-
file =
|
85329
|
+
file = import_path14.default.join(_this.projectPath, fileName);
|
85318
85330
|
return [
|
85319
85331
|
4,
|
85320
85332
|
fileExists(file)
|
@@ -85350,7 +85362,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
85350
85362
|
return __generator(this, function(_state) {
|
85351
85363
|
switch (_state.label) {
|
85352
85364
|
case 0:
|
85353
|
-
dir =
|
85365
|
+
dir = import_path14.default.join(_this.projectPath, dirName);
|
85354
85366
|
_state.label = 1;
|
85355
85367
|
case 1:
|
85356
85368
|
_state.trys.push([
|
@@ -85407,7 +85419,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
85407
85419
|
return __generator(this, function(_state) {
|
85408
85420
|
return [
|
85409
85421
|
2,
|
85410
|
-
fileExists(
|
85422
|
+
fileExists(import_path14.default.join(_this.projectPath, fileName))
|
85411
85423
|
];
|
85412
85424
|
});
|
85413
85425
|
})();
|
@@ -85421,7 +85433,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
85421
85433
|
return __generator(this, function(_state) {
|
85422
85434
|
return [
|
85423
85435
|
2,
|
85424
|
-
import_utils50.fs.readdir(
|
85436
|
+
import_utils50.fs.readdir(import_path14.default.join(_this.projectPath, dir))
|
85425
85437
|
];
|
85426
85438
|
});
|
85427
85439
|
})();
|
@@ -85827,11 +85839,18 @@ var PluginNpmAPI = /* @__PURE__ */ function() {
|
|
85827
85839
|
}();
|
85828
85840
|
|
85829
85841
|
// ../../new-action/dist/esm/utils/index.js
|
85830
|
-
var
|
85842
|
+
var import_path15 = __toESM(require("path"));
|
85831
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);
|
85832
85851
|
function alreadyRepo(cwd = process.cwd()) {
|
85833
85852
|
try {
|
85834
|
-
return import_utils50.fs.existsSync(
|
85853
|
+
return import_utils50.fs.existsSync(import_path15.default.resolve(cwd, "package.json"));
|
85835
85854
|
} catch (e) {
|
85836
85855
|
return false;
|
85837
85856
|
}
|
@@ -85850,7 +85869,7 @@ var readJson = (jsonPath) => {
|
|
85850
85869
|
}
|
85851
85870
|
};
|
85852
85871
|
function hasEnabledFunction(action2, dependencies, devDependencies, peerDependencies, cwd) {
|
85853
|
-
const packageJsonPath =
|
85872
|
+
const packageJsonPath = import_path15.default.normalize(`${cwd}/package.json`);
|
85854
85873
|
const packageJson = readJson(packageJsonPath);
|
85855
85874
|
if (!dependencies[action2] && !devDependencies[action2]) {
|
85856
85875
|
return false;
|
@@ -85869,9 +85888,9 @@ function hasEnabledFunction(action2, dependencies, devDependencies, peerDependen
|
|
85869
85888
|
}
|
85870
85889
|
return false;
|
85871
85890
|
}
|
85872
|
-
function
|
85891
|
+
function getGeneratorPath2(generator, distTag) {
|
85873
85892
|
if (process.env.CODESMITH_ENV === "development") {
|
85874
|
-
return
|
85893
|
+
return import_path15.default.dirname(require.resolve(generator));
|
85875
85894
|
} else if (distTag) {
|
85876
85895
|
return `${generator}@${distTag}`;
|
85877
85896
|
}
|
@@ -85928,7 +85947,7 @@ var MWANewAction = async (options) => {
|
|
85928
85947
|
});
|
85929
85948
|
const actionType = ans.actionType;
|
85930
85949
|
const action2 = ans[actionType];
|
85931
|
-
const generator =
|
85950
|
+
const generator = getGeneratorPath2(MWANewActionGenerators[actionType][action2], distTag);
|
85932
85951
|
if (!generator) {
|
85933
85952
|
throw new Error(`no valid option`);
|
85934
85953
|
}
|
@@ -86024,7 +86043,7 @@ var ModuleNewAction = async (options) => {
|
|
86024
86043
|
});
|
86025
86044
|
const actionType = ans.actionType;
|
86026
86045
|
const action2 = ans[actionType];
|
86027
|
-
const generator =
|
86046
|
+
const generator = getGeneratorPath2(ModuleNewActionGenerators[actionType][action2], distTag);
|
86028
86047
|
if (!generator) {
|
86029
86048
|
throw new Error(`no valid option`);
|
86030
86049
|
}
|
@@ -86080,7 +86099,7 @@ var ModuleNewAction = async (options) => {
|
|
86080
86099
|
};
|
86081
86100
|
|
86082
86101
|
// ../../new-action/dist/esm/monorepo.js
|
86083
|
-
var
|
86102
|
+
var import_path16 = __toESM(require("path"));
|
86084
86103
|
var import_lodash12 = require("@modern-js/utils/lodash");
|
86085
86104
|
var REPO_GENERATOR = "@modern-js/repo-generator";
|
86086
86105
|
var MonorepoNewAction = async (options) => {
|
@@ -86103,10 +86122,10 @@ var MonorepoNewAction = async (options) => {
|
|
86103
86122
|
}
|
86104
86123
|
const plugins = plugin.map((plugin2) => {
|
86105
86124
|
try {
|
86106
|
-
return
|
86125
|
+
return import_path16.default.join(require.resolve(plugin2), "../../");
|
86107
86126
|
} catch (e) {
|
86108
86127
|
try {
|
86109
|
-
return
|
86128
|
+
return import_path16.default.join(require.resolve(plugin2), "../../../../");
|
86110
86129
|
} catch (e2) {
|
86111
86130
|
return plugin2;
|
86112
86131
|
}
|
@@ -86384,7 +86403,7 @@ var PluginContext = /* @__PURE__ */ function() {
|
|
86384
86403
|
}();
|
86385
86404
|
|
86386
86405
|
// ../../generator-plugin/dist/esm/utils/index.js
|
86387
|
-
var
|
86406
|
+
var import_path17 = __toESM(require("path"));
|
86388
86407
|
|
86389
86408
|
// ../../generator-plugin/dist/esm/utils/module.js
|
86390
86409
|
var import_lodash13 = require("@modern-js/utils/lodash");
|
@@ -86468,7 +86487,7 @@ function _installPlugins() {
|
|
86468
86487
|
switch (_state2.label) {
|
86469
86488
|
case 0:
|
86470
86489
|
if (plugin.startsWith("file:")) {
|
86471
|
-
pluginPath =
|
86490
|
+
pluginPath = import_path17.default.join(process.cwd(), plugin.slice(5));
|
86472
86491
|
return [
|
86473
86492
|
2,
|
86474
86493
|
{
|
@@ -86477,7 +86496,7 @@ function _installPlugins() {
|
|
86477
86496
|
}
|
86478
86497
|
];
|
86479
86498
|
}
|
86480
|
-
if (
|
86499
|
+
if (import_path17.default.isAbsolute(plugin)) {
|
86481
86500
|
return [
|
86482
86501
|
2,
|
86483
86502
|
{
|
@@ -86589,7 +86608,7 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
86589
86608
|
];
|
86590
86609
|
return [
|
86591
86610
|
4,
|
86592
|
-
import_utils50.fs.readJSON(
|
86611
|
+
import_utils50.fs.readJSON(import_path18.default.join(process.cwd(), plugin.slice(5), "package.json"))
|
86593
86612
|
];
|
86594
86613
|
case 1:
|
86595
86614
|
pkgJSON = _state2.sent();
|
@@ -86598,14 +86617,14 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
86598
86617
|
6
|
86599
86618
|
];
|
86600
86619
|
case 2:
|
86601
|
-
if (!
|
86620
|
+
if (!import_path18.default.isAbsolute(plugin))
|
86602
86621
|
return [
|
86603
86622
|
3,
|
86604
86623
|
4
|
86605
86624
|
];
|
86606
86625
|
return [
|
86607
86626
|
4,
|
86608
|
-
import_utils50.fs.readJSON(
|
86627
|
+
import_utils50.fs.readJSON(import_path18.default.join(plugin, "package.json"))
|
86609
86628
|
];
|
86610
86629
|
case 3:
|
86611
86630
|
pkgJSON = _state2.sent();
|
@@ -86875,7 +86894,7 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
86875
86894
|
5
|
86876
86895
|
];
|
86877
86896
|
info = _step.value;
|
86878
|
-
(_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);
|
86879
86898
|
onForgedFunc = (_info_context1 = info.context) === null || _info_context1 === void 0 ? void 0 : _info_context1.lifeCycleFuncMap[LifeCycle2.OnForged];
|
86880
86899
|
if (!(onForgedFunc && (0, import_lodash14.isFunction)(onForgedFunc)))
|
86881
86900
|
return [
|
@@ -87002,14 +87021,6 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
87002
87021
|
}();
|
87003
87022
|
|
87004
87023
|
// src/index.ts
|
87005
|
-
var getGeneratorPath2 = (generator, distTag) => {
|
87006
|
-
if (process.env.CODESMITH_ENV === "development") {
|
87007
|
-
return import_path18.default.dirname(require.resolve(generator));
|
87008
|
-
} else if (distTag) {
|
87009
|
-
return `${generator}@${distTag}`;
|
87010
|
-
}
|
87011
|
-
return generator;
|
87012
|
-
};
|
87013
87024
|
var mergeDefaultConfig = (context) => {
|
87014
87025
|
const { defaultSolution } = context.config;
|
87015
87026
|
if (defaultSolution) {
|
@@ -87050,7 +87061,7 @@ var handleTemplateFile = async (context, generator, appApi, generatorPlugin) =>
|
|
87050
87061
|
generator.logger.error("solution is not valid ");
|
87051
87062
|
}
|
87052
87063
|
await appApi.runSubGenerator(
|
87053
|
-
|
87064
|
+
getGeneratorPath(solutionGenerator, context.config.distTag, [__dirname]),
|
87054
87065
|
void 0,
|
87055
87066
|
{
|
87056
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,7 +23,7 @@
|
|
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
29
|
"@modern-js/codesmith": "2.3.5",
|
@@ -32,15 +32,15 @@
|
|
32
32
|
"@types/node": "^14",
|
33
33
|
"jest": "^29",
|
34
34
|
"typescript": "^5",
|
35
|
-
"@modern-js/generator-common": "3.3.
|
36
|
-
"@modern-js/base-generator": "3.3.
|
37
|
-
"@modern-js/generator-utils": "3.3.
|
38
|
-
"@modern-js/module-generator": "3.3.
|
39
|
-
"@modern-js/generator-plugin": "3.3.
|
40
|
-
"@modern-js/monorepo-generator": "3.3.
|
41
|
-
"@
|
42
|
-
"@
|
43
|
-
"@scripts/
|
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
|