@modern-js/utils 2.40.0 → 2.42.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. package/dist/types/cli/alias.d.ts +10 -10
  2. package/dist/types/cli/applyOptionsChain.d.ts +1 -1
  3. package/dist/types/cli/babel.d.ts +1 -1
  4. package/dist/types/cli/commands.d.ts +1 -1
  5. package/dist/types/cli/common.d.ts +1 -1
  6. package/dist/types/cli/config.d.ts +1 -1
  7. package/dist/types/cli/constants/chainId.d.ts +195 -195
  8. package/dist/types/cli/constants/index.d.ts +1 -1
  9. package/dist/types/cli/ensure.d.ts +1 -1
  10. package/dist/types/cli/fs.d.ts +1 -1
  11. package/dist/types/cli/get/config.d.ts +1 -1
  12. package/dist/types/cli/get/data.d.ts +1 -1
  13. package/dist/types/cli/get/index.d.ts +1 -1
  14. package/dist/types/cli/index.d.ts +1 -1
  15. package/dist/types/cli/is/config.d.ts +7 -7
  16. package/dist/types/cli/is/env.d.ts +1 -1
  17. package/dist/types/cli/is/index.d.ts +1 -1
  18. package/dist/types/cli/is/project.d.ts +1 -1
  19. package/dist/types/cli/is/type.d.ts +1 -1
  20. package/dist/types/cli/logger.d.ts +1 -1
  21. package/dist/types/cli/monorepo.d.ts +3 -3
  22. package/dist/types/cli/package.d.ts +1 -1
  23. package/dist/types/cli/path.d.ts +1 -1
  24. package/dist/types/cli/port.d.ts +5 -9
  25. package/dist/types/cli/prettyInstructions.d.ts +5 -5
  26. package/dist/types/cli/require.d.ts +3 -3
  27. package/dist/types/cli/runtimeExports.d.ts +3 -3
  28. package/dist/types/cli/watch.d.ts +3 -3
  29. package/dist/types/compiled.d.ts +1 -1
  30. package/dist/types/import.d.ts +2 -2
  31. package/dist/types/index.d.ts +1 -1
  32. package/dist/types/universal/constants.d.ts +1 -1
  33. package/dist/types/universal/formatWebpack.d.ts +13 -13
  34. package/dist/types/universal/pluginDagSort.d.ts +1 -1
  35. package/package.json +5 -5
@@ -1,20 +1,20 @@
1
1
  export type Alias = Record<string, string | string[]>;
2
2
  export type AliasOption = Alias | ((aliases: Alias) => Alias | void);
3
3
  interface NormalizedConfig {
4
- source: {
5
- alias?: AliasOption | Array<AliasOption>;
6
- };
4
+ source: {
5
+ alias?: AliasOption | Array<AliasOption>;
6
+ };
7
7
  }
8
8
  interface IAliasConfig {
9
- absoluteBaseUrl: string;
10
- paths?: Record<string, string | string[]>;
11
- isTsPath?: boolean;
12
- isTsProject?: boolean;
9
+ absoluteBaseUrl: string;
10
+ paths?: Record<string, string | string[]>;
11
+ isTsPath?: boolean;
12
+ isTsProject?: boolean;
13
13
  }
14
14
  export declare const mergeAlias: (alias: NormalizedConfig['source']['alias']) => Alias;
15
15
  export declare const getAliasConfig: (aliasOption: NormalizedConfig['source']['alias'], option: {
16
- appDirectory: string;
17
- tsconfigPath: string;
16
+ appDirectory: string;
17
+ tsconfigPath: string;
18
18
  }) => IAliasConfig;
19
19
  export declare const getUserAlias: (alias?: Record<string, string | string[]>) => Record<string, string | string[]>;
20
- export {};
20
+ export {};
@@ -1,3 +1,3 @@
1
1
  export type Falsy = false | null | undefined | 0 | '';
2
2
  export declare function applyOptionsChain<T, U>(defaults: T, options?: T | ((config: T, utils?: U) => T | void) | Array<T | ((config: T, utils?: U) => T | void)> | Falsy, utils?: U, mergeFn?: typeof Object.assign): T;
3
- export declare function applyOptionsChain<T, U>(defaults: T, options: T | ((config: T, utils: U) => T | void) | Array<T | ((config: T, utils: U) => T | void)> | Falsy, utils: U, mergeFn?: typeof Object.assign): T;
3
+ export declare function applyOptionsChain<T, U>(defaults: T, options: T | ((config: T, utils: U) => T | void) | Array<T | ((config: T, utils: U) => T | void)> | Falsy, utils: U, mergeFn?: typeof Object.assign): T;
@@ -1,3 +1,3 @@
1
1
  import { BabelConfig, BabelConfigUtils, BabelTransformOptions } from '@modern-js/types';
