@modern-js/plugin 3.8.3 → 3.9.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.
- package/dist/types/cli/api.d.ts +4 -4
- package/dist/types/cli/context.d.ts +2 -2
- package/dist/types/cli/hooks.d.ts +27 -27
- package/dist/types/cli/index.d.ts +6 -6
- package/dist/types/cli/run/config/createLoadedConfig.d.ts +1 -1
- package/dist/types/cli/run/config/createResolvedConfig.d.ts +2 -2
- package/dist/types/cli/run/create.d.ts +7 -7
- package/dist/types/cli/run/index.d.ts +9 -9
- package/dist/types/cli/run/run.d.ts +1 -1
- package/dist/types/cli/run/types.d.ts +2 -2
- package/dist/types/cli/run/utils/createFileWatcher.d.ts +2 -2
- package/dist/types/cli/run/utils/mergeConfig.d.ts +1 -1
- package/dist/types/hooks.d.ts +1 -1
- package/dist/types/index.d.ts +7 -7
- package/dist/types/manager.d.ts +1 -1
- package/dist/types/runtime/api.d.ts +4 -4
- package/dist/types/runtime/context.d.ts +2 -2
- package/dist/types/runtime/hooks.d.ts +1 -1
- package/dist/types/runtime/index.d.ts +5 -5
- package/dist/types/runtime/run/create.d.ts +3 -3
- package/dist/types/runtime/run/index.d.ts +2 -2
- package/dist/types/runtime/run/types.d.ts +1 -1
- package/dist/types/server/api.d.ts +4 -4
- package/dist/types/server/context.d.ts +3 -3
- package/dist/types/server/hooks.d.ts +5 -5
- package/dist/types/server/index.d.ts +4 -4
- package/dist/types/server/run/create.d.ts +3 -3
- package/dist/types/server/run/index.d.ts +4 -4
- package/dist/types/server/run/types.d.ts +1 -1
- package/dist/types/types/cli/api.d.ts +6 -6
- package/dist/types/types/cli/context.d.ts +3 -3
- package/dist/types/types/cli/hooks.d.ts +3 -3
- package/dist/types/types/cli/index.d.ts +4 -4
- package/dist/types/types/cli/plugin.d.ts +4 -4
- package/dist/types/types/hooks.d.ts +1 -1
- package/dist/types/types/index.d.ts +4 -4
- package/dist/types/types/plugin.d.ts +3 -3
- package/dist/types/types/runtime/api.d.ts +6 -6
- package/dist/types/types/runtime/context.d.ts +3 -3
- package/dist/types/types/runtime/hooks.d.ts +1 -1
- package/dist/types/types/runtime/index.d.ts +4 -4
- package/dist/types/types/runtime/plugin.d.ts +4 -4
- package/dist/types/types/server/api.d.ts +5 -5
- package/dist/types/types/server/context.d.ts +3 -3
- package/dist/types/types/server/hooks.d.ts +1 -1
- package/dist/types/types/server/index.d.ts +4 -4
- package/dist/types/types/server/plugin.d.ts +4 -4
- package/package.json +7 -7
package/dist/types/cli/api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CLIPluginAPI } from '../types/cli/api';
|
|
2
|
-
import type { InternalContext } from '../types/cli/context';
|
|
3
|
-
import type { CLIPluginExtends } from '../types/cli/plugin';
|
|
4
|
-
import type { PluginManager } from '../types/plugin';
|
|
1
|
+
import type { CLIPluginAPI } from '../types/cli/api.js';
|
|
2
|
+
import type { InternalContext } from '../types/cli/context.js';
|
|
3
|
+
import type { CLIPluginExtends } from '../types/cli/plugin.js';
|
|
4
|
+
import type { PluginManager } from '../types/plugin.js';
|
|
5
5
|
export declare function initPluginAPI<Extends extends CLIPluginExtends>({ context, pluginManager, }: {
|
|
6
6
|
context: InternalContext<Extends>;
|
|
7
7
|
pluginManager: PluginManager;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AppContext, InternalContext } from '../types/cli/context';
|
|
2
|
-
import type { CLIPlugin, CLIPluginExtends } from '../types/cli/plugin';
|
|
1
|
+
import type { AppContext, InternalContext } from '../types/cli/context.js';
|
|
2
|
+
import type { CLIPlugin, CLIPluginExtends } from '../types/cli/plugin.js';
|
|
3
3
|
interface ContextParams<Extends extends CLIPluginExtends> {
|
|
4
4
|
appContext: AppContext<Extends>;
|
|
5
5
|
config: Extends['config'];
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import type { OnAfterBuildFn, OnAfterCreateCompilerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnDevCompileDoneFn } from '@rsbuild/core';
|
|
2
|
-
import type { AddCommandFn, AddWatchFilesFn, ConfigFn, InternalRuntimePluginsFn, InternalServerPluginsFn, ModifyBundlerChainFn, ModifyConfigFn, ModifyHtmlPartialsFn, ModifyResolvedConfigFn, ModifyRsbuildConfigFn, ModifyRspackConfigFn, ModifyServerRoutesFn, OnAfterDeployFn, OnAfterDevFn, OnBeforeDeployFn, OnBeforeDevFn, OnBeforeExitFn, OnBeforeRestartFn, OnFileChangedFn, OnPrepareFn, RuntimePluginConfig, ServerPluginConfig } from '../types/cli/hooks';
|
|
3
|
-
import type { DeepPartial } from '../types/utils';
|
|
2
|
+
import type { AddCommandFn, AddWatchFilesFn, ConfigFn, InternalRuntimePluginsFn, InternalServerPluginsFn, ModifyBundlerChainFn, ModifyConfigFn, ModifyHtmlPartialsFn, ModifyResolvedConfigFn, ModifyRsbuildConfigFn, ModifyRspackConfigFn, ModifyServerRoutesFn, OnAfterDeployFn, OnAfterDevFn, OnBeforeDeployFn, OnBeforeDevFn, OnBeforeExitFn, OnBeforeRestartFn, OnFileChangedFn, OnPrepareFn, RuntimePluginConfig, ServerPluginConfig } from '../types/cli/hooks.js';
|
|
3
|
+
import type { DeepPartial } from '../types/utils.js';
|
|
4
4
|
export type { OnAfterBuildFn, OnAfterCreateCompilerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnDevCompileDoneFn, AddCommandFn, AddWatchFilesFn, ConfigFn, ModifyBundlerChainFn, ModifyConfigFn, ModifyHtmlPartialsFn, ModifyResolvedConfigFn, ModifyRsbuildConfigFn, ModifyRspackConfigFn, OnAfterDeployFn, OnBeforeDeployFn, OnBeforeDevFn, OnAfterDevFn, OnBeforeExitFn, OnBeforeRestartFn, OnFileChangedFn, OnPrepareFn, InternalRuntimePluginsFn, InternalServerPluginsFn, ModifyServerRoutesFn, RuntimePluginConfig, ServerPluginConfig, };
|
|
5
5
|
export declare function initHooks<Config, NormalizedConfig, ExtendBuildUtils, ExtendConfigUtils>(): {
|
|
6
6
|
/**
|
|
7
7
|
* add config for this cli plugin
|
|
8
8
|
*/
|
|
9
|
-
config: import("
|
|
9
|
+
config: import("../index.js").CollectAsyncHook<ConfigFn<DeepPartial<Config>>>;
|
|
10
10
|
/**
|
|
11
11
|
* @private
|
|
12
12
|
* modify config for this cli plugin
|
|
13
13
|
*/
|
|
14
|
-
modifyConfig: import("
|
|
14
|
+
modifyConfig: import("../index.js").AsyncHook<ModifyConfigFn<Config, ExtendConfigUtils>>;
|
|
15
15
|
/**
|
|
16
16
|
* modify final config
|
|
17
17
|
*/
|
|
18
|
-
modifyResolvedConfig: import("
|
|
19
|
-
modifyRsbuildConfig: import("
|
|
20
|
-
modifyBundlerChain: import("
|
|
21
|
-
modifyRspackConfig: import("
|
|
22
|
-
modifyHtmlPartials: import("
|
|
23
|
-
addCommand: import("
|
|
24
|
-
addWatchFiles: import("
|
|
25
|
-
onPrepare: import("
|
|
26
|
-
onFileChanged: import("
|
|
27
|
-
onBeforeRestart: import("
|
|
28
|
-
onBeforeCreateCompiler: import("
|
|
29
|
-
onAfterCreateCompiler: import("
|
|
30
|
-
onDevCompileDone: import("
|
|
31
|
-
onBeforeBuild: import("
|
|
32
|
-
onAfterBuild: import("
|
|
33
|
-
onBeforeDev: import("
|
|
34
|
-
onAfterDev: import("
|
|
35
|
-
onBeforeDeploy: import("
|
|
36
|
-
onAfterDeploy: import("
|
|
37
|
-
onBeforeExit: import("
|
|
38
|
-
_internalRuntimePlugins: import("
|
|
39
|
-
_internalServerPlugins: import("
|
|
40
|
-
modifyServerRoutes: import("
|
|
18
|
+
modifyResolvedConfig: import("../index.js").AsyncHook<ModifyResolvedConfigFn<NormalizedConfig, ExtendConfigUtils>>;
|
|
19
|
+
modifyRsbuildConfig: import("../index.js").AsyncHook<ModifyRsbuildConfigFn<ExtendBuildUtils>>;
|
|
20
|
+
modifyBundlerChain: import("../index.js").AsyncHook<ModifyBundlerChainFn<ExtendBuildUtils>>;
|
|
21
|
+
modifyRspackConfig: import("../index.js").AsyncHook<ModifyRspackConfigFn<ExtendBuildUtils>>;
|
|
22
|
+
modifyHtmlPartials: import("../index.js").AsyncHook<ModifyHtmlPartialsFn>;
|
|
23
|
+
addCommand: import("../index.js").AsyncHook<AddCommandFn>;
|
|
24
|
+
addWatchFiles: import("../index.js").CollectAsyncHook<AddWatchFilesFn>;
|
|
25
|
+
onPrepare: import("../index.js").AsyncHook<OnPrepareFn>;
|
|
26
|
+
onFileChanged: import("../index.js").AsyncHook<OnFileChangedFn>;
|
|
27
|
+
onBeforeRestart: import("../index.js").AsyncHook<OnBeforeRestartFn>;
|
|
28
|
+
onBeforeCreateCompiler: import("../index.js").AsyncHook<OnBeforeCreateCompilerFn>;
|
|
29
|
+
onAfterCreateCompiler: import("../index.js").AsyncHook<OnAfterCreateCompilerFn>;
|
|
30
|
+
onDevCompileDone: import("../index.js").AsyncHook<import("@rsbuild/core").OnAfterDevCompileFn>;
|
|
31
|
+
onBeforeBuild: import("../index.js").AsyncHook<OnBeforeBuildFn>;
|
|
32
|
+
onAfterBuild: import("../index.js").AsyncHook<OnAfterBuildFn>;
|
|
33
|
+
onBeforeDev: import("../index.js").AsyncHook<OnBeforeDevFn>;
|
|
34
|
+
onAfterDev: import("../index.js").AsyncHook<OnAfterDevFn>;
|
|
35
|
+
onBeforeDeploy: import("../index.js").AsyncHook<OnBeforeDeployFn>;
|
|
36
|
+
onAfterDeploy: import("../index.js").AsyncHook<OnAfterDeployFn>;
|
|
37
|
+
onBeforeExit: import("../index.js").AsyncHook<OnBeforeExitFn>;
|
|
38
|
+
_internalRuntimePlugins: import("../index.js").AsyncHook<InternalRuntimePluginsFn>;
|
|
39
|
+
_internalServerPlugins: import("../index.js").AsyncHook<InternalServerPluginsFn>;
|
|
40
|
+
modifyServerRoutes: import("../index.js").AsyncHook<ModifyServerRoutesFn>;
|
|
41
41
|
};
|
|
42
42
|
export type Hooks<Config, NormalizedConfig, ExtendBuildUtils, ExtendConfigUtils> = ReturnType<typeof initHooks<Config, NormalizedConfig, ExtendBuildUtils, ExtendConfigUtils>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { initPluginAPI } from './api';
|
|
2
|
-
export { initAppContext, createContext } from './context';
|
|
3
|
-
export { initHooks, type Hooks, type OnAfterBuildFn, type OnAfterCreateCompilerFn, type OnBeforeBuildFn, type OnBeforeCreateCompilerFn, type OnDevCompileDoneFn, type AddCommandFn, type AddWatchFilesFn, type ConfigFn, type ModifyBundlerChainFn, type ModifyConfigFn, type ModifyHtmlPartialsFn, type ModifyResolvedConfigFn, type ModifyRsbuildConfigFn, type ModifyRspackConfigFn, type OnAfterDeployFn, type OnBeforeDeployFn, type OnBeforeDevFn, type OnAfterDevFn, type OnBeforeExitFn, type OnBeforeRestartFn, type OnFileChangedFn, type OnPrepareFn, type InternalRuntimePluginsFn, type InternalServerPluginsFn, type ModifyServerRoutesFn, type RuntimePluginConfig, type ServerPluginConfig, } from './hooks';
|
|
4
|
-
export { cli, createLoadedConfig, initAppDir, createCli } from './run';
|
|
5
|
-
export { createConfigOptions, createStorybookOptions } from './run/create';
|
|
6
|
-
export { mergeConfig } from './run/utils/mergeConfig';
|
|
1
|
+
export { initPluginAPI } from './api.js';
|
|
2
|
+
export { initAppContext, createContext } from './context.js';
|
|
3
|
+
export { initHooks, type Hooks, type OnAfterBuildFn, type OnAfterCreateCompilerFn, type OnBeforeBuildFn, type OnBeforeCreateCompilerFn, type OnDevCompileDoneFn, type AddCommandFn, type AddWatchFilesFn, type ConfigFn, type ModifyBundlerChainFn, type ModifyConfigFn, type ModifyHtmlPartialsFn, type ModifyResolvedConfigFn, type ModifyRsbuildConfigFn, type ModifyRspackConfigFn, type OnAfterDeployFn, type OnBeforeDeployFn, type OnBeforeDevFn, type OnAfterDevFn, type OnBeforeExitFn, type OnBeforeRestartFn, type OnFileChangedFn, type OnPrepareFn, type InternalRuntimePluginsFn, type InternalServerPluginsFn, type ModifyServerRoutesFn, type RuntimePluginConfig, type ServerPluginConfig, } from './hooks.js';
|
|
4
|
+
export { cli, createLoadedConfig, initAppDir, createCli } from './run/index.js';
|
|
5
|
+
export { createConfigOptions, createStorybookOptions } from './run/create.js';
|
|
6
|
+
export { mergeConfig } from './run/utils/mergeConfig.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { LoadedConfig } from '../types';
|
|
1
|
+
import type { LoadedConfig } from '../types.js';
|
|
2
2
|
export declare function createLoadedConfig<T>(appDirectory: string, configFilePath: string, otherConfig?: T): Promise<LoadedConfig<T>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { DeepPartial } from '../../../types/utils';
|
|
2
|
-
import type { LoadedConfig } from '../types';
|
|
1
|
+
import type { DeepPartial } from '../../../types/utils.js';
|
|
2
|
+
import type { LoadedConfig } from '../types.js';
|
|
3
3
|
export declare const createResolveConfig: <Config, NormalizedConfig>(loaded: LoadedConfig<Config>, configs: DeepPartial<Config>[]) => Promise<NormalizedConfig>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { InternalContext } from '../../types/cli/context';
|
|
2
|
-
import type { CLIPluginExtends } from '../../types/cli/plugin';
|
|
3
|
-
import type { CLIRunOptions } from './types';
|
|
1
|
+
import type { InternalContext } from '../../types/cli/context.js';
|
|
2
|
+
import type { CLIPluginExtends } from '../../types/cli/plugin.js';
|
|
3
|
+
import type { CLIRunOptions } from './types.js';
|
|
4
4
|
export declare const createCli: <Extends extends CLIPluginExtends>() => {
|
|
5
5
|
init: (options: CLIRunOptions<Extends>) => Promise<{
|
|
6
6
|
appContext: InternalContext<Extends>;
|
|
@@ -14,11 +14,11 @@ type CreateConfigOption<Extends extends CLIPluginExtends> = Omit<CLIRunOptions<E
|
|
|
14
14
|
modifyModernConfig?: (config: Extends['config']) => Extends['config'] | Promise<Extends['config']>;
|
|
15
15
|
};
|
|
16
16
|
export declare const createConfigOptions: <Extends extends CLIPluginExtends>(options: CreateConfigOption<Extends>) => Promise<{
|
|
17
|
-
config: Awaited<Extends["normalizedConfig"]> | NonNullable<Awaited<import("../../types/utils").UnwrapPromise<Extends["normalizedConfig"]>>>;
|
|
18
|
-
getAppContext: () => Readonly<import("../../types/cli/context").AppContext<Extends> & Extends["extendContext"]>;
|
|
17
|
+
config: Awaited<Extends["normalizedConfig"]> | NonNullable<Awaited<import("../../types/utils.js").UnwrapPromise<Extends["normalizedConfig"]>>>;
|
|
18
|
+
getAppContext: () => Readonly<import("../../types/cli/context.js").AppContext<Extends> & Extends["extendContext"]>;
|
|
19
19
|
}>;
|
|
20
20
|
export declare const createStorybookOptions: <Extends extends CLIPluginExtends>(options: Omit<CreateConfigOption<Extends>, "command">) => Promise<{
|
|
21
|
-
config: Awaited<Extends["normalizedConfig"]> | NonNullable<Awaited<import("../../types/utils").UnwrapPromise<Extends["normalizedConfig"]>>>;
|
|
22
|
-
getAppContext: () => Readonly<import("../../types/cli/context").AppContext<Extends> & Extends["extendContext"]>;
|
|
21
|
+
config: Awaited<Extends["normalizedConfig"]> | NonNullable<Awaited<import("../../types/utils.js").UnwrapPromise<Extends["normalizedConfig"]>>>;
|
|
22
|
+
getAppContext: () => Readonly<import("../../types/cli/context.js").AppContext<Extends> & Extends["extendContext"]>;
|
|
23
23
|
}>;
|
|
24
24
|
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { createCli } from './create';
|
|
2
|
-
export { createLoadedConfig } from './config/createLoadedConfig';
|
|
3
|
-
export { initAppDir } from './utils/initAppDir';
|
|
4
|
-
export { loadTypeScriptFile } from './config/loadConfig';
|
|
1
|
+
import { createCli } from './create.js';
|
|
2
|
+
export { createLoadedConfig } from './config/createLoadedConfig.js';
|
|
3
|
+
export { initAppDir } from './utils/initAppDir.js';
|
|
4
|
+
export { loadTypeScriptFile } from './config/loadConfig.js';
|
|
5
5
|
export { createCli };
|
|
6
|
-
export { run } from './run';
|
|
6
|
+
export { run } from './run.js';
|
|
7
7
|
export declare const cli: {
|
|
8
|
-
init: (options: import("./types").CLIRunOptions<import("
|
|
9
|
-
appContext: import("
|
|
8
|
+
init: (options: import("./types.js").CLIRunOptions<import("../../index.js").CLIPluginExtends<{}, {}, {}, {}, {}, {}, {}>>) => Promise<{
|
|
9
|
+
appContext: import("../../index.js").InternalContext<import("../../index.js").CLIPluginExtends<{}, {}, {}, {}, {}, {}, {}>>;
|
|
10
10
|
}>;
|
|
11
|
-
run: (options: import("./types").CLIRunOptions<import("
|
|
12
|
-
getPrevInitOptions: () => import("./types").CLIRunOptions<import("
|
|
11
|
+
run: (options: import("./types.js").CLIRunOptions<import("../../index.js").CLIPluginExtends<{}, {}, {}, {}, {}, {}, {}>>) => Promise<void>;
|
|
12
|
+
getPrevInitOptions: () => import("./types.js").CLIRunOptions<import("../../index.js").CLIPluginExtends<{}, {}, {}, {}, {}, {}, {}>>;
|
|
13
13
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CLIOptions } from './types';
|
|
1
|
+
import type { CLIOptions } from './types.js';
|
|
2
2
|
export declare const run: (options: CLIOptions) => Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CLIPluginExtends } from '../../types/cli';
|
|
2
|
-
import type { Plugin } from '../../types/plugin';
|
|
1
|
+
import type { CLIPluginExtends } from '../../types/cli/index.js';
|
|
2
|
+
import type { Plugin } from '../../types/plugin.js';
|
|
3
3
|
export interface CLIOptions<Extends extends CLIPluginExtends = {
|
|
4
4
|
config: {};
|
|
5
5
|
}> {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { InternalContext } from '../../../types';
|
|
2
|
-
import type { CLIPluginExtends } from '../../../types/cli/plugin';
|
|
1
|
+
import type { InternalContext } from '../../../types/index.js';
|
|
2
|
+
import type { CLIPluginExtends } from '../../../types/cli/plugin.js';
|
|
3
3
|
export declare const createFileWatcher: <Extends extends CLIPluginExtends>(appContext: InternalContext<Extends>) => Promise<import("@modern-js/utils").FSWatcher | undefined>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { DeepPartial } from '../../../types/utils';
|
|
1
|
+
import type { DeepPartial } from '../../../types/utils.js';
|
|
2
2
|
export declare const mergeConfig: <Config, NormalizedConfig>(configs: Array<DeepPartial<Config>>) => NormalizedConfig;
|
package/dist/types/hooks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AsyncHook, AsyncInterruptHook, AsyncPipelineHook, CollectAsyncHook, CollectSyncHook, SyncHook } from './types/hooks';
|
|
1
|
+
import type { AsyncHook, AsyncInterruptHook, AsyncPipelineHook, CollectAsyncHook, CollectSyncHook, SyncHook } from './types/hooks.js';
|
|
2
2
|
export declare function createAsyncInterruptHook<Callback extends (...args: any[]) => any>(): AsyncInterruptHook<Callback>;
|
|
3
3
|
export declare function createSyncHook<Callback extends (...args: any[]) => any>(): SyncHook<Callback>;
|
|
4
4
|
export declare function createAsyncHook<Callback extends (...args: any[]) => any>(): AsyncHook<Callback>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { createPluginManager } from './manager';
|
|
2
|
-
export { createSyncHook, createAsyncHook, createCollectSyncHook, createCollectAsyncHook, createAsyncInterruptHook, createAsyncPipelineHook, } from './hooks';
|
|
3
|
-
export type { Plugin, PluginManager, TransformFunction, } from './types/plugin';
|
|
4
|
-
export type { CLIPluginAPI, AppContext, InternalContext, Entrypoint, CLIPlugin, CLIPluginExtends, RuntimePluginConfig, ServerPluginConfig, } from './types/cli';
|
|
5
|
-
export type { RuntimePluginAPI, RuntimeContext, InternalRuntimeContext, RuntimePlugin, RuntimePluginExtends, } from './types/runtime';
|
|
6
|
-
export type { ServerPluginAPI, ServerContext, InternalServerContext, ServerPlugin, ServerPluginExtends, ResetEvent, FileChangeEvent, } from './types/server';
|
|
7
|
-
export type { SyncHook, AsyncHook, AsyncInterruptHook, CollectAsyncHook, CollectSyncHook, PluginHook, PluginHookTap, AsyncPipelineHook, } from './types/hooks';
|
|
1
|
+
export { createPluginManager } from './manager.js';
|
|
2
|
+
export { createSyncHook, createAsyncHook, createCollectSyncHook, createCollectAsyncHook, createAsyncInterruptHook, createAsyncPipelineHook, } from './hooks.js';
|
|
3
|
+
export type { Plugin, PluginManager, TransformFunction, } from './types/plugin.js';
|
|
4
|
+
export type { CLIPluginAPI, AppContext, InternalContext, Entrypoint, CLIPlugin, CLIPluginExtends, RuntimePluginConfig, ServerPluginConfig, } from './types/cli/index.js';
|
|
5
|
+
export type { RuntimePluginAPI, RuntimeContext, InternalRuntimeContext, RuntimePlugin, RuntimePluginExtends, } from './types/runtime/index.js';
|
|
6
|
+
export type { ServerPluginAPI, ServerContext, InternalServerContext, ServerPlugin, ServerPluginExtends, ResetEvent, FileChangeEvent, } from './types/server/index.js';
|
|
7
|
+
export type { SyncHook, AsyncHook, AsyncInterruptHook, CollectAsyncHook, CollectSyncHook, PluginHook, PluginHookTap, AsyncPipelineHook, } from './types/hooks.js';
|
package/dist/types/manager.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NOTE: This file will be used in both Node.js and runtime environments. Please avoid importing Node.js-specific APIs.
|
|
3
3
|
*/
|
|
4
|
-
import type { PluginManager } from './types/plugin';
|
|
4
|
+
import type { PluginManager } from './types/plugin.js';
|
|
5
5
|
export declare function createPluginManager(): PluginManager;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PluginManager } from '../types/plugin';
|
|
2
|
-
import type { RuntimePluginAPI } from '../types/runtime/api';
|
|
3
|
-
import type { InternalRuntimeContext } from '../types/runtime/context';
|
|
4
|
-
import type { RuntimePlugin, RuntimePluginExtends } from '../types/runtime/plugin';
|
|
1
|
+
import type { PluginManager } from '../types/plugin.js';
|
|
2
|
+
import type { RuntimePluginAPI } from '../types/runtime/api.js';
|
|
3
|
+
import type { InternalRuntimeContext } from '../types/runtime/context.js';
|
|
4
|
+
import type { RuntimePlugin, RuntimePluginExtends } from '../types/runtime/plugin.js';
|
|
5
5
|
export declare function initPluginAPI<Extends extends RuntimePluginExtends>({ context, plugins, }: {
|
|
6
6
|
context: InternalRuntimeContext<Extends>;
|
|
7
7
|
pluginManager: PluginManager;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { InternalRuntimeContext, RuntimeContext } from '../types/runtime/context';
|
|
2
|
-
import type { RuntimePlugin, RuntimePluginExtends } from '../types/runtime/plugin';
|
|
1
|
+
import type { InternalRuntimeContext, RuntimeContext } from '../types/runtime/context.js';
|
|
2
|
+
import type { RuntimePlugin, RuntimePluginExtends } from '../types/runtime/plugin.js';
|
|
3
3
|
export interface RuntimeConfig<Extends extends RuntimePluginExtends> {
|
|
4
4
|
plugins?: RuntimePlugin<Extends>[];
|
|
5
5
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Hooks } from '../types/runtime/hooks';
|
|
1
|
+
import type { Hooks } from '../types/runtime/hooks.js';
|
|
2
2
|
export declare function initHooks<RuntimeConfig, RuntimeContext>(): Hooks<RuntimeConfig, RuntimeContext>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { initPluginAPI } from './api';
|
|
2
|
-
export { initRuntimeContext, createRuntimeContext } from './context';
|
|
3
|
-
export { initHooks } from './hooks';
|
|
4
|
-
export { runtime } from './run';
|
|
5
|
-
export type { RuntimePluginAPI, RuntimeContext, InternalRuntimeContext, RuntimePlugin, RuntimePluginExtends, Hooks, } from '../types/runtime';
|
|
1
|
+
export { initPluginAPI } from './api.js';
|
|
2
|
+
export { initRuntimeContext, createRuntimeContext } from './context.js';
|
|
3
|
+
export { initHooks } from './hooks.js';
|
|
4
|
+
export { runtime } from './run/index.js';
|
|
5
|
+
export type { RuntimePluginAPI, RuntimeContext, InternalRuntimeContext, RuntimePlugin, RuntimePluginExtends, Hooks, } from '../types/runtime/index.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { RuntimePluginExtends } from '../../types/runtime/plugin';
|
|
2
|
-
import type { RuntimeRunOptions } from './types';
|
|
1
|
+
import type { RuntimePluginExtends } from '../../types/runtime/plugin.js';
|
|
2
|
+
import type { RuntimeRunOptions } from './types.js';
|
|
3
3
|
export declare const createRuntime: <Extends extends RuntimePluginExtends>() => {
|
|
4
4
|
run: (options: RuntimeRunOptions) => {
|
|
5
|
-
runtimeContext: import("
|
|
5
|
+
runtimeContext: import("../index.js").InternalRuntimeContext<Extends>;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const runtime: {
|
|
2
|
-
run: (options: import("./types").RuntimeRunOptions) => {
|
|
3
|
-
runtimeContext: import("
|
|
2
|
+
run: (options: import("./types.js").RuntimeRunOptions) => {
|
|
3
|
+
runtimeContext: import("../index.js").InternalRuntimeContext<import("../index.js").RuntimePluginExtends<{}, {}, {}, {}>>;
|
|
4
4
|
};
|
|
5
5
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PluginManager } from '../types/plugin';
|
|
2
|
-
import type { ServerPluginAPI } from '../types/server/api';
|
|
3
|
-
import type { InternalServerContext } from '../types/server/context';
|
|
4
|
-
import type { ServerPluginExtends } from '../types/server/plugin';
|
|
1
|
+
import type { PluginManager } from '../types/plugin.js';
|
|
2
|
+
import type { ServerPluginAPI } from '../types/server/api.js';
|
|
3
|
+
import type { InternalServerContext } from '../types/server/context.js';
|
|
4
|
+
import type { ServerPluginExtends } from '../types/server/plugin.js';
|
|
5
5
|
export declare const debug: import("@modern-js/utils/compiled/debug").Debugger;
|
|
6
6
|
export declare function initPluginAPI<Extends extends ServerPluginExtends>({ context, pluginManager, }: {
|
|
7
7
|
context: InternalServerContext<Extends>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { InternalServerContext, ServerContext } from '../types/server/context';
|
|
2
|
-
import type { ServerPlugin, ServerPluginExtends } from '../types/server/plugin';
|
|
3
|
-
import type { ServerCreateOptions } from './run/types';
|
|
1
|
+
import type { InternalServerContext, ServerContext } from '../types/server/context.js';
|
|
2
|
+
import type { ServerPlugin, ServerPluginExtends } from '../types/server/plugin.js';
|
|
3
|
+
import type { ServerCreateOptions } from './run/types.js';
|
|
4
4
|
interface ContextParams<Extends extends ServerPluginExtends> {
|
|
5
5
|
serverContext: ServerContext<Extends>;
|
|
6
6
|
config: Extends['config'];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ModifyConfigFn, OnPrepareFn, OnResetFn } from '../types/server/hooks';
|
|
2
|
-
import type { DeepPartial } from '../types/utils';
|
|
1
|
+
import type { ModifyConfigFn, OnPrepareFn, OnResetFn } from '../types/server/hooks.js';
|
|
2
|
+
import type { DeepPartial } from '../types/utils.js';
|
|
3
3
|
export type { OnResetFn, OnPrepareFn, ModifyConfigFn };
|
|
4
4
|
export declare function initHooks<Config>(): {
|
|
5
|
-
modifyConfig: import("
|
|
6
|
-
onPrepare: import("
|
|
7
|
-
onReset: import("
|
|
5
|
+
modifyConfig: import("../index.js").AsyncHook<ModifyConfigFn<DeepPartial<Config>>>;
|
|
6
|
+
onPrepare: import("../index.js").AsyncHook<OnPrepareFn>;
|
|
7
|
+
onReset: import("../index.js").AsyncHook<OnResetFn>;
|
|
8
8
|
};
|
|
9
9
|
export type Hooks<Config> = ReturnType<typeof initHooks<Config>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { initPluginAPI } from './api';
|
|
2
|
-
export { initServerContext, createServerContext } from './context';
|
|
3
|
-
export { initHooks, type Hooks, type OnPrepareFn, type ModifyConfigFn, type OnResetFn, } from './hooks';
|
|
4
|
-
export { server, createServer, type ServerCreateOptions } from './run';
|
|
1
|
+
export { initPluginAPI } from './api.js';
|
|
2
|
+
export { initServerContext, createServerContext } from './context.js';
|
|
3
|
+
export { initHooks, type Hooks, type OnPrepareFn, type ModifyConfigFn, type OnResetFn, } from './hooks.js';
|
|
4
|
+
export { server, createServer, type ServerCreateOptions } from './run/index.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ServerPluginExtends } from '../../types/server/plugin';
|
|
2
|
-
import type { ServerRunOptions } from './types';
|
|
1
|
+
import type { ServerPluginExtends } from '../../types/server/plugin.js';
|
|
2
|
+
import type { ServerRunOptions } from './types.js';
|
|
3
3
|
export declare const createServer: <Extends extends ServerPluginExtends>() => {
|
|
4
4
|
run: (options: ServerRunOptions) => Promise<{
|
|
5
|
-
serverContext: import("
|
|
5
|
+
serverContext: import("../../index.js").InternalServerContext<Extends>;
|
|
6
6
|
}>;
|
|
7
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createServer } from './create';
|
|
1
|
+
import { createServer } from './create.js';
|
|
2
2
|
export declare const server: {
|
|
3
|
-
run: (options: import("./types").ServerRunOptions) => Promise<{
|
|
4
|
-
serverContext: import("
|
|
3
|
+
run: (options: import("./types.js").ServerRunOptions) => Promise<{
|
|
4
|
+
serverContext: import("../../index.js").InternalServerContext<import("../../index.js").ServerPluginExtends<{}, {}, {}, {}>>;
|
|
5
5
|
}>;
|
|
6
6
|
};
|
|
7
7
|
export { createServer };
|
|
8
|
-
export type { ServerCreateOptions } from './types';
|
|
8
|
+
export type { ServerCreateOptions } from './types.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ServerRoute } from '@modern-js/types';
|
|
2
|
-
import type { Plugin } from '../../types/plugin';
|
|
2
|
+
import type { Plugin } from '../../types/plugin.js';
|
|
3
3
|
export type ServerCreateOptions = {
|
|
4
4
|
/** server working directory, and then also dist directory */
|
|
5
5
|
pwd: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { OnAfterBuildFn, OnAfterCreateCompilerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnDevCompileDoneFn } from '@rsbuild/core';
|
|
2
|
-
import type { Hooks } from '../../cli/hooks';
|
|
3
|
-
import type { PluginHook, PluginHookTap } from '../hooks';
|
|
4
|
-
import type { DeepPartial } from '../utils';
|
|
5
|
-
import type { AppContext } from './context';
|
|
6
|
-
import type { AddCommandFn, AddWatchFilesFn, ConfigFn, InternalRuntimePluginsFn, InternalServerPluginsFn, ModifyBundlerChainFn, ModifyConfigFn, ModifyHtmlPartialsFn, ModifyResolvedConfigFn, ModifyRsbuildConfigFn, ModifyRspackConfigFn, ModifyServerRoutesFn, OnAfterDeployFn, OnAfterDevFn, OnBeforeDeployFn, OnBeforeDevFn, OnBeforeExitFn, OnBeforeRestartFn, OnFileChangedFn, OnPrepareFn } from './hooks';
|
|
7
|
-
import type { CLIPluginExtends } from './plugin';
|
|
2
|
+
import type { Hooks } from '../../cli/hooks.js';
|
|
3
|
+
import type { PluginHook, PluginHookTap } from '../hooks.js';
|
|
4
|
+
import type { DeepPartial } from '../utils.js';
|
|
5
|
+
import type { AppContext } from './context.js';
|
|
6
|
+
import type { AddCommandFn, AddWatchFilesFn, ConfigFn, InternalRuntimePluginsFn, InternalServerPluginsFn, ModifyBundlerChainFn, ModifyConfigFn, ModifyHtmlPartialsFn, ModifyResolvedConfigFn, ModifyRsbuildConfigFn, ModifyRspackConfigFn, ModifyServerRoutesFn, OnAfterDeployFn, OnAfterDevFn, OnBeforeDeployFn, OnBeforeDevFn, OnBeforeExitFn, OnBeforeRestartFn, OnFileChangedFn, OnPrepareFn } from './hooks.js';
|
|
7
|
+
import type { CLIPluginExtends } from './plugin.js';
|
|
8
8
|
/**
|
|
9
9
|
* Define a generic CLI plugin API that provider can extend as needed.
|
|
10
10
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { BuilderInstance } from '@modern-js/builder';
|
|
2
2
|
import type { ServerRoute } from '@modern-js/types';
|
|
3
|
-
import type { Hooks } from '../../cli/hooks';
|
|
4
|
-
import type { CLIPluginAPI } from './api';
|
|
5
|
-
import type { CLIPlugin, CLIPluginExtends } from './plugin';
|
|
3
|
+
import type { Hooks } from '../../cli/hooks.js';
|
|
4
|
+
import type { CLIPluginAPI } from './api.js';
|
|
5
|
+
import type { CLIPlugin, CLIPluginExtends } from './plugin.js';
|
|
6
6
|
export interface Entrypoint {
|
|
7
7
|
isMainEntry?: boolean;
|
|
8
8
|
entryName: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ServerPlugin as ServerPluginConfig, ServerRoute } from '@modern-js/types';
|
|
2
2
|
import type { Command } from '@modern-js/utils/commander';
|
|
3
3
|
import type { ModifyBundlerChainUtils, ModifyRspackConfigUtils, RsbuildConfig, Rspack, RspackChain } from '@rsbuild/core';
|
|
4
|
-
import type { TransformFunction } from '../plugin';
|
|
5
|
-
import type { MaybePromise } from '../utils';
|
|
6
|
-
import type { Entrypoint } from './context';
|
|
4
|
+
import type { TransformFunction } from '../plugin.js';
|
|
5
|
+
import type { MaybePromise } from '../utils.js';
|
|
6
|
+
import type { Entrypoint } from './context.js';
|
|
7
7
|
declare module '@modern-js/utils/commander' {
|
|
8
8
|
interface Command {
|
|
9
9
|
commandsMap: Map<string, Command>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { CLIPluginAPI } from './api';
|
|
2
|
-
export type { AppContext, InternalContext, Entrypoint } from './context';
|
|
3
|
-
export type { CLIPlugin, CLIPluginExtends } from './plugin';
|
|
4
|
-
export type { RuntimePluginConfig, ServerPluginConfig } from './hooks';
|
|
1
|
+
export type { CLIPluginAPI } from './api.js';
|
|
2
|
+
export type { AppContext, InternalContext, Entrypoint } from './context.js';
|
|
3
|
+
export type { CLIPlugin, CLIPluginExtends } from './plugin.js';
|
|
4
|
+
export type { RuntimePluginConfig, ServerPluginConfig } from './hooks.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PluginHook } from '../hooks';
|
|
2
|
-
import type { Plugin } from '../plugin';
|
|
3
|
-
import type { CLIPluginAPI } from './api';
|
|
4
|
-
import type { AppContext } from './context';
|
|
1
|
+
import type { PluginHook } from '../hooks.js';
|
|
2
|
+
import type { Plugin } from '../plugin.js';
|
|
3
|
+
import type { CLIPluginAPI } from './api.js';
|
|
4
|
+
import type { AppContext } from './context.js';
|
|
5
5
|
export interface CLIPluginExtends<Config extends Record<string, any> = {}, NormalizedConfig extends Record<string, any> = {}, ExtendContext extends Record<string, any> = {}, ExtendAPI extends Record<string, any> = {}, ExtendHook extends Record<string, PluginHook<(...args: any[]) => any>> = {}, ExtendBuildUtils extends Record<string, any> = {}, ExtendConfigUtils extends Record<string, any> = {}> {
|
|
6
6
|
config?: Config;
|
|
7
7
|
normalizedConfig?: NormalizedConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Tail, UnwrapPromise } from './utils';
|
|
1
|
+
import type { Tail, UnwrapPromise } from './utils.js';
|
|
2
2
|
export type SyncHook<Callback extends (...args: any[]) => any> = {
|
|
3
3
|
tap: (cb: Callback) => void;
|
|
4
4
|
call: (...args: Parameters<Callback>) => ReturnType<Callback>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Plugin, PluginManager, TransformFunction, } from './plugin';
|
|
2
|
-
export type { CLIPluginAPI, AppContext, InternalContext, Entrypoint, CLIPlugin, } from './cli';
|
|
3
|
-
export type { RuntimePluginAPI, RuntimeContext, InternalRuntimeContext, RuntimePlugin, } from './runtime';
|
|
4
|
-
export type { AsyncHook, CollectAsyncHook, PluginHook, PluginHookTap, } from './hooks';
|
|
1
|
+
export type { Plugin, PluginManager, TransformFunction, } from './plugin.js';
|
|
2
|
+
export type { CLIPluginAPI, AppContext, InternalContext, Entrypoint, CLIPlugin, } from './cli/index.js';
|
|
3
|
+
export type { RuntimePluginAPI, RuntimeContext, InternalRuntimeContext, RuntimePlugin, } from './runtime/index.js';
|
|
4
|
+
export type { AsyncHook, CollectAsyncHook, PluginHook, PluginHookTap, } from './hooks.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { PluginHook } from './hooks';
|
|
2
|
-
import type { Falsy } from './utils';
|
|
3
|
-
import type { MaybePromise } from './utils';
|
|
1
|
+
import type { PluginHook } from './hooks.js';
|
|
2
|
+
import type { Falsy } from './utils.js';
|
|
3
|
+
import type { MaybePromise } from './utils.js';
|
|
4
4
|
export type TransformFunction<T> = (arg: T) => T | Promise<T>;
|
|
5
5
|
export type Plugin<PluginAPI = {}, Context = {}> = {
|
|
6
6
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { PluginHook, PluginHookTap } from '../hooks';
|
|
2
|
-
import type { DeepPartial } from '../utils';
|
|
3
|
-
import type { RuntimeContext } from './context';
|
|
4
|
-
import type { Hooks } from './hooks';
|
|
5
|
-
import type { ConfigFn, ExtendStreamSSRFn, ExtendStringSSRCollectorsFn, OnBeforeRenderFn, PickContextFn, StringSSRCollectorsInfo, WrapRootFn } from './hooks';
|
|
6
|
-
import type { RuntimePluginExtends } from './plugin';
|
|
1
|
+
import type { PluginHook, PluginHookTap } from '../hooks.js';
|
|
2
|
+
import type { DeepPartial } from '../utils.js';
|
|
3
|
+
import type { RuntimeContext } from './context.js';
|
|
4
|
+
import type { Hooks } from './hooks.js';
|
|
5
|
+
import type { ConfigFn, ExtendStreamSSRFn, ExtendStringSSRCollectorsFn, OnBeforeRenderFn, PickContextFn, StringSSRCollectorsInfo, WrapRootFn } from './hooks.js';
|
|
6
|
+
import type { RuntimePluginExtends } from './plugin.js';
|
|
7
7
|
export type RuntimePluginAPI<Extends extends RuntimePluginExtends> = Readonly<{
|
|
8
8
|
updateRuntimeContext: (updateContext: DeepPartial<RuntimeContext>) => void;
|
|
9
9
|
getHooks: () => Readonly<Hooks<Extends['config'], RuntimeContext & Extends['extendContext']> & Extends['extendHooks']>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { RuntimePluginAPI } from './api';
|
|
2
|
-
import type { Hooks } from './hooks';
|
|
3
|
-
import type { RuntimePluginExtends } from './plugin';
|
|
1
|
+
import type { RuntimePluginAPI } from './api.js';
|
|
2
|
+
import type { Hooks } from './hooks.js';
|
|
3
|
+
import type { RuntimePluginExtends } from './plugin.js';
|
|
4
4
|
export type RuntimeContext = {};
|
|
5
5
|
export type InternalRuntimeContext<Extends extends RuntimePluginExtends> = RuntimeContext & {
|
|
6
6
|
/** All hooks. */
|
|
@@ -10,7 +10,7 @@ export type Collector = {
|
|
|
10
10
|
effect: () => void | Promise<void>;
|
|
11
11
|
};
|
|
12
12
|
import type React from 'react';
|
|
13
|
-
import type { AsyncInterruptHook, CollectSyncHook, SyncHook } from '../hooks';
|
|
13
|
+
import type { AsyncInterruptHook, CollectSyncHook, SyncHook } from '../hooks.js';
|
|
14
14
|
export type OnBeforeRenderFn<RuntimeContext> = (context: RuntimeContext, interrupt: (info: any) => any) => Promise<any> | any;
|
|
15
15
|
export type ExtendStringSSRCollectorsFn<RuntimeContext> = (context: RuntimeContext) => Collector;
|
|
16
16
|
export type StringSSRCollectorsInfo = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { RuntimePluginAPI } from './api';
|
|
2
|
-
export type { RuntimeContext, InternalRuntimeContext } from './context';
|
|
3
|
-
export type { RuntimePlugin, RuntimePluginExtends } from './plugin';
|
|
4
|
-
export type { Hooks } from './hooks';
|
|
1
|
+
export type { RuntimePluginAPI } from './api.js';
|
|
2
|
+
export type { RuntimeContext, InternalRuntimeContext } from './context.js';
|
|
3
|
+
export type { RuntimePlugin, RuntimePluginExtends } from './plugin.js';
|
|
4
|
+
export type { Hooks } from './hooks.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PluginHook } from '../hooks';
|
|
2
|
-
import type { Plugin } from '../plugin';
|
|
3
|
-
import type { RuntimePluginAPI } from './api';
|
|
4
|
-
import type { RuntimeContext } from './context';
|
|
1
|
+
import type { PluginHook } from '../hooks.js';
|
|
2
|
+
import type { Plugin } from '../plugin.js';
|
|
3
|
+
import type { RuntimePluginAPI } from './api.js';
|
|
4
|
+
import type { RuntimeContext } from './context.js';
|
|
5
5
|
export interface RuntimePluginExtends<Config extends Record<string, any> = {}, ExtendContext extends Record<string, any> = {}, ExtendAPI extends Record<string, any> = {}, ExtendHook extends Record<string, PluginHook<(...args: any[]) => any>> = {}> {
|
|
6
6
|
config?: Config;
|
|
7
7
|
extendContext?: ExtendContext;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { PluginHook, PluginHookTap } from '../hooks';
|
|
2
|
-
import type { DeepPartial } from '../utils';
|
|
3
|
-
import type { ServerContext } from './context';
|
|
4
|
-
import type { Hooks, ModifyConfigFn, OnPrepareFn, OnResetFn } from './hooks';
|
|
5
|
-
import type { ServerPluginExtends } from './plugin';
|
|
1
|
+
import type { PluginHook, PluginHookTap } from '../hooks.js';
|
|
2
|
+
import type { DeepPartial } from '../utils.js';
|
|
3
|
+
import type { ServerContext } from './context.js';
|
|
4
|
+
import type { Hooks, ModifyConfigFn, OnPrepareFn, OnResetFn } from './hooks.js';
|
|
5
|
+
import type { ServerPluginExtends } from './plugin.js';
|
|
6
6
|
export type ServerPluginAPI<Extends extends ServerPluginExtends> = Readonly<{
|
|
7
7
|
getServerContext: () => Readonly<ServerContext<Extends> & Extends['extendContext']>;
|
|
8
8
|
updateServerContext: (updateContext: DeepPartial<ServerContext<Extends> & Extends['extendContext']>) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ServerRoute } from '@modern-js/types';
|
|
2
|
-
import type { ServerPluginAPI } from './api';
|
|
3
|
-
import type { Hooks } from './hooks';
|
|
4
|
-
import type { ServerPlugin, ServerPluginExtends } from './plugin';
|
|
2
|
+
import type { ServerPluginAPI } from './api.js';
|
|
3
|
+
import type { Hooks } from './hooks.js';
|
|
4
|
+
import type { ServerPlugin, ServerPluginExtends } from './plugin.js';
|
|
5
5
|
export interface Middleware {
|
|
6
6
|
name: string;
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AsyncHook } from '../hooks';
|
|
1
|
+
import type { AsyncHook } from '../hooks.js';
|
|
2
2
|
export type ModifyConfigFn<ServerConfig> = (arg: ServerConfig) => ServerConfig | Promise<ServerConfig>;
|
|
3
3
|
export type OnPrepareFn = () => Promise<void> | void;
|
|
4
4
|
export type ChangeEvent = 'add' | 'change' | 'unlink';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { ServerPluginAPI } from './api';
|
|
2
|
-
export type { ServerContext, InternalServerContext } from './context';
|
|
3
|
-
export type { ServerPlugin, ServerPluginExtends } from './plugin';
|
|
4
|
-
export type { Hooks, FileChangeEvent, ResetEvent } from './hooks';
|
|
1
|
+
export type { ServerPluginAPI } from './api.js';
|
|
2
|
+
export type { ServerContext, InternalServerContext } from './context.js';
|
|
3
|
+
export type { ServerPlugin, ServerPluginExtends } from './plugin.js';
|
|
4
|
+
export type { Hooks, FileChangeEvent, ResetEvent } from './hooks.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PluginHook } from '../hooks';
|
|
2
|
-
import type { Plugin } from '../plugin';
|
|
3
|
-
import type { ServerPluginAPI } from './api';
|
|
4
|
-
import type { ServerContext } from './context';
|
|
1
|
+
import type { PluginHook } from '../hooks.js';
|
|
2
|
+
import type { Plugin } from '../plugin.js';
|
|
3
|
+
import type { ServerPluginAPI } from './api.js';
|
|
4
|
+
import type { ServerContext } from './context.js';
|
|
5
5
|
export interface ServerPluginExtends<Config extends Record<string, any> = {}, ExtendContext extends Record<string, any> = {}, ExtendAPI extends Record<string, any> = {}, ExtendHook extends Record<string, PluginHook<(...args: any[]) => any>> = {}> {
|
|
6
6
|
config?: Config;
|
|
7
7
|
extendContext?: ExtendContext;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.
|
|
18
|
+
"version": "3.9.1",
|
|
19
19
|
"types": "./dist/types/index.d.ts",
|
|
20
20
|
"main": "./dist/cjs/index.js",
|
|
21
21
|
"exports": {
|
|
@@ -82,19 +82,19 @@
|
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@rsbuild/core": "2.2.
|
|
85
|
+
"@rsbuild/core": "2.2.4",
|
|
86
86
|
"@swc/helpers": "^0.5.17",
|
|
87
87
|
"jiti": "^2.6.1",
|
|
88
|
-
"@modern-js/runtime-utils": "3.
|
|
89
|
-
"@modern-js/types": "3.
|
|
90
|
-
"@modern-js/utils": "3.
|
|
88
|
+
"@modern-js/runtime-utils": "3.9.1",
|
|
89
|
+
"@modern-js/types": "3.9.1",
|
|
90
|
+
"@modern-js/utils": "3.9.1"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@rslib/core": "0.
|
|
93
|
+
"@rslib/core": "1.0.0",
|
|
94
94
|
"@types/node": "^20",
|
|
95
95
|
"@types/react": "^19.2.17",
|
|
96
96
|
"typescript": "^5",
|
|
97
|
-
"@modern-js/builder": "3.
|
|
97
|
+
"@modern-js/builder": "3.9.1",
|
|
98
98
|
"@modern-js/rslib": "2.68.10"
|
|
99
99
|
},
|
|
100
100
|
"sideEffects": false,
|