Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import { RspackBuiltinPlugin } from "../builtin-plugin/base";
import type { Compiler } from "../Compiler";
export type ConsumeSharedPluginOptions = {
consumes: Consumes;
shareScope?: string;
enhanced?: boolean;
};
export type Consumes = (ConsumesItem | ConsumesObject)[] | ConsumesObject;
export type ConsumesItem = string;
export type ConsumesObject = {
[k: string]: ConsumesConfig | ConsumesItem;
};
export type ConsumesConfig = {
eager?: boolean;
import?: false | ConsumesItem;
packageName?: string;
requiredVersion?: false | string;
shareKey?: string;
shareScope?: string;
singleton?: boolean;
strictVersion?: boolean;
};
export declare class ConsumeSharedPlugin extends RspackBuiltinPlugin {
name: BuiltinPluginName;
_options: {
consumes: [string, {
import: string | undefined;
shareScope: string;
shareKey: string;
requiredVersion: string | false | undefined;
strictVersion: boolean;
packageName: string | undefined;
singleton: boolean;
eager: boolean;
}][];
enhanced: boolean;
};
constructor(options: ConsumeSharedPluginOptions);
raw(compiler: Compiler): BuiltinPlugin;
}

View File

@@ -0,0 +1,34 @@
import { type BuiltinPlugin, BuiltinPluginName, type RawProvideOptions } from "@rspack/binding";
import { RspackBuiltinPlugin } from "../builtin-plugin/base";
import type { Compiler } from "../Compiler";
export type ProvideSharedPluginOptions<Enhanced extends boolean = false> = {
provides: Provides<Enhanced>;
shareScope?: string;
enhanced?: Enhanced;
};
export type Provides<Enhanced extends boolean> = (ProvidesItem | ProvidesObject<Enhanced>)[] | ProvidesObject<Enhanced>;
export type ProvidesItem = string;
export type ProvidesObject<Enhanced extends boolean> = {
[k: string]: ProvidesConfig<Enhanced> | ProvidesItem;
};
export type ProvidesConfig<Enhanced extends boolean> = Enhanced extends true ? ProvidesEnhancedConfig : ProvidesV1Config;
type ProvidesV1Config = {
eager?: boolean;
shareKey: string;
shareScope?: string;
version?: false | string;
};
type ProvidesEnhancedConfig = ProvidesV1Config & ProvidesEnhancedExtraConfig;
type ProvidesEnhancedExtraConfig = {
singleton?: boolean;
strictVersion?: boolean;
requiredVersion?: false | string;
};
export declare class ProvideSharedPlugin<Enhanced extends boolean = false> extends RspackBuiltinPlugin {
name: BuiltinPluginName;
_provides: [string, Omit<RawProvideOptions, "key">][];
_enhanced?: Enhanced;
constructor(options: ProvideSharedPluginOptions<Enhanced>);
raw(compiler: Compiler): BuiltinPlugin;
}
export {};

View File

@@ -0,0 +1,51 @@
import type { Compiler } from "../Compiler";
export type SharePluginOptions = {
shareScope?: string;
shared: Shared;
enhanced: boolean;
};
export type Shared = (SharedItem | SharedObject)[] | SharedObject;
export type SharedItem = string;
export type SharedObject = {
[k: string]: SharedConfig | SharedItem;
};
export type SharedConfig = {
eager?: boolean;
import?: false | SharedItem;
packageName?: string;
requiredVersion?: false | string;
shareKey?: string;
shareScope?: string;
singleton?: boolean;
strictVersion?: boolean;
version?: false | string;
};
export declare class SharePlugin {
_shareScope: string | undefined;
_consumes: {
[x: string]: {
import: string | false | undefined;
shareKey: string;
shareScope: string | undefined;
requiredVersion: string | false | undefined;
strictVersion: boolean | undefined;
singleton: boolean | undefined;
packageName: string | undefined;
eager: boolean | undefined;
};
}[];
_provides: {
[x: string]: {
shareKey: string;
shareScope: string | undefined;
version: string | false | undefined;
eager: boolean | undefined;
singleton: boolean | undefined;
requiredVersion: string | false | undefined;
strictVersion: boolean | undefined;
};
}[];
_enhanced: boolean;
constructor(options: SharePluginOptions);
apply(compiler: Compiler): void;
}

View File

@@ -0,0 +1,9 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import { RspackBuiltinPlugin } from "../builtin-plugin/base";
import type { Compiler } from "../Compiler";
export declare class ShareRuntimePlugin extends RspackBuiltinPlugin {
private enhanced;
name: BuiltinPluginName;
constructor(enhanced?: boolean);
raw(compiler: Compiler): BuiltinPlugin | undefined;
}

1
node_modules/@rspack/core/dist/sharing/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function isRequiredVersion(str: string): boolean;