2
2
  export declare const getBabelUtils: (config: BabelTransformOptions) => BabelConfigUtils;
3
- export declare const applyUserBabelConfig: (defaultOptions: BabelTransformOptions, userBabelConfig?: BabelConfig | BabelConfig[], extraBabelUtils?: Partial<BabelConfigUtils>) => BabelTransformOptions;
3
+ export declare const applyUserBabelConfig: (defaultOptions: BabelTransformOptions, userBabelConfig?: BabelConfig | BabelConfig[], extraBabelUtils?: Partial<BabelConfigUtils>) => BabelTransformOptions;
@@ -1,4 +1,4 @@
1
1
  export declare const getFullArgv: () => string[];
2
2
  export declare const getArgv: () => string[];
3
3
  export declare const getCommand: () => string;
4
- export declare const isDevCommand: () => boolean;
4
+ export declare const isDevCommand: () => boolean;
@@ -5,4 +5,4 @@
5
5
  */
6
6
  export declare const createDebugger: (scope: string) => import("../../compiled/debug").Debugger;
7
7
  export declare const clearConsole: () => void;
8
- export declare const wait: (time?: number) => Promise<unknown>;
8
+ export declare const wait: (time?: number) => Promise<unknown>;
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * When merging config, some properties prefer `override` rather than `merge to array`
3
3
  */
