@bleedingdev/modern-js-app-tools 3.2.0-ultramodern.0 → 3.2.0-ultramodern.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 (107) hide show
  1. package/package.json +11 -11
  2. package/dist/types/baseline.d.ts +0 -46
  3. package/dist/types/builder/builder-rspack/index.d.ts +0 -2
  4. package/dist/types/builder/generator/adapterCopy.d.ts +0 -3
  5. package/dist/types/builder/generator/createBuilderProviderConfig.d.ts +0 -3
  6. package/dist/types/builder/generator/createCopyPattern.d.ts +0 -16
  7. package/dist/types/builder/generator/getBuilderEnvironments.d.ts +0 -6
  8. package/dist/types/builder/generator/index.d.ts +0 -8
  9. package/dist/types/builder/index.d.ts +0 -3
  10. package/dist/types/builder/shared/builderPlugins/adapterBasic.d.ts +0 -3
  11. package/dist/types/builder/shared/builderPlugins/adapterHtml.d.ts +0 -3
  12. package/dist/types/builder/shared/builderPlugins/adapterPrecompress.d.ts +0 -3
  13. package/dist/types/builder/shared/builderPlugins/adapterSSR.d.ts +0 -3
  14. package/dist/types/builder/shared/builderPlugins/builderHooks.d.ts +0 -3
  15. package/dist/types/builder/shared/builderPlugins/index.d.ts +0 -5
  16. package/dist/types/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.d.ts +0 -7
  17. package/dist/types/builder/shared/bundlerPlugins/HtmlBottomTemplate.d.ts +0 -9
  18. package/dist/types/builder/shared/bundlerPlugins/RouterPlugin.d.ts +0 -32
  19. package/dist/types/builder/shared/bundlerPlugins/index.d.ts +0 -3
  20. package/dist/types/builder/shared/createCopyInfo.d.ts +0 -8
  21. package/dist/types/builder/shared/index.d.ts +0 -3
  22. package/dist/types/builder/shared/loaders/serverModuleLoader.d.ts +0 -3
  23. package/dist/types/builder/shared/types.d.ts +0 -6
  24. package/dist/types/commands/build.d.ts +0 -4
  25. package/dist/types/commands/deploy.d.ts +0 -3
  26. package/dist/types/commands/dev.d.ts +0 -9
  27. package/dist/types/commands/index.d.ts +0 -10
  28. package/dist/types/commands/info.d.ts +0 -18
  29. package/dist/types/commands/inspect.d.ts +0 -4
  30. package/dist/types/commands/runtime.d.ts +0 -11
  31. package/dist/types/commands/serve.d.ts +0 -8
  32. package/dist/types/compat/hooks.d.ts +0 -7
  33. package/dist/types/compat/index.d.ts +0 -2
  34. package/dist/types/compat/utils.d.ts +0 -13
  35. package/dist/types/config/default.d.ts +0 -3
  36. package/dist/types/config/index.d.ts +0 -2
  37. package/dist/types/config/initialize/index.d.ts +0 -3
  38. package/dist/types/config/initialize/inits.d.ts +0 -4
  39. package/dist/types/constants.d.ts +0 -2
  40. package/dist/types/defineConfig.d.ts +0 -11
  41. package/dist/types/esm/register-esm.d.mts +0 -11
  42. package/dist/types/esm/ts-node-loader.d.mts +0 -6
  43. package/dist/types/esm/ts-paths-loader.d.mts +0 -6
  44. package/dist/types/exports/server.d.ts +0 -1
  45. package/dist/types/index.d.ts +0 -17
  46. package/dist/types/locale/en.d.ts +0 -44
  47. package/dist/types/locale/index.d.ts +0 -90
  48. package/dist/types/locale/zh.d.ts +0 -44
  49. package/dist/types/plugins/analyze/constants.d.ts +0 -3
  50. package/dist/types/plugins/analyze/getBundleEntry.d.ts +0 -4
  51. package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +0 -7
  52. package/dist/types/plugins/analyze/getHtmlTemplate.d.ts +0 -27
  53. package/dist/types/plugins/analyze/getServerRoutes.d.ts +0 -8
  54. package/dist/types/plugins/analyze/index.d.ts +0 -3
  55. package/dist/types/plugins/analyze/isDefaultExportFunction.d.ts +0 -1
  56. package/dist/types/plugins/analyze/templates.d.ts +0 -5
  57. package/dist/types/plugins/analyze/utils.d.ts +0 -10
  58. package/dist/types/plugins/deploy/index.d.ts +0 -3
  59. package/dist/types/plugins/deploy/platforms/gh-pages.d.ts +0 -2
  60. package/dist/types/plugins/deploy/platforms/netlify.d.ts +0 -2
  61. package/dist/types/plugins/deploy/platforms/node.d.ts +0 -2
  62. package/dist/types/plugins/deploy/platforms/platform.d.ts +0 -17
  63. package/dist/types/plugins/deploy/platforms/templates/netlify-entry.d.cts +0 -2
  64. package/dist/types/plugins/deploy/platforms/templates/netlify-entry.d.mts +0 -2
  65. package/dist/types/plugins/deploy/platforms/templates/node-entry.d.cts +0 -1
  66. package/dist/types/plugins/deploy/platforms/templates/node-entry.d.mts +0 -1
  67. package/dist/types/plugins/deploy/platforms/templates/vercel-entry.d.cts +0 -2
  68. package/dist/types/plugins/deploy/platforms/templates/vercel-entry.d.mts +0 -2
  69. package/dist/types/plugins/deploy/platforms/vercel.d.ts +0 -2
  70. package/dist/types/plugins/deploy/types.d.ts +0 -3
  71. package/dist/types/plugins/deploy/utils/generator.d.ts +0 -24
  72. package/dist/types/plugins/deploy/utils/index.d.ts +0 -16
  73. package/dist/types/plugins/initialize/index.d.ts +0 -3
  74. package/dist/types/plugins/serverBuild.d.ts +0 -3
  75. package/dist/types/plugins/serverRuntime.d.ts +0 -3
  76. package/dist/types/presetUltramodern.d.ts +0 -6
  77. package/dist/types/rsbuild.d.ts +0 -12
  78. package/dist/types/run/index.d.ts +0 -20
  79. package/dist/types/types/config/deploy.d.ts +0 -38
  80. package/dist/types/types/config/dev.d.ts +0 -55
  81. package/dist/types/types/config/experiments.d.ts +0 -3
  82. package/dist/types/types/config/html.d.ts +0 -3
  83. package/dist/types/types/config/index.d.ts +0 -48
  84. package/dist/types/types/config/output.d.ts +0 -61
  85. package/dist/types/types/config/performance.d.ts +0 -3
  86. package/dist/types/types/config/resolve.d.ts +0 -2
  87. package/dist/types/types/config/security.d.ts +0 -2
  88. package/dist/types/types/config/source.d.ts +0 -61
  89. package/dist/types/types/config/testing.d.ts +0 -8
  90. package/dist/types/types/config/tools.d.ts +0 -21
  91. package/dist/types/types/index.d.ts +0 -10
  92. package/dist/types/types/plugin.d.ts +0 -114
  93. package/dist/types/types/utils.d.ts +0 -1
  94. package/dist/types/ultramodern/designSystem.d.ts +0 -54
  95. package/dist/types/utils/config.d.ts +0 -2
  96. package/dist/types/utils/createServer.d.ts +0 -5
  97. package/dist/types/utils/env.d.ts +0 -2
  98. package/dist/types/utils/generateWatchFiles.d.ts +0 -2
  99. package/dist/types/utils/getConfigFile.d.ts +0 -1
  100. package/dist/types/utils/getSelectedEntries.d.ts +0 -5
  101. package/dist/types/utils/initAppContext.d.ts +0 -31
  102. package/dist/types/utils/loadPlugins.d.ts +0 -13
  103. package/dist/types/utils/printInstructions.d.ts +0 -3
  104. package/dist/types/utils/register.d.ts +0 -19
  105. package/dist/types/utils/restart.d.ts +0 -2
  106. package/dist/types/utils/routes.d.ts +0 -4
  107. package/dist/types/utils/types.d.ts +0 -49
