@rspack/binding 1.2.2 → 1.2.3

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 +198 -6
  2. package/package.json +11 -11
package/binding.d.ts CHANGED
@@ -67,6 +67,7 @@ export declare class JsChunk {
67
67
  getAllInitialChunks(): JsChunk[]
68
68
  getAllReferencedChunks(): JsChunk[]
69
69
  groups(): JsChunkGroup[]
70
+ getEntryOptions(): EntryOptionsDTO | undefined
70
71
  }
71
72
 
72
73
  export declare class JsChunkGraph {
@@ -77,6 +78,7 @@ export declare class JsChunkGraph {
77
78
  getChunkModulesIterableBySourceType(chunk: JsChunk, sourceType: string): JsModule[]
78
79
  getModuleChunks(module: JsModule): JsChunk[]
79
80
  getModuleId(jsModule: JsModule): string | null
81
+ getBlockChunkGroup(jsBlock: JsDependenciesBlock): JsChunkGroup | null
80
82
  }
81
83
 
82
84
  export declare class JsChunkGroup {
@@ -84,6 +86,7 @@ export declare class JsChunkGroup {
84
86
  get index(): number | undefined
85
87
  get name(): string | undefined
86
88
  get origins(): Array<JsChunkGroupOrigin>
89
+ get childrenIterable(): JsChunkGroup[]
87
90
  isInitial(): boolean
88
91
  getParents(): JsChunkGroup[]
89
92
  getRuntimeChunk(): JsChunk
@@ -102,18 +105,17 @@ export declare class JsCompilation {
102
105
  getOptimizationBailout(): Array<JsStatsOptimizationBailout>
103
106
  getChunks(): JsChunk[]
104
107
  getNamedChunkKeys(): Array<string>
105
- getNamedChunk(name: string): JsChunk
108
+ getNamedChunk(name: string): JsChunk | null
106
109
  getNamedChunkGroupKeys(): Array<string>
107
110
  getNamedChunkGroup(name: string): JsChunkGroup
108
111
  setAssetSource(name: string, source: JsCompatSource): void
109
112
  deleteAssetSource(name: string): void
110
113
  getAssetFilenames(): Array<string>
111
114
  hasAsset(name: string): boolean
112
- emitAssetFromLoader(filename: string, source: JsCompatSource, assetInfo: JsAssetInfo, module: string): void
113
115
  emitAsset(filename: string, source: JsCompatSource, assetInfo: JsAssetInfo): void
114
116
  deleteAsset(filename: string): void
115
117
  renameAsset(filename: string, newName: string): void
116
- get entrypoints(): Record<string, JsChunkGroup>
118
+ get entrypoints(): JsChunkGroup[]
117
119
  get chunkGroups(): JsChunkGroup[]
118
120
  get hash(): string | null
119
121
  dependencies(): JsDependencies
@@ -197,6 +199,7 @@ export declare class JsDependency {
197
199
  get request(): string | undefined
198
200
  get critical(): boolean
199
201
  set critical(val: boolean)
202
+ get ids(): Array<string> | undefined
200
203
  }
201
204
 
202
205
  export declare class JsEntries {
@@ -235,6 +238,10 @@ export declare class JsModule {
235
238
  size(ty?: string | undefined | null): number
236
239
  get modules(): JsModule[] | undefined
237
240
  get useSourceMap(): boolean
241
+ libIdent(options: JsLibIdentOptions): string | null
242
+ get resourceResolveData(): JsResourceData | undefined
243
+ get matchResource(): string | undefined
244
+ emitFile(filename: string, source: JsCompatSource, assetInfo: JsAssetInfo): void
238
245
  }
239
246
 
240
247
  export declare class JsModuleGraph {
@@ -246,11 +253,16 @@ export declare class JsModuleGraph {
246
253
  getConnection(dependency: JsDependency): JsModuleGraphConnection | null
247
254
  getOutgoingConnections(module: JsModule): JsModuleGraphConnection[]
248
255
  getIncomingConnections(module: JsModule): JsModuleGraphConnection[]
256
+ getParentModule(jsDependency: JsDependency): JsModule | null
257
+ getParentBlockIndex(jsDependency: JsDependency): number
258
+ isAsync(module: JsModule): boolean
249
259
  }
250
260
 
251
261
  export declare class JsModuleGraphConnection {
252
262
  get dependency(): JsDependency
253
263
  get module(): JsModule | null
264
+ get resolvedModule(): JsModule | null
265
+ get originModule(): JsModule | null
254
266
  }
255
267
 
256
268
  export declare class JsResolver {
@@ -366,6 +378,7 @@ export declare enum BuiltinPluginName {
366
378
  LightningCssMinimizerRspackPlugin = 'LightningCssMinimizerRspackPlugin',
367
379
  BundlerInfoRspackPlugin = 'BundlerInfoRspackPlugin',
368
380
  CssExtractRspackPlugin = 'CssExtractRspackPlugin',
381
+ RsdoctorPlugin = 'RsdoctorPlugin',
369
382
  JsLoaderRspackPlugin = 'JsLoaderRspackPlugin',
370
383
  LazyCompilationPlugin = 'LazyCompilationPlugin'
371
384
  }
@@ -399,6 +412,7 @@ export interface JsAdditionalTreeRuntimeRequirementsResult {
399
412
 
400
413
  export interface JsAfterEmitData {
401
414
  outputName: string
415
+ compilationId: number
402
416
  }
403
417
 
404
418
  export interface JsAfterResolveData {
@@ -416,6 +430,7 @@ export interface JsAfterTemplateExecutionData {
416
430
  headTags: Array<JsHtmlPluginTag>
417
431
  bodyTags: Array<JsHtmlPluginTag>
418
432
  outputName: string
433
+ compilationId: number
419
434
  }
420
435
 
421
436
  export interface JsAlterAssetTagGroupsData {
@@ -423,12 +438,14 @@ export interface JsAlterAssetTagGroupsData {
423
438
  bodyTags: Array<JsHtmlPluginTag>
424
439
  publicPath: string
425
440
  outputName: string
441
+ compilationId: number
426
442
  }
427
443
 
428
444
  export interface JsAlterAssetTagsData {
429
445
  assetTags: JsHtmlPluginAssetTags
430
446
  outputName: string
431
447
  publicPath: string
448
+ compilationId: number
432
449
  }
433
450
 
434
451
  export interface JsAsset {
@@ -496,11 +513,13 @@ export interface JsBannerContentFnCtx {
496
513
  export interface JsBeforeAssetTagGenerationData {
497
514
  assets: JsHtmlPluginAssets
498
515
  outputName: string
516
+ compilationId: number
499
517
  }
500
518
 
501
519
  export interface JsBeforeEmitData {
502
520
  html: string
503
521
  outputName: string
522
+ compilationId: number
504
523
  }
505
524
 
506
525
  export interface JsBeforeResolveArgs {
@@ -659,7 +678,6 @@ export interface JsExecuteModuleResult {
659
678
  buildDependencies: Array<string>
660
679
  missingDependencies: Array<string>
661
680
  cacheable: boolean
662
- assets: Array<string>
663
681
  id: number
664
682
  error?: string
665
683
  }
@@ -679,6 +697,8 @@ export interface JsHtmlPluginAssets {
679
697
  js: Array<string>
680
698
  css: Array<string>
681
699
  favicon?: string
700
+ jsIntegrity?: Array<string | undefined | null>
701
+ cssIntegrity?: Array<string | undefined | null>
682
702
  }
683
703
 
684
704
  export interface JsHtmlPluginAssetTags {
@@ -695,6 +715,10 @@ export interface JsHtmlPluginTag {
695
715
  asset?: string
696
716
  }
697
717
 
718
+ export interface JsLibIdentOptions {
719
+ context: string
720
+ }
721
+
698
722
  export interface JsLibraryAuxiliaryComment {
699
723
  root?: string
700
724
  commonjs?: string
@@ -828,6 +852,157 @@ export interface JsResourceData {
828
852
  fragment?: string
829
853
  }
830
854
 
855
+ export interface JsRsdoctorAsset {
856
+ ukey: number
857
+ path: string
858
+ chunks: Array<number>
859
+ size: number
860
+ }
861
+
862
+ export interface JsRsdoctorAssetPatch {
863
+ assets: Array<JsRsdoctorAsset>
864
+ chunkAssets: Array<JsRsdoctorChunkAssets>
865
+ entrypointAssets: Array<JsRsdoctorEntrypointAssets>
866
+ }
867
+
868
+ export interface JsRsdoctorChunk {
869
+ ukey: number
870
+ name: string
871
+ initial: boolean
872
+ entry: boolean
873
+ dependencies: Array<number>
874
+ imported: Array<number>
875
+ }
876
+
877
+ export interface JsRsdoctorChunkAssets {
878
+ chunk: number
879
+ assets: Array<number>
880
+ }
881
+
882
+ export interface JsRsdoctorChunkGraph {
883
+ chunks: Array<JsRsdoctorChunk>
884
+ entrypoints: Array<JsRsdoctorEntrypoint>
885
+ }
886
+
887
+ export interface JsRsdoctorChunkModules {
888
+ chunk: number
889
+ modules: Array<number>
890
+ }
891
+
892
+ export interface JsRsdoctorDependency {
893
+ ukey: number
894
+ kind: string
895
+ request: string
896
+ module: number
897
+ dependency: number
898
+ }
899
+
900
+ export interface JsRsdoctorEntrypoint {
901
+ ukey: number
902
+ name: string
903
+ chunks: Array<number>
904
+ }
905
+
906
+ export interface JsRsdoctorEntrypointAssets {
907
+ entrypoint: number
908
+ assets: Array<number>
909
+ }
910
+
911
+ export interface JsRsdoctorExportInfo {
912
+ ukey: number
913
+ name: string
914
+ from?: number
915
+ variable?: number
916
+ identifier?: JsRsdoctorStatement
917
+ sideEffects: Array<number>
918
+ }
919
+
920
+ export interface JsRsdoctorModule {
921
+ ukey: number
922
+ identifier: string
923
+ path: string
924
+ isEntry: boolean
925
+ kind: 'normal' | 'concatenated'
926
+ layer?: string
927
+ dependencies: Array<number>
928
+ imported: Array<number>
929
+ modules: Array<number>
930
+ belongModules: Array<number>
931
+ chunks: Array<number>
932
+ }
933
+
934
+ export interface JsRsdoctorModuleGraph {
935
+ modules: Array<JsRsdoctorModule>
936
+ dependencies: Array<JsRsdoctorDependency>
937
+ chunkModules: Array<JsRsdoctorChunkModules>
938
+ }
939
+
940
+ export interface JsRsdoctorModuleGraphModule {
941
+ ukey: number
942
+ module: number
943
+ exports: Array<number>
944
+ sideEffects: Array<number>
945
+ variables: Array<number>
946
+ dynamic: boolean
947
+ }
948
+
949
+ export interface JsRsdoctorModuleId {
950
+ module: number
951
+ renderId: string
952
+ }
953
+
954
+ export interface JsRsdoctorModuleIdsPatch {
955
+ moduleIds: Array<JsRsdoctorModuleId>
956
+ }
957
+
958
+ export interface JsRsdoctorModuleOriginalSource {
959
+ module: number
960
+ source: string
961
+ size: number
962
+ }
963
+
964
+ export interface JsRsdoctorModuleSourcesPatch {
965
+ moduleOriginalSources: Array<JsRsdoctorModuleOriginalSource>
966
+ }
967
+
968
+ export interface JsRsdoctorSideEffect {
969
+ ukey: number
970
+ name: string
971
+ originName?: string
972
+ module: number
973
+ identifier: JsRsdoctorStatement
974
+ isNameSpace: boolean
975
+ fromDependency?: number
976
+ exports: Array<number>
977
+ variable?: number
978
+ }
979
+
980
+ export interface JsRsdoctorSourcePosition {
981
+ line?: number
982
+ column?: number
983
+ index?: number
984
+ }
985
+
986
+ export interface JsRsdoctorSourceRange {
987
+ start: JsRsdoctorSourcePosition
988
+ end?: JsRsdoctorSourcePosition
989
+ }
990
+
991
+ export interface JsRsdoctorStatement {
992
+ module: number
993
+ sourcePosition?: JsRsdoctorSourceRange
994
+ transformedPosition: JsRsdoctorSourceRange
995
+ }
996
+
997
+ export interface JsRsdoctorVariable {
998
+ ukey: number
999
+ name: string
1000
+ module: number
1001
+ usedInfo: string
1002
+ identififer: JsRsdoctorStatement
1003
+ exported?: number
1004
+ }
1005
+
831
1006
  export interface JsRspackDiagnostic {
832
1007
  severity: JsRspackSeverity
833
1008
  error: JsRspackError
@@ -1221,7 +1396,7 @@ export interface RawCacheGroupOptions {
1221
1396
  /** What kind of chunks should be selected. */
1222
1397
  chunks?: RegExp | 'async' | 'initial' | 'all'
1223
1398
  type?: RegExp | string
1224
- layer?: RegExp | string
1399
+ layer?: RegExp | string | ((layer?: string) => boolean)
1225
1400
  automaticNameDelimiter?: string
1226
1401
  minChunks?: number
1227
1402
  minSize?: number | RawSplitChunkSizes
@@ -1410,6 +1585,7 @@ export interface RawEnvironment {
1410
1585
  module?: boolean
1411
1586
  optionalChaining?: boolean
1412
1587
  templateLiteral?: boolean
1588
+ dynamicImportInWorker?: boolean
1413
1589
  }
1414
1590
 
1415
1591
  export interface RawEvalDevToolModulePluginOptions {
@@ -1788,6 +1964,7 @@ export interface RawOptimizationOptions {
1788
1964
  usedExports: boolean | string
1789
1965
  providedExports: boolean
1790
1966
  innerGraph: boolean
1967
+ realContentHash: boolean
1791
1968
  mangleExports: boolean | string
1792
1969
  concatenateModules: boolean
1793
1970
  avoidEntryIife: boolean
@@ -1962,6 +2139,11 @@ export interface RawResolveTsconfigOptions {
1962
2139
  references?: Array<string>
1963
2140
  }
1964
2141
 
2142
+ export interface RawRsdoctorPluginOptions {
2143
+ moduleGraphFeatures: boolean | Array<'graph' | 'ids' | 'sources'>
2144
+ chunkGraphFeatures: boolean | Array<'graph' | 'assets'>
2145
+ }
2146
+
1965
2147
  export interface RawRspackFuture {
1966
2148
 
1967
2149
  }
@@ -2135,7 +2317,12 @@ export declare enum RegisterJsTapKind {
2135
2317
  HtmlPluginAfterEmit = 40,
2136
2318
  RuntimePluginCreateScript = 41,
2137
2319
  RuntimePluginLinkPreload = 42,
2138
- RuntimePluginLinkPrefetch = 43
2320
+ RuntimePluginLinkPrefetch = 43,
2321
+ RsdoctorPluginModuleGraph = 44,
2322
+ RsdoctorPluginChunkGraph = 45,
2323
+ RsdoctorPluginModuleIds = 46,
2324
+ RsdoctorPluginModuleSources = 47,
2325
+ RsdoctorPluginAssets = 48
2139
2326
  }
2140
2327
 
2141
2328
  export interface RegisterJsTaps {
@@ -2183,6 +2370,11 @@ export interface RegisterJsTaps {
2183
2370
  registerRuntimePluginCreateScriptTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCreateScriptData) => String); stage: number; }>
2184
2371
  registerRuntimePluginLinkPreloadTaps: (stages: Array<number>) => Array<{ function: ((arg: JsLinkPreloadData) => String); stage: number; }>
2185
2372
  registerRuntimePluginLinkPrefetchTaps: (stages: Array<number>) => Array<{ function: ((arg: JsLinkPrefetchData) => String); stage: number; }>
2373
+ registerRsdoctorPluginModuleGraphTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorModuleGraph) => Promise<boolean | undefined>); stage: number; }>
2374
+ registerRsdoctorPluginChunkGraphTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorChunkGraph) => Promise<boolean | undefined>); stage: number; }>
2375
+ registerRsdoctorPluginModuleIdsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorModuleIdsPatch) => Promise<boolean | undefined>); stage: number; }>
2376
+ registerRsdoctorPluginModuleSourcesTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorModuleSourcesPatch) => Promise<boolean | undefined>); stage: number; }>
2377
+ registerRsdoctorPluginAssetsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorAssetPatch) => Promise<boolean | undefined>); stage: number; }>
2186
2378
  }
2187
2379
 
2188
2380
  export interface ThreadsafeNodeFS {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "binding.js",
@@ -18,21 +18,21 @@
18
18
  "repository": "web-infra-dev/rspack",
19
19
  "devDependencies": {
20
20
  "@napi-rs/cli": "3.0.0-alpha.65",
21
- "typescript": "^5.7.2"
21
+ "typescript": "^5.7.3"
22
22
  },
23
23
  "napi": {
24
24
  "binaryName": "rspack"
25
25
  },
26
26
  "optionalDependencies": {
27
- "@rspack/binding-darwin-arm64": "1.2.2",
28
- "@rspack/binding-win32-arm64-msvc": "1.2.2",
29
- "@rspack/binding-linux-arm64-musl": "1.2.2",
30
- "@rspack/binding-linux-arm64-gnu": "1.2.2",
31
- "@rspack/binding-darwin-x64": "1.2.2",
32
- "@rspack/binding-win32-ia32-msvc": "1.2.2",
33
- "@rspack/binding-win32-x64-msvc": "1.2.2",
34
- "@rspack/binding-linux-x64-musl": "1.2.2",
35
- "@rspack/binding-linux-x64-gnu": "1.2.2"
27
+ "@rspack/binding-darwin-arm64": "1.2.3",
28
+ "@rspack/binding-linux-arm64-gnu": "1.2.3",
29
+ "@rspack/binding-win32-arm64-msvc": "1.2.3",
30
+ "@rspack/binding-win32-ia32-msvc": "1.2.3",
31
+ "@rspack/binding-linux-arm64-musl": "1.2.3",
32
+ "@rspack/binding-darwin-x64": "1.2.3",
33
+ "@rspack/binding-win32-x64-msvc": "1.2.3",
34
+ "@rspack/binding-linux-x64-gnu": "1.2.3",
35
+ "@rspack/binding-linux-x64-musl": "1.2.3"
36
36
  },
37
37
  "scripts": {
38
38
  "build:debug": "node scripts/build.js",