@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
@@ -1,9 +1,6 @@
1
1
  import type { Entrypoint, HtmlTemplates } from '@modern-js/types';
2
2
  import type { AppNormalizedConfig, AppTools, IAppContext, PluginAPI } from '../types';
3
- export declare const getHtmlTemplate: (entrypoints: Entrypoint[], api: PluginAPI<AppTools<'shared'>>, {
4
- appContext,
5
- config
6
- }: {
7
- appContext: IAppContext;
8
- config: AppNormalizedConfig<'shared'>;
9
- }) => Promise<HtmlTemplates>;
3
+ export declare const getHtmlTemplate: (entrypoints: Entrypoint[], api: PluginAPI<AppTools<'shared'>>, { appContext, config, }: {
4
+ appContext: IAppContext;
5
+ config: AppNormalizedConfig<'shared'>;
6
+ }) => Promise<HtmlTemplates>;
@@ -1,10 +1,7 @@
1
1
  import type { IAppContext } from '@modern-js/core';
2
2
  import type { Entrypoint, ServerRoute } from '@modern-js/types';
3
3
  import type { AppNormalizedConfig } from '../types';
4
- export declare const getServerRoutes: (entrypoints: Entrypoint[], {
5
- appContext,
6
- config
7
- }: {
8
- appContext: IAppContext;
9
- config: AppNormalizedConfig<'shared'>;
10
- }) => ServerRoute[];
4
+ export declare const getServerRoutes: (entrypoints: Entrypoint[], { appContext, config, }: {
5
+ appContext: IAppContext;
6
+ config: AppNormalizedConfig<'shared'>;
7
+ }) => ServerRoute[];
@@ -1,8 +1,6 @@
1
1
  import type { CliPlugin } from '@modern-js/core';
2
2
  import { AppTools } from '../types';
3
- declare const _default: ({
4
- bundler
5
- }: {
6
- bundler: 'webpack' | 'rspack';
3
+ declare const _default: ({ bundler, }: {
4
+ bundler: 'webpack' | 'rspack';
7
5
  }) => CliPlugin<AppTools<'shared'>>;
8
- export default _default;
6
+ export default _default;
@@ -1 +1 @@
1
- export declare const isDefaultExportFunction: (file: string | false) => boolean;
1
+ export declare const isDefaultExportFunction: (file: string | false) => boolean;
@@ -1 +1 @@
1
- export declare function makeLegalIdentifier(str: string): string;
1
+ export declare function makeLegalIdentifier(str: string): string;
@@ -2,6 +2,6 @@ import type { NestedRouteForCli } from '@modern-js/types';
2
2
  export declare const getRouteId: (componentPath: string, routesDir: string, entryName: string, isMainEntry: boolean) => string;
3
3
  export declare const optimizeRoute: (routeTree: NestedRouteForCli) => NestedRouteForCli[];
4
4
  export declare const walk: (dirname: string, rootDir: string, alias: {
5
- name: string;
6
- basename: string;
7
- }, entryName: string, isMainEntry: boolean, oldVersion: boolean) => Promise<NestedRouteForCli | NestedRouteForCli[] | null>;
5
+ name: string;
6
+ basename: string;
7
+ }, entryName: string, isMainEntry: boolean, oldVersion: boolean) => Promise<NestedRouteForCli | NestedRouteForCli[] | null>;
@@ -1,48 +1,30 @@
1
1
  import type { Entrypoint, NestedRouteForCli, PageRoute, RouteLegacy, SSRMode } from '@modern-js/types';
2
2
  import type { AppNormalizedConfig, IAppContext, RuntimePlugin } from '../types';
