@rspack/binding 1.1.0 → 1.1.1

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.
Files changed (2) hide show
  1. package/binding.d.ts +112 -49
  2. package/package.json +11 -11
package/binding.d.ts CHANGED
@@ -13,20 +13,20 @@ export type RawLazyCompilationTest = RegExp | ((m: JsModule) => boolean);
13
13
 
14
14
  /* -- napi-rs generated below -- */
15
15
 
16
- export class ExternalObject<T> {
16
+ export declare class ExternalObject<T> {
17
17
  readonly '': {
18
18
  readonly '': unique symbol
19
19
  [K: symbol]: T
20
20
  }
21
21
  }
22
- export class EntryDataDto {
22
+ export declare class EntryDataDto {
23
23
  get dependencies(): Array<JsDependency>
24
24
  get includeDependencies(): Array<JsDependency>
25
25
  get options(): EntryOptionsDto
26
26
  }
27
27
  export type EntryDataDTO = EntryDataDto
28
28
 
29
- export class EntryOptionsDto {
29
+ export declare class EntryOptionsDto {
30
30
  get name(): string | undefined
31
31
  set name(name: string | undefined)
32
32
  get runtime(): false | string | undefined
@@ -46,7 +46,7 @@ export class EntryOptionsDto {
46
46
  }
47
47
  export type EntryOptionsDTO = EntryOptionsDto
48
48
 
49
- export class JsCompilation {
49
+ export declare class JsCompilation {
50
50
  updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSource) => JsCompatSource), assetInfoUpdateOrFunction?: JsAssetInfo | ((assetInfo: JsAssetInfo) => JsAssetInfo)): void
51
51
  getAssets(): Readonly<JsAsset>[]
52
52
  getAsset(name: string): JsAsset | null
@@ -86,13 +86,18 @@ export class JsCompilation {
86
86
  addContextDependencies(deps: Array<string>): void
87
87
  addMissingDependencies(deps: Array<string>): void
88
88
  addBuildDependencies(deps: Array<string>): void
89
- rebuildModule(moduleIdentifiers: Array<string>, f: (...args: any[]) => any): void
90
- importModule(request: string, layer: string | undefined | null, publicPath: JsFilename | undefined | null, baseUri: string | undefined | null, originalModule: string | undefined | null, originalModuleContext: string | undefined | null, callback: (...args: any[]) => any): void
89
+ /**
90
+ * This is a very unsafe function.
91
+ * Please don't use this at the moment.
92
+ * Using async and mutable reference to `Compilation` at the same time would likely to cause data races.
93
+ */
94
+ rebuildModule(moduleIdentifiers: Array<string>, f: any): void
95
+ importModule(request: string, layer: string | undefined | null, publicPath: JsFilename | undefined | null, baseUri: string | undefined | null, originalModule: string | undefined | null, originalModuleContext: string | undefined | null, callback: any): void
91
96
  get entries(): JsEntries
92
97
  addRuntimeModule(chunkUkey: number, runtimeModule: JsAddingRuntimeModule): void
93
98
  }
94
99
 
95
- export class JsContextModuleFactoryAfterResolveData {
100
+ export declare class JsContextModuleFactoryAfterResolveData {
96
101
  get resource(): string
97
102
  set resource(resource: string)
98
103
  get context(): string
@@ -106,7 +111,7 @@ export class JsContextModuleFactoryAfterResolveData {
106
111
  get dependencies(): Array<JsDependencyMut>
107
112
  }
108
113
 
109
- export class JsContextModuleFactoryBeforeResolveData {
114
+ export declare class JsContextModuleFactoryBeforeResolveData {
110
115
  get context(): string
111
116
  set context(context: string)
112
117
  get request(): string
@@ -117,7 +122,7 @@ export class JsContextModuleFactoryBeforeResolveData {
117
122
  set recursive(recursive: boolean)
118
123
  }
119
124
 
120
- export class JsDependencies {
125
+ export declare class JsDependencies {
121
126
  get fileDependencies(): Array<string>
122
127
  get addedFileDependencies(): Array<string>
123
128
  get removedFileDependencies(): Array<string>
@@ -132,19 +137,19 @@ export class JsDependencies {
132
137
  get removedBuildDependencies(): Array<string>
133
138
  }
134
139
 
135
- export class JsDependenciesBlock {
140
+ export declare class JsDependenciesBlock {
136
141
  get dependencies(): Array<JsDependency>
137
142
  get blocks(): Array<JsDependenciesBlock>
138
143
  }
139
144
 
140
- export class JsDependency {
145
+ export declare class JsDependency {
141
146
  get type(): string
142
147
  get category(): string
143
148
  get request(): string | undefined
144
149
  get critical(): boolean
145
150
  }
146
151
 
147
- export class JsDependencyMut {
152
+ export declare class JsDependencyMut {
148
153
  get type(): string
149
154
  get category(): string
150
155
  get request(): string | undefined
@@ -152,7 +157,7 @@ export class JsDependencyMut {
152
157
  set critical(val: boolean)
153
158
  }
154
159
 
155
- export class JsEntries {
160
+ export declare class JsEntries {
156
161
  clear(): void
157
162
  get size(): number
158
163
  has(key: string): boolean
@@ -163,7 +168,7 @@ export class JsEntries {
163
168
  values(): Array<EntryDataDto>
164
169
  }
165
170
 
166
- export class JsModule {
171
+ export declare class JsModule {
167
172
  get context(): string | undefined
168
173
  get originalSource(): JsCompatSource | undefined
169
174
  get resource(): string | undefined
@@ -183,24 +188,24 @@ export class JsModule {
183
188
  get useSourceMap(): boolean
184
189
  }
185
190
 
186
- export class JsResolver {
191
+ export declare class JsResolver {
187
192
  resolveSync(path: string, request: string): string | false
188
- withOptions(raw?: RawResolveOptionsWithDependencyType | undefined | null): this
193
+ withOptions(raw?: RawResolveOptionsWithDependencyType | undefined | null): JsResolver
189
194
  }
190
195
 
191
- export class JsResolverFactory {
196
+ export declare class JsResolverFactory {
192
197
  constructor()
193
198
  get(type: string, options?: RawResolveOptionsWithDependencyType): JsResolver
194
199
  }
195
200
 
196
- export class JsStats {
201
+ export declare class JsStats {
197
202
  toJson(jsOptions: JsStatsOptions): JsStatsCompilation
198
203
  hasWarnings(): boolean
199
204
  hasErrors(): boolean
200
205
  getLogging(acceptedTypes: number): Array<JsStatsLogging>
201
206
  }
202
207
 
203
- export class Rspack {
208
+ export declare class Rspack {
204
209
  constructor(options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, resolverFactoryReference: JsResolverFactory)
205
210
  setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
206
211
  /** Build with the given option passed to the constructor */
@@ -209,29 +214,29 @@ export class Rspack {
209
214
  rebuild(changed_files: string[], removed_files: string[], callback: (err: null | Error) => void): void
210
215
  }
211
216
 
212
- export function __chunk_graph_inner_get_chunk_entry_dependent_chunks_iterable(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
217
+ export declare function __chunk_graph_inner_get_chunk_entry_dependent_chunks_iterable(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
213
218
 
214
- export function __chunk_graph_inner_get_chunk_entry_modules(jsChunkUkey: number, jsCompilation: JsCompilation): JsModule[]
219
+ export declare function __chunk_graph_inner_get_chunk_entry_modules(jsChunkUkey: number, jsCompilation: JsCompilation): JsModule[]
215
220
 
216
- export function __chunk_graph_inner_get_chunk_modules(jsChunkUkey: number, jsCompilation: JsCompilation): JsModule[]
221
+ export declare function __chunk_graph_inner_get_chunk_modules(jsChunkUkey: number, jsCompilation: JsCompilation): JsModule[]
217
222
 
218
- export function __chunk_graph_inner_get_chunk_modules_iterable_by_source_type(jsChunkUkey: number, sourceType: string, jsCompilation: JsCompilation): JsModule[]
223
+ export declare function __chunk_graph_inner_get_chunk_modules_iterable_by_source_type(jsChunkUkey: number, sourceType: string, jsCompilation: JsCompilation): JsModule[]
219
224
 
220
- export function __chunk_group_inner_get_chunk_group(ukey: number, jsCompilation: JsCompilation): JsChunkGroup
225
+ export declare function __chunk_group_inner_get_chunk_group(ukey: number, jsCompilation: JsCompilation): JsChunkGroup
221
226
 
222
- export function __chunk_inner_can_be_initial(jsChunkUkey: number, jsCompilation: JsCompilation): boolean
227
+ export declare function __chunk_inner_can_be_initial(jsChunkUkey: number, jsCompilation: JsCompilation): boolean
223
228
 
224
- export function __chunk_inner_get_all_async_chunks(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
229
+ export declare function __chunk_inner_get_all_async_chunks(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
225
230
 
226
- export function __chunk_inner_get_all_initial_chunks(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
231
+ export declare function __chunk_inner_get_all_initial_chunks(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
227
232
 
228
- export function __chunk_inner_get_all_referenced_chunks(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
233
+ export declare function __chunk_inner_get_all_referenced_chunks(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
229
234
 
230
- export function __chunk_inner_has_runtime(jsChunkUkey: number, jsCompilation: JsCompilation): boolean
235
+ export declare function __chunk_inner_has_runtime(jsChunkUkey: number, jsCompilation: JsCompilation): boolean
231
236
 
232
- export function __chunk_inner_is_only_initial(jsChunkUkey: number, jsCompilation: JsCompilation): boolean
237
+ export declare function __chunk_inner_is_only_initial(jsChunkUkey: number, jsCompilation: JsCompilation): boolean
233
238
 
234
- export function __entrypoint_inner_get_runtime_chunk(ukey: number, jsCompilation: JsCompilation): JsChunk
239
+ export declare function __entrypoint_inner_get_runtime_chunk(ukey: number, jsCompilation: JsCompilation): JsChunk
235
240
 
236
241
  export interface BuiltinPlugin {
237
242
  name: BuiltinPluginName
@@ -239,7 +244,7 @@ export interface BuiltinPlugin {
239
244
  canInherentFromParent?: boolean
240
245
  }
241
246
 
242
- export enum BuiltinPluginName {
247
+ export declare enum BuiltinPluginName {
243
248
  DefinePlugin = 'DefinePlugin',
244
249
  ProvidePlugin = 'ProvidePlugin',
245
250
  BannerPlugin = 'BannerPlugin',
@@ -303,6 +308,10 @@ export enum BuiltinPluginName {
303
308
  SizeLimitsPlugin = 'SizeLimitsPlugin',
304
309
  NoEmitOnErrorsPlugin = 'NoEmitOnErrorsPlugin',
305
310
  ContextReplacementPlugin = 'ContextReplacementPlugin',
311
+ DllEntryPlugin = 'DllEntryPlugin',
312
+ DllReferenceAgencyPlugin = 'DllReferenceAgencyPlugin',
313
+ LibManifestPlugin = 'LibManifestPlugin',
314
+ FlagAllModulesAsUsedPlugin = 'FlagAllModulesAsUsedPlugin',
306
315
  HttpExternalsRspackPlugin = 'HttpExternalsRspackPlugin',
307
316
  CopyRspackPlugin = 'CopyRspackPlugin',
308
317
  HtmlRspackPlugin = 'HtmlRspackPlugin',
@@ -314,13 +323,13 @@ export enum BuiltinPluginName {
314
323
  LazyCompilationPlugin = 'LazyCompilationPlugin'
315
324
  }
316
325
 
317
- export function cleanupGlobalTrace(): void
326
+ export declare function cleanupGlobalTrace(): void
318
327
 
319
328
  export interface ContextInfo {
320
329
  issuer: string
321
330
  }
322
331
 
323
- export function formatDiagnostic(diagnostic: JsDiagnostic): ExternalObject<'Diagnostic'>
332
+ export declare function formatDiagnostic(diagnostic: JsDiagnostic): ExternalObject<'Diagnostic'>
324
333
 
325
334
  export interface JsAddingRuntimeModule {
326
335
  name: string
@@ -446,6 +455,22 @@ export interface JsBeforeResolveArgs {
446
455
  issuer: string
447
456
  }
448
457
 
458
+ export interface JsBuildMeta {
459
+ strictEsmModule: boolean
460
+ hasTopLevelAwait: boolean
461
+ esm: boolean
462
+ exportsType: 'unset' | 'default' | 'namespace' | 'flagged' | 'dynamic'
463
+ defaultObject: 'false' | 'redirect' | JsBuildMetaDefaultObjectRedirectWarn
464
+ moduleArgument: 'module' | 'webpackModule'
465
+ exportsArgument: 'exports' | 'webpackExports'
466
+ sideEffectFree?: boolean
467
+ exportsFinalName?: Array<[string, string]> | undefined
468
+ }
469
+
470
+ export interface JsBuildMetaDefaultObjectRedirectWarn {
471
+ redirectWarn: JsDefaultObjectRedirectWarnObject
472
+ }
473
+
449
474
  export interface JsBuildTimeExecutionOption {
450
475
  publicPath?: string
451
476
  baseUri?: string
@@ -519,6 +544,10 @@ export interface JsCreateData {
519
544
  resource: string
520
545
  }
521
546
 
547
+ export interface JsDefaultObjectRedirectWarnObject {
548
+ ignore: boolean
549
+ }
550
+
522
551
  export interface JsDiagnostic {
523
552
  message: string
524
553
  help?: string
@@ -671,7 +700,7 @@ export interface JsLoaderItem {
671
700
  pitchExecuted: boolean
672
701
  }
673
702
 
674
- export enum JsLoaderState {
703
+ export declare enum JsLoaderState {
675
704
  Pitching = 'Pitching',
676
705
  Normal = 'Normal'
677
706
  }
@@ -744,7 +773,7 @@ export interface JsRspackError {
744
773
  hideStack?: boolean
745
774
  }
746
775
 
747
- export enum JsRspackSeverity {
776
+ export declare enum JsRspackSeverity {
748
777
  Error = 'Error',
749
778
  Warn = 'Warn'
750
779
  }
@@ -1019,17 +1048,10 @@ export interface JsStatsWarning {
1019
1048
  }
1020
1049
 
1021
1050
  export interface JsTap {
1022
- function: (...args: any[]) => any
1051
+ function: any
1023
1052
  stage: number
1024
1053
  }
1025
1054
 
1026
- export interface NodeFS {
1027
- writeFile: (...args: any[]) => any
1028
- removeFile: (...args: any[]) => any
1029
- mkdir: (...args: any[]) => any
1030
- mkdirp: (...args: any[]) => any
1031
- }
1032
-
1033
1055
  export interface NodeFsStats {
1034
1056
  isFile: boolean
1035
1057
  isDirectory: boolean
@@ -1269,6 +1291,35 @@ export interface RawCssParserOptions {
1269
1291
  namedExports?: boolean
1270
1292
  }
1271
1293
 
1294
+ export interface RawDllEntryPluginOptions {
1295
+ context: string
1296
+ entries: Array<string>
1297
+ name: string
1298
+ }
1299
+
1300
+ export interface RawDllManifest {
1301
+ content: Record<string, RawDllManifestContentItem>
1302
+ name?: string
1303
+ type?: string
1304
+ }
1305
+
1306
+ export interface RawDllManifestContentItem {
1307
+ buildMeta?: JsBuildMeta
1308
+ exports?: string[] | true
1309
+ id?: string
1310
+ }
1311
+
1312
+ export interface RawDllReferenceAgencyPluginOptions {
1313
+ context?: string
1314
+ name?: string
1315
+ extensions: Array<string>
1316
+ scope?: string
1317
+ sourceType?: string
1318
+ type: string
1319
+ content?: Record<string, RawDllManifestContentItem>
1320
+ manifest?: RawDllManifest
1321
+ }
1322
+
1272
1323
  export interface RawDraft {
1273
1324
  customMedia: boolean
1274
1325
  }
@@ -1347,6 +1398,10 @@ export interface RawFallbackCacheGroupOptions {
1347
1398
  automaticNameDelimiter?: string
1348
1399
  }
1349
1400
 
1401
+ export interface RawFlagAllModulesAsUsedPluginOptions {
1402
+ explanation: string
1403
+ }
1404
+
1350
1405
  export interface RawFuncUseCtx {
1351
1406
  resource?: string
1352
1407
  realResource?: string
@@ -1468,13 +1523,22 @@ export interface RawJavascriptParserOptions {
1468
1523
  }
1469
1524
 
1470
1525
  export interface RawLazyCompilationOption {
1471
- module: (err: Error | null, arg: RawModuleArg) => any
1526
+ module: ((err: Error | null, arg: RawModuleArg) => RawModuleInfo)
1472
1527
  test?: RawLazyCompilationTest
1473
1528
  entries: boolean
1474
1529
  imports: boolean
1475
1530
  cacheable: boolean
1476
1531
  }
1477
1532
 
1533
+ export interface RawLibManifestPluginOptions {
1534
+ context?: string
1535
+ entryOnly?: boolean
1536
+ name?: JsFilename
1537
+ path: JsFilename
1538
+ format?: boolean
1539
+ type?: string
1540
+ }
1541
+
1478
1542
  export interface RawLightningCssBrowsers {
1479
1543
  android?: number
1480
1544
  chrome?: number
@@ -1804,7 +1868,7 @@ export interface RawRuleSetCondition {
1804
1868
  func?: (value: string) => boolean
1805
1869
  }
1806
1870
 
1807
- export enum RawRuleSetConditionType {
1871
+ export declare enum RawRuleSetConditionType {
1808
1872
  string = 'string',
1809
1873
  regexp = 'regexp',
1810
1874
  logical = 'logical',
@@ -1913,9 +1977,9 @@ export interface RawTrustedTypes {
1913
1977
  * Author Donny/강동윤
1914
1978
  * Copyright (c)
1915
1979
  */
1916
- export function registerGlobalTrace(filter: string, layer: "chrome" | "logger"| "console", output: string): void
1980
+ export declare function registerGlobalTrace(filter: string, layer: "chrome" | "logger"| "console", output: string): void
1917
1981
 
1918
- export enum RegisterJsTapKind {
1982
+ export declare enum RegisterJsTapKind {
1919
1983
  CompilerThisCompilation = 0,
1920
1984
  CompilerCompilation = 1,
1921
1985
  CompilerMake = 2,
@@ -2014,4 +2078,3 @@ export interface ThreadsafeNodeFS {
2014
2078
  stat: (name: string) => Promise<NodeFsStats | void> | NodeFsStats | void
2015
2079
  lstat: (name: string) => Promise<NodeFsStats | void> | NodeFsStats | void
2016
2080
  }
2017
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "binding.js",
@@ -17,22 +17,22 @@
17
17
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
18
18
  "repository": "web-infra-dev/rspack",
19
19
  "devDependencies": {
20
- "@napi-rs/cli": "3.0.0-alpha.45",
20
+ "@napi-rs/cli": "3.0.0-alpha.64",
21
21
  "typescript": "^5.6.3"
22
22
  },
23
23
  "napi": {
24
24
  "binaryName": "rspack"
25
25
  },
26
26
  "optionalDependencies": {
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"
27
+ "@rspack/binding-darwin-arm64": "1.1.1",
28
+ "@rspack/binding-win32-arm64-msvc": "1.1.1",
29
+ "@rspack/binding-linux-arm64-gnu": "1.1.1",
30
+ "@rspack/binding-linux-arm64-musl": "1.1.1",
31
+ "@rspack/binding-win32-ia32-msvc": "1.1.1",
32
+ "@rspack/binding-linux-x64-musl": "1.1.1",
33
+ "@rspack/binding-win32-x64-msvc": "1.1.1",
34
+ "@rspack/binding-darwin-x64": "1.1.1",
35
+ "@rspack/binding-linux-x64-gnu": "1.1.1"
36
36
  },
37
37
  "scripts": {
38
38
  "build:debug": "node scripts/build.js",