4
- export declare const isOverriddenConfigKey: (key: string) => boolean;
4
+ export declare const isOverriddenConfigKey: (key: string) => boolean;
@@ -1,197 +1,197 @@
1
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
- readonly LOADERS: "loaders";
8
- /** Rule for fonts */
9
- readonly FONT: "font";
10
- /** Rule for images */
11
- readonly IMAGE: "image";
12
- /** Rule for media */
13
- readonly MEDIA: "media";
14
- /** Rule for js */
15
- readonly JS: "js";
16
- /** Rule for data uri encoded javascript */
17
- readonly JS_DATA_URI: "js-data-uri";
18
- /** Rule for ts */
19
- readonly TS: "ts";
20
- /** Rule for css */
21
- readonly CSS: "css";
22
- /** Rule for less */
23
- readonly LESS: "less";
24
- /** Rule for sass */
25
- readonly SASS: "sass";
26
- /** Rule for stylus */
27
- readonly STYLUS: "stylus";
28
- /** Rule for svg */
29
- readonly SVG: "svg";
30
- /** Rule for pug */
31
- readonly PUG: "pug";
32
- /** Rule for Vue */
33
- readonly VUE: "vue";
34
- /** Rule for toml */
35
- readonly TOML: "toml";
36
- /** Rule for yaml */
37
- readonly YAML: "yaml";
38
- /** Rule for wasm */
39
- readonly WASM: "wasm";
40
- /** Rule for node */
41
- readonly NODE: "node";
42
- /** Rule for bff */
43
- readonly JS_BFF_API: "js-bff-api";
44
- };
45
- /** Predefined rule groups */
46
- readonly ONE_OF: {
47
- readonly SVG: "svg";
48
- readonly SVG_URL: "svg-url";
49
- readonly SVG_ASSET: "svg-asset";
50
- readonly SVG_INLINE: "svg-inline";
51
- };
52
- /** Predefined loaders */
53
- readonly USE: {
54
- /** ts-loader */
55
- readonly TS: "ts";
56
- /** css-loader */
57
- readonly CSS: "css";
58
- /** sass-loader */
59
- readonly SASS: "sass";
60
- /** less-loader */
61
- readonly LESS: "less";
62
- /** stylus-loader */
63
- readonly STYLUS: "stylus";
64
- /** url-loader */
65
- readonly URL: "url";
66
- /** pug-loader */
67
- readonly PUG: "pug";
68
- /** vue-loader */
69
- readonly VUE: "vue";
70
- /** file-loader */
71
- readonly FILE: "file";
72
- /** @svgr/webpack */
73
- readonly SVGR: "svgr";
74
- /** yaml-loader */
75
- readonly YAML: "yaml";
76
- /** toml-loader */
77
- readonly TOML: "toml";
78
- /** html-loader */
79
- readonly HTML: "html";
80
- /** node-loader */
81
- readonly NODE: "html";
82
- /** babel-loader */
83
- readonly BABEL: "babel";
84
- /** esbuild-loader */
85
- readonly ESBUILD: "esbuild";
86
- /** swc-loader */
87
- readonly SWC: "swc";
88
- /** style-loader */
89
- readonly STYLE: "style-loader";
90
- /** postcss-loader */
91
- readonly POSTCSS: "postcss";
92
- /** ignore-css-loader */
93
- readonly IGNORE_CSS: "ignore-css";
94
- /** css-modules-typescript-loader */
95
- readonly CSS_MODULES_TS: "css-modules-typescript";
96
- /** mini-css-extract-plugin.loader */
97
- readonly MINI_CSS_EXTRACT: "mini-css-extract";
98
- /** resolve-url-loader */
99
- readonly RESOLVE_URL_LOADER_FOR_SASS: "resolve-url-loader";
100
- /** builder-plugin-image-compress.loader */
101
- readonly IMAGE_COMPRESS: "image-compress";
102
- /** builder-plugin-image-compress svgo-loader */
103
- readonly SVGO: "svgo";
104
- /** builder-plugin-imagex */
105
- readonly IMAGEX: "imagex";
106
- /** storybook-react-docgen */
107
- readonly REACT_DOCGEN: "react-docgen";
108
- };
109
- /** Predefined plugins */
110
- readonly PLUGIN: {
111
- /** HotModuleReplacementPlugin */
112
- readonly HMR: "hmr";
113
- /** CopyWebpackPlugin */
114
- readonly COPY: "copy";
115
- /** HtmlWebpackPlugin */
116
- readonly HTML: "html";
117
- /** DefinePlugin */
118
- readonly DEFINE: "define";
119
- /** IgnorePlugin */
120
- readonly IGNORE: "ignore";
121
- /** BannerPlugin */
122
- readonly BANNER: "banner";
123
- /** Webpackbar */
124
- readonly PROGRESS: "progress";
125
- /** Inspector */
126
- readonly INSPECTOR: "inspector";
127
- /** AppIconPlugin */
128
- readonly APP_ICON: "app-icon";
129
- /** FaviconUrlPlugin */
130
- readonly FAVICON_URL: "favicon-url";
131
- /** LoadableWebpackPlugin */
132
- readonly LOADABLE: "loadable";
133
- /** WebpackManifestPlugin */
134
- readonly MANIFEST: "webpack-manifest";
135
- /** ForkTsCheckerWebpackPlugin */
136
- readonly TS_CHECKER: "ts-checker";
137
- /** InlineChunkHtmlPlugin */
138
- readonly INLINE_HTML: "inline-html";
139
- /** WebpackBundleAnalyzer */
140
- readonly BUNDLE_ANALYZER: "bundle-analyze";
141
- /** BottomTemplatePlugin */
142
- readonly BOTTOM_TEMPLATE: "bottom-template";
143
- /** HtmlTagsPlugin */
144
- readonly HTML_TAGS: "html-tags";
145
- /** HtmlNoncePlugin */
146
- readonly HTML_NONCE: "html-nonce";
147
- /** HtmlCrossOriginPlugin */
148
- readonly HTML_CROSS_ORIGIN: "html-cross-origin";
149
- /** htmlPreconnectPlugin */
150
- readonly HTML_PRECONNECT: "html-preconnect-plugin";
151
- /** htmlDnsPrefetchPlugin */
152
- readonly HTML_DNS_PREFETCH: "html-dns-prefetch-plugin";
153
- /** htmlPrefetchPlugin */
154
- readonly HTML_PREFETCH: "html-prefetch-plugin";
155
- /** htmlPreloadPlugin */
156
- readonly HTML_PRELOAD: "html-preload-plugin";
157
- /** MiniCssExtractPlugin */
158
- readonly MINI_CSS_EXTRACT: "mini-css-extract";
159
- /** VueLoaderPlugin */
160
- readonly VUE_LOADER_PLUGIN: "vue-loader-plugin";
161
- /** ReactFastRefreshPlugin */
162
- readonly REACT_FAST_REFRESH: "react-fast-refresh";
163
- /** ProvidePlugin for node polyfill */
164
- readonly NODE_POLYFILL_PROVIDE: "node-polyfill-provide";
165
- /** WebpackSRIPlugin */
166
- readonly SUBRESOURCE_INTEGRITY: "subresource-integrity";
167
- /** WebpackAssetsRetryPlugin */
168
- readonly ASSETS_RETRY: "ASSETS_RETRY";
169
- /** AutoSetRootFontSizePlugin */
170
- readonly AUTO_SET_ROOT_SIZE: "auto-set-root-size";
171
- /** HtmlAsyncChunkPlugin */
172
- readonly HTML_ASYNC_CHUNK: "html-async-chunk";
173
- /** SWC_POLYFILL_CHECKER */
174
- readonly SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin";
175
- /** RouterPlugin */
176
- readonly ROUTER_MANIFEST: "route-plugin";
177
- };
178
- /** Predefined minimizers */
179
- readonly MINIMIZER: {
180
- /** TerserWebpackPlugin */
181
- readonly JS: "js";
182
- /** CssMinimizerWebpackPlugin */
183
- readonly CSS: "css";
184
- /** ESBuildPlugin */
185
- readonly ESBUILD: "js-css";
186
- /** SWCPlugin */
187
- readonly SWC: "swc";
188
- };
189
- /** Predefined resolve plugins */
190
- readonly RESOLVE_PLUGIN: {
191
- /** ModuleScopePlugin */
192
- readonly MODULE_SCOPE: "module-scope";
193
- /** TsConfigPathsPlugin */
194
- readonly TS_CONFIG_PATHS: "ts-config-paths";
195
- };
2
+ /** Predefined rules */
3
+ readonly RULE: {
4
+ /** Rule for .mjs */
5
+ readonly MJS: "mjs";
6
+ /** Rule for predefined loaders */
7
+ readonly LOADERS: "loaders";
8
+ /** Rule for fonts */
9
+ readonly FONT: "font";
10
+ /** Rule for images */
11
+ readonly IMAGE: "image";
12
+ /** Rule for media */
13
+ readonly MEDIA: "media";
14
+ /** Rule for js */
15
+ readonly JS: "js";
16
+ /** Rule for data uri encoded javascript */
17
+ readonly JS_DATA_URI: "js-data-uri";
18
+ /** Rule for ts */
19
+ readonly TS: "ts";
20
+ /** Rule for css */
21
+ readonly CSS: "css";
22
+ /** Rule for less */
23
+ readonly LESS: "less";
24
+ /** Rule for sass */
25
+ readonly SASS: "sass";
26
+ /** Rule for stylus */
27
+ readonly STYLUS: "stylus";
28
+ /** Rule for svg */
29
+ readonly SVG: "svg";
30
+ /** Rule for pug */
31
+ readonly PUG: "pug";
32
+ /** Rule for Vue */
33
+ readonly VUE: "vue";
34
+ /** Rule for toml */
35
+ readonly TOML: "toml";
36
+ /** Rule for yaml */
37
+ readonly YAML: "yaml";
38
+ /** Rule for wasm */
39
+ readonly WASM: "wasm";
40
+ /** Rule for node */
41
+ readonly NODE: "node";
42
+ /** Rule for bff */
43
+ readonly JS_BFF_API: "js-bff-api";
44
+ };
45
+ /** Predefined rule groups */
46
+ readonly ONE_OF: {
47
+ readonly SVG: "svg";
48
+ readonly SVG_URL: "svg-url";
49
+ readonly SVG_ASSET: "svg-asset";
50
+ readonly SVG_INLINE: "svg-inline";
51
+ };
52
+ /** Predefined loaders */
53
+ readonly USE: {
54
+ /** ts-loader */
55
+ readonly TS: "ts";
56
+ /** css-loader */
57
+ readonly CSS: "css";
58
+ /** sass-loader */
59
+ readonly SASS: "sass";
60
+ /** less-loader */
61
+ readonly LESS: "less";
62
+ /** stylus-loader */
63
+ readonly STYLUS: "stylus";
64
+ /** url-loader */
65
+ readonly URL: "url";
66
+ /** pug-loader */
67
+ readonly PUG: "pug";
68
+ /** vue-loader */
69
+ readonly VUE: "vue";
70
+ /** file-loader */
71
+ readonly FILE: "file";
72
+ /** @svgr/webpack */
73
+ readonly SVGR: "svgr";
74
+ /** yaml-loader */
75
+ readonly YAML: "yaml";
76
+ /** toml-loader */
77
+ readonly TOML: "toml";
78
+ /** html-loader */
79
+ readonly HTML: "html";
80
+ /** node-loader */
81
+ readonly NODE: "html";
82
+ /** babel-loader */
83
+ readonly BABEL: "babel";
84
+ /** esbuild-loader */
85
+ readonly ESBUILD: "esbuild";
86
+ /** swc-loader */
87
+ readonly SWC: "swc";
88
+ /** style-loader */
89
+ readonly STYLE: "style-loader";
90
+ /** postcss-loader */
91
+ readonly POSTCSS: "postcss";
92
+ /** ignore-css-loader */
93
+ readonly IGNORE_CSS: "ignore-css";
94
+ /** css-modules-typescript-loader */
95
+ readonly CSS_MODULES_TS: "css-modules-typescript";
96
+ /** mini-css-extract-plugin.loader */
97
+ readonly MINI_CSS_EXTRACT: "mini-css-extract";
98
+ /** resolve-url-loader */
99
+ readonly RESOLVE_URL_LOADER_FOR_SASS: "resolve-url-loader";
100
+ /** builder-plugin-image-compress.loader */
101
+ readonly IMAGE_COMPRESS: "image-compress";
102
+ /** builder-plugin-image-compress svgo-loader */
103
+ readonly SVGO: "svgo";
104
+ /** builder-plugin-imagex */
105
+ readonly IMAGEX: "imagex";
106
+ /** storybook-react-docgen */
107
+ readonly REACT_DOCGEN: "react-docgen";
108
+ };
109
+ /** Predefined plugins */
110
+ readonly PLUGIN: {
111
+ /** HotModuleReplacementPlugin */
112
+ readonly HMR: "hmr";
113
+ /** CopyWebpackPlugin */
114
+ readonly COPY: "copy";
115
+ /** HtmlWebpackPlugin */
116
+ readonly HTML: "html";
117
+ /** DefinePlugin */
118
+ readonly DEFINE: "define";
119
+ /** IgnorePlugin */
120
+ readonly IGNORE: "ignore";
121
+ /** BannerPlugin */
122
+ readonly BANNER: "banner";
123
+ /** Webpackbar */
124
+ readonly PROGRESS: "progress";
125
+ /** Inspector */
126
+ readonly INSPECTOR: "inspector";
127
+ /** AppIconPlugin */
128
+ readonly APP_ICON: "app-icon";
129
+ /** FaviconUrlPlugin */
130
+ readonly FAVICON_URL: "favicon-url";
131
+ /** LoadableWebpackPlugin */
132
+ readonly LOADABLE: "loadable";
133
+ /** WebpackManifestPlugin */
134
+ readonly MANIFEST: "webpack-manifest";
135
+ /** ForkTsCheckerWebpackPlugin */
136
+ readonly TS_CHECKER: "ts-checker";
137
+ /** InlineChunkHtmlPlugin */
138
+ readonly INLINE_HTML: "inline-html";
139
+ /** WebpackBundleAnalyzer */
140
+ readonly BUNDLE_ANALYZER: "bundle-analyze";
141
+ /** BottomTemplatePlugin */
142
+ readonly BOTTOM_TEMPLATE: "bottom-template";
143
+ /** HtmlTagsPlugin */
144
+ readonly HTML_TAGS: "html-tags";
145
+ /** HtmlNoncePlugin */
146
+ readonly HTML_NONCE: "html-nonce";
147
+ /** HtmlCrossOriginPlugin */
148
+ readonly HTML_CROSS_ORIGIN: "html-cross-origin";
149
+ /** htmlPreconnectPlugin */
150
+ readonly HTML_PRECONNECT: "html-preconnect-plugin";
151
+ /** htmlDnsPrefetchPlugin */
152
+ readonly HTML_DNS_PREFETCH: "html-dns-prefetch-plugin";
153
+ /** htmlPrefetchPlugin */
154
+ readonly HTML_PREFETCH: "html-prefetch-plugin";
155
+ /** htmlPreloadPlugin */
156
+ readonly HTML_PRELOAD: "html-preload-plugin";
157
+ /** MiniCssExtractPlugin */
158
+ readonly MINI_CSS_EXTRACT: "mini-css-extract";
159
+ /** VueLoaderPlugin */
160
+ readonly VUE_LOADER_PLUGIN: "vue-loader-plugin";
161
+ /** ReactFastRefreshPlugin */
162
+ readonly REACT_FAST_REFRESH: "react-fast-refresh";
163
+ /** ProvidePlugin for node polyfill */
164
+ readonly NODE_POLYFILL_PROVIDE: "node-polyfill-provide";
165
+ /** WebpackSRIPlugin */
166
+ readonly SUBRESOURCE_INTEGRITY: "subresource-integrity";
167
+ /** WebpackAssetsRetryPlugin */
168
+ readonly ASSETS_RETRY: "ASSETS_RETRY";
169
+ /** AutoSetRootFontSizePlugin */
170
+ readonly AUTO_SET_ROOT_SIZE: "auto-set-root-size";
171
+ /** HtmlAsyncChunkPlugin */
172
+ readonly HTML_ASYNC_CHUNK: "html-async-chunk";
173
+ /** SWC_POLYFILL_CHECKER */
174
+ readonly SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin";
175
+ /** RouterPlugin */
176
+ readonly ROUTER_MANIFEST: "route-plugin";
177
+ };
178
+ /** Predefined minimizers */
179
+ readonly MINIMIZER: {
180
+ /** TerserWebpackPlugin */
181
+ readonly JS: "js";
182
+ /** CssMinimizerWebpackPlugin */
183
+ readonly CSS: "css";
184
+ /** ESBuildPlugin */
185
+ readonly ESBUILD: "js-css";
186
+ /** SWCPlugin */
187
+ readonly SWC: "swc";
188
+ };
189
+ /** Predefined resolve plugins */
190
+ readonly RESOLVE_PLUGIN: {
191
+ /** ModuleScopePlugin */
192
+ readonly MODULE_SCOPE: "module-scope";
193
+ /** TsConfigPathsPlugin */
194
+ readonly TS_CONFIG_PATHS: "ts-config-paths";
195
+ };
196
196
  };
