@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.
Files changed (112) hide show
  1. package/dist/cjs/analyze/getHtmlTemplate.js +5 -5
  2. package/dist/cjs/analyze/templates.js +7 -6
  3. package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +3 -1
  4. package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +1 -1
  5. package/dist/cjs/config/default.js +2 -1
  6. package/dist/cjs/defineConfig.js +8 -6
  7. package/dist/esm/analyze/getHtmlTemplate.js +5 -5
  8. package/dist/esm/analyze/templates.js +6 -6
  9. package/dist/esm/builder/shared/builderPlugins/adapterSSR.js +6 -4
  10. package/dist/esm/builder/shared/bundlerPlugins/RouterPlugin.js +1 -1
  11. package/dist/esm/config/default.js +2 -1
  12. package/dist/esm/config/initialize/inits.js +19 -19
  13. package/dist/esm/defineConfig.js +1 -1
  14. package/dist/esm-node/analyze/getHtmlTemplate.js +5 -5
  15. package/dist/esm-node/analyze/templates.js +7 -6
  16. package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.js +3 -1
  17. package/dist/esm-node/builder/shared/bundlerPlugins/RouterPlugin.js +1 -1
  18. package/dist/esm-node/config/default.js +2 -1
  19. package/dist/esm-node/defineConfig.js +8 -6
  20. package/dist/types/analyze/constants.d.ts +19 -19
  21. package/dist/types/analyze/generateCode.d.ts +9 -16
  22. package/dist/types/analyze/getBundleEntry.d.ts +1 -1
  23. package/dist/types/analyze/getClientRoutes/getRoutes.d.ts +7 -13
  24. package/dist/types/analyze/getClientRoutes/getRoutesLegacy.d.ts +7 -13
  25. package/dist/types/analyze/getClientRoutes/index.d.ts +1 -1
  26. package/dist/types/analyze/getClientRoutes/utils.d.ts +1 -1
  27. package/dist/types/analyze/getFileSystemEntry.d.ts +1 -1
  28. package/dist/types/analyze/getHtmlTemplate.d.ts +4 -7
  29. package/dist/types/analyze/getServerRoutes.d.ts +4 -7
  30. package/dist/types/analyze/index.d.ts +3 -5
  31. package/dist/types/analyze/isDefaultExportFunction.d.ts +1 -1
  32. package/dist/types/analyze/makeLegalIdentifier.d.ts +1 -1
  33. package/dist/types/analyze/nestedRoutes.d.ts +3 -3
  34. package/dist/types/analyze/templates.d.ts +22 -40
  35. package/dist/types/analyze/utils.d.ts +10 -19
  36. package/dist/types/builder/builder-rspack/adapterCopy.d.ts +1 -1
  37. package/dist/types/builder/builder-rspack/index.d.ts +1 -1
  38. package/dist/types/builder/builder-webpack/adapterModern.d.ts +1 -1
  39. package/dist/types/builder/builder-webpack/createCopyPattern.d.ts +20 -20
  40. package/dist/types/builder/builder-webpack/index.d.ts +1 -1
  41. package/dist/types/builder/generator/createBuilderOptions.d.ts +1 -1
  42. package/dist/types/builder/generator/createBuilderProviderConfig.d.ts +1 -1
  43. package/dist/types/builder/generator/getBuilderTargets.d.ts +1 -1
  44. package/dist/types/builder/generator/index.d.ts +2 -2
  45. package/dist/types/builder/index.d.ts +1 -1
  46. package/dist/types/builder/shared/builderPlugins/adapterBasic.d.ts +1 -1
  47. package/dist/types/builder/shared/builderPlugins/adapterHtml.d.ts +1 -1
  48. package/dist/types/builder/shared/builderPlugins/adapterSSR.d.ts +1 -1
  49. package/dist/types/builder/shared/builderPlugins/index.d.ts +1 -1
  50. package/dist/types/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.d.ts +5 -5
  51. package/dist/types/builder/shared/bundlerPlugins/HtmlBottomTemplate.d.ts +7 -7
  52. package/dist/types/builder/shared/bundlerPlugins/RouterPlugin.d.ts +24 -31
  53. package/dist/types/builder/shared/bundlerPlugins/index.d.ts +1 -1
  54. package/dist/types/builder/shared/createCopyInfo.d.ts +4 -4
  55. package/dist/types/builder/shared/index.d.ts +1 -1
  56. package/dist/types/builder/shared/loaders/serverModuleLoader.d.ts +1 -1
  57. package/dist/types/builder/shared/types.d.ts +3 -3
  58. package/dist/types/commands/build.d.ts +1 -1
  59. package/dist/types/commands/deploy.d.ts +1 -1
  60. package/dist/types/commands/dev.d.ts +2 -2
  61. package/dist/types/commands/index.d.ts +1 -1
  62. package/dist/types/commands/inspect.d.ts +7 -7
  63. package/dist/types/commands/serve.d.ts +1 -1
  64. package/dist/types/config/default.d.ts +1 -1
  65. package/dist/types/config/index.d.ts +1 -1
  66. package/dist/types/config/initialize/index.d.ts +1 -1
  67. package/dist/types/config/initialize/inits.d.ts +1 -1
  68. package/dist/types/config/legacy/createHtmlConfig.d.ts +1 -1
  69. package/dist/types/config/legacy/createOutputConfig.d.ts +1 -1
  70. package/dist/types/config/legacy/createSourceConfig.d.ts +1 -1
  71. package/dist/types/config/legacy/createToolsConfig.d.ts +1 -1
  72. package/dist/types/config/legacy/index.d.ts +1 -1
  73. package/dist/types/defineConfig.d.ts +1 -1
  74. package/dist/types/exports/server.d.ts +1 -1
  75. package/dist/types/hooks.d.ts +1 -1
  76. package/dist/types/index.d.ts +6 -6
  77. package/dist/types/initialize/index.d.ts +3 -5
  78. package/dist/types/locale/en.d.ts +38 -38
  79. package/dist/types/locale/index.d.ts +75 -75
  80. package/dist/types/locale/zh.d.ts +38 -38
  81. package/dist/types/types/config/deploy.d.ts +21 -21
  82. package/dist/types/types/config/dev.d.ts +10 -10
  83. package/dist/types/types/config/experiments.d.ts +1 -1
  84. package/dist/types/types/config/html.d.ts +1 -1
  85. package/dist/types/types/config/index.d.ts +38 -38
  86. package/dist/types/types/config/output.d.ts +35 -28
  87. package/dist/types/types/config/performance.d.ts +1 -1
  88. package/dist/types/types/config/security.d.ts +1 -1
  89. package/dist/types/types/config/source.d.ts +52 -52
  90. package/dist/types/types/config/testing.d.ts +6 -6
  91. package/dist/types/types/config/tools.d.ts +26 -24
  92. package/dist/types/types/hooks.d.ts +75 -75
  93. package/dist/types/types/index.d.ts +17 -17
  94. package/dist/types/types/legacyConfig/deploy.d.ts +5 -5
  95. package/dist/types/types/legacyConfig/dev.d.ts +9 -9
  96. package/dist/types/types/legacyConfig/index.d.ts +16 -16
  97. package/dist/types/types/legacyConfig/output.d.ts +45 -45
  98. package/dist/types/types/legacyConfig/source.d.ts +22 -22
  99. package/dist/types/types/legacyConfig/testing.d.ts +6 -6
  100. package/dist/types/types/legacyConfig/tools.d.ts +10 -10
  101. package/dist/types/types/utils.d.ts +4 -4
  102. package/dist/types/utils/config.d.ts +7 -13
  103. package/dist/types/utils/createServer.d.ts +5 -5
  104. package/dist/types/utils/env.d.ts +1 -1
  105. package/dist/types/utils/generateWatchFiles.d.ts +1 -1
  106. package/dist/types/utils/getSelectedEntries.d.ts +1 -1
  107. package/dist/types/utils/getServerInternalPlugins.d.ts +1 -1
  108. package/dist/types/utils/printInstructions.d.ts +1 -1
  109. package/dist/types/utils/restart.d.ts +1 -1
  110. package/dist/types/utils/routes.d.ts +1 -1
  111. package/dist/types/utils/types.d.ts +13 -13
  112. package/package.json +26 -26
