@rspack/binding 1.1.8 → 1.2.0-beta.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.
Files changed (2) hide show
  1. package/binding.d.ts +150 -141
  2. package/package.json +12 -12
package/binding.d.ts CHANGED
@@ -32,7 +32,7 @@ export declare class EntryOptionsDto {
32
32
  get runtime(): false | string | undefined
33
33
  set runtime(chunkLoading: boolean | string | undefined)
34
34
  get chunkLoading(): string | undefined
35
- set chunkLoading(chunkLoading: string | undefined)
35
+ set chunkLoading(chunkLoading: string | false | undefined)
36
36
  get asyncChunks(): boolean | undefined
37
37
  set asyncChunks(asyncChunks: boolean | undefined)
38
38
  get baseUri(): string | undefined
@@ -46,6 +46,49 @@ export declare class EntryOptionsDto {
46
46
  }
47
47
  export type EntryOptionsDTO = EntryOptionsDto
48
48
 
49
+ export declare class JsChunk {
50
+ get name(): string | undefined
51
+ get id(): string | undefined
52
+ get ids(): Array<string>
53
+ get idNameHints(): Array<string>
54
+ get filenameTemplate(): string | undefined
55
+ get cssFilenameTemplate(): string | undefined
56
+ get files(): Array<string>
57
+ get runtime(): Array<string>
58
+ get hash(): string | undefined
59
+ get contentHash(): Record<string, string>
60
+ get renderedHash(): string | undefined
61
+ get chunkReason(): string | undefined
62
+ get auxiliaryFiles(): Array<string>
63
+ isOnlyInitial(): boolean
64
+ canBeInitial(): boolean
65
+ hasRuntime(): boolean
66
+ getAllAsyncChunks(): JsChunk[]
67
+ getAllInitialChunks(): JsChunk[]
68
+ getAllReferencedChunks(): JsChunk[]
69
+ groups(): JsChunkGroup[]
70
+ }
71
+
72
+ export declare class JsChunkGraph {
73
+ getChunkModules(chunk: JsChunk): JsModule[]
74
+ getChunkEntryModules(chunk: JsChunk): JsModule[]
75
+ getChunkEntryDependentChunksIterable(chunk: JsChunk): JsChunk[]
76
+ getChunkModulesIterableBySourceType(chunk: JsChunk, sourceType: string): JsModule[]
77
+ getModuleChunks(module: JsModule): JsChunk[]
78
+ getModuleId(jsModule: JsModule): string | null
79
+ }
80
+
81
+ export declare class JsChunkGroup {
82
+ get chunks(): JsChunk[]
83
+ get index(): number | undefined
84
+ get name(): string | undefined
85
+ get origins(): Array<JsChunkGroupOrigin>
86
+ isInitial(): boolean
87
+ getParents(): JsChunkGroup[]
88
+ getRuntimeChunk(): JsChunk
89
+ getFiles(): Array<string>
90
+ }
91
+
49
92
  export declare class JsCompilation {
50
93
  updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSourceOwned) => JsCompatSourceOwned), assetInfoUpdateOrFunction?: JsAssetInfo | ((assetInfo: JsAssetInfo) => JsAssetInfo)): void
51
94
  getAssets(): Readonly<JsAsset>[]