3
- export declare const index: ({
4
- mountId,
5
- imports,
6
- renderFunction,
7
- exportStatement
8
- }: {
9
- mountId: string;
10
- imports: string;
11
- exportStatement: string;
12
- renderFunction: string;
3
+ export declare const index: ({ mountId, imports, renderFunction, exportStatement, }: {
4
+ mountId: string;
5
+ imports: string;
6
+ exportStatement: string;
7
+ renderFunction: string;
13
8
  }) => string;
14
- export declare const renderFunction: ({
15
- plugins,
16
- customBootstrap,
17
- fileSystemRoutes
18
- }: {
19
- plugins: RuntimePlugin[];
20
- customBootstrap?: string | false | undefined;
21
- fileSystemRoutes: Entrypoint['fileSystemRoutes'];
9
+ export declare const renderFunction: ({ plugins, customBootstrap, fileSystemRoutes, }: {
10
+ plugins: RuntimePlugin[];
11
+ customBootstrap?: string | false | undefined;
12
+ fileSystemRoutes: Entrypoint['fileSystemRoutes'];
22
13
  }) => string;
23
14
  export declare const html: (partials: {
24
- top: string[];
25
- head: string[];
26
- body: string[];
15
+ top: string[];
16
+ head: string[];
17
+ body: string[];
27
18
  }) => string;
28
- export declare const routesForServer: ({
29
- routes
30
- }: {
31
- routes: (NestedRouteForCli | PageRoute)[];
19
+ export declare const routesForServer: ({ routes, }: {
20
+ routes: (NestedRouteForCli | PageRoute)[];
32
21
  }) => string;
33
- export declare const fileSystemRoutes: ({
34
- routes,
35
- ssrMode,
36
- nestedRoutesEntry,
37
- entryName,
38
- internalDirectory,
39
- splitRouteChunks
40
- }: {
41
- routes: RouteLegacy[] | (NestedRouteForCli | PageRoute)[];
42
- ssrMode?: SSRMode | undefined;
43
- nestedRoutesEntry?: string | undefined;
44
- entryName: string;
45
- internalDirectory: string;
46
- splitRouteChunks?: boolean | undefined;
22
+ export declare const fileSystemRoutes: ({ routes, ssrMode, nestedRoutesEntry, entryName, internalDirectory, splitRouteChunks, }: {
23
+ routes: RouteLegacy[] | (NestedRouteForCli | PageRoute)[];
24
+ ssrMode?: SSRMode | undefined;
25
+ nestedRoutesEntry?: string | undefined;
26
+ entryName: string;
27
+ internalDirectory: string;
28
+ splitRouteChunks?: boolean | undefined;
47
29
  }) => Promise<string>;
48
- export declare function ssrLoaderCombinedModule(entrypoints: Entrypoint[], entrypoint: Entrypoint, config: AppNormalizedConfig<'shared'>, appContext: IAppContext): string | null;
30
+ export declare function ssrLoaderCombinedModule(entrypoints: Entrypoint[], entrypoint: Entrypoint, config: AppNormalizedConfig<'shared'>, appContext: IAppContext): string | null;
@@ -1,31 +1,22 @@
1
1
  import type { Entrypoint } from '@modern-js/types';
2
2
  import type { ImportStatement } from '../types';
3
3
  export declare const walkDirectory: (dir: string) => string[];
4
- export declare const getDefaultImports: ({
5
- entrypoint,
6
- srcDirectory,
7
- internalSrcAlias,
8
- internalDirAlias,
9
- internalDirectory
10
- }: {
11
- entrypoint: Entrypoint;
12
- srcDirectory: string;
13
- internalSrcAlias: string;
14
- internalDirAlias: string;
15
- internalDirectory: string;
4
+ export declare const getDefaultImports: ({ entrypoint, srcDirectory, internalSrcAlias, internalDirAlias, internalDirectory, }: {
5
+ entrypoint: Entrypoint;
6
+ srcDirectory: string;
7
+ internalSrcAlias: string;
8
+ internalDirAlias: string;
9
+ internalDirectory: string;
16
10
  }) => ImportStatement[];
17
11
  export declare const isPageComponentFile: (filePath: string) => boolean;
18
12
  export declare const replaceWithAlias: (base: string, filePath: string, alias: string) => string;
19
- export declare const parseModule: ({
20
- source,
21
- filename
22
- }: {
23
- source: string;
24
- filename: string;
13
+ export declare const parseModule: ({ source, filename, }: {
14
+ source: string;
15
+ filename: string;
25
16
  }) => Promise<readonly [imports: readonly import("es-module-lexer").ImportSpecifier[], exports: readonly import("es-module-lexer").ExportSpecifier[], facade: boolean]>;
26
17
  export declare const hasLoader: (filename: string, source?: string) => Promise<boolean>;
27
18
  export declare const hasAction: (filename: string, source?: string) => Promise<boolean>;
28
19
  export declare const getServerLoadersFile: (internalDirectory: string, entryName: string) => string;
29
20
  export declare const getServerCombinedModueFile: (internalDirectory: string, entryName: string) => string;
30
21
  export declare const checkIsBuildCommands: () => boolean;
31
- export declare const isSubDirOrEqual: (parent: string, child: string) => boolean;
22
+ export declare const isSubDirOrEqual: (parent: string, child: string) => boolean;
@@ -1,4 +1,4 @@
1
1
  import { BuilderPlugin } from '@modern-js/builder-shared';
2
2
  import { BuilderPluginAPI } from '@modern-js/builder-rspack-provider';
3
3
  import { BuilderOptions } from '../shared';
4
- export declare const builderPluginAdpaterCopy: (options: BuilderOptions<'rspack'>) => BuilderPlugin<BuilderPluginAPI>;
4
+ export declare const builderPluginAdpaterCopy: (options: BuilderOptions<'rspack'>) => BuilderPlugin<BuilderPluginAPI>;
@@ -1,2 +1,2 @@
1
1
  import { BuilderOptions } from '../shared';
2
- export declare function createRspackBuilderForModern(options: BuilderOptions<'rspack'>): Promise<import("@modern-js/builder-shared").BuilderInstance<import("@modern-js/builder-shared").BuilderProvider>>;
2
+ export declare function createRspackBuilderForModern(options: BuilderOptions<'rspack'>): Promise<import("@modern-js/builder-shared").BuilderInstance<import("@modern-js/builder-shared").BuilderProvider>>;
@@ -4,4 +4,4 @@ import { BuilderOptions } from '../shared';
4
4
  /**
5
5
  * Provides default configuration consistent with modern.js v1
6
6
  */
7
- export declare const builderPluginAdapterModern: (options: BuilderOptions<'webpack'>) => BuilderPlugin<BuilderPluginAPI>;
7
+ export declare const builderPluginAdapterModern: (options: BuilderOptions<'webpack'>) => BuilderPlugin<BuilderPluginAPI>;
@@ -2,25 +2,25 @@
2
2
  import { WebpackChain } from '@modern-js/builder-webpack-provider';
3
3
  import type { AppNormalizedConfig, Bundler, IAppContext } from '../../types';
4
4
  export declare function createPublicPattern(appContext: IAppContext, config: AppNormalizedConfig, chain: WebpackChain): {
5
- info: (file: {
6
- sourceFilename: string;
7
- }) => {
8
- minimized: boolean;
9
- };
10
- from: string;
11
- to: string;
12
- context: string;
13
- noErrorOnMissing: boolean;
14
- transform: (content: Buffer, absoluteFrom: string) => string | Buffer;
5
+ info: (file: {
6
+ sourceFilename: string;
7
+ }) => {
8
+ minimized: boolean;
9
+ };
10
+ from: string;
11
+ to: string;
12
+ context: string;
13
+ noErrorOnMissing: boolean;
14
+ transform: (content: Buffer, absoluteFrom: string) => string | Buffer;
15
15
  };
16
16
  export declare function createUploadPattern<B extends Bundler>(appContext: IAppContext, config: AppNormalizedConfig<B>): {
17
- info: (file: {
18
- sourceFilename: string;
19
- }) => {
20
- minimized: boolean;
21
- };
22
- from: string;
23
- to: string;
24
- context: string;
25
- noErrorOnMissing: boolean;
26
- };
17
+ info: (file: {
18
+ sourceFilename: string;
19
+ }) => {
20
+ minimized: boolean;
21
+ };
22
+ from: string;
23
+ to: string;
24
+ context: string;
25
+ noErrorOnMissing: boolean;
26
+ };
@@ -1,4 +1,4 @@
1
1
  import { BuilderInstance } from '@modern-js/builder';
2
2
  import { BuilderWebpackProvider } from '@modern-js/builder-webpack-provider';
3
3
  import { BuilderOptions } from '../shared';
4
- export declare function createWebpackBuilderForModern(options: BuilderOptions<'webpack'>): Promise<BuilderInstance<BuilderWebpackProvider>>;
4
+ export declare function createWebpackBuilderForModern(options: BuilderOptions<'webpack'>): Promise<BuilderInstance<BuilderWebpackProvider>>;
@@ -1,3 +1,3 @@
1
1
  import type { BuilderTarget, CreateBuilderOptions } from '@modern-js/builder-shared';
2
2
  import type { IAppContext } from '@modern-js/core';
3
- export declare function createBuilderOptions(target: BuilderTarget | BuilderTarget[], appContext: IAppContext): CreateBuilderOptions;
3
+ export declare function createBuilderOptions(target: BuilderTarget | BuilderTarget[], appContext: IAppContext): CreateBuilderOptions;
@@ -1,2 +1,2 @@
1
1
  import type { Bundler, IAppContext, AppNormalizedConfig } from '../../types';
2
- export declare function createBuilderProviderConfig<B extends Bundler>(resolveConfig: AppNormalizedConfig<B>, appContext: IAppContext): AppNormalizedConfig<B>;
2
+ export declare function createBuilderProviderConfig<B extends Bundler>(resolveConfig: AppNormalizedConfig<B>, appContext: IAppContext): AppNormalizedConfig<B>;
@@ -1,3 +1,3 @@
1
1
  import type { BuilderTarget } from '@modern-js/builder-shared';
2
2
  import type { AppNormalizedConfig } from '../../types';
3
- export declare function getBuilderTargets(normalizedConfig: AppNormalizedConfig<'shared'>): BuilderTarget[];
3
+ export declare function getBuilderTargets(normalizedConfig: AppNormalizedConfig<'shared'>): BuilderTarget[];
@@ -2,11 +2,11 @@ import type { BuilderProvider, BuilderInstance } from '@modern-js/builder-shared
2
2
  import { BuilderOptions } from '../shared';
3
3
  import { Bundler } from '../../types';
4
4
  export type GenerateProvider = (c: {
5
- builderConfig: any;
5
+ builderConfig: any;
6
6
  }) => BuilderProvider;
7
7
  /**
8
8
  * @param options BuilderOptions
9
9
  * @param generateProvider GenerateProvider
10
10
  * @returns BuilderInstance
11
11
  */
12
- export declare function generateBuilder<B extends Bundler>(options: BuilderOptions<B>, generateProvider: GenerateProvider): Promise<BuilderInstance<BuilderProvider>>;
12
+ export declare function generateBuilder<B extends Bundler>(options: BuilderOptions<B>, generateProvider: GenerateProvider): Promise<BuilderInstance<BuilderProvider>>;
@@ -1 +1 @@
1
- export declare function createBuilderGenerator(bundler: 'webpack' | 'rspack'): Promise<typeof import("./builder-rspack").createRspackBuilderForModern | typeof import("./builder-webpack").createWebpackBuilderForModern>;
1
+ export declare function createBuilderGenerator(bundler: 'webpack' | 'rspack'): Promise<typeof import("./builder-rspack").createRspackBuilderForModern | typeof import("./builder-webpack").createWebpackBuilderForModern>;
@@ -1,3 +1,3 @@
1
1
  import { BuilderPlugin } from '@modern-js/builder-shared';
2
2
  import type { BuilderPluginAPI } from '../types';
3
- export declare const builderPluginAdapterBasic: () => BuilderPlugin<BuilderPluginAPI>;
3
+ export declare const builderPluginAdapterBasic: () => BuilderPlugin<BuilderPluginAPI>;
@@ -1,4 +1,4 @@
1
1
  import { BuilderPlugin } from '@modern-js/builder-shared';
2
2
  import { Bundler } from '../../../types';
3
3
  import type { BuilderOptions, BuilderPluginAPI } from '../types';
4
- export declare const builderPluginAdapterHtml: <B extends Bundler>(options: BuilderOptions<B>) => BuilderPlugin<BuilderPluginAPI>;
4
+ export declare const builderPluginAdapterHtml: <B extends Bundler>(options: BuilderOptions<B>) => BuilderPlugin<BuilderPluginAPI>;
@@ -1,4 +1,4 @@
1
1
  import { BuilderPlugin } from '@modern-js/builder-shared';
2
2
  import type { Bundler } from '../../../types';
3
3
  import type { BuilderOptions, BuilderPluginAPI } from '../types';
4
- export declare const builderPluginAdapterSSR: <B extends Bundler>(options: BuilderOptions<B>) => BuilderPlugin<BuilderPluginAPI>;
4
+ export declare const builderPluginAdapterSSR: <B extends Bundler>(options: BuilderOptions<B>) => BuilderPlugin<BuilderPluginAPI>;
@@ -1,3 +1,3 @@
1
1
  export * from './adapterBasic';
2
2
  export * from './adapterHtml';
3
- export * from './adapterSSR';
3
+ export * from './adapterSSR';
@@ -2,8 +2,8 @@ import type { webpack } from '@modern-js/builder-webpack-provider';
2
2
  import type { Rspack } from '@modern-js/builder-rspack-provider';
3
3
  import type HtmlWebpackPlugin from '@modern-js/builder-webpack-provider/html-webpack-plugin';
4
4
  export declare class HtmlAsyncChunkPlugin {
5
- name: string;
6
- htmlWebpackPlugin: typeof HtmlWebpackPlugin;
7
- constructor(htmlWebpackPlugin: typeof HtmlWebpackPlugin);
8
- apply(compiler: webpack.Compiler | Rspack.Compiler): void;
9
- }
5
+ name: string;
6
+ htmlWebpackPlugin: typeof HtmlWebpackPlugin;
7
+ constructor(htmlWebpackPlugin: typeof HtmlWebpackPlugin);
8
+ apply(compiler: webpack.Compiler | Rspack.Compiler): void;
9
+ }
@@ -2,10 +2,10 @@ import type { webpack } from '@modern-js/builder-webpack-provider';
2
2
  import type { Rspack } from '@modern-js/builder-rspack-provider';
3
3
  import type HtmlWebpackPlugin from '@modern-js/builder-webpack-provider/html-webpack-plugin';
4
4
  export declare class BottomTemplatePlugin {
5
- htmlWebpackPlugin: typeof HtmlWebpackPlugin;
6
- bottomTemplateReg: RegExp;
7
- bodyRegExp: RegExp;
8
- name: string;
9
- constructor(htmlWebpackPlugin: typeof HtmlWebpackPlugin);
10
- apply(compiler: Rspack.Compiler | webpack.Compiler): void;
11
- }
5
+ htmlWebpackPlugin: typeof HtmlWebpackPlugin;
6
+ bottomTemplateReg: RegExp;
7
+ bodyRegExp: RegExp;
8
+ name: string;
9
+ constructor(htmlWebpackPlugin: typeof HtmlWebpackPlugin);
10
+ apply(compiler: Rspack.Compiler | webpack.Compiler): void;
11
+ }
@@ -3,40 +3,33 @@ import type { Rspack } from '@modern-js/builder-rspack-provider';
3
3
  import type HtmlWebpackPlugin from '@modern-js/builder-webpack-provider/html-webpack-plugin';
4
4
  import type { ScriptLoading } from '@modern-js/builder-shared';
5
5
  export interface RouteAssets {
6
- [routeId: string]: {
7
- chunkIds?: (string | number)[];
8
- assets?: string[];
9
- referenceCssAssets?: string[];
10
- };
6
+ [routeId: string]: {
7
+ chunkIds?: (string | number)[];
8
+ assets?: string[];
9
+ referenceCssAssets?: string[];
10
+ };
11
11
  }
12
12
  type Compiler = webpack.Compiler | Rspack.Compiler;
13
13
  type Options = {
14
- HtmlBundlerPlugin: typeof HtmlWebpackPlugin;
15
- staticJsDir: string;
16
- enableInlineRouteManifests: boolean;
17
- disableFilenameHash?: boolean;
18
- scriptLoading?: ScriptLoading;
19
- nonce?: string;
14
+ HtmlBundlerPlugin: typeof HtmlWebpackPlugin;
15
+ staticJsDir: string;
16
+ enableInlineRouteManifests: boolean;
17
+ disableFilenameHash?: boolean;
18
+ scriptLoading?: ScriptLoading;
19
+ nonce?: string;
20
20
  };
21
21
  export declare class RouterPlugin {
22
- readonly name: string;
23
- private HtmlBundlerPlugin;
24
- private enableInlineRouteManifests;
25
- private staticJsDir;
26
- private disableFilenameHash?;
27
- private scriptLoading?;
28
- private nonce?;
29
- constructor({
30
- staticJsDir,
31
- HtmlBundlerPlugin,
32
- enableInlineRouteManifests,
33
- disableFilenameHash,
34
- scriptLoading,
35
- nonce
36
- }: Options);
37
- private isTargetNodeOrWebWorker;
38
- private getEntryChunks;
39
- private getEntryChunkFiles;
40
- apply(compiler: Compiler): void;
22
+ readonly name: string;
23
+ private HtmlBundlerPlugin;
24
+ private enableInlineRouteManifests;
25
+ private staticJsDir;
26
+ private disableFilenameHash?;
27
+ private scriptLoading?;
28
+ private nonce?;
29
+ constructor({ staticJsDir, HtmlBundlerPlugin, enableInlineRouteManifests, disableFilenameHash, scriptLoading, nonce, }: Options);
30
+ private isTargetNodeOrWebWorker;
31
+ private getEntryChunks;
32
+ private getEntryChunkFiles;
33
+ apply(compiler: Compiler): void;
41
34
  }
42
- export {};
35
+ export {};
@@ -1,3 +1,3 @@
1
1
  export * from './HtmlAsyncChunkPlugin';
2
2
  export * from './HtmlBottomTemplate';
3
- export * from './RouterPlugin';
3
+ export * from './RouterPlugin';
@@ -1,6 +1,6 @@
1
1
  import { AppNormalizedConfig, IAppContext } from '../../types';
2
2
  export declare function createCopyInfo(appContext: IAppContext, config: AppNormalizedConfig<'shared'>): {
3
- configDir: string;
4
- uploadDir: string;
5
- publicDir: string;
6
- };
3
+ configDir: string;
4
+ uploadDir: string;
5
+ publicDir: string;
6
+ };
@@ -1,3 +1,3 @@
1
1
  export * from './types';
2
2
  export * from './builderPlugins';
3
- export * from './createCopyInfo';
3
+ export * from './createCopyInfo';
@@ -1,4 +1,4 @@
1
1
  import type { webpack } from '@modern-js/builder-webpack-provider';
2
2
  import type { Rspack } from '@modern-js/builder-rspack-provider';
3
3
  declare function loader(this: webpack.LoaderContext<void> | Rspack.LoaderContext): string;
4
- export default loader;
4
+ export default loader;
@@ -4,9 +4,9 @@ import type { DefaultBuilderPluginAPI } from '@modern-js/builder-shared';
4
4
  import type { Bundler, AppNormalizedConfig, IAppContext } from '../../types';
5
5
  export { WebpackBuilderConfig, RspackBuilderConfig };
6
6
  export type BuilderOptions<B extends Bundler> = {
7
- normalizedConfig: AppNormalizedConfig<B>;
8
- appContext: IAppContext;
7
+ normalizedConfig: AppNormalizedConfig<B>;
8
+ appContext: IAppContext;
9
9
  };
10
10
  export type BuilderConfig = RspackBuilderConfig | WebpackBuilderConfig;
11
11
  export type BuilderNormalizedConfig = RspackNormalizedConfig | WebpackNormalizedConfig;
12
- export type BuilderPluginAPI = DefaultBuilderPluginAPI<BuilderConfig, BuilderNormalizedConfig>;
12
+ export type BuilderPluginAPI = DefaultBuilderPluginAPI<BuilderConfig, BuilderNormalizedConfig>;
@@ -1,4 +1,4 @@
1
1
  import { PluginAPI } from '@modern-js/core';
2
2
  import type { BuildOptions } from '../utils/types';
3
3
  import type { AppTools } from '../types';
4
- export declare const build: (api: PluginAPI<AppTools<'shared'>>, options?: BuildOptions) => Promise<void>;
4
+ export declare const build: (api: PluginAPI<AppTools<'shared'>>, options?: BuildOptions) => Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import type { PluginAPI } from '@modern-js/core';
2
2
  import type { AppTools } from '../types';
3
- export declare const deploy: (api: PluginAPI<AppTools<'shared'>>, options: any) => Promise<void>;
3
+ export declare const deploy: (api: PluginAPI<AppTools<'shared'>>, options: any) => Promise<void>;
@@ -2,6 +2,6 @@ import { PluginAPI } from '@modern-js/core';
2
2
  import { DevOptions } from '../utils/types';
3
3
  import type { AppTools } from '../types';
4
4
  export interface ExtraServerOptions {
5
- useSSRWorker?: boolean;
5
+ useSSRWorker?: boolean;
6
6
  }
7
- export declare const dev: (api: PluginAPI<AppTools<'shared'>>, options: DevOptions, devServerOptions?: ExtraServerOptions) => Promise<void>;
7
+ export declare const dev: (api: PluginAPI<AppTools<'shared'>>, options: DevOptions, devServerOptions?: ExtraServerOptions) => Promise<void>;
@@ -1,3 +1,3 @@
1
1
  export * from './dev';
2
2
  export * from './build';
3
- export * from './serve';
3
+ export * from './serve';
@@ -2,10 +2,10 @@ import type { PluginAPI } from '@modern-js/core';
2
2
  import type { InspectOptions } from '../utils/types';
3
3
  import type { AppTools } from '../types';
4
4
  export declare const inspect: (api: PluginAPI<AppTools<'shared'>>, options: InspectOptions) => Promise<{
5
- builderConfig: string;
6
- bundlerConfigs: string[];
7
- origin: {
8
- builderConfig: Record<string, any>;
9
- bundlerConfigs: Record<string, any>[];
10
- };
11
- }>;
5
+ builderConfig: string;
6
+ bundlerConfigs: string[];
7
+ origin: {
8
+ builderConfig: Record<string, any>;
9
+ bundlerConfigs: Record<string, any>[];
10
+ };
11
+ }>;
@@ -1,3 +1,3 @@
1
1
  import type { PluginAPI } from '@modern-js/core';
2
2
  import type { AppTools } from '../types';
3
- export declare const start: (api: PluginAPI<AppTools<'shared'>>) => Promise<void>;
3
+ export declare const start: (api: PluginAPI<AppTools<'shared'>>) => Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import { IAppContext, AppUserConfig, AppLegacyUserConfig } from '../types';
2
2
  export declare function createDefaultConfig(appContext: IAppContext, bundler: 'webpack' | 'rspack'): AppUserConfig<'webpack'> | AppUserConfig<'rspack'>;
3
- export declare function createLegacyDefaultConfig(appContext: IAppContext): AppLegacyUserConfig;
3
+ export declare function createLegacyDefaultConfig(appContext: IAppContext): AppLegacyUserConfig;
@@ -1,3 +1,3 @@
1
1
  export * from './legacy';
2
2
  export * from './initialize';
3
- export * from './default';
3
+ export * from './default';
@@ -1,2 +1,2 @@
1
1
  import type { AppNormalizedConfig, IAppContext } from '../../types';
2
- export declare function initialNormalizedConfig(config: AppNormalizedConfig<'shared'>, appContext: IAppContext, bundler: 'webpack' | 'rspack'): AppNormalizedConfig<'shared'>;
2
+ export declare function initialNormalizedConfig(config: AppNormalizedConfig<'shared'>, appContext: IAppContext, bundler: 'webpack' | 'rspack'): AppNormalizedConfig<'shared'>;
@@ -1,4 +1,4 @@
1
1
  import { AppNormalizedConfig, IAppContext } from '../../types';
2
2
  export declare function initHtmlConfig(config: AppNormalizedConfig<'shared'>, appContext: IAppContext): import("@modern-js/builder-shared").SharedHtmlConfig;
3
3
  export declare function initSourceConfig(config: AppNormalizedConfig<'shared'>, appContext: IAppContext, bundler: 'webpack' | 'rspack'): void;
4
- export declare function createBuilderModuleScope(config: AppNormalizedConfig<'webpack'>): (string | RegExp)[] | undefined;
4
+ export declare function createBuilderModuleScope(config: AppNormalizedConfig<'webpack'>): (string | RegExp)[] | undefined;
@@ -1,2 +1,2 @@
1
1
  import { AppLegacyNormalizedConfig, AppNormalizedConfig } from '../../types';
2
- export declare function createHtmlConfig(config: Readonly<AppLegacyNormalizedConfig>): AppNormalizedConfig<'webpack'>['html'];
2
+ export declare function createHtmlConfig(config: Readonly<AppLegacyNormalizedConfig>): AppNormalizedConfig<'webpack'>['html'];
@@ -1,2 +1,2 @@
1
1
  import { AppLegacyNormalizedConfig, AppNormalizedConfig } from '../../types';
2
- export declare function createOutputConfig(config: Readonly<AppLegacyNormalizedConfig>): AppNormalizedConfig<'webpack'>['output'];
2
+ export declare function createOutputConfig(config: Readonly<AppLegacyNormalizedConfig>): AppNormalizedConfig<'webpack'>['output'];
@@ -1,2 +1,2 @@
1
1
  import { AppLegacyNormalizedConfig, AppNormalizedConfig } from '../../types';
2
- export declare function createSourceConfig(config: AppLegacyNormalizedConfig): AppNormalizedConfig<'webpack'>['source'];
2
+ export declare function createSourceConfig(config: AppLegacyNormalizedConfig): AppNormalizedConfig<'webpack'>['source'];
@@ -1,2 +1,2 @@
1
1
  import { AppLegacyNormalizedConfig, AppNormalizedConfig } from '../../types';
2
- export declare function createToolsConfig(config: AppLegacyNormalizedConfig): AppNormalizedConfig<'webpack'>['tools'];
2
+ export declare function createToolsConfig(config: AppLegacyNormalizedConfig): AppNormalizedConfig<'webpack'>['tools'];
@@ -1,3 +1,3 @@
1
1
  import type { AppLegacyNormalizedConfig, AppLegacyUserConfig, AppNormalizedConfig, AppUserConfig } from '../../types';
2
2
  export declare function transformNormalizedConfig(config: AppLegacyNormalizedConfig): AppNormalizedConfig<'webpack'>;
3
- export declare function checkIsLegacyConfig(config: AppLegacyUserConfig | AppUserConfig): config is AppLegacyUserConfig;
3
+ export declare function checkIsLegacyConfig(config: AppLegacyUserConfig | AppUserConfig): config is AppLegacyUserConfig;
@@ -9,4 +9,4 @@ export declare const defineConfig: <B extends "webpack" | "rspack" = "webpack">(
9
9
  * @deprecated Please use `defineConfig` instead.
10
10
  * `defineLegacyConfig` will be removed in the future major version.
11
11
  */
12
- export declare const defineLegacyConfig: (config: AppLegacyUserConfig) => AppLegacyUserConfig;
12
+ export declare const defineLegacyConfig: (config: AppLegacyUserConfig) => AppLegacyUserConfig;
@@ -1 +1 @@
1
- export { defineServerConfig as defineConfig } from '../utils/config';
1
+ export { defineServerConfig as defineConfig } from '../utils/config';
@@ -1,2 +1,2 @@
1
1
  import { AppToolsHooks } from './types/hooks';
2
- export declare const hooks: AppToolsHooks;
2
+ export declare const hooks: AppToolsHooks;
@@ -9,14 +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
- /**
13
- * Specify which bundler to use for the build.
14
- * @default `webpack`
15
- * */
16
- bundler?: 'experimental-rspack' | 'webpack';
12
+ /**
13
+ * Specify which bundler to use for the build.
14
+ * @default `webpack`
15
+ * */
16
+ bundler?: 'experimental-rspack' | 'webpack';
17
17
  };
18
18
  /**
19
19
  * The core package of the framework, providing CLI commands, build capabilities, configuration parsing and more.
20
20
  */
21
21
  export declare const appTools: (options?: AppToolsOptions) => CliPlugin<AppTools<'shared'>>;
22
- export default appTools;
22
+ export default appTools;