avancement planning

This commit is contained in:
2026-05-26 11:58:39 +02:00
parent 619a2b240a
commit 150b97cd2e
4892 changed files with 99214 additions and 429382 deletions
+48 -8
View File
@@ -125,6 +125,7 @@ export interface SourceDescription extends Partial<PartialNull<ModuleOptions>> {
export interface TransformModuleJSON {
ast?: ProgramNode | undefined;
code: string;
safeVariableNames: Record<string, string> | null;
// note if plugins use new this.cache to opt-out auto transform cache
customTransformCache: boolean;
originalCode: string;
@@ -134,6 +135,7 @@ export interface TransformModuleJSON {
}
export interface ModuleJSON extends TransformModuleJSON, ModuleOptions {
safeVariableNames: Record<string, string> | null;
ast: ProgramNode;
dependencies: string[];
id: string;
@@ -198,6 +200,7 @@ export interface ModuleInfo extends ModuleOptions {
dynamicallyImportedIds: readonly string[];
exportedBindings: Record<string, string[]> | null;
exports: string[] | null;
safeVariableNames: Record<string, string> | null;
hasDefaultExport: boolean | null;
id: string;
implicitlyLoadedAfterOneOf: readonly string[];
@@ -258,6 +261,7 @@ export interface PluginContext extends MinimalPluginContext {
source: string,
importer?: string,
options?: {
importerAttributes?: Record<string, string>;
attributes?: Record<string, string>;
custom?: CustomPluginOptions;
isEntry?: boolean;
@@ -309,13 +313,19 @@ export type ResolveIdHook = (
this: PluginContext,
source: string,
importer: string | undefined,
options: { attributes: Record<string, string>; custom?: CustomPluginOptions; isEntry: boolean }
options: {
attributes: Record<string, string>;
custom?: CustomPluginOptions;
importerAttributes?: Record<string, string> | undefined;
isEntry: boolean;
}
) => ResolveIdResult;
export type ShouldTransformCachedModuleHook = (
this: PluginContext,
options: {
ast: ProgramNode;
attributes: Record<string, string>;
code: string;
id: string;
meta: CustomPluginOptions;
@@ -335,7 +345,19 @@ export type HasModuleSideEffects = (id: string, external: boolean) => boolean;
export type LoadResult = SourceDescription | string | NullValue;
export type LoadHook = (this: PluginContext, id: string) => LoadResult;
export type LoadHook = (
this: PluginContext,
id: string,
// temporarily marked as optional for better Vite type-compatibility
options?:
| {
// unused, temporarily added for better Vite type-compatibility
ssr?: boolean | undefined;
// temporarily marked as optional for better Vite type-compatibility
attributes?: Record<string, string>;
}
| undefined
) => LoadResult;
export interface TransformPluginContext extends PluginContext {
debug: LoggingFunctionWithPosition;
@@ -350,7 +372,16 @@ export type TransformResult = string | NullValue | Partial<SourceDescription>;
export type TransformHook = (
this: TransformPluginContext,
code: string,
id: string
id: string,
// temporarily marked as optional for better Vite type-compatibility
options?:
| {
// unused, temporarily added for better Vite type-compatibility
ssr?: boolean | undefined;
// temporarily marked as optional for better Vite type-compatibility
attributes?: Record<string, string>;
}
| undefined
) => TransformResult;
export type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => void;
@@ -367,18 +398,24 @@ export type ResolveDynamicImportHook = (
this: PluginContext,
specifier: string | AstNode,
importer: string,
options: { attributes: Record<string, string> }
options: { attributes: Record<string, string>; importerAttributes: Record<string, string> }
) => ResolveIdResult;
export type ResolveImportMetaHook = (
this: PluginContext,
property: string | null,
options: { chunkId: string; format: InternalModuleFormat; moduleId: string }
options: {
attributes: Record<string, string>;
chunkId: string;
format: InternalModuleFormat;
moduleId: string;
}
) => string | NullValue;
export type ResolveFileUrlHook = (
this: PluginContext,
options: {
attributes: Record<string, string>;
chunkId: string;
fileName: string;
format: InternalModuleFormat;
@@ -460,6 +497,7 @@ export interface FunctionPluginHooks {
chunk: PreRenderedChunkWithFileName;
targetChunk: PreRenderedChunkWithFileName | null;
getTargetChunkImports: () => DynamicImportTargetChunk[] | null;
targetModuleAttributes: Record<string, string>;
}
) => { left: string; right: string } | NullValue;
renderError: (this: PluginContext, error?: Error) => void;
@@ -559,7 +597,8 @@ export type PluginHooks = {
};
export interface OutputPlugin
extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>,
extends
Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>,
Partial<Record<AddonHooks, ObjectHook<AddonHook>>> {
cacheKey?: string | undefined;
name: string;
@@ -615,8 +654,9 @@ export interface NormalizedTreeshakingOptions {
unknownGlobalSideEffects: boolean;
}
export interface TreeshakingOptions
extends Partial<Omit<NormalizedTreeshakingOptions, 'moduleSideEffects'>> {
export interface TreeshakingOptions extends Partial<
Omit<NormalizedTreeshakingOptions, 'moduleSideEffects'>
> {
moduleSideEffects?: ModuleSideEffectsOption | undefined;
preset?: TreeshakingPreset | undefined;
}