197
- export type ChainIdentifier = typeof CHAIN_ID;
197
+ export type ChainIdentifier = typeof CHAIN_ID;
@@ -89,4 +89,4 @@ export declare const SERVER_PLUGIN_KOA = "@modern-js/plugin-koa";
89
89
  export declare const SERVER_PLUGIN_SERVER = "@modern-js/plugin-server";
90
90
  export declare const SERVER_PLUGIN_POLYFILL = "@modern-js/plugin-polyfill";
91
91
  export declare const INTERNAL_SERVER_PLUGINS: InternalPlugins;
92
- export * from './chainId';
92
+ export * from './chainId';
@@ -5,4 +5,4 @@
5
5
  * @returns Resolved absolute file path.
6
6
  */
7
7
  export declare const ensureAbsolutePath: (base: string, filePath: string) => string;
8
- export declare const ensureArray: <T>(params: T | T[]) => T[];
8
+ export declare const ensureArray: <T>(params: T | T[]) => T[];
@@ -4,4 +4,4 @@
4
4
  * @returns The file path if exists, or false if no file exists.
5
5
  */
6
6
  export declare const findExists: (files: string[]) => string | false;
7
- export declare const emptyDir: (dir: string) => Promise<void>;
7
+ export declare const emptyDir: (dir: string) => Promise<void>;
@@ -1 +1 @@
1
- export declare const getEntryOptions: <T>(name: string, isMainEntry: boolean, baseOptions?: T | undefined, optionsByEntries?: Record<string, T> | undefined, packageName?: string) => T | undefined;
1
+ export declare const getEntryOptions: <T>(name: string, isMainEntry: boolean, baseOptions?: T | undefined, optionsByEntries?: Record<string, T> | undefined, packageName?: string) => T | undefined;
@@ -6,4 +6,4 @@ export declare const defaults: string[];
6
6
  export declare const getBrowserslist: (appDirectory: string) => string[];
