@modern-js/utils 1.3.6 → 1.3.8-canary.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.
- package/.eslintrc.js +9 -0
- package/CHANGELOG.md +6 -0
- package/compiled/browserslist/index.d.ts +178 -0
- package/compiled/browserslist/index.js +1 -0
- package/compiled/browserslist/license +20 -0
- package/compiled/browserslist/package.json +1 -0
- package/compiled/chalk/index.d.ts +415 -0
- package/compiled/chalk/index.js +1 -0
- package/compiled/chalk/license +9 -0
- package/compiled/chalk/package.json +1 -0
- package/compiled/chokidar/anymatch/index.d.ts +19 -0
- package/compiled/chokidar/fsevents.node +0 -0
- package/compiled/chokidar/index.js +40 -0
- package/compiled/chokidar/license +21 -0
- package/compiled/chokidar/package.json +1 -0
- package/compiled/chokidar/types/index.d.ts +188 -0
- package/compiled/commander/index.js +1 -0
- package/compiled/commander/license +22 -0
- package/compiled/commander/package.json +1 -0
- package/compiled/commander/typings/index.d.ts +774 -0
- package/compiled/debug/index.d.ts +54 -0
- package/compiled/debug/index.js +1 -0
- package/compiled/debug/license +20 -0
- package/compiled/debug/ms/index.d.ts +25 -0
- package/compiled/debug/package.json +1 -0
- package/compiled/execa/index.d.ts +564 -0
- package/compiled/execa/index.js +1 -0
- package/compiled/execa/license +9 -0
- package/compiled/execa/package.json +1 -0
- package/compiled/filesize/filesize.d.ts +131 -0
- package/compiled/filesize/index.js +9 -0
- package/compiled/filesize/license +28 -0
- package/compiled/filesize/package.json +1 -0
- package/compiled/fs-extra/index.d.ts +563 -0
- package/compiled/fs-extra/index.js +1 -0
- package/compiled/fs-extra/license +15 -0
- package/compiled/fs-extra/package.json +1 -0
- package/compiled/glob/index.d.ts +91 -0
- package/compiled/glob/index.js +1 -0
- package/compiled/glob/license +21 -0
- package/compiled/glob/minimatch/index.d.ts +204 -0
- package/compiled/glob/package.json +1 -0
- package/compiled/gzip-size/index.d.ts +96 -0
- package/compiled/gzip-size/index.js +1 -0
- package/compiled/gzip-size/license +9 -0
- package/compiled/gzip-size/package.json +1 -0
- package/compiled/import-lazy/index.d.ts +26 -0
- package/compiled/import-lazy/index.js +1 -0
- package/compiled/import-lazy/license +9 -0
- package/compiled/import-lazy/package.json +1 -0
- package/compiled/js-yaml/index.d.ts +154 -0
- package/compiled/js-yaml/index.js +1 -0
- package/compiled/js-yaml/license +21 -0
- package/compiled/js-yaml/package.json +1 -0
- package/compiled/lodash/common/array.d.ts +2126 -0
- package/compiled/lodash/common/collection.d.ts +1930 -0
- package/compiled/lodash/common/common.d.ts +280 -0
- package/compiled/lodash/common/date.d.ts +23 -0
- package/compiled/lodash/common/function.d.ts +1446 -0
- package/compiled/lodash/common/lang.d.ts +1693 -0
- package/compiled/lodash/common/math.d.ts +405 -0
- package/compiled/lodash/common/number.d.ts +131 -0
- package/compiled/lodash/common/object.d.ts +2519 -0
- package/compiled/lodash/common/seq.d.ts +210 -0
- package/compiled/lodash/common/string.d.ts +788 -0
- package/compiled/lodash/common/util.d.ts +1220 -0
- package/compiled/lodash/index.d.ts +46 -0
- package/compiled/lodash/index.js +9 -0
- package/compiled/lodash/license +47 -0
- package/compiled/lodash/package.json +1 -0
- package/compiled/pkg-up/index.d.ts +48 -0
- package/compiled/pkg-up/index.js +1 -0
- package/compiled/pkg-up/license +9 -0
- package/compiled/pkg-up/package.json +1 -0
- package/compiled/recursive-readdir/index.d.ts +21 -0
- package/compiled/recursive-readdir/index.js +1 -0
- package/compiled/recursive-readdir/license +21 -0
- package/compiled/recursive-readdir/package.json +1 -0
- package/compiled/signale/index.d.ts +162 -0
- package/compiled/signale/index.js +1 -0
- package/compiled/signale/package.json +1 -0
- package/compiled/strip-ansi/index.d.ts +17 -0
- package/compiled/strip-ansi/index.js +1 -0
- package/compiled/strip-ansi/license +9 -0
- package/compiled/strip-ansi/package.json +1 -0
- package/compiled/upath/index.js +1 -0
- package/compiled/upath/license +22 -0
- package/compiled/upath/package.json +1 -0
- package/compiled/upath/upath.d.ts +241 -0
- package/dist/FileSizeReporter.d.ts +16 -0
- package/dist/FileSizeReporter.js +151 -0
- package/dist/alias.d.ts +21 -0
- package/dist/alias.js +62 -0
- package/dist/applyOptionsChain.d.ts +6 -0
- package/dist/applyOptionsChain.js +30 -0
- package/dist/clearConsole.d.ts +1 -0
- package/dist/clearConsole.js +9 -0
- package/dist/compatRequire.d.ts +8 -0
- package/dist/compatRequire.js +28 -0
- package/dist/compiled.d.ts +21 -0
- package/dist/compiled.js +33 -0
- package/dist/constants.d.ts +222 -0
- package/dist/constants.js +277 -0
- package/dist/{js/modern/debug.js → debug.d.ts} +1 -3
- package/dist/debug.js +11 -0
- package/dist/emptyDir.d.ts +1 -0
- package/dist/emptyDir.js +19 -0
- package/dist/{js/modern/ensureAbsolutePath.js → ensureAbsolutePath.d.ts} +1 -3
- package/dist/ensureAbsolutePath.js +15 -0
- package/dist/findExists.d.ts +6 -0
- package/dist/findExists.js +21 -0
- package/dist/format.d.ts +16 -0
- package/dist/format.js +113 -0
- package/dist/generateMetaTags.d.ts +16 -0
- package/dist/generateMetaTags.js +48 -0
- package/dist/getBrowserslist.d.ts +2 -0
- package/dist/getBrowserslist.js +7 -0
- package/dist/getCacheIdentifier.d.ts +7 -0
- package/dist/getCacheIdentifier.js +24 -0
- package/dist/getEntryOptions.d.ts +1 -0
- package/dist/getEntryOptions.js +26 -0
- package/dist/getPackageManager.d.ts +1 -0
- package/dist/getPackageManager.js +47 -0
- package/dist/getPort.d.ts +7 -0
- package/dist/getPort.js +62 -0
- package/dist/getServerConfig.d.ts +1 -0
- package/dist/getServerConfig.js +39 -0
- package/dist/import.d.ts +5 -0
- package/dist/import.js +10 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +45 -0
- package/dist/is/index.d.ts +34 -0
- package/dist/is/index.js +82 -0
- package/dist/is/node-env.d.ts +4 -0
- package/dist/is/node-env.js +12 -0
- package/dist/is/platform.d.ts +2 -0
- package/dist/is/platform.js +10 -0
- package/dist/is/type.d.ts +8 -0
- package/dist/is/type.js +38 -0
- package/dist/js/modern/monorepo.js +4 -5
- package/dist/js/node/monorepo.js +5 -7
- package/dist/js/treeshaking/monorepo.js +7 -6
- package/dist/logger.d.ts +63 -0
- package/dist/logger.js +128 -0
- package/dist/monorepo.d.ts +11 -0
- package/dist/monorepo.js +80 -0
- package/dist/nodeEnv.d.ts +3 -0
- package/dist/nodeEnv.js +49 -0
- package/dist/path.d.ts +3 -0
- package/dist/path.js +14 -0
- package/dist/{types/pkgUp.d.ts → pkgUp.d.ts} +1 -1
- package/dist/pkgUp.js +8 -0
- package/dist/prettyInstructions.d.ts +6 -0
- package/dist/prettyInstructions.js +64 -0
- package/dist/printBuildError.d.ts +8 -0
- package/dist/printBuildError.js +43 -0
- package/dist/readTsConfig.d.ts +2 -0
- package/dist/readTsConfig.js +19 -0
- package/dist/removeSlash.d.ts +3 -0
- package/dist/removeSlash.js +9 -0
- package/dist/runtimeExports.d.ts +4 -0
- package/dist/runtimeExports.js +53 -0
- package/dist/ssrHelpers.d.ts +4 -0
- package/dist/ssrHelpers.js +7 -0
- package/dist/storage.d.ts +5 -0
- package/dist/storage.js +61 -0
- package/dist/types/FileSizeReporter.d.ts +5 -5
- package/dist/types/alias.d.ts +12 -14
- package/dist/types/applyOptionsChain.d.ts +5 -5
- package/dist/types/clearConsole.d.ts +1 -1
- package/dist/types/compatRequire.d.ts +1 -1
- package/dist/types/compiled.d.ts +17 -0
- package/dist/types/constants.d.ts +165 -162
- package/dist/types/debug.d.ts +1 -3
- package/dist/types/emptyDir.d.ts +1 -1
- package/dist/types/ensureAbsolutePath.d.ts +1 -1
- package/dist/types/findExists.d.ts +1 -1
- package/dist/types/format.d.ts +5 -5
- package/dist/types/generateMetaTags.d.ts +3 -3
- package/dist/types/getBrowserslist.d.ts +1 -1
- package/dist/types/getCacheIdentifier.d.ts +3 -3
- package/dist/types/getEntryOptions.d.ts +1 -1
- package/dist/types/getPackageManager.d.ts +1 -1
- package/dist/types/getPort.d.ts +1 -1
- package/dist/types/getServerConfig.d.ts +1 -0
- package/dist/types/import.d.ts +2 -2
- package/dist/types/index.d.ts +3 -4
- package/dist/types/is/index.d.ts +1 -4
- package/dist/types/is/node-env.d.ts +1 -1
- package/dist/types/is/platform.d.ts +1 -1
- package/dist/types/is/type.d.ts +1 -1
- package/dist/types/logger.d.ts +49 -49
- package/dist/types/monorepo.d.ts +3 -3
- package/dist/types/nodeEnv.d.ts +1 -1
- package/dist/types/path.d.ts +1 -1
- package/dist/types/prettyInstructions.d.ts +2 -2
- package/dist/types/printBuildError.d.ts +1 -1
- package/dist/types/readTsConfig.d.ts +1 -1
- package/dist/types/removeSlash.d.ts +1 -1
- package/dist/types/runtimeExports.d.ts +3 -3
- package/dist/types/wait.d.ts +1 -1
- package/dist/types/watch.d.ts +4 -4
- package/dist/wait.d.ts +2 -0
- package/dist/wait.js +7 -0
- package/dist/watch.d.ts +8 -0
- package/dist/watch.js +64 -0
- package/jest.config.js +0 -1
- package/package.json +57 -40
- package/tests/debug.test.ts +2 -2
- package/tests/is.test.ts +27 -0
- package/tests/isPlatform.test.ts +19 -0
- package/tests/prettyInstructions.test.ts +1 -1
- package/tsconfig.json +3 -5
- package/dist/js/modern/FileSizeReporter.js +0 -156
- package/dist/js/modern/alias.js +0 -74
- package/dist/js/modern/applyOptionsChain.js +0 -27
- package/dist/js/modern/chalk.js +0 -2
- package/dist/js/modern/clearConsole.js +0 -5
- package/dist/js/modern/compatRequire.js +0 -26
- package/dist/js/modern/constants.js +0 -333
- package/dist/js/modern/emptyDir.js +0 -6
- package/dist/js/modern/findExists.js +0 -16
- package/dist/js/modern/format.js +0 -137
- package/dist/js/modern/generateMetaTags.js +0 -49
- package/dist/js/modern/getBrowserslist.js +0 -5
- package/dist/js/modern/getCacheIdentifier.js +0 -20
- package/dist/js/modern/getEntryOptions.js +0 -24
- package/dist/js/modern/getPackageManager.js +0 -37
- package/dist/js/modern/getPort.js +0 -52
- package/dist/js/modern/import.js +0 -11
- package/dist/js/modern/index.js +0 -34
- package/dist/js/modern/is/index.js +0 -77
- package/dist/js/modern/is/node-env.js +0 -5
- package/dist/js/modern/is/platform.js +0 -2
- package/dist/js/modern/is/type.js +0 -27
- package/dist/js/modern/logger.js +0 -152
- package/dist/js/modern/nodeEnv.js +0 -31
- package/dist/js/modern/path.js +0 -5
- package/dist/js/modern/pkgUp.js +0 -2
- package/dist/js/modern/prettyInstructions.js +0 -79
- package/dist/js/modern/printBuildError.js +0 -40
- package/dist/js/modern/readTsConfig.js +0 -13
- package/dist/js/modern/removeSlash.js +0 -3
- package/dist/js/modern/runtimeExports.js +0 -52
- package/dist/js/modern/wait.js +0 -5
- package/dist/js/modern/watch.js +0 -43
- package/dist/js/node/FileSizeReporter.js +0 -175
- package/dist/js/node/alias.js +0 -97
- package/dist/js/node/applyOptionsChain.js +0 -37
- package/dist/js/node/chalk.js +0 -15
- package/dist/js/node/clearConsole.js +0 -14
- package/dist/js/node/compatRequire.js +0 -41
- package/dist/js/node/constants.js +0 -353
- package/dist/js/node/debug.js +0 -19
- package/dist/js/node/emptyDir.js +0 -18
- package/dist/js/node/ensureAbsolutePath.js +0 -20
- package/dist/js/node/findExists.js +0 -27
- package/dist/js/node/format.js +0 -141
- package/dist/js/node/generateMetaTags.js +0 -58
- package/dist/js/node/getBrowserslist.js +0 -17
- package/dist/js/node/getCacheIdentifier.js +0 -27
- package/dist/js/node/getEntryOptions.js +0 -35
- package/dist/js/node/getPackageManager.js +0 -51
- package/dist/js/node/getPort.js +0 -67
- package/dist/js/node/import.js +0 -19
- package/dist/js/node/index.js +0 -465
- package/dist/js/node/is/index.js +0 -150
- package/dist/js/node/is/node-env.js +0 -23
- package/dist/js/node/is/platform.js +0 -14
- package/dist/js/node/is/type.js +0 -48
- package/dist/js/node/logger.js +0 -162
- package/dist/js/node/nodeEnv.js +0 -45
- package/dist/js/node/path.js +0 -24
- package/dist/js/node/pkgUp.js +0 -15
- package/dist/js/node/prettyInstructions.js +0 -95
- package/dist/js/node/printBuildError.js +0 -52
- package/dist/js/node/readTsConfig.js +0 -28
- package/dist/js/node/removeSlash.js +0 -18
- package/dist/js/node/runtimeExports.js +0 -68
- package/dist/js/node/wait.js +0 -12
- package/dist/js/node/watch.js +0 -61
- package/dist/js/treeshaking/FileSizeReporter.js +0 -185
- package/dist/js/treeshaking/alias.js +0 -72
- package/dist/js/treeshaking/applyOptionsChain.js +0 -31
- package/dist/js/treeshaking/chalk.js +0 -2
- package/dist/js/treeshaking/clearConsole.js +0 -5
- package/dist/js/treeshaking/compatRequire.js +0 -29
- package/dist/js/treeshaking/constants.js +0 -333
- package/dist/js/treeshaking/debug.js +0 -10
- package/dist/js/treeshaking/emptyDir.js +0 -37
- package/dist/js/treeshaking/ensureAbsolutePath.js +0 -11
- package/dist/js/treeshaking/findExists.js +0 -33
- package/dist/js/treeshaking/format.js +0 -167
- package/dist/js/treeshaking/generateMetaTags.js +0 -55
- package/dist/js/treeshaking/getBrowserslist.js +0 -7
- package/dist/js/treeshaking/getCacheIdentifier.js +0 -35
- package/dist/js/treeshaking/getEntryOptions.js +0 -26
- package/dist/js/treeshaking/getPackageManager.js +0 -101
- package/dist/js/treeshaking/getPort.js +0 -103
- package/dist/js/treeshaking/import.js +0 -11
- package/dist/js/treeshaking/index.js +0 -34
- package/dist/js/treeshaking/is/index.js +0 -81
- package/dist/js/treeshaking/is/node-env.js +0 -13
- package/dist/js/treeshaking/is/platform.js +0 -6
- package/dist/js/treeshaking/is/type.js +0 -29
- package/dist/js/treeshaking/logger.js +0 -188
- package/dist/js/treeshaking/nodeEnv.js +0 -108
- package/dist/js/treeshaking/path.js +0 -11
- package/dist/js/treeshaking/pkgUp.js +0 -2
- package/dist/js/treeshaking/prettyInstructions.js +0 -100
- package/dist/js/treeshaking/printBuildError.js +0 -40
- package/dist/js/treeshaking/readTsConfig.js +0 -13
- package/dist/js/treeshaking/removeSlash.js +0 -9
- package/dist/js/treeshaking/runtimeExports.js +0 -61
- package/dist/js/treeshaking/wait.js +0 -8
- package/dist/js/treeshaking/watch.js +0 -112
- package/dist/types/chalk.d.ts +0 -2
package/dist/types/alias.d.ts
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
declare type AliasOption = Record<string, string> | ((aliases: Record<string, string>) => Record<string, unknown>) | Record<string, string> | undefined;
|
|
2
2
|
interface NormalizedConfig {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
source: {
|
|
4
|
+
alias?: AliasOption | Array<AliasOption>;
|
|
5
|
+
};
|
|
6
6
|
}
|
|
7
7
|
interface IAliasConfig {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
absoluteBaseUrl: string;
|
|
9
|
+
paths?: Record<string, string | string[]>;
|
|
10
|
+
isTsPath?: boolean;
|
|
11
|
+
isTsProject?: boolean;
|
|
12
12
|
}
|
|
13
|
-
export declare const validAlias: <T extends NormalizedConfig>(modernConfig: T, {
|
|
14
|
-
|
|
15
|
-
}: {
|
|
16
|
-
tsconfigPath: string;
|
|
13
|
+
export declare const validAlias: <T extends NormalizedConfig>(modernConfig: T, { tsconfigPath }: {
|
|
14
|
+
tsconfigPath: string;
|
|
17
15
|
}) => string | null;
|
|
18
16
|
export declare const getAlias: (aliasOption: AliasOption | Array<AliasOption>, option: {
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
appDirectory: string;
|
|
18
|
+
tsconfigPath: string;
|
|
21
19
|
}) => IAliasConfig;
|
|
22
20
|
export declare const getUserAlias: (alias?: Record<string, string | string[]>) => Record<string, string | string[]>;
|
|
23
|
-
export {};
|
|
21
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const applyOptionsChain: <T, U>(defaults: T, options?: T | (T | ((config: T, utils?: U | undefined) => void | T))[] | ((config: T, utils?: U | undefined) => void | T) | undefined, utils?: U | undefined, mergeFn?: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}) => T;
|
|
2
|
+
<T_1, U_1>(target: T_1, source: U_1): T_1 & U_1;
|
|
3
|
+
<T_2, U_2, V>(target: T_2, source1: U_2, source2: V): T_2 & U_2 & V;
|
|
4
|
+
<T_3, U_3, V_1, W>(target: T_3, source1: U_3, source2: V_1, source3: W): T_3 & U_3 & V_1 & W;
|
|
5
|
+
(target: object, ...sources: any[]): any;
|
|
6
|
+
}) => T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const clearConsole: () => void;
|
|
1
|
+
export declare const clearConsole: () => void;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const compatRequire: (filePath: string) => any;
|
|
7
7
|
export declare const requireExistModule: (filename: string, extensions?: string[]) => any;
|
|
8
|
-
export declare const cleanRequireCache: (filelist: string[]) => void;
|
|
8
|
+
export declare const cleanRequireCache: (filelist: string[]) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import fs from '../compiled/fs-extra';
|
|
2
|
+
import chalk from '../compiled/chalk';
|
|
3
|
+
export { fs, chalk };
|
|
4
|
+
export type { IOptions as GlobOptions } from '../compiled/glob';
|
|
5
|
+
export type { FSWatcher, WatchOptions } from '../compiled/chokidar';
|
|
6
|
+
export declare const glob: typeof import('../compiled/glob');
|
|
7
|
+
export declare const yaml: typeof import('../compiled/js-yaml');
|
|
8
|
+
export declare const execa: typeof import('../compiled/execa');
|
|
9
|
+
export declare const pkgUp: typeof import('../compiled/pkg-up');
|
|
10
|
+
export declare const upath: typeof import('../compiled/upath');
|
|
11
|
+
export declare const debug: typeof import('../compiled/debug');
|
|
12
|
+
export declare const chokidar: typeof import('../compiled/chokidar');
|
|
13
|
+
export declare const gzipSize: typeof import('../compiled/gzip-size');
|
|
14
|
+
export declare const filesize: typeof import('../compiled/filesize');
|
|
15
|
+
export declare const stripAnsi: typeof import('../compiled/strip-ansi');
|
|
16
|
+
export declare const browserslist: typeof import('../compiled/browserslist');
|
|
17
|
+
export declare const recursiveReaddir: typeof import('../compiled/recursive-readdir');
|
|
@@ -5,215 +5,218 @@ export declare const HMR_SOCK_PATH = "/_modern_js_hmr_ws";
|
|
|
5
5
|
/**
|
|
6
6
|
* route specification file
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
8
|
export declare const ROUTE_SPEC_FILE = "route.json";
|
|
10
9
|
/**
|
|
11
10
|
* main entry name
|
|
12
11
|
*/
|
|
13
|
-
|
|
14
12
|
export declare const MAIN_ENTRY_NAME = "main";
|
|
15
13
|
/**
|
|
16
14
|
* open editor request path
|
|
17
15
|
*/
|
|
18
|
-
|
|
19
16
|
export declare const LAUNCH_EDITOR_ENDPOINT = "/__open-stack-frame-in-editor";
|
|
20
17
|
/**
|
|
21
18
|
* server side bundles directory, which relative to dist.
|
|
22
19
|
*/
|
|
23
|
-
|
|
24
20
|
export declare const SERVER_BUNDLE_DIRECTORY = "bundles";
|
|
25
21
|
/**
|
|
26
22
|
* entry name pattern used for ajv pattern properties.
|
|
27
23
|
*/
|
|
28
|
-
|
|
29
24
|
export declare const ENTRY_NAME_PATTERN = "^[a-zA-Z0-9_-]+$";
|
|
30
25
|
/**
|
|
31
26
|
* SSR server render function name
|
|
32
27
|
*/
|
|
33
|
-
|
|
34
28
|
export declare const SERVER_RENDER_FUNCTION_NAME = "serverRender";
|
|
35
29
|
/**
|
|
36
30
|
* loadbale manifest json file
|
|
37
31
|
*/
|
|
38
|
-
|
|
39
32
|
export declare const LOADABLE_STATS_FILE = "loadable-stats.json";
|
|
40
33
|
/**
|
|
41
34
|
* internal specified folder
|
|
42
35
|
*/
|
|
43
|
-
|
|
44
36
|
export declare const API_DIR = "api";
|
|
45
37
|
export declare const SERVER_DIR = "server";
|
|
46
38
|
export declare const SHARED_DIR = "shared";
|
|
39
|
+
/**
|
|
40
|
+
* Modern.config.ts cached dir
|
|
41
|
+
*/
|
|
42
|
+
export declare const CONFIG_CACHE_DIR = "./node_modules/.node-bundle-require";
|
|
43
|
+
export declare const CONFIG_FILE_EXTENSIONS: string[];
|
|
44
|
+
/**
|
|
45
|
+
* Serialized config path
|
|
46
|
+
*/
|
|
47
|
+
export declare const OUTPUT_CONFIG_FILE = "modern.config.json";
|
|
48
|
+
/**
|
|
49
|
+
* Default server config basename
|
|
50
|
+
*/
|
|
51
|
+
export declare const DEFAULT_SERVER_CONFIG = "modern.server.config";
|
|
47
52
|
/**
|
|
48
53
|
* Internal plugins that work as soon as they are installed.
|
|
49
54
|
*/
|
|
50
|
-
|
|
51
55
|
export declare const INTERNAL_PLUGINS: {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
[name: string]: {
|
|
57
|
+
cli?: string;
|
|
58
|
+
server?: string;
|
|
59
|
+
};
|
|
56
60
|
};
|
|
57
61
|
/**
|
|
58
62
|
* The schema registered in the plugin.
|
|
59
63
|
*/
|
|
60
|
-
|
|
61
64
|
export declare const PLUGIN_SCHEMAS: {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
type: string;
|
|
73
|
-
patternProperties: {
|
|
74
|
-
"^[a-zA-Z0-9_-]+$": {
|
|
75
|
-
type: string;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
additionalProperties: boolean;
|
|
79
|
-
};
|
|
80
|
-
})[];
|
|
81
|
-
'@modern-js/plugin-bff': {
|
|
82
|
-
target: string;
|
|
83
|
-
schema: {
|
|
84
|
-
type: string;
|
|
85
|
-
properties: {
|
|
86
|
-
prefix: {
|
|
87
|
-
type: string[];
|
|
88
|
-
items: {
|
|
65
|
+
'@modern-js/runtime': ({
|
|
66
|
+
target: string;
|
|
67
|
+
schema: {
|
|
68
|
+
type: string;
|
|
69
|
+
additionalProperties: boolean;
|
|
70
|
+
patternProperties?: undefined;
|
|
71
|
+
};
|
|
72
|
+
} | {
|
|
73
|
+
target: string;
|
|
74
|
+
schema: {
|
|
89
75
|
type: string;
|
|
90
|
-
|
|
76
|
+
patternProperties: {
|
|
77
|
+
"^[a-zA-Z0-9_-]+$": {
|
|
78
|
+
type: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
additionalProperties: boolean;
|
|
91
82
|
};
|
|
92
|
-
|
|
93
|
-
|
|
83
|
+
})[];
|
|
84
|
+
'@modern-js/plugin-bff': {
|
|
85
|
+
target: string;
|
|
86
|
+
schema: {
|
|
87
|
+
type: string;
|
|
88
|
+
properties: {
|
|
89
|
+
prefix: {
|
|
90
|
+
type: string[];
|
|
91
|
+
items: {
|
|
92
|
+
type: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
fetcher: {
|
|
96
|
+
type: string;
|
|
97
|
+
};
|
|
98
|
+
proxy: {
|
|
99
|
+
type: string;
|
|
100
|
+
};
|
|
101
|
+
requestCreator: {
|
|
102
|
+
type: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
94
105
|
};
|
|
95
|
-
|
|
96
|
-
|
|
106
|
+
}[];
|
|
107
|
+
'@modern-js/plugin-esbuild': {
|
|
108
|
+
target: string;
|
|
109
|
+
schema: {
|
|
110
|
+
typeof: string[];
|
|
97
111
|
};
|
|
98
|
-
|
|
99
|
-
|
|
112
|
+
}[];
|
|
113
|
+
'@modern-js/plugin-less': {
|
|
114
|
+
target: string;
|
|
115
|
+
schema: {
|
|
116
|
+
typeof: string[];
|
|
100
117
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
target: string;
|
|
124
|
-
schema: {
|
|
125
|
-
typeof: string[];
|
|
126
|
-
};
|
|
127
|
-
}[];
|
|
128
|
-
'@modern-js/plugin-proxy': {
|
|
129
|
-
target: string;
|
|
130
|
-
schema: {
|
|
131
|
-
typeof: string[];
|
|
132
|
-
};
|
|
133
|
-
}[];
|
|
134
|
-
'@modern-js/plugin-unbundle': ({
|
|
135
|
-
target: string;
|
|
136
|
-
schema: {
|
|
137
|
-
type: string;
|
|
138
|
-
properties?: undefined;
|
|
139
|
-
};
|
|
140
|
-
} | {
|
|
141
|
-
target: string;
|
|
142
|
-
schema: {
|
|
143
|
-
type: string;
|
|
144
|
-
properties: {
|
|
145
|
-
ignore: {
|
|
146
|
-
type: string[];
|
|
147
|
-
items: {
|
|
118
|
+
}[];
|
|
119
|
+
'@modern-js/plugin-sass': {
|
|
120
|
+
target: string;
|
|
121
|
+
schema: {
|
|
122
|
+
typeof: string[];
|
|
123
|
+
};
|
|
124
|
+
}[];
|
|
125
|
+
'@modern-js/plugin-tailwindcss': {
|
|
126
|
+
target: string;
|
|
127
|
+
schema: {
|
|
128
|
+
typeof: string[];
|
|
129
|
+
};
|
|
130
|
+
}[];
|
|
131
|
+
'@modern-js/plugin-proxy': {
|
|
132
|
+
target: string;
|
|
133
|
+
schema: {
|
|
134
|
+
typeof: string[];
|
|
135
|
+
};
|
|
136
|
+
}[];
|
|
137
|
+
'@modern-js/plugin-unbundle': ({
|
|
138
|
+
target: string;
|
|
139
|
+
schema: {
|
|
148
140
|
type: string;
|
|
149
|
-
|
|
141
|
+
properties?: undefined;
|
|
150
142
|
};
|
|
151
|
-
|
|
152
|
-
|
|
143
|
+
} | {
|
|
144
|
+
target: string;
|
|
145
|
+
schema: {
|
|
146
|
+
type: string;
|
|
147
|
+
properties: {
|
|
148
|
+
ignore: {
|
|
149
|
+
type: string[];
|
|
150
|
+
items: {
|
|
151
|
+
type: string;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
ignoreModuleCache: {
|
|
155
|
+
type: string;
|
|
156
|
+
};
|
|
157
|
+
clearPdnCache: {
|
|
158
|
+
type: string;
|
|
159
|
+
};
|
|
160
|
+
pdnHost: {
|
|
161
|
+
type: string;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
153
164
|
};
|
|
154
|
-
|
|
155
|
-
|
|
165
|
+
})[];
|
|
166
|
+
'@modern-js/plugin-ssg': {
|
|
167
|
+
target: string;
|
|
168
|
+
schema: {
|
|
169
|
+
oneOf: ({
|
|
170
|
+
type: string;
|
|
171
|
+
instanceof?: undefined;
|
|
172
|
+
} | {
|
|
173
|
+
instanceof: string;
|
|
174
|
+
type?: undefined;
|
|
175
|
+
})[];
|
|
156
176
|
};
|
|
157
|
-
|
|
158
|
-
|
|
177
|
+
}[];
|
|
178
|
+
'@modern-js/plugin-ssr': {
|
|
179
|
+
target: string;
|
|
180
|
+
schema: {
|
|
181
|
+
type: string[];
|
|
159
182
|
};
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
'@modern-js/plugin-router': {
|
|
201
|
-
target: string;
|
|
202
|
-
schema: {
|
|
203
|
-
type: string[];
|
|
204
|
-
};
|
|
205
|
-
}[];
|
|
206
|
-
'@modern-js/plugin-testing': {
|
|
207
|
-
target: string;
|
|
208
|
-
schema: {
|
|
209
|
-
typeof: string[];
|
|
210
|
-
};
|
|
211
|
-
}[];
|
|
212
|
-
'@modern-js/plugin-garfish': {
|
|
213
|
-
target: string;
|
|
214
|
-
schema: {
|
|
215
|
-
type: string[];
|
|
216
|
-
};
|
|
217
|
-
}[];
|
|
218
|
-
'@modern-js/plugin-nocode': never[];
|
|
219
|
-
};
|
|
183
|
+
}[];
|
|
184
|
+
'@modern-js/plugin-state': {
|
|
185
|
+
target: string;
|
|
186
|
+
schema: {
|
|
187
|
+
type: string[];
|
|
188
|
+
};
|
|
189
|
+
}[];
|
|
190
|
+
'@modern-js/plugin-design-token': ({
|
|
191
|
+
target: string;
|
|
192
|
+
schema: {
|
|
193
|
+
typeof: string[];
|
|
194
|
+
type?: undefined;
|
|
195
|
+
};
|
|
196
|
+
} | {
|
|
197
|
+
target: string;
|
|
198
|
+
schema: {
|
|
199
|
+
type: string[];
|
|
200
|
+
typeof?: undefined;
|
|
201
|
+
};
|
|
202
|
+
})[];
|
|
203
|
+
'@modern-js/plugin-router': {
|
|
204
|
+
target: string;
|
|
205
|
+
schema: {
|
|
206
|
+
type: string[];
|
|
207
|
+
};
|
|
208
|
+
}[];
|
|
209
|
+
'@modern-js/plugin-testing': {
|
|
210
|
+
target: string;
|
|
211
|
+
schema: {
|
|
212
|
+
typeof: string[];
|
|
213
|
+
};
|
|
214
|
+
}[];
|
|
215
|
+
'@modern-js/plugin-garfish': {
|
|
216
|
+
target: string;
|
|
217
|
+
schema: {
|
|
218
|
+
type: string[];
|
|
219
|
+
};
|
|
220
|
+
}[];
|
|
221
|
+
'@modern-js/plugin-nocode': never[];
|
|
222
|
+
};
|
package/dist/types/debug.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import debug from 'debug';
|
|
2
1
|
/**
|
|
3
2
|
* Create debug function with unified namespace prefix.
|
|
4
3
|
* @param scope - Custom module name of your debug function.
|
|
5
4
|
* @returns Debug function which namespace start with modern-js:.
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
export declare const createDebugger: (scope: string) => debug.Debugger;
|
|
6
|
+
export declare const createDebugger: (scope: string) => import("../compiled/debug").Debugger;
|
package/dist/types/emptyDir.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const emptyDir: (dir: string) => Promise<void>;
|
|
1
|
+
export declare const emptyDir: (dir: string) => Promise<void>;
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @param filePath - Aboluste or relative file path.
|
|
5
5
|
* @returns Resolved absolute file path.
|
|
6
6
|
*/
|
|
7
|
-
export declare const ensureAbsolutePath: (base: string, filePath: string) => string;
|
|
7
|
+
export declare const ensureAbsolutePath: (base: string, filePath: string) => string;
|
package/dist/types/format.d.ts
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* https://github.com/facebook/create-react-app/blob/master/LICENSE
|
|
7
7
|
*/
|
|
8
8
|
import { StatsCompilation } from 'webpack';
|
|
9
|
-
import type { ProxyDetail,
|
|
9
|
+
import type { ProxyDetail, BffProxyOptions } from '@modern-js/types';
|
|
10
10
|
declare function formatWebpackMessages(json: StatsCompilation): {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
errors: string[];
|
|
12
|
+
warnings: string[];
|
|
13
13
|
};
|
|
14
14
|
export { formatWebpackMessages };
|
|
15
|
-
declare function formatProxyOptions(proxyOptions:
|
|
16
|
-
export { formatProxyOptions };
|
|
15
|
+
declare function formatProxyOptions(proxyOptions: BffProxyOptions): ProxyDetail[];
|
|
16
|
+
export { formatProxyOptions };
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* Modified from https://github.com/jantimon/html-webpack-plugin/blob/2f5de7ab9e8bca60e9e200f2e4b4cfab90db28d4/index.js#L800
|
|
9
9
|
*/
|
|
10
10
|
export declare type MetaAttributes = {
|
|
11
|
-
|
|
11
|
+
[attributeName: string]: string | boolean;
|
|
12
12
|
};
|
|
13
13
|
export interface MetaOptions {
|
|
14
|
-
|
|
14
|
+
[name: string]: string | false | MetaAttributes;
|
|
15
15
|
}
|
|
16
|
-
export declare const generateMetaTags: (metaOptions?: MetaOptions | undefined) => string;
|
|
16
|
+
export declare const generateMetaTags: (metaOptions?: MetaOptions | undefined) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const defaults: string[];
|
|
2
|
-
export declare const getBrowserslist: (appDirectory: string) => string[];
|
|
2
|
+
export declare const getBrowserslist: (appDirectory: string) => string[];
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Generate cache identifier from some packages and config files.
|
|
3
3
|
*/
|
|
4
4
|
export declare function getCacheIdentifier(packages: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}[], _files?: string[]): string;
|
|
5
|
+
name: string;
|
|
6
|
+
version: string;
|
|
7
|
+
}[], _files?: string[]): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getEntryOptions: <T>(name: string, baseOptions?: T | undefined, optionsByEntries?: Record<string, T> | undefined, packageName?: string | undefined) => T | undefined;
|
|
1
|
+
export declare const getEntryOptions: <T>(name: string, baseOptions?: T | undefined, optionsByEntries?: Record<string, T> | undefined, packageName?: string | undefined) => T | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getPackageManager(cwd?: string): Promise<"npm" | "yarn" | "pnpm">;
|
|
1
|
+
export declare function getPackageManager(cwd?: string): Promise<"npm" | "yarn" | "pnpm">;
|
package/dist/types/getPort.d.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @param tryLimits - Maximum number of retries.
|
|
5
5
|
* @returns Available port number.
|
|
6
6
|
*/
|
|
7
|
-
export declare const getPort: (port: string | number, tryLimits?: number) => Promise<number>;
|
|
7
|
+
export declare const getPort: (port: string | number, tryLimits?: number) => Promise<number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getServerConfig: (appDirectory: string, configFile: string) => Promise<string | false>;
|
package/dist/types/import.d.ts
CHANGED
|
@@ -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
|
-
|
|
5
|
-
};
|
|
4
|
+
lazy: (moduleName: string, requireFn: (id: string) => unknown) => any;
|
|
5
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export *
|
|
2
|
-
export * from './chalk';
|
|
1
|
+
export * from './compiled';
|
|
3
2
|
export * from './format';
|
|
4
3
|
export * from './FileSizeReporter';
|
|
5
4
|
export * from './printBuildError';
|
|
@@ -12,7 +11,6 @@ export * from './constants';
|
|
|
12
11
|
export * from './ensureAbsolutePath';
|
|
13
12
|
export * from './getCacheIdentifier';
|
|
14
13
|
export * from './clearConsole';
|
|
15
|
-
export * from './pkgUp';
|
|
16
14
|
export * from './applyOptionsChain';
|
|
17
15
|
export * from './getBrowserslist';
|
|
18
16
|
export * from './removeSlash';
|
|
@@ -30,4 +28,5 @@ export * from './import';
|
|
|
30
28
|
export * from './watch';
|
|
31
29
|
export * from './nodeEnv';
|
|
32
30
|
export * from './wait';
|
|
33
|
-
export * from './emptyDir';
|
|
31
|
+
export * from './emptyDir';
|
|
32
|
+
export * from './getServerConfig';
|
package/dist/types/is/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export declare const isDepExists: (appDirectory: string, name: string) => boolea
|
|
|
12
12
|
* @param root - App directory.
|
|
13
13
|
* @returns Whether to use typescript.
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
15
|
export declare const isTypescript: (root: string) => boolean;
|
|
17
16
|
/**
|
|
18
17
|
* Is Empty object
|
|
@@ -20,7 +19,6 @@ export declare const isTypescript: (root: string) => boolean;
|
|
|
20
19
|
* @param o - Any object.
|
|
21
20
|
* @returns Whether it is empty object.
|
|
22
21
|
*/
|
|
23
|
-
|
|
24
22
|
export declare const isEmpty: (o: Record<string, unknown>) => boolean;
|
|
25
23
|
/**
|
|
26
24
|
* Is SSR project
|
|
@@ -28,10 +26,9 @@ export declare const isEmpty: (o: Record<string, unknown>) => boolean;
|
|
|
28
26
|
* @param config - User config.
|
|
29
27
|
* @returns Whether to use server side render.
|
|
30
28
|
*/
|
|
31
|
-
|
|
32
29
|
export declare const isSSR: (config: any) => boolean;
|
|
33
30
|
export declare const isUseSSRBundle: (config: any) => boolean;
|
|
34
31
|
export declare const isFastRefresh: () => boolean;
|
|
35
32
|
export * from './node-env';
|
|
36
33
|
export * from './platform';
|
|
37
|
-
export * from './type';
|
|
34
|
+
export * from './type';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const isNodeJS: () => boolean;
|
|
2
|
-
export declare const isBrowser: () => boolean;
|
|
2
|
+
export declare const isBrowser: () => boolean;
|
package/dist/types/is/type.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ export declare function isFunction(func: any): func is Function;
|
|
|
5
5
|
export declare function isObject(obj: unknown): obj is Record<string, any>;
|
|
6
6
|
export declare function isPlainObject(obj: unknown): obj is Record<string, any>;
|
|
7
7
|
export declare function isPromise(obj: any): obj is Promise<any>;
|
|
8
|
-
export declare function isRegExp(obj: any): obj is RegExp;
|
|
8
|
+
export declare function isRegExp(obj: any): obj is RegExp;
|