@@ -3,60 +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
- */
9
- entry: string;
10
- /**
11
- * Disable framework's behavior of automatically generating entry code.
12
- */
13
- disableMount?: boolean;
14
- /**
15
- * Specify the file path of custom bootstrap.
16
- */
17
- customBootstrap?: string;
6
+ /**
7
+ * The entry file path.
8
+ */
9
+ entry: string;
10
+ /**
11
+ * Disable framework's behavior of automatically generating entry code.
12
+ */
13
+ disableMount?: boolean;
14
+ /**
15
+ * Specify the file path of custom bootstrap.
16
+ */
17
+ customBootstrap?: string;
18
18
  };
19
19
  export type Entries = Record<string, Entry>;
20
20
  export interface SharedSourceConfig extends BuilderSharedSourceConfig {
21
- /**
22
- * Used to configure custom page entries.
23
- */
24
- entries?: Entries;
25
- /**
26
- * Used to configure the main entry name.
27
- * @default 'main'
28
- */
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
- */
35
- enableAsyncEntry?: boolean;
36
- /**
37
- * Used to disable the functionality of automatically identifying page entry points based on directory structure.
38
- * @default false
39
- */
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
- */
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
- */
50
- disableEntryDirs?: string[];
51
- /**
52
- * Customize the directory of the framework configuration files.
53
- */
54
- configDir?: string;
55
- /**
56
- * @deprecated designSystem is no longer required.
57
- * If you are using Tailwind CSS, you can now use the `theme` option of Tailwind CSS, they are the same.
58
- */
59
- designSystem?: Record<string, any>;
21
+ /**
22
+ * Used to configure custom page entries.
23
+ */
24
+ entries?: Entries;
25
+ /**
26
+ * Used to configure the main entry name.
27
+ * @default 'main'
28
+ */
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
+ */
35
+ enableAsyncEntry?: boolean;
36
+ /**
37
+ * Used to disable the functionality of automatically identifying page entry points based on directory structure.
38
+ * @default false
39
+ */
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
+ */
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
+ */
50
+ disableEntryDirs?: string[];
51
+ /**
52
+ * Customize the directory of the framework configuration files.
53
+ */
54
+ configDir?: string;
55
+ /**
56
+ * @deprecated designSystem is no longer required.
57
+ * If you are using Tailwind CSS, you can now use the `theme` option of Tailwind CSS, they are the same.
58
+ */
59
+ designSystem?: Record<string, any>;
60
60
  }