7
7
  export declare function getInternalPlugins(appDirectory: string, internalPlugins?: InternalPlugins): string[];
8
8
  export declare const readTsConfig: (root: string) => any;
9
- export declare const readTsConfigByFile: (filename: string) => any;
9
+ export declare const readTsConfigByFile: (filename: string) => any;
@@ -1,4 +1,4 @@
1
1
  export declare const getServerConfig: (appDirectory: string, configFile: string) => Promise<string | false>;
2
2
  export declare const getTargetDir: (from: string, baseDir: string, targetBaseDir: string) => string;
3
3
  export * from './data';
4
- export * from './config';
4
+ export * from './config';
@@ -17,4 +17,4 @@ export * from './prettyInstructions';
17
17
  export * from './require';
18
18
  export * from './runtimeExports';
19
19
  export * from './watch';
20
- export * from './config';
20
+ export * from './config';
@@ -1,5 +1,5 @@
1
1
  interface EntryPoint {
2
- entryName: string;
2
+ entryName: string;
3
3
  }
4
4
  /**
5
5
  * Is SSR project
@@ -17,12 +17,12 @@ export declare const isUseSSRBundle: (config: any) => boolean;
17
17
  */
18
18
  export declare const isServiceWorker: (config: any) => boolean;
19
19
  export declare const isRouterV5: (config: {
20
- runtime?: {
21
- router?: {
22
- mode?: string;
23
- } | boolean;
24
- };
20
+ runtime?: {
21
+ router?: {
22
+ mode?: string;
23
+ } | boolean;
24
+ };
25
25
  }) => boolean;
