@modern-js/app-tools 2.41.0 → 2.42.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.
Files changed (102) hide show
  1. package/dist/cjs/analyze/templates.js +7 -6
  2. package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +3 -1
  3. package/dist/cjs/config/default.js +2 -1
  4. package/dist/esm/analyze/templates.js +6 -6
  5. package/dist/esm/builder/shared/builderPlugins/adapterSSR.js +6 -4
  6. package/dist/esm/config/default.js +2 -1
  7. package/dist/esm-node/analyze/templates.js +7 -6
  8. package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.js +3 -1
  9. package/dist/esm-node/config/default.js +2 -1
  10. package/dist/types/analyze/constants.d.ts +19 -19
  11. package/dist/types/analyze/generateCode.d.ts +9 -16
  12. package/dist/types/analyze/getBundleEntry.d.ts +1 -1
  13. package/dist/types/analyze/getClientRoutes/getRoutes.d.ts +7 -13
  14. package/dist/types/analyze/getClientRoutes/getRoutesLegacy.d.ts +7 -13
  15. package/dist/types/analyze/getClientRoutes/index.d.ts +1 -1
  16. package/dist/types/analyze/getClientRoutes/utils.d.ts +1 -1
  17. package/dist/types/analyze/getFileSystemEntry.d.ts +1 -1
  18. package/dist/types/analyze/getHtmlTemplate.d.ts +4 -7
  19. package/dist/types/analyze/getServerRoutes.d.ts +4 -7
  20. package/dist/types/analyze/index.d.ts +3 -5
  21. package/dist/types/analyze/isDefaultExportFunction.d.ts +1 -1
  22. package/dist/types/analyze/makeLegalIdentifier.d.ts +1 -1
  23. package/dist/types/analyze/nestedRoutes.d.ts +3 -3
  24. package/dist/types/analyze/templates.d.ts +22 -40
  25. package/dist/types/analyze/utils.d.ts +10 -19
  26. package/dist/types/builder/builder-rspack/adapterCopy.d.ts +1 -1
  27. package/dist/types/builder/builder-rspack/index.d.ts +1 -1
  28. package/dist/types/builder/builder-webpack/adapterModern.d.ts +1 -1
  29. package/dist/types/builder/builder-webpack/createCopyPattern.d.ts +20 -20
  30. package/dist/types/builder/builder-webpack/index.d.ts +1 -1
  31. package/dist/types/builder/generator/createBuilderOptions.d.ts +1 -1
  32. package/dist/types/builder/generator/createBuilderProviderConfig.d.ts +1 -1
  33. package/dist/types/builder/generator/getBuilderTargets.d.ts +1 -1
  34. package/dist/types/builder/generator/index.d.ts +2 -2
  35. package/dist/types/builder/index.d.ts +1 -1
  36. package/dist/types/builder/shared/builderPlugins/adapterBasic.d.ts +1 -1
  37. package/dist/types/builder/shared/builderPlugins/adapterHtml.d.ts +1 -1
  38. package/dist/types/builder/shared/builderPlugins/adapterSSR.d.ts +1 -1
  39. package/dist/types/builder/shared/builderPlugins/index.d.ts +1 -1
  40. package/dist/types/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.d.ts +5 -5
  41. package/dist/types/builder/shared/bundlerPlugins/HtmlBottomTemplate.d.ts +7 -7
  42. package/dist/types/builder/shared/bundlerPlugins/RouterPlugin.d.ts +24 -31
  43. package/dist/types/builder/shared/bundlerPlugins/index.d.ts +1 -1
  44. package/dist/types/builder/shared/createCopyInfo.d.ts +4 -4
  45. package/dist/types/builder/shared/index.d.ts +1 -1
  46. package/dist/types/builder/shared/loaders/serverModuleLoader.d.ts +1 -1
  47. package/dist/types/builder/shared/types.d.ts +3 -3
  48. package/dist/types/commands/build.d.ts +1 -1
  49. package/dist/types/commands/deploy.d.ts +1 -1
  50. package/dist/types/commands/dev.d.ts +2 -2
  51. package/dist/types/commands/index.d.ts +1 -1
  52. package/dist/types/commands/inspect.d.ts +7 -7
  53. package/dist/types/commands/serve.d.ts +1 -1
  54. package/dist/types/config/default.d.ts +1 -1
  55. package/dist/types/config/index.d.ts +1 -1
  56. package/dist/types/config/initialize/index.d.ts +1 -1
  57. package/dist/types/config/initialize/inits.d.ts +1 -1
  58. package/dist/types/config/legacy/createHtmlConfig.d.ts +1 -1
  59. package/dist/types/config/legacy/createOutputConfig.d.ts +1 -1
  60. package/dist/types/config/legacy/createSourceConfig.d.ts +1 -1
  61. package/dist/types/config/legacy/createToolsConfig.d.ts +1 -1
  62. package/dist/types/config/legacy/index.d.ts +1 -1
  63. package/dist/types/defineConfig.d.ts +1 -1
  64. package/dist/types/exports/server.d.ts +1 -1
  65. package/dist/types/hooks.d.ts +1 -1
  66. package/dist/types/index.d.ts +6 -6
  67. package/dist/types/initialize/index.d.ts +3 -5
  68. package/dist/types/locale/en.d.ts +38 -38
  69. package/dist/types/locale/index.d.ts +75 -75
  70. package/dist/types/locale/zh.d.ts +38 -38
  71. package/dist/types/types/config/deploy.d.ts +21 -21
  72. package/dist/types/types/config/dev.d.ts +10 -10
  73. package/dist/types/types/config/experiments.d.ts +1 -1
  74. package/dist/types/types/config/html.d.ts +1 -1
  75. package/dist/types/types/config/index.d.ts +38 -38
  76. package/dist/types/types/config/output.d.ts +35 -28
  77. package/dist/types/types/config/performance.d.ts +1 -1
  78. package/dist/types/types/config/security.d.ts +1 -1
  79. package/dist/types/types/config/source.d.ts +52 -52
  80. package/dist/types/types/config/testing.d.ts +6 -6
  81. package/dist/types/types/config/tools.d.ts +26 -24
  82. package/dist/types/types/hooks.d.ts +75 -75
  83. package/dist/types/types/index.d.ts +17 -17
  84. package/dist/types/types/legacyConfig/deploy.d.ts +5 -5
  85. package/dist/types/types/legacyConfig/dev.d.ts +9 -9
  86. package/dist/types/types/legacyConfig/index.d.ts +16 -16
  87. package/dist/types/types/legacyConfig/output.d.ts +45 -45
  88. package/dist/types/types/legacyConfig/source.d.ts +22 -22
  89. package/dist/types/types/legacyConfig/testing.d.ts +6 -6
  90. package/dist/types/types/legacyConfig/tools.d.ts +10 -10
  91. package/dist/types/types/utils.d.ts +4 -4
  92. package/dist/types/utils/config.d.ts +7 -13
  93. package/dist/types/utils/createServer.d.ts +5 -5
  94. package/dist/types/utils/env.d.ts +1 -1
  95. package/dist/types/utils/generateWatchFiles.d.ts +1 -1
  96. package/dist/types/utils/getSelectedEntries.d.ts +1 -1
  97. package/dist/types/utils/getServerInternalPlugins.d.ts +1 -1
  98. package/dist/types/utils/printInstructions.d.ts +1 -1
  99. package/dist/types/utils/restart.d.ts +1 -1
  100. package/dist/types/utils/routes.d.ts +1 -1
  101. package/dist/types/utils/types.d.ts +13 -13
  102. package/package.json +24 -24
