@modern-js/repo-generator 3.1.9 → 3.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +672 -695
- package/package.json +17 -13
package/dist/index.js
CHANGED
@@ -11558,7 +11558,7 @@ var require_ora = __commonJS({
|
|
11558
11558
|
}, 87: (e2, t2, r2) => {
|
11559
11559
|
"use strict";
|
11560
11560
|
var i;
|
11561
|
-
function
|
11561
|
+
function _defineProperty20(e3, t3, r3) {
|
11562
11562
|
if (t3 in e3) {
|
11563
11563
|
Object.defineProperty(e3, t3, { value: r3, enumerable: true, configurable: true, writable: true });
|
11564
11564
|
} else {
|
@@ -11640,9 +11640,9 @@ var require_ora = __commonJS({
|
|
11640
11640
|
}
|
11641
11641
|
this[l] = i2;
|
11642
11642
|
return i2;
|
11643
|
-
} },
|
11643
|
+
} }, _defineProperty20(i, Symbol.asyncIterator, function() {
|
11644
11644
|
return this;
|
11645
|
-
}),
|
11645
|
+
}), _defineProperty20(i, "return", function _return() {
|
11646
11646
|
var e3 = this;
|
11647
11647
|
return new Promise(function(t3, r3) {
|
11648
11648
|
e3[h].destroy(null, function(e4) {
|
@@ -11656,7 +11656,7 @@ var require_ora = __commonJS({
|
|
11656
11656
|
}), i), d);
|
11657
11657
|
var _ = function createReadableStreamAsyncIterator(e3) {
|
11658
11658
|
var t3;
|
11659
|
-
var r3 = Object.create(p, (t3 = {},
|
11659
|
+
var r3 = Object.create(p, (t3 = {}, _defineProperty20(t3, h, { value: e3, writable: true }), _defineProperty20(t3, s, { value: null, writable: true }), _defineProperty20(t3, a, { value: null, writable: true }), _defineProperty20(t3, o, { value: null, writable: true }), _defineProperty20(t3, f, { value: e3._readableState.endEmitted, writable: true }), _defineProperty20(t3, u, { value: function value(e4, t4) {
|
11660
11660
|
var i2 = r3[h].read();
|
11661
11661
|
if (i2) {
|
11662
11662
|
r3[l] = null;
|
@@ -11708,12 +11708,12 @@ var require_ora = __commonJS({
|
|
11708
11708
|
}
|
11709
11709
|
return r3;
|
11710
11710
|
}
|
11711
|
-
function
|
11711
|
+
function _objectSpread9(e3) {
|
11712
11712
|
for (var t3 = 1; t3 < arguments.length; t3++) {
|
11713
11713
|
var r3 = arguments[t3] != null ? arguments[t3] : {};
|
11714
11714
|
if (t3 % 2) {
|
11715
11715
|
ownKeys9(Object(r3), true).forEach(function(t4) {
|
11716
|
-
|
11716
|
+
_defineProperty20(e3, t4, r3[t4]);
|
11717
11717
|
});
|
11718
11718
|
} else if (Object.getOwnPropertyDescriptors) {
|
11719
11719
|
Object.defineProperties(e3, Object.getOwnPropertyDescriptors(r3));
|
@@ -11725,7 +11725,7 @@ var require_ora = __commonJS({
|
|
11725
11725
|
}
|
11726
11726
|
return e3;
|
11727
11727
|
}
|
11728
|
-
function
|
11728
|
+
function _defineProperty20(e3, t3, r3) {
|
11729
11729
|
if (t3 in e3) {
|
11730
11730
|
Object.defineProperty(e3, t3, { value: r3, enumerable: true, configurable: true, writable: true });
|
11731
11731
|
} else {
|
@@ -11733,12 +11733,12 @@ var require_ora = __commonJS({
|
|
11733
11733
|
}
|
11734
11734
|
return e3;
|
11735
11735
|
}
|
11736
|
-
function
|
11736
|
+
function _classCallCheck16(e3, t3) {
|
11737
11737
|
if (!(e3 instanceof t3)) {
|
11738
11738
|
throw new TypeError("Cannot call a class as a function");
|
11739
11739
|
}
|
11740
11740
|
}
|
11741
|
-
function
|
11741
|
+
function _defineProperties25(e3, t3) {
|
11742
11742
|
for (var r3 = 0; r3 < t3.length; r3++) {
|
11743
11743
|
var i2 = t3[r3];
|
11744
11744
|
i2.enumerable = i2.enumerable || false;
|
@@ -11748,11 +11748,11 @@ var require_ora = __commonJS({
|
|
11748
11748
|
Object.defineProperty(e3, i2.key, i2);
|
11749
11749
|
}
|
11750
11750
|
}
|
11751
|
-
function
|
11751
|
+
function _createClass16(e3, t3, r3) {
|
11752
11752
|
if (t3)
|
11753
|
-
|
11753
|
+
_defineProperties25(e3.prototype, t3);
|
11754
11754
|
if (r3)
|
11755
|
-
|
11755
|
+
_defineProperties25(e3, r3);
|
11756
11756
|
return e3;
|
11757
11757
|
}
|
11758
11758
|
var i = r2(300), n = i.Buffer;
|
@@ -11763,12 +11763,12 @@ var require_ora = __commonJS({
|
|
11763
11763
|
}
|
11764
11764
|
e2.exports = function() {
|
11765
11765
|
function BufferList() {
|
11766
|
-
|
11766
|
+
_classCallCheck16(this, BufferList);
|
11767
11767
|
this.head = null;
|
11768
11768
|
this.tail = null;
|
11769
11769
|
this.length = 0;
|
11770
11770
|
}
|
11771
|
-
|
11771
|
+
_createClass16(BufferList, [{ key: "push", value: function push(e3) {
|
11772
11772
|
var t3 = { data: e3, next: null };
|
11773
11773
|
if (this.length > 0)
|
11774
11774
|
this.tail.next = t3;
|
@@ -11888,7 +11888,7 @@ var require_ora = __commonJS({
|
|
11888
11888
|
this.length -= i2;
|
11889
11889
|
return t3;
|
11890
11890
|
} }, { key: o, value: function value(e3, t3) {
|
11891
|
-
return a(this,
|
11891
|
+
return a(this, _objectSpread9({}, t3, { depth: 0, customInspect: false }));
|
11892
11892
|
} }]);
|
11893
11893
|
return BufferList;
|
11894
11894
|
}();
|
@@ -12088,7 +12088,7 @@ var require_ora = __commonJS({
|
|
12088
12088
|
Promise.resolve(f).then(i2, n);
|
12089
12089
|
}
|
12090
12090
|
}
|
12091
|
-
function
|
12091
|
+
function _asyncToGenerator29(e3) {
|
12092
12092
|
return function() {
|
12093
12093
|
var t3 = this, r3 = arguments;
|
12094
12094
|
return new Promise(function(i2, n) {
|
@@ -12115,12 +12115,12 @@ var require_ora = __commonJS({
|
|
12115
12115
|
}
|
12116
12116
|
return r3;
|
12117
12117
|
}
|
12118
|
-
function
|
12118
|
+
function _objectSpread9(e3) {
|
12119
12119
|
for (var t3 = 1; t3 < arguments.length; t3++) {
|
12120
12120
|
var r3 = arguments[t3] != null ? arguments[t3] : {};
|
12121
12121
|
if (t3 % 2) {
|
12122
12122
|
ownKeys9(Object(r3), true).forEach(function(t4) {
|
12123
|
-
|
12123
|
+
_defineProperty20(e3, t4, r3[t4]);
|
12124
12124
|
});
|
12125
12125
|
} else if (Object.getOwnPropertyDescriptors) {
|
12126
12126
|
Object.defineProperties(e3, Object.getOwnPropertyDescriptors(r3));
|
@@ -12132,7 +12132,7 @@ var require_ora = __commonJS({
|
|
12132
12132
|
}
|
12133
12133
|
return e3;
|
12134
12134
|
}
|
12135
|
-
function
|
12135
|
+
function _defineProperty20(e3, t3, r3) {
|
12136
12136
|
if (t3 in e3) {
|
12137
12137
|
Object.defineProperty(e3, t3, { value: r3, enumerable: true, configurable: true, writable: true });
|
12138
12138
|
} else {
|
@@ -12151,7 +12151,7 @@ var require_ora = __commonJS({
|
|
12151
12151
|
n = t3[Symbol.iterator]();
|
12152
12152
|
else
|
12153
12153
|
throw new i("iterable", ["Iterable"], t3);
|
12154
|
-
var s = new e3(
|
12154
|
+
var s = new e3(_objectSpread9({ objectMode: true }, r3));
|
12155
12155
|
var a = false;
|
12156
12156
|
s._read = function() {
|
12157
12157
|
if (!a) {
|
@@ -12163,7 +12163,7 @@ var require_ora = __commonJS({
|
|
12163
12163
|
return _next2.apply(this, arguments);
|
12164
12164
|
}
|
12165
12165
|
function _next2() {
|
12166
|
-
_next2 =
|
12166
|
+
_next2 = _asyncToGenerator29(function* () {
|
12167
12167
|
try {
|
12168
12168
|
var e4 = yield n.next(), t4 = e4.value, r4 = e4.done;
|
12169
12169
|
if (r4) {
|
@@ -79659,12 +79659,12 @@ var require_buffer_list = __commonJS({
|
|
79659
79659
|
}
|
79660
79660
|
return keys;
|
79661
79661
|
}
|
79662
|
-
function
|
79662
|
+
function _objectSpread9(target) {
|
79663
79663
|
for (var i = 1; i < arguments.length; i++) {
|
79664
79664
|
var source = arguments[i] != null ? arguments[i] : {};
|
79665
79665
|
if (i % 2) {
|
79666
79666
|
ownKeys9(Object(source), true).forEach(function(key) {
|
79667
|
-
|
79667
|
+
_defineProperty20(target, key, source[key]);
|
79668
79668
|
});
|
79669
79669
|
} else if (Object.getOwnPropertyDescriptors) {
|
79670
79670
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
@@ -79676,7 +79676,7 @@ var require_buffer_list = __commonJS({
|
|
79676
79676
|
}
|
79677
79677
|
return target;
|
79678
79678
|
}
|
79679
|
-
function
|
79679
|
+
function _defineProperty20(obj, key, value) {
|
79680
79680
|
if (key in obj) {
|
79681
79681
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
79682
79682
|
} else {
|
@@ -79684,12 +79684,12 @@ var require_buffer_list = __commonJS({
|
|
79684
79684
|
}
|
79685
79685
|
return obj;
|
79686
79686
|
}
|
79687
|
-
function
|
79687
|
+
function _classCallCheck16(instance, Constructor) {
|
79688
79688
|
if (!(instance instanceof Constructor)) {
|
79689
79689
|
throw new TypeError("Cannot call a class as a function");
|
79690
79690
|
}
|
79691
79691
|
}
|
79692
|
-
function
|
79692
|
+
function _defineProperties25(target, props) {
|
79693
79693
|
for (var i = 0; i < props.length; i++) {
|
79694
79694
|
var descriptor = props[i];
|
79695
79695
|
descriptor.enumerable = descriptor.enumerable || false;
|
@@ -79699,11 +79699,11 @@ var require_buffer_list = __commonJS({
|
|
79699
79699
|
Object.defineProperty(target, descriptor.key, descriptor);
|
79700
79700
|
}
|
79701
79701
|
}
|
79702
|
-
function
|
79702
|
+
function _createClass16(Constructor, protoProps, staticProps) {
|
79703
79703
|
if (protoProps)
|
79704
|
-
|
79704
|
+
_defineProperties25(Constructor.prototype, protoProps);
|
79705
79705
|
if (staticProps)
|
79706
|
-
|
79706
|
+
_defineProperties25(Constructor, staticProps);
|
79707
79707
|
return Constructor;
|
79708
79708
|
}
|
79709
79709
|
var _require = require("buffer");
|
@@ -79716,12 +79716,12 @@ var require_buffer_list = __commonJS({
|
|
79716
79716
|
}
|
79717
79717
|
module2.exports = /* @__PURE__ */ function() {
|
79718
79718
|
function BufferList() {
|
79719
|
-
|
79719
|
+
_classCallCheck16(this, BufferList);
|
79720
79720
|
this.head = null;
|
79721
79721
|
this.tail = null;
|
79722
79722
|
this.length = 0;
|
79723
79723
|
}
|
79724
|
-
|
79724
|
+
_createClass16(BufferList, [{
|
79725
79725
|
key: "push",
|
79726
79726
|
value: function push(v) {
|
79727
79727
|
var entry = {
|
@@ -79883,7 +79883,7 @@ var require_buffer_list = __commonJS({
|
|
79883
79883
|
}, {
|
79884
79884
|
key: custom,
|
79885
79885
|
value: function value(_, options) {
|
79886
|
-
return inspect(this,
|
79886
|
+
return inspect(this, _objectSpread9({}, options, {
|
79887
79887
|
// Only inspect one level.
|
79888
79888
|
depth: 0,
|
79889
79889
|
// It should not recurse.
|
@@ -81192,7 +81192,7 @@ var require_async_iterator = __commonJS({
|
|
81192
81192
|
"../../../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports, module2) {
|
81193
81193
|
"use strict";
|
81194
81194
|
var _Object$setPrototypeO;
|
81195
|
-
function
|
81195
|
+
function _defineProperty20(obj, key, value) {
|
81196
81196
|
if (key in obj) {
|
81197
81197
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
81198
81198
|
} else {
|
@@ -81280,9 +81280,9 @@ var require_async_iterator = __commonJS({
|
|
81280
81280
|
this[kLastPromise] = promise;
|
81281
81281
|
return promise;
|
81282
81282
|
}
|
81283
|
-
},
|
81283
|
+
}, _defineProperty20(_Object$setPrototypeO, Symbol.asyncIterator, function() {
|
81284
81284
|
return this;
|
81285
|
-
}),
|
81285
|
+
}), _defineProperty20(_Object$setPrototypeO, "return", function _return() {
|
81286
81286
|
var _this2 = this;
|
81287
81287
|
return new Promise(function(resolve, reject) {
|
81288
81288
|
_this2[kStream].destroy(null, function(err) {
|
@@ -81296,22 +81296,22 @@ var require_async_iterator = __commonJS({
|
|
81296
81296
|
}), _Object$setPrototypeO), AsyncIteratorPrototype);
|
81297
81297
|
var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream) {
|
81298
81298
|
var _Object$create;
|
81299
|
-
var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {},
|
81299
|
+
var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty20(_Object$create, kStream, {
|
81300
81300
|
value: stream,
|
81301
81301
|
writable: true
|
81302
|
-
}),
|
81302
|
+
}), _defineProperty20(_Object$create, kLastResolve, {
|
81303
81303
|
value: null,
|
81304
81304
|
writable: true
|
81305
|
-
}),
|
81305
|
+
}), _defineProperty20(_Object$create, kLastReject, {
|
81306
81306
|
value: null,
|
81307
81307
|
writable: true
|
81308
|
-
}),
|
81308
|
+
}), _defineProperty20(_Object$create, kError, {
|
81309
81309
|
value: null,
|
81310
81310
|
writable: true
|
81311
|
-
}),
|
81311
|
+
}), _defineProperty20(_Object$create, kEnded, {
|
81312
81312
|
value: stream._readableState.endEmitted,
|
81313
81313
|
writable: true
|
81314
|
-
}),
|
81314
|
+
}), _defineProperty20(_Object$create, kHandlePromise, {
|
81315
81315
|
value: function value(resolve, reject) {
|
81316
81316
|
var data = iterator[kStream].read();
|
81317
81317
|
if (data) {
|
@@ -81373,7 +81373,7 @@ var require_from2 = __commonJS({
|
|
81373
81373
|
Promise.resolve(value).then(_next, _throw);
|
81374
81374
|
}
|
81375
81375
|
}
|
81376
|
-
function
|
81376
|
+
function _asyncToGenerator29(fn) {
|
81377
81377
|
return function() {
|
81378
81378
|
var self3 = this, args = arguments;
|
81379
81379
|
return new Promise(function(resolve, reject) {
|
@@ -81400,12 +81400,12 @@ var require_from2 = __commonJS({
|
|
81400
81400
|
}
|
81401
81401
|
return keys;
|
81402
81402
|
}
|
81403
|
-
function
|
81403
|
+
function _objectSpread9(target) {
|
81404
81404
|
for (var i = 1; i < arguments.length; i++) {
|
81405
81405
|
var source = arguments[i] != null ? arguments[i] : {};
|
81406
81406
|
if (i % 2) {
|
81407
81407
|
ownKeys9(Object(source), true).forEach(function(key) {
|
81408
|
-
|
81408
|
+
_defineProperty20(target, key, source[key]);
|
81409
81409
|
});
|
81410
81410
|
} else if (Object.getOwnPropertyDescriptors) {
|
81411
81411
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
@@ -81417,7 +81417,7 @@ var require_from2 = __commonJS({
|
|
81417
81417
|
}
|
81418
81418
|
return target;
|
81419
81419
|
}
|
81420
|
-
function
|
81420
|
+
function _defineProperty20(obj, key, value) {
|
81421
81421
|
if (key in obj) {
|
81422
81422
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
81423
81423
|
} else {
|
@@ -81436,7 +81436,7 @@ var require_from2 = __commonJS({
|
|
81436
81436
|
iterator = iterable[Symbol.iterator]();
|
81437
81437
|
else
|
81438
81438
|
throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable);
|
81439
|
-
var readable = new Readable(
|
81439
|
+
var readable = new Readable(_objectSpread9({
|
81440
81440
|
objectMode: true
|
81441
81441
|
}, opts));
|
81442
81442
|
var reading = false;
|
@@ -81450,7 +81450,7 @@ var require_from2 = __commonJS({
|
|
81450
81450
|
return _next2.apply(this, arguments);
|
81451
81451
|
}
|
81452
81452
|
function _next2() {
|
81453
|
-
_next2 =
|
81453
|
+
_next2 = _asyncToGenerator29(function* () {
|
81454
81454
|
try {
|
81455
81455
|
var _ref = yield iterator.next(), value = _ref.value, done = _ref.done;
|
81456
81456
|
if (done) {
|
@@ -102932,7 +102932,7 @@ var require_ora3 = __commonJS({
|
|
102932
102932
|
}, 87: (e2, t2, r2) => {
|
102933
102933
|
"use strict";
|
102934
102934
|
var i;
|
102935
|
-
function
|
102935
|
+
function _defineProperty20(e3, t3, r3) {
|
102936
102936
|
if (t3 in e3) {
|
102937
102937
|
Object.defineProperty(e3, t3, { value: r3, enumerable: true, configurable: true, writable: true });
|
102938
102938
|
} else {
|
@@ -103014,9 +103014,9 @@ var require_ora3 = __commonJS({
|
|
103014
103014
|
}
|
103015
103015
|
this[l] = i2;
|
103016
103016
|
return i2;
|
103017
|
-
} },
|
103017
|
+
} }, _defineProperty20(i, Symbol.asyncIterator, function() {
|
103018
103018
|
return this;
|
103019
|
-
}),
|
103019
|
+
}), _defineProperty20(i, "return", function _return() {
|
103020
103020
|
var e3 = this;
|
103021
103021
|
return new Promise(function(t3, r3) {
|
103022
103022
|
e3[h].destroy(null, function(e4) {
|
@@ -103030,7 +103030,7 @@ var require_ora3 = __commonJS({
|
|
103030
103030
|
}), i), d);
|
103031
103031
|
var _ = function createReadableStreamAsyncIterator(e3) {
|
103032
103032
|
var t3;
|
103033
|
-
var r3 = Object.create(p, (t3 = {},
|
103033
|
+
var r3 = Object.create(p, (t3 = {}, _defineProperty20(t3, h, { value: e3, writable: true }), _defineProperty20(t3, s, { value: null, writable: true }), _defineProperty20(t3, a, { value: null, writable: true }), _defineProperty20(t3, o, { value: null, writable: true }), _defineProperty20(t3, f, { value: e3._readableState.endEmitted, writable: true }), _defineProperty20(t3, u, { value: function value(e4, t4) {
|
103034
103034
|
var i2 = r3[h].read();
|
103035
103035
|
if (i2) {
|
103036
103036
|
r3[l] = null;
|
@@ -103082,12 +103082,12 @@ var require_ora3 = __commonJS({
|
|
103082
103082
|
}
|
103083
103083
|
return r3;
|
103084
103084
|
}
|
103085
|
-
function
|
103085
|
+
function _objectSpread9(e3) {
|
103086
103086
|
for (var t3 = 1; t3 < arguments.length; t3++) {
|
103087
103087
|
var r3 = arguments[t3] != null ? arguments[t3] : {};
|
103088
103088
|
if (t3 % 2) {
|
103089
103089
|
ownKeys9(Object(r3), true).forEach(function(t4) {
|
103090
|
-
|
103090
|
+
_defineProperty20(e3, t4, r3[t4]);
|
103091
103091
|
});
|
103092
103092
|
} else if (Object.getOwnPropertyDescriptors) {
|
103093
103093
|
Object.defineProperties(e3, Object.getOwnPropertyDescriptors(r3));
|
@@ -103099,7 +103099,7 @@ var require_ora3 = __commonJS({
|
|
103099
103099
|
}
|
103100
103100
|
return e3;
|
103101
103101
|
}
|
103102
|
-
function
|
103102
|
+
function _defineProperty20(e3, t3, r3) {
|
103103
103103
|
if (t3 in e3) {
|
103104
103104
|
Object.defineProperty(e3, t3, { value: r3, enumerable: true, configurable: true, writable: true });
|
103105
103105
|
} else {
|
@@ -103107,12 +103107,12 @@ var require_ora3 = __commonJS({
|
|
103107
103107
|
}
|
103108
103108
|
return e3;
|
103109
103109
|
}
|
103110
|
-
function
|
103110
|
+
function _classCallCheck16(e3, t3) {
|
103111
103111
|
if (!(e3 instanceof t3)) {
|
103112
103112
|
throw new TypeError("Cannot call a class as a function");
|
103113
103113
|
}
|
103114
103114
|
}
|
103115
|
-
function
|
103115
|
+
function _defineProperties25(e3, t3) {
|
103116
103116
|
for (var r3 = 0; r3 < t3.length; r3++) {
|
103117
103117
|
var i2 = t3[r3];
|
103118
103118
|
i2.enumerable = i2.enumerable || false;
|
@@ -103122,11 +103122,11 @@ var require_ora3 = __commonJS({
|
|
103122
103122
|
Object.defineProperty(e3, i2.key, i2);
|
103123
103123
|
}
|
103124
103124
|
}
|
103125
|
-
function
|
103125
|
+
function _createClass16(e3, t3, r3) {
|
103126
103126
|
if (t3)
|
103127
|
-
|
103127
|
+
_defineProperties25(e3.prototype, t3);
|
103128
103128
|
if (r3)
|
103129
|
-
|
103129
|
+
_defineProperties25(e3, r3);
|
103130
103130
|
return e3;
|
103131
103131
|
}
|
103132
103132
|
var i = r2(300), n = i.Buffer;
|
@@ -103137,12 +103137,12 @@ var require_ora3 = __commonJS({
|
|
103137
103137
|
}
|
103138
103138
|
e2.exports = function() {
|
103139
103139
|
function BufferList() {
|
103140
|
-
|
103140
|
+
_classCallCheck16(this, BufferList);
|
103141
103141
|
this.head = null;
|
103142
103142
|
this.tail = null;
|
103143
103143
|
this.length = 0;
|
103144
103144
|
}
|
103145
|
-
|
103145
|
+
_createClass16(BufferList, [{ key: "push", value: function push(e3) {
|
103146
103146
|
var t3 = { data: e3, next: null };
|
103147
103147
|
if (this.length > 0)
|
103148
103148
|
this.tail.next = t3;
|
@@ -103262,7 +103262,7 @@ var require_ora3 = __commonJS({
|
|
103262
103262
|
this.length -= i2;
|
103263
103263
|
return t3;
|
103264
103264
|
} }, { key: o, value: function value(e3, t3) {
|
103265
|
-
return a(this,
|
103265
|
+
return a(this, _objectSpread9({}, t3, { depth: 0, customInspect: false }));
|
103266
103266
|
} }]);
|
103267
103267
|
return BufferList;
|
103268
103268
|
}();
|
@@ -103462,7 +103462,7 @@ var require_ora3 = __commonJS({
|
|
103462
103462
|
Promise.resolve(f).then(i2, n);
|
103463
103463
|
}
|
103464
103464
|
}
|
103465
|
-
function
|
103465
|
+
function _asyncToGenerator29(e3) {
|
103466
103466
|
return function() {
|
103467
103467
|
var t3 = this, r3 = arguments;
|
103468
103468
|
return new Promise(function(i2, n) {
|
@@ -103489,12 +103489,12 @@ var require_ora3 = __commonJS({
|
|
103489
103489
|
}
|
103490
103490
|
return r3;
|
103491
103491
|
}
|
103492
|
-
function
|
103492
|
+
function _objectSpread9(e3) {
|
103493
103493
|
for (var t3 = 1; t3 < arguments.length; t3++) {
|
103494
103494
|
var r3 = arguments[t3] != null ? arguments[t3] : {};
|
103495
103495
|
if (t3 % 2) {
|
103496
103496
|
ownKeys9(Object(r3), true).forEach(function(t4) {
|
103497
|
-
|
103497
|
+
_defineProperty20(e3, t4, r3[t4]);
|
103498
103498
|
});
|
103499
103499
|
} else if (Object.getOwnPropertyDescriptors) {
|
103500
103500
|
Object.defineProperties(e3, Object.getOwnPropertyDescriptors(r3));
|
@@ -103506,7 +103506,7 @@ var require_ora3 = __commonJS({
|
|
103506
103506
|
}
|
103507
103507
|
return e3;
|
103508
103508
|
}
|
103509
|
-
function
|
103509
|
+
function _defineProperty20(e3, t3, r3) {
|
103510
103510
|
if (t3 in e3) {
|
103511
103511
|
Object.defineProperty(e3, t3, { value: r3, enumerable: true, configurable: true, writable: true });
|
103512
103512
|
} else {
|
@@ -103525,7 +103525,7 @@ var require_ora3 = __commonJS({
|
|
103525
103525
|
n = t3[Symbol.iterator]();
|
103526
103526
|
else
|
103527
103527
|
throw new i("iterable", ["Iterable"], t3);
|
103528
|
-
var s = new e3(
|
103528
|
+
var s = new e3(_objectSpread9({ objectMode: true }, r3));
|
103529
103529
|
var a = false;
|
103530
103530
|
s._read = function() {
|
103531
103531
|
if (!a) {
|
@@ -103537,7 +103537,7 @@ var require_ora3 = __commonJS({
|
|
103537
103537
|
return _next2.apply(this, arguments);
|
103538
103538
|
}
|
103539
103539
|
function _next2() {
|
103540
|
-
_next2 =
|
103540
|
+
_next2 = _asyncToGenerator29(function* () {
|
103541
103541
|
try {
|
103542
103542
|
var e4 = yield n.next(), t4 = e4.value, r4 = e4.done;
|
103543
103543
|
if (r4) {
|
@@ -145173,26 +145173,29 @@ function getObjKeyMap2(obj, prefix = "") {
|
|
145173
145173
|
if ((0, import_lodash7.isString)(obj[key])) {
|
145174
145174
|
result[key] = prefix ? `${prefix}.${key}` : key;
|
145175
145175
|
} else if ((0, import_lodash7.isObject)(obj[key])) {
|
145176
|
-
result[key] = getObjKeyMap2(
|
145177
|
-
obj[key],
|
145178
|
-
prefix ? `${prefix}.${key}` : key
|
145179
|
-
);
|
145176
|
+
result[key] = getObjKeyMap2(obj[key], prefix ? `${prefix}.${key}` : key);
|
145180
145177
|
}
|
145181
145178
|
});
|
145182
145179
|
return result;
|
145183
145180
|
}
|
145184
145181
|
|
145185
145182
|
// ../../../cli/plugin-i18n/dist/esm-node/index.js
|
145186
|
-
|
145187
|
-
|
145188
|
-
|
145189
|
-
|
145183
|
+
function _define_property(obj, key, value) {
|
145184
|
+
if (key in obj) {
|
145185
|
+
Object.defineProperty(obj, key, {
|
145186
|
+
value,
|
145187
|
+
enumerable: true,
|
145188
|
+
configurable: true,
|
145189
|
+
writable: true
|
145190
|
+
});
|
145191
|
+
} else {
|
145192
|
+
obj[key] = value;
|
145190
145193
|
}
|
145194
|
+
return obj;
|
145195
|
+
}
|
145196
|
+
var I18n2 = class {
|
145191
145197
|
format(msg, vars) {
|
145192
|
-
return msg.replace(
|
145193
|
-
/\{(\w+)\}/g,
|
145194
|
-
(_match, capture) => Object.prototype.hasOwnProperty.call(vars, capture) ? vars[capture] : capture
|
145195
|
-
);
|
145198
|
+
return msg.replace(/\{(\w+)\}/g, (_match, capture) => Object.prototype.hasOwnProperty.call(vars, capture) ? vars[capture] : capture);
|
145196
145199
|
}
|
145197
145200
|
getMessage(lang, key, vars, fallbackText) {
|
145198
145201
|
const languages = Object.keys(this.languageMap);
|
@@ -145229,6 +145232,10 @@ var I18n2 = class {
|
|
145229
145232
|
t: (key, vars, fallbackText) => this.getMessage(lang, key, vars, fallbackText)
|
145230
145233
|
};
|
145231
145234
|
}
|
145235
|
+
constructor() {
|
145236
|
+
_define_property(this, "language", "en");
|
145237
|
+
_define_property(this, "languageMap", {});
|
145238
|
+
}
|
145232
145239
|
};
|
145233
145240
|
|
145234
145241
|
// ../../generator-common/dist/esm-node/locale/zh.js
|
@@ -145428,90 +145435,61 @@ var EN_LOCALE2 = {
|
|
145428
145435
|
|
145429
145436
|
// ../../generator-common/dist/esm-node/locale/index.js
|
145430
145437
|
var i18n2 = new I18n2();
|
145431
|
-
var localeKeys2 = i18n2.init("en", {
|
145438
|
+
var localeKeys2 = i18n2.init("en", {
|
145439
|
+
zh: ZH_LOCALE2,
|
145440
|
+
en: EN_LOCALE2
|
145441
|
+
});
|
145432
145442
|
|
145433
145443
|
// ../../generator-common/dist/esm-node/common/boolean.js
|
145434
|
-
var BooleanConfig
|
145444
|
+
var BooleanConfig;
|
145445
|
+
(function(BooleanConfig2) {
|
145435
145446
|
BooleanConfig2["NO"] = "no";
|
145436
145447
|
BooleanConfig2["YES"] = "yes";
|
145437
|
-
|
145438
|
-
|
145448
|
+
})(BooleanConfig || (BooleanConfig = {}));
|
145449
|
+
var BooleanConfigName = {
|
145450
|
+
[BooleanConfig.NO]: () => i18n2.t(localeKeys2.boolean.no),
|
145451
|
+
[BooleanConfig.YES]: () => i18n2.t(localeKeys2.boolean.yes)
|
145452
|
+
};
|
145439
145453
|
|
145440
145454
|
// ../../generator-common/dist/esm-node/common/solution.js
|
145441
|
-
var Solution
|
145455
|
+
var Solution;
|
145456
|
+
(function(Solution22) {
|
145442
145457
|
Solution22["MWA"] = "mwa";
|
145443
145458
|
Solution22["Module"] = "module";
|
145444
145459
|
Solution22["Doc"] = "doc";
|
145445
145460
|
Solution22["Monorepo"] = "monorepo";
|
145446
|
-
|
145447
|
-
|
145448
|
-
|
145461
|
+
})(Solution || (Solution = {}));
|
145462
|
+
var SubSolution;
|
145463
|
+
(function(SubSolution22) {
|
145449
145464
|
SubSolution22["MWA"] = "mwa";
|
145450
145465
|
SubSolution22["MWATest"] = "mwa_test";
|
145451
145466
|
SubSolution22["Module"] = "module";
|
145452
145467
|
SubSolution22["InnerModule"] = "inner_module";
|
145453
|
-
|
145454
|
-
})(SubSolution || {});
|
145468
|
+
})(SubSolution || (SubSolution = {}));
|
145455
145469
|
var SolutionText = {
|
145456
|
-
[
|
145457
|
-
|
145458
|
-
|
145459
|
-
]: () => i18n2.t(localeKeys2.solution.
|
145460
|
-
[
|
145461
|
-
"module"
|
145462
|
-
/* Module */
|
145463
|
-
]: () => i18n2.t(localeKeys2.solution.module),
|
145464
|
-
[
|
145465
|
-
"doc"
|
145466
|
-
/* Doc */
|
145467
|
-
]: () => i18n2.t(localeKeys2.solution.doc),
|
145468
|
-
[
|
145469
|
-
"monorepo"
|
145470
|
-
/* Monorepo */
|
145471
|
-
]: () => i18n2.t(localeKeys2.solution.monorepo)
|
145470
|
+
[Solution.MWA]: () => i18n2.t(localeKeys2.solution.mwa),
|
145471
|
+
[Solution.Module]: () => i18n2.t(localeKeys2.solution.module),
|
145472
|
+
[Solution.Doc]: () => i18n2.t(localeKeys2.solution.doc),
|
145473
|
+
[Solution.Monorepo]: () => i18n2.t(localeKeys2.solution.monorepo)
|
145472
145474
|
};
|
145473
145475
|
var SubSolutionText = {
|
145474
|
-
[
|
145475
|
-
|
145476
|
-
|
145477
|
-
]: () => i18n2.t(localeKeys2.sub_solution.
|
145478
|
-
[
|
145479
|
-
"mwa_test"
|
145480
|
-
/* MWATest */
|
145481
|
-
]: () => i18n2.t(localeKeys2.sub_solution.mwa_test),
|
145482
|
-
[
|
145483
|
-
"module"
|
145484
|
-
/* Module */
|
145485
|
-
]: () => i18n2.t(localeKeys2.sub_solution.module),
|
145486
|
-
[
|
145487
|
-
"inner_module"
|
145488
|
-
/* InnerModule */
|
145489
|
-
]: () => i18n2.t(localeKeys2.sub_solution.inner_module)
|
145476
|
+
[SubSolution.MWA]: () => i18n2.t(localeKeys2.sub_solution.mwa),
|
145477
|
+
[SubSolution.MWATest]: () => i18n2.t(localeKeys2.sub_solution.mwa_test),
|
145478
|
+
[SubSolution.Module]: () => i18n2.t(localeKeys2.sub_solution.module),
|
145479
|
+
[SubSolution.InnerModule]: () => i18n2.t(localeKeys2.sub_solution.inner_module)
|
145490
145480
|
};
|
145491
145481
|
var SolutionToolsMap = {
|
145492
|
-
[
|
145493
|
-
|
145494
|
-
|
145495
|
-
]: "@modern-js/
|
145496
|
-
[
|
145497
|
-
"module"
|
145498
|
-
/* Module */
|
145499
|
-
]: "@modern-js/module-tools",
|
145500
|
-
[
|
145501
|
-
"doc"
|
145502
|
-
/* Doc */
|
145503
|
-
]: "@modern-js/doc-tools",
|
145504
|
-
[
|
145505
|
-
"monorepo"
|
145506
|
-
/* Monorepo */
|
145507
|
-
]: "@modern-js/monorepo-tools"
|
145482
|
+
[Solution.MWA]: "@modern-js/app-tools",
|
145483
|
+
[Solution.Module]: "@modern-js/module-tools",
|
145484
|
+
[Solution.Doc]: "@modern-js/doc-tools",
|
145485
|
+
[Solution.Monorepo]: "@modern-js/monorepo-tools"
|
145508
145486
|
};
|
145509
145487
|
function getSolutionNameFromSubSolution(solution) {
|
145510
|
-
if (solution ===
|
145511
|
-
return
|
145488
|
+
if (solution === SubSolution.MWATest) {
|
145489
|
+
return Solution.MWA;
|
145512
145490
|
}
|
145513
|
-
if (solution ===
|
145514
|
-
return
|
145491
|
+
if (solution === SubSolution.InnerModule) {
|
145492
|
+
return Solution.Module;
|
145515
145493
|
}
|
145516
145494
|
return solution;
|
145517
145495
|
}
|
@@ -145523,14 +145501,16 @@ var getSolutionSchema = (extra = {}) => {
|
|
145523
145501
|
type: "string",
|
145524
145502
|
title: extra.isMonorepo ? i18n2.t(localeKeys2.sub_solution.self) : i18n2.t(localeKeys2.solution.self),
|
145525
145503
|
enum: (() => {
|
145526
|
-
var
|
145527
|
-
const items = ((extra
|
145528
|
-
|
145529
|
-
).map((solution) =>
|
145530
|
-
|
145531
|
-
|
145532
|
-
|
145533
|
-
|
145504
|
+
var _extra_customPlugin, _extra_customPlugin_custom;
|
145505
|
+
const items = ((extra === null || extra === void 0 ? void 0 : extra.solutions) || Object.values((extra === null || extra === void 0 ? void 0 : extra.isMonorepo) ? SubSolution : Solution)).filter((solution) => {
|
145506
|
+
return !((extra === null || extra === void 0 ? void 0 : extra.isSubProject) && solution === Solution.Monorepo);
|
145507
|
+
}).map((solution) => {
|
145508
|
+
return {
|
145509
|
+
value: solution,
|
145510
|
+
label: (extra === null || extra === void 0 ? void 0 : extra.isMonorepo) ? SubSolutionText[solution]() : SolutionText[solution]()
|
145511
|
+
};
|
145512
|
+
});
|
145513
|
+
if (extra === null || extra === void 0 ? void 0 : (_extra_customPlugin = extra.customPlugin) === null || _extra_customPlugin === void 0 ? void 0 : (_extra_customPlugin_custom = _extra_customPlugin.custom) === null || _extra_customPlugin_custom === void 0 ? void 0 : _extra_customPlugin_custom.length) {
|
145534
145514
|
return [
|
145535
145515
|
...items,
|
145536
145516
|
{
|
@@ -145546,7 +145526,7 @@ var getSolutionSchema = (extra = {}) => {
|
|
145546
145526
|
};
|
145547
145527
|
};
|
145548
145528
|
var getScenesSchema = (extra = {}) => {
|
145549
|
-
const hasPlugin = (extra
|
145529
|
+
const hasPlugin = (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution] && extra.customPlugin[(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution].length > 0;
|
145550
145530
|
return {
|
145551
145531
|
type: "object",
|
145552
145532
|
properties: hasPlugin ? {
|
@@ -145554,15 +145534,15 @@ var getScenesSchema = (extra = {}) => {
|
|
145554
145534
|
type: "string",
|
145555
145535
|
title: i18n2.t(localeKeys2.scenes.self),
|
145556
145536
|
enum: (() => {
|
145557
|
-
const solution = (extra
|
145558
|
-
const items = ((extra
|
145537
|
+
const solution = (extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution;
|
145538
|
+
const items = ((extra === null || extra === void 0 ? void 0 : extra.customPlugin) ? (extra === null || extra === void 0 ? void 0 : extra.customPlugin[solution]) || [] : []).map((plugin) => ({
|
145559
145539
|
value: plugin.key,
|
145560
145540
|
label: plugin.name
|
145561
145541
|
}));
|
145562
145542
|
if (solution && solution !== "custom") {
|
145563
145543
|
items.unshift({
|
145564
145544
|
value: solution,
|
145565
|
-
label: `${(extra
|
145545
|
+
label: `${(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? SubSolutionText[solution]() : SolutionText[solution]()}(${i18n2.t(localeKeys2.solution.default)})`
|
145566
145546
|
});
|
145567
145547
|
}
|
145568
145548
|
return items;
|
@@ -145573,57 +145553,27 @@ var getScenesSchema = (extra = {}) => {
|
|
145573
145553
|
};
|
145574
145554
|
var BaseGenerator = "@modern-js/base-generator";
|
145575
145555
|
var SolutionGenerator = {
|
145576
|
-
[
|
145577
|
-
|
145578
|
-
|
145579
|
-
]: "@modern-js/
|
145580
|
-
[
|
145581
|
-
"module"
|
145582
|
-
/* Module */
|
145583
|
-
]: "@modern-js/module-generator",
|
145584
|
-
[
|
145585
|
-
"doc"
|
145586
|
-
/* Doc */
|
145587
|
-
]: "@modern-js/doc-generator",
|
145588
|
-
[
|
145589
|
-
"monorepo"
|
145590
|
-
/* Monorepo */
|
145591
|
-
]: "@modern-js/monorepo-generator"
|
145556
|
+
[Solution.MWA]: "@modern-js/mwa-generator",
|
145557
|
+
[Solution.Module]: "@modern-js/module-generator",
|
145558
|
+
[Solution.Doc]: "@modern-js/doc-generator",
|
145559
|
+
[Solution.Monorepo]: "@modern-js/monorepo-generator"
|
145592
145560
|
};
|
145593
145561
|
var SubSolutionGenerator = {
|
145594
|
-
[
|
145595
|
-
|
145596
|
-
|
145597
|
-
]: "@modern-js/
|
145598
|
-
[
|
145599
|
-
"mwa_test"
|
145600
|
-
/* MWATest */
|
145601
|
-
]: "@modern-js/mwa-generator",
|
145602
|
-
[
|
145603
|
-
"module"
|
145604
|
-
/* Module */
|
145605
|
-
]: "@modern-js/module-generator",
|
145606
|
-
[
|
145607
|
-
"inner_module"
|
145608
|
-
/* InnerModule */
|
145609
|
-
]: "@modern-js/module-generator"
|
145562
|
+
[SubSolution.MWA]: "@modern-js/mwa-generator",
|
145563
|
+
[SubSolution.MWATest]: "@modern-js/mwa-generator",
|
145564
|
+
[SubSolution.Module]: "@modern-js/module-generator",
|
145565
|
+
[SubSolution.InnerModule]: "@modern-js/module-generator"
|
145610
145566
|
};
|
145611
145567
|
|
145612
145568
|
// ../../generator-common/dist/esm-node/common/language.js
|
145613
|
-
var Language
|
145569
|
+
var Language;
|
145570
|
+
(function(Language2) {
|
145614
145571
|
Language2["TS"] = "ts";
|
145615
145572
|
Language2["JS"] = "js";
|
145616
|
-
|
145617
|
-
})(Language || {});
|
145573
|
+
})(Language || (Language = {}));
|
145618
145574
|
var LanguageName = {
|
145619
|
-
[
|
145620
|
-
|
145621
|
-
/* TS */
|
145622
|
-
]: "TS",
|
145623
|
-
[
|
145624
|
-
"js"
|
145625
|
-
/* JS */
|
145626
|
-
]: "ES6+"
|
145575
|
+
[Language.TS]: "TS",
|
145576
|
+
[Language.JS]: "ES6+"
|
145627
145577
|
};
|
145628
145578
|
var getLanguageSchema = (_extra = {}) => {
|
145629
145579
|
return {
|
@@ -145637,33 +145587,24 @@ var getLanguageSchema = (_extra = {}) => {
|
|
145637
145587
|
};
|
145638
145588
|
|
145639
145589
|
// ../../generator-common/dist/esm-node/common/packageManager.js
|
145640
|
-
var PackageManager
|
145590
|
+
var PackageManager;
|
145591
|
+
(function(PackageManager2) {
|
145641
145592
|
PackageManager2["Pnpm"] = "pnpm";
|
145642
145593
|
PackageManager2["Yarn"] = "yarn";
|
145643
145594
|
PackageManager2["Npm"] = "npm";
|
145644
|
-
|
145645
|
-
})(PackageManager || {});
|
145595
|
+
})(PackageManager || (PackageManager = {}));
|
145646
145596
|
var PackageManagerName = {
|
145647
|
-
[
|
145648
|
-
|
145649
|
-
|
145650
|
-
]: "pnpm",
|
145651
|
-
[
|
145652
|
-
"yarn"
|
145653
|
-
/* Yarn */
|
145654
|
-
]: "Yarn",
|
145655
|
-
[
|
145656
|
-
"npm"
|
145657
|
-
/* Npm */
|
145658
|
-
]: "npm"
|
145597
|
+
[PackageManager.Pnpm]: "pnpm",
|
145598
|
+
[PackageManager.Yarn]: "Yarn",
|
145599
|
+
[PackageManager.Npm]: "npm"
|
145659
145600
|
};
|
145660
145601
|
var getPackageManagerSchema = (extra = {}) => {
|
145661
145602
|
return {
|
145662
145603
|
type: "string",
|
145663
145604
|
title: i18n2.t(localeKeys2.packageManager.self),
|
145664
|
-
enum: Object.values(PackageManager).filter(
|
145665
|
-
|
145666
|
-
).map((packageManager) => ({
|
145605
|
+
enum: Object.values(PackageManager).filter((packageManager) => {
|
145606
|
+
return (extra === null || extra === void 0 ? void 0 : extra.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
|
145607
|
+
}).map((packageManager) => ({
|
145667
145608
|
value: packageManager,
|
145668
145609
|
label: PackageManagerName[packageManager]
|
145669
145610
|
})),
|
@@ -145672,7 +145613,7 @@ var getPackageManagerSchema = (extra = {}) => {
|
|
145672
145613
|
dependencies: [],
|
145673
145614
|
fulfill: {
|
145674
145615
|
state: {
|
145675
|
-
visible: !(extra
|
145616
|
+
visible: !(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) && !(extra === null || extra === void 0 ? void 0 : extra.isSubProject)
|
145676
145617
|
}
|
145677
145618
|
}
|
145678
145619
|
}
|
@@ -145684,13 +145625,13 @@ var getPackageManagerSchema = (extra = {}) => {
|
|
145684
145625
|
var getPackageNameSchema = (extra = {}) => {
|
145685
145626
|
return {
|
145686
145627
|
type: "string",
|
145687
|
-
title: (extra
|
145628
|
+
title: (extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? i18n2.t(localeKeys2.packageName.sub_name) : i18n2.t(localeKeys2.packageName.self),
|
145688
145629
|
"x-reactions": [
|
145689
145630
|
{
|
145690
145631
|
dependencies: [],
|
145691
145632
|
fulfill: {
|
145692
145633
|
state: {
|
145693
|
-
visible: Boolean(extra
|
145634
|
+
visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) || !(extra === null || extra === void 0 ? void 0 : extra.isMwa) && !(extra === null || extra === void 0 ? void 0 : extra.isDoc)
|
145694
145635
|
}
|
145695
145636
|
}
|
145696
145637
|
}
|
@@ -145705,20 +145646,20 @@ var getPackageNameSchema = (extra = {}) => {
|
|
145705
145646
|
};
|
145706
145647
|
|
145707
145648
|
// ../../generator-common/dist/esm-node/common/packagePath.js
|
145708
|
-
var PackagePathRegex = new RegExp(
|
145709
|
-
"^[a-z0-9]*[-_/]?([a-z0-9]*[-_]?[a-z0-9]*)*[-_/]?[a-z0-9-_]+$"
|
145710
|
-
);
|
145649
|
+
var PackagePathRegex = new RegExp("^[a-z0-9-_]+[a-z0-9-/_]*$");
|
145711
145650
|
var getPackagePathSchema = (extra) => {
|
145712
145651
|
return {
|
145713
145652
|
type: "string",
|
145714
145653
|
title: i18n2.t(localeKeys2.packagePath.self),
|
145715
145654
|
"x-reactions": [
|
145716
145655
|
{
|
145717
|
-
dependencies: [
|
145656
|
+
dependencies: [
|
145657
|
+
"packageName"
|
145658
|
+
],
|
145718
145659
|
fulfill: {
|
145719
145660
|
state: {
|
145720
145661
|
value: "{{$deps[0]}}",
|
145721
|
-
visible: Boolean(extra
|
145662
|
+
visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject)
|
145722
145663
|
}
|
145723
145664
|
}
|
145724
145665
|
}
|
@@ -145800,16 +145741,16 @@ var MonorepoDefaultConfig = {
|
|
145800
145741
|
};
|
145801
145742
|
|
145802
145743
|
// ../../generator-common/dist/esm-node/mwa/common.js
|
145803
|
-
var Framework
|
145744
|
+
var Framework;
|
145745
|
+
(function(Framework2) {
|
145804
145746
|
Framework2["Express"] = "express";
|
145805
145747
|
Framework2["Koa"] = "koa";
|
145806
|
-
|
145807
|
-
|
145808
|
-
|
145748
|
+
})(Framework || (Framework = {}));
|
145749
|
+
var BuildTools;
|
145750
|
+
(function(BuildTools2) {
|
145809
145751
|
BuildTools2["Webpack"] = "webpack";
|
145810
145752
|
BuildTools2["Rspack"] = "rspack";
|
145811
|
-
|
145812
|
-
})(BuildTools || {});
|
145753
|
+
})(BuildTools || (BuildTools = {}));
|
145813
145754
|
var getBuildToolsSchema = (_extra = {}) => {
|
145814
145755
|
return {
|
145815
145756
|
type: "string",
|
@@ -145820,6 +145761,10 @@ var getBuildToolsSchema = (_extra = {}) => {
|
|
145820
145761
|
}))
|
145821
145762
|
};
|
145822
145763
|
};
|
145764
|
+
var FrameworkAppendTypeContent = {
|
145765
|
+
[Framework.Express]: `/// <reference types='@modern-js/plugin-express/types' />`,
|
145766
|
+
[Framework.Koa]: `/// <reference types='@modern-js/plugin-koa/types' />`
|
145767
|
+
};
|
145823
145768
|
|
145824
145769
|
// ../../generator-common/dist/esm-node/mwa/project.js
|
145825
145770
|
var getMWASchemaProperties = (extra) => {
|
@@ -145845,18 +145790,19 @@ var MWADefaultConfig = {
|
|
145845
145790
|
};
|
145846
145791
|
|
145847
145792
|
// ../../generator-common/dist/esm-node/newAction/common/index.js
|
145848
|
-
var ActionType
|
145793
|
+
var ActionType;
|
145794
|
+
(function(ActionType2) {
|
145849
145795
|
ActionType2["Function"] = "function";
|
145850
145796
|
ActionType2["Element"] = "element";
|
145851
145797
|
ActionType2["Refactor"] = "refactor";
|
145852
|
-
|
145853
|
-
|
145854
|
-
|
145798
|
+
})(ActionType || (ActionType = {}));
|
145799
|
+
var ActionElement;
|
145800
|
+
(function(ActionElement2) {
|
145855
145801
|
ActionElement2["Entry"] = "entry";
|
145856
145802
|
ActionElement2["Server"] = "server";
|
145857
|
-
|
145858
|
-
|
145859
|
-
|
145803
|
+
})(ActionElement || (ActionElement = {}));
|
145804
|
+
var ActionFunction;
|
145805
|
+
(function(ActionFunction2) {
|
145860
145806
|
ActionFunction2["TailwindCSS"] = "tailwindcss";
|
145861
145807
|
ActionFunction2["BFF"] = "bff";
|
145862
145808
|
ActionFunction2["MicroFrontend"] = "micro_frontend";
|
@@ -145871,99 +145817,43 @@ var ActionFunction = /* @__PURE__ */ ((ActionFunction2) => {
|
|
145871
145817
|
ActionFunction2["Proxy"] = "proxy";
|
145872
145818
|
ActionFunction2["SWC"] = "swc";
|
145873
145819
|
ActionFunction2["Rspack"] = "rspack";
|
145874
|
-
|
145875
|
-
|
145876
|
-
|
145820
|
+
})(ActionFunction || (ActionFunction = {}));
|
145821
|
+
var ActionRefactor;
|
145822
|
+
(function(ActionRefactor2) {
|
145877
145823
|
ActionRefactor2["ReactRouter5"] = "react_router_5";
|
145878
|
-
|
145879
|
-
})(ActionRefactor || {});
|
145824
|
+
})(ActionRefactor || (ActionRefactor = {}));
|
145880
145825
|
var ActionTypeText = {
|
145881
|
-
[
|
145882
|
-
|
145883
|
-
|
145884
|
-
]: () => i18n2.t(localeKeys2.action.function.self),
|
145885
|
-
[
|
145886
|
-
"element"
|
145887
|
-
/* Element */
|
145888
|
-
]: () => i18n2.t(localeKeys2.action.element.self),
|
145889
|
-
[
|
145890
|
-
"refactor"
|
145891
|
-
/* Refactor */
|
145892
|
-
]: () => i18n2.t(localeKeys2.action.refactor.self)
|
145826
|
+
[ActionType.Function]: () => i18n2.t(localeKeys2.action.function.self),
|
145827
|
+
[ActionType.Element]: () => i18n2.t(localeKeys2.action.element.self),
|
145828
|
+
[ActionType.Refactor]: () => i18n2.t(localeKeys2.action.refactor.self)
|
145893
145829
|
};
|
145894
145830
|
var ActionElementText = {
|
145895
|
-
[
|
145896
|
-
|
145897
|
-
/* Entry */
|
145898
|
-
]: () => i18n2.t(localeKeys2.action.element.entry),
|
145899
|
-
[
|
145900
|
-
"server"
|
145901
|
-
/* Server */
|
145902
|
-
]: () => i18n2.t(localeKeys2.action.element.server)
|
145831
|
+
[ActionElement.Entry]: () => i18n2.t(localeKeys2.action.element.entry),
|
145832
|
+
[ActionElement.Server]: () => i18n2.t(localeKeys2.action.element.server)
|
145903
145833
|
};
|
145904
145834
|
var ActionFunctionText = {
|
145905
|
-
[
|
145906
|
-
|
145907
|
-
|
145908
|
-
]: () => i18n2.t(localeKeys2.action.function.
|
145909
|
-
[
|
145910
|
-
|
145911
|
-
|
145912
|
-
]: () => i18n2.t(localeKeys2.action.function.
|
145913
|
-
[
|
145914
|
-
|
145915
|
-
|
145916
|
-
]: () => i18n2.t(localeKeys2.action.function.
|
145917
|
-
[
|
145918
|
-
|
145919
|
-
/* I18n */
|
145920
|
-
]: () => i18n2.t(localeKeys2.action.function.i18n),
|
145921
|
-
[
|
145922
|
-
"test"
|
145923
|
-
/* Test */
|
145924
|
-
]: () => i18n2.t(localeKeys2.action.function.test),
|
145925
|
-
[
|
145926
|
-
"e2e_test"
|
145927
|
-
/* E2ETest */
|
145928
|
-
]: () => i18n2.t(localeKeys2.action.function.e2e_test),
|
145929
|
-
[
|
145930
|
-
"doc"
|
145931
|
-
/* Doc */
|
145932
|
-
]: () => i18n2.t(localeKeys2.action.function.doc),
|
145933
|
-
[
|
145934
|
-
"storybook"
|
145935
|
-
/* Storybook */
|
145936
|
-
]: () => i18n2.t(localeKeys2.action.function.storybook),
|
145937
|
-
[
|
145938
|
-
"runtimeApi"
|
145939
|
-
/* RuntimeApi */
|
145940
|
-
]: () => i18n2.t(localeKeys2.action.function.runtime_api),
|
145941
|
-
[
|
145942
|
-
"ssg"
|
145943
|
-
/* SSG */
|
145944
|
-
]: () => i18n2.t(localeKeys2.action.function.ssg),
|
145945
|
-
[
|
145946
|
-
"polyfill"
|
145947
|
-
/* Polyfill */
|
145948
|
-
]: () => i18n2.t(localeKeys2.action.function.polyfill),
|
145949
|
-
[
|
145950
|
-
"proxy"
|
145951
|
-
/* Proxy */
|
145952
|
-
]: () => i18n2.t(localeKeys2.action.function.proxy),
|
145953
|
-
[
|
145954
|
-
"swc"
|
145955
|
-
/* SWC */
|
145956
|
-
]: () => i18n2.t(localeKeys2.action.function.swc),
|
145957
|
-
[
|
145958
|
-
"rspack"
|
145959
|
-
/* Rspack */
|
145960
|
-
]: () => i18n2.t(localeKeys2.action.function.rspack)
|
145835
|
+
[ActionFunction.TailwindCSS]: () => i18n2.t(localeKeys2.action.function.tailwindcss),
|
145836
|
+
[ActionFunction.BFF]: () => i18n2.t(localeKeys2.action.function.bff),
|
145837
|
+
[ActionFunction.MicroFrontend]: () => i18n2.t(localeKeys2.action.function.micro_frontend),
|
145838
|
+
[ActionFunction.I18n]: () => i18n2.t(localeKeys2.action.function.i18n),
|
145839
|
+
[ActionFunction.Test]: () => i18n2.t(localeKeys2.action.function.test),
|
145840
|
+
[ActionFunction.E2ETest]: () => i18n2.t(localeKeys2.action.function.e2e_test),
|
145841
|
+
[ActionFunction.Doc]: () => i18n2.t(localeKeys2.action.function.doc),
|
145842
|
+
[ActionFunction.Storybook]: () => i18n2.t(localeKeys2.action.function.storybook),
|
145843
|
+
[ActionFunction.RuntimeApi]: () => i18n2.t(localeKeys2.action.function.runtime_api),
|
145844
|
+
[ActionFunction.SSG]: () => i18n2.t(localeKeys2.action.function.ssg),
|
145845
|
+
[ActionFunction.Polyfill]: () => i18n2.t(localeKeys2.action.function.polyfill),
|
145846
|
+
[ActionFunction.Proxy]: () => i18n2.t(localeKeys2.action.function.proxy),
|
145847
|
+
[ActionFunction.SWC]: () => i18n2.t(localeKeys2.action.function.swc),
|
145848
|
+
[ActionFunction.Rspack]: () => i18n2.t(localeKeys2.action.function.rspack)
|
145961
145849
|
};
|
145962
145850
|
var ActionRefactorText = {
|
145963
|
-
[
|
145964
|
-
|
145965
|
-
|
145966
|
-
]:
|
145851
|
+
[ActionRefactor.ReactRouter5]: () => i18n2.t(localeKeys2.action.refactor.react_router_5)
|
145852
|
+
};
|
145853
|
+
var ActionTypeTextMap = {
|
145854
|
+
[ActionType.Element]: ActionElementText,
|
145855
|
+
[ActionType.Function]: ActionFunctionText,
|
145856
|
+
[ActionType.Refactor]: ActionRefactorText
|
145967
145857
|
};
|
145968
145858
|
|
145969
145859
|
// ../../generator-common/dist/esm-node/newAction/mwa/index.js
|
@@ -145984,8 +145874,13 @@ var MWAActionFunctions = [
|
|
145984
145874
|
ActionFunction.Proxy,
|
145985
145875
|
ActionFunction.Storybook
|
145986
145876
|
];
|
145987
|
-
var MWAActionElements = [
|
145988
|
-
|
145877
|
+
var MWAActionElements = [
|
145878
|
+
ActionElement.Entry,
|
145879
|
+
ActionElement.Server
|
145880
|
+
];
|
145881
|
+
var MWAActionReactors = [
|
145882
|
+
ActionRefactor.ReactRouter5
|
145883
|
+
];
|
145989
145884
|
var MWAActionTypesMap = {
|
145990
145885
|
[ActionType.Element]: MWAActionElements,
|
145991
145886
|
[ActionType.Function]: MWAActionFunctions,
|
@@ -146001,14 +145896,12 @@ var getMWANewActionSchema = (extra = {}) => {
|
|
146001
145896
|
actionType: {
|
146002
145897
|
type: "string",
|
146003
145898
|
title: i18n2.t(localeKeys2.action.self),
|
146004
|
-
enum: MWAActionTypes.filter(
|
146005
|
-
(type) => type === ActionType.Function ? funcs.length > 0 : true
|
146006
|
-
).filter(
|
146007
|
-
(type) => type === ActionType.Refactor ? refactors.length > 0 : true
|
146008
|
-
).map((type) => ({
|
145899
|
+
enum: MWAActionTypes.filter((type) => type === ActionType.Function ? funcs.length > 0 : true).filter((type) => type === ActionType.Refactor ? refactors.length > 0 : true).map((type) => ({
|
146009
145900
|
value: type,
|
146010
145901
|
label: ActionTypeText[type](),
|
146011
|
-
type: [
|
145902
|
+
type: [
|
145903
|
+
"string"
|
145904
|
+
]
|
146012
145905
|
}))
|
146013
145906
|
},
|
146014
145907
|
[ActionType.Element]: {
|
@@ -146020,7 +145913,9 @@ var getMWANewActionSchema = (extra = {}) => {
|
|
146020
145913
|
})),
|
146021
145914
|
"x-reactions": [
|
146022
145915
|
{
|
146023
|
-
dependencies: [
|
145916
|
+
dependencies: [
|
145917
|
+
"actionType"
|
145918
|
+
],
|
146024
145919
|
fulfill: {
|
146025
145920
|
state: {
|
146026
145921
|
visible: '{{$deps[0] === "element"}}'
|
@@ -146038,7 +145933,9 @@ var getMWANewActionSchema = (extra = {}) => {
|
|
146038
145933
|
})),
|
146039
145934
|
"x-reactions": [
|
146040
145935
|
{
|
146041
|
-
dependencies: [
|
145936
|
+
dependencies: [
|
145937
|
+
"actionType"
|
145938
|
+
],
|
146042
145939
|
fulfill: {
|
146043
145940
|
state: {
|
146044
145941
|
visible: '{{$deps[0] === "function"}}'
|
@@ -146056,7 +145953,9 @@ var getMWANewActionSchema = (extra = {}) => {
|
|
146056
145953
|
})),
|
146057
145954
|
"x-reactions": [
|
146058
145955
|
{
|
146059
|
-
dependencies: [
|
145956
|
+
dependencies: [
|
145957
|
+
"actionType"
|
145958
|
+
],
|
146060
145959
|
fulfill: {
|
146061
145960
|
state: {
|
146062
145961
|
visible: '{{$deps[0] === "refactor"}}'
|
@@ -146162,7 +146061,9 @@ var BFFPluginDependence = {
|
|
146162
146061
|
};
|
146163
146062
|
|
146164
146063
|
// ../../generator-common/dist/esm-node/newAction/module/index.js
|
146165
|
-
var ModuleActionTypes = [
|
146064
|
+
var ModuleActionTypes = [
|
146065
|
+
ActionType.Function
|
146066
|
+
];
|
146166
146067
|
var ModuleActionFunctions = [
|
146167
146068
|
ActionFunction.Test,
|
146168
146069
|
ActionFunction.TailwindCSS,
|
@@ -146183,21 +146084,23 @@ var getModuleNewActionSchema = (extra = {}) => {
|
|
146183
146084
|
enum: ModuleActionTypes.map((type) => ({
|
146184
146085
|
value: type,
|
146185
146086
|
label: ActionTypeText[type](),
|
146186
|
-
type: [
|
146087
|
+
type: [
|
146088
|
+
"string"
|
146089
|
+
]
|
146187
146090
|
}))
|
146188
146091
|
},
|
146189
146092
|
[ActionType.Function]: {
|
146190
146093
|
type: "string",
|
146191
146094
|
title: ActionTypeText[ActionType.Function](),
|
146192
|
-
enum: ModuleActionFunctions.filter((func) => !funcMap[func]).map(
|
146193
|
-
|
146194
|
-
|
146195
|
-
|
146196
|
-
})
|
146197
|
-
),
|
146095
|
+
enum: ModuleActionFunctions.filter((func) => !funcMap[func]).map((func) => ({
|
146096
|
+
value: func,
|
146097
|
+
label: ActionFunctionText[func]()
|
146098
|
+
})),
|
146198
146099
|
"x-reactions": [
|
146199
146100
|
{
|
146200
|
-
dependencies: [
|
146101
|
+
dependencies: [
|
146102
|
+
"actionType"
|
146103
|
+
],
|
146201
146104
|
fulfill: {
|
146202
146105
|
state: {
|
146203
146106
|
visible: '{{$deps[0] === "function"}}'
|
@@ -146255,10 +146158,22 @@ var getMonorepoNewActionSchema = (extra = {}) => {
|
|
146255
146158
|
};
|
146256
146159
|
};
|
146257
146160
|
var MonorepoNewActionConfig = {
|
146258
|
-
[SubSolution.MWA]: {
|
146259
|
-
|
146260
|
-
|
146261
|
-
|
146161
|
+
[SubSolution.MWA]: {
|
146162
|
+
isMonorepoSubProject: true,
|
146163
|
+
isTest: false
|
146164
|
+
},
|
146165
|
+
[SubSolution.MWATest]: {
|
146166
|
+
isMonorepoSubProject: true,
|
146167
|
+
isTest: true
|
146168
|
+
},
|
146169
|
+
[SubSolution.Module]: {
|
146170
|
+
isMonorepoSubProject: true,
|
146171
|
+
isPublic: true
|
146172
|
+
},
|
146173
|
+
[SubSolution.InnerModule]: {
|
146174
|
+
isMonorepoSubProject: true,
|
146175
|
+
isPublic: false
|
146176
|
+
}
|
146262
146177
|
};
|
146263
146178
|
|
146264
146179
|
// ../../generator-common/dist/esm-node/index.js
|
@@ -146287,7 +146202,9 @@ var lazy = (moduleName, requireFn) => {
|
|
146287
146202
|
const importLazyLocal = require_import_lazy2()(requireFn);
|
146288
146203
|
return importLazyLocal(moduleName);
|
146289
146204
|
};
|
146290
|
-
var Import = {
|
146205
|
+
var Import = {
|
146206
|
+
lazy
|
146207
|
+
};
|
146291
146208
|
|
146292
146209
|
// ../../../toolkit/utils/dist/esm/compiled.js
|
146293
146210
|
var import_fs_extra = __toESM(require_fs_extra2());
|
@@ -146319,21 +146236,25 @@ var import_browserslist = __toESM(require_browserslist2());
|
|
146319
146236
|
var import_recursive_readdir = __toESM(require_recursive_readdir2());
|
146320
146237
|
var import_commander = __toESM(require_commander2());
|
146321
146238
|
var import_signale2 = __toESM(require_signale2());
|
146322
|
-
var mime = Import.lazy(
|
146323
|
-
|
146324
|
-
|
146325
|
-
);
|
146326
|
-
var chokidar = Import.lazy(
|
146327
|
-
"../compiled/chokidar",
|
146328
|
-
require
|
146329
|
-
);
|
146330
|
-
var inquirer3 = Import.lazy(
|
146331
|
-
"../compiled/inquirer",
|
146332
|
-
require
|
146333
|
-
);
|
146239
|
+
var mime = Import.lazy("../compiled/mime-types", require);
|
146240
|
+
var chokidar = Import.lazy("../compiled/chokidar", require);
|
146241
|
+
var inquirer3 = Import.lazy("../compiled/inquirer", require);
|
146334
146242
|
|
146335
146243
|
// ../../../toolkit/utils/dist/esm/logger.js
|
146336
146244
|
var import_chalk2 = __toESM(require_chalk2());
|
146245
|
+
function _define_property2(obj, key, value) {
|
146246
|
+
if (key in obj) {
|
146247
|
+
Object.defineProperty(obj, key, {
|
146248
|
+
value,
|
146249
|
+
enumerable: true,
|
146250
|
+
configurable: true,
|
146251
|
+
writable: true
|
146252
|
+
});
|
146253
|
+
} else {
|
146254
|
+
obj[key] = value;
|
146255
|
+
}
|
146256
|
+
return obj;
|
146257
|
+
}
|
146337
146258
|
var LOG_LEVEL = {
|
146338
146259
|
error: 0,
|
146339
146260
|
warn: 1,
|
@@ -146367,22 +146288,15 @@ var LOG_TYPES = {
|
|
146367
146288
|
label: "debug",
|
146368
146289
|
level: "debug"
|
146369
146290
|
},
|
146370
|
-
log: {
|
146291
|
+
log: {
|
146292
|
+
level: "log"
|
146293
|
+
}
|
146371
146294
|
};
|
146372
146295
|
var DEFAULT_CONFIG = {
|
146373
146296
|
displayLabel: true,
|
146374
146297
|
uppercaseLabel: false
|
146375
146298
|
};
|
146376
146299
|
var Logger2 = class {
|
146377
|
-
constructor(options = {}) {
|
146378
|
-
this.level = options.level || LOG_TYPES.log.level;
|
146379
|
-
this.config = __spreadValues(__spreadValues({}, DEFAULT_CONFIG), options.config || {});
|
146380
|
-
this.types = __spreadValues(__spreadValues({}, LOG_TYPES), options.types || {});
|
146381
|
-
this.longestLabel = this.getLongestLabel();
|
146382
|
-
Object.keys(this.types).forEach((type) => {
|
146383
|
-
this[type] = this._log.bind(this, type);
|
146384
|
-
});
|
146385
|
-
}
|
146386
146300
|
_log(type, message, ...args) {
|
146387
146301
|
if (message === void 0 || message === null) {
|
146388
146302
|
console.log();
|
@@ -146423,6 +146337,19 @@ ${import_chalk2.default.grey(rest.join("\n"))}`;
|
|
146423
146337
|
});
|
146424
146338
|
return longestLabel;
|
146425
146339
|
}
|
146340
|
+
constructor(options = {}) {
|
146341
|
+
_define_property2(this, "level", void 0);
|
146342
|
+
_define_property2(this, "config", void 0);
|
146343
|
+
_define_property2(this, "types", void 0);
|
146344
|
+
_define_property2(this, "longestLabel", void 0);
|
146345
|
+
this.level = options.level || LOG_TYPES.log.level;
|
146346
|
+
this.config = __spreadValues(__spreadValues({}, DEFAULT_CONFIG), options.config || {});
|
146347
|
+
this.types = __spreadValues(__spreadValues({}, LOG_TYPES), options.types || {});
|
146348
|
+
this.longestLabel = this.getLongestLabel();
|
146349
|
+
Object.keys(this.types).forEach((type) => {
|
146350
|
+
this[type] = this._log.bind(this, type);
|
146351
|
+
});
|
146352
|
+
}
|
146426
146353
|
};
|
146427
146354
|
var logger = new Logger2();
|
146428
146355
|
logger.Logger = Logger2;
|
@@ -146435,7 +146362,11 @@ var import_path11 = __toESM(require("path"));
|
|
146435
146362
|
function canUseNpm2() {
|
146436
146363
|
return __async(this, null, function* () {
|
146437
146364
|
try {
|
146438
|
-
yield (0, import_execa.default)("npm", [
|
146365
|
+
yield (0, import_execa.default)("npm", [
|
146366
|
+
"--version"
|
146367
|
+
], {
|
146368
|
+
env: process.env
|
146369
|
+
});
|
146439
146370
|
return true;
|
146440
146371
|
} catch (e) {
|
146441
146372
|
return false;
|
@@ -146445,7 +146376,11 @@ function canUseNpm2() {
|
|
146445
146376
|
function canUseYarn3() {
|
146446
146377
|
return __async(this, null, function* () {
|
146447
146378
|
try {
|
146448
|
-
yield (0, import_execa.default)("yarn", [
|
146379
|
+
yield (0, import_execa.default)("yarn", [
|
146380
|
+
"--version"
|
146381
|
+
], {
|
146382
|
+
env: process.env
|
146383
|
+
});
|
146449
146384
|
return true;
|
146450
146385
|
} catch (e) {
|
146451
146386
|
return false;
|
@@ -146455,7 +146390,11 @@ function canUseYarn3() {
|
|
146455
146390
|
function canUsePnpm3() {
|
146456
146391
|
return __async(this, null, function* () {
|
146457
146392
|
try {
|
146458
|
-
yield (0, import_execa.default)("pnpm", [
|
146393
|
+
yield (0, import_execa.default)("pnpm", [
|
146394
|
+
"--version"
|
146395
|
+
], {
|
146396
|
+
env: process.env
|
146397
|
+
});
|
146459
146398
|
return true;
|
146460
146399
|
} catch (e) {
|
146461
146400
|
return false;
|
@@ -146509,25 +146448,40 @@ function stripAnsi3(string) {
|
|
146509
146448
|
|
146510
146449
|
// ../../generator-utils/dist/esm/locale/zh.js
|
146511
146450
|
var ZH_LOCALE3 = {
|
146512
|
-
packageName: {
|
146513
|
-
|
146451
|
+
packageName: {
|
146452
|
+
exit: "项目名称 {value} 已存在"
|
146453
|
+
},
|
146454
|
+
packagePath: {
|
146455
|
+
exit: "目录 {value} 已存在"
|
146456
|
+
}
|
146514
146457
|
};
|
146515
146458
|
|
146516
146459
|
// ../../generator-utils/dist/esm/locale/en.js
|
146517
146460
|
var EN_LOCALE3 = {
|
146518
|
-
packageName: {
|
146519
|
-
|
146461
|
+
packageName: {
|
146462
|
+
exit: "package name `{value}` is already exists"
|
146463
|
+
},
|
146464
|
+
packagePath: {
|
146465
|
+
exit: "package path {value} is already exists"
|
146466
|
+
}
|
146520
146467
|
};
|
146521
146468
|
|
146522
146469
|
// ../../generator-utils/dist/esm/locale/index.js
|
146523
146470
|
var i18n3 = new I18n2();
|
146524
|
-
var localeKeys3 = i18n3.init("en", {
|
146471
|
+
var localeKeys3 = i18n3.init("en", {
|
146472
|
+
zh: ZH_LOCALE3,
|
146473
|
+
en: EN_LOCALE3
|
146474
|
+
});
|
146525
146475
|
|
146526
146476
|
// ../../generator-utils/dist/esm/utils/package.js
|
146527
146477
|
function isPackageExist(packageName, registry2) {
|
146528
146478
|
return __async(this, null, function* () {
|
146529
146479
|
if (yield canUseNpm2()) {
|
146530
|
-
const args = [
|
146480
|
+
const args = [
|
146481
|
+
"view",
|
146482
|
+
packageName,
|
146483
|
+
"version"
|
146484
|
+
];
|
146531
146485
|
if (registry2) {
|
146532
146486
|
args.push(`--registry=${registry2}`);
|
146533
146487
|
}
|
@@ -146540,7 +146494,11 @@ function isPackageExist(packageName, registry2) {
|
|
146540
146494
|
function isPackageDeprecated(packageName, registry2) {
|
146541
146495
|
return __async(this, null, function* () {
|
146542
146496
|
if (yield canUseNpm2()) {
|
146543
|
-
const args = [
|
146497
|
+
const args = [
|
146498
|
+
"view",
|
146499
|
+
packageName,
|
146500
|
+
"deprecated"
|
146501
|
+
];
|
146544
146502
|
if (registry2) {
|
146545
146503
|
args.push(`--registry=${registry2}`);
|
146546
146504
|
}
|
@@ -146551,7 +146509,9 @@ function isPackageDeprecated(packageName, registry2) {
|
|
146551
146509
|
});
|
146552
146510
|
}
|
146553
146511
|
function semverDecrease(version) {
|
146554
|
-
const versionObj = import_semver.default.parse(version, {
|
146512
|
+
const versionObj = import_semver.default.parse(version, {
|
146513
|
+
loose: true
|
146514
|
+
});
|
146555
146515
|
if (!versionObj) {
|
146556
146516
|
throw new Error(`Version ${version} is not valid semver`);
|
146557
146517
|
}
|
@@ -146598,7 +146558,11 @@ function getPackageVersion(packageName, registry2) {
|
|
146598
146558
|
spinner: "runner"
|
146599
146559
|
}).start();
|
146600
146560
|
if (yield canUsePnpm3()) {
|
146601
|
-
const args = [
|
146561
|
+
const args = [
|
146562
|
+
"info",
|
146563
|
+
packageName,
|
146564
|
+
"version"
|
146565
|
+
];
|
146602
146566
|
if (registry2) {
|
146603
146567
|
args.push(`--registry=${registry2}`);
|
146604
146568
|
}
|
@@ -146607,7 +146571,11 @@ function getPackageVersion(packageName, registry2) {
|
|
146607
146571
|
return stripAnsi3(result.stdout);
|
146608
146572
|
}
|
146609
146573
|
if (yield canUseNpm2()) {
|
146610
|
-
const args = [
|
146574
|
+
const args = [
|
146575
|
+
"view",
|
146576
|
+
packageName,
|
146577
|
+
"version"
|
146578
|
+
];
|
146611
146579
|
if (registry2) {
|
146612
146580
|
args.push(`--registry=${registry2}`);
|
146613
146581
|
}
|
@@ -146625,20 +146593,17 @@ function getModernPluginVersion(_0, _1) {
|
|
146625
146593
|
}) {
|
146626
146594
|
const { cwd = process.cwd(), registry: registry2, distTag } = options;
|
146627
146595
|
const getLatetPluginVersion = (tag) => __async(this, null, function* () {
|
146628
|
-
const version = yield getPackageVersion(
|
146629
|
-
`${packageName}@${tag || distTag || "latest"}`,
|
146630
|
-
registry2
|
146631
|
-
);
|
146596
|
+
const version = yield getPackageVersion(`${packageName}@${tag || distTag || "latest"}`, registry2);
|
146632
146597
|
return version;
|
146633
146598
|
});
|
146634
146599
|
if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
|
146635
146600
|
return getLatetPluginVersion("latest");
|
146636
146601
|
}
|
146637
|
-
const pkgPath = import_path12.default.join(
|
146638
|
-
|
146639
|
-
|
146640
|
-
|
146641
|
-
);
|
146602
|
+
const pkgPath = import_path12.default.join(require.resolve(SolutionToolsMap[solution], {
|
146603
|
+
paths: [
|
146604
|
+
cwd
|
146605
|
+
]
|
146606
|
+
}), "../../../../", "package.json");
|
146642
146607
|
if (import_fs_extra.default.existsSync(pkgPath)) {
|
146643
146608
|
const pkgInfo = import_fs_extra.default.readJSONSync(pkgPath);
|
146644
146609
|
const modernVersion = pkgInfo.version;
|
@@ -147145,7 +147110,7 @@ function asyncGeneratorStep29(gen, resolve, reject, _next, _throw, key, arg) {
|
|
147145
147110
|
Promise.resolve(value).then(_next, _throw);
|
147146
147111
|
}
|
147147
147112
|
}
|
147148
|
-
function
|
147113
|
+
function _async_to_generator(fn) {
|
147149
147114
|
return function() {
|
147150
147115
|
var self3 = this, args = arguments;
|
147151
147116
|
return new Promise(function(resolve, reject) {
|
@@ -147160,7 +147125,7 @@ function _asyncToGenerator29(fn) {
|
|
147160
147125
|
});
|
147161
147126
|
};
|
147162
147127
|
}
|
147163
|
-
function
|
147128
|
+
function _define_property3(obj, key, value) {
|
147164
147129
|
if (key in obj) {
|
147165
147130
|
Object.defineProperty(obj, key, {
|
147166
147131
|
value,
|
@@ -147173,17 +147138,17 @@ function _defineProperty20(obj, key, value) {
|
|
147173
147138
|
}
|
147174
147139
|
return obj;
|
147175
147140
|
}
|
147176
|
-
function
|
147141
|
+
function _object_spread(target) {
|
147177
147142
|
for (var i = 1; i < arguments.length; i++) {
|
147178
147143
|
var source = arguments[i] != null ? arguments[i] : {};
|
147179
|
-
var
|
147144
|
+
var ownKeys22 = Object.keys(source);
|
147180
147145
|
if (typeof Object.getOwnPropertySymbols === "function") {
|
147181
|
-
|
147146
|
+
ownKeys22 = ownKeys22.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
147182
147147
|
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
147183
147148
|
}));
|
147184
147149
|
}
|
147185
|
-
|
147186
|
-
|
147150
|
+
ownKeys22.forEach(function(key) {
|
147151
|
+
_define_property3(target, key, source[key]);
|
147187
147152
|
});
|
147188
147153
|
}
|
147189
147154
|
return target;
|
@@ -147201,7 +147166,7 @@ function ownKeys6(object, enumerableOnly) {
|
|
147201
147166
|
}
|
147202
147167
|
return keys;
|
147203
147168
|
}
|
147204
|
-
function
|
147169
|
+
function _object_spread_props(target, source) {
|
147205
147170
|
source = source != null ? source : {};
|
147206
147171
|
if (Object.getOwnPropertyDescriptors) {
|
147207
147172
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
@@ -147314,11 +147279,18 @@ var __generator34 = function(thisArg, body) {
|
|
147314
147279
|
};
|
147315
147280
|
}
|
147316
147281
|
};
|
147282
|
+
var FileType;
|
147283
|
+
(function(FileType22) {
|
147284
|
+
FileType22["Text"] = "text";
|
147285
|
+
FileType22["Binary"] = "binary";
|
147286
|
+
FileType22["Json"] = "json";
|
147287
|
+
FileType22["TextRaw"] = "textRaw";
|
147288
|
+
})(FileType || (FileType = {}));
|
147317
147289
|
function fileExists(filePath) {
|
147318
147290
|
return _fileExists.apply(this, arguments);
|
147319
147291
|
}
|
147320
147292
|
function _fileExists() {
|
147321
|
-
_fileExists =
|
147293
|
+
_fileExists = _async_to_generator(function(filePath) {
|
147322
147294
|
var e;
|
147323
147295
|
return __generator34(this, function(_state) {
|
147324
147296
|
switch (_state.label) {
|
@@ -147375,8 +147347,8 @@ function addFile(config, projectPath, templatePath, renderString3) {
|
|
147375
147347
|
return _addFile.apply(this, arguments);
|
147376
147348
|
}
|
147377
147349
|
function _addFile() {
|
147378
|
-
_addFile =
|
147379
|
-
var fileDestPath, destExists, absTemplatePath, rawTemplate, template;
|
147350
|
+
_addFile = _async_to_generator(function(config, projectPath, templatePath, renderString3) {
|
147351
|
+
var fileDestPath, destExists, absTemplatePath, rawTemplate, _config_templateFile, template;
|
147380
147352
|
return __generator34(this, function(_state) {
|
147381
147353
|
switch (_state.label) {
|
147382
147354
|
case 0:
|
@@ -147399,7 +147371,7 @@ function _addFile() {
|
|
147399
147371
|
case 2:
|
147400
147372
|
_state.sent();
|
147401
147373
|
absTemplatePath = config.templateFile ? import_path13.default.join(templatePath, config.templateFile) : null;
|
147402
|
-
if (!(absTemplatePath != null && (config.type ===
|
147374
|
+
if (!(absTemplatePath != null && (config.type === FileType.Binary || Object.keys(config.data || {}).length === 0)))
|
147403
147375
|
return [
|
147404
147376
|
3,
|
147405
147377
|
5
|
@@ -147437,7 +147409,7 @@ function _addFile() {
|
|
147437
147409
|
case 7:
|
147438
147410
|
return [
|
147439
147411
|
4,
|
147440
|
-
import_fs_extra.default.writeFile(fileDestPath, renderString3(template, config.data || {}), "utf8")
|
147412
|
+
import_fs_extra.default.writeFile(fileDestPath, renderString3(template, config.data || {}, ((_config_templateFile = config.templateFile) === null || _config_templateFile === void 0 ? void 0 : _config_templateFile.endsWith(".ejs")) ? "ejs" : "handlebars"), "utf8")
|
147441
147413
|
];
|
147442
147414
|
case 8:
|
147443
147415
|
_state.sent();
|
@@ -147455,7 +147427,7 @@ function addManyFiles(config, projectPath, templatePath, renderString3) {
|
|
147455
147427
|
return _addManyFiles.apply(this, arguments);
|
147456
147428
|
}
|
147457
147429
|
function _addManyFiles() {
|
147458
|
-
_addManyFiles =
|
147430
|
+
_addManyFiles = _async_to_generator(function(config, projectPath, templatePath, renderString3) {
|
147459
147431
|
var _config_templateBase, dest, templateFiles, filesAdded, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, templateFile, absTemplatePath, targetFile, fileCfg, addedPath, err;
|
147460
147432
|
return __generator34(this, function(_state) {
|
147461
147433
|
switch (_state.label) {
|
@@ -147499,7 +147471,7 @@ function _addManyFiles() {
|
|
147499
147471
|
templateFile = _step.value;
|
147500
147472
|
absTemplatePath = import_path13.default.resolve(templatePath, templateFile);
|
147501
147473
|
targetFile = dropFileRootPath(templateFile, config.templateBase);
|
147502
|
-
fileCfg =
|
147474
|
+
fileCfg = _object_spread_props(_object_spread({}, config), {
|
147503
147475
|
file: import_path13.default.join(config.destination, config.fileNameFunc ? config.fileNameFunc(targetFile) : targetFile),
|
147504
147476
|
templateFile: absTemplatePath,
|
147505
147477
|
force: true
|
@@ -147556,7 +147528,7 @@ function _addManyFiles() {
|
|
147556
147528
|
|
147557
147529
|
// ../../generator-plugin/dist/esm/context/handlebars.js
|
147558
147530
|
var handlebars2 = __toESM(require_lib());
|
147559
|
-
function
|
147531
|
+
function _class_call_check(instance, Constructor) {
|
147560
147532
|
if (!(instance instanceof Constructor)) {
|
147561
147533
|
throw new TypeError("Cannot call a class as a function");
|
147562
147534
|
}
|
@@ -147571,14 +147543,14 @@ function _defineProperties16(target, props) {
|
|
147571
147543
|
Object.defineProperty(target, descriptor.key, descriptor);
|
147572
147544
|
}
|
147573
147545
|
}
|
147574
|
-
function
|
147546
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
147575
147547
|
if (protoProps)
|
147576
147548
|
_defineProperties16(Constructor.prototype, protoProps);
|
147577
147549
|
if (staticProps)
|
147578
147550
|
_defineProperties16(Constructor, staticProps);
|
147579
147551
|
return Constructor;
|
147580
147552
|
}
|
147581
|
-
function
|
147553
|
+
function _define_property4(obj, key, value) {
|
147582
147554
|
if (key in obj) {
|
147583
147555
|
Object.defineProperty(obj, key, {
|
147584
147556
|
value,
|
@@ -147591,7 +147563,7 @@ function _defineProperty21(obj, key, value) {
|
|
147591
147563
|
}
|
147592
147564
|
return obj;
|
147593
147565
|
}
|
147594
|
-
function
|
147566
|
+
function _object_spread2(target) {
|
147595
147567
|
for (var i = 1; i < arguments.length; i++) {
|
147596
147568
|
var source = arguments[i] != null ? arguments[i] : {};
|
147597
147569
|
var ownKeys9 = Object.keys(source);
|
@@ -147601,7 +147573,7 @@ function _objectSpread10(target) {
|
|
147601
147573
|
}));
|
147602
147574
|
}
|
147603
147575
|
ownKeys9.forEach(function(key) {
|
147604
|
-
|
147576
|
+
_define_property4(target, key, source[key]);
|
147605
147577
|
});
|
147606
147578
|
}
|
147607
147579
|
return target;
|
@@ -147609,16 +147581,16 @@ function _objectSpread10(target) {
|
|
147609
147581
|
var PluginHandlebarsAPI = /* @__PURE__ */ function() {
|
147610
147582
|
"use strict";
|
147611
147583
|
function PluginHandlebarsAPI2() {
|
147612
|
-
|
147613
|
-
|
147614
|
-
|
147584
|
+
_class_call_check(this, PluginHandlebarsAPI2);
|
147585
|
+
_define_property4(this, "helpers", {});
|
147586
|
+
_define_property4(this, "partials", {});
|
147615
147587
|
}
|
147616
|
-
|
147588
|
+
_create_class(PluginHandlebarsAPI2, [
|
147617
147589
|
{
|
147618
147590
|
key: "renderString",
|
147619
147591
|
value: function renderString3(template, data) {
|
147620
|
-
var helpers =
|
147621
|
-
var partials =
|
147592
|
+
var helpers = _object_spread2({}, this.helpers);
|
147593
|
+
var partials = _object_spread2({}, this.partials);
|
147622
147594
|
Object.keys(helpers).forEach(function(h) {
|
147623
147595
|
return handlebars2.registerHelper(h, helpers[h]);
|
147624
147596
|
});
|
@@ -147653,6 +147625,46 @@ var PluginHandlebarsAPI = /* @__PURE__ */ function() {
|
|
147653
147625
|
return PluginHandlebarsAPI2;
|
147654
147626
|
}();
|
147655
147627
|
|
147628
|
+
// ../../generator-plugin/dist/esm/context/ejs.js
|
147629
|
+
var import_ejs2 = __toESM(require_ejs());
|
147630
|
+
function _class_call_check2(instance, Constructor) {
|
147631
|
+
if (!(instance instanceof Constructor)) {
|
147632
|
+
throw new TypeError("Cannot call a class as a function");
|
147633
|
+
}
|
147634
|
+
}
|
147635
|
+
function _defineProperties17(target, props) {
|
147636
|
+
for (var i = 0; i < props.length; i++) {
|
147637
|
+
var descriptor = props[i];
|
147638
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
147639
|
+
descriptor.configurable = true;
|
147640
|
+
if ("value" in descriptor)
|
147641
|
+
descriptor.writable = true;
|
147642
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
147643
|
+
}
|
147644
|
+
}
|
147645
|
+
function _create_class2(Constructor, protoProps, staticProps) {
|
147646
|
+
if (protoProps)
|
147647
|
+
_defineProperties17(Constructor.prototype, protoProps);
|
147648
|
+
if (staticProps)
|
147649
|
+
_defineProperties17(Constructor, staticProps);
|
147650
|
+
return Constructor;
|
147651
|
+
}
|
147652
|
+
var PluginEjsAPI = /* @__PURE__ */ function() {
|
147653
|
+
"use strict";
|
147654
|
+
function PluginEjsAPI2() {
|
147655
|
+
_class_call_check2(this, PluginEjsAPI2);
|
147656
|
+
}
|
147657
|
+
_create_class2(PluginEjsAPI2, [
|
147658
|
+
{
|
147659
|
+
key: "renderString",
|
147660
|
+
value: function renderString3(template, data) {
|
147661
|
+
return import_ejs2.default.render(template, data) || "";
|
147662
|
+
}
|
147663
|
+
}
|
147664
|
+
]);
|
147665
|
+
return PluginEjsAPI2;
|
147666
|
+
}();
|
147667
|
+
|
147656
147668
|
// ../../generator-plugin/dist/esm/context/file.js
|
147657
147669
|
function asyncGeneratorStep30(gen, resolve, reject, _next, _throw, key, arg) {
|
147658
147670
|
try {
|
@@ -147668,7 +147680,7 @@ function asyncGeneratorStep30(gen, resolve, reject, _next, _throw, key, arg) {
|
|
147668
147680
|
Promise.resolve(value).then(_next, _throw);
|
147669
147681
|
}
|
147670
147682
|
}
|
147671
|
-
function
|
147683
|
+
function _async_to_generator2(fn) {
|
147672
147684
|
return function() {
|
147673
147685
|
var self3 = this, args = arguments;
|
147674
147686
|
return new Promise(function(resolve, reject) {
|
@@ -147683,12 +147695,12 @@ function _asyncToGenerator30(fn) {
|
|
147683
147695
|
});
|
147684
147696
|
};
|
147685
147697
|
}
|
147686
|
-
function
|
147698
|
+
function _class_call_check3(instance, Constructor) {
|
147687
147699
|
if (!(instance instanceof Constructor)) {
|
147688
147700
|
throw new TypeError("Cannot call a class as a function");
|
147689
147701
|
}
|
147690
147702
|
}
|
147691
|
-
function
|
147703
|
+
function _defineProperties18(target, props) {
|
147692
147704
|
for (var i = 0; i < props.length; i++) {
|
147693
147705
|
var descriptor = props[i];
|
147694
147706
|
descriptor.enumerable = descriptor.enumerable || false;
|
@@ -147698,14 +147710,14 @@ function _defineProperties17(target, props) {
|
|
147698
147710
|
Object.defineProperty(target, descriptor.key, descriptor);
|
147699
147711
|
}
|
147700
147712
|
}
|
147701
|
-
function
|
147713
|
+
function _create_class3(Constructor, protoProps, staticProps) {
|
147702
147714
|
if (protoProps)
|
147703
|
-
|
147715
|
+
_defineProperties18(Constructor.prototype, protoProps);
|
147704
147716
|
if (staticProps)
|
147705
|
-
|
147717
|
+
_defineProperties18(Constructor, staticProps);
|
147706
147718
|
return Constructor;
|
147707
147719
|
}
|
147708
|
-
function
|
147720
|
+
function _define_property5(obj, key, value) {
|
147709
147721
|
if (key in obj) {
|
147710
147722
|
Object.defineProperty(obj, key, {
|
147711
147723
|
value,
|
@@ -147718,7 +147730,7 @@ function _defineProperty22(obj, key, value) {
|
|
147718
147730
|
}
|
147719
147731
|
return obj;
|
147720
147732
|
}
|
147721
|
-
function
|
147733
|
+
function _object_spread3(target) {
|
147722
147734
|
for (var i = 1; i < arguments.length; i++) {
|
147723
147735
|
var source = arguments[i] != null ? arguments[i] : {};
|
147724
147736
|
var ownKeys9 = Object.keys(source);
|
@@ -147728,7 +147740,7 @@ function _objectSpread11(target) {
|
|
147728
147740
|
}));
|
147729
147741
|
}
|
147730
147742
|
ownKeys9.forEach(function(key) {
|
147731
|
-
|
147743
|
+
_define_property5(target, key, source[key]);
|
147732
147744
|
});
|
147733
147745
|
}
|
147734
147746
|
return target;
|
@@ -147835,17 +147847,25 @@ var __generator35 = function(thisArg, body) {
|
|
147835
147847
|
};
|
147836
147848
|
}
|
147837
147849
|
};
|
147850
|
+
var FileType2;
|
147851
|
+
(function(FileType22) {
|
147852
|
+
FileType22["Text"] = "text";
|
147853
|
+
FileType22["Binary"] = "binary";
|
147854
|
+
FileType22["Json"] = "json";
|
147855
|
+
FileType22["TextRaw"] = "textRaw";
|
147856
|
+
})(FileType2 || (FileType2 = {}));
|
147838
147857
|
var PluginFileAPI = /* @__PURE__ */ function() {
|
147839
147858
|
"use strict";
|
147840
147859
|
function PluginFileAPI2() {
|
147841
|
-
|
147842
|
-
|
147843
|
-
|
147844
|
-
|
147845
|
-
|
147860
|
+
_class_call_check3(this, PluginFileAPI2);
|
147861
|
+
_define_property5(this, "projectPath", "");
|
147862
|
+
_define_property5(this, "templatePath", "");
|
147863
|
+
_define_property5(this, "handlebarAPI", new PluginHandlebarsAPI());
|
147864
|
+
_define_property5(this, "ejsAPI", new PluginEjsAPI());
|
147865
|
+
_define_property5(this, "jsonAPI", void 0);
|
147846
147866
|
this.renderString = this.renderString.bind(this);
|
147847
147867
|
}
|
147848
|
-
|
147868
|
+
_create_class3(PluginFileAPI2, [
|
147849
147869
|
{
|
147850
147870
|
key: "context",
|
147851
147871
|
get: function get4() {
|
@@ -147874,7 +147894,10 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
147874
147894
|
{
|
147875
147895
|
key: "renderString",
|
147876
147896
|
value: function renderString3() {
|
147877
|
-
var template = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", data = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
147897
|
+
var template = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", data = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "handlebars";
|
147898
|
+
if (type === "ejs") {
|
147899
|
+
return this.ejsAPI.renderString(template, data);
|
147900
|
+
}
|
147878
147901
|
return this.handlebarAPI.renderString(template, data);
|
147879
147902
|
}
|
147880
147903
|
},
|
@@ -147890,7 +147913,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
147890
147913
|
key: "addFile",
|
147891
147914
|
value: function addFile1(params) {
|
147892
147915
|
var _this = this;
|
147893
|
-
return
|
147916
|
+
return _async_to_generator2(function() {
|
147894
147917
|
return __generator35(this, function(_state) {
|
147895
147918
|
switch (_state.label) {
|
147896
147919
|
case 0:
|
@@ -147912,7 +147935,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
147912
147935
|
key: "addManyFiles",
|
147913
147936
|
value: function addManyFiles1(params) {
|
147914
147937
|
var _this = this;
|
147915
|
-
return
|
147938
|
+
return _async_to_generator2(function() {
|
147916
147939
|
return __generator35(this, function(_state) {
|
147917
147940
|
switch (_state.label) {
|
147918
147941
|
case 0:
|
@@ -147934,7 +147957,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
147934
147957
|
key: "updateJSONFile",
|
147935
147958
|
value: function updateJSONFile(fileName, updateInfo) {
|
147936
147959
|
var _this = this;
|
147937
|
-
return
|
147960
|
+
return _async_to_generator2(function() {
|
147938
147961
|
var fsMaterial;
|
147939
147962
|
return __generator35(this, function(_state) {
|
147940
147963
|
switch (_state.label) {
|
@@ -147945,7 +147968,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
147945
147968
|
_this.jsonAPI.update(fsMaterial.get(fileName), {
|
147946
147969
|
query: {},
|
147947
147970
|
update: {
|
147948
|
-
$set:
|
147971
|
+
$set: _object_spread3({}, updateInfo)
|
147949
147972
|
}
|
147950
147973
|
})
|
147951
147974
|
];
|
@@ -147963,7 +147986,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
147963
147986
|
key: "updateModernConfig",
|
147964
147987
|
value: function updateModernConfig(updateInfo) {
|
147965
147988
|
var _this = this;
|
147966
|
-
return
|
147989
|
+
return _async_to_generator2(function() {
|
147967
147990
|
var update;
|
147968
147991
|
return __generator35(this, function(_state) {
|
147969
147992
|
switch (_state.label) {
|
@@ -147990,7 +148013,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
147990
148013
|
key: "updateTextRawFile",
|
147991
148014
|
value: function updateTextRawFile(fileName, update) {
|
147992
148015
|
var _this = this;
|
147993
|
-
return
|
148016
|
+
return _async_to_generator2(function() {
|
147994
148017
|
var content, newContent;
|
147995
148018
|
return __generator35(this, function(_state) {
|
147996
148019
|
switch (_state.label) {
|
@@ -148020,7 +148043,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
148020
148043
|
key: "rmFile",
|
148021
148044
|
value: function rmFile(fileName) {
|
148022
148045
|
var _this = this;
|
148023
|
-
return
|
148046
|
+
return _async_to_generator2(function() {
|
148024
148047
|
var file;
|
148025
148048
|
return __generator35(this, function(_state) {
|
148026
148049
|
switch (_state.label) {
|
@@ -148056,7 +148079,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
148056
148079
|
key: "rmDir",
|
148057
148080
|
value: function rmDir(dirName) {
|
148058
148081
|
var _this = this;
|
148059
|
-
return
|
148082
|
+
return _async_to_generator2(function() {
|
148060
148083
|
var dir, stat, e;
|
148061
148084
|
return __generator35(this, function(_state) {
|
148062
148085
|
switch (_state.label) {
|
@@ -148114,7 +148137,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
148114
148137
|
key: "isFileExit",
|
148115
148138
|
value: function isFileExit(fileName) {
|
148116
148139
|
var _this = this;
|
148117
|
-
return
|
148140
|
+
return _async_to_generator2(function() {
|
148118
148141
|
return __generator35(this, function(_state) {
|
148119
148142
|
return [
|
148120
148143
|
2,
|
@@ -148128,7 +148151,7 @@ var PluginFileAPI = /* @__PURE__ */ function() {
|
|
148128
148151
|
key: "readDir",
|
148129
148152
|
value: function readDir(dir) {
|
148130
148153
|
var _this = this;
|
148131
|
-
return
|
148154
|
+
return _async_to_generator2(function() {
|
148132
148155
|
return __generator35(this, function(_state) {
|
148133
148156
|
return [
|
148134
148157
|
2,
|
@@ -148157,7 +148180,7 @@ function asyncGeneratorStep31(gen, resolve, reject, _next, _throw, key, arg) {
|
|
148157
148180
|
Promise.resolve(value).then(_next, _throw);
|
148158
148181
|
}
|
148159
148182
|
}
|
148160
|
-
function
|
148183
|
+
function _async_to_generator3(fn) {
|
148161
148184
|
return function() {
|
148162
148185
|
var self3 = this, args = arguments;
|
148163
148186
|
return new Promise(function(resolve, reject) {
|
@@ -148172,12 +148195,12 @@ function _asyncToGenerator31(fn) {
|
|
148172
148195
|
});
|
148173
148196
|
};
|
148174
148197
|
}
|
148175
|
-
function
|
148198
|
+
function _class_call_check4(instance, Constructor) {
|
148176
148199
|
if (!(instance instanceof Constructor)) {
|
148177
148200
|
throw new TypeError("Cannot call a class as a function");
|
148178
148201
|
}
|
148179
148202
|
}
|
148180
|
-
function
|
148203
|
+
function _defineProperties19(target, props) {
|
148181
148204
|
for (var i = 0; i < props.length; i++) {
|
148182
148205
|
var descriptor = props[i];
|
148183
148206
|
descriptor.enumerable = descriptor.enumerable || false;
|
@@ -148187,14 +148210,14 @@ function _defineProperties18(target, props) {
|
|
148187
148210
|
Object.defineProperty(target, descriptor.key, descriptor);
|
148188
148211
|
}
|
148189
148212
|
}
|
148190
|
-
function
|
148213
|
+
function _create_class4(Constructor, protoProps, staticProps) {
|
148191
148214
|
if (protoProps)
|
148192
|
-
|
148215
|
+
_defineProperties19(Constructor.prototype, protoProps);
|
148193
148216
|
if (staticProps)
|
148194
|
-
|
148217
|
+
_defineProperties19(Constructor, staticProps);
|
148195
148218
|
return Constructor;
|
148196
148219
|
}
|
148197
|
-
function
|
148220
|
+
function _define_property6(obj, key, value) {
|
148198
148221
|
if (key in obj) {
|
148199
148222
|
Object.defineProperty(obj, key, {
|
148200
148223
|
value,
|
@@ -148312,12 +148335,12 @@ var __generator36 = function(thisArg, body) {
|
|
148312
148335
|
var PluginGitAPI = /* @__PURE__ */ function() {
|
148313
148336
|
"use strict";
|
148314
148337
|
function PluginGitAPI2() {
|
148315
|
-
|
148316
|
-
|
148317
|
-
|
148318
|
-
|
148338
|
+
_class_call_check4(this, PluginGitAPI2);
|
148339
|
+
_define_property6(this, "gitMessage", "");
|
148340
|
+
_define_property6(this, "gitApi", void 0);
|
148341
|
+
_define_property6(this, "projectPath", void 0);
|
148319
148342
|
}
|
148320
|
-
|
148343
|
+
_create_class4(PluginGitAPI2, [
|
148321
148344
|
{
|
148322
148345
|
key: "context",
|
148323
148346
|
get: function get4() {
|
@@ -148353,7 +148376,7 @@ var PluginGitAPI = /* @__PURE__ */ function() {
|
|
148353
148376
|
key: "isInGitRepo",
|
148354
148377
|
value: function isInGitRepo2() {
|
148355
148378
|
var _this = this;
|
148356
|
-
return
|
148379
|
+
return _async_to_generator3(function() {
|
148357
148380
|
return __generator36(this, function(_state) {
|
148358
148381
|
return [
|
148359
148382
|
2,
|
@@ -148367,7 +148390,7 @@ var PluginGitAPI = /* @__PURE__ */ function() {
|
|
148367
148390
|
key: "initGitRepo",
|
148368
148391
|
value: function initGitRepo2() {
|
148369
148392
|
var _this = this;
|
148370
|
-
return
|
148393
|
+
return _async_to_generator3(function() {
|
148371
148394
|
return __generator36(this, function(_state) {
|
148372
148395
|
switch (_state.label) {
|
148373
148396
|
case 0:
|
@@ -148390,7 +148413,7 @@ var PluginGitAPI = /* @__PURE__ */ function() {
|
|
148390
148413
|
value: function gitAddAndCommit() {
|
148391
148414
|
var commitMessage = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "feat: init";
|
148392
148415
|
var _this = this;
|
148393
|
-
return
|
148416
|
+
return _async_to_generator3(function() {
|
148394
148417
|
return __generator36(this, function(_state) {
|
148395
148418
|
switch (_state.label) {
|
148396
148419
|
case 0:
|
@@ -148414,12 +148437,12 @@ var PluginGitAPI = /* @__PURE__ */ function() {
|
|
148414
148437
|
|
148415
148438
|
// ../../generator-plugin/dist/esm/context/input.js
|
148416
148439
|
var import_lodash10 = __toESM(require_lodash2());
|
148417
|
-
function
|
148440
|
+
function _class_call_check5(instance, Constructor) {
|
148418
148441
|
if (!(instance instanceof Constructor)) {
|
148419
148442
|
throw new TypeError("Cannot call a class as a function");
|
148420
148443
|
}
|
148421
148444
|
}
|
148422
|
-
function
|
148445
|
+
function _defineProperties20(target, props) {
|
148423
148446
|
for (var i = 0; i < props.length; i++) {
|
148424
148447
|
var descriptor = props[i];
|
148425
148448
|
descriptor.enumerable = descriptor.enumerable || false;
|
@@ -148429,14 +148452,14 @@ function _defineProperties19(target, props) {
|
|
148429
148452
|
Object.defineProperty(target, descriptor.key, descriptor);
|
148430
148453
|
}
|
148431
148454
|
}
|
148432
|
-
function
|
148455
|
+
function _create_class5(Constructor, protoProps, staticProps) {
|
148433
148456
|
if (protoProps)
|
148434
|
-
|
148457
|
+
_defineProperties20(Constructor.prototype, protoProps);
|
148435
148458
|
if (staticProps)
|
148436
|
-
|
148459
|
+
_defineProperties20(Constructor, staticProps);
|
148437
148460
|
return Constructor;
|
148438
148461
|
}
|
148439
|
-
function
|
148462
|
+
function _define_property7(obj, key, value) {
|
148440
148463
|
if (key in obj) {
|
148441
148464
|
Object.defineProperty(obj, key, {
|
148442
148465
|
value,
|
@@ -148452,15 +148475,15 @@ function _defineProperty24(obj, key, value) {
|
|
148452
148475
|
var PluginInputContext = /* @__PURE__ */ function() {
|
148453
148476
|
"use strict";
|
148454
148477
|
function PluginInputContext2(solutionSchema) {
|
148455
|
-
|
148456
|
-
|
148457
|
-
|
148458
|
-
|
148459
|
-
|
148460
|
-
|
148478
|
+
_class_call_check5(this, PluginInputContext2);
|
148479
|
+
_define_property7(this, "inputValue", {});
|
148480
|
+
_define_property7(this, "defaultConfig", {});
|
148481
|
+
_define_property7(this, "solutionSchemaFunc", void 0);
|
148482
|
+
_define_property7(this, "solutionSchema", {});
|
148483
|
+
_define_property7(this, "extendInputMap", {});
|
148461
148484
|
this.solutionSchemaFunc = solutionSchema;
|
148462
148485
|
}
|
148463
|
-
|
148486
|
+
_create_class5(PluginInputContext2, [
|
148464
148487
|
{
|
148465
148488
|
key: "prepare",
|
148466
148489
|
value: function prepare(inputData) {
|
@@ -148515,7 +148538,7 @@ var PluginInputContext = /* @__PURE__ */ function() {
|
|
148515
148538
|
this.extendInputMap[key].before[inputKey] = properties[inputKey];
|
148516
148539
|
} else {
|
148517
148540
|
this.extendInputMap[key] = {
|
148518
|
-
before:
|
148541
|
+
before: _define_property7({}, inputKey, properties[inputKey]),
|
148519
148542
|
after: {}
|
148520
148543
|
};
|
148521
148544
|
}
|
@@ -148551,7 +148574,7 @@ var PluginInputContext = /* @__PURE__ */ function() {
|
|
148551
148574
|
} else {
|
148552
148575
|
this.extendInputMap[key] = {
|
148553
148576
|
before: {},
|
148554
|
-
after:
|
148577
|
+
after: _define_property7({}, inputKey, properties[inputKey])
|
148555
148578
|
};
|
148556
148579
|
}
|
148557
148580
|
}
|
@@ -148668,7 +148691,7 @@ function asyncGeneratorStep32(gen, resolve, reject, _next, _throw, key, arg) {
|
|
148668
148691
|
Promise.resolve(value).then(_next, _throw);
|
148669
148692
|
}
|
148670
148693
|
}
|
148671
|
-
function
|
148694
|
+
function _async_to_generator4(fn) {
|
148672
148695
|
return function() {
|
148673
148696
|
var self3 = this, args = arguments;
|
148674
148697
|
return new Promise(function(resolve, reject) {
|
@@ -148683,12 +148706,12 @@ function _asyncToGenerator32(fn) {
|
|
148683
148706
|
});
|
148684
148707
|
};
|
148685
148708
|
}
|
148686
|
-
function
|
148709
|
+
function _class_call_check6(instance, Constructor) {
|
148687
148710
|
if (!(instance instanceof Constructor)) {
|
148688
148711
|
throw new TypeError("Cannot call a class as a function");
|
148689
148712
|
}
|
148690
148713
|
}
|
148691
|
-
function
|
148714
|
+
function _defineProperties21(target, props) {
|
148692
148715
|
for (var i = 0; i < props.length; i++) {
|
148693
148716
|
var descriptor = props[i];
|
148694
148717
|
descriptor.enumerable = descriptor.enumerable || false;
|
@@ -148698,14 +148721,14 @@ function _defineProperties20(target, props) {
|
|
148698
148721
|
Object.defineProperty(target, descriptor.key, descriptor);
|
148699
148722
|
}
|
148700
148723
|
}
|
148701
|
-
function
|
148724
|
+
function _create_class6(Constructor, protoProps, staticProps) {
|
148702
148725
|
if (protoProps)
|
148703
|
-
|
148726
|
+
_defineProperties21(Constructor.prototype, protoProps);
|
148704
148727
|
if (staticProps)
|
148705
|
-
|
148728
|
+
_defineProperties21(Constructor, staticProps);
|
148706
148729
|
return Constructor;
|
148707
148730
|
}
|
148708
|
-
function
|
148731
|
+
function _define_property8(obj, key, value) {
|
148709
148732
|
if (key in obj) {
|
148710
148733
|
Object.defineProperty(obj, key, {
|
148711
148734
|
value,
|
@@ -148823,13 +148846,13 @@ var __generator37 = function(thisArg, body) {
|
|
148823
148846
|
var PluginNpmAPI = /* @__PURE__ */ function() {
|
148824
148847
|
"use strict";
|
148825
148848
|
function PluginNpmAPI2(projectPath, packageManager) {
|
148826
|
-
|
148827
|
-
|
148828
|
-
|
148849
|
+
_class_call_check6(this, PluginNpmAPI2);
|
148850
|
+
_define_property8(this, "projectPath", "");
|
148851
|
+
_define_property8(this, "packageManager", void 0);
|
148829
148852
|
this.projectPath = projectPath;
|
148830
148853
|
this.packageManager = packageManager;
|
148831
148854
|
}
|
148832
|
-
|
148855
|
+
_create_class6(PluginNpmAPI2, [
|
148833
148856
|
{
|
148834
148857
|
key: "method",
|
148835
148858
|
get: function get4() {
|
@@ -148842,7 +148865,7 @@ var PluginNpmAPI = /* @__PURE__ */ function() {
|
|
148842
148865
|
key: "install",
|
148843
148866
|
value: function install() {
|
148844
148867
|
var _this = this;
|
148845
|
-
return
|
148868
|
+
return _async_to_generator4(function() {
|
148846
148869
|
return __generator37(this, function(_state) {
|
148847
148870
|
switch (_state.label) {
|
148848
148871
|
case 0:
|
@@ -148917,7 +148940,9 @@ var readJson = (jsonPath) => {
|
|
148917
148940
|
if (!import_fs_extra.default.existsSync(jsonPath)) {
|
148918
148941
|
return {};
|
148919
148942
|
}
|
148920
|
-
const jsonStr = import_fs_extra.default.readFileSync(jsonPath, {
|
148943
|
+
const jsonStr = import_fs_extra.default.readFileSync(jsonPath, {
|
148944
|
+
encoding: "utf8"
|
148945
|
+
});
|
148921
148946
|
try {
|
148922
148947
|
return import_json5.default.parse(jsonStr);
|
148923
148948
|
} catch (error) {
|
@@ -148925,20 +148950,22 @@ var readJson = (jsonPath) => {
|
|
148925
148950
|
}
|
148926
148951
|
};
|
148927
148952
|
function hasEnabledFunction(action2, dependencies, devDependencies, peerDependencies, cwd) {
|
148928
|
-
var _a2, _b, _c;
|
148929
148953
|
const packageJsonPath = import_path15.default.normalize(`${cwd}/package.json`);
|
148930
148954
|
const packageJson = readJson(packageJsonPath);
|
148931
148955
|
if (!dependencies[action2] && !devDependencies[action2]) {
|
148932
148956
|
return false;
|
148933
148957
|
}
|
148934
148958
|
if (dependencies[action2]) {
|
148935
|
-
|
148959
|
+
var _packageJson_dependencies;
|
148960
|
+
return (_packageJson_dependencies = packageJson.dependencies) === null || _packageJson_dependencies === void 0 ? void 0 : _packageJson_dependencies[dependencies[action2]];
|
148936
148961
|
}
|
148937
148962
|
if (peerDependencies[action2]) {
|
148938
|
-
|
148963
|
+
var _packageJson_peerDependencies;
|
148964
|
+
return (_packageJson_peerDependencies = packageJson.peerDependencies) === null || _packageJson_peerDependencies === void 0 ? void 0 : _packageJson_peerDependencies[peerDependencies[action2]];
|
148939
148965
|
}
|
148940
148966
|
if (!peerDependencies[action2] && devDependencies[action2]) {
|
148941
|
-
|
148967
|
+
var _packageJson_devDependencies;
|
148968
|
+
return (_packageJson_devDependencies = packageJson.devDependencies) === null || _packageJson_devDependencies === void 0 ? void 0 : _packageJson_devDependencies[devDependencies[action2]];
|
148942
148969
|
}
|
148943
148970
|
return false;
|
148944
148971
|
}
|
@@ -148954,21 +148981,16 @@ function getGeneratorPath(generator, distTag) {
|
|
148954
148981
|
// ../../new-action/dist/esm/mwa.js
|
148955
148982
|
var import_lodash11 = __toESM(require_lodash2());
|
148956
148983
|
var MWANewAction = (options) => __async(void 0, null, function* () {
|
148957
|
-
const {
|
148958
|
-
locale = "zh",
|
148959
|
-
distTag = "",
|
148960
|
-
debug: debug2 = false,
|
148961
|
-
registry: registry2 = "",
|
148962
|
-
config = "{}",
|
148963
|
-
cwd = process.cwd()
|
148964
|
-
} = options;
|
148984
|
+
const { locale = "zh", distTag = "", debug: debug2 = false, registry: registry2 = "", config = "{}", cwd = process.cwd() } = options;
|
148965
148985
|
let UserConfig = {};
|
148966
148986
|
try {
|
148967
148987
|
UserConfig = JSON.parse(config);
|
148968
148988
|
} catch (e) {
|
148969
148989
|
throw new Error("config is not a valid json");
|
148970
148990
|
}
|
148971
|
-
i18n2.changeLanguage({
|
148991
|
+
i18n2.changeLanguage({
|
148992
|
+
locale: UserConfig.locale || locale
|
148993
|
+
});
|
148972
148994
|
const smith = new CodeSmith({
|
148973
148995
|
debug: debug2,
|
148974
148996
|
registryUrl: registry2
|
@@ -148984,24 +149006,12 @@ var MWANewAction = (options) => __async(void 0, null, function* () {
|
|
148984
149006
|
});
|
148985
149007
|
const funcMap = {};
|
148986
149008
|
MWAActionFunctions.forEach((func) => {
|
148987
|
-
const enable = hasEnabledFunction(
|
148988
|
-
func,
|
148989
|
-
MWAActionFunctionsDependencies,
|
148990
|
-
MWAActionFunctionsDevDependencies,
|
148991
|
-
{},
|
148992
|
-
cwd
|
148993
|
-
);
|
149009
|
+
const enable = hasEnabledFunction(func, MWAActionFunctionsDependencies, MWAActionFunctionsDevDependencies, {}, cwd);
|
148994
149010
|
funcMap[func] = enable;
|
148995
149011
|
});
|
148996
149012
|
const refactorMap = {};
|
148997
149013
|
MWAActionReactors.forEach((refactor) => {
|
148998
|
-
const enable = hasEnabledFunction(
|
148999
|
-
refactor,
|
149000
|
-
MWAActionRefactorDependencies,
|
149001
|
-
{},
|
149002
|
-
{},
|
149003
|
-
cwd
|
149004
|
-
);
|
149014
|
+
const enable = hasEnabledFunction(refactor, MWAActionRefactorDependencies, {}, {}, cwd);
|
149005
149015
|
refactorMap[refactor] = enable;
|
149006
149016
|
});
|
149007
149017
|
const ans = yield formilyAPI.getInputBySchemaFunc(getMWANewActionSchema, __spreadProps(__spreadValues({}, UserConfig), {
|
@@ -149010,10 +149020,7 @@ var MWANewAction = (options) => __async(void 0, null, function* () {
|
|
149010
149020
|
}));
|
149011
149021
|
const actionType = ans.actionType;
|
149012
149022
|
const action2 = ans[actionType];
|
149013
|
-
const generator = getGeneratorPath(
|
149014
|
-
MWANewActionGenerators[actionType][action2],
|
149015
|
-
distTag
|
149016
|
-
);
|
149023
|
+
const generator = getGeneratorPath(MWANewActionGenerators[actionType][action2], distTag);
|
149017
149024
|
if (!generator) {
|
149018
149025
|
throw new Error(`no valid option`);
|
149019
149026
|
}
|
@@ -149026,24 +149033,21 @@ var MWANewAction = (options) => __async(void 0, null, function* () {
|
|
149026
149033
|
};
|
149027
149034
|
const devDependency = MWAActionFunctionsDevDependencies[action2];
|
149028
149035
|
const dependency = MWAActionFunctionsDependencies[action2] || MWAActionRefactorDependencies[action2];
|
149029
|
-
const finalConfig = (0, import_lodash11.merge)(
|
149030
|
-
UserConfig,
|
149031
|
-
|
149032
|
-
|
149033
|
-
|
149034
|
-
|
149035
|
-
|
149036
|
-
},
|
149037
|
-
{
|
149038
|
-
|
149039
|
-
|
149040
|
-
|
149041
|
-
|
149042
|
-
|
149043
|
-
|
149044
|
-
pluginDependence: MWANewActionPluginDependence[actionType][action2]
|
149045
|
-
}
|
149046
|
-
);
|
149036
|
+
const finalConfig = (0, import_lodash11.merge)(UserConfig, ans, {
|
149037
|
+
locale: UserConfig.locale || locale,
|
149038
|
+
packageManager: UserConfig.packageManager || (yield getPackageManager(cwd)),
|
149039
|
+
distTag
|
149040
|
+
}, {
|
149041
|
+
devDependencies: devDependency ? {
|
149042
|
+
[devDependency]: `${yield getMwaPluginVersion(devDependency)}`
|
149043
|
+
} : {},
|
149044
|
+
dependencies: dependency ? {
|
149045
|
+
[dependency]: `${yield getMwaPluginVersion(dependency)}`
|
149046
|
+
} : {},
|
149047
|
+
appendTypeContent: MWAActionFunctionsAppendTypeContent[action2] || MWAActionReactorAppendTypeContent[action2],
|
149048
|
+
pluginName: MWANewActionPluginName[actionType][action2],
|
149049
|
+
pluginDependence: MWANewActionPluginDependence[actionType][action2]
|
149050
|
+
});
|
149047
149051
|
const task = [
|
149048
149052
|
{
|
149049
149053
|
name: generator,
|
@@ -149062,21 +149066,16 @@ var MWANewAction = (options) => __async(void 0, null, function* () {
|
|
149062
149066
|
// ../../new-action/dist/esm/module.js
|
149063
149067
|
var import_lodash12 = __toESM(require_lodash2());
|
149064
149068
|
var ModuleNewAction = (options) => __async(void 0, null, function* () {
|
149065
|
-
const {
|
149066
|
-
locale = "zh",
|
149067
|
-
distTag = "",
|
149068
|
-
debug: debug2 = false,
|
149069
|
-
registry: registry2 = "",
|
149070
|
-
config = "{}",
|
149071
|
-
cwd = process.cwd()
|
149072
|
-
} = options;
|
149069
|
+
const { locale = "zh", distTag = "", debug: debug2 = false, registry: registry2 = "", config = "{}", cwd = process.cwd() } = options;
|
149073
149070
|
let UserConfig = {};
|
149074
149071
|
try {
|
149075
149072
|
UserConfig = JSON.parse(config);
|
149076
149073
|
} catch (e) {
|
149077
149074
|
throw new Error("config is not a valid json");
|
149078
149075
|
}
|
149079
|
-
i18n2.changeLanguage({
|
149076
|
+
i18n2.changeLanguage({
|
149077
|
+
locale: UserConfig.locale || locale
|
149078
|
+
});
|
149080
149079
|
const smith = new CodeSmith({
|
149081
149080
|
debug: debug2,
|
149082
149081
|
registryUrl: registry2
|
@@ -149093,13 +149092,7 @@ var ModuleNewAction = (options) => __async(void 0, null, function* () {
|
|
149093
149092
|
let hasOption = false;
|
149094
149093
|
const funcMap = {};
|
149095
149094
|
ModuleActionFunctions.forEach((func) => {
|
149096
|
-
const enable = hasEnabledFunction(
|
149097
|
-
func,
|
149098
|
-
ModuleActionFunctionsDependencies,
|
149099
|
-
ModuleActionFunctionsDevDependencies,
|
149100
|
-
ModuleActionFunctionsPeerDependencies,
|
149101
|
-
cwd
|
149102
|
-
);
|
149095
|
+
const enable = hasEnabledFunction(func, ModuleActionFunctionsDependencies, ModuleActionFunctionsDevDependencies, ModuleActionFunctionsPeerDependencies, cwd);
|
149103
149096
|
funcMap[func] = enable;
|
149104
149097
|
if (!enable) {
|
149105
149098
|
hasOption = true;
|
@@ -149114,10 +149107,7 @@ var ModuleNewAction = (options) => __async(void 0, null, function* () {
|
|
149114
149107
|
}));
|
149115
149108
|
const actionType = ans.actionType;
|
149116
149109
|
const action2 = ans[actionType];
|
149117
|
-
const generator = getGeneratorPath(
|
149118
|
-
ModuleNewActionGenerators[actionType][action2],
|
149119
|
-
distTag
|
149120
|
-
);
|
149110
|
+
const generator = getGeneratorPath(ModuleNewActionGenerators[actionType][action2], distTag);
|
149121
149111
|
if (!generator) {
|
149122
149112
|
throw new Error(`no valid option`);
|
149123
149113
|
}
|
@@ -149131,24 +149121,23 @@ var ModuleNewAction = (options) => __async(void 0, null, function* () {
|
|
149131
149121
|
cwd
|
149132
149122
|
});
|
149133
149123
|
};
|
149134
|
-
const finalConfig = (0, import_lodash12.merge)(
|
149135
|
-
UserConfig,
|
149136
|
-
|
149137
|
-
|
149138
|
-
|
149139
|
-
|
149140
|
-
|
149141
|
-
},
|
149142
|
-
{
|
149143
|
-
|
149144
|
-
|
149145
|
-
|
149146
|
-
|
149147
|
-
|
149148
|
-
|
149149
|
-
|
149150
|
-
|
149151
|
-
);
|
149124
|
+
const finalConfig = (0, import_lodash12.merge)(UserConfig, ans, {
|
149125
|
+
locale: UserConfig.locale || locale,
|
149126
|
+
packageManager: UserConfig.packageManager || (yield getPackageManager(cwd)),
|
149127
|
+
distTag
|
149128
|
+
}, {
|
149129
|
+
devDependencies: devDependency ? {
|
149130
|
+
[devDependency]: `${yield getModulePluginVersion(devDependency)}`
|
149131
|
+
} : {},
|
149132
|
+
dependencies: dependency ? {
|
149133
|
+
[dependency]: `${yield getModulePluginVersion(dependency)}`
|
149134
|
+
} : {},
|
149135
|
+
peerDependencies: peerDependency ? {
|
149136
|
+
[peerDependency]: `${yield getModulePluginVersion(peerDependency)}`
|
149137
|
+
} : {},
|
149138
|
+
pluginName: ModuleNewActionPluginName[actionType][action2],
|
149139
|
+
pluginDependence: ModuleNewActionPluginDependence[actionType][action2]
|
149140
|
+
});
|
149152
149141
|
const task = [
|
149153
149142
|
{
|
149154
149143
|
name: generator,
|
@@ -149169,22 +149158,16 @@ var import_path16 = __toESM(require("path"));
|
|
149169
149158
|
var import_lodash13 = __toESM(require_lodash2());
|
149170
149159
|
var REPO_GENERATOR = "@modern-js/repo-generator";
|
149171
149160
|
var MonorepoNewAction = (options) => __async(void 0, null, function* () {
|
149172
|
-
const {
|
149173
|
-
locale = "zh",
|
149174
|
-
distTag = "",
|
149175
|
-
debug: debug2 = false,
|
149176
|
-
registry: registry2 = "",
|
149177
|
-
config = "{}",
|
149178
|
-
plugin = [],
|
149179
|
-
cwd = process.cwd()
|
149180
|
-
} = options;
|
149161
|
+
const { locale = "zh", distTag = "", debug: debug2 = false, registry: registry2 = "", config = "{}", plugin = [], cwd = process.cwd() } = options;
|
149181
149162
|
let UserConfig = {};
|
149182
149163
|
try {
|
149183
149164
|
UserConfig = JSON.parse(config);
|
149184
149165
|
} catch (e) {
|
149185
149166
|
throw new Error("config is not a valid json");
|
149186
149167
|
}
|
149187
|
-
i18n2.changeLanguage({
|
149168
|
+
i18n2.changeLanguage({
|
149169
|
+
locale: UserConfig.locale || locale
|
149170
|
+
});
|
149188
149171
|
const smith = new CodeSmith({
|
149189
149172
|
debug: debug2,
|
149190
149173
|
registryUrl: registry2
|
@@ -149246,7 +149229,7 @@ function asyncGeneratorStep33(gen, resolve, reject, _next, _throw, key, arg) {
|
|
149246
149229
|
Promise.resolve(value).then(_next, _throw);
|
149247
149230
|
}
|
149248
149231
|
}
|
149249
|
-
function
|
149232
|
+
function _async_to_generator5(fn) {
|
149250
149233
|
return function() {
|
149251
149234
|
var self3 = this, args = arguments;
|
149252
149235
|
return new Promise(function(resolve, reject) {
|
@@ -149261,12 +149244,12 @@ function _asyncToGenerator33(fn) {
|
|
149261
149244
|
});
|
149262
149245
|
};
|
149263
149246
|
}
|
149264
|
-
function
|
149247
|
+
function _class_call_check7(instance, Constructor) {
|
149265
149248
|
if (!(instance instanceof Constructor)) {
|
149266
149249
|
throw new TypeError("Cannot call a class as a function");
|
149267
149250
|
}
|
149268
149251
|
}
|
149269
|
-
function
|
149252
|
+
function _defineProperties22(target, props) {
|
149270
149253
|
for (var i = 0; i < props.length; i++) {
|
149271
149254
|
var descriptor = props[i];
|
149272
149255
|
descriptor.enumerable = descriptor.enumerable || false;
|
@@ -149276,14 +149259,14 @@ function _defineProperties21(target, props) {
|
|
149276
149259
|
Object.defineProperty(target, descriptor.key, descriptor);
|
149277
149260
|
}
|
149278
149261
|
}
|
149279
|
-
function
|
149262
|
+
function _create_class7(Constructor, protoProps, staticProps) {
|
149280
149263
|
if (protoProps)
|
149281
|
-
|
149264
|
+
_defineProperties22(Constructor.prototype, protoProps);
|
149282
149265
|
if (staticProps)
|
149283
|
-
|
149266
|
+
_defineProperties22(Constructor, staticProps);
|
149284
149267
|
return Constructor;
|
149285
149268
|
}
|
149286
|
-
function
|
149269
|
+
function _define_property9(obj, key, value) {
|
149287
149270
|
if (key in obj) {
|
149288
149271
|
Object.defineProperty(obj, key, {
|
149289
149272
|
value,
|
@@ -149296,7 +149279,7 @@ function _defineProperty26(obj, key, value) {
|
|
149296
149279
|
}
|
149297
149280
|
return obj;
|
149298
149281
|
}
|
149299
|
-
function
|
149282
|
+
function _object_spread4(target) {
|
149300
149283
|
for (var i = 1; i < arguments.length; i++) {
|
149301
149284
|
var source = arguments[i] != null ? arguments[i] : {};
|
149302
149285
|
var ownKeys9 = Object.keys(source);
|
@@ -149306,7 +149289,7 @@ function _objectSpread12(target) {
|
|
149306
149289
|
}));
|
149307
149290
|
}
|
149308
149291
|
ownKeys9.forEach(function(key) {
|
149309
|
-
|
149292
|
+
_define_property9(target, key, source[key]);
|
149310
149293
|
});
|
149311
149294
|
}
|
149312
149295
|
return target;
|
@@ -149416,16 +149399,16 @@ var __generator38 = function(thisArg, body) {
|
|
149416
149399
|
var PluginNewAPI = /* @__PURE__ */ function() {
|
149417
149400
|
"use strict";
|
149418
149401
|
function PluginNewAPI2(solution, projectPath, inputData) {
|
149419
|
-
|
149420
|
-
|
149421
|
-
|
149422
|
-
|
149402
|
+
_class_call_check7(this, PluginNewAPI2);
|
149403
|
+
_define_property9(this, "solution", void 0);
|
149404
|
+
_define_property9(this, "projectPath", void 0);
|
149405
|
+
_define_property9(this, "inputData", void 0);
|
149423
149406
|
this.solution = solution;
|
149424
149407
|
this.projectPath = projectPath;
|
149425
149408
|
this.inputData = inputData;
|
149426
149409
|
process.setMaxListeners(20);
|
149427
149410
|
}
|
149428
|
-
|
149411
|
+
_create_class7(PluginNewAPI2, [
|
149429
149412
|
{
|
149430
149413
|
key: "method",
|
149431
149414
|
get: function get4() {
|
@@ -149440,7 +149423,7 @@ var PluginNewAPI = /* @__PURE__ */ function() {
|
|
149440
149423
|
key: "createElement",
|
149441
149424
|
value: function createElement(element, params) {
|
149442
149425
|
var _this = this;
|
149443
|
-
return
|
149426
|
+
return _async_to_generator5(function() {
|
149444
149427
|
return __generator38(this, function(_state) {
|
149445
149428
|
switch (_state.label) {
|
149446
149429
|
case 0:
|
@@ -149455,7 +149438,7 @@ var PluginNewAPI = /* @__PURE__ */ function() {
|
|
149455
149438
|
return [
|
149456
149439
|
4,
|
149457
149440
|
MWANewAction({
|
149458
|
-
config: JSON.stringify(
|
149441
|
+
config: JSON.stringify(_object_spread4({
|
149459
149442
|
actionType: ActionType.Element,
|
149460
149443
|
element,
|
149461
149444
|
noNeedInstall: true
|
@@ -149479,7 +149462,7 @@ var PluginNewAPI = /* @__PURE__ */ function() {
|
|
149479
149462
|
key: "enableFunc",
|
149480
149463
|
value: function enableFunc(func, params) {
|
149481
149464
|
var _this = this;
|
149482
|
-
return
|
149465
|
+
return _async_to_generator5(function() {
|
149483
149466
|
return __generator38(this, function(_state) {
|
149484
149467
|
switch (_state.label) {
|
149485
149468
|
case 0:
|
@@ -149494,7 +149477,7 @@ var PluginNewAPI = /* @__PURE__ */ function() {
|
|
149494
149477
|
return [
|
149495
149478
|
4,
|
149496
149479
|
MWANewAction({
|
149497
|
-
config: JSON.stringify(
|
149480
|
+
config: JSON.stringify(_object_spread4({
|
149498
149481
|
actionType: ActionType.Function,
|
149499
149482
|
function: func,
|
149500
149483
|
noNeedInstall: true
|
@@ -149519,7 +149502,7 @@ var PluginNewAPI = /* @__PURE__ */ function() {
|
|
149519
149502
|
return [
|
149520
149503
|
4,
|
149521
149504
|
ModuleNewAction({
|
149522
|
-
config: JSON.stringify(
|
149505
|
+
config: JSON.stringify(_object_spread4({
|
149523
149506
|
actionType: ActionType.Function,
|
149524
149507
|
function: func,
|
149525
149508
|
noNeedInstall: true
|
@@ -149543,7 +149526,7 @@ var PluginNewAPI = /* @__PURE__ */ function() {
|
|
149543
149526
|
key: "createSubProject",
|
149544
149527
|
value: function createSubProject(solution, params) {
|
149545
149528
|
var _this = this;
|
149546
|
-
return
|
149529
|
+
return _async_to_generator5(function() {
|
149547
149530
|
return __generator38(this, function(_state) {
|
149548
149531
|
switch (_state.label) {
|
149549
149532
|
case 0:
|
@@ -149555,7 +149538,7 @@ var PluginNewAPI = /* @__PURE__ */ function() {
|
|
149555
149538
|
return [
|
149556
149539
|
4,
|
149557
149540
|
MonorepoNewAction({
|
149558
|
-
config: JSON.stringify(
|
149541
|
+
config: JSON.stringify(_object_spread4({
|
149559
149542
|
solution,
|
149560
149543
|
noNeedInstall: true
|
149561
149544
|
}, _this.inputData, params)),
|
@@ -149579,12 +149562,12 @@ var PluginNewAPI = /* @__PURE__ */ function() {
|
|
149579
149562
|
}();
|
149580
149563
|
|
149581
149564
|
// ../../generator-plugin/dist/esm/context/index.js
|
149582
|
-
function
|
149565
|
+
function _class_call_check8(instance, Constructor) {
|
149583
149566
|
if (!(instance instanceof Constructor)) {
|
149584
149567
|
throw new TypeError("Cannot call a class as a function");
|
149585
149568
|
}
|
149586
149569
|
}
|
149587
|
-
function
|
149570
|
+
function _defineProperties23(target, props) {
|
149588
149571
|
for (var i = 0; i < props.length; i++) {
|
149589
149572
|
var descriptor = props[i];
|
149590
149573
|
descriptor.enumerable = descriptor.enumerable || false;
|
@@ -149594,14 +149577,14 @@ function _defineProperties22(target, props) {
|
|
149594
149577
|
Object.defineProperty(target, descriptor.key, descriptor);
|
149595
149578
|
}
|
149596
149579
|
}
|
149597
|
-
function
|
149580
|
+
function _create_class8(Constructor, protoProps, staticProps) {
|
149598
149581
|
if (protoProps)
|
149599
|
-
|
149582
|
+
_defineProperties23(Constructor.prototype, protoProps);
|
149600
149583
|
if (staticProps)
|
149601
|
-
|
149584
|
+
_defineProperties23(Constructor, staticProps);
|
149602
149585
|
return Constructor;
|
149603
149586
|
}
|
149604
|
-
function
|
149587
|
+
function _define_property10(obj, key, value) {
|
149605
149588
|
if (key in obj) {
|
149606
149589
|
Object.defineProperty(obj, key, {
|
149607
149590
|
value,
|
@@ -149614,17 +149597,17 @@ function _defineProperty27(obj, key, value) {
|
|
149614
149597
|
}
|
149615
149598
|
return obj;
|
149616
149599
|
}
|
149617
|
-
function
|
149600
|
+
function _object_spread5(target) {
|
149618
149601
|
for (var i = 1; i < arguments.length; i++) {
|
149619
149602
|
var source = arguments[i] != null ? arguments[i] : {};
|
149620
|
-
var
|
149603
|
+
var ownKeys22 = Object.keys(source);
|
149621
149604
|
if (typeof Object.getOwnPropertySymbols === "function") {
|
149622
|
-
|
149605
|
+
ownKeys22 = ownKeys22.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
149623
149606
|
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
149624
149607
|
}));
|
149625
149608
|
}
|
149626
|
-
|
149627
|
-
|
149609
|
+
ownKeys22.forEach(function(key) {
|
149610
|
+
_define_property10(target, key, source[key]);
|
149628
149611
|
});
|
149629
149612
|
}
|
149630
149613
|
return target;
|
@@ -149642,7 +149625,7 @@ function ownKeys7(object, enumerableOnly) {
|
|
149642
149625
|
}
|
149643
149626
|
return keys;
|
149644
149627
|
}
|
149645
|
-
function
|
149628
|
+
function _object_spread_props2(target, source) {
|
149646
149629
|
source = source != null ? source : {};
|
149647
149630
|
if (Object.getOwnPropertyDescriptors) {
|
149648
149631
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
@@ -149653,36 +149636,36 @@ function _objectSpreadProps7(target, source) {
|
|
149653
149636
|
}
|
149654
149637
|
return target;
|
149655
149638
|
}
|
149656
|
-
var LifeCycle2
|
149639
|
+
var LifeCycle2;
|
149640
|
+
(function(LifeCycle22) {
|
149657
149641
|
LifeCycle22["OnForged"] = "onForged";
|
149658
149642
|
LifeCycle22["AfterForged"] = "afterForged";
|
149659
|
-
|
149660
|
-
}(LifeCycle2 || {});
|
149643
|
+
})(LifeCycle2 || (LifeCycle2 = {}));
|
149661
149644
|
var PluginContext = /* @__PURE__ */ function() {
|
149662
149645
|
"use strict";
|
149663
149646
|
function PluginContext2(solutionSchema, locale) {
|
149664
|
-
|
149665
|
-
|
149666
|
-
|
149667
|
-
|
149668
|
-
|
149669
|
-
|
149670
|
-
|
149671
|
-
|
149647
|
+
_class_call_check8(this, PluginContext2);
|
149648
|
+
_define_property10(this, "generator", void 0);
|
149649
|
+
_define_property10(this, "inputContext", void 0);
|
149650
|
+
_define_property10(this, "gitAPI", void 0);
|
149651
|
+
_define_property10(this, "fileAPI", void 0);
|
149652
|
+
_define_property10(this, "npmAPI", void 0);
|
149653
|
+
_define_property10(this, "newAPI", void 0);
|
149654
|
+
_define_property10(this, "locale", void 0);
|
149672
149655
|
var _obj;
|
149673
|
-
|
149674
|
-
}),
|
149656
|
+
_define_property10(this, "lifeCycleFuncMap", (_obj = {}, _define_property10(_obj, LifeCycle2.OnForged, function() {
|
149657
|
+
}), _define_property10(_obj, LifeCycle2.AfterForged, function() {
|
149675
149658
|
}), _obj));
|
149676
149659
|
this.inputContext = new PluginInputContext(solutionSchema);
|
149677
149660
|
this.gitAPI = new PluginGitAPI();
|
149678
149661
|
this.fileAPI = new PluginFileAPI();
|
149679
149662
|
this.locale = locale;
|
149680
149663
|
}
|
149681
|
-
|
149664
|
+
_create_class8(PluginContext2, [
|
149682
149665
|
{
|
149683
149666
|
key: "context",
|
149684
149667
|
get: function get4() {
|
149685
|
-
return
|
149668
|
+
return _object_spread_props2(_object_spread5({
|
149686
149669
|
locale: this.locale
|
149687
149670
|
}, this.inputContext.context, this.gitAPI.context, this.fileAPI.context), {
|
149688
149671
|
onForged: this.onForged.bind(this),
|
@@ -149693,13 +149676,13 @@ var PluginContext = /* @__PURE__ */ function() {
|
|
149693
149676
|
{
|
149694
149677
|
key: "forgedAPI",
|
149695
149678
|
get: function get4() {
|
149696
|
-
return
|
149679
|
+
return _object_spread5({}, this.fileAPI.method, this.newAPI.method);
|
149697
149680
|
}
|
149698
149681
|
},
|
149699
149682
|
{
|
149700
149683
|
key: "afterForgedAPI",
|
149701
149684
|
get: function get4() {
|
149702
|
-
return
|
149685
|
+
return _object_spread5({}, this.gitAPI.method, this.npmAPI.method);
|
149703
149686
|
}
|
149704
149687
|
},
|
149705
149688
|
{
|
@@ -149715,19 +149698,13 @@ var PluginContext = /* @__PURE__ */ function() {
|
|
149715
149698
|
{
|
149716
149699
|
key: "onForged",
|
149717
149700
|
value: function onForged(func) {
|
149718
|
-
this.lifeCycleFuncMap[
|
149719
|
-
"onForged"
|
149720
|
-
/* OnForged */
|
149721
|
-
] = func;
|
149701
|
+
this.lifeCycleFuncMap[LifeCycle2.OnForged] = func;
|
149722
149702
|
}
|
149723
149703
|
},
|
149724
149704
|
{
|
149725
149705
|
key: "afterForged",
|
149726
149706
|
value: function afterForged(func) {
|
149727
|
-
this.lifeCycleFuncMap[
|
149728
|
-
"afterForged"
|
149729
|
-
/* AfterForged */
|
149730
|
-
] = func;
|
149707
|
+
this.lifeCycleFuncMap[LifeCycle2.AfterForged] = func;
|
149731
149708
|
}
|
149732
149709
|
}
|
149733
149710
|
]);
|
@@ -149761,7 +149738,7 @@ function asyncGeneratorStep34(gen, resolve, reject, _next, _throw, key, arg) {
|
|
149761
149738
|
Promise.resolve(value).then(_next, _throw);
|
149762
149739
|
}
|
149763
149740
|
}
|
149764
|
-
function
|
149741
|
+
function _async_to_generator6(fn) {
|
149765
149742
|
return function() {
|
149766
149743
|
var self3 = this, args = arguments;
|
149767
149744
|
return new Promise(function(resolve, reject) {
|
@@ -149883,7 +149860,7 @@ function getPackageMeta(packageName, packageVersion, options) {
|
|
149883
149860
|
return _getPackageMeta.apply(this, arguments);
|
149884
149861
|
}
|
149885
149862
|
function _getPackageMeta() {
|
149886
|
-
_getPackageMeta =
|
149863
|
+
_getPackageMeta = _async_to_generator6(function(packageName, packageVersion, options) {
|
149887
149864
|
var registryUrl, params, getPkgInfoPromise, stdout, pkgMetaInfo;
|
149888
149865
|
return __generator39(this, function(_state) {
|
149889
149866
|
switch (_state.label) {
|
@@ -149949,7 +149926,7 @@ function asyncGeneratorStep35(gen, resolve, reject, _next, _throw, key, arg) {
|
|
149949
149926
|
Promise.resolve(value).then(_next, _throw);
|
149950
149927
|
}
|
149951
149928
|
}
|
149952
|
-
function
|
149929
|
+
function _async_to_generator7(fn) {
|
149953
149930
|
return function() {
|
149954
149931
|
var self3 = this, args = arguments;
|
149955
149932
|
return new Promise(function(resolve, reject) {
|
@@ -150070,23 +150047,23 @@ function installPlugins(plugins, registryUrl) {
|
|
150070
150047
|
return _installPlugins.apply(this, arguments);
|
150071
150048
|
}
|
150072
150049
|
function _installPlugins() {
|
150073
|
-
_installPlugins =
|
150050
|
+
_installPlugins = _async_to_generator7(function(plugins, registryUrl) {
|
150074
150051
|
return __generator40(this, function(_state) {
|
150075
150052
|
return [
|
150076
150053
|
2,
|
150077
150054
|
Promise.all(plugins.map(function() {
|
150078
|
-
var _ref =
|
150079
|
-
var
|
150055
|
+
var _ref = _async_to_generator7(function(plugin) {
|
150056
|
+
var pluginPath, _getPackageInfo, name, version, pluginPath1;
|
150080
150057
|
return __generator40(this, function(_state2) {
|
150081
150058
|
switch (_state2.label) {
|
150082
150059
|
case 0:
|
150083
150060
|
if (plugin.startsWith("file:")) {
|
150084
|
-
|
150061
|
+
pluginPath = import_path17.default.join(process.cwd(), plugin.slice(5));
|
150085
150062
|
return [
|
150086
150063
|
2,
|
150087
150064
|
{
|
150088
|
-
templatePath:
|
150089
|
-
module: requireModule(
|
150065
|
+
templatePath: pluginPath,
|
150066
|
+
module: requireModule(pluginPath)
|
150090
150067
|
}
|
150091
150068
|
];
|
150092
150069
|
}
|
@@ -150108,12 +150085,12 @@ function _installPlugins() {
|
|
150108
150085
|
})
|
150109
150086
|
];
|
150110
150087
|
case 1:
|
150111
|
-
|
150088
|
+
pluginPath1 = _state2.sent();
|
150112
150089
|
return [
|
150113
150090
|
2,
|
150114
150091
|
{
|
150115
|
-
templatePath:
|
150116
|
-
module: requireModule(
|
150092
|
+
templatePath: pluginPath1,
|
150093
|
+
module: requireModule(pluginPath1)
|
150117
150094
|
}
|
150118
150095
|
];
|
150119
150096
|
}
|
@@ -150153,16 +150130,16 @@ var localeKeys4 = i18n4.init("en", {
|
|
150153
150130
|
});
|
150154
150131
|
|
150155
150132
|
// ../../generator-plugin/dist/esm/index.js
|
150156
|
-
function
|
150133
|
+
function _array_like_to_array(arr, len) {
|
150157
150134
|
if (len == null || len > arr.length)
|
150158
150135
|
len = arr.length;
|
150159
150136
|
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
150160
150137
|
arr2[i] = arr[i];
|
150161
150138
|
return arr2;
|
150162
150139
|
}
|
150163
|
-
function
|
150140
|
+
function _array_without_holes(arr) {
|
150164
150141
|
if (Array.isArray(arr))
|
150165
|
-
return
|
150142
|
+
return _array_like_to_array(arr);
|
150166
150143
|
}
|
150167
150144
|
function asyncGeneratorStep36(gen, resolve, reject, _next, _throw, key, arg) {
|
150168
150145
|
try {
|
@@ -150178,7 +150155,7 @@ function asyncGeneratorStep36(gen, resolve, reject, _next, _throw, key, arg) {
|
|
150178
150155
|
Promise.resolve(value).then(_next, _throw);
|
150179
150156
|
}
|
150180
150157
|
}
|
150181
|
-
function
|
150158
|
+
function _async_to_generator8(fn) {
|
150182
150159
|
return function() {
|
150183
150160
|
var self3 = this, args = arguments;
|
150184
150161
|
return new Promise(function(resolve, reject) {
|
@@ -150193,12 +150170,12 @@ function _asyncToGenerator36(fn) {
|
|
150193
150170
|
});
|
150194
150171
|
};
|
150195
150172
|
}
|
150196
|
-
function
|
150173
|
+
function _class_call_check9(instance, Constructor) {
|
150197
150174
|
if (!(instance instanceof Constructor)) {
|
150198
150175
|
throw new TypeError("Cannot call a class as a function");
|
150199
150176
|
}
|
150200
150177
|
}
|
150201
|
-
function
|
150178
|
+
function _defineProperties24(target, props) {
|
150202
150179
|
for (var i = 0; i < props.length; i++) {
|
150203
150180
|
var descriptor = props[i];
|
150204
150181
|
descriptor.enumerable = descriptor.enumerable || false;
|
@@ -150208,14 +150185,14 @@ function _defineProperties23(target, props) {
|
|
150208
150185
|
Object.defineProperty(target, descriptor.key, descriptor);
|
150209
150186
|
}
|
150210
150187
|
}
|
150211
|
-
function
|
150188
|
+
function _create_class9(Constructor, protoProps, staticProps) {
|
150212
150189
|
if (protoProps)
|
150213
|
-
|
150190
|
+
_defineProperties24(Constructor.prototype, protoProps);
|
150214
150191
|
if (staticProps)
|
150215
|
-
|
150192
|
+
_defineProperties24(Constructor, staticProps);
|
150216
150193
|
return Constructor;
|
150217
150194
|
}
|
150218
|
-
function
|
150195
|
+
function _define_property11(obj, key, value) {
|
150219
150196
|
if (key in obj) {
|
150220
150197
|
Object.defineProperty(obj, key, {
|
150221
150198
|
value,
|
@@ -150228,24 +150205,24 @@ function _defineProperty28(obj, key, value) {
|
|
150228
150205
|
}
|
150229
150206
|
return obj;
|
150230
150207
|
}
|
150231
|
-
function
|
150208
|
+
function _iterable_to_array(iter) {
|
150232
150209
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
150233
150210
|
return Array.from(iter);
|
150234
150211
|
}
|
150235
|
-
function
|
150212
|
+
function _non_iterable_spread() {
|
150236
150213
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
150237
150214
|
}
|
150238
|
-
function
|
150215
|
+
function _object_spread6(target) {
|
150239
150216
|
for (var i = 1; i < arguments.length; i++) {
|
150240
150217
|
var source = arguments[i] != null ? arguments[i] : {};
|
150241
|
-
var
|
150218
|
+
var ownKeys22 = Object.keys(source);
|
150242
150219
|
if (typeof Object.getOwnPropertySymbols === "function") {
|
150243
|
-
|
150220
|
+
ownKeys22 = ownKeys22.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
150244
150221
|
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
150245
150222
|
}));
|
150246
150223
|
}
|
150247
|
-
|
150248
|
-
|
150224
|
+
ownKeys22.forEach(function(key) {
|
150225
|
+
_define_property11(target, key, source[key]);
|
150249
150226
|
});
|
150250
150227
|
}
|
150251
150228
|
return target;
|
@@ -150263,7 +150240,7 @@ function ownKeys8(object, enumerableOnly) {
|
|
150263
150240
|
}
|
150264
150241
|
return keys;
|
150265
150242
|
}
|
150266
|
-
function
|
150243
|
+
function _object_spread_props3(target, source) {
|
150267
150244
|
source = source != null ? source : {};
|
150268
150245
|
if (Object.getOwnPropertyDescriptors) {
|
150269
150246
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
@@ -150274,10 +150251,10 @@ function _objectSpreadProps8(target, source) {
|
|
150274
150251
|
}
|
150275
150252
|
return target;
|
150276
150253
|
}
|
150277
|
-
function
|
150254
|
+
function _object_without_properties(source, excluded) {
|
150278
150255
|
if (source == null)
|
150279
150256
|
return {};
|
150280
|
-
var target =
|
150257
|
+
var target = _object_without_properties_loose(source, excluded);
|
150281
150258
|
var key, i;
|
150282
150259
|
if (Object.getOwnPropertySymbols) {
|
150283
150260
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
@@ -150292,7 +150269,7 @@ function _objectWithoutProperties2(source, excluded) {
|
|
150292
150269
|
}
|
150293
150270
|
return target;
|
150294
150271
|
}
|
150295
|
-
function
|
150272
|
+
function _object_without_properties_loose(source, excluded) {
|
150296
150273
|
if (source == null)
|
150297
150274
|
return {};
|
150298
150275
|
var target = {};
|
@@ -150306,21 +150283,21 @@ function _objectWithoutPropertiesLoose2(source, excluded) {
|
|
150306
150283
|
}
|
150307
150284
|
return target;
|
150308
150285
|
}
|
150309
|
-
function
|
150310
|
-
return
|
150286
|
+
function _to_consumable_array(arr) {
|
150287
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
150311
150288
|
}
|
150312
|
-
function
|
150289
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
150313
150290
|
if (!o)
|
150314
150291
|
return;
|
150315
150292
|
if (typeof o === "string")
|
150316
|
-
return
|
150293
|
+
return _array_like_to_array(o, minLen);
|
150317
150294
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
150318
150295
|
if (n === "Object" && o.constructor)
|
150319
150296
|
n = o.constructor.name;
|
150320
150297
|
if (n === "Map" || n === "Set")
|
150321
150298
|
return Array.from(n);
|
150322
150299
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
150323
|
-
return
|
150300
|
+
return _array_like_to_array(o, minLen);
|
150324
150301
|
}
|
150325
150302
|
var __generator41 = function(thisArg, body) {
|
150326
150303
|
var f, y, t, g, _ = {
|
@@ -150428,12 +150405,12 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
150428
150405
|
"use strict";
|
150429
150406
|
function GeneratorPlugin2(logger2, event) {
|
150430
150407
|
var locale = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "en";
|
150431
|
-
|
150432
|
-
|
150433
|
-
|
150434
|
-
|
150435
|
-
|
150436
|
-
|
150408
|
+
_class_call_check9(this, GeneratorPlugin2);
|
150409
|
+
_define_property11(this, "plugins", []);
|
150410
|
+
_define_property11(this, "extendPlugin", {});
|
150411
|
+
_define_property11(this, "customPlugin", {});
|
150412
|
+
_define_property11(this, "event", void 0);
|
150413
|
+
_define_property11(this, "logger", void 0);
|
150437
150414
|
this.event = event;
|
150438
150415
|
this.logger = logger2;
|
150439
150416
|
if (event) {
|
@@ -150449,19 +150426,19 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
150449
150426
|
locale
|
150450
150427
|
});
|
150451
150428
|
}
|
150452
|
-
|
150429
|
+
_create_class9(GeneratorPlugin2, [
|
150453
150430
|
{
|
150454
150431
|
key: "setupPlugin",
|
150455
150432
|
value: function setupPlugin(plugins, registry2) {
|
150456
150433
|
var _this = this;
|
150457
|
-
return
|
150434
|
+
return _async_to_generator8(function() {
|
150458
150435
|
return __generator41(this, function(_state) {
|
150459
150436
|
switch (_state.label) {
|
150460
150437
|
case 0:
|
150461
150438
|
return [
|
150462
150439
|
4,
|
150463
150440
|
Promise.all(plugins.map(function() {
|
150464
|
-
var _ref =
|
150441
|
+
var _ref = _async_to_generator8(function(plugin) {
|
150465
150442
|
var pkgJSON, _getPackageInfo, name, pkgVersion, meta;
|
150466
150443
|
return __generator41(this, function(_state2) {
|
150467
150444
|
switch (_state2.label) {
|
@@ -150516,12 +150493,12 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
150516
150493
|
}));
|
150517
150494
|
}
|
150518
150495
|
if (meta.extend) {
|
150519
|
-
_this.extendPlugin[meta.extend] =
|
150496
|
+
_this.extendPlugin[meta.extend] = _to_consumable_array(_this.extendPlugin[meta.extend] || []).concat([
|
150520
150497
|
plugin
|
150521
150498
|
]);
|
150522
150499
|
} else if (meta.type && meta.key) {
|
150523
|
-
_this.customPlugin[meta.type] =
|
150524
|
-
|
150500
|
+
_this.customPlugin[meta.type] = _to_consumable_array(_this.customPlugin[meta.type] || []).concat([
|
150501
|
+
_object_spread_props3(_object_spread6({}, meta), {
|
150525
150502
|
plugin
|
150526
150503
|
})
|
150527
150504
|
]);
|
@@ -150555,7 +150532,7 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
150555
150532
|
try {
|
150556
150533
|
for (var _iterator = this.plugins[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
150557
150534
|
var info = _step.value;
|
150558
|
-
properties =
|
150535
|
+
properties = _object_spread6({}, properties, info.context.inputContext.getFinalInputs());
|
150559
150536
|
}
|
150560
150537
|
} catch (err) {
|
150561
150538
|
_didIteratorError = true;
|
@@ -150635,14 +150612,14 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
150635
150612
|
key: "installPlugins",
|
150636
150613
|
value: function installPlugins1(solution, inputData) {
|
150637
150614
|
var _this = this;
|
150638
|
-
return
|
150615
|
+
return _async_to_generator8(function() {
|
150639
150616
|
var plugins, plugin, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, info;
|
150640
150617
|
return __generator41(this, function(_state) {
|
150641
150618
|
switch (_state.label) {
|
150642
150619
|
case 0:
|
150643
150620
|
plugins = [];
|
150644
150621
|
if (_this.extendPlugin[solution] && _this.extendPlugin[solution].length > 0) {
|
150645
|
-
plugins =
|
150622
|
+
plugins = _to_consumable_array(plugins).concat(_to_consumable_array(_this.extendPlugin[solution]));
|
150646
150623
|
}
|
150647
150624
|
if (_this.customPlugin[solution]) {
|
150648
150625
|
plugin = _this.customPlugin[solution].find(function(item) {
|
@@ -150724,13 +150701,13 @@ var GeneratorPlugin = /* @__PURE__ */ function() {
|
|
150724
150701
|
key: "handleForged",
|
150725
150702
|
value: function handleForged(solution, basePath, inputData, projectPath, generatorCore) {
|
150726
150703
|
var _this = this;
|
150727
|
-
return
|
150704
|
+
return _async_to_generator8(function() {
|
150728
150705
|
var generatorPlugin, restData, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, info, _info_context, _info_context1, onForgedFunc, err, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, info1, _info_context2, afterForged, err;
|
150729
150706
|
return __generator41(this, function(_state) {
|
150730
150707
|
switch (_state.label) {
|
150731
150708
|
case 0:
|
150732
150709
|
_this.logger.info(i18n4.t(localeKeys4.run_plugin));
|
150733
|
-
generatorPlugin = inputData.generatorPlugin, restData =
|
150710
|
+
generatorPlugin = inputData.generatorPlugin, restData = _object_without_properties(inputData, [
|
150734
150711
|
"generatorPlugin"
|
150735
150712
|
]);
|
150736
150713
|
if (solution !== restData.solution) {
|