26
26
  export declare const isSSGEntry: (config: any, entryName: string, entrypoints: EntryPoint[]) => boolean;
27
27
  export declare const isSingleEntry: (entrypoints: EntryPoint[], mainEntryName?: string) => boolean;
28
- export {};
28
+ export {};
@@ -5,4 +5,4 @@ export declare const getNodeEnv: () => string;
5
5
  export declare const isDev: () => boolean;
6
6
  export declare const isProd: () => boolean;
7
7
  export declare const isTest: () => boolean;
8
- export declare const isBrowser: () => boolean;
8
+ export declare const isBrowser: () => boolean;
@@ -1,4 +1,4 @@
1
1
  export * from './env';
2
2
  export * from './type';
3
3
  export * from './config';
4
- export * from './project';
4
+ export * from './project';
@@ -30,4 +30,4 @@ export declare const isReact18: (cwd: string) => boolean;
30
30
  * @param root - App directory.
31
31
  * @returns Whether to use typescript.
32
32
  */
33
- export declare const isTypescript: (root: string) => boolean;
33
+ export declare const isTypescript: (root: string) => boolean;
@@ -12,4 +12,4 @@ export declare function isRegExp(obj: any): obj is RegExp;
12
12
  * @param o - Any object.
13
13
  * @returns Whether it is empty object.
