@rspack/binding 1.0.0-beta.2 → 1.0.0-beta.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 +157 -63
  2. package/package.json +10 -10
package/binding.d.ts CHANGED
@@ -19,6 +19,39 @@ export class ExternalObject<T> {
19
19
  [K: symbol]: T
20
20
  }
21
21
  }
22
+ export class DependencyDto {
23
+ get type(): string
24
+ get category(): string
25
+ }
26
+ export type DependencyDTO = DependencyDto
27
+
28
+ export class EntryDataDto {
29
+ get dependencies(): Array<DependencyDto>
30
+ get includeDependencies(): Array<DependencyDto>
31
+ get options(): EntryOptionsDto
32
+ }
33
+ export type EntryDataDTO = EntryDataDto
34
+
35
+ export class EntryOptionsDto {
36
+ get name(): string | undefined
37
+ set name(name: string | undefined)
38
+ get runtime(): false | string | undefined
39
+ set runtime(chunkLoading: boolean | string | undefined)
40
+ get chunkLoading(): string | undefined
41
+ set chunkLoading(chunkLoading: string | undefined)
42
+ get asyncChunks(): boolean | undefined
43
+ set asyncChunks(asyncChunks: boolean | undefined)
44
+ get baseUri(): string | undefined
45
+ set baseUri(baseUri: string | undefined)
46
+ get library(): JsLibraryOptions | undefined
47
+ set library(library: JsLibraryOptions | undefined)
48
+ get dependOn(): Array<string> | undefined
49
+ set dependOn(dependOn: Array<string> | undefined)
50
+ get layer(): string | undefined
51
+ set layer(layer: string | undefined)
52
+ }
53
+ export type EntryOptionsDTO = EntryOptionsDto
54
+
22
55
  export class JsCompilation {
23
56
  updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSource) => JsCompatSource), assetInfoUpdateOrFunction?: JsAssetInfo | ((assetInfo: JsAssetInfo) => JsAssetInfo)): void
24
57
  getAssets(): Readonly<JsAsset>[]
@@ -62,6 +95,18 @@ export class JsCompilation {
62
95
  addBuildDependencies(deps: Array<string>): void
63
96
  rebuildModule(moduleIdentifiers: Array<string>, f: (...args: any[]) => any): void
64
97
  importModule(request: string, publicPath: JsFilename | undefined | null, baseUri: string | undefined | null, originalModule: string | undefined | null, originalModuleContext: string | undefined | null, callback: (...args: any[]) => any): void
98
+ get entries(): JsEntries
99
+ }
100
+
101
+ export class JsEntries {
102
+ clear(): void
103
+ get size(): number
104
+ has(key: string): boolean
105
+ set(key: string, value: JsEntryData | EntryDataDto): void
106
+ delete(key: string): boolean
107
+ get(key: string): EntryDataDto | undefined
108
+ keys(): Array<string>
109
+ values(): Array<EntryDataDto>
65
110
  }
66
111
 
