@rspack/binding 1.1.4 → 1.1.6

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 +47 -6
  2. package/package.json +10 -10
package/binding.d.ts CHANGED
@@ -47,7 +47,7 @@ export declare class EntryOptionsDto {
47
47
  export type EntryOptionsDTO = EntryOptionsDto
48
48
 
49
49
  export declare class JsCompilation {
50
- updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSource) => JsCompatSource), assetInfoUpdateOrFunction?: JsAssetInfo | ((assetInfo: JsAssetInfo) => JsAssetInfo)): void
50
+ updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSourceOwned) => JsCompatSourceOwned), assetInfoUpdateOrFunction?: JsAssetInfo | ((assetInfo: JsAssetInfo) => JsAssetInfo)): void
51
51
  getAssets(): Readonly<JsAsset>[]
52
52
  getAsset(name: string): JsAsset | null
53
53
  getAssetSource(name: string): JsCompatSource | null
@@ -205,8 +205,13 @@ export declare class JsStats {
205
205
  getLogging(acceptedTypes: number): Array<JsStatsLogging>
206
206
  }
207
207
 
208
+ export declare class RawExternalItemFnCtx {
209
+ data(): RawExternalItemFnCtxData
210
+ getResolver(): JsResolver
211
+ }
212
+
208
213
  export declare class Rspack {
209
- constructor(options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, resolverFactoryReference: JsResolverFactory)
214
+ constructor(options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS, resolverFactoryReference: JsResolverFactory)
210
215
  setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
211
216
  /** Build with the given option passed to the constructor */
212
217
  build(callback: (err: null | Error) => void): void
@@ -518,6 +523,17 @@ export interface JsChunkGroupOrigin {
518
523
  request?: string
519
524
  }
520
525
 
526
+ /**
527
+ * File clean options
528
+ *
529
+ * This matches with:
530
+ * - keep:
531
+ * - If a string, keep the files under this path
532
+ */
533
+ export interface JsCleanOptions {
534
+ keep?: string
535
+ }
536
+
521
537
  export interface JsCodegenerationResult {
522
538
  sources: Record<string, string>
523
539
  }
@@ -526,11 +542,23 @@ export interface JsCodegenerationResults {
526
542
  map: Record<string, Record<string, JsCodegenerationResult>>
527
543
  }
528
544
 
545
+ /**
546
+ * Zero copy `JsCompatSource` slice shared between Rust and Node.js if buffer is used.
547
+ *
548
+ * It can only be used in non-async context and the lifetime is bound to the fn closure.
549
+ *
550
+ * If you want to use Node.js Buffer in async context or want to extend the lifetime, use `JsCompatSourceOwned` instead.
551
+ */
529
552
  export interface JsCompatSource {
530
553
  source: string | Buffer
531
554
  map?: string
532
555
  }
533
556
 
557
+ export interface JsCompatSourceOwned {
558
+ source: string | Buffer
559
+ map?: string
560
+ }
561
+
534
562
  export interface JsCreateData {
535
563
  request: string
536
564
  userRequest: string
@@ -781,7 +809,7 @@ export interface JsRuntimeGlobals {
781
809
  }
782
810
 
783
811
  export interface JsRuntimeModule {
784
- source?: JsCompatSource
812
+ source?: JsCompatSourceOwned
785
813
  moduleIdentifier: string
786
814
  constructorName: string
787
815
  name: string
@@ -1335,6 +1363,7 @@ export interface RawEntryDynamicResult {
1335
1363
  export interface RawEnvironment {
1336
1364
  const?: boolean
1337
1365
  arrowFunction?: boolean
1366
+ nodePrefixForCoreModules?: boolean
1338
1367
  }
1339
1368
 
1340
1369
  export interface RawEvalDevToolModulePluginOptions {
@@ -1373,7 +1402,7 @@ export interface RawExposeOptions {
1373
1402
  import: Array<string>
1374
1403
  }
1375
1404
 
1376
- export interface RawExternalItemFnCtx {
1405
+ export interface RawExternalItemFnCtxData {
1377
1406
  request: string
1378
1407
  context: string
1379
1408
  dependencyType: string
@@ -1456,6 +1485,7 @@ export interface RawHtmlRspackPluginOptions {
1456
1485
  /** entry_chunk_name (only entry chunks are supported) */
1457
1486
  chunks?: Array<string>
1458
1487
  excludeChunks?: Array<string>
1488
+ chunksSortMode: "auto" | "manual"
1459
1489
  sri?: "sha256" | "sha384" | "sha512"
1460
1490
  minify?: boolean
1461
1491
  title?: string
@@ -1482,6 +1512,8 @@ export interface RawIncremental {
1482
1512
  providedExports: boolean
1483
1513
  dependenciesDiagnostics: boolean
1484
1514
  buildChunkGraph: boolean
1515
+ moduleIds: boolean
1516
+ chunkIds: boolean
1485
1517
  modulesHashes: boolean
1486
1518
  modulesCodegen: boolean
1487
1519
  modulesRuntimeRequirements: boolean
@@ -1722,6 +1754,7 @@ export interface RawOptions {
1722
1754
  experiments: RawExperiments
1723
1755
  node?: RawNodeOption
1724
1756
  profile: boolean
1757
+ amd?: string
1725
1758
  bail: boolean
1726
1759
  __references: Record<string, any>
1727
1760
  }
@@ -1729,7 +1762,7 @@ export interface RawOptions {
1729
1762
  export interface RawOutputOptions {
1730
1763
  path: string
1731
1764
  pathinfo: boolean | "verbose"
1732
- clean: boolean
1765
+ clean: boolean | JsCleanOptions
1733
1766
  publicPath: "auto" | JsFilename
1734
1767
  assetModuleFilename: JsFilename
1735
1768
  wasmLoading: string
@@ -1740,7 +1773,6 @@ export interface RawOutputOptions {
1740
1773
  crossOriginLoading: RawCrossOriginLoading
1741
1774
  cssFilename: JsFilename
1742
1775
  cssChunkFilename: JsFilename
1743
- cssHeadDataCompression: boolean
1744
1776
  hotUpdateMainFilename: string
1745
1777
  hotUpdateChunkFilename: string
1746
1778
  hotUpdateGlobal: string
@@ -1994,6 +2026,7 @@ export interface RawToOptions {
1994
2026
 
1995
2027
  export interface RawTrustedTypes {
1996
2028
  policyName?: string
2029
+ onPolicyCreationFailure?: string
1997
2030
  }
1998
2031
 
1999
2032
  /**
@@ -2103,4 +2136,12 @@ export interface ThreadsafeNodeFS {
2103
2136
  readFile: (name: string) => Promise<Buffer | string | void> | Buffer | string | void
2104
2137
  stat: (name: string) => Promise<NodeFsStats | void> | NodeFsStats | void
2105
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
2106
2147
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
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-linux-arm64-gnu": "1.1.4",
28
- "@rspack/binding-darwin-arm64": "1.1.4",
29
- "@rspack/binding-win32-arm64-msvc": "1.1.4",
30
- "@rspack/binding-darwin-x64": "1.1.4",
31
- "@rspack/binding-linux-arm64-musl": "1.1.4",
32
- "@rspack/binding-win32-ia32-msvc": "1.1.4",
33
- "@rspack/binding-win32-x64-msvc": "1.1.4",
34
- "@rspack/binding-linux-x64-gnu": "1.1.4",
35
- "@rspack/binding-linux-x64-musl": "1.1.4"
27
+ "@rspack/binding-win32-arm64-msvc": "1.1.6",
28
+ "@rspack/binding-darwin-arm64": "1.1.6",
29
+ "@rspack/binding-linux-arm64-gnu": "1.1.6",
30
+ "@rspack/binding-linux-arm64-musl": "1.1.6",
31
+ "@rspack/binding-win32-ia32-msvc": "1.1.6",
32
+ "@rspack/binding-linux-x64-gnu": "1.1.6",
33
+ "@rspack/binding-darwin-x64": "1.1.6",
34
+ "@rspack/binding-linux-x64-musl": "1.1.6",
35
+ "@rspack/binding-win32-x64-msvc": "1.1.6"
36
36
  },
37
37
  "scripts": {
38
38
  "build:debug": "node scripts/build.js",