@bleedingdev/modern-js-app-tools 3.2.0-ultramodern.5 → 3.2.0-ultramodern.50

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 (129) hide show
  1. package/dist/cjs/builder/generator/getBuilderEnvironments.js +143 -8
  2. package/dist/cjs/builder/shared/builderPlugins/adapterBasic.js +41 -5
  3. package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +3 -1
  4. package/dist/cjs/plugins/deploy/index.js +17 -6
  5. package/dist/cjs/plugins/deploy/platforms/cloudflare.js +220 -0
  6. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.mjs +258 -0
  7. package/dist/cjs/rsbuild.js +3 -0
  8. package/dist/esm/builder/generator/getBuilderEnvironments.mjs +132 -8
  9. package/dist/esm/builder/shared/builderPlugins/adapterBasic.mjs +41 -5
  10. package/dist/esm/builder/shared/builderPlugins/adapterSSR.mjs +3 -1
  11. package/dist/esm/plugins/deploy/index.mjs +10 -4
  12. package/dist/esm/plugins/deploy/platforms/cloudflare.mjs +176 -0
  13. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.mjs +258 -0
  14. package/dist/esm/rsbuild.mjs +5 -2
  15. package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +134 -9
  16. package/dist/esm-node/builder/shared/builderPlugins/adapterBasic.mjs +41 -5
  17. package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.mjs +3 -1
  18. package/dist/esm-node/plugins/deploy/index.mjs +10 -4
  19. package/dist/esm-node/plugins/deploy/platforms/cloudflare.mjs +177 -0
  20. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.mjs +258 -0
  21. package/dist/esm-node/rsbuild.mjs +5 -2
  22. package/dist/types/baseline.d.ts +46 -0
  23. package/dist/types/builder/builder-rspack/index.d.ts +2 -0
  24. package/dist/types/builder/generator/adapterCopy.d.ts +3 -0
  25. package/dist/types/builder/generator/createBuilderProviderConfig.d.ts +3 -0
  26. package/dist/types/builder/generator/createCopyPattern.d.ts +16 -0
  27. package/dist/types/builder/generator/getBuilderEnvironments.d.ts +6 -0
  28. package/dist/types/builder/generator/index.d.ts +8 -0
  29. package/dist/types/builder/index.d.ts +3 -0
  30. package/dist/types/builder/shared/builderPlugins/adapterBasic.d.ts +3 -0
  31. package/dist/types/builder/shared/builderPlugins/adapterHtml.d.ts +3 -0
  32. package/dist/types/builder/shared/builderPlugins/adapterPrecompress.d.ts +3 -0
  33. package/dist/types/builder/shared/builderPlugins/adapterSSR.d.ts +3 -0
  34. package/dist/types/builder/shared/builderPlugins/builderHooks.d.ts +3 -0
  35. package/dist/types/builder/shared/builderPlugins/index.d.ts +5 -0
  36. package/dist/types/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.d.ts +7 -0
  37. package/dist/types/builder/shared/bundlerPlugins/HtmlBottomTemplate.d.ts +9 -0
  38. package/dist/types/builder/shared/bundlerPlugins/RouterPlugin.d.ts +32 -0
  39. package/dist/types/builder/shared/bundlerPlugins/index.d.ts +3 -0
  40. package/dist/types/builder/shared/createCopyInfo.d.ts +8 -0
  41. package/dist/types/builder/shared/index.d.ts +3 -0
  42. package/dist/types/builder/shared/loaders/serverModuleLoader.d.ts +3 -0
  43. package/dist/types/builder/shared/types.d.ts +6 -0
  44. package/dist/types/commands/build.d.ts +4 -0
  45. package/dist/types/commands/deploy.d.ts +3 -0
  46. package/dist/types/commands/dev.d.ts +9 -0
  47. package/dist/types/commands/index.d.ts +10 -0
  48. package/dist/types/commands/info.d.ts +18 -0
  49. package/dist/types/commands/inspect.d.ts +4 -0
  50. package/dist/types/commands/runtime.d.ts +11 -0
  51. package/dist/types/commands/serve.d.ts +8 -0
  52. package/dist/types/compat/hooks.d.ts +7 -0
  53. package/dist/types/compat/index.d.ts +2 -0
  54. package/dist/types/compat/utils.d.ts +13 -0
  55. package/dist/types/config/default.d.ts +3 -0
  56. package/dist/types/config/index.d.ts +2 -0
  57. package/dist/types/config/initialize/index.d.ts +3 -0
  58. package/dist/types/config/initialize/inits.d.ts +4 -0
  59. package/dist/types/constants.d.ts +2 -0
  60. package/dist/types/defineConfig.d.ts +11 -0
  61. package/dist/types/esm/register-esm.d.mts +5 -0
  62. package/dist/types/esm/ts-paths-loader.d.mts +6 -0
  63. package/dist/types/exports/server.d.ts +1 -0
  64. package/dist/types/index.d.ts +17 -0
  65. package/dist/types/locale/en.d.ts +44 -0
  66. package/dist/types/locale/index.d.ts +3 -0
  67. package/dist/types/locale/zh.d.ts +44 -0
  68. package/dist/types/plugins/analyze/constants.d.ts +3 -0
  69. package/dist/types/plugins/analyze/getBundleEntry.d.ts +4 -0
  70. package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +7 -0
  71. package/dist/types/plugins/analyze/getHtmlTemplate.d.ts +27 -0
  72. package/dist/types/plugins/analyze/getServerRoutes.d.ts +8 -0
  73. package/dist/types/plugins/analyze/index.d.ts +3 -0
  74. package/dist/types/plugins/analyze/isDefaultExportFunction.d.ts +1 -0
  75. package/dist/types/plugins/analyze/templates.d.ts +5 -0
  76. package/dist/types/plugins/analyze/utils.d.ts +10 -0
  77. package/dist/types/plugins/deploy/index.d.ts +6 -0
  78. package/dist/types/plugins/deploy/platforms/cloudflare.d.ts +2 -0
  79. package/dist/types/plugins/deploy/platforms/gh-pages.d.ts +2 -0
  80. package/dist/types/plugins/deploy/platforms/netlify.d.ts +2 -0
  81. package/dist/types/plugins/deploy/platforms/node.d.ts +2 -0
  82. package/dist/types/plugins/deploy/platforms/platform.d.ts +17 -0
  83. package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.d.mts +4 -0
  84. package/dist/types/plugins/deploy/platforms/templates/netlify-entry.d.cts +2 -0
  85. package/dist/types/plugins/deploy/platforms/templates/netlify-entry.d.mts +2 -0
  86. package/dist/types/plugins/deploy/platforms/templates/node-entry.d.cts +1 -0
  87. package/dist/types/plugins/deploy/platforms/templates/node-entry.d.mts +1 -0
  88. package/dist/types/plugins/deploy/platforms/templates/vercel-entry.d.cts +2 -0
  89. package/dist/types/plugins/deploy/platforms/templates/vercel-entry.d.mts +2 -0
  90. package/dist/types/plugins/deploy/platforms/vercel.d.ts +2 -0
  91. package/dist/types/plugins/deploy/types.d.ts +3 -0
  92. package/dist/types/plugins/deploy/utils/generator.d.ts +24 -0
  93. package/dist/types/plugins/deploy/utils/index.d.ts +16 -0
  94. package/dist/types/plugins/initialize/index.d.ts +3 -0
  95. package/dist/types/plugins/serverBuild.d.ts +3 -0
  96. package/dist/types/plugins/serverRuntime.d.ts +3 -0
  97. package/dist/types/presetUltramodern.d.ts +6 -0
  98. package/dist/types/rsbuild.d.ts +12 -0
  99. package/dist/types/run/index.d.ts +20 -0
  100. package/dist/types/types/config/deploy.d.ts +46 -0
  101. package/dist/types/types/config/dev.d.ts +55 -0
  102. package/dist/types/types/config/experiments.d.ts +3 -0
  103. package/dist/types/types/config/html.d.ts +3 -0
  104. package/dist/types/types/config/index.d.ts +48 -0
  105. package/dist/types/types/config/output.d.ts +61 -0
  106. package/dist/types/types/config/performance.d.ts +3 -0
  107. package/dist/types/types/config/resolve.d.ts +2 -0
  108. package/dist/types/types/config/security.d.ts +2 -0
  109. package/dist/types/types/config/source.d.ts +61 -0
  110. package/dist/types/types/config/testing.d.ts +8 -0
  111. package/dist/types/types/config/tools.d.ts +21 -0
  112. package/dist/types/types/index.d.ts +10 -0
  113. package/dist/types/types/plugin.d.ts +114 -0
  114. package/dist/types/types/utils.d.ts +1 -0
  115. package/dist/types/ultramodern/designSystem.d.ts +54 -0
  116. package/dist/types/utils/config.d.ts +2 -0
  117. package/dist/types/utils/createServer.d.ts +5 -0
  118. package/dist/types/utils/env.d.ts +2 -0
  119. package/dist/types/utils/generateWatchFiles.d.ts +2 -0
  120. package/dist/types/utils/getConfigFile.d.ts +1 -0
  121. package/dist/types/utils/getSelectedEntries.d.ts +5 -0
  122. package/dist/types/utils/initAppContext.d.ts +31 -0
  123. package/dist/types/utils/loadPlugins.d.ts +13 -0
  124. package/dist/types/utils/printInstructions.d.ts +3 -0
  125. package/dist/types/utils/register.d.ts +19 -0
  126. package/dist/types/utils/restart.d.ts +2 -0
  127. package/dist/types/utils/routes.d.ts +4 -0
  128. package/dist/types/utils/types.d.ts +49 -0
  129. package/package.json +15 -15