61
61
  export type SourceUserConfig = BuilderSourceConfig & SharedSourceConfig;
62
- export type RsSourceUserConfig = RsBuilderSourceConfig & SharedSourceConfig;
62
+ export type RsSourceUserConfig = RsBuilderSourceConfig & SharedSourceConfig;
@@ -1,8 +1,8 @@
1
1
  import type { TestConfig } from '@modern-js/types';
2
2
  export interface TestingUserConfig {
3
- /**
4
- * Decide which transformer will be used to compile file
5
- * @default 'babel-jest'
6
- */
7
- transformer?: TestConfig['transformer'];
8
- }
3
+ /**
4
+ * Decide which transformer will be used to compile file
5
+ * @default 'babel-jest'
6
+ */
7
+ transformer?: TestConfig['transformer'];
8
+ }
@@ -5,32 +5,34 @@ import type { SharedToolsConfig as BuilderSharedToolsConfig } from '@modern-js/b
5
5
  import type { UnwrapBuilderConfig } from '../utils';
6
6
  import type { WebpackBuilderConfig, RspackBuilderConfig } from '../../builder/shared';
7
7
  export type BuilderToolsConfig = UnwrapBuilderConfig<WebpackBuilderConfig, 'tools'> & {
8
- esbuild?: PluginEsbuildOptions;
8
+ esbuild?: PluginEsbuildOptions;
9
9
  };
10
10
  export type RsBuilderToolsConfig = UnwrapBuilderConfig<RspackBuilderConfig, 'tools'>;
11
11
  export type Tailwindcss = Record<string, any> | ((options: Record<string, any>) => Record<string, any> | void);
12
12
  export interface SharedToolsConfig extends BuilderSharedToolsConfig {
13
- /**
14
- * Used to custom Tailwind CSS configurations.
15
- * @requires `tailwindcss` plugin.
16
- * The configuration of `tools.tailwindcss` is provided by `tailwindcss` plugin.
17
- * Please use `yarn new` or `pnpm new` to enable the corresponding capability.
18
- */
19
- tailwindcss?: Tailwindcss;
20
- /**
21
- * Used to custom Jest configurations.
22
- * @requires `test` plugin.
23
- * The configuration of `tools.jest` is provided by `test` plugin.
24
- * Please use `yarn new` or `pnpm new` to enable the corresponding capability.
25
- */
26
- jest?: JestConfig | ((jestConfig: JestConfig) => JestConfig);
27
- /**
28
- * Used to custom SWC configurations.
29
- * @requires `swc` plugin.
30
- * The configuration of `swc` is provided by `swc` plugin.
31
- * Please use `yarn new` or `pnpm new` to enable the corresponding capability.
32
- */
33
- swc?: PluginSwcOptions<'outer'>;
13
+ /**
14
+ * Used to custom Tailwind CSS configurations.
15
+ * @requires `tailwindcss` plugin.
16
+ * The configuration of `tools.tailwindcss` is provided by `tailwindcss` plugin.
17
+ * Please use `yarn new` or `pnpm new` to enable the corresponding capability.
18
+ */
19
+ tailwindcss?: Tailwindcss;
20
+ /**
21
+ * Used to custom Jest configurations.
22
+ * @requires `test` plugin.
23
+ * The configuration of `tools.jest` is provided by `test` plugin.
24
+ * Please use `yarn new` or `pnpm new` to enable the corresponding capability.
25
+ */
26
+ jest?: JestConfig | ((jestConfig: JestConfig) => JestConfig);
27
+ /**
28
+ * Used to custom SWC configurations.
29
+ * @requires `swc` plugin.
30
+ * The configuration of `swc` is provided by `swc` plugin.
31
+ * Please use `yarn new` or `pnpm new` to enable the corresponding capability.
32
+ */
33
+ swc?: PluginSwcOptions<'outer'>;
34
+ }
35
+ export interface ToolsUserConfig extends BuilderToolsConfig, SharedToolsConfig {
36
+ }
37
+ export interface RsToolsUserConfig extends SharedToolsConfig, RsBuilderToolsConfig {
34
38
  }