@@ -1,4 +0,0 @@
1
- import type { Entrypoint } from '@modern-js/types';
2
- import type { AppNormalizedConfig } from '../../types';
3
- import type { AppToolsContext, AppToolsHooks } from '../../types/plugin';
4
- export declare const getBundleEntry: (hooks: AppToolsHooks, appContext: AppToolsContext, config: AppNormalizedConfig) => Promise<Entrypoint[]>;
@@ -1,7 +0,0 @@
1
- import type { Entrypoint } from '@modern-js/types';
2
- import type { AppNormalizedConfig } from '../../types';
3
- import type { AppToolsContext, AppToolsHooks } from '../../types/plugin';
4
- export type { Entrypoint };
5
- export declare const hasEntry: (dir: string) => string | false;
6
- export declare const hasServerEntry: (dir: string) => string | false;
7
- export declare const getFileSystemEntry: (hooks: AppToolsHooks, appContext: AppToolsContext, config: AppNormalizedConfig) => Promise<Entrypoint[]>;
@@ -1,27 +0,0 @@
1
- import type { Entrypoint, HtmlPartials, HtmlTemplates } from '@modern-js/types';
2
- import type { AppNormalizedConfig } from '../../types';
3
- import type { AppToolsContext, AppToolsHooks } from '../../types/plugin';
4
- export declare const getModifyHtmlPartials: (partials: Record<keyof HtmlPartials, string[]>) => {
5
- top: {
6
- append: (...script: string[]) => void;
7
- prepend: (...script: string[]) => void;
8
- current: string[];
9
- };
10
- head: {
11
- append: (...script: string[]) => void;
12
- prepend: (...script: string[]) => void;
13
- current: string[];
14
- };
15
- body: {
16
- append: (...script: string[]) => void;
17
- prepend: (...script: string[]) => void;
18
- current: string[];
19
- };
20
- };
21
- export declare const getHtmlTemplate: (entrypoints: Entrypoint[], hooks: AppToolsHooks, { appContext, config, }: {
22
- appContext: AppToolsContext;
23
- config: AppNormalizedConfig;
24
- }) => Promise<{
25
- partialsByEntrypoint: Record<string, HtmlPartials>;
26
- htmlTemplates: HtmlTemplates;
27
- }>;
@@ -1,8 +0,0 @@
1
- import type { Entrypoint, ServerRoute } from '@modern-js/types';
2
- import type { AppNormalizedConfig } from '../../types';
3
- import type { AppToolsContext } from '../../types/plugin';
4
- export declare const getServerRoutes: (entrypoints: Entrypoint[], { appContext, config, }: {
5
- appContext: AppToolsContext;
6
- config: AppNormalizedConfig;
7
- }) => ServerRoute[];
8
- export declare const getProdServerRoutes: (distDirectory: string) => any;
@@ -1,3 +0,0 @@
1
- import type { AppTools, CliPlugin } from '../../types';
2
- declare const _default: () => CliPlugin<AppTools>;
3
- export default _default;
@@ -1 +0,0 @@
1
- export declare const isDefaultExportFunction: (file: string | false) => boolean;
@@ -1,5 +0,0 @@
1
- export declare const html: (partials: {
2
- top: string[];
3
- head: string[];
4
- body: string[];
5
- }) => string;
@@ -1,10 +0,0 @@
1
- export declare const walkDirectory: (dir: string) => string[];
2
- export declare const replaceWithAlias: (base: string, filePath: string, alias: string) => string;
3
- export declare const parseModule: ({ source, filename, }: {
4
- source: string;
5
- filename: string;
6
- }) => Promise<readonly [imports: readonly import("es-module-lexer").ImportSpecifier[], exports: readonly import("es-module-lexer").ExportSpecifier[], facade: boolean, hasModuleSyntax: boolean]>;
7
- export declare const getServerCombinedModuleFile: (internalDirectory: string, entryName: string) => string;
8
- export declare const checkIsBuildCommands: () => boolean;
9
- export declare const checkIsServeCommand: () => boolean;
10
- export declare const isSubDirOrEqual: (parent: string, child: string) => boolean;
@@ -1,3 +0,0 @@
1
- import type { AppTools, CliPlugin } from '../../types';
2
- declare const _default: () => CliPlugin<AppTools>;
3
- export default _default;
@@ -1,2 +0,0 @@
1
- import type { CreatePreset } from './platform';
2
- export declare const createGhPagesPreset: CreatePreset;
@@ -1,2 +0,0 @@
1
- import type { CreatePreset } from './platform';
2
- export declare const createNetlifyPreset: CreatePreset;
@@ -1,2 +0,0 @@
1
- import type { CreatePreset } from './platform';
2
- export declare const createNodePreset: CreatePreset;
@@ -1,17 +0,0 @@
1
- import type { AppToolsNormalizedConfig } from '../../../types';
2
- import type { AppToolsContext } from '../../../types/plugin';
3
- import type { PluginAPI } from '../types';
4
- interface CreatePresetParams {
5
- appContext: AppToolsContext;
6
- modernConfig: AppToolsNormalizedConfig;
7
- api: PluginAPI;
8
- needModernServer?: boolean;
9
- }
10
- export type CreatePreset = (params: CreatePresetParams) => DeployPreset;
11
- type DeployPreset = {
12
- prepare?: () => Promise<void>;
13
- writeOutput?: () => Promise<void>;
14
- genEntry?: () => Promise<void>;
15
- end?: () => Promise<void>;
16
- };
17
- export {};
@@ -1,2 +0,0 @@
1
- export default handler;
2
- declare function handler(request: any, context: any): Promise<any>;
@@ -1,2 +0,0 @@
1
- export default handler;
2
- declare function handler(request: any, context: any): Promise<any>;
@@ -1,2 +0,0 @@
1
- export = handler;
2
- declare function handler(req: any, res: any): Promise<any>;
@@ -1,2 +0,0 @@
1
- export default handler;
2
- declare function handler(req: any, res: any): Promise<any>;
@@ -1,2 +0,0 @@
1
- import type { CreatePreset } from './platform';
2
- export declare const createVercelPreset: CreatePreset;
@@ -1,3 +0,0 @@
1
- import type { AppTools, CliPlugin } from '../../types';
2
- export type Setup = NonNullable<CliPlugin<AppTools>['setup']>;
3
- export type PluginAPI = Parameters<Setup>[0];
@@ -1,24 +0,0 @@
1
- import type { ProdServerOptions } from '@modern-js/prod-server';
2
- import type { AppToolsNormalizedConfig } from '../../../types';
3
- import type { AppToolsContext } from '../../../types/plugin';
4
- export declare const serverAppContextTemplate: (appContext: AppToolsContext) => {
5
- sharedDirectory: string;
6
- apiDirectory: string;
7
- lambdaDirectory: string;
8
- metaName: string;
9
- bffRuntimeFramework: "hono" | "effect";
10
- };
11
- export type PluginItem = [string, Record<string, any> | undefined];
12
- export declare const genPluginImportsCode: (plugins: PluginItem[], isESM?: boolean) => string;
13
- export declare const getPluginsCode: (plugins: PluginItem[]) => string;
14
- export declare const getServerConfigPath: (meta: string) => string;
15
- export interface GenerateHandlerOptions {
16
- template: string;
17
- appContext: AppToolsContext;
18
- config: AppToolsNormalizedConfig;
19
- serverConfig?: Partial<ProdServerOptions>;
20
- genAppContextTemplate?: typeof serverAppContextTemplate;
21
- genPluginImports?: typeof genPluginImportsCode;
22
- isESM?: boolean;
23
- }
24
- export declare const generateHandler: ({ template, appContext, config, serverConfig: modifyServerConfig, genAppContextTemplate, genPluginImports, isESM, }: GenerateHandlerOptions) => Promise<string>;
@@ -1,16 +0,0 @@
1
- export type ServerAppContext = {
2
- sharedDirectory: string;
3
- apiDirectory: string;
4
- lambdaDirectory: string;
5
- metaName: string;
6
- bffRuntimeFramework: string;
7
- };
8
- export declare const normalizePath: (filePath: string) => string;
9
- export declare const getProjectUsage: (appDirectory: string, distDirectory: string, metaName: string) => {
10
- useSSR: boolean;
11
- useAPI: boolean;
12
- useWebServer: boolean;
13
- };
14
- export declare const getTemplatePath: (file: string) => string;
15
- export declare const readTemplate: (file: string) => Promise<string>;
16
- export declare const resolveESMDependency: (entry: string) => Promise<string | undefined>;
@@ -1,3 +0,0 @@
1
- import type { AppTools, CliPlugin } from '../../types';
2
- declare const _default: () => CliPlugin<AppTools>;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { AppTools, CliPlugin } from '../types';
2
- declare const _default: () => CliPlugin<AppTools>;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { AppTools, CliPlugin } from '../types';
2
- declare const _default: () => CliPlugin<AppTools>;
3
- export default _default;
@@ -1,6 +0,0 @@
1
- import { type AppBaselineOptions } from './baseline';
2
- import type { AppUserConfig } from './types';
3
- export interface PresetUltramodernOptions extends AppBaselineOptions {
4
- }
5
- export declare const createPresetUltramodernConfig: (options?: PresetUltramodernOptions) => AppUserConfig;
6
- export declare const presetUltramodern: (config: AppUserConfig, options?: PresetUltramodernOptions) => AppUserConfig;
@@ -1,12 +0,0 @@
1
- import type { AppUserConfig } from './types';
2
- type ResolveModernRsbuildConfigOptions = {
3
- command: string;
4
- configPath?: string;
5
- cwd?: string;
6
- metaName?: string;
7
- modifyModernConfig?: (config: AppUserConfig) => AppUserConfig | Promise<AppUserConfig>;
8
- };
9
- export declare function resolveModernRsbuildConfig(options: ResolveModernRsbuildConfigOptions): Promise<{
10
- rsbuildConfig: import("@modern-js/builder").RsbuildConfig;
11
- }>;
12
- export type { ResolveModernRsbuildConfigOptions };
@@ -1,20 +0,0 @@
1
- import type { InternalPlugins } from '@modern-js/types';
2
- import { handleSetupResult } from '../compat/hooks';
3
- export interface RunOptions {
4
- cwd?: string;
5
- configFile?: string;
6
- metaName?: string;
7
- statePluginName?: string;
8
- internalPlugins?: InternalPlugins;
9
- initialLog?: string;
10
- version: string;
11
- }
12
- export declare function createRunOptions({ cwd, initialLog, metaName, version, internalPlugins, configFile, }: RunOptions): Promise<{
13
- cwd: string | undefined;
14
- initialLog: string;
15
- configFile: string;
16
- metaName: string;
17
- internalPlugins: import("@modern-js/plugin").Plugin[];
18
- handleSetupResult: typeof handleSetupResult;
19
- }>;
20
- export declare function run(options: RunOptions): Promise<void>;
@@ -1,38 +0,0 @@
1
- export interface MicroFrontend {
2
- /**
3
- * Specifies whether to enable the HTML entry.
4
- * When set to `true`, the current child application will be externalized for `react` and `react-dom`.
5
- * @default true
6
- */
7
- enableHtmlEntry?: boolean;
8
- /**
9
- * Specifies whether to use the external base library.
10
- * @default false
11
- */
12
- externalBasicLibrary?: boolean;
13
- moduleApp?: string;
14
- /**
15
- * Runtime compatibility digest exposed in remote contracts (manifest / remote entry).
16
- */
17
- runtimeDigest?: string;
18
- /**
19
- * SRI-style integrity token for the remote entry contract.
20
- * Example: `sha256-<base64Digest>`.
21
- */
22
- integrity?: string;
23
- /**
24
- * Opaque attestation token exposed in remote runtime metadata.
25
- * Can be validated by the host via runtime `remoteTrust.attestations`.
26
- */
27
- attestation?: string;
28
- }
29
- export interface DeployUserConfig {
30
- /**
31
- * Used to configure micro-frontend sub-application information.
32
- * @default false
33
- */
34
- microFrontend?: boolean | MicroFrontend;
35
- worker?: {
36
- ssr?: boolean;
37
- };
38
- }
@@ -1,55 +0,0 @@
1
- import type { BuilderConfig } from '@modern-js/builder';
2
- import type { CorsOptions, SetupMiddlewares } from '@modern-js/server';
3
- import type { ServerConfig } from '@rsbuild/core';
4
- type BuilderDevConfig = NonNullable<BuilderConfig['dev']>;
5
- export type DevProxyOptions = string | Record<string, string>;
6
- export interface DevServerUserConfig {
7
- /**
8
- * Configure CORS for the dev server.
9
- * - object: enable CORS with the specified options.
10
- * - true: enable CORS with default options (allow all origins, not recommended).
11
- * - false: disable CORS.
12
- * @default
13
- * ```js
14
- * { origin: defaultAllowedOrigins }
15
- * ```
16
- * where `defaultAllowedOrigins` includes:
17
- * - `localhost`
18
- * - `127.0.0.1`
19
- *
20
- * @link https://github.com/expressjs/cors
21
- */
22
- cors?: boolean | CorsOptions;
23
- /**
24
- * Whether to enable gzip compression for served static assets.
25
- */
26
- compress?: ServerConfig['compress'];
27
- /**
28
- * Adds headers to all responses.
29
- */
30
- headers?: ServerConfig['headers'];
31
- /**
32
- * The index.html page will likely have to be served in place of any 404 responses.
33
- */
34
- historyApiFallback?: ServerConfig['historyApiFallback'];
35
- /**
36
- * Proxying some URLs.
37
- */
38
- proxy?: ServerConfig['proxy'];
39
- /**
40
- * Whether to watch files change in directories such as `mock/`, `server/`, `api/`.
41
- */
42
- watch?: boolean;
43
- }
44
- /**
45
- * setupMiddlewares is a special field, it will not be passed to Rsbuild.
46
- * Although its name is the same as in Rsbuild, it is consumed by Modern.js.
47
- */
48
- export type DevUserConfig = Omit<BuilderDevConfig, 'setupMiddlewares'> & {
49
- setupMiddlewares?: SetupMiddlewares;
50
- /**
51
- * Dev server specific options.
52
- */
53
- server?: DevServerUserConfig;
54
- };
55
- export {};
@@ -1,3 +0,0 @@
1
- import type { BuilderConfig } from '@modern-js/builder';
2
- export type BuilderExperimentsConfig = Required<BuilderConfig>['experiments'];
3
- export type ExperimentsUserConfig = BuilderExperimentsConfig;
@@ -1,3 +0,0 @@
1
- import type { BuilderConfig } from '@modern-js/builder';
2
- import type { UnwrapBuilderConfig } from '../utils';
3
- export type HtmlUserConfig = UnwrapBuilderConfig<BuilderConfig, 'html'>;
@@ -1,48 +0,0 @@
1
- import type { CLIPlugin, CLIPluginExtends } from '@modern-js/plugin';
2
- import type { BffUserConfig, ServerUserConfig } from '@modern-js/server-core';
3
- import type { RsbuildConfig } from '@rsbuild/core';
4
- import type { AppToolsExtendAPI, AppToolsExtendContext, AppToolsExtendHooks } from '../plugin';
5
- import type { DeployUserConfig } from './deploy';
6
- import type { DevUserConfig } from './dev';
7
- import type { ExperimentsUserConfig } from './experiments';
8
- import type { HtmlUserConfig } from './html';
9
- import type { OutputUserConfig } from './output';
10
- import type { PerformanceUserConfig } from './performance';
11
- import type { ResolveUserConfig } from './resolve';
12
- import type { SecurityUserConfig } from './security';
13
- import type { SourceUserConfig } from './source';
14
- import type { TestingUserConfig } from './testing';
15
- import type { ToolsUserConfig } from './tools';
16
- export * from './output';
17
- export type AppToolsBuilderPlugins = NonNullable<RsbuildConfig['plugins']>;
18
- export interface AppToolsUserConfig {
19
- resolve?: ResolveUserConfig;
20
- server?: ServerUserConfig;
21
- source?: SourceUserConfig;
22
- output?: OutputUserConfig;
23
- experiments?: ExperimentsUserConfig;
24
- /**
25
- * The configuration of `bff` is provided by `bff` plugin.
26
- * Please use `yarn new` or `pnpm new` to enable the corresponding capability.
27
- * @requires `bff` plugin
28
- */
29
- bff?: BffUserConfig;
30
- dev?: DevUserConfig;
31
- deploy?: DeployUserConfig;
32
- html?: HtmlUserConfig;
33
- tools?: ToolsUserConfig;
34
- security?: SecurityUserConfig;
35
- testing?: TestingUserConfig;
36
- builderPlugins?: AppToolsBuilderPlugins;
37
- performance?: PerformanceUserConfig;
38
- environments?: RsbuildConfig['environments'];
39
- splitChunks?: RsbuildConfig['splitChunks'];
40
- plugins?: CliPlugin<AppTools>[];
41
- }
42
- interface SharedNormalizedConfig<RawConfig> {
43
- cliOptions?: Record<string, any>;
44
- _raw: RawConfig;
45
- }
46
- export type AppToolsNormalizedConfig<Config = AppToolsUserConfig> = Required<Config> & SharedNormalizedConfig<Config>;
47
- export type AppTools = Required<CLIPluginExtends<AppToolsUserConfig, AppToolsNormalizedConfig, AppToolsExtendContext, AppToolsExtendAPI, AppToolsExtendHooks>>;
48
- export type CliPlugin<Extends extends CLIPluginExtends> = CLIPlugin<Extends>;
@@ -1,61 +0,0 @@
1
- import type { BuilderConfig } from '@modern-js/builder';
2
- import type { SSGConfig, SSGMultiEntryOptions } from '@modern-js/types';
3
- import type CompressionPlugin from 'compression-webpack-plugin';
4
- import type { UnwrapBuilderConfig } from '../utils';
5
- type CompressionPluginOptions = NonNullable<ConstructorParameters<typeof CompressionPlugin>[0]>;
6
- export type PrecompressCodecOptions = boolean | CompressionPluginOptions;
7
- export interface PrecompressConfig {
8
- /**
9
- * Configure gzip precompression options.
10
- * `true` means using default options.
11
- * `false` means disabling gzip precompression.
12
- * @default true
13
- */
14
- gzip?: PrecompressCodecOptions;
15
- /**
16
- * Configure brotli precompression options.
17
- * `true` means using default options.
18
- * `false` means disabling brotli precompression.
19
- * @default true
20
- */
21
- brotli?: PrecompressCodecOptions;
22
- }
23
- export interface OutputUserConfig extends UnwrapBuilderConfig<BuilderConfig, 'output'> {
24
- /**
25
- * Enable SSG for self-controlled routing or conventional routing.
26
- * @default false
27
- */
28
- ssg?: SSGConfig;
29
- /**
30
- * Specify SSG configuration by entries for multi-entry apps.
31
- * Takes precedence over `ssg` when provided.
32
- */
33
- ssgByEntries?: SSGMultiEntryOptions;
34
- /**
35
- * When using convention-based routing, the framework will split js and css based on the route to load on demand.
36
- * If your project does not want to split js and css based on routes, you can set this option to false.
37
- * @default true
38
- */
39
- splitRouteChunks?: boolean;
40
- /**
41
- * Used to control whether to inject convention-based routing information into the HTML.
42
- * @default true
43
- */
44
- enableInlineRouteManifests?: boolean;
45
- /**
46
- * Used to control whether to inject convention-based routing information into the HTML.
47
- * @default false
48
- */
49
- disableInlineRouteManifests?: boolean;
50
- /**
51
- * Specify the temporary directory for framework generated files.
52
- */
53
- tempDir?: string;
54
- /**
55
- * Generate precompressed static assets by using compression-webpack-plugin.
56
- * `true` means enabling both gzip and brotli with default options.
57
- * @default true
58
- */
59
- precompress?: boolean | PrecompressConfig;
60
- }
61
- export type { SSGConfig, SSGMultiEntryOptions, SSGRouteOptions, SSGSingleEntryOptions, } from '@modern-js/types';
@@ -1,3 +0,0 @@
1
- import type { BuilderConfig } from '@modern-js/builder';
2
- import type { UnwrapBuilderConfig } from '../utils';
3
- export type PerformanceUserConfig = UnwrapBuilderConfig<BuilderConfig, 'performance'>;
@@ -1,2 +0,0 @@
1
- import type { BuilderConfig } from '@modern-js/builder';
2
- export type ResolveUserConfig = BuilderConfig['resolve'];
@@ -1,2 +0,0 @@
1
- import type { BuilderConfig } from '@modern-js/builder';
2
- export type SecurityUserConfig = Required<BuilderConfig>['security'];
@@ -1,61 +0,0 @@
1
- import type { BuilderConfig } from '@modern-js/builder';
2
- export type Entry = string | {
3
- /**
4
- * The entry file path.
5
- */
6
- entry: string;
7
- /**
8
- * Disable framework's behavior of automatically generating entry code.
9
- */
10
- disableMount?: boolean;
11
- /**
12
- * use src/{entryName}/entry.tsx to custom entry
13
- */
14
- customEntry?: boolean;
15
- };
16
- export type Entries = Record<string, Entry>;
17
- export interface SourceUserConfig extends NonNullable<BuilderConfig['source']> {
18
- /**
19
- * Add code before each page entry. It will be executed before the page code.
20
- * @default []
21
- */
22
- preEntry?: string | string[];
23
- /**
24
- * Used to configure custom page entries.
25
- */
26
- entries?: Entries;
27
- /**
28
- * Used to configure the main entry name.
29
- * @default 'main'
30
- */
31
- mainEntryName?: string;
32
- /**
33
- * This option is used for Module Federation scenario.
34
- * When this option is enabled, framework will wrap the automatically generated entry files with dynamic import.
35
- * @default false
36
- */
37
- enableAsyncEntry?: boolean;
38
- /**
39
- * When enabled, framework will inject `source.preEntry` into the top of the
40
- * auto-generated entry file (`index.jsx`) and will not pass `source.preEntry`
41
- * to builder config.
42
- * This is useful when `source.enableAsyncEntry` is enabled and you still want
43
- * preEntry to run before the real entry code.
44
- * @default false
45
- */
46
- enableAsyncPreEntry?: boolean;
47
- /**
48
- * Used to disable the functionality of automatically identifying page entry points based on directory structure.
49
- * @default false
50
- */
51
- disableDefaultEntries?: boolean;
52
- /**
53
- * By default, framework scans the src directory to identify page entries.
54
- * You can customize the directory used for identifying page entries with this option.
55
- */
56
- entriesDir?: string;
57
- /**
58
- * Customize the directory of the framework configuration files.
59
- */
60
- configDir?: string;
61
- }
@@ -1,8 +0,0 @@
1
- import type { TestConfig } from '@modern-js/types';
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
- }
@@ -1,21 +0,0 @@
1
- import type { BuilderConfig } from '@modern-js/builder';
2
- import type { JestConfig } from '@modern-js/types';
3
- import type { UnwrapBuilderConfig } from '../utils';
4
- type BuilderToolsConfig = UnwrapBuilderConfig<BuilderConfig, 'tools'>;
5
- export interface ToolsUserConfig extends Omit<BuilderToolsConfig, 'swc'> {
6
- /**
7
- * Used to custom Jest configurations.
8
- * @requires `test` plugin.
9
- * The configuration of `tools.jest` is provided by `test` plugin.
10
- * Please use `yarn new` or `pnpm new` to enable the corresponding capability.
11
- */
12
- jest?: JestConfig | ((jestConfig: JestConfig) => JestConfig);
13
- /**
14
- * Used to custom SWC configurations.
15
- * @requires `swc` plugin.
16
- * The configuration of `swc` is provided by `swc` plugin.
17
- * Please use `yarn new` or `pnpm new` to enable the corresponding capability.
18
- */
19
- swc?: BuilderToolsConfig['swc'];
20
- }
21
- export {};
@@ -1,10 +0,0 @@
1
- import type { CLIPluginAPI, CLIPluginExtends, RuntimePluginConfig, ServerPluginConfig } from '@modern-js/plugin';
2
- import type { AppTools, AppToolsNormalizedConfig, AppToolsUserConfig } from './config';
3
- export type { Rspack } from '@modern-js/builder';
4
- export type { BffNormalizedConfig, BffUserConfig, LoaderContext, OnError, OnTiming, Params, RequestHandler, RequestHandlerConfig, RequestHandlerOptions, Resource, ServerNormalizedConfig, ServerUserConfig, SSR, SSRByEntries, } from '@modern-js/server-core';
5
- export * from './config';
6
- export type { CLIPluginExtends, RuntimePluginConfig, ServerPluginConfig };
7
- export type AppUserConfig = AppToolsUserConfig;
8
- export type AppNormalizedConfig = AppToolsNormalizedConfig;
9
- export type AppToolsAPI = CLIPluginAPI<AppTools>;
10
- export type { AppToolsContext, AppToolsExtendAPI, AppToolsExtendContext, AppToolsExtendHooks, AppToolsHooks as AppToolsFeatureHooks, } from './plugin';