@modern-js/generator-cases 3.0.7-beta.0 → 3.0.8

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,10 +1,26 @@
1
1
  # @modern-js/generator-cases
2
2
 
3
- ## 3.0.7-beta.0
3
+ ## 3.0.8
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - @modern-js/generator-common@3.0.7-beta.0
7
+ - Updated dependencies [b2ea17b]
8
+ - @modern-js/generator-common@3.0.8
9
+
10
+ ## 3.0.7
11
+
12
+ ### Patch Changes
13
+
14
+ - 89ca6cc: refactor: merge build-config into scripts/build
15
+
16
+ refactor: 把 build-config 合并进 scripts/build
17
+
18
+ - 30614fa: chore: modify package.json entry fields and build config
19
+ chore: 更改 package.json entry 字段以及构建配置
20
+ - Updated dependencies [89ca6cc]
21
+ - Updated dependencies [30614fa]
22
+ - Updated dependencies [577084d]
23
+ - @modern-js/generator-common@3.0.7
8
24
 
9
25
  ## 3.0.6
10
26
 
@@ -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 });
@@ -34,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
34
17
  return to;
35
18
  };
36
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
37
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
38
25
  mod
39
26
  ));
@@ -42,6 +29,7 @@ var src_exports = {};
42
29
  __export(src_exports, {
43
30
  BFFTypeValues: () => BFFTypeValues,
44
31
  BooleanConfigValues: () => BooleanConfigValues,
32
+ BuildToolsValues: () => BuildToolsValues,
45
33
  FrameworkValues: () => FrameworkValues,
46
34
  LanguageValues: () => LanguageValues,
47
35
  MWABFFValueMap: () => MWABFFValueMap,
@@ -67,9 +55,11 @@ const PackageManagerValues = Object.values(import_generator_common.PackageManage
67
55
  const BooleanConfigValues = Object.values(import_generator_common.BooleanConfig);
68
56
  const FrameworkValues = Object.values(import_generator_common.Framework);
69
57
  const BFFTypeValues = Object.values(import_generator_common.BFFType);
58
+ const BuildToolsValues = Object.values(import_generator_common.BuildTools);
70
59
  const MWAValueMap = {
71
60
  language: LanguageValues,
72
- packageManager: PackageManagerValues
61
+ packageManager: PackageManagerValues,
62
+ buildTools: BuildToolsValues
73
63
  };
74
64
  const ModuleValueMap = {
75
65
  language: LanguageValues,
@@ -84,7 +74,8 @@ const getMWACases = (length) => {
84
74
  const cases = (0, import_covertable.default)(MWAValueMap, {
85
75
  length: length || Object.keys(MWAValueMap).length
86
76
  });
87
- return cases.map((item) => __spreadProps(__spreadValues({}, item), {
77
+ return cases.map((item) => ({
78
+ ...item,
88
79
  solution: import_generator_common.Solution.MWA
89
80
  }));
90
81
  };
@@ -92,7 +83,8 @@ const getModuleCases = (length) => {
92
83
  const cases = (0, import_covertable.default)(ModuleValueMap, {
93
84
  length: length || Object.keys(ModuleValueMap).length
94
85
  });
95
- return cases.map((item) => __spreadProps(__spreadValues({}, item), {
86
+ return cases.map((item) => ({
87
+ ...item,
96
88
  solution: import_generator_common.Solution.Module
97
89
  }));
98
90
  };
@@ -100,7 +92,8 @@ const getMonorepoCases = () => {
100
92
  const cases = (0, import_covertable.default)(MonorepoValueMap, {
101
93
  length: Object.keys(MonorepoValueMap).length
102
94
  });
103
- return cases.map((item) => __spreadProps(__spreadValues({}, item), {
95
+ return cases.map((item) => ({
96
+ ...item,
104
97
  solution: import_generator_common.Solution.Monorepo
105
98
  }));
106
99
  };
@@ -130,18 +123,24 @@ const getMWANewCases = (length) => {
130
123
  const config = { actionType: action };
131
124
  import_generator_common.MWAActionTypesMap[action].forEach((option) => {
132
125
  config[action] = option;
133
- const currentConfig = __spreadProps(__spreadValues({}, config), { [action]: option });
126
+ const currentConfig = { ...config, [action]: option };
134
127
  if (option === import_generator_common.ActionElement.Entry) {
135
128
  const entryCases = getMWAEntryCases(length);
136
129
  entryCases.forEach((c) => {
137
- cases.push(__spreadValues(__spreadValues({}, currentConfig), c));
130
+ cases.push({ ...currentConfig, ...c });
138
131
  });
139
132
  } else if (option === import_generator_common.ActionElement.Server) {
140
133
  const serverCases = getMWAServerCases();
141
- cases.push(__spreadValues(__spreadValues({}, currentConfig), serverCases[Math.round(Math.random() * serverCases.length)]));
134
+ cases.push({
135
+ ...currentConfig,
136
+ ...serverCases[Math.round(Math.random() * serverCases.length)]
137
+ });
142
138
  } else if (option === import_generator_common.ActionFunction.BFF) {
143
139
  const bffCases = getMWABFFCases(length);
144
- cases.push(__spreadValues(__spreadValues({}, currentConfig), bffCases[Math.round(Math.random() * bffCases.length)]));
140
+ cases.push({
141
+ ...currentConfig,
142
+ ...bffCases[Math.round(Math.random() * bffCases.length)]
143
+ });
145
144
  } else {
146
145
  cases.push(currentConfig);
147
146
  }
@@ -154,7 +153,7 @@ const getModuleNewCases = () => {
154
153
  import_generator_common.ModuleActionTypes.forEach((action) => {
155
154
  const config = { actionType: action };
156
155
  import_generator_common.ModuleActionTypesMap[action].forEach((option) => {
157
- const currentConfig = __spreadProps(__spreadValues({}, config), { [action]: option });
156
+ const currentConfig = { ...config, [action]: option };
158
157
  cases.push(currentConfig);
159
158
  });
160
159
  });
@@ -170,7 +169,8 @@ const getMWASubProjectCases = (isTest, length) => {
170
169
  const cases = (0, import_covertable.default)(MWASubProjectValueMap, {
171
170
  length: length || Object.keys(MWASubProjectValueMap).length
172
171
  });
173
- return cases.map((item) => __spreadProps(__spreadValues({}, item), {
172
+ return cases.map((item) => ({
173
+ ...item,
174
174
  packageName: Object.values(item).join("-"),
175
175
  packagePath: Object.values(item).join("-"),
176
176
  solution: isTest ? import_generator_common.SubSolution.MWATest : import_generator_common.SubSolution.MWA
@@ -180,7 +180,8 @@ const getModuleSubProjectCases = (isInner, length) => {
180
180
  const cases = (0, import_covertable.default)(ModuleSubProjectValueMap, {
181
181
  length: length || Object.keys(ModuleSubProjectValueMap).length
182
182
  });
183
- return cases.map((item) => __spreadProps(__spreadValues({}, item), {
183
+ return cases.map((item) => ({
184
+ ...item,
184
185
  packageName: Object.values(item).join("-"),
185
186
  packagePath: Object.values(item).join("-"),
186
187
  solution: isInner ? import_generator_common.SubSolution.InnerModule : import_generator_common.SubSolution.Module
@@ -199,6 +200,7 @@ const getMonorepoNewCases = (length) => {
199
200
  0 && (module.exports = {
200
201
  BFFTypeValues,
201
202
  BooleanConfigValues,
203
+ BuildToolsValues,
202
204
  FrameworkValues,
203
205
  LanguageValues,
204
206
  MWABFFValueMap,
@@ -76,15 +76,17 @@ function _unsupportedIterableToArray(o, minLen) {
76
76
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
77
77
  }
78
78
  import make from "covertable";
79
- import { Solution, PackageManager, Language, BooleanConfig, MWAActionTypes, MWAActionTypesMap, Framework, BFFType, ActionElement, ActionFunction, ModuleActionTypes, ModuleActionTypesMap, SubSolution } from "@modern-js/generator-common";
79
+ import { Solution, PackageManager, Language, BooleanConfig, MWAActionTypes, MWAActionTypesMap, Framework, BFFType, ActionElement, ActionFunction, ModuleActionTypes, ModuleActionTypesMap, SubSolution, BuildTools } from "@modern-js/generator-common";
80
80
  var LanguageValues = Object.values(Language);
81
81
  var PackageManagerValues = Object.values(PackageManager);
82
82
  var BooleanConfigValues = Object.values(BooleanConfig);
83
83
  var FrameworkValues = Object.values(Framework);
84
84
  var BFFTypeValues = Object.values(BFFType);
85
+ var BuildToolsValues = Object.values(BuildTools);
85
86
  var MWAValueMap = {
86
87
  language: LanguageValues,
87
- packageManager: PackageManagerValues
88
+ packageManager: PackageManagerValues,
89
+ buildTools: BuildToolsValues
88
90
  };
89
91
  var ModuleValueMap = {
90
92
  language: LanguageValues,
@@ -223,4 +225,4 @@ var getMonorepoNewCases = function(length) {
223
225
  var cases = _toConsumableArray(getMWASubProjectCases(false, length)).concat(_toConsumableArray(getMWASubProjectCases(true, length)), _toConsumableArray(getModuleSubProjectCases(false, length)), _toConsumableArray(getModuleSubProjectCases(true, length)));
224
226
  return cases;
225
227
  };
226
- export { BFFTypeValues, BooleanConfigValues, FrameworkValues, LanguageValues, MWABFFValueMap, MWAServerValueMap, MWASubProjectValueMap, MWAValueMap, ModuleSubProjectValueMap, ModuleValueMap, MonorepoValueMap, PackageManagerValues, getMWACases, getMWANewCases, getModuleCases, getModuleNewCases, getMonorepoCases, getMonorepoNewCases };
228
+ export { BFFTypeValues, BooleanConfigValues, BuildToolsValues, FrameworkValues, LanguageValues, MWABFFValueMap, MWAServerValueMap, MWASubProjectValueMap, MWAValueMap, ModuleSubProjectValueMap, ModuleValueMap, MonorepoValueMap, PackageManagerValues, getMWACases, getMWANewCases, getModuleCases, getModuleNewCases, getMonorepoCases, getMonorepoNewCases };
@@ -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,
@@ -31,16 +12,19 @@ import {
31
12
  ActionFunction,
32
13
  ModuleActionTypes,
33
14
  ModuleActionTypesMap,
34
- SubSolution
15
+ SubSolution,
16
+ BuildTools
35
17
  } from "@modern-js/generator-common";
36
18
  const LanguageValues = Object.values(Language);
37
19
  const PackageManagerValues = Object.values(PackageManager);
38
20
  const BooleanConfigValues = Object.values(BooleanConfig);
39
21
  const FrameworkValues = Object.values(Framework);
40
22
  const BFFTypeValues = Object.values(BFFType);
23
+ const BuildToolsValues = Object.values(BuildTools);
41
24
  const MWAValueMap = {
42
25
  language: LanguageValues,
43
- packageManager: PackageManagerValues
26
+ packageManager: PackageManagerValues,
27
+ buildTools: BuildToolsValues
44
28
  };
45
29
  const ModuleValueMap = {
46
30
  language: LanguageValues,
@@ -55,7 +39,8 @@ const getMWACases = (length) => {
55
39
  const cases = make(MWAValueMap, {
56
40
  length: length || Object.keys(MWAValueMap).length
57
41
  });
58
- return cases.map((item) => __spreadProps(__spreadValues({}, item), {
42
+ return cases.map((item) => ({
43
+ ...item,
59
44
  solution: Solution.MWA
60
45
  }));
61
46
  };
@@ -63,7 +48,8 @@ const getModuleCases = (length) => {
63
48
  const cases = make(ModuleValueMap, {
64
49
  length: length || Object.keys(ModuleValueMap).length
65
50
  });
66
- return cases.map((item) => __spreadProps(__spreadValues({}, item), {
51
+ return cases.map((item) => ({
52
+ ...item,
67
53
  solution: Solution.Module
68
54
  }));
69
55
  };
@@ -71,7 +57,8 @@ const getMonorepoCases = () => {
71
57
  const cases = make(MonorepoValueMap, {
72
58
  length: Object.keys(MonorepoValueMap).length
73
59
  });
74
- return cases.map((item) => __spreadProps(__spreadValues({}, item), {
60
+ return cases.map((item) => ({
61
+ ...item,
75
62
  solution: Solution.Monorepo
76
63
  }));
77
64
  };
@@ -101,18 +88,24 @@ const getMWANewCases = (length) => {
101
88
  const config = { actionType: action };
102
89
  MWAActionTypesMap[action].forEach((option) => {
103
90
  config[action] = option;
104
- const currentConfig = __spreadProps(__spreadValues({}, config), { [action]: option });
91
+ const currentConfig = { ...config, [action]: option };
105
92
  if (option === ActionElement.Entry) {
106
93
  const entryCases = getMWAEntryCases(length);
107
94
  entryCases.forEach((c) => {
108
- cases.push(__spreadValues(__spreadValues({}, currentConfig), c));
95
+ cases.push({ ...currentConfig, ...c });
109
96
  });
110
97
  } else if (option === ActionElement.Server) {
111
98
  const serverCases = getMWAServerCases();
112
- cases.push(__spreadValues(__spreadValues({}, currentConfig), serverCases[Math.round(Math.random() * serverCases.length)]));
99
+ cases.push({
100
+ ...currentConfig,
101
+ ...serverCases[Math.round(Math.random() * serverCases.length)]
102
+ });
113
103
  } else if (option === ActionFunction.BFF) {
114
104
  const bffCases = getMWABFFCases(length);
115
- cases.push(__spreadValues(__spreadValues({}, currentConfig), bffCases[Math.round(Math.random() * bffCases.length)]));
105
+ cases.push({
106
+ ...currentConfig,
107
+ ...bffCases[Math.round(Math.random() * bffCases.length)]
108
+ });
116
109
  } else {
117
110
  cases.push(currentConfig);
118
111
  }
@@ -125,7 +118,7 @@ const getModuleNewCases = () => {
125
118
  ModuleActionTypes.forEach((action) => {
126
119
  const config = { actionType: action };
127
120
  ModuleActionTypesMap[action].forEach((option) => {
128
- const currentConfig = __spreadProps(__spreadValues({}, config), { [action]: option });
121
+ const currentConfig = { ...config, [action]: option };
129
122
  cases.push(currentConfig);
130
123
  });
131
124
  });
@@ -141,7 +134,8 @@ const getMWASubProjectCases = (isTest, length) => {
141
134
  const cases = make(MWASubProjectValueMap, {
142
135
  length: length || Object.keys(MWASubProjectValueMap).length
143
136
  });
144
- return cases.map((item) => __spreadProps(__spreadValues({}, item), {
137
+ return cases.map((item) => ({
138
+ ...item,
145
139
  packageName: Object.values(item).join("-"),
146
140
  packagePath: Object.values(item).join("-"),
147
141
  solution: isTest ? SubSolution.MWATest : SubSolution.MWA
@@ -151,7 +145,8 @@ const getModuleSubProjectCases = (isInner, length) => {
151
145
  const cases = make(ModuleSubProjectValueMap, {
152
146
  length: length || Object.keys(ModuleSubProjectValueMap).length
153
147
  });
154
- return cases.map((item) => __spreadProps(__spreadValues({}, item), {
148
+ return cases.map((item) => ({
149
+ ...item,
155
150
  packageName: Object.values(item).join("-"),
156
151
  packagePath: Object.values(item).join("-"),
157
152
  solution: isInner ? SubSolution.InnerModule : SubSolution.Module
@@ -169,6 +164,7 @@ const getMonorepoNewCases = (length) => {
169
164
  export {
170
165
  BFFTypeValues,
171
166
  BooleanConfigValues,
167
+ BuildToolsValues,
172
168
  FrameworkValues,
173
169
  LanguageValues,
174
170
  MWABFFValueMap,
@@ -1,9 +1,10 @@
1
- import { Solution, PackageManager, Language, BooleanConfig, Framework, BFFType } from '@modern-js/generator-common';
1
+ import { Solution, PackageManager, Language, BooleanConfig, Framework, BFFType, BuildTools } from '@modern-js/generator-common';
2
2
  export declare const LanguageValues: Language[];
3
3
  export declare const PackageManagerValues: PackageManager[];
4
4
  export declare const BooleanConfigValues: BooleanConfig[];
5
5
  export declare const FrameworkValues: Framework[];
6
6
  export declare const BFFTypeValues: BFFType[];
7
+ export declare const BuildToolsValues: BuildTools[];
7
8
  export declare const MWAValueMap: Record<string, string[]>;
8
9
  export declare const ModuleValueMap: Record<string, string[]>;
9
10
  export declare const MonorepoValueMap: Record<string, string[]>;
package/package.json CHANGED
@@ -11,34 +11,33 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "3.0.7-beta.0",
14
+ "version": "3.0.8",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
- "main": "./dist/js/node/index.js",
18
- "module": "./dist/js/treeshaking/index.js",
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/js/modern/index.js",
25
- "require": "./dist/js/node/index.js"
23
+ "import": "./dist/esm-node/index.js",
24
+ "require": "./dist/cjs/index.js"
26
25
  },
27
- "default": "./dist/js/treeshaking/index.js"
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.7-beta.0"
32
+ "@modern-js/generator-common": "3.0.8"
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/jest-config": "2.4.0",
41
- "@scripts/build": "2.4.0"
39
+ "@scripts/build": "2.6.0",
40
+ "@scripts/jest-config": "2.6.0"
42
41
  },
43
42
  "sideEffects": false,
44
43
  "publishConfig": {