35
- export interface ToolsUserConfig extends BuilderToolsConfig, SharedToolsConfig {}
36
- export interface RsToolsUserConfig extends SharedToolsConfig, RsBuilderToolsConfig {}
@@ -6,84 +6,84 @@ import type { Stats, MultiStats } from '@modern-js/builder-shared';
6
6
  import type { Rspack } from '@modern-js/builder-rspack-provider';
7
7
  import { Bundler } from './utils';
8
8
  export interface ImportSpecifier {
9
- local?: string;
10
- imported?: string;
9
+ local?: string;
10
+ imported?: string;
11
11
  }
12
12
  export interface ImportStatement {
13
- specifiers: ImportSpecifier[];
14
- value: string;
15
- initialize?: string;
13
+ specifiers: ImportSpecifier[];
14
+ value: string;
15
+ initialize?: string;
16
16
  }
17
17
  export interface RuntimePlugin {
18
- name: string;
19
- options: string;
20
- args?: string;
18
+ name: string;
19
+ options: string;
20
+ args?: string;
21
21
  }
22
22
  export type AppToolsHooks<B extends Bundler = 'webpack'> = {
23
- modifyEntryExport: AsyncWaterfall<{
24
- entrypoint: Entrypoint;
25
- exportStatement: string;
26
- }>;
27
- modifyEntryImports: AsyncWaterfall<{
28
- imports: ImportStatement[];
29
- entrypoint: Entrypoint;
30
- }>;
31
- modifyEntryRuntimePlugins: AsyncWaterfall<{
32
- entrypoint: Entrypoint;
33
- plugins: RuntimePlugin[];
34
- bundlerConfigs?: B extends 'rspack' ? Rspack.Configuration[] : webpack.Configuration[];
35
- }>;
36
- modifyEntryRenderFunction: AsyncWaterfall<{
37
- entrypoint: Entrypoint;
38
- code: string;
39
- }>;
40
- modifyAsyncEntry: AsyncWaterfall<{
41
- entrypoint: Entrypoint;
42
- code: string;
43
- }>;
44
- modifyFileSystemRoutes: AsyncWaterfall<{
45
- entrypoint: Entrypoint;
46
- routes: RouteLegacy[] | (NestedRouteForCli | PageRoute)[];
47
- }>;
48
- modifyServerRoutes: AsyncWaterfall<{
49
- routes: ServerRoute[];
50
- }>;
51
- htmlPartials: AsyncWaterfall<{
52
- entrypoint: Entrypoint;
53
- partials: HtmlPartials;
54
- }>;
55
- beforeGenerateRoutes: AsyncWaterfall<{
56
- entrypoint: Entrypoint;
57
- code: string;
58
- }>;
59
- addDefineTypes: AsyncWaterfall<void>;
60
- collectServerPlugins: AsyncWaterfall<{
61
- plugins: Array<Record<string, string>>;
62
- }>;
63
- beforeDev: AsyncWorkflow<void, unknown>;
64
- afterDev: AsyncWorkflow<{
65
- isFirstCompile: boolean;
66
- }, unknown>;
67
- beforeCreateCompiler: AsyncWorkflow<{
68
- bundlerConfigs?: B extends 'rspack' ? Rspack.Configuration[] : webpack.Configuration[];
69
- }, unknown>;
70
- afterCreateCompiler: AsyncWorkflow<{
71
- compiler?: B extends 'rspack' ? Rspack.Compiler : webpack.Compiler | webpack.MultiCompiler;
72
- }, unknown>;
73
- beforePrintInstructions: AsyncWaterfall<{
74
- instructions: string;
75
- }>;
76
- beforeBuild: AsyncWorkflow<{
77
- bundlerConfigs?: B extends 'rspack' ? Rspack.Configuration[] : webpack.Configuration[];
78
- }, unknown>;
79
- afterBuild: AsyncWorkflow<{
80
- stats?: Stats | MultiStats;
81
- }, unknown>;
82
- beforeDeploy: AsyncWorkflow<Record<string, any>, unknown>;
83
- afterDeploy: AsyncWorkflow<Record<string, any>, unknown>;
84
- beforeRestart: AsyncWorkflow<void, void>;
85
- registerDev: ParallelWorkflow<void, DevToolData>;
86
- beforeDevTask: ParallelWorkflow<DevToolData, void>;
87
- registerBuildPlatform: ParallelWorkflow<void, RegisterBuildPlatformResult>;
88
- beforeBuildPlatform: ParallelWorkflow<RegisterBuildPlatformResult[], void>;
89
- };
23
+ modifyEntryExport: AsyncWaterfall<{
24
+ entrypoint: Entrypoint;
25
+ exportStatement: string;
26
+ }>;
27
+ modifyEntryImports: AsyncWaterfall<{
28
+ imports: ImportStatement[];
29
+ entrypoint: Entrypoint;
30
+ }>;
31
+ modifyEntryRuntimePlugins: AsyncWaterfall<{
32
+ entrypoint: Entrypoint;
33
+ plugins: RuntimePlugin[];
34
+ bundlerConfigs?: B extends 'rspack' ? Rspack.Configuration[] : webpack.Configuration[];
35
+ }>;
36
+ modifyEntryRenderFunction: AsyncWaterfall<{
37
+ entrypoint: Entrypoint;
38
+ code: string;
39
+ }>;
40
+ modifyAsyncEntry: AsyncWaterfall<{
41
+ entrypoint: Entrypoint;
42
+ code: string;
43
+ }>;
44
+ modifyFileSystemRoutes: AsyncWaterfall<{
45
+ entrypoint: Entrypoint;
46
+ routes: RouteLegacy[] | (NestedRouteForCli | PageRoute)[];
47
+ }>;
48
+ modifyServerRoutes: AsyncWaterfall<{
49
+ routes: ServerRoute[];
50
+ }>;
51
+ htmlPartials: AsyncWaterfall<{
52
+ entrypoint: Entrypoint;
53
+ partials: HtmlPartials;
54
+ }>;
55
+ beforeGenerateRoutes: AsyncWaterfall<{
56
+ entrypoint: Entrypoint;
57
+ code: string;
58
+ }>;
59
+ addDefineTypes: AsyncWaterfall<void>;
60
+ collectServerPlugins: AsyncWaterfall<{
61
+ plugins: Array<Record<string, string>>;
62
+ }>;
63
+ beforeDev: AsyncWorkflow<void, unknown>;
64
+ afterDev: AsyncWorkflow<{
65
+ isFirstCompile: boolean;
66
+ }, unknown>;
67
+ beforeCreateCompiler: AsyncWorkflow<{
68
+ bundlerConfigs?: B extends 'rspack' ? Rspack.Configuration[] : webpack.Configuration[];
69
+ }, unknown>;
70
+ afterCreateCompiler: AsyncWorkflow<{
71
+ compiler?: B extends 'rspack' ? Rspack.Compiler : webpack.Compiler | webpack.MultiCompiler;
72
+ }, unknown>;
73
+ beforePrintInstructions: AsyncWaterfall<{
74
+ instructions: string;
75
+ }>;
76
+ beforeBuild: AsyncWorkflow<{
77
+ bundlerConfigs?: B extends 'rspack' ? Rspack.Configuration[] : webpack.Configuration[];
78
+ }, unknown>;
79
+ afterBuild: AsyncWorkflow<{
80
+ stats?: Stats | MultiStats;
81
+ }, unknown>;
82
+ beforeDeploy: AsyncWorkflow<Record<string, any>, unknown>;
83
+ afterDeploy: AsyncWorkflow<Record<string, any>, unknown>;
84
+ beforeRestart: AsyncWorkflow<void, void>;
85
+ registerDev: ParallelWorkflow<void, DevToolData>;
86
+ beforeDevTask: ParallelWorkflow<DevToolData, void>;
87
+ registerBuildPlatform: ParallelWorkflow<void, RegisterBuildPlatformResult>;
88
+ beforeBuildPlatform: ParallelWorkflow<RegisterBuildPlatformResult[], void>;
89
+ };
@@ -9,27 +9,27 @@ export * from './legacyConfig';
9
9
  export type { webpack } from '@modern-js/builder-webpack-provider';
