@modern-js/generator-cases 1.1.2 → 1.2.1
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 +29 -0
- package/dist/js/modern/index.js +2 -2
- package/dist/js/node/index.js +2 -2
- package/dist/js/treeshaking/index.js +2 -2
- package/jest.config.js +8 -0
- package/package.json +11 -7
- package/tests/index.test.ts +2 -2
- package/tests/tsconfig.json +1 -3
- package/tsconfig.json +1 -3
- package/src/index.ts +0 -277
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @modern-js/generator-cases
|
|
2
2
|
|
|
3
|
+
## 1.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 83166714: change .npmignore
|
|
8
|
+
- Updated dependencies [83166714]
|
|
9
|
+
- @modern-js/generator-common@1.3.1
|
|
10
|
+
|
|
11
|
+
## 1.2.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- cfe11628: Make Modern.js self bootstraping
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 2c049918: feat: polyfill function support enable using new command
|
|
20
|
+
- Updated dependencies [2c049918]
|
|
21
|
+
- Updated dependencies [cfe11628]
|
|
22
|
+
- @modern-js/generator-common@1.3.0
|
|
23
|
+
|
|
24
|
+
## 1.1.3
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 4819a3c7: feat: update generator version
|
|
29
|
+
- Updated dependencies [4819a3c7]
|
|
30
|
+
- @modern-js/generator-common@1.2.3
|
|
31
|
+
|
|
3
32
|
## 1.1.2
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
package/dist/js/modern/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
2
|
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
package/dist/js/node/index.js
CHANGED
|
@@ -11,9 +11,9 @@ var _generatorCommon = require("@modern-js/generator-common");
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
15
|
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
17
|
|
|
18
18
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
19
|
|
|
@@ -10,9 +10,9 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
10
10
|
|
|
11
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
12
12
|
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
14
|
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
16
|
|
|
17
17
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
18
|
|
package/jest.config.js
ADDED
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.1
|
|
14
|
+
"version": "1.2.1",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
22
22
|
"node": {
|
|
23
|
+
"jsnext:source": "./src/index.ts",
|
|
23
24
|
"import": "./dist/js/modern/index.js",
|
|
24
25
|
"require": "./dist/js/node/index.js"
|
|
25
26
|
},
|
|
@@ -30,23 +31,26 @@
|
|
|
30
31
|
"@babel/runtime": "^7",
|
|
31
32
|
"execa": "^5.1.1",
|
|
32
33
|
"covertable": "^2.2.2",
|
|
33
|
-
"@modern-js/generator-common": "^1.1
|
|
34
|
+
"@modern-js/generator-common": "^1.3.1"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@types/jest": "^26",
|
|
37
38
|
"@types/node": "^14",
|
|
38
39
|
"typescript": "^4",
|
|
39
|
-
"@
|
|
40
|
-
"
|
|
40
|
+
"@scripts/build": "0.0.0",
|
|
41
|
+
"jest": "^27",
|
|
42
|
+
"@scripts/jest-config": "0.0.0"
|
|
41
43
|
},
|
|
42
44
|
"sideEffects": false,
|
|
43
45
|
"publishConfig": {
|
|
44
46
|
"registry": "https://registry.npmjs.org/",
|
|
45
|
-
"access": "public"
|
|
47
|
+
"access": "public",
|
|
48
|
+
"types": "./dist/types/index.d.ts"
|
|
46
49
|
},
|
|
47
50
|
"scripts": {
|
|
48
51
|
"new": "modern new",
|
|
49
52
|
"build": "modern build",
|
|
50
|
-
"test": "
|
|
51
|
-
}
|
|
53
|
+
"test": "jest --passWithNoTests"
|
|
54
|
+
},
|
|
55
|
+
"readme": "\n<p align=\"center\">\n <a href=\"https://modernjs.dev\" target=\"blank\"><img src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png\" width=\"300\" alt=\"Modern.js Logo\" /></a>\n</p>\n<p align=\"center\">\n现代 Web 工程体系\n <br/>\n <a href=\"https://modernjs.dev\" target=\"blank\">\n modernjs.dev\n </a>\n</p>\n<p align=\"center\">\n The meta-framework suite designed from scratch for frontend-focused modern web development\n</p>\n\n# Introduction\n\n> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.\n\n- [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)\n\n## Getting Started\n\n- [Quick Start](https://modernjs.dev/docs/start)\n- [Guides](https://modernjs.dev/docs/guides)\n- [API References](https://modernjs.dev/docs/apis)\n\n## Contributing\n\n- [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)\n"
|
|
52
56
|
}
|
package/tests/index.test.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getMWANewCases,
|
|
6
6
|
getModuleNewCases,
|
|
7
7
|
getMonorepoNewCases,
|
|
8
|
-
} from '
|
|
8
|
+
} from '../src';
|
|
9
9
|
|
|
10
10
|
describe('test generator cases', () => {
|
|
11
11
|
test('test getMWACases', async () => {
|
|
@@ -22,7 +22,7 @@ describe('test generator cases', () => {
|
|
|
22
22
|
});
|
|
23
23
|
test('test getMWANewCases', async () => {
|
|
24
24
|
const mwaNewCases = getMWANewCases();
|
|
25
|
-
expect(mwaNewCases.length).toBe(
|
|
25
|
+
expect(mwaNewCases.length).toBe(25);
|
|
26
26
|
});
|
|
27
27
|
test('test getModuleNewCases', async () => {
|
|
28
28
|
const moduleNewCases = getModuleNewCases();
|
package/tests/tsconfig.json
CHANGED
package/tsconfig.json
CHANGED
package/src/index.ts
DELETED
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
import make from 'covertable';
|
|
2
|
-
import {
|
|
3
|
-
Solution,
|
|
4
|
-
PackageManager,
|
|
5
|
-
Language,
|
|
6
|
-
RunWay,
|
|
7
|
-
BooleanConfig,
|
|
8
|
-
ClientRoute,
|
|
9
|
-
MWAActionTypes,
|
|
10
|
-
MWAActionTypesMap,
|
|
11
|
-
Framework,
|
|
12
|
-
BFFType,
|
|
13
|
-
ActionElement,
|
|
14
|
-
ActionFunction,
|
|
15
|
-
ModuleActionTypes,
|
|
16
|
-
ModuleActionTypesMap,
|
|
17
|
-
SubSolution,
|
|
18
|
-
CDNType,
|
|
19
|
-
LambdaType,
|
|
20
|
-
} from '@modern-js/generator-common';
|
|
21
|
-
|
|
22
|
-
export const LanguageValues = Object.values(Language);
|
|
23
|
-
export const PackageManagerValues = Object.values(PackageManager);
|
|
24
|
-
export const RunWayValues = Object.values(RunWay);
|
|
25
|
-
export const BooleanConfigValues = Object.values(BooleanConfig);
|
|
26
|
-
export const ClientRouteValues = Object.values(ClientRoute);
|
|
27
|
-
export const FrameworkValues = Object.values(Framework);
|
|
28
|
-
export const BFFTypeValues = Object.values(BFFType);
|
|
29
|
-
export const CDNTypeValues = Object.values(CDNType);
|
|
30
|
-
export const LambdaTypeValues = Object.values(LambdaType);
|
|
31
|
-
|
|
32
|
-
export const MWAValueMap: Record<string, string[]> = {
|
|
33
|
-
language: LanguageValues,
|
|
34
|
-
packageManager: PackageManagerValues,
|
|
35
|
-
runWay: RunWayValues,
|
|
36
|
-
needModifyMWAConfig: BooleanConfigValues,
|
|
37
|
-
clientRoute: ClientRouteValues,
|
|
38
|
-
disableStateManagement: BooleanConfigValues,
|
|
39
|
-
enableLess: BooleanConfigValues,
|
|
40
|
-
enableSass: BooleanConfigValues,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const ModuleValueMap: Record<string, string[]> = {
|
|
44
|
-
language: LanguageValues,
|
|
45
|
-
packageManager: PackageManagerValues,
|
|
46
|
-
needModifyModuleConfig: BooleanConfigValues,
|
|
47
|
-
enableLess: BooleanConfigValues,
|
|
48
|
-
enableSass: BooleanConfigValues,
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const MonorepoValueMap: Record<string, string[]> = {
|
|
52
|
-
packageManager: PackageManagerValues,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export const getMWACases = (length?: number) => {
|
|
56
|
-
const cases = make(MWAValueMap, {
|
|
57
|
-
length: length || Object.keys(MWAValueMap).length,
|
|
58
|
-
postFilter: (row: Record<string, any>) => {
|
|
59
|
-
if (
|
|
60
|
-
row.needModifyMWAConfig === BooleanConfig.NO &&
|
|
61
|
-
(row.disableStateManagement !== BooleanConfig.NO ||
|
|
62
|
-
row.clientRoute !== ClientRoute.SelfControlRoute ||
|
|
63
|
-
row.enableLess !== BooleanConfig.NO ||
|
|
64
|
-
row.enableSass !== BooleanConfig.NO)
|
|
65
|
-
) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
return true;
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
return cases.map(item => ({
|
|
72
|
-
...item,
|
|
73
|
-
solution: Solution.MWA,
|
|
74
|
-
}));
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const getModuleCases = (length?: number) => {
|
|
78
|
-
const cases = make(ModuleValueMap, {
|
|
79
|
-
length: length || Object.keys(ModuleValueMap).length,
|
|
80
|
-
postFilter: (row: Record<string, any>) => {
|
|
81
|
-
if (
|
|
82
|
-
row.needModifyModuleConfig === BooleanConfig.NO &&
|
|
83
|
-
(row.enableLess !== BooleanConfig.NO ||
|
|
84
|
-
row.enableSass !== BooleanConfig.NO)
|
|
85
|
-
) {
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
return true;
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
return cases.map(item => ({
|
|
92
|
-
...item,
|
|
93
|
-
solution: Solution.Module,
|
|
94
|
-
}));
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export const getMonorepoCases = () => {
|
|
98
|
-
const cases = make(MonorepoValueMap, {
|
|
99
|
-
length: Object.keys(MonorepoValueMap).length,
|
|
100
|
-
});
|
|
101
|
-
return cases.map(item => ({
|
|
102
|
-
...item,
|
|
103
|
-
solution: Solution.Monorepo,
|
|
104
|
-
}));
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export const MWAEntryValueMap: Record<string, string[]> = {
|
|
108
|
-
needModifyMWAConfig: BooleanConfigValues,
|
|
109
|
-
clientRoute: ClientRouteValues,
|
|
110
|
-
disableStateManagement: BooleanConfigValues,
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const getMWAEntryCases = (length?: number) => {
|
|
114
|
-
const cases = make(MWAEntryValueMap, {
|
|
115
|
-
length: length || Object.keys(MWAEntryValueMap).length,
|
|
116
|
-
});
|
|
117
|
-
return cases.map(item => ({
|
|
118
|
-
...item,
|
|
119
|
-
name: Object.values(item).join('-'),
|
|
120
|
-
}));
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
export const MWAServerValueMap: Record<string, string[]> = {
|
|
124
|
-
framework: FrameworkValues,
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const getMWAServerCases = () =>
|
|
128
|
-
make(MWAServerValueMap, {
|
|
129
|
-
length: Object.keys(MWAServerValueMap).length,
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
export const MWABFFValueMap: Record<string, string[]> = {
|
|
133
|
-
bffType: BFFTypeValues,
|
|
134
|
-
framework: FrameworkValues,
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
export const MWADeployValueMap: Record<string, string[]> = {
|
|
138
|
-
disableModernServer: BooleanConfigValues,
|
|
139
|
-
cdnType: CDNTypeValues,
|
|
140
|
-
lambdaType: LambdaTypeValues,
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
const getMWABFFCases = (length?: number) =>
|
|
144
|
-
make(MWABFFValueMap, {
|
|
145
|
-
length: length || Object.keys(MWABFFValueMap).length,
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
const getMWADeployCases = (length?: number) =>
|
|
149
|
-
make(MWADeployValueMap, {
|
|
150
|
-
length: length || Object.keys(MWADeployValueMap).length,
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
export const getMWANewCases = (length?: number) => {
|
|
154
|
-
const cases: Array<Record<string, string>> = [];
|
|
155
|
-
MWAActionTypes.forEach(action => {
|
|
156
|
-
const config: Record<string, any> = { actionType: action };
|
|
157
|
-
MWAActionTypesMap[action].forEach(option => {
|
|
158
|
-
config[action] = option;
|
|
159
|
-
const currentConfig = { ...config, [action]: option };
|
|
160
|
-
if (option === ActionElement.Entry) {
|
|
161
|
-
const entryCases = getMWAEntryCases(length);
|
|
162
|
-
entryCases.forEach(c => {
|
|
163
|
-
cases.push({ ...currentConfig, ...c });
|
|
164
|
-
});
|
|
165
|
-
} else if (option === ActionElement.Server) {
|
|
166
|
-
// server only can enable once
|
|
167
|
-
const serverCases = getMWAServerCases();
|
|
168
|
-
cases.push({
|
|
169
|
-
...currentConfig,
|
|
170
|
-
...serverCases[Math.round(Math.random() * serverCases.length)],
|
|
171
|
-
});
|
|
172
|
-
} else if (option === ActionFunction.BFF) {
|
|
173
|
-
// bff only can enable once
|
|
174
|
-
const bffCases = getMWABFFCases(length);
|
|
175
|
-
cases.push({
|
|
176
|
-
...currentConfig,
|
|
177
|
-
...bffCases[Math.round(Math.random() * bffCases.length)],
|
|
178
|
-
});
|
|
179
|
-
} else if (option === ActionFunction.Deploy) {
|
|
180
|
-
// deploy only can enable once
|
|
181
|
-
const deployCases = getMWADeployCases(length);
|
|
182
|
-
cases.push({
|
|
183
|
-
...currentConfig,
|
|
184
|
-
...deployCases[Math.round(Math.random() * deployCases.length)],
|
|
185
|
-
});
|
|
186
|
-
} else {
|
|
187
|
-
cases.push(currentConfig);
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
});
|
|
191
|
-
return cases;
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
export const getModuleNewCases = () => {
|
|
195
|
-
const cases: Array<Record<string, string>> = [];
|
|
196
|
-
ModuleActionTypes.forEach(action => {
|
|
197
|
-
const config: Record<string, any> = { actionType: action };
|
|
198
|
-
ModuleActionTypesMap[action].forEach(option => {
|
|
199
|
-
const currentConfig = { ...config, [action]: option };
|
|
200
|
-
cases.push(currentConfig);
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
return cases;
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
export const MWASubProjectValueMap: Record<string, string[]> = {
|
|
207
|
-
language: LanguageValues,
|
|
208
|
-
needModifyMWAConfig: BooleanConfigValues,
|
|
209
|
-
runWay: RunWayValues,
|
|
210
|
-
clientRoute: ClientRouteValues,
|
|
211
|
-
disableStateManagement: BooleanConfigValues,
|
|
212
|
-
enableLess: BooleanConfigValues,
|
|
213
|
-
enableSass: BooleanConfigValues,
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
export const ModuleSubProjectValueMap: Record<string, string[]> = {
|
|
217
|
-
language: LanguageValues,
|
|
218
|
-
needModifyModuleConfig: BooleanConfigValues,
|
|
219
|
-
enableLess: BooleanConfigValues,
|
|
220
|
-
enableSass: BooleanConfigValues,
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
const getMWASubProjectCases = (isTest: boolean, length?: number) => {
|
|
224
|
-
const cases = make(MWASubProjectValueMap, {
|
|
225
|
-
length: length || Object.keys(MWASubProjectValueMap).length,
|
|
226
|
-
postFilter: (row: Record<string, any>) => {
|
|
227
|
-
if (
|
|
228
|
-
row.needModifyMWAConfig === BooleanConfig.NO &&
|
|
229
|
-
(row.disableStateManagement !== BooleanConfig.NO ||
|
|
230
|
-
row.clientRoute !== ClientRoute.SelfControlRoute ||
|
|
231
|
-
row.enableLess !== BooleanConfig.NO ||
|
|
232
|
-
row.enableSass !== BooleanConfig.NO)
|
|
233
|
-
) {
|
|
234
|
-
return false;
|
|
235
|
-
}
|
|
236
|
-
return true;
|
|
237
|
-
},
|
|
238
|
-
});
|
|
239
|
-
return cases.map(item => ({
|
|
240
|
-
...item,
|
|
241
|
-
packageName: Object.values(item).join('-'),
|
|
242
|
-
packagePath: Object.values(item).join('-'),
|
|
243
|
-
solution: isTest ? SubSolution.MWATest : SubSolution.MWA,
|
|
244
|
-
}));
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
const getModuleSubProjectCases = (isInner: boolean, length?: number) => {
|
|
248
|
-
const cases = make(ModuleSubProjectValueMap, {
|
|
249
|
-
length: length || Object.keys(ModuleSubProjectValueMap).length,
|
|
250
|
-
postFilter: (row: Record<string, any>) => {
|
|
251
|
-
if (
|
|
252
|
-
row.needModifyModuleConfig === BooleanConfig.NO &&
|
|
253
|
-
(row.enableLess !== BooleanConfig.NO ||
|
|
254
|
-
row.enableSass !== BooleanConfig.NO)
|
|
255
|
-
) {
|
|
256
|
-
return false;
|
|
257
|
-
}
|
|
258
|
-
return true;
|
|
259
|
-
},
|
|
260
|
-
});
|
|
261
|
-
return cases.map(item => ({
|
|
262
|
-
...item,
|
|
263
|
-
packageName: Object.values(item).join('-'),
|
|
264
|
-
packagePath: Object.values(item).join('-'),
|
|
265
|
-
solution: isInner ? SubSolution.InnerModule : SubSolution.Module,
|
|
266
|
-
}));
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
export const getMonorepoNewCases = (length?: number) => {
|
|
270
|
-
const cases: Array<Record<string, string>> = [
|
|
271
|
-
...getMWASubProjectCases(false, length),
|
|
272
|
-
...getMWASubProjectCases(true, length),
|
|
273
|
-
...getModuleSubProjectCases(false, length),
|
|
274
|
-
...getModuleSubProjectCases(true, length),
|
|
275
|
-
];
|
|
276
|
-
return cases;
|
|
277
|
-
};
|