@modern-js/generator-cases 3.2.2 → 3.2.4
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/cjs/index.js +100 -100
- package/dist/esm/index.js +45 -24
- package/dist/esm-node/index.js +46 -27
- package/package.json +4 -4
package/dist/cjs/index.js
CHANGED
|
@@ -1,82 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
6
9
|
for (var name in all)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return LanguageValues;
|
|
15
|
-
},
|
|
16
|
-
PackageManagerValues: function() {
|
|
17
|
-
return PackageManagerValues;
|
|
18
|
-
},
|
|
19
|
-
BooleanConfigValues: function() {
|
|
20
|
-
return BooleanConfigValues;
|
|
21
|
-
},
|
|
22
|
-
FrameworkValues: function() {
|
|
23
|
-
return FrameworkValues;
|
|
24
|
-
},
|
|
25
|
-
BFFTypeValues: function() {
|
|
26
|
-
return BFFTypeValues;
|
|
27
|
-
},
|
|
28
|
-
BuildToolsValues: function() {
|
|
29
|
-
return BuildToolsValues;
|
|
30
|
-
},
|
|
31
|
-
MWAValueMap: function() {
|
|
32
|
-
return MWAValueMap;
|
|
33
|
-
},
|
|
34
|
-
ModuleValueMap: function() {
|
|
35
|
-
return ModuleValueMap;
|
|
36
|
-
},
|
|
37
|
-
MonorepoValueMap: function() {
|
|
38
|
-
return MonorepoValueMap;
|
|
39
|
-
},
|
|
40
|
-
getMWACases: function() {
|
|
41
|
-
return getMWACases;
|
|
42
|
-
},
|
|
43
|
-
getModuleCases: function() {
|
|
44
|
-
return getModuleCases;
|
|
45
|
-
},
|
|
46
|
-
getMonorepoCases: function() {
|
|
47
|
-
return getMonorepoCases;
|
|
48
|
-
},
|
|
49
|
-
MWAServerValueMap: function() {
|
|
50
|
-
return MWAServerValueMap;
|
|
51
|
-
},
|
|
52
|
-
MWABFFValueMap: function() {
|
|
53
|
-
return MWABFFValueMap;
|
|
54
|
-
},
|
|
55
|
-
getMWANewCases: function() {
|
|
56
|
-
return getMWANewCases;
|
|
57
|
-
},
|
|
58
|
-
getModuleNewCases: function() {
|
|
59
|
-
return getModuleNewCases;
|
|
60
|
-
},
|
|
61
|
-
MWASubProjectValueMap: function() {
|
|
62
|
-
return MWASubProjectValueMap;
|
|
63
|
-
},
|
|
64
|
-
ModuleSubProjectValueMap: function() {
|
|
65
|
-
return ModuleSubProjectValueMap;
|
|
66
|
-
},
|
|
67
|
-
getMonorepoNewCases: function() {
|
|
68
|
-
return getMonorepoNewCases;
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
69
17
|
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
BFFTypeValues: () => BFFTypeValues,
|
|
32
|
+
BooleanConfigValues: () => BooleanConfigValues,
|
|
33
|
+
BuildToolsValues: () => BuildToolsValues,
|
|
34
|
+
FrameworkValues: () => FrameworkValues,
|
|
35
|
+
LanguageValues: () => LanguageValues,
|
|
36
|
+
MWABFFValueMap: () => MWABFFValueMap,
|
|
37
|
+
MWAServerValueMap: () => MWAServerValueMap,
|
|
38
|
+
MWASubProjectValueMap: () => MWASubProjectValueMap,
|
|
39
|
+
MWAValueMap: () => MWAValueMap,
|
|
40
|
+
ModuleSubProjectValueMap: () => ModuleSubProjectValueMap,
|
|
41
|
+
ModuleValueMap: () => ModuleValueMap,
|
|
42
|
+
MonorepoValueMap: () => MonorepoValueMap,
|
|
43
|
+
PackageManagerValues: () => PackageManagerValues,
|
|
44
|
+
getMWACases: () => getMWACases,
|
|
45
|
+
getMWANewCases: () => getMWANewCases,
|
|
46
|
+
getModuleCases: () => getModuleCases,
|
|
47
|
+
getModuleNewCases: () => getModuleNewCases,
|
|
48
|
+
getMonorepoCases: () => getMonorepoCases,
|
|
49
|
+
getMonorepoNewCases: () => getMonorepoNewCases
|
|
70
50
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const LanguageValues = Object.values(
|
|
75
|
-
const PackageManagerValues = Object.values(
|
|
76
|
-
const BooleanConfigValues = Object.values(
|
|
77
|
-
const FrameworkValues = Object.values(
|
|
78
|
-
const BFFTypeValues = Object.values(
|
|
79
|
-
const BuildToolsValues = Object.values(
|
|
51
|
+
module.exports = __toCommonJS(src_exports);
|
|
52
|
+
var import_covertable = __toESM(require("covertable"));
|
|
53
|
+
var import_generator_common = require("@modern-js/generator-common");
|
|
54
|
+
const LanguageValues = Object.values(import_generator_common.Language);
|
|
55
|
+
const PackageManagerValues = Object.values(import_generator_common.PackageManager);
|
|
56
|
+
const BooleanConfigValues = Object.values(import_generator_common.BooleanConfig);
|
|
57
|
+
const FrameworkValues = Object.values(import_generator_common.Framework);
|
|
58
|
+
const BFFTypeValues = Object.values(import_generator_common.BFFType);
|
|
59
|
+
const BuildToolsValues = Object.values(import_generator_common.BuildTools);
|
|
80
60
|
const MWAValueMap = {
|
|
81
61
|
language: LanguageValues,
|
|
82
62
|
packageManager: PackageManagerValues,
|
|
@@ -90,30 +70,30 @@ const MonorepoValueMap = {
|
|
|
90
70
|
packageManager: PackageManagerValues.filter((packageManager) => packageManager !== "npm")
|
|
91
71
|
};
|
|
92
72
|
const getMWACases = (length) => {
|
|
93
|
-
const cases = (0,
|
|
73
|
+
const cases = (0, import_covertable.default)(MWAValueMap, {
|
|
94
74
|
length: length || Object.keys(MWAValueMap).length
|
|
95
75
|
});
|
|
96
76
|
return cases.map((item) => ({
|
|
97
77
|
...item,
|
|
98
|
-
solution:
|
|
78
|
+
solution: import_generator_common.Solution.MWA
|
|
99
79
|
}));
|
|
100
80
|
};
|
|
101
81
|
const getModuleCases = (length) => {
|
|
102
|
-
const cases = (0,
|
|
82
|
+
const cases = (0, import_covertable.default)(ModuleValueMap, {
|
|
103
83
|
length: length || Object.keys(ModuleValueMap).length
|
|
104
84
|
});
|
|
105
85
|
return cases.map((item) => ({
|
|
106
86
|
...item,
|
|
107
|
-
solution:
|
|
87
|
+
solution: import_generator_common.Solution.Module
|
|
108
88
|
}));
|
|
109
89
|
};
|
|
110
90
|
const getMonorepoCases = () => {
|
|
111
|
-
const cases = (0,
|
|
91
|
+
const cases = (0, import_covertable.default)(MonorepoValueMap, {
|
|
112
92
|
length: Object.keys(MonorepoValueMap).length
|
|
113
93
|
});
|
|
114
94
|
return cases.map((item) => ({
|
|
115
95
|
...item,
|
|
116
|
-
solution:
|
|
96
|
+
solution: import_generator_common.Solution.Monorepo
|
|
117
97
|
}));
|
|
118
98
|
};
|
|
119
99
|
const getMWAEntryCases = (_length) => {
|
|
@@ -126,29 +106,29 @@ const getMWAEntryCases = (_length) => {
|
|
|
126
106
|
const MWAServerValueMap = {
|
|
127
107
|
framework: FrameworkValues
|
|
128
108
|
};
|
|
129
|
-
const getMWAServerCases = () => (0,
|
|
109
|
+
const getMWAServerCases = () => (0, import_covertable.default)(MWAServerValueMap, {
|
|
130
110
|
length: Object.keys(MWAServerValueMap).length
|
|
131
111
|
});
|
|
132
112
|
const MWABFFValueMap = {
|
|
133
113
|
bffType: BFFTypeValues,
|
|
134
114
|
framework: FrameworkValues
|
|
135
115
|
};
|
|
136
|
-
const getMWABFFCases = (length) => (0,
|
|
116
|
+
const getMWABFFCases = (length) => (0, import_covertable.default)(MWABFFValueMap, {
|
|
137
117
|
length: length || Object.keys(MWABFFValueMap).length
|
|
138
118
|
});
|
|
139
119
|
const getMWANewCases = (length) => {
|
|
140
120
|
const cases = [];
|
|
141
|
-
|
|
121
|
+
import_generator_common.MWAActionTypes.forEach((action) => {
|
|
142
122
|
const config = {
|
|
143
123
|
actionType: action
|
|
144
124
|
};
|
|
145
|
-
|
|
125
|
+
import_generator_common.MWAActionTypesMap[action].forEach((option) => {
|
|
146
126
|
config[action] = option;
|
|
147
127
|
const currentConfig = {
|
|
148
128
|
...config,
|
|
149
129
|
[action]: option
|
|
150
130
|
};
|
|
151
|
-
if (option ===
|
|
131
|
+
if (option === import_generator_common.ActionElement.Entry) {
|
|
152
132
|
const entryCases = getMWAEntryCases(length);
|
|
153
133
|
entryCases.forEach((c) => {
|
|
154
134
|
cases.push({
|
|
@@ -156,13 +136,13 @@ const getMWANewCases = (length) => {
|
|
|
156
136
|
...c
|
|
157
137
|
});
|
|
158
138
|
});
|
|
159
|
-
} else if (option ===
|
|
139
|
+
} else if (option === import_generator_common.ActionElement.Server) {
|
|
160
140
|
const serverCases = getMWAServerCases();
|
|
161
141
|
cases.push({
|
|
162
142
|
...currentConfig,
|
|
163
143
|
...serverCases[Math.round(Math.random() * serverCases.length)]
|
|
164
144
|
});
|
|
165
|
-
} else if (option ===
|
|
145
|
+
} else if (option === import_generator_common.ActionFunction.BFF) {
|
|
166
146
|
const bffCases = getMWABFFCases(length);
|
|
167
147
|
cases.push({
|
|
168
148
|
...currentConfig,
|
|
@@ -177,11 +157,11 @@ const getMWANewCases = (length) => {
|
|
|
177
157
|
};
|
|
178
158
|
const getModuleNewCases = () => {
|
|
179
159
|
const cases = [];
|
|
180
|
-
|
|
160
|
+
import_generator_common.ModuleActionTypes.forEach((action) => {
|
|
181
161
|
const config = {
|
|
182
162
|
actionType: action
|
|
183
163
|
};
|
|
184
|
-
|
|
164
|
+
import_generator_common.ModuleActionTypesMap[action].forEach((option) => {
|
|
185
165
|
const currentConfig = {
|
|
186
166
|
...config,
|
|
187
167
|
[action]: option
|
|
@@ -197,34 +177,54 @@ const MWASubProjectValueMap = {
|
|
|
197
177
|
const ModuleSubProjectValueMap = {
|
|
198
178
|
language: LanguageValues
|
|
199
179
|
};
|
|
200
|
-
const getMWASubProjectCases = (
|
|
201
|
-
const cases = (0,
|
|
180
|
+
const getMWASubProjectCases = (length) => {
|
|
181
|
+
const cases = (0, import_covertable.default)(MWASubProjectValueMap, {
|
|
202
182
|
length: length || Object.keys(MWASubProjectValueMap).length
|
|
203
183
|
});
|
|
204
184
|
return cases.map((item) => ({
|
|
205
185
|
...item,
|
|
206
186
|
packageName: Object.values(item).join("-"),
|
|
207
187
|
packagePath: Object.values(item).join("-"),
|
|
208
|
-
solution:
|
|
188
|
+
solution: import_generator_common.SubSolution.MWA
|
|
209
189
|
}));
|
|
210
190
|
};
|
|
211
|
-
const getModuleSubProjectCases = (
|
|
212
|
-
const cases = (0,
|
|
191
|
+
const getModuleSubProjectCases = (length) => {
|
|
192
|
+
const cases = (0, import_covertable.default)(ModuleSubProjectValueMap, {
|
|
213
193
|
length: length || Object.keys(ModuleSubProjectValueMap).length
|
|
214
194
|
});
|
|
215
195
|
return cases.map((item) => ({
|
|
216
196
|
...item,
|
|
217
197
|
packageName: Object.values(item).join("-"),
|
|
218
198
|
packagePath: Object.values(item).join("-"),
|
|
219
|
-
solution:
|
|
199
|
+
solution: import_generator_common.SubSolution.Module
|
|
220
200
|
}));
|
|
221
201
|
};
|
|
222
202
|
const getMonorepoNewCases = (length) => {
|
|
223
203
|
const cases = [
|
|
224
|
-
...getMWASubProjectCases(
|
|
225
|
-
...
|
|
226
|
-
...getModuleSubProjectCases(false, length),
|
|
227
|
-
...getModuleSubProjectCases(true, length)
|
|
204
|
+
...getMWASubProjectCases(length),
|
|
205
|
+
...getModuleSubProjectCases(length)
|
|
228
206
|
];
|
|
229
207
|
return cases;
|
|
230
208
|
};
|
|
209
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
210
|
+
0 && (module.exports = {
|
|
211
|
+
BFFTypeValues,
|
|
212
|
+
BooleanConfigValues,
|
|
213
|
+
BuildToolsValues,
|
|
214
|
+
FrameworkValues,
|
|
215
|
+
LanguageValues,
|
|
216
|
+
MWABFFValueMap,
|
|
217
|
+
MWAServerValueMap,
|
|
218
|
+
MWASubProjectValueMap,
|
|
219
|
+
MWAValueMap,
|
|
220
|
+
ModuleSubProjectValueMap,
|
|
221
|
+
ModuleValueMap,
|
|
222
|
+
MonorepoValueMap,
|
|
223
|
+
PackageManagerValues,
|
|
224
|
+
getMWACases,
|
|
225
|
+
getMWANewCases,
|
|
226
|
+
getModuleCases,
|
|
227
|
+
getModuleNewCases,
|
|
228
|
+
getMonorepoCases,
|
|
229
|
+
getMonorepoNewCases
|
|
230
|
+
});
|
package/dist/esm/index.js
CHANGED
|
@@ -4,27 +4,27 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
|
4
4
|
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
5
5
|
import make from "covertable";
|
|
6
6
|
import { Solution, PackageManager, Language, BooleanConfig, MWAActionTypes, MWAActionTypesMap, Framework, BFFType, ActionElement, ActionFunction, ModuleActionTypes, ModuleActionTypesMap, SubSolution, BuildTools } from "@modern-js/generator-common";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
var LanguageValues = Object.values(Language);
|
|
8
|
+
var PackageManagerValues = Object.values(PackageManager);
|
|
9
|
+
var BooleanConfigValues = Object.values(BooleanConfig);
|
|
10
|
+
var FrameworkValues = Object.values(Framework);
|
|
11
|
+
var BFFTypeValues = Object.values(BFFType);
|
|
12
|
+
var BuildToolsValues = Object.values(BuildTools);
|
|
13
|
+
var MWAValueMap = {
|
|
14
14
|
language: LanguageValues,
|
|
15
15
|
packageManager: PackageManagerValues,
|
|
16
16
|
buildTools: BuildToolsValues
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
var ModuleValueMap = {
|
|
19
19
|
language: LanguageValues,
|
|
20
20
|
packageManager: PackageManagerValues
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
var MonorepoValueMap = {
|
|
23
23
|
packageManager: PackageManagerValues.filter(function(packageManager) {
|
|
24
24
|
return packageManager !== "npm";
|
|
25
25
|
})
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
var getMWACases = function(length) {
|
|
28
28
|
var cases = make(MWAValueMap, {
|
|
29
29
|
length: length || Object.keys(MWAValueMap).length
|
|
30
30
|
});
|
|
@@ -34,7 +34,7 @@ export var getMWACases = function(length) {
|
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
var getModuleCases = function(length) {
|
|
38
38
|
var cases = make(ModuleValueMap, {
|
|
39
39
|
length: length || Object.keys(ModuleValueMap).length
|
|
40
40
|
});
|
|
@@ -44,7 +44,7 @@ export var getModuleCases = function(length) {
|
|
|
44
44
|
});
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
|
-
|
|
47
|
+
var getMonorepoCases = function() {
|
|
48
48
|
var cases = make(MonorepoValueMap, {
|
|
49
49
|
length: Object.keys(MonorepoValueMap).length
|
|
50
50
|
});
|
|
@@ -61,7 +61,7 @@ var getMWAEntryCases = function(_length) {
|
|
|
61
61
|
}
|
|
62
62
|
];
|
|
63
63
|
};
|
|
64
|
-
|
|
64
|
+
var MWAServerValueMap = {
|
|
65
65
|
framework: FrameworkValues
|
|
66
66
|
};
|
|
67
67
|
var getMWAServerCases = function() {
|
|
@@ -69,7 +69,7 @@ var getMWAServerCases = function() {
|
|
|
69
69
|
length: Object.keys(MWAServerValueMap).length
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
|
-
|
|
72
|
+
var MWABFFValueMap = {
|
|
73
73
|
bffType: BFFTypeValues,
|
|
74
74
|
framework: FrameworkValues
|
|
75
75
|
};
|
|
@@ -78,7 +78,7 @@ var getMWABFFCases = function(length) {
|
|
|
78
78
|
length: length || Object.keys(MWABFFValueMap).length
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
|
-
|
|
81
|
+
var getMWANewCases = function(length) {
|
|
82
82
|
var cases = [];
|
|
83
83
|
MWAActionTypes.forEach(function(action) {
|
|
84
84
|
var config = {
|
|
@@ -105,7 +105,7 @@ export var getMWANewCases = function(length) {
|
|
|
105
105
|
});
|
|
106
106
|
return cases;
|
|
107
107
|
};
|
|
108
|
-
|
|
108
|
+
var getModuleNewCases = function() {
|
|
109
109
|
var cases = [];
|
|
110
110
|
ModuleActionTypes.forEach(function(action) {
|
|
111
111
|
var config = {
|
|
@@ -118,13 +118,13 @@ export var getModuleNewCases = function() {
|
|
|
118
118
|
});
|
|
119
119
|
return cases;
|
|
120
120
|
};
|
|
121
|
-
|
|
121
|
+
var MWASubProjectValueMap = {
|
|
122
122
|
language: LanguageValues
|
|
123
123
|
};
|
|
124
|
-
|
|
124
|
+
var ModuleSubProjectValueMap = {
|
|
125
125
|
language: LanguageValues
|
|
126
126
|
};
|
|
127
|
-
var getMWASubProjectCases = function(
|
|
127
|
+
var getMWASubProjectCases = function(length) {
|
|
128
128
|
var cases = make(MWASubProjectValueMap, {
|
|
129
129
|
length: length || Object.keys(MWASubProjectValueMap).length
|
|
130
130
|
});
|
|
@@ -132,11 +132,11 @@ var getMWASubProjectCases = function(isTest, length) {
|
|
|
132
132
|
return _object_spread_props(_object_spread({}, item), {
|
|
133
133
|
packageName: Object.values(item).join("-"),
|
|
134
134
|
packagePath: Object.values(item).join("-"),
|
|
135
|
-
solution:
|
|
135
|
+
solution: SubSolution.MWA
|
|
136
136
|
});
|
|
137
137
|
});
|
|
138
138
|
};
|
|
139
|
-
var getModuleSubProjectCases = function(
|
|
139
|
+
var getModuleSubProjectCases = function(length) {
|
|
140
140
|
var cases = make(ModuleSubProjectValueMap, {
|
|
141
141
|
length: length || Object.keys(ModuleSubProjectValueMap).length
|
|
142
142
|
});
|
|
@@ -144,11 +144,32 @@ var getModuleSubProjectCases = function(isInner, length) {
|
|
|
144
144
|
return _object_spread_props(_object_spread({}, item), {
|
|
145
145
|
packageName: Object.values(item).join("-"),
|
|
146
146
|
packagePath: Object.values(item).join("-"),
|
|
147
|
-
solution:
|
|
147
|
+
solution: SubSolution.Module
|
|
148
148
|
});
|
|
149
149
|
});
|
|
150
150
|
};
|
|
151
|
-
|
|
152
|
-
var cases = _to_consumable_array(getMWASubProjectCases(
|
|
151
|
+
var getMonorepoNewCases = function(length) {
|
|
152
|
+
var cases = _to_consumable_array(getMWASubProjectCases(length)).concat(_to_consumable_array(getModuleSubProjectCases(length)));
|
|
153
153
|
return cases;
|
|
154
154
|
};
|
|
155
|
+
export {
|
|
156
|
+
BFFTypeValues,
|
|
157
|
+
BooleanConfigValues,
|
|
158
|
+
BuildToolsValues,
|
|
159
|
+
FrameworkValues,
|
|
160
|
+
LanguageValues,
|
|
161
|
+
MWABFFValueMap,
|
|
162
|
+
MWAServerValueMap,
|
|
163
|
+
MWASubProjectValueMap,
|
|
164
|
+
MWAValueMap,
|
|
165
|
+
ModuleSubProjectValueMap,
|
|
166
|
+
ModuleValueMap,
|
|
167
|
+
MonorepoValueMap,
|
|
168
|
+
PackageManagerValues,
|
|
169
|
+
getMWACases,
|
|
170
|
+
getMWANewCases,
|
|
171
|
+
getModuleCases,
|
|
172
|
+
getModuleNewCases,
|
|
173
|
+
getMonorepoCases,
|
|
174
|
+
getMonorepoNewCases
|
|
175
|
+
};
|
package/dist/esm-node/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import make from "covertable";
|
|
2
2
|
import { Solution, PackageManager, Language, BooleanConfig, MWAActionTypes, MWAActionTypesMap, Framework, BFFType, ActionElement, ActionFunction, ModuleActionTypes, ModuleActionTypesMap, SubSolution, BuildTools } from "@modern-js/generator-common";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
const LanguageValues = Object.values(Language);
|
|
4
|
+
const PackageManagerValues = Object.values(PackageManager);
|
|
5
|
+
const BooleanConfigValues = Object.values(BooleanConfig);
|
|
6
|
+
const FrameworkValues = Object.values(Framework);
|
|
7
|
+
const BFFTypeValues = Object.values(BFFType);
|
|
8
|
+
const BuildToolsValues = Object.values(BuildTools);
|
|
9
|
+
const MWAValueMap = {
|
|
10
10
|
language: LanguageValues,
|
|
11
11
|
packageManager: PackageManagerValues,
|
|
12
12
|
buildTools: BuildToolsValues
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
const ModuleValueMap = {
|
|
15
15
|
language: LanguageValues,
|
|
16
16
|
packageManager: PackageManagerValues
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
const MonorepoValueMap = {
|
|
19
19
|
packageManager: PackageManagerValues.filter((packageManager) => packageManager !== "npm")
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
const getMWACases = (length) => {
|
|
22
22
|
const cases = make(MWAValueMap, {
|
|
23
23
|
length: length || Object.keys(MWAValueMap).length
|
|
24
24
|
});
|
|
@@ -27,7 +27,7 @@ export const getMWACases = (length) => {
|
|
|
27
27
|
solution: Solution.MWA
|
|
28
28
|
}));
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
const getModuleCases = (length) => {
|
|
31
31
|
const cases = make(ModuleValueMap, {
|
|
32
32
|
length: length || Object.keys(ModuleValueMap).length
|
|
33
33
|
});
|
|
@@ -36,7 +36,7 @@ export const getModuleCases = (length) => {
|
|
|
36
36
|
solution: Solution.Module
|
|
37
37
|
}));
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
const getMonorepoCases = () => {
|
|
40
40
|
const cases = make(MonorepoValueMap, {
|
|
41
41
|
length: Object.keys(MonorepoValueMap).length
|
|
42
42
|
});
|
|
@@ -52,20 +52,20 @@ const getMWAEntryCases = (_length) => {
|
|
|
52
52
|
}
|
|
53
53
|
];
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
const MWAServerValueMap = {
|
|
56
56
|
framework: FrameworkValues
|
|
57
57
|
};
|
|
58
58
|
const getMWAServerCases = () => make(MWAServerValueMap, {
|
|
59
59
|
length: Object.keys(MWAServerValueMap).length
|
|
60
60
|
});
|
|
61
|
-
|
|
61
|
+
const MWABFFValueMap = {
|
|
62
62
|
bffType: BFFTypeValues,
|
|
63
63
|
framework: FrameworkValues
|
|
64
64
|
};
|
|
65
65
|
const getMWABFFCases = (length) => make(MWABFFValueMap, {
|
|
66
66
|
length: length || Object.keys(MWABFFValueMap).length
|
|
67
67
|
});
|
|
68
|
-
|
|
68
|
+
const getMWANewCases = (length) => {
|
|
69
69
|
const cases = [];
|
|
70
70
|
MWAActionTypes.forEach((action) => {
|
|
71
71
|
const config = {
|
|
@@ -104,7 +104,7 @@ export const getMWANewCases = (length) => {
|
|
|
104
104
|
});
|
|
105
105
|
return cases;
|
|
106
106
|
};
|
|
107
|
-
|
|
107
|
+
const getModuleNewCases = () => {
|
|
108
108
|
const cases = [];
|
|
109
109
|
ModuleActionTypes.forEach((action) => {
|
|
110
110
|
const config = {
|
|
@@ -120,13 +120,13 @@ export const getModuleNewCases = () => {
|
|
|
120
120
|
});
|
|
121
121
|
return cases;
|
|
122
122
|
};
|
|
123
|
-
|
|
123
|
+
const MWASubProjectValueMap = {
|
|
124
124
|
language: LanguageValues
|
|
125
125
|
};
|
|
126
|
-
|
|
126
|
+
const ModuleSubProjectValueMap = {
|
|
127
127
|
language: LanguageValues
|
|
128
128
|
};
|
|
129
|
-
const getMWASubProjectCases = (
|
|
129
|
+
const getMWASubProjectCases = (length) => {
|
|
130
130
|
const cases = make(MWASubProjectValueMap, {
|
|
131
131
|
length: length || Object.keys(MWASubProjectValueMap).length
|
|
132
132
|
});
|
|
@@ -134,10 +134,10 @@ const getMWASubProjectCases = (isTest, length) => {
|
|
|
134
134
|
...item,
|
|
135
135
|
packageName: Object.values(item).join("-"),
|
|
136
136
|
packagePath: Object.values(item).join("-"),
|
|
137
|
-
solution:
|
|
137
|
+
solution: SubSolution.MWA
|
|
138
138
|
}));
|
|
139
139
|
};
|
|
140
|
-
const getModuleSubProjectCases = (
|
|
140
|
+
const getModuleSubProjectCases = (length) => {
|
|
141
141
|
const cases = make(ModuleSubProjectValueMap, {
|
|
142
142
|
length: length || Object.keys(ModuleSubProjectValueMap).length
|
|
143
143
|
});
|
|
@@ -145,15 +145,34 @@ const getModuleSubProjectCases = (isInner, length) => {
|
|
|
145
145
|
...item,
|
|
146
146
|
packageName: Object.values(item).join("-"),
|
|
147
147
|
packagePath: Object.values(item).join("-"),
|
|
148
|
-
solution:
|
|
148
|
+
solution: SubSolution.Module
|
|
149
149
|
}));
|
|
150
150
|
};
|
|
151
|
-
|
|
151
|
+
const getMonorepoNewCases = (length) => {
|
|
152
152
|
const cases = [
|
|
153
|
-
...getMWASubProjectCases(
|
|
154
|
-
...
|
|
155
|
-
...getModuleSubProjectCases(false, length),
|
|
156
|
-
...getModuleSubProjectCases(true, length)
|
|
153
|
+
...getMWASubProjectCases(length),
|
|
154
|
+
...getModuleSubProjectCases(length)
|
|
157
155
|
];
|
|
158
156
|
return cases;
|
|
159
157
|
};
|
|
158
|
+
export {
|
|
159
|
+
BFFTypeValues,
|
|
160
|
+
BooleanConfigValues,
|
|
161
|
+
BuildToolsValues,
|
|
162
|
+
FrameworkValues,
|
|
163
|
+
LanguageValues,
|
|
164
|
+
MWABFFValueMap,
|
|
165
|
+
MWAServerValueMap,
|
|
166
|
+
MWASubProjectValueMap,
|
|
167
|
+
MWAValueMap,
|
|
168
|
+
ModuleSubProjectValueMap,
|
|
169
|
+
ModuleValueMap,
|
|
170
|
+
MonorepoValueMap,
|
|
171
|
+
PackageManagerValues,
|
|
172
|
+
getMWACases,
|
|
173
|
+
getMWANewCases,
|
|
174
|
+
getModuleCases,
|
|
175
|
+
getModuleNewCases,
|
|
176
|
+
getMonorepoCases,
|
|
177
|
+
getMonorepoNewCases
|
|
178
|
+
};
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.2.
|
|
18
|
+
"version": "3.2.4",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"covertable": "^2.2.2",
|
|
35
35
|
"@swc/helpers": "0.5.1",
|
|
36
|
-
"@modern-js/generator-common": "3.2.
|
|
36
|
+
"@modern-js/generator-common": "3.2.4"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/jest": "^29",
|
|
40
40
|
"@types/node": "^14",
|
|
41
41
|
"typescript": "^5",
|
|
42
42
|
"jest": "^29",
|
|
43
|
-
"@scripts/build": "2.
|
|
44
|
-
"@scripts/jest-config": "2.
|
|
43
|
+
"@scripts/build": "2.37.0",
|
|
44
|
+
"@scripts/jest-config": "2.37.0"
|
|
45
45
|
},
|
|
46
46
|
"sideEffects": false,
|
|
47
47
|
"publishConfig": {
|