10
10
  export type { Rspack } from '@modern-js/builder-rspack-provider';
11
11
  export type { Bundler } from './utils';
12
- export type { ServerUserConfig, ServerNormalizedConfig, BffUserConfig, BffNormalizedConfig, SSR, SSRByEntries } from '@modern-js/server-core';
13
- export type { IAppContext, PluginAPI, CliPlugin, NormalizedConfig, UserConfig } from '@modern-js/core';
12
+ export type { ServerUserConfig, ServerNormalizedConfig, BffUserConfig, BffNormalizedConfig, SSR, SSRByEntries, } from '@modern-js/server-core';
13
+ export type { IAppContext, PluginAPI, CliPlugin, NormalizedConfig, UserConfig, } from '@modern-js/core';
14
14
  export type AppTools<B extends Bundler = 'webpack'> = {
15
- hooks: AppToolsHooks<B>;
16
- userConfig: FromConfig<B, {
17
- rspack: RsAppToolsUserConfig;
18
- webpack: AppToolsUserConfig;
19
- shared: SharedUserConfig;
20
- }>;
21
- normalizedConfig: FromConfig<B, {
22
- rspack: AppToolsNormalizedConfig<RsAppToolsUserConfig>;
23
- webpack: AppToolsNormalizedConfig<AppToolsUserConfig>;
24
- shared: AppToolsNormalizedConfig<SharedUserConfig>;
25
- }>;
15
+ hooks: AppToolsHooks<B>;
16
+ userConfig: FromConfig<B, {
17
+ rspack: RsAppToolsUserConfig;
18
+ webpack: AppToolsUserConfig;
19
+ shared: SharedUserConfig;
20
+ }>;
21
+ normalizedConfig: FromConfig<B, {
22
+ rspack: AppToolsNormalizedConfig<RsAppToolsUserConfig>;
23
+ webpack: AppToolsNormalizedConfig<AppToolsUserConfig>;
24
+ shared: AppToolsNormalizedConfig<SharedUserConfig>;
25
+ }>;
26
26
  };
