@modern-js/packages-generator 3.0.10 → 3.1.0

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.
Files changed (3) hide show
  1. package/LICENSE +68 -16
  2. package/dist/index.js +139 -1
  3. package/package.json +7 -7
package/LICENSE CHANGED
@@ -21,13 +21,37 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
22
 
23
23
 
24
- The code implementation modified from external library are:
24
+ The code implementation modified from external library are:
25
25
 
26
- - vite
26
+ - bundle-require
27
+
28
+ The MIT License (MIT)
29
+
30
+ Copyright © 2021 EGOIST (https://github.com/sponsors/egoist)
31
+
32
+ Permission is hereby granted, free of charge, to any person obtaining a copy
33
+ of this software and associated documentation files (the "Software"), to deal
34
+ in the Software without restriction, including without limitation the rights
35
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
36
+ copies of the Software, and to permit persons to whom the Software is
37
+ furnished to do so, subject to the following conditions:
38
+
39
+ The above copyright notice and this permission notice shall be included in all
40
+ copies or substantial portions of the Software.
41
+
42
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
46
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
47
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
48
+ SOFTWARE
49
+
50
+ - react-dev-utils
27
51
 
28
52
  MIT License
29
53
 
30
- Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
54
+ Copyright (c) 2013-present, Facebook, Inc.
31
55
 
32
56
  Permission is hereby granted, free of charge, to any person obtaining a copy
33
57
  of this software and associated documentation files (the "Software"), to deal
@@ -47,11 +71,11 @@ The code implementation modified from external library are:
47
71
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
48
72
  SOFTWARE.
49
73
 
50
- - wmr
74
+ - jest-cli
51
75
 
52
76
  MIT License
53
77
 
54
- Copyright (c) 2020 The Preact Authors
78
+ Copyright (c) Facebook, Inc. and its affiliates.
55
79
 
56
80
  Permission is hereby granted, free of charge, to any person obtaining a copy
57
81
  of this software and associated documentation files (the "Software"), to deal
@@ -71,11 +95,11 @@ The code implementation modified from external library are:
71
95
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
72
96
  SOFTWARE.
73
97
 
74
- - bundle-require
98
+ - vitepress
75
99
 
76
- The MIT License (MIT)
100
+ MIT License
77
101
 
78
- Copyright © 2021 EGOIST (https://github.com/sponsors/egoist)
102
+ Copyright (c) 2019-present, Yuxi (Evan) You
79
103
 
80
104
  Permission is hereby granted, free of charge, to any person obtaining a copy
81
105
  of this software and associated documentation files (the "Software"), to deal
@@ -93,13 +117,13 @@ The code implementation modified from external library are:
93
117
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
94
118
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
95
119
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
96
- SOFTWARE
120
+ SOFTWARE.
97
121
 
98
- - react-dev-utils
122
+ - Remix
99
123
 
100
124
  MIT License
101
125
 
102
- Copyright (c) 2013-present, Facebook, Inc.
126
+ Copyright 2021 Remix Software Inc.
103
127
 
104
128
  Permission is hereby granted, free of charge, to any person obtaining a copy
105
129
  of this software and associated documentation files (the "Software"), to deal
@@ -119,11 +143,11 @@ The code implementation modified from external library are:
119
143
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
120
144
  SOFTWARE.
121
145
 
122
- - jest-cli
146
+ - tsconfig-paths-webpack-plugin
123
147
 
124
- MIT License
148
+ The MIT License (MIT)
125
149
 
126
- Copyright (c) Facebook, Inc. and its affiliates.
150
+ Copyright (c) 2016 Jonas Kello
127
151
 
128
152
  Permission is hereby granted, free of charge, to any person obtaining a copy
129
153
  of this software and associated documentation files (the "Software"), to deal
@@ -143,11 +167,11 @@ The code implementation modified from external library are:
143
167
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
144
168
  SOFTWARE.
145
169
 
146
- - Remix
170
+ - midwayjs/hooks
147
171
 
148
172
  MIT License
149
173
 
150
- Copyright 2021 Remix Software Inc.
174
+ Copyright (c) 2013 - Now midwayjs
151
175
 
152
176
  Permission is hereby granted, free of charge, to any person obtaining a copy
153
177
  of this software and associated documentation files (the "Software"), to deal
@@ -166,3 +190,31 @@ The code implementation modified from external library are:
166
190
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
167
191
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
168
192
  SOFTWARE.
193
+
194
+ - nest
195
+
196
+ (The MIT License)
197
+
198
+ Copyright (c) 2017-2023 Kamil Mysliwiec <https://kamilmysliwiec.com>
199
+
200
+ Permission is hereby granted, free of charge, to any person obtaining
201
+ a copy of this software and associated documentation files (the
202
+ 'Software'), to deal in the Software without restriction, including
203
+ without limitation the rights to use, copy, modify, merge, publish,
204
+ distribute, sublicense, and/or sell copies of the Software, and to
205
+ permit persons to whom the Software is furnished to do so, subject to
206
+ the following conditions:
207
+
208
+ The above copyright notice and this permission notice shall be
209
+ included in all copies or substantial portions of the Software.
210
+
211
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
212
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
213
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
214
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
215
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
216
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
217
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
218
+
219
+
220
+
package/dist/index.js CHANGED
@@ -137598,7 +137598,7 @@ var require_format2 = __commonJS({
137598
137598
  if (typeof stats === "object") {
137599
137599
  const fileName = stats.moduleName ? `File: ${stats.moduleName}
137600
137600
  ` : "";
137601
- const mainMessage = stats.message;
137601
+ const mainMessage = typeof stats.formatted === "string" ? stats.formatted : stats.message;
137602
137602
  const details = stats.details ? `
137603
137603
  Details: ${stats.details}
137604
137604
  ` : "";
@@ -140959,6 +140959,143 @@ var require_getTargetDir = __commonJS({
140959
140959
  }
140960
140960
  });
140961
140961
 
140962
+ // ../../../toolkit/utils/dist/babel.js
140963
+ var require_babel = __commonJS({
140964
+ "../../../toolkit/utils/dist/babel.js"(exports, module2) {
140965
+ var __defProp2 = Object.defineProperty;
140966
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
140967
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
140968
+ var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
140969
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
140970
+ var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
140971
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
140972
+ var __spreadValues2 = (a, b) => {
140973
+ for (var prop in b || (b = {}))
140974
+ if (__hasOwnProp2.call(b, prop))
140975
+ __defNormalProp2(a, prop, b[prop]);
140976
+ if (__getOwnPropSymbols2)
140977
+ for (var prop of __getOwnPropSymbols2(b)) {
140978
+ if (__propIsEnum2.call(b, prop))
140979
+ __defNormalProp2(a, prop, b[prop]);
140980
+ }
140981
+ return a;
140982
+ };
140983
+ var __export2 = (target, all) => {
140984
+ for (var name in all)
140985
+ __defProp2(target, name, { get: all[name], enumerable: true });
140986
+ };
140987
+ var __copyProps2 = (to, from, except, desc) => {
140988
+ if (from && typeof from === "object" || typeof from === "function") {
140989
+ for (let key of __getOwnPropNames2(from))
140990
+ if (!__hasOwnProp2.call(to, key) && key !== except)
140991
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
140992
+ }
140993
+ return to;
140994
+ };
140995
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
140996
+ var babel_exports = {};
140997
+ __export2(babel_exports, {
140998
+ applyUserBabelConfig: () => applyUserBabelConfig,
140999
+ getBabelUtils: () => getBabelUtils
141000
+ });
141001
+ module2.exports = __toCommonJS2(babel_exports);
141002
+ var import_path4 = require("path");
141003
+ var import_applyOptionsChain = require_applyOptionsChain2();
141004
+ var import_ensureArray = require_ensureArray2();
141005
+ var import_path22 = require_path2();
141006
+ var formatPath = (originPath) => {
141007
+ if ((0, import_path4.isAbsolute)(originPath)) {
141008
+ return originPath.split(import_path4.sep).join("/");
141009
+ }
141010
+ return originPath;
141011
+ };
141012
+ var getPluginItemName = (item) => {
141013
+ if (typeof item === "string") {
141014
+ return formatPath(item);
141015
+ }
141016
+ if (Array.isArray(item) && typeof item[0] === "string") {
141017
+ return formatPath(item[0]);
141018
+ }
141019
+ return null;
141020
+ };
141021
+ var addPlugins = (plugins, config) => {
141022
+ if (config.plugins) {
141023
+ config.plugins.push(...plugins);
141024
+ } else {
141025
+ config.plugins = plugins;
141026
+ }
141027
+ };
141028
+ var addPresets = (presets, config) => {
141029
+ if (config.presets) {
141030
+ config.presets.push(...presets);
141031
+ } else {
141032
+ config.presets = presets;
141033
+ }
141034
+ };
141035
+ var removePlugins = (plugins, config) => {
141036
+ if (!config.plugins) {
141037
+ return;
141038
+ }
141039
+ const removeList = (0, import_ensureArray.ensureArray)(plugins);
141040
+ config.plugins = config.plugins.filter((item) => {
141041
+ const name = getPluginItemName(item);
141042
+ if (name) {
141043
+ return !removeList.find((removeItem) => name.includes(removeItem));
141044
+ }
141045
+ return true;
141046
+ });
141047
+ };
141048
+ var removePresets = (presets, config) => {
141049
+ if (!config.presets) {
141050
+ return;
141051
+ }
141052
+ const removeList = (0, import_ensureArray.ensureArray)(presets);
141053
+ config.presets = config.presets.filter((item) => {
141054
+ const name = getPluginItemName(item);
141055
+ if (name) {
141056
+ return !removeList.find((removeItem) => name.includes(removeItem));
141057
+ }
141058
+ return true;
141059
+ });
141060
+ };
141061
+ var modifyPresetOptions = (presetName, options, presets = []) => {
141062
+ presets.forEach((preset, index) => {
141063
+ if (Array.isArray(preset)) {
141064
+ if (typeof preset[0] === "string" && (0, import_path22.normalizeToPosixPath)(preset[0]).includes(presetName)) {
141065
+ preset[1] = __spreadValues2(__spreadValues2({}, preset[1] || {}), options);
141066
+ }
141067
+ } else if (typeof preset === "string" && (0, import_path22.normalizeToPosixPath)(preset).includes(presetName)) {
141068
+ presets[index] = [preset, options];
141069
+ }
141070
+ });
141071
+ };
141072
+ var getBabelUtils = (config) => {
141073
+ const noop = () => {
141074
+ };
141075
+ return {
141076
+ addPlugins: (plugins) => addPlugins(plugins, config),
141077
+ addPresets: (presets) => addPresets(presets, config),
141078
+ removePlugins: (plugins) => removePlugins(plugins, config),
141079
+ removePresets: (presets) => removePresets(presets, config),
141080
+ // `addIncludes` and `addExcludes` are noop functions by default,
141081
+ // It can be overridden by `extraBabelUtils`.
141082
+ addIncludes: noop,
141083
+ addExcludes: noop,
141084
+ // Compat `presetEnvOptions` and `presetReactOptions` in Eden.
141085
+ modifyPresetEnvOptions: (options) => modifyPresetOptions("@babel/preset-env", options, config.presets || []),
141086
+ modifyPresetReactOptions: (options) => modifyPresetOptions("@babel/preset-react", options, config.presets || [])
141087
+ };
141088
+ };
141089
+ var applyUserBabelConfig = (defaultOptions, userBabelConfig, extraBabelUtils) => {
141090
+ if (userBabelConfig) {
141091
+ const babelUtils = __spreadValues2(__spreadValues2({}, getBabelUtils(defaultOptions)), extraBabelUtils);
141092
+ return (0, import_applyOptionsChain.applyOptionsChain)(defaultOptions, userBabelConfig || {}, babelUtils);
141093
+ }
141094
+ return defaultOptions;
141095
+ };
141096
+ }
141097
+ });
141098
+
140962
141099
  // ../../../toolkit/utils/dist/index.js
140963
141100
  var require_dist3 = __commonJS({
140964
141101
  "../../../toolkit/utils/dist/index.js"(exports, module2) {
@@ -141022,6 +141159,7 @@ var require_dist3 = __commonJS({
141022
141159
  __reExport(src_exports2, require_getCoreJsVersion(), module2.exports);
141023
141160
  __reExport(src_exports2, require_react(), module2.exports);
141024
141161
  __reExport(src_exports2, require_getTargetDir(), module2.exports);
141162
+ __reExport(src_exports2, require_babel(), module2.exports);
141025
141163
  }
141026
141164
  });
141027
141165
 
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "3.0.10",
14
+ "version": "3.1.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "main": "./dist/index.js",
17
17
  "files": [
@@ -23,14 +23,14 @@
23
23
  "@modern-js/codesmith": "2.0.5",
24
24
  "@modern-js/codesmith-api-app": "2.0.5",
25
25
  "@modern-js/codesmith-api-json": "2.0.5",
26
- "@types/jest": "^27",
26
+ "@types/jest": "^29",
27
27
  "@types/node": "^14",
28
- "jest": "^27",
28
+ "jest": "^29",
29
29
  "typescript": "^4",
30
- "@scripts/jest-config": "2.8.0",
31
- "@scripts/build": "2.8.0",
32
- "@modern-js/generator-utils": "3.0.10",
33
- "@modern-js/generator-common": "3.0.10"
30
+ "@modern-js/generator-utils": "3.1.0",
31
+ "@scripts/jest-config": "2.10.0",
32
+ "@modern-js/generator-common": "3.1.0",
33
+ "@scripts/build": "2.10.0"
34
34
  },
35
35
  "sideEffects": false,
36
36
  "publishConfig": {