@modern-js/app-tools 2.40.0 → 2.42.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/dist/cjs/analyze/getHtmlTemplate.js +5 -5
- package/dist/cjs/analyze/templates.js +7 -6
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +3 -1
- package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +1 -1
- package/dist/cjs/config/default.js +2 -1
- package/dist/cjs/defineConfig.js +8 -6
- package/dist/esm/analyze/getHtmlTemplate.js +5 -5
- package/dist/esm/analyze/templates.js +6 -6
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.js +6 -4
- package/dist/esm/builder/shared/bundlerPlugins/RouterPlugin.js +1 -1
- package/dist/esm/config/default.js +2 -1
- package/dist/esm/config/initialize/inits.js +19 -19
- package/dist/esm/defineConfig.js +1 -1
- package/dist/esm-node/analyze/getHtmlTemplate.js +5 -5
- package/dist/esm-node/analyze/templates.js +7 -6
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.js +3 -1
- package/dist/esm-node/builder/shared/bundlerPlugins/RouterPlugin.js +1 -1
- package/dist/esm-node/config/default.js +2 -1
- package/dist/esm-node/defineConfig.js +8 -6
- package/dist/types/analyze/constants.d.ts +19 -19
- package/dist/types/analyze/generateCode.d.ts +9 -16
- package/dist/types/analyze/getBundleEntry.d.ts +1 -1
- package/dist/types/analyze/getClientRoutes/getRoutes.d.ts +7 -13
- package/dist/types/analyze/getClientRoutes/getRoutesLegacy.d.ts +7 -13
- package/dist/types/analyze/getClientRoutes/index.d.ts +1 -1
- package/dist/types/analyze/getClientRoutes/utils.d.ts +1 -1
- package/dist/types/analyze/getFileSystemEntry.d.ts +1 -1
- package/dist/types/analyze/getHtmlTemplate.d.ts +4 -7
- package/dist/types/analyze/getServerRoutes.d.ts +4 -7
- package/dist/types/analyze/index.d.ts +3 -5
- package/dist/types/analyze/isDefaultExportFunction.d.ts +1 -1
- package/dist/types/analyze/makeLegalIdentifier.d.ts +1 -1
- package/dist/types/analyze/nestedRoutes.d.ts +3 -3
- package/dist/types/analyze/templates.d.ts +22 -40
- package/dist/types/analyze/utils.d.ts +10 -19
- package/dist/types/builder/builder-rspack/adapterCopy.d.ts +1 -1
- package/dist/types/builder/builder-rspack/index.d.ts +1 -1
- package/dist/types/builder/builder-webpack/adapterModern.d.ts +1 -1
- package/dist/types/builder/builder-webpack/createCopyPattern.d.ts +20 -20
- package/dist/types/builder/builder-webpack/index.d.ts +1 -1
- package/dist/types/builder/generator/createBuilderOptions.d.ts +1 -1
- package/dist/types/builder/generator/createBuilderProviderConfig.d.ts +1 -1
- package/dist/types/builder/generator/getBuilderTargets.d.ts +1 -1
- package/dist/types/builder/generator/index.d.ts +2 -2
- package/dist/types/builder/index.d.ts +1 -1
- package/dist/types/builder/shared/builderPlugins/adapterBasic.d.ts +1 -1
- package/dist/types/builder/shared/builderPlugins/adapterHtml.d.ts +1 -1
- package/dist/types/builder/shared/builderPlugins/adapterSSR.d.ts +1 -1
- package/dist/types/builder/shared/builderPlugins/index.d.ts +1 -1
- package/dist/types/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.d.ts +5 -5
- package/dist/types/builder/shared/bundlerPlugins/HtmlBottomTemplate.d.ts +7 -7
- package/dist/types/builder/shared/bundlerPlugins/RouterPlugin.d.ts +24 -31
- package/dist/types/builder/shared/bundlerPlugins/index.d.ts +1 -1
- package/dist/types/builder/shared/createCopyInfo.d.ts +4 -4
- package/dist/types/builder/shared/index.d.ts +1 -1
- package/dist/types/builder/shared/loaders/serverModuleLoader.d.ts +1 -1
- package/dist/types/builder/shared/types.d.ts +3 -3
- package/dist/types/commands/build.d.ts +1 -1
- package/dist/types/commands/deploy.d.ts +1 -1
- package/dist/types/commands/dev.d.ts +2 -2
- package/dist/types/commands/index.d.ts +1 -1
- package/dist/types/commands/inspect.d.ts +7 -7
- package/dist/types/commands/serve.d.ts +1 -1
- package/dist/types/config/default.d.ts +1 -1
- package/dist/types/config/index.d.ts +1 -1
- package/dist/types/config/initialize/index.d.ts +1 -1
- package/dist/types/config/initialize/inits.d.ts +1 -1
- package/dist/types/config/legacy/createHtmlConfig.d.ts +1 -1
- package/dist/types/config/legacy/createOutputConfig.d.ts +1 -1
- package/dist/types/config/legacy/createSourceConfig.d.ts +1 -1
- package/dist/types/config/legacy/createToolsConfig.d.ts +1 -1
- package/dist/types/config/legacy/index.d.ts +1 -1
- package/dist/types/defineConfig.d.ts +1 -1
- package/dist/types/exports/server.d.ts +1 -1
- package/dist/types/hooks.d.ts +1 -1
- package/dist/types/index.d.ts +6 -6
- package/dist/types/initialize/index.d.ts +3 -5
- package/dist/types/locale/en.d.ts +38 -38
- package/dist/types/locale/index.d.ts +75 -75
- package/dist/types/locale/zh.d.ts +38 -38
- package/dist/types/types/config/deploy.d.ts +21 -21
- package/dist/types/types/config/dev.d.ts +10 -10
- package/dist/types/types/config/experiments.d.ts +1 -1
- package/dist/types/types/config/html.d.ts +1 -1
- package/dist/types/types/config/index.d.ts +38 -38
- package/dist/types/types/config/output.d.ts +35 -28
- package/dist/types/types/config/performance.d.ts +1 -1
- package/dist/types/types/config/security.d.ts +1 -1
- package/dist/types/types/config/source.d.ts +52 -52
- package/dist/types/types/config/testing.d.ts +6 -6
- package/dist/types/types/config/tools.d.ts +26 -24
- package/dist/types/types/hooks.d.ts +75 -75
- package/dist/types/types/index.d.ts +17 -17
- package/dist/types/types/legacyConfig/deploy.d.ts +5 -5
- package/dist/types/types/legacyConfig/dev.d.ts +9 -9
- package/dist/types/types/legacyConfig/index.d.ts +16 -16
- package/dist/types/types/legacyConfig/output.d.ts +45 -45
- package/dist/types/types/legacyConfig/source.d.ts +22 -22
- package/dist/types/types/legacyConfig/testing.d.ts +6 -6
- package/dist/types/types/legacyConfig/tools.d.ts +10 -10
- package/dist/types/types/utils.d.ts +4 -4
- package/dist/types/utils/config.d.ts +7 -13
- package/dist/types/utils/createServer.d.ts +5 -5
- package/dist/types/utils/env.d.ts +1 -1
- package/dist/types/utils/generateWatchFiles.d.ts +1 -1
- package/dist/types/utils/getSelectedEntries.d.ts +1 -1
- package/dist/types/utils/getServerInternalPlugins.d.ts +1 -1
- package/dist/types/utils/printInstructions.d.ts +1 -1
- package/dist/types/utils/restart.d.ts +1 -1
- package/dist/types/utils/routes.d.ts +1 -1
- package/dist/types/utils/types.d.ts +13 -13
- package/package.json +26 -26
@@ -2,14 +2,14 @@ import type { JestConfig, DevServerOptions } from '@modern-js/types';
|
|
2
2
|
import type { BuilderConfig } from '@modern-js/builder-webpack-provider';
|
3
3
|
type BuilderToolsConfig = Required<BuilderConfig>['tools'];
|
4
4
|
export type ToolsLegacyUserConfig = BuilderToolsConfig & {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
esbuild?: Record<string, unknown>;
|
6
|
+
devServer?: DevServerOptions;
|
7
|
+
/**
|
8
|
+
* The configuration of `tools.tailwindcss` is provided by `tailwindcss` plugin.
|
9
|
+
* Please use `yarn new` or `pnpm new` to enable the corresponding capability.
|
10
|
+
* @requires `tailwindcss` plugin
|
11
|
+
*/
|
12
|
+
tailwindcss?: Record<string, any> | ((options: Record<string, any>) => Record<string, any> | void);
|
13
|
+
jest?: JestConfig | ((jestConfig: JestConfig) => JestConfig);
|
14
14
|
};
|
15
|
-
export {};
|
15
|
+
export {};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
export type UnwrapBuilderConfig<Config, Key extends keyof Config> = Required<Config>[Key];
|
2
2
|
export type Bundler = 'rspack' | 'webpack' | 'shared';
|
3
3
|
export type FromConfig<B extends Bundler, Config extends {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
}, Rspack = {}, Webpack = {}, Shared = {}> = B extends 'shared' ? Config['shared'] : B extends 'rspack' ? Config['rspack'] : Config['webpack'];
|
4
|
+
rspack: Rspack;
|
5
|
+
webpack: Webpack;
|
6
|
+
shared: Shared;
|
7
|
+
}, Rspack = {}, Webpack = {}, Shared = {}> = B extends 'shared' ? Config['shared'] : B extends 'rspack' ? Config['rspack'] : Config['webpack'];
|
@@ -2,22 +2,16 @@ import { bundle } from '@modern-js/node-bundle-require';
|
|
2
2
|
import type { ServerConfig } from '@modern-js/server-core';
|
3
3
|
import type { AppNormalizedConfig } from '../types';
|
4
4
|
export declare const defineServerConfig: (config: ServerConfig) => ServerConfig;
|
5
|
-
export declare const buildServerConfig: ({
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
}: {
|
12
|
-
appDirectory: string;
|
13
|
-
distDirectory: string;
|
14
|
-
configFile: string;
|
15
|
-
options?: Parameters<typeof bundle>[1];
|
16
|
-
watch?: boolean | undefined;
|
5
|
+
export declare const buildServerConfig: ({ appDirectory, distDirectory, configFile, options, watch, }: {
|
6
|
+
appDirectory: string;
|
7
|
+
distDirectory: string;
|
8
|
+
configFile: string;
|
9
|
+
options?: Parameters<typeof bundle>[1];
|
10
|
+
watch?: boolean | undefined;
|
17
11
|
}) => Promise<void>;
|
18
12
|
/**
|
19
13
|
*
|
20
14
|
* 处理循环引用的 replacer
|
21
15
|
*/
|
22
16
|
export declare const safeReplacer: () => (key: string, value: unknown) => unknown;
|
23
|
-
export declare const emitResolvedConfig: (appDirectory: string, resolvedConfig: AppNormalizedConfig<'shared'>) => Promise<void>;
|
17
|
+
export declare const emitResolvedConfig: (appDirectory: string, resolvedConfig: AppNormalizedConfig<'shared'>) => Promise<void>;
|
@@ -5,8 +5,8 @@ export declare const setServer: (newServer: Server) => void;
|
|
5
5
|
export declare const closeServer: () => Promise<void>;
|
6
6
|
export declare const createServer: (options: ModernDevServerOptions) => Promise<Server>;
|
7
7
|
export declare const injectDataLoaderPlugin: (internalPlugins: InternalPlugins) => {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
};
|
8
|
+
'@modern-js/plugin-data-loader': {
|
9
|
+
path: string;
|
10
|
+
forced: boolean;
|
11
|
+
};
|
12
|
+
};
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import type { IAppContext } from '../types';
|
2
|
-
export declare function getAutoInjectEnv(appContext: IAppContext): Record<string, string>;
|
2
|
+
export declare function getAutoInjectEnv(appContext: IAppContext): Record<string, string>;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { IAppContext } from '../types';
|
2
2
|
export declare const addServerConfigToDeps: (dependencies: string[], appDirectory: string, serverConfigFile: string) => Promise<void>;
|
3
|
-
export declare function generateWatchFiles(appContext: IAppContext, configDir?: string): Promise<string[]>;
|
3
|
+
export declare function generateWatchFiles(appContext: IAppContext, configDir?: string): Promise<string[]>;
|
@@ -2,4 +2,4 @@ import { Entrypoint } from '@modern-js/types';
|
|
2
2
|
/**
|
3
3
|
* Allow user to select entrypoints to build.
|
4
4
|
*/
|
5
|
-
export declare const getSelectedEntries: (entry: string[] | boolean, entrypoints: Entrypoint[]) => Promise<string[]>;
|
5
|
+
export declare const getSelectedEntries: (entry: string[] | boolean, entrypoints: Entrypoint[]) => Promise<string[]>;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { AppTools, PluginAPI } from '../types';
|
2
|
-
export declare function getServerInternalPlugins(api: PluginAPI<AppTools<'shared'>>): Promise<Record<string, string>>;
|
2
|
+
export declare function getServerInternalPlugins(api: PluginAPI<AppTools<'shared'>>): Promise<Record<string, string>>;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import type { IAppContext, CliHooksRunner } from '@modern-js/core';
|
2
2
|
import type { AppNormalizedConfig, AppTools } from '../types';
|
3
|
-
export declare const printInstructions: (hookRunners: CliHooksRunner<AppTools<'shared'>>, appContext: IAppContext, config: AppNormalizedConfig<'shared'>) => Promise<void>;
|
3
|
+
export declare const printInstructions: (hookRunners: CliHooksRunner<AppTools<'shared'>>, appContext: IAppContext, config: AppNormalizedConfig<'shared'>) => Promise<void>;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { ToRunners } from '@modern-js/core';
|
2
2
|
import { AppToolsHooks } from '../types/hooks';
|
3
|
-
export declare function restart(hooksRunner: ToRunners<AppToolsHooks>, filename: string): Promise<void>;
|
3
|
+
export declare function restart(hooksRunner: ToRunners<AppToolsHooks>, filename: string): Promise<void>;
|
@@ -1,22 +1,22 @@
|
|
1
1
|
export type DevOptions = {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
entry?: string[] | boolean;
|
3
|
+
config?: string;
|
4
|
+
apiOnly?: boolean;
|
5
|
+
analyze?: boolean;
|
6
6
|
};
|
7
7
|
export type BuildOptions = {
|
8
|
-
|
9
|
-
|
8
|
+
config?: string;
|
9
|
+
analyze?: boolean;
|
10
10
|
};
|
11
11
|
export type DeployOptions = {
|
12
|
-
|
13
|
-
|
12
|
+
config?: string;
|
13
|
+
skipBuild?: boolean;
|
14
14
|
};
|
15
15
|
export type StartOptions = {
|
16
|
-
|
16
|
+
apiOnly?: boolean;
|
17
17
|
};
|
18
18
|
export type InspectOptions = {
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
};
|
19
|
+
env: string;
|
20
|
+
output: string;
|
21
|
+
verbose?: boolean;
|
22
|
+
};
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.
|
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",
|
@@ -71,40 +71,40 @@
|
|
71
71
|
"@babel/types": "^7.22.15",
|
72
72
|
"es-module-lexer": "^1.1.0",
|
73
73
|
"esbuild": "0.17.19",
|
74
|
-
"@swc/helpers": "0.5.
|
75
|
-
"@modern-js/builder": "2.
|
76
|
-
"@modern-js/builder-plugin-
|
77
|
-
"@modern-js/builder-
|
78
|
-
"@modern-js/builder-shared": "2.
|
79
|
-
"@modern-js/
|
80
|
-
"@modern-js/
|
81
|
-
"@modern-js/
|
82
|
-
"@modern-js/
|
83
|
-
"@modern-js/
|
84
|
-
"@modern-js/plugin-
|
85
|
-
"@modern-js/plugin-
|
86
|
-
"@modern-js/
|
87
|
-
"@modern-js/
|
88
|
-
"@modern-js/server": "2.
|
89
|
-
"@modern-js/
|
90
|
-
"@modern-js/
|
91
|
-
"@modern-js/
|
92
|
-
"@modern-js/
|
74
|
+
"@swc/helpers": "0.5.3",
|
75
|
+
"@modern-js/builder-plugin-node-polyfill": "2.42.0",
|
76
|
+
"@modern-js/builder-plugin-esbuild": "2.42.0",
|
77
|
+
"@modern-js/builder-webpack-provider": "2.42.0",
|
78
|
+
"@modern-js/builder-shared": "2.42.0",
|
79
|
+
"@modern-js/builder": "2.42.0",
|
80
|
+
"@modern-js/core": "2.42.0",
|
81
|
+
"@modern-js/plugin": "2.42.0",
|
82
|
+
"@modern-js/new-action": "2.42.0",
|
83
|
+
"@modern-js/node-bundle-require": "2.42.0",
|
84
|
+
"@modern-js/plugin-data-loader": "2.42.0",
|
85
|
+
"@modern-js/plugin-lint": "2.42.0",
|
86
|
+
"@modern-js/plugin-i18n": "2.42.0",
|
87
|
+
"@modern-js/prod-server": "2.42.0",
|
88
|
+
"@modern-js/server": "2.42.0",
|
89
|
+
"@modern-js/upgrade": "2.42.0",
|
90
|
+
"@modern-js/types": "2.42.0",
|
91
|
+
"@modern-js/server-core": "2.42.0",
|
92
|
+
"@modern-js/utils": "2.42.0"
|
93
93
|
},
|
94
94
|
"devDependencies": {
|
95
|
-
"@types/babel__traverse": "
|
95
|
+
"@types/babel__traverse": "7.18.5",
|
96
96
|
"@types/jest": "^29",
|
97
97
|
"@types/node": "^14",
|
98
98
|
"jest": "^29",
|
99
99
|
"typescript": "^5",
|
100
100
|
"webpack": "^5.88.1",
|
101
|
-
"@modern-js/builder-plugin-swc": "2.
|
102
|
-
"@modern-js/builder-rspack-provider": "2.
|
103
|
-
"@scripts/build": "2.
|
104
|
-
"@scripts/jest-config": "2.
|
101
|
+
"@modern-js/builder-plugin-swc": "2.42.0",
|
102
|
+
"@modern-js/builder-rspack-provider": "2.42.0",
|
103
|
+
"@scripts/build": "2.42.0",
|
104
|
+
"@scripts/jest-config": "2.42.0"
|
105
105
|
},
|
106
106
|
"peerDependencies": {
|
107
|
-
"@modern-js/builder-rspack-provider": "^2.
|
107
|
+
"@modern-js/builder-rspack-provider": "^2.42.0"
|
108
108
|
},
|
109
109
|
"peerDependenciesMeta": {
|
110
110
|
"@modern-js/builder-rspack-provider": {
|