@rspack/binding 0.1.10 → 0.1.12

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 +70 -14
  2. package/package.json +10 -10
package/binding.d.ts CHANGED
@@ -27,6 +27,10 @@ export class JsCompilation {
27
27
  getBuildDependencies(): Array<string>
28
28
  pushDiagnostic(severity: "error" | "warning", title: string, message: string): void
29
29
  getStats(): JsStats
30
+ getAssetPath(filename: string, data: PathData): string
31
+ getAssetPathWithInfo(filename: string, data: PathData): PathWithInfo
32
+ getPath(filename: string, data: PathData): string
33
+ getPathWithInfo(filename: string, data: PathData): PathWithInfo
30
34
  addFileDependencies(deps: Array<string>): void
31
35
  addContextDependencies(deps: Array<string>): void
32
36
  addMissingDependencies(deps: Array<string>): void
@@ -35,8 +39,8 @@ export class JsCompilation {
35
39
 
36
40
  export class JsStats {
37
41
  getAssets(): JsStatsGetAssets
38
- getModules(reasons: boolean, moduleAssets: boolean): Array<JsStatsModule>
39
- getChunks(chunkModules: boolean, chunksRelations: boolean, reasons: boolean, moduleAssets: boolean): Array<JsStatsChunk>
42
+ getModules(reasons: boolean, moduleAssets: boolean, nestedModules: boolean): Array<JsStatsModule>
43
+ getChunks(chunkModules: boolean, chunksRelations: boolean, reasons: boolean, moduleAssets: boolean, nestedModules: boolean): Array<JsStatsChunk>
40
44
  getEntrypoints(): Array<JsStatsChunkGroup>
41
45
  getNamedChunkGroups(): Array<JsStatsChunkGroup>
42
46
  getErrors(): Array<JsStatsError>
@@ -81,6 +85,14 @@ export class Rspack {
81
85
  unsafe_drop(): void
82
86
  }
83
87
 
88
+ export interface AfterResolveData {
89
+ request: string
90
+ context?: string
91
+ fileDependencies: Array<string>
92
+ contextDependencies: Array<string>
93
+ missingDependencies: Array<string>
94
+ }
95
+
84
96
  export interface BeforeResolveData {
85
97
  request: string
86
98
  context?: string
@@ -102,10 +114,9 @@ export interface JsAsset {
102
114
  }
103
115
 
104
116
  export interface JsAssetInfo {
105
- /**
106
- * if the asset can be long term cached forever (contains a hash)
107
- * whether the asset is minimized
108
- */
117
+ /** if the asset can be long term cached forever (contains a hash) */
118
+ immutable: boolean
119
+ /** whether the asset is minimized */
109
120
  minimized: boolean
110
121
  /**
111
122
  * the value(s) of the full hash used for this asset
@@ -113,7 +124,7 @@ export interface JsAssetInfo {
113
124
  * the value(s) of the module hash used for this asset
114
125
  * the value(s) of the content hash used for this asset
115
126
  */
116
- contentHash?: string
127
+ contentHash: Array<string>
117
128
  /**
118
129
  * when asset was created from a source file (potentially transformed), the original filename relative to compilation context
119
130
  * size in bytes, only set after asset has been emitted
@@ -172,8 +183,10 @@ export interface JsHooks {
172
183
  optimizeModules: (...args: any[]) => any
173
184
  optimizeChunkModule: (...args: any[]) => any
174
185
  beforeCompile: (...args: any[]) => any
186
+ afterCompile: (...args: any[]) => any
175
187
  finishModules: (...args: any[]) => any
176
188
  beforeResolve: (...args: any[]) => any
189
+ afterResolve: (...args: any[]) => any
177
190
  contextModuleBeforeResolve: (...args: any[]) => any
178
191
  normalModuleFactoryResolveForScheme: (...args: any[]) => any
179
192
  chunkAsset: (...args: any[]) => any
@@ -223,6 +236,16 @@ export interface JsModule {
223
236
  moduleIdentifier: string
224
237
  }
225
238
 
239
+ export interface JsResolveForSchemeInput {
240
+ resourceData: JsResourceData
241
+ scheme: string
242
+ }
243
+
244
+ export interface JsResolveForSchemeResult {
245
+ resourceData: JsResourceData
246
+ stop: boolean
247
+ }
248
+
226
249
  export interface JsResourceData {
227
250
  /** Resource with absolute path, query and fragment */
228
251
  resource: string
@@ -332,6 +355,20 @@ export interface NodeFS {
332
355
  mkdirp: (...args: any[]) => any
333
356
  }
334
357
 
358
+ export interface PathData {
359
+ filename?: string
360
+ hash?: string
361
+ contentHash?: string
362
+ runtime?: string
363
+ url?: string
364
+ id?: string
365
+ }
366
+
367
+ export interface PathWithInfo {
368
+ path: string
369
+ info: JsAssetInfo
370
+ }
371
+
335
372
  export interface RawAssetParserDataUrlOption {
336
373
  maxSize?: number
337
374
  }
@@ -371,7 +408,7 @@ export interface RawBuiltins {
371
408
  presetEnv?: RawPresetEnv
372
409
  define: Record<string, string>
373
410
  provide: Record<string, string[]>
374
- treeShaking: boolean
411
+ treeShaking: string
375
412
  progress?: RawProgressPluginConfig
376
413
  react: RawReactOptions
377
414
  decorator?: RawDecoratorOptions
@@ -392,8 +429,12 @@ export interface RawCacheGroupOptions {
392
429
  chunks?: string
393
430
  minChunks?: number
394
431
  minSize?: number
432
+ maxSize?: number
433
+ maxAsyncSize?: number
434
+ maxInitialSize?: number
395
435
  name?: string
396
436
  reuseExistingChunk?: boolean
437
+ enforce?: boolean
397
438
  }
398
439
 
399
440
  export interface RawCacheOptions {
@@ -474,9 +515,10 @@ export interface RawExternalItemFnResult {
474
515
  }
475
516
 
476
517
  export interface RawExternalItemValue {
477
- type: "string" | "bool"
518
+ type: "string" | "bool" | "array"
478
519
  stringPayload?: string
479
520
  boolPayload?: boolean
521
+ arrayPayload?: Array<string>
480
522
  }
481
523
 
482
524
  export interface RawExternalsPresets {
@@ -484,6 +526,14 @@ export interface RawExternalsPresets {
484
526
  web: boolean
485
527
  }
486
528
 
529
+ export interface RawFallbackCacheGroupOptions {
530
+ chunks?: string
531
+ minSize?: number
532
+ maxSize?: number
533
+ maxAsyncSize?: number
534
+ maxInitialSize?: number
535
+ }
536
+
487
537
  export interface RawGlobOptions {
488
538
  caseSensitiveMatch?: boolean
489
539
  dot?: boolean
@@ -555,6 +605,7 @@ export interface RawModuleRule {
555
605
  resource?: RawRuleSetCondition
556
606
  /** A condition matcher against the resource query. */
557
607
  resourceQuery?: RawRuleSetCondition
608
+ resourceFragment?: RawRuleSetCondition
558
609
  descriptionData?: Record<string, RawRuleSetCondition>
559
610
  sideEffects?: boolean
560
611
  use?: Array<RawModuleRuleUse>
@@ -564,6 +615,8 @@ export interface RawModuleRule {
564
615
  resolve?: RawResolveOptions
565
616
  issuer?: RawRuleSetCondition
566
617
  dependency?: RawRuleSetCondition
618
+ scheme?: RawRuleSetCondition
619
+ mimetype?: RawRuleSetCondition
567
620
  oneOf?: Array<RawModuleRule>
568
621
  /** Specifies the category of the loader. No value means normal loader. */
569
622
  enforce?: 'pre' | 'post'
@@ -604,6 +657,7 @@ export interface RawOptimizationOptions {
604
657
  splitChunks?: RawSplitChunksOptions
605
658
  moduleIds: string
606
659
  removeAvailableModules: boolean
660
+ removeEmptyChunks: boolean
607
661
  sideEffects: string
608
662
  realContentHash: boolean
609
663
  }
@@ -649,6 +703,8 @@ export interface RawOutputOptions {
649
703
  crossOriginLoading: RawCrossOriginLoading
650
704
  cssFilename: string
651
705
  cssChunkFilename: string
706
+ hotUpdateMainFilename: string
707
+ hotUpdateChunkFilename: string
652
708
  uniqueName: string
653
709
  chunkLoadingGlobal: string
654
710
  library?: RawLibraryOptions
@@ -747,6 +803,7 @@ export interface RawResolveOptions {
747
803
  modules?: Array<string>
748
804
  byDependency?: Record<string, RawResolveOptions>
749
805
  fullySpecified?: boolean
806
+ exportsFields?: Array<string>
750
807
  }
751
808
 
752
809
  export interface RawRuleSetCondition {
@@ -775,6 +832,7 @@ export interface RawSnapshotStrategy {
775
832
  }
776
833
 
777
834
  export interface RawSplitChunksOptions {
835
+ fallbackCacheGroup?: RawFallbackCacheGroupOptions
778
836
  name?: string
779
837
  cacheGroups?: Record<string, RawCacheGroupOptions>
780
838
  /** What kind of chunks should be selected. */
@@ -785,6 +843,9 @@ export interface RawSplitChunksOptions {
785
843
  minSize?: number
786
844
  enforceSizeThreshold?: number
787
845
  minRemainingSize?: number
846
+ maxSize?: number
847
+ maxAsyncSize?: number
848
+ maxInitialSize?: number
788
849
  }
789
850
 
790
851
  export interface RawStatsOptions {
@@ -802,11 +863,6 @@ export interface RawTrustedTypes {
802
863
  policyName?: string
803
864
  }
804
865
 
805
- export interface SchemeAndJsResourceData {
806
- resourceData: JsResourceData
807
- scheme: string
808
- }
809
-
810
866
  export interface ThreadsafeNodeFS {
811
867
  writeFile: (...args: any[]) => any
812
868
  mkdir: (...args: any[]) => any
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "binding.js",
@@ -25,15 +25,15 @@
25
25
  "binaryName": "rspack"
26
26
  },
27
27
  "optionalDependencies": {
28
- "@rspack/binding-darwin-arm64": "0.1.10",
29
- "@rspack/binding-win32-arm64-msvc": "0.1.10",
30
- "@rspack/binding-linux-arm64-gnu": "0.1.10",
31
- "@rspack/binding-linux-arm64-musl": "0.1.10",
32
- "@rspack/binding-win32-ia32-msvc": "0.1.10",
33
- "@rspack/binding-darwin-x64": "0.1.10",
34
- "@rspack/binding-win32-x64-msvc": "0.1.10",
35
- "@rspack/binding-linux-x64-gnu": "0.1.10",
36
- "@rspack/binding-linux-x64-musl": "0.1.10"
28
+ "@rspack/binding-darwin-arm64": "0.1.12",
29
+ "@rspack/binding-win32-arm64-msvc": "0.1.12",
30
+ "@rspack/binding-linux-arm64-gnu": "0.1.12",
31
+ "@rspack/binding-linux-arm64-musl": "0.1.12",
32
+ "@rspack/binding-win32-ia32-msvc": "0.1.12",
33
+ "@rspack/binding-darwin-x64": "0.1.12",
34
+ "@rspack/binding-win32-x64-msvc": "0.1.12",
35
+ "@rspack/binding-linux-x64-gnu": "0.1.12",
36
+ "@rspack/binding-linux-x64-musl": "0.1.12"
37
37
  },
38
38
  "scripts": {
39
39
  "build:debug": "node scripts/build.js",