67
112
  export class JsResolver {
@@ -360,6 +405,31 @@ export interface JsDiagnostic {
360
405
  error: JsRspackError
361
406
  }
362
407
 
408
+ export interface JsEntryData {
409
+ dependencies: Array<DependencyDto>
410
+ includeDependencies: Array<DependencyDto>
411
+ options: JsEntryOptions
412
+ }
413
+
414
+ export interface JsEntryOptions {
415
+ name?: string
416
+ runtime?: false | string
417
+ chunkLoading?: string
418
+ asyncChunks?: boolean
419
+ publicPath?: "auto" | JsFilename
420
+ baseUri?: string
421
+ filename?: JsFilename
422
+ library?: JsLibraryOptions
423
+ dependOn?: Array<string>
424
+ layer?: string
425
+ }
426
+
427
+ export interface JsEntryPluginOptions {
428
+ context: string
429
+ entry: string
430
+ options: JsEntryOptions
431
+ }
432
+
363
433
  export interface JsExecuteModuleArg {
364
434
  entry: string
365
435
  runtimeModules: Array<string>
@@ -387,6 +457,35 @@ export interface JsFactoryMeta {
387
457
  sideEffectFree?: boolean
388
458
  }
389
459
 
460
+ export interface JsLibraryAuxiliaryComment {
461
+ root?: string
462
+ commonjs?: string
463
+ commonjs2?: string
464
+ amd?: string
465
+ }
466
+
467
+ export interface JsLibraryCustomUmdObject {
468
+ amd?: string
469
+ commonjs?: string
470
+ root?: Array<string>
471
+ }
472
+
473
+ export interface JsLibraryName {
474
+ type: "string" | "array" | "umdObject"
475
+ stringPayload?: string
476
+ arrayPayload?: Array<string>
477
+ umdObjectPayload?: JsLibraryCustomUmdObject
478
+ }
479
+
480
+ export interface JsLibraryOptions {
481
+ name?: JsLibraryName
482
+ export?: Array<string>
483
+ libraryType: string
484
+ umdNamedDefine?: boolean
485
+ auxiliaryComment?: JsLibraryAuxiliaryComment
486
+ amdContainer?: string
487
+ }
488
+
390
489
  export interface JsLoaderContext {
391
490
  resourceData: Readonly<JsResourceData>
392
491
  /** Will be deprecated. Use module.module_identifier instead */
@@ -899,7 +998,7 @@ export interface RawConsumeSharedPluginOptions {
899
998
  export interface RawContainerPluginOptions {
900
999
  name: string
901
1000
  shareScope: string
902
- library: RawLibraryOptions
1001
+ library: JsLibraryOptions
903
1002
  runtime?: false | string
904
1003
  filename?: string
905
1004
  exposes: Array<RawExposeOptions>
@@ -984,6 +1083,10 @@ export interface RawCssParserOptions {
984
1083
  namedExports?: boolean
985
1084
  }
986
1085
 
1086
+ export interface RawDraft {
1087
+ customMedia: boolean
1088
+ }
1089
+
987
1090
  export interface RawDynamicEntryPluginOptions {
988
1091
  context: string
989
1092
  entry: () => Promise<RawEntryDynamicResult[]>
@@ -991,26 +1094,7 @@ export interface RawDynamicEntryPluginOptions {
991
1094
 
992
1095
  export interface RawEntryDynamicResult {
993
1096
  import: Array<string>
994
- options: RawEntryOptions
995
- }
996
-
997
- export interface RawEntryOptions {
998
- name?: string
999
- runtime?: false | string
1000
- chunkLoading?: string
1001
- asyncChunks?: boolean
1002
- publicPath?: "auto" | JsFilename
1003
- baseUri?: string
1004
- filename?: JsFilename
1005
- library?: RawLibraryOptions
1006
- dependOn?: Array<string>
1007
- layer?: string
1008
- }
1009
-
1010
- export interface RawEntryPluginOptions {
1011
- context: string
1012
- entry: string
1013
- options: RawEntryOptions
1097
+ options: JsEntryOptions
1014
1098
  }
1015
1099
 
1016
1100
  export interface RawEnvironment {
@@ -1163,43 +1247,43 @@ export interface RawLazyCompilationOption {
1163
1247
  cacheable: boolean
1164
1248
  }
1165
1249
 
1166
- export interface RawLibraryAuxiliaryComment {
1167
- root?: string
1168
- commonjs?: string
1169
- commonjs2?: string
1170
- amd?: string
1171
- }
1172
-
1173
- export interface RawLibraryCustomUmdObject {
1174
- amd?: string
1175
- commonjs?: string
1176
- root?: Array<string>
1177
- }
1178
-
1179
- export interface RawLibraryName {
1180
- type: "string" | "array" | "umdObject"
1181
- stringPayload?: string
1182
- arrayPayload?: Array<string>
1183
- umdObjectPayload?: RawLibraryCustomUmdObject
1250
+ export interface RawLightningCssBrowsers {
1251
+ android?: number
1252
+ chrome?: number
1253
+ edge?: number
1254
+ firefox?: number
1255
+ ie?: number
1256
+ ios_saf?: number
1257
+ opera?: number
1258
+ safari?: number
1259
+ samsung?: number
1184
1260
  }
1185
1261
 
1186
- export interface RawLibraryOptions {
1187
- name?: RawLibraryName
1188
- export?: Array<string>
1189
- libraryType: string
1190
- umdNamedDefine?: boolean
1191
- auxiliaryComment?: RawLibraryAuxiliaryComment
1192
- amdContainer?: string
1262
+ export interface RawLightningCssMinimizerOptions {
1263
+ errorRecovery: boolean
1264
+ targets?: RawLightningCssBrowsers
1265
+ include?: number
1266
+ exclude?: number
1267
+ draft?: RawDraft
1268
+ nonStandard?: RawNonStandard
1269
+ pseudoClasses?: RawLightningCssPseudoClasses
1270
+ unusedSymbols: Array<string>
1193
1271
  }
1194
1272
 
1195
1273
  export interface RawLightningCssMinimizerRspackPluginOptions {
1196
- errorRecovery: boolean
1197
- unusedSymbols: Array<string>
1198
- removeUnusedLocalIdents: boolean
1199
- browserslist: Array<string>
1200
1274
  test?: string | RegExp | (string | RegExp)[]
1201
1275
  include?: string | RegExp | (string | RegExp)[]
1202
1276
  exclude?: string | RegExp | (string | RegExp)[]
1277
+ removeUnusedLocalIdents: boolean
1278
+ minimizerOptions: RawLightningCssMinimizerOptions
1279
+ }
1280
+
1281
+ export interface RawLightningCssPseudoClasses {
1282
+ hover?: string
1283
+ active?: string
1284
+ focus?: string
1285
+ focusVisible?: string
1286
+ focusWithin?: string
1203
1287
  }
1204
1288
 
1205
1289
  export interface RawLimitChunkCountPluginOptions {
@@ -1297,6 +1381,10 @@ export interface RawNodeOption {
1297
1381
  global: string
1298
1382
  }
1299
1383
 
1384
+ export interface RawNonStandard {
1385
+ deepSelectorCombinator: boolean
1386
+ }
1387
+
1300
1388
  export interface RawOptimizationOptions {
1301
1389
  removeAvailableModules: boolean
1302
1390
  sideEffects: string
@@ -1347,7 +1435,7 @@ export interface RawOutputOptions {
1347
1435
  hotUpdateGlobal: string
1348
1436
  uniqueName: string
1349
1437
  chunkLoadingGlobal: string
1350
- library?: RawLibraryOptions
1438
+ library?: JsLibraryOptions
1351
1439
  strictModuleErrorHandling: boolean
1352
1440
  enabledLibraryTypes?: Array<string>
1353
1441
  globalObject: string
@@ -1573,15 +1661,19 @@ export interface RawSwcCssMinimizerRspackPluginOptions {
1573
1661
  exclude?: string | RegExp | (string | RegExp)[]
1574
1662
  }
1575
1663
 
1576
- export interface RawSwcJsMinimizerRspackPluginOptions {
1577
- extractComments?: RawExtractComments
1664
+ export interface RawSwcJsMinimizerOptions {
1578
1665
  compress: any
1579
1666
  mangle: any
1580
1667
  format: any
1581
1668
  module?: boolean
1669
+ }
1670
+
1671
+ export interface RawSwcJsMinimizerRspackPluginOptions {
1582
1672
  test?: string | RegExp | (string | RegExp)[]
1583
1673
  include?: string | RegExp | (string | RegExp)[]
1584
1674
  exclude?: string | RegExp | (string | RegExp)[]
1675
+ extractComments?: RawExtractComments
1676
+ minimizerOptions: RawSwcJsMinimizerOptions
1585
1677
  }
1586
1678
 
1587
1679
  export interface RawToOptions {
@@ -1626,16 +1718,17 @@ export enum RegisterJsTapKind {
1626
1718
  CompilationChunkAsset = 20,
1627
1719
  CompilationProcessAssets = 21,
1628
1720
  CompilationAfterProcessAssets = 22,
1629
- CompilationAfterSeal = 23,
1630
- NormalModuleFactoryBeforeResolve = 24,
1631
- NormalModuleFactoryFactorize = 25,
1632
- NormalModuleFactoryResolve = 26,
1633
- NormalModuleFactoryAfterResolve = 27,
1634
- NormalModuleFactoryCreateModule = 28,
1635
- NormalModuleFactoryResolveForScheme = 29,
1636
- ContextModuleFactoryBeforeResolve = 30,
1637
- ContextModuleFactoryAfterResolve = 31,
1638
- JavascriptModulesChunkHash = 32
1721
+ CompilationSeal = 23,
1722
+ CompilationAfterSeal = 24,
1723
+ NormalModuleFactoryBeforeResolve = 25,
1724
+ NormalModuleFactoryFactorize = 26,
1725
+ NormalModuleFactoryResolve = 27,
1726
+ NormalModuleFactoryAfterResolve = 28,
1727
+ NormalModuleFactoryCreateModule = 29,
1728
+ NormalModuleFactoryResolveForScheme = 30,
1729
+ ContextModuleFactoryBeforeResolve = 31,
1730
+ ContextModuleFactoryAfterResolve = 32,
1731
+ JavascriptModulesChunkHash = 33
1639
1732
  }
1640
1733
 
1641
1734
  export interface RegisterJsTaps {
@@ -1662,6 +1755,7 @@ export interface RegisterJsTaps {
1662
1755
  registerCompilationChunkAssetTaps: (stages: Array<number>) => Array<{ function: ((arg: JsChunkAssetArgs) => void); stage: number; }>
1663
1756
  registerCompilationProcessAssetsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => Promise<void>); stage: number; }>
1664
1757
  registerCompilationAfterProcessAssetsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }>
1758
+ registerCompilationSealTaps: (stages: Array<number>) => Array<{ function: (() => void); stage: number; }>
1665
1759
  registerCompilationAfterSealTaps: (stages: Array<number>) => Array<{ function: (() => Promise<void>); stage: number; }>
1666
1760
  registerNormalModuleFactoryBeforeResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: JsBeforeResolveArgs) => Promise<[boolean | undefined, JsBeforeResolveArgs]>); stage: number; }>
1667
1761
  registerNormalModuleFactoryFactorizeTaps: (stages: Array<number>) => Array<{ function: ((arg: JsFactorizeArgs) => Promise<JsFactorizeArgs>); stage: number; }>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.3",
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.0-beta.2",
28
- "@rspack/binding-win32-arm64-msvc": "1.0.0-beta.2",
29
- "@rspack/binding-linux-arm64-musl": "1.0.0-beta.2",
30
- "@rspack/binding-linux-arm64-gnu": "1.0.0-beta.2",
31
- "@rspack/binding-win32-x64-msvc": "1.0.0-beta.2",
32
- "@rspack/binding-win32-ia32-msvc": "1.0.0-beta.2",
33
- "@rspack/binding-linux-x64-gnu": "1.0.0-beta.2",
34
- "@rspack/binding-darwin-x64": "1.0.0-beta.2",
35
- "@rspack/binding-linux-x64-musl": "1.0.0-beta.2"
27
+ "@rspack/binding-linux-arm64-musl": "1.0.0-beta.3",
28
+ "@rspack/binding-win32-arm64-msvc": "1.0.0-beta.3",
29
+ "@rspack/binding-darwin-arm64": "1.0.0-beta.3",
30
+ "@rspack/binding-linux-arm64-gnu": "1.0.0-beta.3",
31
+ "@rspack/binding-win32-ia32-msvc": "1.0.0-beta.3",
32
+ "@rspack/binding-win32-x64-msvc": "1.0.0-beta.3",
33
+ "@rspack/binding-darwin-x64": "1.0.0-beta.3",
34
+ "@rspack/binding-linux-x64-gnu": "1.0.0-beta.3",
35
+ "@rspack/binding-linux-x64-musl": "1.0.0-beta.3"
36
36
  },
37
37
  "scripts": {
38
38
  "build:debug": "node scripts/build.js",