@modern-js/generator-cases 3.0.6 → 3.0.7
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @modern-js/generator-cases
|
|
2
2
|
|
|
3
|
+
## 3.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 89ca6cc: refactor: merge build-config into scripts/build
|
|
8
|
+
|
|
9
|
+
refactor: 把 build-config 合并进 scripts/build
|
|
10
|
+
|
|
11
|
+
- 30614fa: chore: modify package.json entry fields and build config
|
|
12
|
+
chore: 更改 package.json entry 字段以及构建配置
|
|
13
|
+
- Updated dependencies [89ca6cc]
|
|
14
|
+
- Updated dependencies [30614fa]
|
|
15
|
+
- Updated dependencies [577084d]
|
|
16
|
+
- @modern-js/generator-common@3.0.7
|
|
17
|
+
|
|
3
18
|
## 3.0.6
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
7
|
var __export = (target, all) => {
|
|
25
8
|
for (var name in all)
|
|
26
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -84,7 +67,8 @@ const getMWACases = (length) => {
|
|
|
84
67
|
const cases = (0, import_covertable.default)(MWAValueMap, {
|
|
85
68
|
length: length || Object.keys(MWAValueMap).length
|
|
86
69
|
});
|
|
87
|
-
return cases.map((item) =>
|
|
70
|
+
return cases.map((item) => ({
|
|
71
|
+
...item,
|
|
88
72
|
solution: import_generator_common.Solution.MWA
|
|
89
73
|
}));
|
|
90
74
|
};
|
|
@@ -92,7 +76,8 @@ const getModuleCases = (length) => {
|
|
|
92
76
|
const cases = (0, import_covertable.default)(ModuleValueMap, {
|
|
93
77
|
length: length || Object.keys(ModuleValueMap).length
|
|
94
78
|
});
|
|
95
|
-
return cases.map((item) =>
|
|
79
|
+
return cases.map((item) => ({
|
|
80
|
+
...item,
|
|
96
81
|
solution: import_generator_common.Solution.Module
|
|
97
82
|
}));
|
|
98
83
|
};
|
|
@@ -100,7 +85,8 @@ const getMonorepoCases = () => {
|
|
|
100
85
|
const cases = (0, import_covertable.default)(MonorepoValueMap, {
|
|
101
86
|
length: Object.keys(MonorepoValueMap).length
|
|
102
87
|
});
|
|
103
|
-
return cases.map((item) =>
|
|
88
|
+
return cases.map((item) => ({
|
|
89
|
+
...item,
|
|
104
90
|
solution: import_generator_common.Solution.Monorepo
|
|
105
91
|
}));
|
|
106
92
|
};
|
|
@@ -130,18 +116,24 @@ const getMWANewCases = (length) => {
|
|
|
130
116
|
const config = { actionType: action };
|
|
131
117
|
import_generator_common.MWAActionTypesMap[action].forEach((option) => {
|
|
132
118
|
config[action] = option;
|
|
133
|
-
const currentConfig =
|
|
119
|
+
const currentConfig = { ...config, [action]: option };
|
|
134
120
|
if (option === import_generator_common.ActionElement.Entry) {
|
|
135
121
|
const entryCases = getMWAEntryCases(length);
|
|
136
122
|
entryCases.forEach((c) => {
|
|
137
|
-
cases.push(
|
|
123
|
+
cases.push({ ...currentConfig, ...c });
|
|
138
124
|
});
|
|
139
125
|
} else if (option === import_generator_common.ActionElement.Server) {
|
|
140
126
|
const serverCases = getMWAServerCases();
|
|
141
|
-
cases.push(
|
|
127
|
+
cases.push({
|
|
128
|
+
...currentConfig,
|
|
129
|
+
...serverCases[Math.round(Math.random() * serverCases.length)]
|
|
130
|
+
});
|
|
142
131
|
} else if (option === import_generator_common.ActionFunction.BFF) {
|
|
143
132
|
const bffCases = getMWABFFCases(length);
|
|
144
|
-
cases.push(
|
|
133
|
+
cases.push({
|
|
134
|
+
...currentConfig,
|
|
135
|
+
...bffCases[Math.round(Math.random() * bffCases.length)]
|
|
136
|
+
});
|
|
145
137
|
} else {
|
|
146
138
|
cases.push(currentConfig);
|
|
147
139
|
}
|
|
@@ -154,7 +146,7 @@ const getModuleNewCases = () => {
|
|
|
154
146
|
import_generator_common.ModuleActionTypes.forEach((action) => {
|
|
155
147
|
const config = { actionType: action };
|
|
156
148
|
import_generator_common.ModuleActionTypesMap[action].forEach((option) => {
|
|
157
|
-
const currentConfig =
|
|
149
|
+
const currentConfig = { ...config, [action]: option };
|
|
158
150
|
cases.push(currentConfig);
|
|
159
151
|
});
|
|
160
152
|
});
|
|
@@ -170,7 +162,8 @@ const getMWASubProjectCases = (isTest, length) => {
|
|
|
170
162
|
const cases = (0, import_covertable.default)(MWASubProjectValueMap, {
|
|
171
163
|
length: length || Object.keys(MWASubProjectValueMap).length
|
|
172
164
|
});
|
|
173
|
-
return cases.map((item) =>
|
|
165
|
+
return cases.map((item) => ({
|
|
166
|
+
...item,
|
|
174
167
|
packageName: Object.values(item).join("-"),
|
|
175
168
|
packagePath: Object.values(item).join("-"),
|
|
176
169
|
solution: isTest ? import_generator_common.SubSolution.MWATest : import_generator_common.SubSolution.MWA
|
|
@@ -180,7 +173,8 @@ const getModuleSubProjectCases = (isInner, length) => {
|
|
|
180
173
|
const cases = (0, import_covertable.default)(ModuleSubProjectValueMap, {
|
|
181
174
|
length: length || Object.keys(ModuleSubProjectValueMap).length
|
|
182
175
|
});
|
|
183
|
-
return cases.map((item) =>
|
|
176
|
+
return cases.map((item) => ({
|
|
177
|
+
...item,
|
|
184
178
|
packageName: Object.values(item).join("-"),
|
|
185
179
|
packagePath: Object.values(item).join("-"),
|
|
186
180
|
solution: isInner ? import_generator_common.SubSolution.InnerModule : import_generator_common.SubSolution.Module
|
|
File without changes
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
1
|
import make from "covertable";
|
|
21
2
|
import {
|
|
22
3
|
Solution,
|
|
@@ -55,7 +36,8 @@ const getMWACases = (length) => {
|
|
|
55
36
|
const cases = make(MWAValueMap, {
|
|
56
37
|
length: length || Object.keys(MWAValueMap).length
|
|
57
38
|
});
|
|
58
|
-
return cases.map((item) =>
|
|
39
|
+
return cases.map((item) => ({
|
|
40
|
+
...item,
|
|
59
41
|
solution: Solution.MWA
|
|
60
42
|
}));
|
|
61
43
|
};
|
|
@@ -63,7 +45,8 @@ const getModuleCases = (length) => {
|
|
|
63
45
|
const cases = make(ModuleValueMap, {
|
|
64
46
|
length: length || Object.keys(ModuleValueMap).length
|
|
65
47
|
});
|
|
66
|
-
return cases.map((item) =>
|
|
48
|
+
return cases.map((item) => ({
|
|
49
|
+
...item,
|
|
67
50
|
solution: Solution.Module
|
|
68
51
|
}));
|
|
69
52
|
};
|
|
@@ -71,7 +54,8 @@ const getMonorepoCases = () => {
|
|
|
71
54
|
const cases = make(MonorepoValueMap, {
|
|
72
55
|
length: Object.keys(MonorepoValueMap).length
|
|
73
56
|
});
|
|
74
|
-
return cases.map((item) =>
|
|
57
|
+
return cases.map((item) => ({
|
|
58
|
+
...item,
|
|
75
59
|
solution: Solution.Monorepo
|
|
76
60
|
}));
|
|
77
61
|
};
|
|
@@ -101,18 +85,24 @@ const getMWANewCases = (length) => {
|
|
|
101
85
|
const config = { actionType: action };
|
|
102
86
|
MWAActionTypesMap[action].forEach((option) => {
|
|
103
87
|
config[action] = option;
|
|
104
|
-
const currentConfig =
|
|
88
|
+
const currentConfig = { ...config, [action]: option };
|
|
105
89
|
if (option === ActionElement.Entry) {
|
|
106
90
|
const entryCases = getMWAEntryCases(length);
|
|
107
91
|
entryCases.forEach((c) => {
|
|
108
|
-
cases.push(
|
|
92
|
+
cases.push({ ...currentConfig, ...c });
|
|
109
93
|
});
|
|
110
94
|
} else if (option === ActionElement.Server) {
|
|
111
95
|
const serverCases = getMWAServerCases();
|
|
112
|
-
cases.push(
|
|
96
|
+
cases.push({
|
|
97
|
+
...currentConfig,
|
|
98
|
+
...serverCases[Math.round(Math.random() * serverCases.length)]
|
|
99
|
+
});
|
|
113
100
|
} else if (option === ActionFunction.BFF) {
|
|
114
101
|
const bffCases = getMWABFFCases(length);
|
|
115
|
-
cases.push(
|
|
102
|
+
cases.push({
|
|
103
|
+
...currentConfig,
|
|
104
|
+
...bffCases[Math.round(Math.random() * bffCases.length)]
|
|
105
|
+
});
|
|
116
106
|
} else {
|
|
117
107
|
cases.push(currentConfig);
|
|
118
108
|
}
|
|
@@ -125,7 +115,7 @@ const getModuleNewCases = () => {
|
|
|
125
115
|
ModuleActionTypes.forEach((action) => {
|
|
126
116
|
const config = { actionType: action };
|
|
127
117
|
ModuleActionTypesMap[action].forEach((option) => {
|
|
128
|
-
const currentConfig =
|
|
118
|
+
const currentConfig = { ...config, [action]: option };
|
|
129
119
|
cases.push(currentConfig);
|
|
130
120
|
});
|
|
131
121
|
});
|
|
@@ -141,7 +131,8 @@ const getMWASubProjectCases = (isTest, length) => {
|
|
|
141
131
|
const cases = make(MWASubProjectValueMap, {
|
|
142
132
|
length: length || Object.keys(MWASubProjectValueMap).length
|
|
143
133
|
});
|
|
144
|
-
return cases.map((item) =>
|
|
134
|
+
return cases.map((item) => ({
|
|
135
|
+
...item,
|
|
145
136
|
packageName: Object.values(item).join("-"),
|
|
146
137
|
packagePath: Object.values(item).join("-"),
|
|
147
138
|
solution: isTest ? SubSolution.MWATest : SubSolution.MWA
|
|
@@ -151,7 +142,8 @@ const getModuleSubProjectCases = (isInner, length) => {
|
|
|
151
142
|
const cases = make(ModuleSubProjectValueMap, {
|
|
152
143
|
length: length || Object.keys(ModuleSubProjectValueMap).length
|
|
153
144
|
});
|
|
154
|
-
return cases.map((item) =>
|
|
145
|
+
return cases.map((item) => ({
|
|
146
|
+
...item,
|
|
155
147
|
packageName: Object.values(item).join("-"),
|
|
156
148
|
packagePath: Object.values(item).join("-"),
|
|
157
149
|
solution: isInner ? SubSolution.InnerModule : SubSolution.Module
|
package/package.json
CHANGED
|
@@ -11,34 +11,33 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "3.0.
|
|
14
|
+
"version": "3.0.7",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
|
-
"main": "./dist/
|
|
18
|
-
"module": "./dist/
|
|
19
|
-
"jsnext:modern": "./dist/js/modern/index.js",
|
|
17
|
+
"main": "./dist/cjs/index.js",
|
|
18
|
+
"module": "./dist/esm/index.js",
|
|
20
19
|
"exports": {
|
|
21
20
|
".": {
|
|
22
21
|
"node": {
|
|
23
22
|
"jsnext:source": "./src/index.ts",
|
|
24
|
-
"import": "./dist/
|
|
25
|
-
"require": "./dist/
|
|
23
|
+
"import": "./dist/esm-node/index.js",
|
|
24
|
+
"require": "./dist/cjs/index.js"
|
|
26
25
|
},
|
|
27
|
-
"default": "./dist/
|
|
26
|
+
"default": "./dist/esm/index.js"
|
|
28
27
|
}
|
|
29
28
|
},
|
|
30
29
|
"dependencies": {
|
|
31
30
|
"@babel/runtime": "^7.18.0",
|
|
32
31
|
"covertable": "^2.2.2",
|
|
33
|
-
"@modern-js/generator-common": "3.0.
|
|
32
|
+
"@modern-js/generator-common": "3.0.7"
|
|
34
33
|
},
|
|
35
34
|
"devDependencies": {
|
|
36
35
|
"@types/jest": "^27",
|
|
37
36
|
"@types/node": "^14",
|
|
38
37
|
"typescript": "^4",
|
|
39
38
|
"jest": "^27",
|
|
40
|
-
"@scripts/build": "2.
|
|
41
|
-
"@scripts/jest-config": "2.
|
|
39
|
+
"@scripts/build": "2.5.0",
|
|
40
|
+
"@scripts/jest-config": "2.5.0"
|
|
42
41
|
},
|
|
43
42
|
"sideEffects": false,
|
|
44
43
|
"publishConfig": {
|