14
14
  */
15
- export declare const isEmpty: (o: Record<string, unknown>) => boolean;
15
+ export declare const isEmpty: (o: Record<string, unknown>) => boolean;
@@ -1 +1 @@
1
- export { logger, createLogger, type Logger } from 'rslog';
1
+ export { logger, createLogger, type Logger } from 'rslog';
@@ -5,6 +5,6 @@ export declare const isPnpmWorkspaces: (root: string) => boolean;
5
5
  export declare const isMonorepo: (root: string) => boolean;
6
6
  export declare const findMonorepoRoot: (appDirectory: string, maxDepth?: number) => string | undefined;
7
7
  export declare const getMonorepoPackages: (root: string) => {
8
- name: string;
9
- path: string;
10
- }[];
8
+ name: string;
9
+ path: string;
10
+ }[];
@@ -1,4 +1,4 @@
1
1
  export declare function getPnpmVersion(): Promise<string>;
2
2
  export declare function canUseNpm(): Promise<boolean>;
3
3
  export declare function canUseYarn(): Promise<boolean>;
4
- export declare function canUsePnpm(): Promise<boolean>;
4
+ export declare function canUsePnpm(): Promise<boolean>;
@@ -8,4 +8,4 @@ export declare function splitPathString(str: string): string[];
8
8
  export declare const removeLeadingSlash: (s: string) => string;
9
9
  export declare const removeTailSlash: (s: string) => string;
10
10
  export declare const removeSlash: (s: string) => string;
11
- export declare const cutNameByHyphen: (s: string) => string;
11
+ export declare const cutNameByHyphen: (s: string) => string;
@@ -5,12 +5,8 @@
5
5
  * @param strictPort - Whether to throw an error when the port is occupied.
6
6
  * @returns Available port number.
7
7
  */
8
- export declare const getPort: (port: string | number, {
9
- tryLimits,
10
- strictPort,
11
- slient
12
- }?: {
13
- tryLimits?: number | undefined;
14
- strictPort?: boolean | undefined;
15
- slient?: boolean | undefined;
16
- }) => Promise<number>;
8
+ export declare const getPort: (port: string | number, { tryLimits, strictPort, slient, }?: {
9
+ tryLimits?: number | undefined;
10
+ strictPort?: boolean | undefined;
11
+ slient?: boolean | undefined;
12
+ }) => Promise<number>;
@@ -1,9 +1,9 @@
1
1
  export type AddressUrl = {
2
- label: string;
3
- url: string;
2
+ label: string;
3
+ url: string;
4
4
  };
5
5
  export declare const getAddressUrls: (protocol: string | undefined, port: number, host?: string) => {
6
- label: string;
7
- url: string;
6
+ label: string;
7
+ url: string;
8
8
  }[];
9
- export declare const prettyInstructions: (appContext: any, config: any) => string;
9
+ export declare const prettyInstructions: (appContext: any, config: any) => string;
@@ -6,8 +6,8 @@
6
6
  export declare const compatRequire: (filePath: string, interop?: boolean) => any;
7
7
  export declare const dynamicImport: Function;
8
8
  export declare const requireExistModule: (filename: string, opt?: {
9
- extensions?: string[];
10
- interop?: boolean;
9
+ extensions?: string[];
10
+ interop?: boolean;
11
11
  }) => any;
12
12
  export declare const cleanRequireCache: (filelist: string[]) => void;
13
13
  export declare function deleteRequireCache(path: string): void;
@@ -17,4 +17,4 @@ export declare function deleteRequireCache(path: string): void;
17
17
  * @param resolvePath - Path to resolve dependencies.
18
18
  * @returns Resolved file path.
19
19
  */
20
- export declare const tryResolve: (name: string, resolvePath: string) => string;
20
+ export declare const tryResolve: (name: string, resolvePath: string) => string;
@@ -1,4 +1,4 @@
1
1
  export declare const createRuntimeExportsUtils: (pwd?: any, namespace?: any) => {
2
- addExport: (statement: string) => void;
3
- getPath: () => string;
4
- };
2
+ addExport: (statement: string) => void;
3
+ getPath: () => string;
4
+ };
@@ -1,8 +1,8 @@
1
1
  export type WatchChangeTypeValueT = 'add' | 'unlink' | 'change';