@@ -0,0 +1,16 @@
1
+ import type { Rspack, RspackChain } from '@rsbuild/core';
2
+ import type { AppNormalizedConfig } from '../../types';
3
+ import type { AppToolsContext } from '../../types/plugin';
4
+ export declare function createPublicPattern(appContext: AppToolsContext, config: AppNormalizedConfig, chain: RspackChain): {
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<ArrayBufferLike>;
15
+ };
16
+ export declare function createUploadPattern(appContext: AppToolsContext, config: AppNormalizedConfig): Rspack.CopyRspackPluginOptions['patterns']['0'];
@@ -0,0 +1,6 @@
1
+ import type { AppNormalizedConfig } from '../../types';
2
+ import type { AppToolsContext } from '../../types/plugin';
3
+ export declare function getBuilderEnvironments(normalizedConfig: AppNormalizedConfig, appContext: AppToolsContext, tempBuilderConfig: Omit<AppNormalizedConfig, 'plugins'>): {
4
+ environments: Record<string, import("@rsbuild/core").EnvironmentConfig>;
5
+ builderConfig: Omit<AppNormalizedConfig, "plugins">;
6
+ };
@@ -0,0 +1,8 @@
1
+ import { type BundlerType } from '@modern-js/builder';
2
+ import type { BuilderOptions } from '../shared';
3
+ /**
4
+ * @param options BuilderOptions
5
+ * @param bundlerType BundlerType
6
+ * @returns BuilderInstance
7
+ */
8
+ export declare function generateBuilder(options: BuilderOptions, bundlerType: BundlerType): Promise<any>;
@@ -0,0 +1,3 @@
1
+ export declare function createBuilderGenerator(): Promise<typeof import("./builder-rspack/index.js").createRspackBuilderForModern>;
2
+ export { parseRspackConfig } from '@modern-js/builder';
3
+ export { builderPluginAdapterBasic, builderPluginAdapterHooks, } from './shared/builderPlugins';
@@ -0,0 +1,3 @@
1
+ import type { RsbuildPlugin } from '@rsbuild/core';
2
+ import type { BuilderOptions } from '../types';
3
+ export declare const builderPluginAdapterBasic: (options: BuilderOptions) => RsbuildPlugin;
@@ -0,0 +1,3 @@
1
+ import type { RsbuildPlugin } from '@rsbuild/core';
2
+ import type { BuilderOptions } from '../types';
3
+ export declare const builderPluginAdapterHtml: (options: BuilderOptions) => RsbuildPlugin;
@@ -0,0 +1,3 @@
1
+ import type { RsbuildPlugin } from '@rsbuild/core';
2
+ import type { BuilderOptions } from '../types';
3
+ export declare const builderPluginAdapterPrecompress: (options: BuilderOptions) => RsbuildPlugin;
@@ -0,0 +1,3 @@
1
+ import { type RsbuildPlugin } from '@rsbuild/core';
2
+ import type { BuilderOptions } from '../types';
3
+ export declare const builderPluginAdapterSSR: (options: BuilderOptions) => RsbuildPlugin;
@@ -0,0 +1,3 @@
1
+ import type { RsbuildPlugin } from '@rsbuild/core';
2
+ import type { BuilderOptions } from '../types';
3
+ export declare const builderPluginAdapterHooks: (options: BuilderOptions) => RsbuildPlugin;
@@ -0,0 +1,5 @@
1
+ export * from './adapterBasic';
2
+ export * from './adapterHtml';
3
+ export * from './adapterPrecompress';
4
+ export * from './adapterSSR';
5
+ export * from './builderHooks';
@@ -0,0 +1,7 @@
1
+ import type { Rspack } from '@modern-js/builder';
2
+ export declare class HtmlAsyncChunkPlugin {
3
+ name: string;
4
+ htmlPlugin: typeof Rspack.HtmlRspackPlugin;
5
+ constructor(htmlPlugin: typeof Rspack.HtmlRspackPlugin);
6
+ apply(compiler: Rspack.Compiler): void;
7
+ }
@@ -0,0 +1,9 @@
1
+ import type { Rspack } from '@modern-js/builder';
2
+ export declare class BottomTemplatePlugin {
3
+ htmlPlugin: typeof Rspack.HtmlRspackPlugin;
4
+ bottomTemplateReg: RegExp;
5
+ bodyRegExp: RegExp;
6
+ name: string;
7
+ constructor(htmlPlugin: typeof Rspack.HtmlRspackPlugin);
8
+ apply(compiler: Rspack.Compiler): void;
9
+ }
@@ -0,0 +1,32 @@
1
+ import type { Rspack, ScriptLoading } from '@rsbuild/core';
2
+ export interface RouteAssets {
3
+ [routeId: string]: {
4
+ chunkIds?: (string | number)[];
5
+ assets?: string[];
6
+ referenceCssAssets?: string[];
7
+ };
8
+ }
9
+ type Compiler = Rspack.Compiler;
10
+ type Options = {
11
+ HtmlBundlerPlugin: typeof Rspack.HtmlRspackPlugin;
12
+ staticJsDir?: string;
13
+ enableInlineRouteManifests: boolean;
14
+ disableFilenameHash?: boolean;
15
+ scriptLoading?: ScriptLoading;
16
+ nonce?: string;
17
+ };
18
+ export declare class RouterPlugin {
19
+ readonly name: string;
20
+ private HtmlBundlerPlugin;
21
+ private enableInlineRouteManifests;
22
+ private staticJsDir;
23
+ private disableFilenameHash?;
24
+ private scriptLoading?;
25
+ private nonce?;
26
+ constructor({ staticJsDir, HtmlBundlerPlugin, enableInlineRouteManifests, disableFilenameHash, scriptLoading, nonce, }: Options);
27
+ private isTargetNodeOrWebWorker;
28
+ private getEntryChunks;
29
+ private getEntryChunkFiles;
30
+ apply(compiler: Compiler): void;
31
+ }
32
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './HtmlAsyncChunkPlugin';
2
+ export * from './HtmlBottomTemplate';
3
+ export * from './RouterPlugin';
@@ -0,0 +1,8 @@
1
+ import type { AppNormalizedConfig } from '../../types';
2
+ import type { AppToolsContext } from '../../types/plugin';
3
+ export declare function createCopyInfo(appContext: AppToolsContext, config: AppNormalizedConfig): {
4
+ configDir: string;
5
+ uploadDir: string;
6
+ publicDir: string;
7
+ customPublicDirs: any;
8
+ };
@@ -0,0 +1,3 @@
1
+ export * from './builderPlugins';
2
+ export * from './createCopyInfo';
3
+ export * from './types';
@@ -0,0 +1,3 @@
1
+ import type { Rspack } from '@modern-js/builder';
2
+ declare function loader(this: Rspack.LoaderContext): string;
3
+ export default loader;
@@ -0,0 +1,6 @@
1
+ import type { AppNormalizedConfig } from '../../types';
2
+ import type { AppToolsContext } from '../../types/plugin';
3
+ export type BuilderOptions = {
4
+ normalizedConfig: AppNormalizedConfig;
5
+ appContext: AppToolsContext;
6
+ };
@@ -0,0 +1,4 @@
1
+ import type { CLIPluginAPI } from '@modern-js/plugin';
2
+ import type { AppTools } from '../types';
3
+ import type { BuildOptions } from '../utils/types';
4
+ export declare const build: (api: CLIPluginAPI<AppTools>, options?: BuildOptions) => Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { CLIPluginAPI } from '@modern-js/plugin';
2
+ import type { AppTools } from '../types';
3
+ export declare const deploy: (api: CLIPluginAPI<AppTools>, options: any) => Promise<void>;
@@ -0,0 +1,9 @@
1
+ import type { CLIPluginAPI } from '@modern-js/plugin';
2
+ import { type ApplyPlugins } from '@modern-js/server';
3
+ import type { AppTools } from '../types';
4
+ import type { DevOptions } from '../utils/types';
5
+ interface ExtraServerOptions {
6
+ applyPlugins?: ApplyPlugins;
7
+ }
8
+ export declare const dev: (api: CLIPluginAPI<AppTools>, options: DevOptions, devServerOptions?: ExtraServerOptions) => Promise<void>;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { CLIPluginAPI } from '@modern-js/plugin';
2
+ import type { Command } from '@modern-js/utils';
3
+ import type { AppTools } from '../types';
4
+ export declare const devCommand: (program: Command, api: CLIPluginAPI<AppTools>) => Promise<void>;
5
+ export declare const buildCommand: (program: Command, api: CLIPluginAPI<AppTools>) => Promise<void>;
6
+ export declare const serverCommand: (program: Command, api: CLIPluginAPI<AppTools>) => void;
7
+ export declare const deployCommand: (program: Command, api: CLIPluginAPI<AppTools>) => void;
8
+ export declare const inspectCommand: (program: Command, api: CLIPluginAPI<AppTools>) => void;
9
+ export declare const infoCommand: (program: Command, api: CLIPluginAPI<AppTools>) => void;
10
+ export declare const runtimeOperationsCommand: (program: Command, api: CLIPluginAPI<AppTools>) => Promise<void>;
@@ -0,0 +1,18 @@
1
+ import type { CLIPluginAPI } from '@modern-js/plugin';
2
+ import type { AppTools } from '../types';
3
+ import type { InfoOptions } from '../utils/types';
4
+ export interface EntryInfo {
5
+ entryName: string;
6
+ isMainEntry: boolean;
7
+ entry: string;
8
+ isAutoMount: boolean;
9
+ isCustomSourceEntry: boolean;
10
+ customEntry: boolean;
11
+ ssr: boolean | 'stream' | 'string';
12
+ ssg: boolean;
13
+ }
14
+ export interface ProjectInfo {
15
+ entries: EntryInfo[];
16
+ apiOnly: boolean;
17
+ }
18
+ export declare const info: (api: CLIPluginAPI<AppTools>, options?: InfoOptions) => Promise<void>;
@@ -0,0 +1,4 @@
1
+ import type { CLIPluginAPI } from '@modern-js/plugin';
2
+ import type { AppTools } from '../types';
3
+ import type { InspectOptions } from '../utils/types';
4
+ export declare const inspect: (api: CLIPluginAPI<AppTools>, options: InspectOptions) => Promise<any>;
@@ -0,0 +1,11 @@
1
+ import type { CLIPluginAPI } from '@modern-js/plugin';
2
+ import type { Command } from '@modern-js/utils';
3
+ import type { AppTools } from '../types';
4
+ import type { RuntimeFallbackSignalOptions } from '../utils/types';
5
+ export declare const resolveRuntimeEndpoint: (input: string | undefined, defaultPath: string) => string;
6
+ export declare const resolveToken: ({ token, tokenEnv, }: {
7
+ token?: string;
8
+ tokenEnv?: string;
9
+ }) => string | undefined;
10
+ export declare const createRuntimeFallbackSignalPayload: (options: RuntimeFallbackSignalOptions) => Record<string, unknown>;
11
+ export declare const runtimeCommand: (program: Command, _api: CLIPluginAPI<AppTools>) => Promise<void>;
@@ -0,0 +1,8 @@
1
+ import type { CLIPluginAPI } from '@modern-js/plugin';
2
+ import { createProdServer } from '@modern-js/prod-server';
3
+ import type { AppTools } from '../types';
4
+ type ExtraServerOptions = {
5
+ launcher?: typeof createProdServer;
6
+ };
7
+ export declare const serve: (api: CLIPluginAPI<AppTools>, serverOptions?: ExtraServerOptions) => Promise<void>;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { InternalContext } from '@modern-js/plugin';
2
+ import type { AppTools } from '../types';
3
+ /**
4
+ * old plugin useHookRunners function result
5
+ */
6
+ export declare function getHookRunners(context: InternalContext<AppTools>): Record<string, any>;
7
+ export declare function handleSetupResult(setupResult: Record<string, (...args: any) => any>, api: Record<string, any>): void;
@@ -0,0 +1,2 @@
1
+ import type { AppTools, CliPlugin } from '../types';
2
+ export declare const compatPlugin: () => CliPlugin<AppTools>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Maps old plugin hook function names to new plugin API names
3
+ */
4
+ export declare function transformHookRunner(hookRunnerName: string): string | undefined;
5
+ /**
6
+ * Note:
7
+ * isMultiple Indicates whether the function parameter represents multiple values.
8
+ */
9
+ export declare function transformHookParams(hookRunnerName: string, params: any): {
10
+ isMultiple: boolean;
11
+ params: any;
12
+ };
13
+ export declare function transformHookResult(hookRunnerName: string, result: any): any;
@@ -0,0 +1,3 @@
1
+ import type { AppUserConfig } from '../types';
2
+ import type { AppToolsContext } from '../types/plugin';
3
+ export declare function createDefaultConfig(appContext: AppToolsContext): AppUserConfig;
@@ -0,0 +1,2 @@
1
+ export * from './default';
2
+ export * from './initialize';
@@ -0,0 +1,3 @@
1
+ import type { AppNormalizedConfig } from '../../types';
2
+ import type { AppToolsContext } from '../../types/plugin';
3
+ export declare function initialNormalizedConfig(config: AppNormalizedConfig, appContext: AppToolsContext): AppNormalizedConfig;
@@ -0,0 +1,4 @@
1
+ import type { AppNormalizedConfig } from '../../types';
2
+ import type { AppToolsContext } from '../../types/plugin';
3
+ export declare function initHtmlConfig(config: AppNormalizedConfig, appContext: AppToolsContext): AppNormalizedConfig['html'];
4
+ export declare function initSourceConfig(config: AppNormalizedConfig, appContext: AppToolsContext): void;
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_CONFIG_FILE = "modern.config";
2
+ export declare const DEFAULT_RUNTIME_CONFIG_FILE = "modern.runtime";
@@ -0,0 +1,11 @@
1
+ import type { AppUserConfig } from './types';
2
+ export type ConfigParams = {
3
+ env: string;
4
+ command: string;
5
+ };
6
+ export type UserConfigExport<Config> = Config | ((env: ConfigParams) => Config | Promise<Config>);
7
+ /**
8
+ * This function helps you to autocomplete configuration types.
9
+ * It accepts a direct config object, or a function that returns a config.
10
+ */
11
+ export declare const defineConfig: (config: UserConfigExport<AppUserConfig>) => UserConfigExport<import("./types").AppToolsUserConfig>;
@@ -0,0 +1,5 @@
1
+ export declare const registerPathsLoader: ({ appDir, baseUrl, paths }: {
2
+ appDir: any;
3
+ baseUrl: any;
4
+ paths: any;
5
+ }) => Promise<void>;
@@ -0,0 +1,6 @@
1
+ export declare function initialize({ appDir: currentAppDir, baseUrl, paths }: {
2
+ appDir: any;
3
+ baseUrl: any;
4
+ paths: any;
5
+ }): Promise<void>;
6
+ export declare function resolve(specifier: any, context: any, defaultResolve: any): any;
@@ -0,0 +1 @@
1
+ export type { ServerPlugin } from '@modern-js/server-core';
@@ -0,0 +1,17 @@
1
+ import type { AppTools, CliPlugin } from './types';
2
+ import { initAppContext } from './utils/initAppContext';
3
+ export * from './baseline';
4
+ export * from './defineConfig';
5
+ export * from './presetUltramodern';
6
+ export * from './ultramodern/designSystem';
7
+ export declare const appTools: () => CliPlugin<AppTools>;
8
+ export { dev } from './commands/dev';
9
+ export { serve } from './commands/serve';
10
+ export { defineConfig } from './defineConfig';
11
+ export { type ResolveModernRsbuildConfigOptions, resolveModernRsbuildConfig, } from './rsbuild';
12
+ export * from './types';
13
+ export { generateWatchFiles } from './utils/generateWatchFiles';
14
+ export type { DevOptions } from './utils/types';
15
+ export { initAppContext };
16
+ export default appTools;
17
+ export { mergeConfig } from '@modern-js/plugin/cli';
@@ -0,0 +1,44 @@
1
+ export declare const EN_LOCALE: {
2
+ command: {
3
+ shared: {
4
+ analyze: string;
5
+ config: string;
6
+ skipBuild: string;
7
+ noNeedInstall: string;
8
+ };
9
+ dev: {
10
+ describe: string;
11
+ entry: string;
12
+ apiOnly: string;
13
+ webOnly: string;
14
+ selectEntry: string;
15
+ requireEntry: string;
16
+ };
17
+ build: {
18
+ describe: string;
19
+ watch: string;
20
+ };
21
+ serve: {
22
+ describe: string;
23
+ };
24
+ deploy: {
25
+ describe: string;
26
+ };
27
+ new: {
28
+ describe: string;
29
+ debug: string;
30
+ config: string;
31
+ distTag: string;
32
+ registry: string;
33
+ lang: string;
34
+ };
35
+ inspect: {
36
+ env: string;
37
+ output: string;
38
+ verbose: string;
39
+ };
40
+ info: {
41
+ describe: string;
42
+ };
43
+ };
44
+ };
@@ -0,0 +1,3 @@
1
+ declare const i18n: any;
2
+ declare const localeKeys: any;
3
+ export { i18n, localeKeys };
@@ -0,0 +1,44 @@
1
+ export declare const ZH_LOCALE: {
2
+ command: {
3
+ shared: {
4
+ analyze: string;
5
+ config: string;
6
+ skipBuild: string;
7
+ noNeedInstall: string;
8
+ };
9
+ dev: {
10
+ describe: string;
11
+ entry: string;
12
+ apiOnly: string;
13
+ webOnly: string;
14
+ selectEntry: string;
15
+ requireEntry: string;
16
+ };
17
+ build: {
18
+ describe: string;
19
+ watch: string;
20
+ };
21
+ serve: {
22
+ describe: string;
23
+ };
24
+ deploy: {
25
+ describe: string;
26
+ };
27
+ new: {
28
+ describe: string;
29
+ debug: string;
30
+ config: string;
31
+ distTag: string;
32
+ registry: string;
33
+ lang: string;
34
+ };
35
+ inspect: {
36
+ env: string;
37
+ output: string;
38
+ verbose: string;
39
+ };
40
+ info: {
41
+ describe: string;
42
+ };
43
+ };
44
+ };
@@ -0,0 +1,3 @@
1
+ export declare const ENTRY_FILE_NAME = "entry";
2
+ export declare const HTML_PARTIALS_FOLDER = "html";
3
+ export declare const HTML_PARTIALS_EXTENSIONS: string[];
@@ -0,0 +1,4 @@
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[]>;
@@ -0,0 +1,7 @@
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) => any;
6
+ export declare const hasServerEntry: (dir: string) => any;
7
+ export declare const getFileSystemEntry: (hooks: AppToolsHooks, appContext: AppToolsContext, config: AppNormalizedConfig) => Promise<Entrypoint[]>;
@@ -0,0 +1,27 @@
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
+ }>;
@@ -0,0 +1,8 @@
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;
@@ -0,0 +1,3 @@
1
+ import type { AppTools, CliPlugin } from '../../types';
2
+ declare const _default: () => CliPlugin<AppTools>;
3
+ export default _default;
@@ -0,0 +1 @@
1
+ export declare const isDefaultExportFunction: (file: string | false) => boolean;
@@ -0,0 +1,5 @@
1
+ export declare const html: (partials: {
2
+ top: string[];
3
+ head: string[];
4
+ body: string[];
5
+ }) => string;
@@ -0,0 +1,10 @@
1
+ export declare const walkDirectory: (dir: string) => string[];
2
+ export declare const replaceWithAlias: (base: string, filePath: string, alias: string) => any;
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;
@@ -0,0 +1,6 @@
1
+ import type { AppTools, AppToolsNormalizedConfig, CliPlugin } from '../../types';
2
+ import type { DeployTarget } from '../../types/config/deploy';
3
+ export declare const getSupportedDeployTargets: () => DeployTarget[];
4
+ export declare const resolveDeployTarget: (modernConfig: AppToolsNormalizedConfig, envDeployTarget?: string | undefined, detectedProvider?: import("std-env").ProviderName) => string;
5
+ declare const _default: () => CliPlugin<AppTools>;
6
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import type { CreatePreset } from './platform';
2
+ export declare const createCloudflarePreset: CreatePreset;
@@ -0,0 +1,2 @@
1
+ import type { CreatePreset } from './platform';
2
+ export declare const createGhPagesPreset: CreatePreset;
@@ -0,0 +1,2 @@
1
+ import type { CreatePreset } from './platform';
2
+ export declare const createNetlifyPreset: CreatePreset;
@@ -0,0 +1,2 @@
1
+ import type { CreatePreset } from './platform';
2
+ export declare const createNodePreset: CreatePreset;
@@ -0,0 +1,17 @@
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 {};
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ fetch(request: any, env: any, ctx: any): Promise<Response>;
3
+ };
4
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const handler: (request: any, context: any) => Promise<any>;
2
+ export { handler as default };
@@ -0,0 +1,2 @@
1
+ declare const handler: (request: any, context: any) => Promise<any>;
2
+ export default handler;
@@ -0,0 +1,2 @@
1
+ declare const handler: (req: any, res: any) => Promise<any>;
2
+ export = handler;
@@ -0,0 +1,2 @@
1
+ declare const handler: (req: any, res: any) => Promise<any>;
2
+ export default handler;
@@ -0,0 +1,2 @@
1
+ import type { CreatePreset } from './platform';
2
+ export declare const createVercelPreset: CreatePreset;
@@ -0,0 +1,3 @@
1
+ import type { AppTools, CliPlugin } from '../../types';
2
+ export type Setup = NonNullable<CliPlugin<AppTools>['setup']>;
3
+ export type PluginAPI = Parameters<Setup>[0];