@@ -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
+ }
@@ -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
- 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);
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
- rspack: Rspack;
5
- webpack: Webpack;
6
- shared: Shared;
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
- appDirectory,
7
- distDirectory,
8
- configFile,
9
- options,
10
- watch
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
- '@modern-js/plugin-data-loader': {
9
- path: string;
10
- forced: boolean;
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,3 +1,3 @@
1
1
  import type { IAppContext } from '@modern-js/core';
2
2
  declare const generateRoutes: (appContext: IAppContext) => Promise<void>;
3
- export { generateRoutes };
3
+ export { generateRoutes };
@@ -1,22 +1,22 @@
1
1
  export type DevOptions = {
2
- entry?: string[] | boolean;
3
- config?: string;
4
- apiOnly?: boolean;
5
- analyze?: boolean;
2
+ entry?: string[] | boolean;
3
+ config?: string;
4
+ apiOnly?: boolean;
5
+ analyze?: boolean;
6
6
  };
7
7
  export type BuildOptions = {
8
- config?: string;
9
- analyze?: boolean;
8
+ config?: string;
9
+ analyze?: boolean;
10
10
  };
11
11
  export type DeployOptions = {
12
- config?: string;
13
- skipBuild?: boolean;
12
+ config?: string;
13
+ skipBuild?: boolean;
14
14
  };
15
15
  export type StartOptions = {
16
- apiOnly?: boolean;
16
+ apiOnly?: boolean;
17
17
  };
18
18
  export type InspectOptions = {
19
- env: string;
20
- output: string;
21
- verbose?: boolean;
22
- };
19
+ env: string;
20
+ output: string;
21
+ verbose?: boolean;
22
+ };