@@ -54,11 +97,11 @@ export declare class JsCompilation {
54
97
  get modules(): Array<JsModule>
55
98
  get builtModules(): Array<JsModule>
56
99
  getOptimizationBailout(): Array<JsStatsOptimizationBailout>
57
- getChunks(): Array<JsChunk>
100
+ getChunks(): JsChunk[]
58
101
  getNamedChunkKeys(): Array<string>
59
- getNamedChunk(name: string): JsChunk | null
102
+ getNamedChunk(name: string): JsChunk
60
103
  getNamedChunkGroupKeys(): Array<string>
61
- getNamedChunkGroup(name: string): JsChunkGroup | null
104
+ getNamedChunkGroup(name: string): JsChunkGroup
62
105
  setAssetSource(name: string, source: JsCompatSource): void
63
106
  deleteAssetSource(name: string): void
64
107
  getAssetFilenames(): Array<string>
@@ -68,7 +111,7 @@ export declare class JsCompilation {
68
111
  deleteAsset(filename: string): void
69
112
  renameAsset(filename: string, newName: string): void
70
113
  get entrypoints(): Record<string, JsChunkGroup>
71
- get chunkGroups(): Array<JsChunkGroup>
114
+ get chunkGroups(): JsChunkGroup[]
72
115
  get hash(): string | null
73
116
  dependencies(): JsDependencies
74
117
  pushDiagnostic(diagnostic: JsRspackDiagnostic): void
@@ -94,8 +137,10 @@ export declare class JsCompilation {
94
137
  rebuildModule(moduleIdentifiers: Array<string>, f: any): void
95
138
  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
96
139
  get entries(): JsEntries
97
- addRuntimeModule(chunkUkey: number, runtimeModule: JsAddingRuntimeModule): void
140
+ addRuntimeModule(chunk: JsChunk, runtimeModule: JsAddingRuntimeModule): void
98
141
  get moduleGraph(): JsModuleGraph
142
+ get chunkGraph(): JsChunkGraph
143
+ addInclude(args: [string, RawDependency, JsEntryOptions | undefined][], callback: (errMsg: Error | null, results: [string | null, JsModule][]) => void): void
99
144
  }
100
145
 
101
146
  export declare class JsContextModuleFactoryAfterResolveData {
@@ -162,6 +207,13 @@ export declare class JsEntries {
162
207
  values(): Array<EntryDataDto>
163
208
  }
164
209
 
210
+ export declare class JsExportsInfo {
211
+ isUsed(runtime: string | string[] | undefined): boolean
212
+ isModuleUsed(runtime: string | string[] | undefined): boolean
213
+ setUsedInUnknownWay(runtime: string | string[] | undefined): boolean
214
+ getUsed(name: string | string[], runtime: string | string[] | undefined): 0 | 1 | 2 | 3 | 4
215
+ }
216
+
165
217
  export declare class JsModule {
166
218
  get context(): string | undefined
167
219
  get originalSource(): JsCompatSource | undefined
@@ -184,8 +236,18 @@ export declare class JsModule {
184
236
 
185
237
  export declare class JsModuleGraph {
186
238
  getModule(jsDependency: JsDependency): JsModule | null
239
+ getResolvedModule(jsDependency: JsDependency): JsModule | null
187
240
  getUsedExports(jsModule: JsModule, jsRuntime: string | Array<string>): boolean | Array<string> | null
188
241
  getIssuer(module: JsModule): JsModule | null
242
+ getExportsInfo(module: JsModule): JsExportsInfo
243
+ getConnection(dependency: JsDependency): JsModuleGraphConnection | null
244
+ getOutgoingConnections(module: JsModule): JsModuleGraphConnection[]
245
+ getIncomingConnections(module: JsModule): JsModuleGraphConnection[]
246
+ }
247
+
248
+ export declare class JsModuleGraphConnection {
249
+ get dependency(): JsDependency
250
+ get module(): JsModule | null
189
251
  }
190
252
 
191
253
  export declare class JsResolver {
@@ -211,7 +273,7 @@ export declare class RawExternalItemFnCtx {
211
273
  }
212
274
 
213
275
  export declare class Rspack {
214
- constructor(options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS, resolverFactoryReference: JsResolverFactory)
276
+ constructor(compilerPath: string, options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory)
215
277
  setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
216
278
  /** Build with the given option passed to the constructor */
217
279
  build(callback: (err: null | Error) => void): void
@@ -219,30 +281,6 @@ export declare class Rspack {
219
281
  rebuild(changed_files: string[], removed_files: string[], callback: (err: null | Error) => void): void
220
282
  }
221
283
 
222
- export declare function __chunk_graph_inner_get_chunk_entry_dependent_chunks_iterable(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
223
-
224
- export declare function __chunk_graph_inner_get_chunk_entry_modules(jsChunkUkey: number, jsCompilation: JsCompilation): JsModule[]
225
-
226
- export declare function __chunk_graph_inner_get_chunk_modules(jsChunkUkey: number, jsCompilation: JsCompilation): JsModule[]
227
-
228
- export declare function __chunk_graph_inner_get_chunk_modules_iterable_by_source_type(jsChunkUkey: number, sourceType: string, jsCompilation: JsCompilation): JsModule[]
229
-
230
- export declare function __chunk_group_inner_get_chunk_group(ukey: number, jsCompilation: JsCompilation): JsChunkGroup
231
-
232
- export declare function __chunk_inner_can_be_initial(jsChunkUkey: number, jsCompilation: JsCompilation): boolean
233
-
234
- export declare function __chunk_inner_get_all_async_chunks(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
235
-
236
- export declare function __chunk_inner_get_all_initial_chunks(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
237
-
238
- export declare function __chunk_inner_get_all_referenced_chunks(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
239
-
240
- export declare function __chunk_inner_has_runtime(jsChunkUkey: number, jsCompilation: JsCompilation): boolean
241
-
242
- export declare function __chunk_inner_is_only_initial(jsChunkUkey: number, jsCompilation: JsCompilation): boolean
243
-
244
- export declare function __entrypoint_inner_get_runtime_chunk(ukey: number, jsCompilation: JsCompilation): JsChunk
245
-
246
284
  export interface BuiltinPlugin {
247
285
  name: BuiltinPluginName
248
286
  options: unknown
@@ -287,6 +325,7 @@ export declare enum BuiltinPluginName {
287
325
  NaturalChunkIdsPlugin = 'NaturalChunkIdsPlugin',
288
326
  NamedChunkIdsPlugin = 'NamedChunkIdsPlugin',
289
327
  DeterministicChunkIdsPlugin = 'DeterministicChunkIdsPlugin',
328
+ OccurrenceChunkIdsPlugin = 'OccurrenceChunkIdsPlugin',
290
329
  RealContentHashPlugin = 'RealContentHashPlugin',
291
330
  RemoveEmptyChunksPlugin = 'RemoveEmptyChunksPlugin',
292
331
  EnsureChunkConditionsPlugin = 'EnsureChunkConditionsPlugin',
@@ -332,6 +371,7 @@ export declare function cleanupGlobalTrace(): void
332
371
 
333
372
  export interface ContextInfo {
334
373
  issuer: string
374
+ issuerLayer?: string
335
375
  }
336
376
 
337
377
  export declare function formatDiagnostic(diagnostic: JsDiagnostic): ExternalObject<'Diagnostic'>
@@ -444,6 +484,12 @@ export interface JsAssetInfoRelated {
444
484
  sourceMap?: string
445
485
  }
446
486
 
487
+ export interface JsBannerContentFnCtx {
488
+ hash: string
489
+ chunk: JsChunk
490
+ filename: string
491
+ }
492
+
447
493
  export interface JsBeforeAssetTagGenerationData {
448
494
  assets: JsHtmlPluginAssets
449
495
  outputName: string
@@ -485,44 +531,22 @@ export interface JsCacheGroupTestCtx {
485
531
  module: JsModule
486
532
  }
487
533
 
488
- export interface JsChunk {
489
- __inner_ukey: number
490
- __inner_groups: Array<number>
491
- name?: string
492
- id?: string
493
- ids: Array<string>
494
- idNameHints: Array<string>
495
- filenameTemplate?: string
496
- cssFilenameTemplate?: string
497
- files: Array<string>
498
- runtime: Array<string>
499
- hash?: string
500
- contentHash: Record<string, string>
501
- renderedHash?: string
502
- chunkReason?: string
503
- auxiliaryFiles: Array<string>
504
- }
505
-
506
534
  export interface JsChunkAssetArgs {
507
535
  chunk: JsChunk
508
536
  filename: string
509
537
  }
510
538
 
511
- export interface JsChunkGroup {
512
- __inner_parents: Array<number>
513
- __inner_ukey: number
514
- chunks: Array<JsChunk>
515
- index?: number
516
- name?: string
517
- isInitial: boolean
518
- origins: Array<JsChunkGroupOrigin>
519
- }
520
-
521
539
  export interface JsChunkGroupOrigin {
522
540
  module?: JsModule | undefined
523
541
  request?: string
524
542
  }
525
543
 
544
+ export interface JsChunkOptionNameCtx {
545
+ module: JsModule
546
+ chunks: JsChunk[]
547
+ cacheGroupKey: string
548
+ }
549
+
526
550
  /**
527
551
  * File clean options
528
552
  *
@@ -598,7 +622,7 @@ export interface JsEntryData {
598
622
  export interface JsEntryOptions {
599
623
  name?: string
600
624
  runtime?: false | string
601
- chunkLoading?: string
625
+ chunkLoading?: false | string
602
626
  asyncChunks?: boolean
603
627
  publicPath?: "auto" | JsFilename
604
628
  baseUri?: string
@@ -629,6 +653,7 @@ export interface JsExecuteModuleResult {
629
653
  cacheable: boolean
630
654
  assets: Array<string>
631
655
  id: number
656
+ error?: string
632
657
  }
633
658
 
634
659
  export interface JsFactorizeArgs {
@@ -672,7 +697,7 @@ export interface JsLibraryAuxiliaryComment {
672
697
  export interface JsLibraryCustomUmdObject {
673
698
  amd?: string
674
699
  commonjs?: string
675
- root?: Array<string>
700
+ root?: Array<string> | string
676
701
  }
677
702
 
678
703
  export interface JsLibraryName {
@@ -683,11 +708,11 @@ export interface JsLibraryName {
683
708
  }
684
709
 
685
710
  export interface JsLibraryOptions {
686
- name?: JsLibraryName
687
- export?: Array<string>
688
- libraryType: string
711
+ name?: string | Array<string> | JsLibraryCustomUmdObject
712
+ export?: Array<string> | string
713
+ type: string
689
714
  umdNamedDefine?: boolean
690
- auxiliaryComment?: JsLibraryAuxiliaryComment
715
+ auxiliaryComment?: string | JsLibraryAuxiliaryComment
691
716
  amdContainer?: string
692
717
  }
693
718
 
@@ -1081,6 +1106,7 @@ export interface JsTap {
1081
1106
  export interface NodeFsStats {
1082
1107
  isFile: boolean
1083
1108
  isDirectory: boolean
1109
+ isSymlink: boolean
1084
1110
  atimeMs: number
1085
1111
  mtimeMs: number
1086
1112
  ctimeMs: number
@@ -1098,9 +1124,9 @@ export interface RawAliasOptionItem {
1098
1124
  redirect: Array<string | false>
1099
1125
  }
1100
1126
 
1101
- export interface RawAssetGeneratorDataUrlFnArgs {
1127
+ export interface RawAssetGeneratorDataUrlFnCtx {
1102
1128
  filename: string
1103
- content: string
1129
+ module: JsModule
1104
1130
  }
1105
1131
 
1106
1132
  export interface RawAssetGeneratorDataUrlOptions {
@@ -1111,12 +1137,13 @@ export interface RawAssetGeneratorDataUrlOptions {
1111
1137
  export interface RawAssetGeneratorOptions {
1112
1138
  emit?: boolean
1113
1139
  filename?: JsFilename
1140
+ outputPath?: JsFilename
1114
1141
  publicPath?: "auto" | JsFilename
1115
- dataUrl?: RawAssetGeneratorDataUrlOptions | ((arg: RawAssetGeneratorDataUrlFnArgs) => string)
1142
+ dataUrl?: RawAssetGeneratorDataUrlOptions | ((source: Buffer, context: RawAssetGeneratorDataUrlFnCtx) => string)
1116
1143
  }
1117
1144
 
1118
1145
  export interface RawAssetInlineGeneratorOptions {
1119
- dataUrl?: RawAssetGeneratorDataUrlOptions | ((arg: RawAssetGeneratorDataUrlFnArgs) => string)
1146
+ dataUrl?: RawAssetGeneratorDataUrlOptions | ((source: Buffer, context: RawAssetGeneratorDataUrlFnCtx) => string)
1120
1147
  }
1121
1148
 
1122
1149
  export interface RawAssetParserDataUrl {
@@ -1135,15 +1162,10 @@ export interface RawAssetParserOptions {
1135
1162
  export interface RawAssetResourceGeneratorOptions {
1136
1163
  emit?: boolean
1137
1164
  filename?: JsFilename
1165
+ outputPath?: JsFilename
1138
1166
  publicPath?: "auto" | JsFilename
1139
1167
  }
1140
1168
 
1141
- export interface RawBannerContentFnCtx {
1142
- hash: string
1143
- chunk: JsChunk
1144
- filename: string
1145
- }
1146
-
1147
1169
  export interface RawBannerPluginOptions {
1148
1170
  banner: string | ((...args: any[]) => any)
1149
1171
  entryOnly?: boolean
@@ -1165,7 +1187,7 @@ export interface RawCacheGroupOptions {
1165
1187
  key: string
1166
1188
  priority?: number
1167
1189
  test?: RegExp | string | Function
1168
- filename?: string
1190
+ filename?: JsFilename
1169
1191
  idHint?: string
1170
1192
  /** What kind of chunks should be selected. */
1171
1193
  chunks?: RegExp | 'async' | 'initial' | 'all'
@@ -1187,20 +1209,6 @@ export interface RawCacheGroupOptions {
1187
1209
 
1188
1210
  export interface RawCacheOptions {
1189
1211
  type: string
1190
- maxGenerations: number
1191
- maxAge: number
1192
- profile: boolean
1193
- buildDependencies: Array<string>
1194
- cacheDirectory: string
1195
- cacheLocation: string
1196
- name: string
1197
- version: string
1198
- }
1199
-
1200
- export interface RawChunkOptionNameCtx {
1201
- module: JsModule
1202
- chunks: Array<JsChunk>
1203
- cacheGroupKey: string
1204
1212
  }
1205
1213
 
1206
1214
  export interface RawConsumeOptions {
@@ -1269,12 +1277,6 @@ export interface RawCopyRspackPluginOptions {
1269
1277
  patterns: Array<RawCopyPattern>
1270
1278
  }
1271
1279
 
1272
- export interface RawCrossOriginLoading {
1273
- type: "bool" | "string"
1274
- stringPayload?: string
1275
- boolPayload?: boolean
1276
- }
1277
-
1278
1280
  export interface RawCssAutoGeneratorOptions {
1279
1281
  exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only"
1280
1282
  exportsOnly?: boolean
@@ -1295,6 +1297,7 @@ export interface RawCssExtractPluginOption {
1295
1297
  linkType?: string
1296
1298
  runtime: boolean
1297
1299
  pathinfo: boolean
1300
+ enforceRelative: boolean
1298
1301
  }
1299
1302
 
1300
1303
  export interface RawCssGeneratorOptions {
@@ -1317,6 +1320,10 @@ export interface RawCssParserOptions {
1317
1320
  namedExports?: boolean
1318
1321
  }
1319
1322
 
1323
+ export interface RawDependency {
1324
+ request: string
1325
+ }
1326
+
1320
1327
  export interface RawDllEntryPluginOptions {
1321
1328
  context: string
1322
1329
  entries: Array<string>
@@ -1372,22 +1379,19 @@ export interface RawEvalDevToolModulePluginOptions {
1372
1379
  sourceUrlComment?: string
1373
1380
  }
1374
1381
 
1375
- export interface RawExperimentCacheOptionsCommon {
1376
- type: "disable"|"memory"
1377
- }
1378
-
1379
1382
  export interface RawExperimentCacheOptionsPersistent {
1380
- type: "persistent"
1381
- snapshot: RawExperimentSnapshotOptions
1382
- storage: Array<RawStorageOptions>
1383
+ buildDependencies?: Array<string>
1384
+ version?: string
1385
+ snapshot?: RawExperimentSnapshotOptions
1386
+ storage?: RawStorageOptions
1383
1387
  }
1384
1388
 
1385
1389
  export interface RawExperiments {
1386
1390
  layers: boolean
1387
1391
  topLevelAwait: boolean
1388
- incremental?: RawIncremental
1389
- rspackFuture: RawRspackFuture
1390
- cache: RawExperimentCacheOptionsPersistent | RawExperimentCacheOptionsCommon
1392
+ incremental?: false | { [key: string]: boolean }
1393
+ rspackFuture?: RawRspackFuture
1394
+ cache: boolean | { type: "persistent" } & RawExperimentCacheOptionsPersistent | { type: "memory" }
1391
1395
  }
1392
1396
 
1393
1397
  export interface RawExperimentSnapshotOptions {
@@ -1511,6 +1515,7 @@ export interface RawIncremental {
1511
1515
  inferAsyncModules: boolean
1512
1516
  providedExports: boolean
1513
1517
  dependenciesDiagnostics: boolean
1518
+ sideEffects: boolean
1514
1519
  buildChunkGraph: boolean
1515
1520
  moduleIds: boolean
1516
1521
  chunkIds: boolean
@@ -1572,6 +1577,10 @@ export interface RawJavascriptParserOptions {
1572
1577
  importDynamic?: boolean
1573
1578
  }
1574
1579
 
1580
+ export interface RawJsonParserOptions {
1581
+ exportsDepth?: number
1582
+ }
1583
+
1575
1584
  export interface RawLazyCompilationOption {
1576
1585
  module: ((err: Error | null, arg: RawModuleArg) => RawModuleInfo)
1577
1586
  test?: RawLazyCompilationTest
@@ -1728,28 +1737,31 @@ export interface RawNonStandard {
1728
1737
  deepSelectorCombinator: boolean
1729
1738
  }
1730
1739
 
1740
+ export interface RawOccurrenceChunkIdsPluginOptions {
1741
+ prioritiseInitial?: boolean
1742
+ }
1743
+
1731
1744
  export interface RawOptimizationOptions {
1732
1745
  removeAvailableModules: boolean
1733
- sideEffects: string
1734
- usedExports: string
1746
+ sideEffects: boolean | string
1747
+ usedExports: boolean | string
1735
1748
  providedExports: boolean
1736
1749
  innerGraph: boolean
1737
- mangleExports: string
1750
+ mangleExports: boolean | string
1738
1751
  concatenateModules: boolean
1752
+ avoidEntryIife: boolean
1739
1753
  }
1740
1754
 
1741
1755
  export interface RawOptions {
1756
+ name?: string
1742
1757
  mode?: undefined | 'production' | 'development' | 'none'
1743
- target: Array<string>
1744
1758
  context: string
1745
1759
  output: RawOutputOptions
1746
1760
  resolve: RawResolveOptions
1747
1761
  resolveLoader: RawResolveOptions
1748
1762
  module: RawModuleOptions
1749
- devtool: string
1750
1763
  optimization: RawOptimizationOptions
1751
1764
  stats: RawStatsOptions
1752
- snapshot: RawSnapshotOptions
1753
1765
  cache: RawCacheOptions
1754
1766
  experiments: RawExperiments
1755
1767
  node?: RawNodeOption
@@ -1765,12 +1777,12 @@ export interface RawOutputOptions {
1765
1777
  clean: boolean | JsCleanOptions
1766
1778
  publicPath: "auto" | JsFilename
1767
1779
  assetModuleFilename: JsFilename
1768
- wasmLoading: string
1780
+ wasmLoading: string | false
1769
1781
  enabledWasmLoadingTypes: Array<string>
1770
1782
  webassemblyModuleFilename: string
1771
1783
  filename: JsFilename
1772
1784
  chunkFilename: JsFilename
1773
- crossOriginLoading: RawCrossOriginLoading
1785
+ crossOriginLoading: string | false
1774
1786
  cssFilename: JsFilename
1775
1787
  cssChunkFilename: JsFilename
1776
1788
  hotUpdateMainFilename: string
@@ -1786,7 +1798,7 @@ export interface RawOutputOptions {
1786
1798
  importMetaName: string
1787
1799
  iife: boolean
1788
1800
  module: boolean
1789
- chunkLoading: string
1801
+ chunkLoading: string | false
1790
1802
  chunkLoadTimeout: number
1791
1803
  charset: boolean
1792
1804
  enabledChunkLoadingTypes?: Array<string>
@@ -1797,21 +1809,22 @@ export interface RawOutputOptions {
1797
1809
  hashDigestLength: number
1798
1810
  hashSalt?: string
1799
1811
  asyncChunks: boolean
1800
- workerChunkLoading: string
1801
- workerWasmLoading: string
1812
+ workerChunkLoading: string | false
1813
+ workerWasmLoading: string | false
1802
1814
  workerPublicPath: string
1803
- scriptType: "module" | "text/javascript" | "false"
1815
+ scriptType: "module" | "text/javascript" | false
1804
1816
  environment: RawEnvironment
1805
1817
  compareBeforeEmit: boolean
1806
1818
  }
1807
1819
 
1808
1820
  export interface RawParserOptions {
1809
- type: "asset" | "css" | "css/auto" | "css/module" | "javascript" | "javascript/auto" | "javascript/dynamic" | "javascript/esm"
1821
+ type: "asset" | "css" | "css/auto" | "css/module" | "javascript" | "javascript/auto" | "javascript/dynamic" | "javascript/esm" | "json"
1810
1822
  asset?: RawAssetParserOptions
1811
1823
  css?: RawCssParserOptions
1812
1824
  cssAuto?: RawCssAutoParserOptions
1813
1825
  cssModule?: RawCssModuleParserOptions
1814
1826
  javascript?: RawJavascriptParserOptions
1827
+ json?: RawJsonParserOptions
1815
1828
  }
1816
1829
 
1817
1830
  export interface RawPathData {
@@ -1948,10 +1961,6 @@ export interface RawSizeLimitsPluginOptions {
1948
1961
  maxEntrypointSize?: number
1949
1962
  }
1950
1963
 
1951
- export interface RawSnapshotOptions {
1952
-
1953
- }
1954
-
1955
1964
  export interface RawSourceMapDevToolPluginOptions {
1956
1965
  append?: (false | null) | string | Function
1957
1966
  columns?: boolean
@@ -2036,7 +2045,7 @@ export interface RawTrustedTypes {
2036
2045
  * Author Donny/강동윤
2037
2046
  * Copyright (c)
2038
2047
  */
2039
- export declare function registerGlobalTrace(filter: string, layer: "chrome" | "logger"| "console", output: string): void
2048
+ export declare function registerGlobalTrace(filter: string, layer: "chrome" | "logger", output: string): void
2040
2049
 
2041
2050
  export declare enum RegisterJsTapKind {
2042
2051
  CompilerThisCompilation = 0,
@@ -2127,21 +2136,21 @@ export interface RegisterJsTaps {
2127
2136
  }
2128
2137
 
2129
2138
  export interface ThreadsafeNodeFS {
2130
- writeFile: (name: string, content: Buffer) => Promise<void> | void
2131
- removeFile: (name: string) => Promise<void> | void
2132
- mkdir: (name: string) => Promise<void> | void
2133
- mkdirp: (name: string) => Promise<string | void> | string | void
2134
- removeDirAll: (name: string) => Promise<string | void> | string | void
2135
- readDir: (name: string) => Promise<string[] | void> | string[] | void
2136
- readFile: (name: string) => Promise<Buffer | string | void> | Buffer | string | void
2137
- stat: (name: string) => Promise<NodeFsStats | void> | NodeFsStats | void
2138
- lstat: (name: string) => Promise<NodeFsStats | void> | NodeFsStats | void
2139
- open: (name: string, flags: string) => Promise<number | void> | number | void
2140
- rename: (from: string, to: string) => Promise<void> | void
2141
- close: (fd: number) => Promise<void> | void
2142
- write: (fd: number, content: Buffer, position: number) => Promise<number | void> | number | void
2143
- writeAll: (fd: number, content: Buffer) => Promise<number | void> | number | void
2144
- read: (fd: number, length: number, position: number) => Promise<Buffer | void> | Buffer | void
2145
- readUntil: (fd: number, code: number, position: number) => Promise<Buffer | void> | Buffer | void
2146
- readToEnd: (fd: number, position: number) => Promise<Buffer | void> | Buffer | void
2139
+ writeFile: (name: string, content: Buffer) => Promise<void>
2140
+ removeFile: (name: string) => Promise<void>
2141
+ mkdir: (name: string) => Promise<void>
2142
+ mkdirp: (name: string) => Promise<string | void>
2143
+ removeDirAll: (name: string) => Promise<string | void>
2144
+ readDir: (name: string) => Promise<string[] | void>
2145
+ readFile: (name: string) => Promise<Buffer | string | void>
2146
+ stat: (name: string) => Promise<NodeFsStats | void>
2147
+ lstat: (name: string) => Promise<NodeFsStats | void>
2148
+ open: (name: string, flags: string) => Promise<number | void>
2149
+ rename: (from: string, to: string) => Promise<void>
2150
+ close: (fd: number) => Promise<void>
2151
+ write: (fd: number, content: Buffer, position: number) => Promise<number | void>
2152
+ writeAll: (fd: number, content: Buffer) => Promise<number | void>
2153
+ read: (fd: number, length: number, position: number) => Promise<Buffer | void>
2154
+ readUntil: (fd: number, code: number, position: number) => Promise<Buffer | void>
2155
+ readToEnd: (fd: number, position: number) => Promise<Buffer | void>
2147
2156
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "1.1.8",
3
+ "version": "1.2.0-beta.0",
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.64",
21
- "typescript": "^5.6.3"
20
+ "@napi-rs/cli": "3.0.0-alpha.65",
21
+ "typescript": "^5.7.2"
22
22
  },
23
23
  "napi": {
24
24
  "binaryName": "rspack"
25
25
  },
26
26
  "optionalDependencies": {
27
- "@rspack/binding-darwin-arm64": "1.1.8",
28
- "@rspack/binding-win32-arm64-msvc": "1.1.8",
29
- "@rspack/binding-linux-arm64-gnu": "1.1.8",
30
- "@rspack/binding-linux-arm64-musl": "1.1.8",
31
- "@rspack/binding-win32-ia32-msvc": "1.1.8",
32
- "@rspack/binding-win32-x64-msvc": "1.1.8",
33
- "@rspack/binding-darwin-x64": "1.1.8",
34
- "@rspack/binding-linux-x64-gnu": "1.1.8",
35
- "@rspack/binding-linux-x64-musl": "1.1.8"
27
+ "@rspack/binding-darwin-arm64": "1.2.0-beta.0",
28
+ "@rspack/binding-win32-arm64-msvc": "1.2.0-beta.0",
29
+ "@rspack/binding-linux-arm64-gnu": "1.2.0-beta.0",
30
+ "@rspack/binding-linux-arm64-musl": "1.2.0-beta.0",
31
+ "@rspack/binding-win32-ia32-msvc": "1.2.0-beta.0",
32
+ "@rspack/binding-darwin-x64": "1.2.0-beta.0",
33
+ "@rspack/binding-win32-x64-msvc": "1.2.0-beta.0",
34
+ "@rspack/binding-linux-x64-musl": "1.2.0-beta.0",
35
+ "@rspack/binding-linux-x64-gnu": "1.2.0-beta.0"
36
36
  },
37
37
  "scripts": {
38
38
  "build:debug": "node scripts/build.js",