27
27
  export type LegacyAppTools = {
28
- hooks: AppToolsHooks;
29
- userConfig: AppToolsLegacyUserConfig;
30
- normalizedConfig: AppToolsLegacyNormalizedConfig;
28
+ hooks: AppToolsHooks;
29
+ userConfig: AppToolsLegacyUserConfig;
30
+ normalizedConfig: AppToolsLegacyNormalizedConfig;
31
31
  };
32
32
  export type AppNormalizedConfig<B extends Bundler = 'webpack'> = NormalizedConfig<AppTools<B>>;
33
33
  export type AppLegacyNormalizedConfig = NormalizedConfig<LegacyAppTools>;
34
34
  export type AppUserConfig<B extends Bundler = 'webpack'> = UserConfig<AppTools<B>>;
35
- export type AppLegacyUserConfig = UserConfig<LegacyAppTools>;
35
+ export type AppLegacyUserConfig = UserConfig<LegacyAppTools>;
@@ -1,8 +1,8 @@
1
1
  export interface MicroFrontend {
2
- enableHtmlEntry?: boolean;
3
- externalBasicLibrary?: boolean;
4
- moduleApp?: string;
2
+ enableHtmlEntry?: boolean;
3
+ externalBasicLibrary?: boolean;
4
+ moduleApp?: string;
5
5
  }
6
6
  export type DeployLegacyUserConfig = {
7
- microFrontend?: boolean | MicroFrontend;
8
- };
7
+ microFrontend?: boolean | MicroFrontend;
8
+ };
@@ -1,12 +1,12 @@
1
1
  import type { DevServerHttpsOptions } from '@modern-js/types';
2
2
  export type DevProxyOptions = string | Record<string, string>;
3
3
  export type DevUserLegacyConfig = {
4
- assetPrefix?: string | boolean;
5
- https?: DevServerHttpsOptions;
6
- /**
7
- * The configuration of `dev.proxy` is provided by `proxy` plugin.
8
- * Please use `yarn new` or `pnpm new` to enable the corresponding capability.
9
- * @requires `proxy` plugin
10
- */
11
- proxy?: DevProxyOptions;
12
- };
4
+ assetPrefix?: string | boolean;
5
+ https?: DevServerHttpsOptions;
6
+ /**
7
+ * The configuration of `dev.proxy` is provided by `proxy` plugin.
8
+ * Please use `yarn new` or `pnpm new` to enable the corresponding capability.
9
+ * @requires `proxy` plugin
10
+ */
11
+ proxy?: DevProxyOptions;
12
+ };
@@ -11,25 +11,25 @@ export type { DeployLegacyUserConfig } from './deploy';
11
11
  export type { SourceLegacyUserConfig } from './source';
12
12
  export type { ToolsLegacyUserConfig } from './tools';