2
2
  export declare const WatchChangeType: Record<'ADD' | 'UNLINK' | 'CHANGE', WatchChangeTypeValueT>;
3
3
  type RunTaskType = (option: {
4
- changedFilePath: string;
5
- changeType: WatchChangeTypeValueT;
4
+ changedFilePath: string;
5
+ changeType: WatchChangeTypeValueT;
6
6
  }) => void | Promise<void>;
7
7
  export declare const watch: (watchDir: string | string[], runTask: RunTaskType, ignored?: (string | RegExp)[]) => import("../compiled").FSWatcher;
8
- export {};
8
+ export {};
@@ -38,4 +38,4 @@ export type { default as WebpackChain } from '../compiled/webpack-chain';
38
38
  */
39
39
  export declare const mime: typeof import('../compiled/mime-types');
40
40
  export declare const chokidar: typeof import('../compiled/chokidar');
41
- export declare const inquirer: typeof import('../compiled/inquirer');
41
+ export declare const inquirer: typeof import('../compiled/inquirer');
@@ -1,5 +1,5 @@
1
1
  declare const lazy: (moduleName: string, requireFn: (id: string) => unknown) => any;
2
2
  export { lazy as lazyImport };
3
3
  export declare const Import: {
4
- lazy: (moduleName: string, requireFn: (id: string) => unknown) => any;
5
- };
4
+ lazy: (moduleName: string, requireFn: (id: string) => unknown) => any;
5
+ };
@@ -1,3 +1,3 @@
1
1
  export * from './compiled';
2
2
  export * from './cli';
3
- export * from './import';
3
+ export * from './import';
@@ -17,4 +17,4 @@ export declare const HTML_CHUNKSMAP_SEPARATOR = "<!--<?- chunksMap.js ?>-->";
17
17
  /**
18
18
  * reporter name for server loader
19
19
  */
20
- export declare const LOADER_REPORTER_NAME = "server-loader";
20
+ export declare const LOADER_REPORTER_NAME = "server-loader";
@@ -7,20 +7,20 @@
7
7
  */
8
8
  import type { StatsCompilation } from 'webpack';
9
9
  export declare function addErrorTips(errors: string[], color?: {
10
- gray: (message: string) => string;
11
- cyan: (message: string) => string;
12
- green: (message: string) => string;
13
- yellow: (message: string) => string;
14
- underline: (message: string) => string;
10
+ gray: (message: string) => string;
11
+ cyan: (message: string) => string;
12
+ green: (message: string) => string;
13
+ yellow: (message: string) => string;
14
+ underline: (message: string) => string;
15
15
  }): string[];
16
16
  declare function formatWebpackMessages(json?: Pick<StatsCompilation, 'errors' | 'warnings'>, color?: {
17
- gray: (message: string) => string;
18
- cyan: (message: string) => string;
19
- green: (message: string) => string;
20
- yellow: (message: string) => string;
21
- underline: (message: string) => string;
17
+ gray: (message: string) => string;
18
+ cyan: (message: string) => string;
19
+ green: (message: string) => string;
20
+ yellow: (message: string) => string;
21
+ underline: (message: string) => string;
22
22
  }): {
23
- errors: string[];
24
- warnings: string[];
23
+ errors: string[];
24
+ warnings: string[];
25
25
  };
26
- export { formatWebpackMessages };
26
+ export { formatWebpackMessages };
@@ -1 +1 @@
1
- export declare const pluginDagSort: <P extends Record<string, any>>(plugins: P[], key?: string, preKey?: string, postKey?: string) => P[];
1
+ export declare const pluginDagSort: <P extends Record<string, any>>(plugins: P[], key?: string, preKey?: string, postKey?: string) => P[];
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.40.0",
18
+ "version": "2.42.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -146,7 +146,7 @@
146
146
  "caniuse-lite": "^1.0.30001520",
147
147
  "lodash": "^4.17.21",
148
148
  "rslog": "^1.1.0",
149
- "@swc/helpers": "0.5.1"
149
+ "@swc/helpers": "0.5.3"
150
150
  },
151
151
  "devDependencies": {
152
152
  "@types/jest": "^29",
@@ -154,9 +154,9 @@
154
154
  "jest": "^29",
155
155
  "typescript": "^5",
156
156
  "webpack": "^5.88.1",
157
- "@modern-js/types": "2.40.0",
158
- "@scripts/build": "2.40.0",
159
- "@scripts/jest-config": "2.40.0"
157
+ "@modern-js/types": "2.42.0",
158
+ "@scripts/build": "2.42.0",
159
+ "@scripts/jest-config": "2.42.0"
160
160
  },
161
161
  "sideEffects": false,
162
162
  "scripts": {