@rspack/binding 1.0.14 → 1.1.0
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/binding.d.ts +86 -85
- package/package.json +10 -10
package/binding.d.ts
CHANGED
|
@@ -19,28 +19,6 @@ export class ExternalObject<T> {
|
|
|
19
19
|
[K: symbol]: T
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
export class DependenciesBlockDto {
|
|
23
|
-
get dependencies(): Array<JsDependency>
|
|
24
|
-
get blocks(): Array<DependenciesBlockDto>
|
|
25
|
-
}
|
|
26
|
-
export type DependenciesBlockDTO = DependenciesBlockDto
|
|
27
|
-
|
|
28
|
-
export class DependenciesDto {
|
|
29
|
-
get fileDependencies(): Array<string>
|
|
30
|
-
get addedFileDependencies(): Array<string>
|
|
31
|
-
get removedFileDependencies(): Array<string>
|
|
32
|
-
get contextDependencies(): Array<string>
|
|
33
|
-
get addedContextDependencies(): Array<string>
|
|
34
|
-
get removedContextDependencies(): Array<string>
|
|
35
|
-
get missingDependencies(): Array<string>
|
|
36
|
-
get addedMissingDependencies(): Array<string>
|
|
37
|
-
get removedMissingDependencies(): Array<string>
|
|
38
|
-
get buildDependencies(): Array<string>
|
|
39
|
-
get addedBuildDependencies(): Array<string>
|
|
40
|
-
get removedBuildDependencies(): Array<string>
|
|
41
|
-
}
|
|
42
|
-
export type DependenciesDTO = DependenciesDto
|
|
43
|
-
|
|
44
22
|
export class EntryDataDto {
|
|
45
23
|
get dependencies(): Array<JsDependency>
|
|
46
24
|
get includeDependencies(): Array<JsDependency>
|
|
@@ -73,8 +51,8 @@ export class JsCompilation {
|
|
|
73
51
|
getAssets(): Readonly<JsAsset>[]
|
|
74
52
|
getAsset(name: string): JsAsset | null
|
|
75
53
|
getAssetSource(name: string): JsCompatSource | null
|
|
76
|
-
get modules(): Array<
|
|
77
|
-
get builtModules(): Array<
|
|
54
|
+
get modules(): Array<JsModule>
|
|
55
|
+
get builtModules(): Array<JsModule>
|
|
78
56
|
getOptimizationBailout(): Array<JsStatsOptimizationBailout>
|
|
79
57
|
getChunks(): Array<JsChunk>
|
|
80
58
|
getNamedChunkKeys(): Array<string>
|
|
@@ -92,7 +70,7 @@ export class JsCompilation {
|
|
|
92
70
|
get entrypoints(): Record<string, JsChunkGroup>
|
|
93
71
|
get chunkGroups(): Array<JsChunkGroup>
|
|
94
72
|
get hash(): string | null
|
|
95
|
-
dependencies():
|
|
73
|
+
dependencies(): JsDependencies
|
|
96
74
|
pushDiagnostic(diagnostic: JsRspackDiagnostic): void
|
|
97
75
|
spliceDiagnostic(start: number, end: number, replaceWith: Array<JsRspackDiagnostic>): void
|
|
98
76
|
pushNativeDiagnostic(diagnostic: ExternalObject<'Diagnostic'>): void
|
|
@@ -121,8 +99,8 @@ export class JsContextModuleFactoryAfterResolveData {
|
|
|
121
99
|
set context(context: string)
|
|
122
100
|
get request(): string
|
|
123
101
|
set request(request: string)
|
|
124
|
-
get regExp():
|
|
125
|
-
set regExp(rawRegExp:
|
|
102
|
+
get regExp(): RegExp | undefined
|
|
103
|
+
set regExp(rawRegExp: RegExp | undefined)
|
|
126
104
|
get recursive(): boolean
|
|
127
105
|
set recursive(recursive: boolean)
|
|
128
106
|
get dependencies(): Array<JsDependencyMut>
|
|
@@ -133,12 +111,32 @@ export class JsContextModuleFactoryBeforeResolveData {
|
|
|
133
111
|
set context(context: string)
|
|
134
112
|
get request(): string
|
|
135
113
|
set request(request: string)
|
|
136
|
-
get regExp():
|
|
137
|
-
set regExp(rawRegExp:
|
|
114
|
+
get regExp(): RegExp | undefined
|
|
115
|
+
set regExp(rawRegExp: RegExp | undefined)
|
|
138
116
|
get recursive(): boolean
|
|
139
117
|
set recursive(recursive: boolean)
|
|
140
118
|
}
|
|
141
119
|
|
|
120
|
+
export class JsDependencies {
|
|
121
|
+
get fileDependencies(): Array<string>
|
|
122
|
+
get addedFileDependencies(): Array<string>
|
|
123
|
+
get removedFileDependencies(): Array<string>
|
|
124
|
+
get contextDependencies(): Array<string>
|
|
125
|
+
get addedContextDependencies(): Array<string>
|
|
126
|
+
get removedContextDependencies(): Array<string>
|
|
127
|
+
get missingDependencies(): Array<string>
|
|
128
|
+
get addedMissingDependencies(): Array<string>
|
|
129
|
+
get removedMissingDependencies(): Array<string>
|
|
130
|
+
get buildDependencies(): Array<string>
|
|
131
|
+
get addedBuildDependencies(): Array<string>
|
|
132
|
+
get removedBuildDependencies(): Array<string>
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export class JsDependenciesBlock {
|
|
136
|
+
get dependencies(): Array<JsDependency>
|
|
137
|
+
get blocks(): Array<JsDependenciesBlock>
|
|
138
|
+
}
|
|
139
|
+
|
|
142
140
|
export class JsDependency {
|
|
143
141
|
get type(): string
|
|
144
142
|
get category(): string
|
|
@@ -165,6 +163,26 @@ export class JsEntries {
|
|
|
165
163
|
values(): Array<EntryDataDto>
|
|
166
164
|
}
|
|
167
165
|
|
|
166
|
+
export class JsModule {
|
|
167
|
+
get context(): string | undefined
|
|
168
|
+
get originalSource(): JsCompatSource | undefined
|
|
169
|
+
get resource(): string | undefined
|
|
170
|
+
get moduleIdentifier(): string
|
|
171
|
+
get nameForCondition(): string | undefined
|
|
172
|
+
get request(): string | undefined
|
|
173
|
+
get userRequest(): string | undefined
|
|
174
|
+
set userRequest(val: string)
|
|
175
|
+
get rawRequest(): string | undefined
|
|
176
|
+
get factoryMeta(): JsFactoryMeta | undefined
|
|
177
|
+
get type(): string
|
|
178
|
+
get layer(): string | undefined
|
|
179
|
+
get blocks(): Array<JsDependenciesBlock>
|
|
180
|
+
get dependencies(): Array<JsDependency>
|
|
181
|
+
size(ty?: string | undefined | null): number
|
|
182
|
+
get modules(): JsModule[] | undefined
|
|
183
|
+
get useSourceMap(): boolean
|
|
184
|
+
}
|
|
185
|
+
|
|
168
186
|
export class JsResolver {
|
|
169
187
|
resolveSync(path: string, request: string): string | false
|
|
170
188
|
withOptions(raw?: RawResolveOptionsWithDependencyType | undefined | null): this
|
|
@@ -182,23 +200,6 @@ export class JsStats {
|
|
|
182
200
|
getLogging(acceptedTypes: number): Array<JsStatsLogging>
|
|
183
201
|
}
|
|
184
202
|
|
|
185
|
-
export class ModuleDto {
|
|
186
|
-
get context(): string | undefined
|
|
187
|
-
get originalSource(): JsCompatSource | undefined
|
|
188
|
-
get resource(): string | undefined
|
|
189
|
-
get moduleIdentifier(): string
|
|
190
|
-
get nameForCondition(): string | undefined
|
|
191
|
-
get request(): string | undefined
|
|
192
|
-
get userRequest(): string | undefined
|
|
193
|
-
get rawRequest(): string | undefined
|
|
194
|
-
get factoryMeta(): JsFactoryMeta | undefined
|
|
195
|
-
get type(): string
|
|
196
|
-
get layer(): string | undefined
|
|
197
|
-
get blocks(): Array<DependenciesBlockDto>
|
|
198
|
-
size(ty?: string | undefined | null): number
|
|
199
|
-
}
|
|
200
|
-
export type ModuleDTO = ModuleDto
|
|
201
|
-
|
|
202
203
|
export class Rspack {
|
|
203
204
|
constructor(options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, resolverFactoryReference: JsResolverFactory)
|
|
204
205
|
setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
|
|
@@ -208,29 +209,29 @@ export class Rspack {
|
|
|
208
209
|
rebuild(changed_files: string[], removed_files: string[], callback: (err: null | Error) => void): void
|
|
209
210
|
}
|
|
210
211
|
|
|
211
|
-
export function __chunk_graph_inner_get_chunk_entry_dependent_chunks_iterable(jsChunkUkey: number,
|
|
212
|
+
export function __chunk_graph_inner_get_chunk_entry_dependent_chunks_iterable(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
|
|
212
213
|
|
|
213
|
-
export function __chunk_graph_inner_get_chunk_entry_modules(jsChunkUkey: number,
|
|
214
|
+
export function __chunk_graph_inner_get_chunk_entry_modules(jsChunkUkey: number, jsCompilation: JsCompilation): JsModule[]
|
|
214
215
|
|
|
215
|
-
export function __chunk_graph_inner_get_chunk_modules(jsChunkUkey: number,
|
|
216
|
+
export function __chunk_graph_inner_get_chunk_modules(jsChunkUkey: number, jsCompilation: JsCompilation): JsModule[]
|
|
216
217
|
|
|
217
|
-
export function __chunk_graph_inner_get_chunk_modules_iterable_by_source_type(jsChunkUkey: number, sourceType: string,
|
|
218
|
+
export function __chunk_graph_inner_get_chunk_modules_iterable_by_source_type(jsChunkUkey: number, sourceType: string, jsCompilation: JsCompilation): JsModule[]
|
|
218
219
|
|
|
219
|
-
export function __chunk_group_inner_get_chunk_group(ukey: number,
|
|
220
|
+
export function __chunk_group_inner_get_chunk_group(ukey: number, jsCompilation: JsCompilation): JsChunkGroup
|
|
220
221
|
|
|
221
|
-
export function __chunk_inner_can_be_initial(jsChunkUkey: number,
|
|
222
|
+
export function __chunk_inner_can_be_initial(jsChunkUkey: number, jsCompilation: JsCompilation): boolean
|
|
222
223
|
|
|
223
|
-
export function __chunk_inner_get_all_async_chunks(jsChunkUkey: number,
|
|
224
|
+
export function __chunk_inner_get_all_async_chunks(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
|
|
224
225
|
|
|
225
|
-
export function __chunk_inner_get_all_initial_chunks(jsChunkUkey: number,
|
|
226
|
+
export function __chunk_inner_get_all_initial_chunks(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
|
|
226
227
|
|
|
227
|
-
export function __chunk_inner_get_all_referenced_chunks(jsChunkUkey: number,
|
|
228
|
+
export function __chunk_inner_get_all_referenced_chunks(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
|
|
228
229
|
|
|
229
|
-
export function __chunk_inner_has_runtime(jsChunkUkey: number,
|
|
230
|
+
export function __chunk_inner_has_runtime(jsChunkUkey: number, jsCompilation: JsCompilation): boolean
|
|
230
231
|
|
|
231
|
-
export function __chunk_inner_is_only_initial(jsChunkUkey: number,
|
|
232
|
+
export function __chunk_inner_is_only_initial(jsChunkUkey: number, jsCompilation: JsCompilation): boolean
|
|
232
233
|
|
|
233
|
-
export function __entrypoint_inner_get_runtime_chunk(ukey: number,
|
|
234
|
+
export function __entrypoint_inner_get_runtime_chunk(ukey: number, jsCompilation: JsCompilation): JsChunk
|
|
234
235
|
|
|
235
236
|
export interface BuiltinPlugin {
|
|
236
237
|
name: BuiltinPluginName
|
|
@@ -263,6 +264,7 @@ export enum BuiltinPluginName {
|
|
|
263
264
|
WebWorkerTemplatePlugin = 'WebWorkerTemplatePlugin',
|
|
264
265
|
MergeDuplicateChunksPlugin = 'MergeDuplicateChunksPlugin',
|
|
265
266
|
SplitChunksPlugin = 'SplitChunksPlugin',
|
|
267
|
+
RemoveDuplicateModulesPlugin = 'RemoveDuplicateModulesPlugin',
|
|
266
268
|
ShareRuntimePlugin = 'ShareRuntimePlugin',
|
|
267
269
|
ContainerPlugin = 'ContainerPlugin',
|
|
268
270
|
ContainerReferencePlugin = 'ContainerReferencePlugin',
|
|
@@ -323,7 +325,8 @@ export function formatDiagnostic(diagnostic: JsDiagnostic): ExternalObject<'Diag
|
|
|
323
325
|
export interface JsAddingRuntimeModule {
|
|
324
326
|
name: string
|
|
325
327
|
generator: () => String
|
|
326
|
-
|
|
328
|
+
dependentHash: boolean
|
|
329
|
+
fullHash: boolean
|
|
327
330
|
isolate: boolean
|
|
328
331
|
stage: number
|
|
329
332
|
}
|
|
@@ -449,7 +452,7 @@ export interface JsBuildTimeExecutionOption {
|
|
|
449
452
|
}
|
|
450
453
|
|
|
451
454
|
export interface JsCacheGroupTestCtx {
|
|
452
|
-
module:
|
|
455
|
+
module: JsModule
|
|
453
456
|
}
|
|
454
457
|
|
|
455
458
|
export interface JsChunk {
|
|
@@ -486,7 +489,7 @@ export interface JsChunkGroup {
|
|
|
486
489
|
}
|
|
487
490
|
|
|
488
491
|
export interface JsChunkGroupOrigin {
|
|
489
|
-
module?:
|
|
492
|
+
module?: JsModule | undefined
|
|
490
493
|
request?: string
|
|
491
494
|
}
|
|
492
495
|
|
|
@@ -657,6 +660,7 @@ export interface JsLoaderContext {
|
|
|
657
660
|
loaderItems: Array<JsLoaderItem>
|
|
658
661
|
loaderIndex: number
|
|
659
662
|
loaderState: Readonly<JsLoaderState>
|
|
663
|
+
__internal__error?: JsRspackError
|
|
660
664
|
}
|
|
661
665
|
|
|
662
666
|
export interface JsLoaderItem {
|
|
@@ -672,21 +676,6 @@ export enum JsLoaderState {
|
|
|
672
676
|
Normal = 'Normal'
|
|
673
677
|
}
|
|
674
678
|
|
|
675
|
-
export interface JsModule {
|
|
676
|
-
context?: string
|
|
677
|
-
originalSource?: JsCompatSource
|
|
678
|
-
resource?: string
|
|
679
|
-
moduleIdentifier: string
|
|
680
|
-
nameForCondition?: string
|
|
681
|
-
request?: string
|
|
682
|
-
userRequest?: string
|
|
683
|
-
rawRequest?: string
|
|
684
|
-
factoryMeta?: JsFactoryMeta
|
|
685
|
-
type: string
|
|
686
|
-
layer?: string
|
|
687
|
-
useSourceMap?: boolean
|
|
688
|
-
}
|
|
689
|
-
|
|
690
679
|
export interface JsModuleDescriptor {
|
|
691
680
|
identifier: string
|
|
692
681
|
name: string
|
|
@@ -1041,6 +1030,16 @@ export interface NodeFS {
|
|
|
1041
1030
|
mkdirp: (...args: any[]) => any
|
|
1042
1031
|
}
|
|
1043
1032
|
|
|
1033
|
+
export interface NodeFsStats {
|
|
1034
|
+
isFile: boolean
|
|
1035
|
+
isDirectory: boolean
|
|
1036
|
+
atimeMs: number
|
|
1037
|
+
mtimeMs: number
|
|
1038
|
+
ctimeMs: number
|
|
1039
|
+
birthtimeMs: number
|
|
1040
|
+
size: number
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1044
1043
|
export interface PathWithInfo {
|
|
1045
1044
|
path: string
|
|
1046
1045
|
info: JsAssetInfo
|
|
@@ -1192,10 +1191,10 @@ export interface RawContainerReferencePluginOptions {
|
|
|
1192
1191
|
}
|
|
1193
1192
|
|
|
1194
1193
|
export interface RawContextReplacementPluginOptions {
|
|
1195
|
-
resourceRegExp:
|
|
1194
|
+
resourceRegExp: RegExp
|
|
1196
1195
|
newContentResource?: string
|
|
1197
1196
|
newContentRecursive?: boolean
|
|
1198
|
-
newContentRegExp?:
|
|
1197
|
+
newContentRegExp?: RegExp
|
|
1199
1198
|
newContentCreateContextMap?: Record<string, string>
|
|
1200
1199
|
}
|
|
1201
1200
|
|
|
@@ -1372,7 +1371,7 @@ export interface RawHtmlRspackPluginBaseOptions {
|
|
|
1372
1371
|
|
|
1373
1372
|
export interface RawHtmlRspackPluginOptions {
|
|
1374
1373
|
/** emitted file name in output path */
|
|
1375
|
-
filename?: string
|
|
1374
|
+
filename?: string[]
|
|
1376
1375
|
/** template html file */
|
|
1377
1376
|
template?: string
|
|
1378
1377
|
templateFn?: (data: string) => Promise<string>
|
|
@@ -1416,6 +1415,7 @@ export interface RawIncremental {
|
|
|
1416
1415
|
modulesHashes: boolean
|
|
1417
1416
|
modulesCodegen: boolean
|
|
1418
1417
|
modulesRuntimeRequirements: boolean
|
|
1418
|
+
buildChunkGraph: boolean
|
|
1419
1419
|
}
|
|
1420
1420
|
|
|
1421
1421
|
export interface RawInfo {
|
|
@@ -1437,6 +1437,7 @@ export interface RawJavascriptParserOptions {
|
|
|
1437
1437
|
url?: string
|
|
1438
1438
|
exprContextCritical?: boolean
|
|
1439
1439
|
wrappedContextCritical?: boolean
|
|
1440
|
+
wrappedContextRegExp?: RegExp
|
|
1440
1441
|
exportsPresence?: string
|
|
1441
1442
|
importExportsPresence?: string
|
|
1442
1443
|
reexportExportsPresence?: string
|
|
@@ -1686,6 +1687,7 @@ export interface RawOutputOptions {
|
|
|
1686
1687
|
workerPublicPath: string
|
|
1687
1688
|
scriptType: "module" | "text/javascript" | "false"
|
|
1688
1689
|
environment: RawEnvironment
|
|
1690
|
+
compareBeforeEmit: boolean
|
|
1689
1691
|
}
|
|
1690
1692
|
|
|
1691
1693
|
export interface RawParserOptions {
|
|
@@ -1723,11 +1725,6 @@ export interface RawProvideOptions {
|
|
|
1723
1725
|
strictVersion?: boolean
|
|
1724
1726
|
}
|
|
1725
1727
|
|
|
1726
|
-
export interface RawRegex {
|
|
1727
|
-
source: string
|
|
1728
|
-
flags: string
|
|
1729
|
-
}
|
|
1730
|
-
|
|
1731
1728
|
export interface RawRelated {
|
|
1732
1729
|
sourceMap?: string
|
|
1733
1730
|
}
|
|
@@ -1801,7 +1798,7 @@ export interface RawRspackFuture {
|
|
|
1801
1798
|
export interface RawRuleSetCondition {
|
|
1802
1799
|
type: RawRuleSetConditionType
|
|
1803
1800
|
string?: string
|
|
1804
|
-
regexp?:
|
|
1801
|
+
regexp?: RegExp
|
|
1805
1802
|
logical?: Array<RawRuleSetLogicalConditions>
|
|
1806
1803
|
array?: Array<RawRuleSetCondition>
|
|
1807
1804
|
func?: (value: string) => boolean
|
|
@@ -2012,5 +2009,9 @@ export interface ThreadsafeNodeFS {
|
|
|
2012
2009
|
mkdir: (name: string) => Promise<void> | void
|
|
2013
2010
|
mkdirp: (name: string) => Promise<string | void> | string | void
|
|
2014
2011
|
removeDirAll: (name: string) => Promise<string | void> | string | void
|
|
2012
|
+
readDir: (name: string) => Promise<string[] | void> | string[] | void
|
|
2013
|
+
readFile: (name: string) => Promise<Buffer | string | void> | Buffer | string | void
|
|
2014
|
+
stat: (name: string) => Promise<NodeFsStats | void> | NodeFsStats | void
|
|
2015
|
+
lstat: (name: string) => Promise<NodeFsStats | void> | NodeFsStats | void
|
|
2015
2016
|
}
|
|
2016
2017
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/binding",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Node binding for rspack",
|
|
6
6
|
"main": "binding.js",
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"binaryName": "rspack"
|
|
25
25
|
},
|
|
26
26
|
"optionalDependencies": {
|
|
27
|
-
"@rspack/binding-darwin-arm64": "1.0
|
|
28
|
-
"@rspack/binding-win32-arm64-msvc": "1.0
|
|
29
|
-
"@rspack/binding-linux-arm64-
|
|
30
|
-
"@rspack/binding-linux-arm64-
|
|
31
|
-
"@rspack/binding-win32-ia32-msvc": "1.0
|
|
32
|
-
"@rspack/binding-darwin-x64": "1.0
|
|
33
|
-
"@rspack/binding-
|
|
34
|
-
"@rspack/binding-
|
|
35
|
-
"@rspack/binding-linux-x64-musl": "1.0
|
|
27
|
+
"@rspack/binding-darwin-arm64": "1.1.0",
|
|
28
|
+
"@rspack/binding-win32-arm64-msvc": "1.1.0",
|
|
29
|
+
"@rspack/binding-linux-arm64-musl": "1.1.0",
|
|
30
|
+
"@rspack/binding-linux-arm64-gnu": "1.1.0",
|
|
31
|
+
"@rspack/binding-win32-ia32-msvc": "1.1.0",
|
|
32
|
+
"@rspack/binding-darwin-x64": "1.1.0",
|
|
33
|
+
"@rspack/binding-linux-x64-gnu": "1.1.0",
|
|
34
|
+
"@rspack/binding-win32-x64-msvc": "1.1.0",
|
|
35
|
+
"@rspack/binding-linux-x64-musl": "1.1.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build:debug": "node scripts/build.js",
|