Skip to content

Commit

Permalink
refactor: naming to RspackPlugin (#4156)
Browse files Browse the repository at this point in the history
* refactor: naming to RspackPlugin

* lint

* fix
  • Loading branch information
ahabhgk authored Sep 11, 2023
1 parent 94f0422 commit 77bada1
Show file tree
Hide file tree
Showing 50 changed files with 545 additions and 539 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

170 changes: 85 additions & 85 deletions crates/node_binding/binding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,24 +110,24 @@ export interface BeforeResolveData {
}

export interface BuiltinPlugin {
kind: BuiltinPluginKind
name: BuiltinPluginName
options: unknown
}

export const enum BuiltinPluginKind {
Define = 'Define',
Provide = 'Provide',
Banner = 'Banner',
Progress = 'Progress',
Copy = 'Copy',
Html = 'Html',
SwcJsMinimizer = 'SwcJsMinimizer',
SwcCssMinimizer = 'SwcCssMinimizer',
Entry = 'Entry',
Externals = 'Externals',
NodeTarget = 'NodeTarget',
ElectronTarget = 'ElectronTarget',
HttpExternals = 'HttpExternals'
export const enum BuiltinPluginName {
DefinePlugin = 'DefinePlugin',
ProvidePlugin = 'ProvidePlugin',
BannerPlugin = 'BannerPlugin',
ProgressPlugin = 'ProgressPlugin',
EntryPlugin = 'EntryPlugin',
ExternalsPlugin = 'ExternalsPlugin',
NodeTargetPlugin = 'NodeTargetPlugin',
ElectronTargetPlugin = 'ElectronTargetPlugin',
HttpExternalsRspackPlugin = 'HttpExternalsRspackPlugin',
CopyRspackPlugin = 'CopyRspackPlugin',
HtmlRspackPlugin = 'HtmlRspackPlugin',
SwcJsMinimizerRspackPlugin = 'SwcJsMinimizerRspackPlugin',
SwcCssMinimizerRspackPlugin = 'SwcCssMinimizerRspackPlugin'
}

export function cleanupGlobalTrace(): void
Expand Down Expand Up @@ -492,39 +492,39 @@ export interface RawAssetResourceGeneratorOptions {
publicPath?: string
}

export interface RawBannerCondition {
type: "string" | "regexp"
stringMatcher?: string
regexpMatcher?: string
export interface RawBannerContent {
type: "string" | "function"
stringPayload?: string
fnPayload?: (...args: any[]) => any
}

export interface RawBannerConditions {
type: "string" | "regexp" | "array"
stringMatcher?: string
regexpMatcher?: string
arrayMatcher?: Array<RawBannerCondition>
export interface RawBannerContentFnCtx {
hash: string
chunk: JsChunk
filename: string
}

export interface RawBannerConfig {
export interface RawBannerPluginOptions {
banner: RawBannerContent
entryOnly?: boolean
footer?: boolean
raw?: boolean
test?: RawBannerConditions
include?: RawBannerConditions
exclude?: RawBannerConditions
test?: RawBannerRules
include?: RawBannerRules
exclude?: RawBannerRules
}

export interface RawBannerContent {
type: "string" | "function"
stringPayload?: string
fnPayload?: (...args: any[]) => any
export interface RawBannerRule {
type: "string" | "regexp"
stringMatcher?: string
regexpMatcher?: string
}

export interface RawBannerContentFnCtx {
hash: string
chunk: JsChunk
filename: string
export interface RawBannerRules {
type: "string" | "regexp" | "array"
stringMatcher?: string
regexpMatcher?: string
arrayMatcher?: Array<RawBannerRule>
}

export interface RawBuiltins {
Expand Down Expand Up @@ -569,8 +569,25 @@ export interface RawCacheOptions {
version: string
}

export interface RawCopyConfig {
patterns: Array<RawPattern>
export interface RawCopyGlobOptions {
caseSensitiveMatch?: boolean
dot?: boolean
ignore?: Array<string>
}

export interface RawCopyPattern {
from: string
to?: string
context?: string
toType?: string
noErrorOnMissing: boolean
force: boolean
priority: number
globOptions: RawCopyGlobOptions
}

export interface RawCopyRspackPluginOptions {
patterns: Array<RawCopyPattern>
}

export interface RawCrossOriginLoading {
Expand Down Expand Up @@ -685,13 +702,7 @@ export interface RawGeneratorOptions {
assetResource?: RawAssetResourceGeneratorOptions
}

export interface RawGlobOptions {
caseSensitiveMatch?: boolean
dot?: boolean
ignore?: Array<string>
}

export interface RawHtmlPluginConfig {
export interface RawHtmlRspackPluginOptions {
/** emitted file name in output path */
filename?: string
/** template html file */
Expand All @@ -714,7 +725,7 @@ export interface RawHtmlPluginConfig {
meta?: Record<string, Record<string, string>>
}

export interface RawHttpExternalsPluginOptions {
export interface RawHttpExternalsRspackPluginOptions {
css: boolean
}

Expand Down Expand Up @@ -744,33 +755,6 @@ export interface RawLibraryOptions {
auxiliaryComment?: RawLibraryAuxiliaryComment
}

export interface RawMinification {
passes: number
dropConsole: boolean
keepClassNames: boolean
keepFnNames: boolean
comments: "all" | "some" | "false"
asciiOnly: boolean
pureFuncs: Array<string>
extractComments?: string
test?: RawMinificationConditions
include?: RawMinificationConditions
exclude?: RawMinificationConditions
}

export interface RawMinificationCondition {
type: "string" | "regexp"
stringMatcher?: string
regexpMatcher?: string
}

export interface RawMinificationConditions {
type: "string" | "regexp" | "array"
stringMatcher?: string
regexpMatcher?: string
arrayMatcher?: Array<RawMinificationCondition>
}

export interface RawModuleOptions {
rules: Array<RawModuleRule>
parser?: Record<string, RawParserOptions>
Expand Down Expand Up @@ -911,17 +895,6 @@ export interface RawParserOptions {
asset?: RawAssetParserOptions
}

export interface RawPattern {
from: string
to?: string
context?: string
toType?: string
noErrorOnMissing: boolean
force: boolean
priority: number
globOptions: RawGlobOptions
}

export interface RawPluginImportConfig {
libraryName: string
libraryDirectory?: string
Expand All @@ -940,7 +913,7 @@ export interface RawPresetEnv {
coreJs?: string
}

export interface RawProgressPluginConfig {
export interface RawProgressPluginOptions {
prefix?: string
}

Expand Down Expand Up @@ -1036,6 +1009,33 @@ export interface RawStyleConfig {
bool?: boolean
}

export interface RawSwcJsMinimizerRspackPluginOptions {
passes: number
dropConsole: boolean
keepClassNames: boolean
keepFnNames: boolean
comments: "all" | "some" | "false"
asciiOnly: boolean
pureFuncs: Array<string>
extractComments?: string
test?: RawSwcJsMinimizerRules
include?: RawSwcJsMinimizerRules
exclude?: RawSwcJsMinimizerRules
}

export interface RawSwcJsMinimizerRule {
type: "string" | "regexp"
stringMatcher?: string
regexpMatcher?: string
}

export interface RawSwcJsMinimizerRules {
type: "string" | "regexp" | "array"
stringMatcher?: string
regexpMatcher?: string
arrayMatcher?: Array<RawSwcJsMinimizerRule>
}

export interface RawTrustedTypes {
policyName?: string
}
Expand Down
Loading

0 comments on commit 77bada1

Please sign in to comment.