13
13
  export interface RuntimeLegacyConfig {
14
- [name: string]: any;
14
+ [name: string]: any;
15
15
  }
16
16
  export interface RuntimeByEntriesLegacyConfig {
17
- [name: string]: RuntimeLegacyConfig;
17
+ [name: string]: RuntimeLegacyConfig;
18
18
  }
19
19
  export type AppToolsLegacyUserConfig = {
20
- source?: SourceLegacyUserConfig;
21
- output?: OutputLegacyUserConfig;
22
- server?: LegacyServerUserConfig;
23
- dev?: DevUserLegacyConfig;
24
- deploy?: DeployLegacyUserConfig;
25
- tools?: ToolsLegacyUserConfig;
26
- runtime?: RuntimeLegacyConfig;
27
- runtimeByEntries?: RuntimeByEntriesLegacyConfig;
28
- bff?: LegacyBffUserConfig;
29
- testing?: TestingLegacyUserConfig;
30
- legacy?: boolean;
20
+ source?: SourceLegacyUserConfig;
21
+ output?: OutputLegacyUserConfig;
22
+ server?: LegacyServerUserConfig;
23
+ dev?: DevUserLegacyConfig;
24
+ deploy?: DeployLegacyUserConfig;
25
+ tools?: ToolsLegacyUserConfig;
26
+ runtime?: RuntimeLegacyConfig;
27
+ runtimeByEntries?: RuntimeByEntriesLegacyConfig;
28
+ bff?: LegacyBffUserConfig;
29
+ testing?: TestingLegacyUserConfig;
30
+ legacy?: boolean;
31
31
  };
32
32
  export interface AppToolsLegacyNormalizedConfig extends Required<AppToolsLegacyUserConfig> {
33
- cliOptions?: Record<string, any>;
34
- _raw: AppToolsLegacyUserConfig;
35
- }
33
+ cliOptions?: Record<string, any>;
34
+ _raw: AppToolsLegacyUserConfig;
35
+ }
@@ -2,49 +2,49 @@ import type { MetaOptions } from '@modern-js/builder-shared';
2
2
  import type { SSGConfig } from '../config';
3
3
  type CrossOrigin = 'anonymous' | 'use-credentials';
4
4
  export type OutputLegacyUserConfig = {
5
- assetPrefix?: string;
6
- htmlPath?: string;
7
- jsPath?: string;
8
- cssPath?: string;
9
- mediaPath?: string;
10
- path?: string;
11
- title?: string;
12
- titleByEntries?: Record<string, string>;
13
- meta?: MetaOptions;
14
- metaByEntries?: Record<string, MetaOptions>;
15
- inject?: 'body' | 'head' | boolean;
16
- injectByEntries?: Record<string, 'body' | 'head' | boolean>;
17
- mountId?: string;
18
- favicon?: string;
19
- faviconByEntries?: Record<string, string | undefined>;
20
- copy?: Array<Record<string, unknown> & {
21
- from: string;
22
- }>;
23
- disableTsChecker?: boolean;
24
- disableHtmlFolder?: boolean;
25
- disableCssModuleExtension?: boolean;
26
- disableCssExtract?: boolean;
27
- enableCssModuleTSDeclaration?: boolean;
28
- disableMinimize?: boolean;
29
- enableInlineStyles?: boolean;
30
- enableInlineScripts?: boolean;
31
- disableSourceMap?: boolean;
32
- disableInlineRuntimeChunk?: boolean;
33
- disableAssetsCache?: boolean;
34
- enableLatestDecorators?: boolean;
35
- polyfill?: 'off' | 'usage' | 'entry' | 'ua';
36
- dataUriLimit?: number;
37
- templateParameters?: Record<string, unknown>;
38
- templateParametersByEntries?: Record<string, Record<string, unknown>>;
39
- crossorigin?: boolean | CrossOrigin;
40
- cssModuleLocalIdentName?: string;
41
- disableNodePolyfill?: boolean;
42
- enableTsLoader?: boolean;
43
- /**
44
- * The configuration of `output.ssg` is provided by `ssg` plugin.
45
- * Please use `yarn new` or `pnpm new` to enable the corresponding capability.
46
- * @requires `ssg` plugin
47
- */
48
- ssg?: SSGConfig;
5
+ assetPrefix?: string;
6
+ htmlPath?: string;
7
+ jsPath?: string;
8
+ cssPath?: string;
9
+ mediaPath?: string;
10
+ path?: string;
11
+ title?: string;
12
+ titleByEntries?: Record<string, string>;
13
+ meta?: MetaOptions;
14
+ metaByEntries?: Record<string, MetaOptions>;
15
+ inject?: 'body' | 'head' | boolean;
16
+ injectByEntries?: Record<string, 'body' | 'head' | boolean>;
17
+ mountId?: string;
18
+ favicon?: string;
19
+ faviconByEntries?: Record<string, string | undefined>;
20
+ copy?: Array<Record<string, unknown> & {
21
+ from: string;
22
+ }>;
23
+ disableTsChecker?: boolean;
24
+ disableHtmlFolder?: boolean;
25
+ disableCssModuleExtension?: boolean;
26
+ disableCssExtract?: boolean;
27
+ enableCssModuleTSDeclaration?: boolean;
28
+ disableMinimize?: boolean;
29
+ enableInlineStyles?: boolean;
30
+ enableInlineScripts?: boolean;
31
+ disableSourceMap?: boolean;
32
+ disableInlineRuntimeChunk?: boolean;
33
+ disableAssetsCache?: boolean;
34
+ enableLatestDecorators?: boolean;
35
+ polyfill?: 'off' | 'usage' | 'entry' | 'ua';
36
+ dataUriLimit?: number;
37
+ templateParameters?: Record<string, unknown>;
38
+ templateParametersByEntries?: Record<string, Record<string, unknown>>;
39
+ crossorigin?: boolean | CrossOrigin;
40
+ cssModuleLocalIdentName?: string;
41
+ disableNodePolyfill?: boolean;
42
+ enableTsLoader?: boolean;
43
+ /**
44
+ * The configuration of `output.ssg` is provided by `ssg` plugin.
45
+ * Please use `yarn new` or `pnpm new` to enable the corresponding capability.
46
+ * @requires `ssg` plugin
47
+ */
48
+ ssg?: SSGConfig;
49
49
  };
