@modern-js/utils 2.22.1-alpha.3 → 2.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/cli/constants/index.js +0 -215
  3. package/dist/cjs/cli/index.js +0 -1
  4. package/dist/cjs/cli/is/project.js +7 -4
  5. package/dist/cjs/cli/logger.js +0 -5
  6. package/dist/cjs/cli/prettyInstructions.js +3 -2
  7. package/dist/cjs/runtime/nestedRoutes.js +3 -1
  8. package/dist/esm/cli/constants/index.js +0 -212
  9. package/dist/esm/cli/index.js +0 -1
  10. package/dist/esm/cli/is/project.js +7 -4
  11. package/dist/esm/cli/logger.js +0 -5
  12. package/dist/esm/cli/prettyInstructions.js +3 -2
  13. package/dist/esm/runtime/nestedRoutes.js +3 -1
  14. package/dist/types/cli/constants/index.d.ts +0 -121
  15. package/dist/types/cli/index.d.ts +0 -1
  16. package/dist/types/cli/is/project.d.ts +11 -1
  17. package/dist/types/runtime/nestedRoutes.d.ts +6 -2
  18. package/package.json +6 -11
  19. package/dist/FileSizeReporter.d.ts +0 -16
  20. package/dist/FileSizeReporter.js +0 -162
  21. package/dist/alias.d.ts +0 -25
  22. package/dist/alias.js +0 -108
  23. package/dist/analyzeProject.d.ts +0 -2
  24. package/dist/analyzeProject.js +0 -71
  25. package/dist/applyOptionsChain.d.ts +0 -3
  26. package/dist/applyOptionsChain.js +0 -58
  27. package/dist/babel.d.ts +0 -3
  28. package/dist/babel.js +0 -136
  29. package/dist/chainId.d.ts +0 -244
  30. package/dist/chainId.js +0 -196
  31. package/dist/cjs/cli/test.js +0 -19
  32. package/dist/clearConsole.d.ts +0 -1
  33. package/dist/clearConsole.js +0 -31
  34. package/dist/commands.d.ts +0 -4
  35. package/dist/commands.js +0 -48
  36. package/dist/compatRequire.d.ts +0 -13
  37. package/dist/compatRequire.js +0 -82
  38. package/dist/compiled.d.ts +0 -43
  39. package/dist/compiled.js +0 -142
  40. package/dist/constants.d.ts +0 -244
  41. package/dist/constants.js +0 -320
  42. package/dist/debug.d.ts +0 -6
  43. package/dist/debug.js +0 -28
  44. package/dist/emptyDir.d.ts +0 -1
  45. package/dist/emptyDir.js +0 -52
  46. package/dist/ensureAbsolutePath.d.ts +0 -7
  47. package/dist/ensureAbsolutePath.js +0 -38
  48. package/dist/ensureArray.d.ts +0 -1
  49. package/dist/ensureArray.js +0 -32
  50. package/dist/esm/cli/test.js +0 -9
  51. package/dist/findExists.d.ts +0 -6
  52. package/dist/findExists.js +0 -45
  53. package/dist/generateMetaTags.d.ts +0 -16
  54. package/dist/generateMetaTags.js +0 -61
  55. package/dist/getBrowserslist.d.ts +0 -2
  56. package/dist/getBrowserslist.js +0 -31
  57. package/dist/getCoreJsVersion.d.ts +0 -1
  58. package/dist/getCoreJsVersion.js +0 -46
  59. package/dist/getEntryOptions.d.ts +0 -1
  60. package/dist/getEntryOptions.js +0 -54
  61. package/dist/getPackageManager.d.ts +0 -1
  62. package/dist/getPackageManager.js +0 -87
  63. package/dist/getPort.d.ts +0 -14
  64. package/dist/getPort.js +0 -112
  65. package/dist/getServerConfig.d.ts +0 -1
  66. package/dist/getServerConfig.js +0 -67
  67. package/dist/getTargetDir.d.ts +0 -1
  68. package/dist/getTargetDir.js +0 -41
  69. package/dist/import.d.ts +0 -5
  70. package/dist/import.js +0 -33
  71. package/dist/index.d.ts +0 -44
  72. package/dist/index.js +0 -60
  73. package/dist/is/index.d.ts +0 -58
  74. package/dist/is/index.js +0 -114
  75. package/dist/is/nodeEnv.d.ts +0 -8
  76. package/dist/is/nodeEnv.js +0 -39
  77. package/dist/is/platform.d.ts +0 -2
  78. package/dist/is/platform.js +0 -30
  79. package/dist/is/type.d.ts +0 -8
  80. package/dist/is/type.js +0 -64
  81. package/dist/logger.d.ts +0 -65
  82. package/dist/logger.js +0 -145
  83. package/dist/monorepo.d.ts +0 -11
  84. package/dist/monorepo.js +0 -137
  85. package/dist/nodeEnv.d.ts +0 -3
  86. package/dist/nodeEnv.js +0 -81
  87. package/dist/path.d.ts +0 -18
  88. package/dist/path.js +0 -92
  89. package/dist/pathSerializer.d.ts +0 -16
  90. package/dist/pathSerializer.js +0 -76
  91. package/dist/plugin.d.ts +0 -2
  92. package/dist/plugin.js +0 -46
  93. package/dist/prettyInstructions.d.ts +0 -9
  94. package/dist/prettyInstructions.js +0 -112
  95. package/dist/printBuildError.d.ts +0 -8
  96. package/dist/printBuildError.js +0 -57
  97. package/dist/react.d.ts +0 -1
  98. package/dist/react.js +0 -64
  99. package/dist/readTsConfig.d.ts +0 -2
  100. package/dist/readTsConfig.js +0 -47
  101. package/dist/removeSlash.d.ts +0 -3
  102. package/dist/removeSlash.js +0 -33
  103. package/dist/resolve.d.ts +0 -13
  104. package/dist/resolve.js +0 -63
  105. package/dist/routes.d.ts +0 -2
  106. package/dist/routes.js +0 -58
  107. package/dist/runtimeExports.d.ts +0 -4
  108. package/dist/runtimeExports.js +0 -73
  109. package/dist/ssr.d.ts +0 -8
  110. package/dist/ssr.js +0 -30
  111. package/dist/storage.d.ts +0 -5
  112. package/dist/storage.js +0 -75
  113. package/dist/testUtils.d.ts +0 -5
  114. package/dist/testUtils.js +0 -38
  115. package/dist/types/cli/test.d.ts +0 -5
  116. package/dist/types.d.ts +0 -1
  117. package/dist/types.js +0 -15
  118. package/dist/universal/constants.d.ts +0 -9
  119. package/dist/universal/constants.js +0 -30
  120. package/dist/universal/formatWebpack.d.ts +0 -13
  121. package/dist/universal/formatWebpack.js +0 -100
  122. package/dist/universal/nestedRoutes.d.ts +0 -8
  123. package/dist/universal/nestedRoutes.js +0 -131
  124. package/dist/universal/remixRouter.d.ts +0 -1
  125. package/dist/universal/remixRouter.js +0 -17
  126. package/dist/universal/serialize.d.ts +0 -1
  127. package/dist/universal/serialize.js +0 -40
  128. package/dist/version.d.ts +0 -2
  129. package/dist/version.js +0 -92
  130. package/dist/wait.d.ts +0 -2
  131. package/dist/wait.js +0 -29
  132. package/dist/watch.d.ts +0 -8
  133. package/dist/watch.js +0 -90
