Skip to content

Commit

Permalink
feat: add rsdoctor native plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
LingyuCoder committed Jan 8, 2025
1 parent 32c63a8 commit 8454d2a
Showing 1 changed file with 130 additions and 1 deletion.
131 changes: 130 additions & 1 deletion crates/node_binding/binding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ export declare enum BuiltinPluginName {
LightningCssMinimizerRspackPlugin = 'LightningCssMinimizerRspackPlugin',
BundlerInfoRspackPlugin = 'BundlerInfoRspackPlugin',
CssExtractRspackPlugin = 'CssExtractRspackPlugin',
RsdoctorRspackPlugin = 'RsdoctorRspackPlugin',
JsLoaderRspackPlugin = 'JsLoaderRspackPlugin',
LazyCompilationPlugin = 'LazyCompilationPlugin'
}
Expand Down Expand Up @@ -809,6 +810,122 @@ export interface JsResourceData {
fragment?: string
}

export interface JsRsdoctorAsset {
ukey: number
path: string
chunks: Array<number>
}

export interface JsRsdoctorChunk {
ukey: number
name: string
initial: boolean
entry: boolean
assets: Array<number>
dependencies: Array<number>
imported: Array<number>
}

export interface JsRsdoctorChunkGraph {
chunks: Array<JsRsdoctorChunk>
entrypoints: Array<JsRsdoctorEntrypoint>
}

export interface JsRsdoctorDependency {
ukey: number
kind: string
request: string
module: number
dependency: number
}

export interface JsRsdoctorEntrypoint {
ukey: number
name: string
chunks: Array<number>
}

export interface JsRsdoctorExportInfo {
ukey: number
name: string
from?: number
variable?: number
identifier?: JsRsdoctorStatement
sideEffects: Array<number>
}

export interface JsRsdoctorModule {
ukey: number
identifier: string
path: string
isEntry: boolean
kind: string
layer?: string
dependencies: Array<number>
imported: Array<number>
modules: Array<number>
chunks: Array<number>
}

export interface JsRsdoctorModuleGraph {
modules: Array<JsRsdoctorModule>
dependencies: Array<JsRsdoctorDependency>
}

export interface JsRsdoctorModuleGraphModule {
ukey: number
module: number
exports: Array<number>
sideEffects: Array<number>
variables: Array<number>
dynamic: boolean
}

export interface JsRsdoctorModuleSource {
sourceSize: number
transformSize: number
source?: string
sourceMap?: string
}

export interface JsRsdoctorSideEffect {
ukey: number
name: string
originName?: string
module: number
identifier: JsRsdoctorStatement
isNameSpace: boolean
fromDependency?: number
exports: Array<number>
variable?: number
}

export interface JsRsdoctorSourcePosition {
line?: number
column?: number
index?: number
}

export interface JsRsdoctorSourceRange {
start: JsRsdoctorSourcePosition
end?: JsRsdoctorSourcePosition
}

export interface JsRsdoctorStatement {
module: number
sourcePosition?: JsRsdoctorSourceRange
transformedPosition: JsRsdoctorSourceRange
}

export interface JsRsdoctorVariable {
ukey: number
name: string
module: number
usedInfo: string
identififer: JsRsdoctorStatement
exported?: number
}

export interface JsRspackDiagnostic {
severity: JsRspackSeverity
error: JsRspackError
Expand Down Expand Up @@ -1917,6 +2034,10 @@ export interface RawResolveTsconfigOptions {
references?: Array<string>
}

export interface RawRsdoctorPluginOptions {

}

export interface RawRspackFuture {

}
Expand Down Expand Up @@ -2086,7 +2207,11 @@ export declare enum RegisterJsTapKind {
HtmlPluginAlterAssetTagGroups = 37,
HtmlPluginAfterTemplateExecution = 38,
HtmlPluginBeforeEmit = 39,
HtmlPluginAfterEmit = 40
HtmlPluginAfterEmit = 40,
RsdoctorPluginModuleGraph = 41,
RsdoctorPluginChunkGraph = 42,
RsdoctorPluginModuleSources = 43,
RsdoctorPluginAssets = 44
}

export interface RegisterJsTaps {
Expand Down Expand Up @@ -2131,6 +2256,10 @@ export interface RegisterJsTaps {
registerHtmlPluginAfterTemplateExecutionTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAfterTemplateExecutionData) => JsAfterTemplateExecutionData); stage: number; }>
registerHtmlPluginBeforeEmitTaps: (stages: Array<number>) => Array<{ function: ((arg: JsBeforeEmitData) => JsBeforeEmitData); stage: number; }>
registerHtmlPluginAfterEmitTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAfterEmitData) => JsAfterEmitData); stage: number; }>
registerRsdoctorPluginModuleGraphTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorModuleGraph) => Promise<boolean | undefined>); stage: number; }>
registerRsdoctorPluginChunkGraphTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorChunkGraph) => Promise<boolean | undefined>); stage: number; }>
registerRsdoctorPluginModuleSourcesTaps: (stages: Array<number>) => Array<{ function: ((arg: Vec<JsRsdoctorModuleSource>) => Promise<boolean | undefined>); stage: number; }>
registerRsdoctorPluginAssetsTaps: (stages: Array<number>) => Array<{ function: ((arg: Vec<JsRsdoctorAsset>) => Promise<boolean | undefined>); stage: number; }>
}

export interface ThreadsafeNodeFS {
Expand Down

0 comments on commit 8454d2a

Please sign in to comment.