@modern-js/app-tools 2.32.0 → 2.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/types/defineConfig.d.ts +6 -3
- package/dist/types/index.d.ts +7 -1
- package/dist/types/types/config/deploy.d.ts +13 -0
- package/dist/types/types/config/dev.d.ts +5 -2
- package/dist/types/types/config/output.d.ts +20 -0
- package/dist/types/types/config/source.d.ts +38 -1
- package/dist/types/types/config/testing.d.ts +1 -1
- package/dist/types/types/config/tools.d.ts +7 -3
- package/dist/types/types/legacyConfig/testing.d.ts +1 -1
- package/package.json +24 -24
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,34 @@
|
|
1
1
|
# @modern-js/app-tools
|
2
2
|
|
3
|
+
## 2.32.1
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 90e053a: feat(app-tools): add comments for configurations and functions
|
8
|
+
|
9
|
+
feat(app-tools): 为配置和函数添加 comments 说明
|
10
|
+
|
11
|
+
- Updated dependencies [90e053a]
|
12
|
+
- @modern-js/types@2.32.1
|
13
|
+
- @modern-js/builder-rspack-provider@2.32.1
|
14
|
+
- @modern-js/builder-shared@2.32.1
|
15
|
+
- @modern-js/builder-webpack-provider@2.32.1
|
16
|
+
- @modern-js/core@2.32.1
|
17
|
+
- @modern-js/plugin-data-loader@2.32.1
|
18
|
+
- @modern-js/server-core@2.32.1
|
19
|
+
- @modern-js/prod-server@2.32.1
|
20
|
+
- @modern-js/server@2.32.1
|
21
|
+
- @modern-js/utils@2.32.1
|
22
|
+
- @modern-js/builder@2.32.1
|
23
|
+
- @modern-js/builder-plugin-node-polyfill@2.32.1
|
24
|
+
- @modern-js/builder-plugin-esbuild@2.32.1
|
25
|
+
- @modern-js/plugin-i18n@2.32.1
|
26
|
+
- @modern-js/plugin-lint@2.32.1
|
27
|
+
- @modern-js/new-action@2.32.1
|
28
|
+
- @modern-js/node-bundle-require@2.32.1
|
29
|
+
- @modern-js/plugin@2.32.1
|
30
|
+
- @modern-js/upgrade@2.32.1
|
31
|
+
|
3
32
|
## 2.32.0
|
4
33
|
|
5
34
|
### Minor Changes
|
@@ -1,9 +1,12 @@
|
|
1
1
|
import type { UserConfigExport } from '@modern-js/core';
|
2
2
|
import type { AppLegacyUserConfig, AppUserConfig } from './types';
|
3
|
+
/**
|
4
|
+
* This function helps you to autocomplete configuration types.
|
5
|
+
* It accepts a direct config object, or a function that returns a config.
|
6
|
+
*/
|
3
7
|
export declare const defineConfig: <B extends "webpack" | "rspack" = "webpack">(config: UserConfigExport<AppUserConfig<B>>) => UserConfigExport<AppUserConfig<B>>;
|
4
8
|
/**
|
5
|
-
*
|
6
|
-
*
|
7
|
-
* `defineLegacyConfig` will be deprecated in the future.
|
9
|
+
* @deprecated Please use `defineConfig` instead.
|
10
|
+
* `defineLegacyConfig` will be removed in the future major version.
|
8
11
|
*/
|
9
12
|
export declare const defineLegacyConfig: (config: AppLegacyUserConfig) => AppLegacyUserConfig;
|
package/dist/types/index.d.ts
CHANGED
@@ -9,8 +9,14 @@ export type { RuntimeUserConfig } from './types/config';
|
|
9
9
|
export declare const devCommand: (program: Command, api: PluginAPI<AppTools<'shared'>>) => Promise<void>;
|
10
10
|
export declare const buildCommand: (program: Command, api: PluginAPI<AppTools<'shared'>>) => Promise<void>;
|
11
11
|
export type AppToolsOptions = {
|
12
|
-
/**
|
12
|
+
/**
|
13
|
+
* Specify which bundler to use for the build.
|
14
|
+
* @default `webpack`
|
15
|
+
* */
|
13
16
|
bundler?: 'experimental-rspack' | 'webpack';
|
14
17
|
};
|
18
|
+
/**
|
19
|
+
* The core package of the framework, providing CLI commands, build capabilities, configuration parsing and more.
|
20
|
+
*/
|
15
21
|
export declare const appTools: (options?: AppToolsOptions) => CliPlugin<AppTools<'shared'>>;
|
16
22
|
export default appTools;
|
@@ -1,9 +1,22 @@
|
|
1
1
|
export interface MicroFrontend {
|
2
|
+
/**
|
3
|
+
* Specifies whether to enable the HTML entry.
|
4
|
+
* When set to `true`, the current child application will be externalized for `react` and `react-dom`.
|
5
|
+
* @default true
|
6
|
+
*/
|
2
7
|
enableHtmlEntry?: boolean;
|
8
|
+
/**
|
9
|
+
* Specifies whether to use the external base library.
|
10
|
+
* @default false
|
11
|
+
*/
|
3
12
|
externalBasicLibrary?: boolean;
|
4
13
|
moduleApp?: string;
|
5
14
|
}
|
6
15
|
export interface DeployUserConfig {
|
16
|
+
/**
|
17
|
+
* Used to configure micro-frontend sub-application information.
|
18
|
+
* @default false
|
19
|
+
*/
|
7
20
|
microFrontend?: boolean | MicroFrontend;
|
8
21
|
worker?: {
|
9
22
|
ssr?: boolean;
|
@@ -3,9 +3,12 @@ type BuilderDevConfig = Required<SharedBuilderConfig>['dev'];
|
|
3
3
|
export type DevProxyOptions = string | Record<string, string>;
|
4
4
|
export interface DevUserConfig extends BuilderDevConfig {
|
5
5
|
/**
|
6
|
-
*
|
6
|
+
* Used to configure a global proxy based on whistle in the development environment,
|
7
|
+
* which can be used to view and modify HTTP/HTTPS requests, responses, and can also be used as a proxy server.
|
8
|
+
*
|
9
|
+
* @requires `proxy` plugin.
|
10
|
+
* This configuration is provided by `proxy` plugin.
|
7
11
|
* Please use `yarn new` or `pnpm new` to enable the corresponding capability.
|
8
|
-
* @requires `proxy` plugin
|
9
12
|
*/
|
10
13
|
proxy?: string | Record<string, string>;
|
11
14
|
}
|
@@ -5,10 +5,30 @@ import { UnwrapBuilderConfig } from '../utils';
|
|
5
5
|
export type BuilderOutputConfig = UnwrapBuilderConfig<WebpackBuilderConfig, 'output'>;
|
6
6
|
export type RsBuilderOutputConfig = UnwrapBuilderConfig<RspackBuilderConfig, 'output'>;
|
7
7
|
export interface SharedOutputConfig extends BuilderSharedOutputConfig {
|
8
|
+
/**
|
9
|
+
* Enable SSG for self-controlled routing or conventional routing.
|
10
|
+
* @default false
|
11
|
+
*/
|
8
12
|
ssg?: SSGConfig;
|
13
|
+
/**
|
14
|
+
* When using convention-based routing, the framework will split js and css based on the route to load on demand.
|
15
|
+
* If your project does not want to split js and css based on routes, you can set this option to false.
|
16
|
+
* @default true
|
17
|
+
*/
|
9
18
|
splitRouteChunks?: boolean;
|
19
|
+
/**
|
20
|
+
* Used to control whether to inject the polyfill of the Node module into the code.
|
21
|
+
* @default true
|
22
|
+
*/
|
10
23
|
disableNodePolyfill?: boolean;
|
24
|
+
/**
|
25
|
+
* Used to control whether to inject convention-based routing information into the HTML.
|
26
|
+
* @default true
|
27
|
+
*/
|
11
28
|
enableInlineRouteManifests?: boolean;
|
29
|
+
/**
|
30
|
+
* Specify the temporary directory for framework generated files.
|
31
|
+
*/
|
12
32
|
tempDir?: string;
|
13
33
|
}
|
14
34
|
export interface OutputUserConfig extends BuilderOutputConfig, SharedOutputConfig {}
|
@@ -3,23 +3,60 @@ import type { WebpackBuilderConfig, RspackBuilderConfig } from '../../builder/sh
|
|
3
3
|
export type BuilderSourceConfig = NonNullable<WebpackBuilderConfig['source']>;
|
4
4
|
export type RsBuilderSourceConfig = NonNullable<RspackBuilderConfig['source']>;
|
5
5
|
export type Entry = string | {
|
6
|
+
/**
|
7
|
+
* The entry file path.
|
8
|
+
*/
|
6
9
|
entry: string;
|
10
|
+
/**
|
11
|
+
* Disable framework's behavior of automatically generating entry code.
|
12
|
+
*/
|
7
13
|
disableMount?: boolean;
|
14
|
+
/**
|
15
|
+
* Specify the file path of custom bootstrap.
|
16
|
+
*/
|
8
17
|
customBootstrap?: string;
|
9
18
|
};
|
10
19
|
export type Entries = Record<string, Entry>;
|
11
20
|
export interface SharedSourceConfig extends BuilderSharedSourceConfig {
|
21
|
+
/**
|
22
|
+
* Used to configure custom page entries.
|
23
|
+
*/
|
12
24
|
entries?: Entries;
|
25
|
+
/**
|
26
|
+
* Used to configure the main entry name.
|
27
|
+
* @default 'main'
|
28
|
+
*/
|
13
29
|
mainEntryName?: string;
|
30
|
+
/**
|
31
|
+
* This option is used for Module Federation scenario.
|
32
|
+
* When this option is enabled, framework will wrap the automatically generated entry files with dynamic import.
|
33
|
+
* @default false
|
34
|
+
*/
|
14
35
|
enableAsyncEntry?: boolean;
|
36
|
+
/**
|
37
|
+
* Used to disable the functionality of automatically identifying page entry points based on directory structure.
|
38
|
+
* @default false
|
39
|
+
*/
|
15
40
|
disableDefaultEntries?: boolean;
|
41
|
+
/**
|
42
|
+
* By default, framework scans the src directory to identify page entries.
|
43
|
+
* You can customize the directory used for identifying page entries with this option.
|
44
|
+
*/
|
16
45
|
entriesDir?: string;
|
46
|
+
/**
|
47
|
+
* By default, framework identifies the application entry point based on the `src` directory.
|
48
|
+
* You can use this option to prevent some directories from being recognized as application entry points.
|
49
|
+
*/
|
17
50
|
disableEntryDirs?: string[];
|
51
|
+
/**
|
52
|
+
* Customize the directory of the framework configuration files.
|
53
|
+
*/
|
18
54
|
configDir?: string;
|
19
55
|
/**
|
56
|
+
* Used to define the project's theme configuration such as color palette.
|
57
|
+
* @requires `tailwindcss` plugin.
|
20
58
|
* The configuration of `source.designSystem` is provided by `tailwindcss` plugin.
|
21
59
|
* Please use `yarn new` or `pnpm new` to enable the corresponding capability.
|
22
|
-
* @requires `tailwindcss` plugin
|
23
60
|
*/
|
24
61
|
designSystem?: Record<string, any>;
|
25
62
|
}
|
@@ -11,20 +11,24 @@ export type RsBuilderToolsConfig = UnwrapBuilderConfig<RspackBuilderConfig, 'too
|
|
11
11
|
export type Tailwindcss = Record<string, any> | ((options: Record<string, any>) => Record<string, any> | void);
|
12
12
|
export interface SharedToolsConfig extends BuilderSharedToolsConfig {
|
13
13
|
/**
|
14
|
+
* Used to custom Tailwind CSS configurations.
|
15
|
+
* @requires `tailwindcss` plugin.
|
14
16
|
* The configuration of `tools.tailwindcss` is provided by `tailwindcss` plugin.
|
15
17
|
* Please use `yarn new` or `pnpm new` to enable the corresponding capability.
|
16
|
-
* @requires `tailwindcss` plugin
|
17
18
|
*/
|
18
19
|
tailwindcss?: Tailwindcss;
|
19
20
|
/**
|
21
|
+
* Used to custom Jest configurations.
|
22
|
+
* @requires `test` plugin.
|
20
23
|
* The configuration of `tools.jest` is provided by `test` plugin.
|
21
24
|
* Please use `yarn new` or `pnpm new` to enable the corresponding capability.
|
22
|
-
* @requires `test` plugin
|
23
25
|
*/
|
24
26
|
jest?: JestConfig | ((jestConfig: JestConfig) => JestConfig);
|
25
27
|
/**
|
28
|
+
* Used to custom SWC configurations.
|
29
|
+
* @requires `swc` plugin.
|
26
30
|
* The configuration of `swc` is provided by `swc` plugin.
|
27
|
-
*
|
31
|
+
* Please use `yarn new` or `pnpm new` to enable the corresponding capability.
|
28
32
|
*/
|
29
33
|
swc?: PluginSwcOptions<'outer'>;
|
30
34
|
}
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.32.
|
18
|
+
"version": "2.32.1",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -73,24 +73,24 @@
|
|
73
73
|
"esbuild": "0.17.19",
|
74
74
|
"rspack-plugin-virtual-module": "0.1.7",
|
75
75
|
"@swc/helpers": "0.5.1",
|
76
|
-
"@modern-js/builder": "2.32.
|
77
|
-
"@modern-js/builder-plugin-esbuild": "2.32.
|
78
|
-
"@modern-js/builder-plugin-node-polyfill": "2.32.
|
79
|
-
"@modern-js/builder-shared": "2.32.
|
80
|
-
"@modern-js/builder-webpack-provider": "2.32.
|
81
|
-
"@modern-js/core": "2.32.
|
82
|
-
"@modern-js/new-action": "2.32.
|
83
|
-
"@modern-js/node-bundle-require": "2.32.
|
84
|
-
"@modern-js/plugin": "2.32.
|
85
|
-
"@modern-js/plugin-data-loader": "2.32.
|
86
|
-
"@modern-js/plugin-i18n": "2.32.
|
87
|
-
"@modern-js/plugin-lint": "2.32.
|
88
|
-
"@modern-js/prod-server": "2.32.
|
89
|
-
"@modern-js/server": "2.32.
|
90
|
-
"@modern-js/types": "2.32.
|
91
|
-
"@modern-js/upgrade": "2.32.
|
92
|
-
"@modern-js/utils": "2.32.
|
93
|
-
"@modern-js/server-core": "2.32.
|
76
|
+
"@modern-js/builder": "2.32.1",
|
77
|
+
"@modern-js/builder-plugin-esbuild": "2.32.1",
|
78
|
+
"@modern-js/builder-plugin-node-polyfill": "2.32.1",
|
79
|
+
"@modern-js/builder-shared": "2.32.1",
|
80
|
+
"@modern-js/builder-webpack-provider": "2.32.1",
|
81
|
+
"@modern-js/core": "2.32.1",
|
82
|
+
"@modern-js/new-action": "2.32.1",
|
83
|
+
"@modern-js/node-bundle-require": "2.32.1",
|
84
|
+
"@modern-js/plugin": "2.32.1",
|
85
|
+
"@modern-js/plugin-data-loader": "2.32.1",
|
86
|
+
"@modern-js/plugin-i18n": "2.32.1",
|
87
|
+
"@modern-js/plugin-lint": "2.32.1",
|
88
|
+
"@modern-js/prod-server": "2.32.1",
|
89
|
+
"@modern-js/server": "2.32.1",
|
90
|
+
"@modern-js/types": "2.32.1",
|
91
|
+
"@modern-js/upgrade": "2.32.1",
|
92
|
+
"@modern-js/utils": "2.32.1",
|
93
|
+
"@modern-js/server-core": "2.32.1"
|
94
94
|
},
|
95
95
|
"devDependencies": {
|
96
96
|
"@types/babel__traverse": "^7.14.2",
|
@@ -99,13 +99,13 @@
|
|
99
99
|
"jest": "^29",
|
100
100
|
"typescript": "^5",
|
101
101
|
"webpack": "^5.88.1",
|
102
|
-
"@modern-js/builder-plugin-swc": "2.32.
|
103
|
-
"@modern-js/builder-rspack-provider": "2.32.
|
104
|
-
"@scripts/build": "2.32.
|
105
|
-
"@scripts/jest-config": "2.32.
|
102
|
+
"@modern-js/builder-plugin-swc": "2.32.1",
|
103
|
+
"@modern-js/builder-rspack-provider": "2.32.1",
|
104
|
+
"@scripts/build": "2.32.1",
|
105
|
+
"@scripts/jest-config": "2.32.1"
|
106
106
|
},
|
107
107
|
"peerDependencies": {
|
108
|
-
"@modern-js/builder-rspack-provider": "^2.32.
|
108
|
+
"@modern-js/builder-rspack-provider": "^2.32.1"
|
109
109
|
},
|
110
110
|
"peerDependenciesMeta": {
|
111
111
|
"@modern-js/builder-rspack-provider": {
|