@rspack/binding 1.3.6 → 1.3.8

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 +28 -5
  2. package/package.json +11 -11
package/binding.d.ts CHANGED
@@ -77,6 +77,7 @@ export declare class Chunks {
77
77
  }
78
78
 
79
79
  export declare class ConcatenatedModule {
80
+ get rootModule(): Module
80
81
  get modules(): Module[]
81
82
  _originalSource(): JsCompatSource | undefined
82
83
  nameForCondition(): string | undefined
@@ -98,6 +99,7 @@ export declare class ContextModule {
98
99
  }
99
100
 
100
101
  export declare class Dependency {
102
+ get _parentModule(): Module | undefined
101
103
  get type(): string
102
104
  get category(): string
103
105
  get request(): string | undefined
@@ -605,6 +607,7 @@ export interface JsChunkAssetArgs {
605
607
  export interface JsChunkGroupOrigin {
606
608
  module?: Module | undefined
607
609
  request?: string
610
+ loc?: string | JsRealDependencyLocation
608
611
  }
609
612
 
610
613
  export interface JsChunkOptionNameCtx {
@@ -621,7 +624,7 @@ export interface JsChunkOptionNameCtx {
621
624
  * - If a string, keep the files under this path
622
625
  */
623
626
  export interface JsCleanOptions {
624
- keep?: string
627
+ keep?: string | RegExp | ((path: string) => boolean)
625
628
  }
626
629
 
627
630
  export interface JsCodegenerationResult {
@@ -881,6 +884,11 @@ export interface JsPathDataChunkLike {
881
884
  id?: string
882
885
  }
883
886
 
887
+ export interface JsRealDependencyLocation {
888
+ start: JsSourcePosition
889
+ end?: JsSourcePosition
890
+ }
891
+
884
892
  export interface JsResolveArgs {
885
893
  request: string
886
894
  context: string
@@ -1104,6 +1112,11 @@ export interface JsRuntimeRequirementInTreeResult {
1104
1112
  allRuntimeRequirements: JsRuntimeGlobals
1105
1113
  }
1106
1114
 
1115
+ export interface JsSourcePosition {
1116
+ line: number
1117
+ column: number
1118
+ }
1119
+
1107
1120
  export interface JsStatsAsset {
1108
1121
  type: string
1109
1122
  name: string
@@ -1396,6 +1409,8 @@ export interface KnownAssetInfo {
1396
1409
  isOverSizeLimit?: boolean
1397
1410
  }
1398
1411
 
1412
+ export declare function minify(source: string, options: string): Promise<TransformOutput>
1413
+
1399
1414
  export interface NodeFsStats {
1400
1415
  isFile: boolean
1401
1416
  isDirectory: boolean
@@ -1513,10 +1528,10 @@ export interface RawCircularDependencyRspackPluginOptions {
1513
1528
  allowAsyncCycles?: boolean
1514
1529
  exclude?: RegExp
1515
1530
  ignoredConnections?: Array<[string | RegExp, string | RegExp]>
1516
- onDetected?: (entrypoint: Module, modules: string[], compilation: JsCompilation) => void
1517
- onIgnored?: (entrypoint: Module, modules: string[], compilation: JsCompilation) => void
1518
- onStart?: (compilation: JsCompilation) => void
1519
- onEnd?: (compilation: JsCompilation) => void
1531
+ onDetected?: (entrypoint: Module, modules: string[]) => void
1532
+ onIgnored?: (entrypoint: Module, modules: string[]) => void
1533
+ onStart?: () => void
1534
+ onEnd?: () => void
1520
1535
  }
1521
1536
 
1522
1537
  export interface RawConsumeOptions {
@@ -1845,6 +1860,7 @@ export interface RawIgnorePluginOptions {
1845
1860
  }
1846
1861
 
1847
1862
  export interface RawIncremental {
1863
+ silent: boolean
1848
1864
  make: boolean
1849
1865
  inferAsyncModules: boolean
1850
1866
  providedExports: boolean
@@ -2555,3 +2571,10 @@ export interface ThreadsafeNodeFS {
2555
2571
  readUntil: (fd: number, code: number, position: number) => Promise<Buffer | void>
2556
2572
  readToEnd: (fd: number, position: number) => Promise<Buffer | void>
2557
2573
  }
2574
+
2575
+ export declare function transform(source: string, options: string): Promise<TransformOutput>
2576
+
2577
+ export interface TransformOutput {
2578
+ code: string
2579
+ map?: string
2580
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "binding.js",
@@ -20,7 +20,7 @@
20
20
  "@napi-rs/cli": "3.0.0-alpha.78",
21
21
  "@napi-rs/wasm-runtime": "^0.2.9",
22
22
  "emnapi": "^1.4.3",
23
- "typescript": "^5.7.3",
23
+ "typescript": "^5.8.3",
24
24
  "@emnapi/core": "^1.4.3"
25
25
  },
26
26
  "napi": {
@@ -48,15 +48,15 @@
48
48
  }
49
49
  },
50
50
  "optionalDependencies": {
51
- "@rspack/binding-darwin-arm64": "1.3.6",
52
- "@rspack/binding-win32-arm64-msvc": "1.3.6",
53
- "@rspack/binding-linux-arm64-musl": "1.3.6",
54
- "@rspack/binding-linux-arm64-gnu": "1.3.6",
55
- "@rspack/binding-win32-ia32-msvc": "1.3.6",
56
- "@rspack/binding-win32-x64-msvc": "1.3.6",
57
- "@rspack/binding-linux-x64-gnu": "1.3.6",
58
- "@rspack/binding-darwin-x64": "1.3.6",
59
- "@rspack/binding-linux-x64-musl": "1.3.6"
51
+ "@rspack/binding-darwin-arm64": "1.3.8",
52
+ "@rspack/binding-win32-arm64-msvc": "1.3.8",
53
+ "@rspack/binding-linux-arm64-gnu": "1.3.8",
54
+ "@rspack/binding-linux-arm64-musl": "1.3.8",
55
+ "@rspack/binding-darwin-x64": "1.3.8",
56
+ "@rspack/binding-win32-x64-msvc": "1.3.8",
57
+ "@rspack/binding-win32-ia32-msvc": "1.3.8",
58
+ "@rspack/binding-linux-x64-gnu": "1.3.8",
59
+ "@rspack/binding-linux-x64-musl": "1.3.8"
60
60
  },
61
61
  "scripts": {
62
62
  "build:dev": "node scripts/build.js",