@@ -1,58 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var applyOptionsChain_exports = {};
19
- __export(applyOptionsChain_exports, {
20
- applyOptionsChain: () => applyOptionsChain
21
- });
22
- module.exports = __toCommonJS(applyOptionsChain_exports);
23
- var import_index = require("./index");
24
- function applyOptionsChain(defaults, options, utils, mergeFn = Object.assign) {
25
- if (!options) {
26
- return defaults;
27
- }
28
- if ((0, import_index.isPlainObject)(options)) {
29
- return mergeFn(defaults, options);
30
- } else if ((0, import_index.isFunction)(options)) {
31
- const ret = options(defaults, utils);
32
- if (ret) {
33
- if (!(0, import_index.isPlainObject)(ret)) {
34
- import_index.logger.warn(
35
- `${options.name}: Function should mutate the config and return nothing, Or return a cloned or merged version of config object.`
36
- );
37
- }
38
- return ret;
39
- }
40
- } else if (Array.isArray(options)) {
41
- return options.reduce(
42
- (memo, cur) => applyOptionsChain(memo, cur, utils, mergeFn),
43
- defaults
44
- );
45
- } else {
46
- throw new Error(
47
- `applyOptionsChain error:
48
- default options is: ${JSON.stringify(
49
- defaults
50
- )}`
51
- );
52
- }
53
- return defaults;
54
- }
55
- // Annotate the CommonJS export names for ESM import in node:
56
- 0 && (module.exports = {
57
- applyOptionsChain
58
- });
package/dist/babel.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { BabelConfig, BabelConfigUtils, BabelTransformOptions } from '@modern-js/types';
2
- export declare const getBabelUtils: (config: BabelTransformOptions) => BabelConfigUtils;
3
- export declare const applyUserBabelConfig: (defaultOptions: BabelTransformOptions, userBabelConfig?: BabelConfig | BabelConfig[], extraBabelUtils?: Partial<BabelConfigUtils>) => BabelTransformOptions;
package/dist/babel.js DELETED
@@ -1,136 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
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 __export = (target, all) => {
20
- for (var name in all)
21
- __defProp(target, name, { get: all[name], enumerable: true });
22
- };
23
- var __copyProps = (to, from, except, desc) => {
24
- if (from && typeof from === "object" || typeof from === "function") {
25
- for (let key of __getOwnPropNames(from))
26
- if (!__hasOwnProp.call(to, key) && key !== except)
27
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
28
- }
29
- return to;
30
- };
31
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
- var babel_exports = {};
33
- __export(babel_exports, {
34
- applyUserBabelConfig: () => applyUserBabelConfig,
35
- getBabelUtils: () => getBabelUtils
36
- });
37
- module.exports = __toCommonJS(babel_exports);
38
- var import_path = require("path");
39
- var import_applyOptionsChain = require("./applyOptionsChain");
40
- var import_ensureArray = require("./ensureArray");
41
- var import_path2 = require("./path");
42
- const formatPath = (originPath) => {
43
- if ((0, import_path.isAbsolute)(originPath)) {
44
- return originPath.split(import_path.sep).join("/");
45
- }
46
- return originPath;
47
- };
48
- const getPluginItemName = (item) => {
49
- if (typeof item === "string") {
50
- return formatPath(item);
51
- }
52
- if (Array.isArray(item) && typeof item[0] === "string") {
53
- return formatPath(item[0]);
54
- }
55
- return null;
56
- };
57
- const addPlugins = (plugins, config) => {
58
- if (config.plugins) {
59
- config.plugins.push(...plugins);
60
- } else {
61
- config.plugins = plugins;
62
- }
63
- };
64
- const addPresets = (presets, config) => {
65
- if (config.presets) {
66
- config.presets.push(...presets);
67
- } else {
68
- config.presets = presets;
69
- }
70
- };
71
- const removePlugins = (plugins, config) => {
72
- if (!config.plugins) {
73
- return;
74
- }
75
- const removeList = (0, import_ensureArray.ensureArray)(plugins);
76
- config.plugins = config.plugins.filter((item) => {
77
- const name = getPluginItemName(item);
78
- if (name) {
79
- return !removeList.find((removeItem) => name.includes(removeItem));
80
- }
81
- return true;
82
- });
83
- };
84
- const removePresets = (presets, config) => {
85
- if (!config.presets) {
86
- return;
87
- }
88
- const removeList = (0, import_ensureArray.ensureArray)(presets);
89
- config.presets = config.presets.filter((item) => {
90
- const name = getPluginItemName(item);
91
- if (name) {
92
- return !removeList.find((removeItem) => name.includes(removeItem));
93
- }
94
- return true;
95
- });
96
- };
97
- const modifyPresetOptions = (presetName, options, presets = []) => {
98
- presets.forEach((preset, index) => {
99
- if (Array.isArray(preset)) {
100
- if (typeof preset[0] === "string" && (0, import_path2.normalizeToPosixPath)(preset[0]).includes(presetName)) {
101
- preset[1] = __spreadValues(__spreadValues({}, preset[1] || {}), options);
102
- }
103
- } else if (typeof preset === "string" && (0, import_path2.normalizeToPosixPath)(preset).includes(presetName)) {
104
- presets[index] = [preset, options];
105
- }
106
- });
107
- };
108
- const getBabelUtils = (config) => {
109
- const noop = () => {
110
- };
111
- return {
112
- addPlugins: (plugins) => addPlugins(plugins, config),
113
- addPresets: (presets) => addPresets(presets, config),
114
- removePlugins: (plugins) => removePlugins(plugins, config),
115
- removePresets: (presets) => removePresets(presets, config),
116
- // `addIncludes` and `addExcludes` are noop functions by default,
117
- // It can be overridden by `extraBabelUtils`.
118
- addIncludes: noop,
119
- addExcludes: noop,
120
- // Compat `presetEnvOptions` and `presetReactOptions` in Eden.
121
- modifyPresetEnvOptions: (options) => modifyPresetOptions("@babel/preset-env", options, config.presets || []),
122
- modifyPresetReactOptions: (options) => modifyPresetOptions("@babel/preset-react", options, config.presets || [])
123
- };
124
- };
125
- const applyUserBabelConfig = (defaultOptions, userBabelConfig, extraBabelUtils) => {
126
- if (userBabelConfig) {
127
- const babelUtils = __spreadValues(__spreadValues({}, getBabelUtils(defaultOptions)), extraBabelUtils);
128
- return (0, import_applyOptionsChain.applyOptionsChain)(defaultOptions, userBabelConfig || {}, babelUtils);
129
- }
130
- return defaultOptions;
131
- };
132
- // Annotate the CommonJS export names for ESM import in node:
133
- 0 && (module.exports = {
134
- applyUserBabelConfig,
135
- getBabelUtils
136
- });
package/dist/chainId.d.ts DELETED
@@ -1,244 +0,0 @@
1
- export declare const CHAIN_ID: {
2
- /** Predefined rules */
3
- readonly RULE: {
4
- /** Rule for .mjs */
5
- readonly MJS: "mjs";
6
- /** Rule for predefined loaders */
7
-
8
- readonly LOADERS: "loaders";
9
- /** Rule for fonts */
10
-
11
- readonly FONT: "font";
12
- /** Rule for images */
13
-
14
- readonly IMAGE: "image";
15
- /** Rule for media */
16
-
17
- readonly MEDIA: "media";
18
- /** Rule for js */
19
-
20
- readonly JS: "js";
21
- /** Rule for data uri encoded javascript */
22
-
23
- readonly JS_DATA_URI: "js-data-uri";
24
- /** Rule for ts */
25
-
26
- readonly TS: "ts";
27
- /** Rule for css */
28
-
29
- readonly CSS: "css";
30
- /** Rule for less */
31
-
32
- readonly LESS: "less";
33
- /** Rule for sass */
34
-
35
- readonly SASS: "sass";
36
- /** Rule for stylus */
37
-
38
- readonly STYLUS: "stylus";
39
- /** Rule for svg */
40
-
41
- readonly SVG: "svg";
42
- /** Rule for pug */
43
-
44
- readonly PUG: "pug";
45
- /** Rule for toml */
46
-
47
- readonly TOML: "toml";
48
- /** Rule for yaml */
49
-
50
- readonly YAML: "yaml";
51
- /** Rule for bff */
52
-
53
- readonly JS_BFF_API: "js-bff-api";
54
- };
55
- /** Predefined rule groups */
56
-
57
- readonly ONE_OF: {
58
- readonly SVG: "svg";
59
- readonly SVG_URL: "svg-url";
60
- readonly SVG_ASSET: "svg-asset";
61
- readonly SVG_INLINE: "svg-inline";
62
- };
63
- /** Predefined loaders */
64
-
65
- readonly USE: {
66
- /** ts-loader */
67
- readonly TS: "ts";
68
- /** css-loader */
69
-
70
- readonly CSS: "css";
71
- /** sass-loader */
72
-
73
- readonly SASS: "sass";
74
- /** less-loader */
75
-
76
- readonly LESS: "less";
77
- /** stylus-loader */
78
-
79
- readonly STYLUS: "stylus";
80
- /** url-loader */
81
-
82
- readonly URL: "url";
83
- /** pug-loader */
84
-
85
- readonly PUG: "pug";
86
- /** file-loader */
87
-
88
- readonly FILE: "file";
89
- /** @svgr/webpack */
90
-
91
- readonly SVGR: "svgr";
92
- /** yaml-loader */
93
-
94
- readonly YAML: "yaml";
95
- /** toml-loader */
96
-
97
- readonly TOML: "toml";
98
- /** html-loader */
99
-
100
- readonly HTML: "html";
101
- /** babel-loader */
102
-
103
- readonly BABEL: "babel";
104
- /** esbuild-loader */
105
-
106
- readonly ESBUILD: "esbuild";
107
- /** swc-loader */
108
-
109
- readonly SWC: "swc";
110
- /** style-loader */
111
-
112
- readonly STYLE: "style-loader";
113
- /** postcss-loader */
114
-
115
- readonly POSTCSS: "postcss";
116
- /** markdown-loader */
117
-
118
- readonly MARKDOWN: "markdown";
119
- /** ignore-css-loader */
120
-
121
- readonly IGNORE_CSS: "ignore-css";
122
- /** css-modules-typescript-loader */
123
-
124
- readonly CSS_MODULES_TS: "css-modules-typescript";
125
- /** mini-css-extract-plugin.loader */
126
-
127
- readonly MINI_CSS_EXTRACT: "mini-css-extract";
128
- /** builder-plugin-image-compress.loader */
129
-
130
- readonly IMAGE_COMPRESS: "image-compress";
131
- /** builder-plugin-image-compress svgo-loader */
132
-
133
- readonly SVGO: "svgo";
134
- /** builder-plugin-imagex */
135
-
136
- readonly IMAGEX: "imagex";
137
- };
138
- /** Predefined plugins */
139
-
140
- readonly PLUGIN: {
141
- /** HotModuleReplacementPlugin */
142
- readonly HMR: "hmr";
143
- /** CopyWebpackPlugin */
144
-
145
- readonly COPY: "copy";
146
- /** HtmlWebpackPlugin */
147
-
148
- readonly HTML: "html";
149
- /** DefinePlugin */
150
-
151
- readonly DEFINE: "define";
152
- /** IgnorePlugin */
153
-
154
- readonly IGNORE: "ignore";
155
- /** BannerPlugin */
156
-
157
- readonly BANNER: "banner";
158
- /** Webpackbar */
159
-
160
- readonly PROGRESS: "progress";
161
- /** Inspector */
162
-
163
- readonly INSPECTOR: "inspector";
164
- /** AppIconPlugin */
165
-
166
- readonly APP_ICON: "app-icon";
167
- /** FaviconUrlPlugin */
168
-
169
- readonly FAVICON_URL: "favicon-url";
170
- /** LoadableWebpackPlugin */
171
-
172
- readonly LOADABLE: "loadable";
173
- /** WebpackManifestPlugin */
174
-
175
- readonly MANIFEST: "webpack-manifest";
176
- /** ForkTsCheckerWebpackPlugin */
177
-
178
- readonly TS_CHECKER: "ts-checker";
179
- /** InlineChunkHtmlPlugin */
180
-
181
- readonly INLINE_HTML: "inline-html";
182
- /** WebpackBundleAnalyzer */
183
-
184
- readonly BUNDLE_ANALYZER: "bundle-analyze";
185
- /** BottomTemplatePlugin */
186
-
187
- readonly BOTTOM_TEMPLATE: "bottom-template";
188
- /** HtmlCrossOriginPlugin */
189
-
190
- readonly HTML_CROSS_ORIGIN: "html-cross-origin";
191
- /** MiniCssExtractPlugin */
192
-
193
- readonly MINI_CSS_EXTRACT: "mini-css-extract";
194
- /** ReactFastRefreshPlugin */
195
-
196
- readonly REACT_FAST_REFRESH: "react-fast-refresh";
197
- /** ProvidePlugin for node polyfill */
198
-
199
- readonly NODE_POLYFILL_PROVIDE: "node-polyfill-provide";
200
- /** WebpackSRIPlugin */
201
-
202
- readonly SUBRESOURCE_INTEGRITY: "subresource-integrity";
203
- /** WebpackAssetsRetryPlugin */
204
-
205
- readonly ASSETS_RETRY: "ASSETS_RETRY";
206
- /** AutoSetRootFontSizePlugin */
207
-
208
- readonly AUTO_SET_ROOT_SIZE: "auto-set-root-size";
209
- /** HtmlAsyncChunkPlugin */
210
-
211
- readonly HTML_ASYNC_CHUNK: "html-async-chunk";
212
- /** SWC_POLYFILL_CHECKER */
213
-
214
- readonly SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin";
215
- /** HtmlTagsPlugin */
216
-
217
- readonly HTML_TAGS: "html-tags";
218
- };
219
- /** Predefined minimizers */
220
-
221
- readonly MINIMIZER: {
222
- /** TerserWebpackPlugin */
223
- readonly JS: "js";
224
- /** CssMinimizerWebpackPlugin */
225
-
226
- readonly CSS: "css";
227
- /** ESBuildPlugin */
228
-
229
- readonly ESBUILD: "js-css";
230
- /** SWCPlugin */
231
-
232
- readonly SWC: "swc";
233
- };
234
- /** Predefined resolve plugins */
235
-
236
- readonly RESOLVE_PLUGIN: {
237
- /** ModuleScopePlugin */
238
- readonly MODULE_SCOPE: "module-scope";
239
- /** TsConfigPathsPlugin */
240
-
241
- readonly TS_CONFIG_PATHS: "ts-config-paths";
242
- };
243
- };
244
- export type ChainIdentifier = typeof CHAIN_ID;
package/dist/chainId.js DELETED
@@ -1,196 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var chainId_exports = {};
19
- __export(chainId_exports, {
20
- CHAIN_ID: () => CHAIN_ID
21
- });
22
- module.exports = __toCommonJS(chainId_exports);
23
- const CHAIN_ID = {
24
- /** Predefined rules */
25
- RULE: {
26
- /** Rule for .mjs */
27
- MJS: "mjs",
28
- /** Rule for predefined loaders */
29
- LOADERS: "loaders",
30
- /** Rule for fonts */
31
- FONT: "font",
32
- /** Rule for images */
33
- IMAGE: "image",
34
- /** Rule for media */
35
- MEDIA: "media",
36
- /** Rule for js */
37
- JS: "js",
38
- /** Rule for data uri encoded javascript */
39
- JS_DATA_URI: "js-data-uri",
40
- /** Rule for ts */
41
- TS: "ts",
42
- /** Rule for css */
43
- CSS: "css",
44
- /** Rule for less */
45
- LESS: "less",
46
- /** Rule for sass */
47
- SASS: "sass",
48
- /** Rule for stylus */
49
- STYLUS: "stylus",
50
- /** Rule for svg */
51
- SVG: "svg",
52
- /** Rule for pug */
53
- PUG: "pug",
54
- /** Rule for toml */
55
- TOML: "toml",
56
- /** Rule for yaml */
57
- YAML: "yaml",
58
- /** Rule for bff */
59
- JS_BFF_API: "js-bff-api"
60
- },
61
- /** Predefined rule groups */
62
- ONE_OF: {
63
- SVG: "svg",
64
- SVG_URL: "svg-url",
65
- SVG_ASSET: "svg-asset",
66
- SVG_INLINE: "svg-inline"
67
- },
68
- /** Predefined loaders */
69
- USE: {
70
- /** ts-loader */
71
- TS: "ts",
72
- /** css-loader */
73
- CSS: "css",
74
- /** sass-loader */
75
- SASS: "sass",
76
- /** less-loader */
77
- LESS: "less",
78
- /** stylus-loader */
79
- STYLUS: "stylus",
80
- /** url-loader */
81
- URL: "url",
82
- /** pug-loader */
83
- PUG: "pug",
84
- /** file-loader */
85
- FILE: "file",
86
- /** @svgr/webpack */
87
- SVGR: "svgr",
88
- /** yaml-loader */
89
- YAML: "yaml",
90
- /** toml-loader */
91
- TOML: "toml",
92
- /** html-loader */
93
- HTML: "html",
94
- /** babel-loader */
95
- BABEL: "babel",
96
- /** esbuild-loader */
97
- ESBUILD: "esbuild",
98
- /** swc-loader */
99
- SWC: "swc",
100
- /** style-loader */
101
- STYLE: "style-loader",
102
- /** postcss-loader */
103
- POSTCSS: "postcss",
104
- /** markdown-loader */
105
- MARKDOWN: "markdown",
106
- /** ignore-css-loader */
107
- IGNORE_CSS: "ignore-css",
108
- /** css-modules-typescript-loader */
109
- CSS_MODULES_TS: "css-modules-typescript",
110
- /** mini-css-extract-plugin.loader */
111
- MINI_CSS_EXTRACT: "mini-css-extract",
112
- /** builder-plugin-image-compress.loader */
113
- IMAGE_COMPRESS: "image-compress",
114
- /** builder-plugin-image-compress svgo-loader */
115
- SVGO: "svgo",
116
- /** builder-plugin-imagex */
117
- IMAGEX: "imagex"
118
- },
119
- /** Predefined plugins */
120
- PLUGIN: {
121
- /** HotModuleReplacementPlugin */
122
- HMR: "hmr",
123
- /** CopyWebpackPlugin */
124
- COPY: "copy",
125
- /** HtmlWebpackPlugin */
126
- HTML: "html",
127
- /** DefinePlugin */
128
- DEFINE: "define",
129
- /** IgnorePlugin */
130
- IGNORE: "ignore",
131
- /** BannerPlugin */
132
- BANNER: "banner",
133
- /** Webpackbar */
134
- PROGRESS: "progress",
135
- /** Inspector */
136
- INSPECTOR: "inspector",
137
- /** AppIconPlugin */
138
- APP_ICON: "app-icon",
139
- /** FaviconUrlPlugin */
140
- FAVICON_URL: "favicon-url",
141
- /** LoadableWebpackPlugin */
142
- LOADABLE: "loadable",
143
- /** WebpackManifestPlugin */
144
- MANIFEST: "webpack-manifest",
145
- /** ForkTsCheckerWebpackPlugin */
146
- TS_CHECKER: "ts-checker",
147
- /** InlineChunkHtmlPlugin */
148
- INLINE_HTML: "inline-html",
149
- /** WebpackBundleAnalyzer */
150
- BUNDLE_ANALYZER: "bundle-analyze",
151
- /** BottomTemplatePlugin */
152
- BOTTOM_TEMPLATE: "bottom-template",
153
- /** HtmlCrossOriginPlugin */
154
- HTML_CROSS_ORIGIN: "html-cross-origin",
155
- /** MiniCssExtractPlugin */
156
- MINI_CSS_EXTRACT: "mini-css-extract",
157
- /** ReactFastRefreshPlugin */
158
- REACT_FAST_REFRESH: "react-fast-refresh",
159
- /** ProvidePlugin for node polyfill */
160
- NODE_POLYFILL_PROVIDE: "node-polyfill-provide",
161
- /** WebpackSRIPlugin */
162
- SUBRESOURCE_INTEGRITY: "subresource-integrity",
163
- /** WebpackAssetsRetryPlugin */
164
- ASSETS_RETRY: "ASSETS_RETRY",
165
- /** AutoSetRootFontSizePlugin */
166
- AUTO_SET_ROOT_SIZE: "auto-set-root-size",
167
- /** HtmlAsyncChunkPlugin */
168
- HTML_ASYNC_CHUNK: "html-async-chunk",
169
- /** SWC_POLYFILL_CHECKER */
170
- SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin",
171
- /** HtmlTagsPlugin */
172
- HTML_TAGS: "html-tags"
173
- },
174
- /** Predefined minimizers */
175
- MINIMIZER: {
176
- /** TerserWebpackPlugin */
177
- JS: "js",
178
- /** CssMinimizerWebpackPlugin */
179
- CSS: "css",
180
- /** ESBuildPlugin */
181
- ESBUILD: "js-css",
182
- /** SWCPlugin */
183
- SWC: "swc"
184
- },
185
- /** Predefined resolve plugins */
186
- RESOLVE_PLUGIN: {
187
- /** ModuleScopePlugin */
188
- MODULE_SCOPE: "module-scope",
189
- /** TsConfigPathsPlugin */
190
- TS_CONFIG_PATHS: "ts-config-paths"
191
- }
192
- };
193
- // Annotate the CommonJS export names for ESM import in node:
194
- 0 && (module.exports = {
195
- CHAIN_ID
196
- });
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "initSnapshotSerializer", {
6
- enumerable: true,
7
- get: function() {
8
- return initSnapshotSerializer;
9
- }
10
- });
11
- const initSnapshotSerializer = (root) => {
12
- expect.addSnapshotSerializer({
13
- test: (val) => typeof val === "string" && (val.includes("modern.js") || val.includes("node_modules") || val.includes(root)),
14
- print: (val) => (
15
- // eslint-disable-next-line no-nested-ternary
16
- typeof val === "string" ? val.includes("node_modules") ? `"${val.replace(/.+node_modules/, ``).replace(/\\/g, "/")}"` : val.includes("modern.js") ? `"${val.replace(/.+modern\.js/, ``).replace(/\\/g, "/")}"` : `"${val.replace(root, "").replace(/\\/g, "/")}"` : val
17
- )
18
- });
19
- };
@@ -1 +0,0 @@
1
- export declare const clearConsole: () => void;
@@ -1,31 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var clearConsole_exports = {};
19
- __export(clearConsole_exports, {
20
- clearConsole: () => clearConsole
21
- });
22
- module.exports = __toCommonJS(clearConsole_exports);
23
- const clearConsole = () => {
24
- if (process.stdout.isTTY && !process.env.DEBUG) {
25
- process.stdout.write("\x1B[H\x1B[2J");
26
- }
27
- };
28
- // Annotate the CommonJS export names for ESM import in node:
29
- 0 && (module.exports = {
30
- clearConsole
31
- });
@@ -1,4 +0,0 @@
1
- export declare const getFullArgv: () => string[];
2
- export declare const getArgv: () => string[];
3
- export declare const getCommand: () => string;
4
- export declare const isDevCommand: () => boolean;