50
- export {};
50
+ export {};
@@ -1,24 +1,24 @@
1
1
  import type { AliasOption } from '@modern-js/utils';
2
2
  export type SourceLegacyUserConfig = {
3
- alias?: AliasOption;
4
- entries?: Record<string, string | {
5
- entry: string;
6
- disableMount?: boolean;
7
- }>;
8
- mainEntryName?: string;
9
- preEntry?: string | string[];
10
- enableAsyncEntry?: boolean;
11
- disableDefaultEntries?: boolean;
12
- entriesDir?: string;
13
- configDir?: string;
14
- apiDir?: string;
15
- envVars?: Array<string>;
16
- globalVars?: Record<string, string>;
17
- moduleScopes?: Array<string | RegExp> | (((scopes: Array<string | RegExp>) => void) | ((scopes: Array<string | RegExp>) => Array<string | RegExp>))[] | ((scopes: Array<string | RegExp>) => Array<string | RegExp>) | ((scopes: Array<string | RegExp>) => void);
18
- include?: Array<string | RegExp>;
19
- /**
20
- * @deprecated designSystem is no longer required.
21
- * If you are using Tailwind CSS, you can now use the `theme` option of Tailwind CSS, they are the same.
22
- */
23
- designSystem?: Record<string, any>;
24
- };
3
+ alias?: AliasOption;
4
+ entries?: Record<string, string | {
5
+ entry: string;
6
+ disableMount?: boolean;
7
+ }>;
8
+ mainEntryName?: string;
9
+ preEntry?: string | string[];
10
+ enableAsyncEntry?: boolean;
11
+ disableDefaultEntries?: boolean;
12
+ entriesDir?: string;
13
+ configDir?: string;
14
+ apiDir?: string;
15
+ envVars?: Array<string>;
16
+ globalVars?: Record<string, string>;
17
+ moduleScopes?: Array<string | RegExp> | (((scopes: Array<string | RegExp>) => void) | ((scopes: Array<string | RegExp>) => Array<string | RegExp>))[] | ((scopes: Array<string | RegExp>) => Array<string | RegExp>) | ((scopes: Array<string | RegExp>) => void);
18
+ include?: Array<string | RegExp>;
19
+ /**
20
+ * @deprecated designSystem is no longer required.
21
+ * If you are using Tailwind CSS, you can now use the `theme` option of Tailwind CSS, they are the same.
22
+ */
23
+ designSystem?: Record<string, any>;
24
+ };
@@ -1,8 +1,8 @@
1
1
  import type { TestConfig } from '@modern-js/types';
2
2
  export interface TestingLegacyUserConfig {
3
- /**
4
- * Decide which transformer will be used to compile file
5
- * @default 'babel-jest'
6
- */
7
- transformer?: TestConfig['transformer'];
8
- }
3
+ /**
4
+ * Decide which transformer will be used to compile file
5
+ * @default 'babel-jest'
6
+ */
7
+ transformer?: TestConfig['transformer'];
8
+ }