@rspack/binding 1.3.11 → 1.3.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 +90 -2
  2. package/package.json +13 -14
package/binding.d.ts CHANGED
@@ -253,10 +253,10 @@ export declare class JsCompilation {
253
253
  get hash(): string | null
254
254
  dependencies(): JsDependencies
255
255
  pushDiagnostic(diagnostic: JsRspackDiagnostic): void
256
- spliceDiagnostic(start: number, end: number, replaceWith: Array<JsRspackDiagnostic>): void
257
256
  pushNativeDiagnostic(diagnostic: ExternalObject<'Diagnostic'>): void
258
257
  pushNativeDiagnostics(diagnostics: ExternalObject<'Diagnostic[]'>): void
259
258
  get errors(): Diagnostics
259
+ get warnings(): Diagnostics
260
260
  getErrors(): Array<JsRspackError>
261
261
  getWarnings(): Array<JsRspackError>
262
262
  getStats(): JsStats
@@ -274,7 +274,7 @@ export declare class JsCompilation {
274
274
  * Using async and mutable reference to `Compilation` at the same time would likely to cause data races.
275
275
  */
276
276
  rebuildModule(moduleIdentifiers: Array<string>, f: any): void
277
- importModule(request: string, layer: string | undefined | null, publicPath: JsFilename | undefined | null, baseUri: string | undefined | null, originalModule: string | undefined | null, originalModuleContext: string | undefined | null, callback: any): void
277
+ importModule(request: string, layer: string | undefined | null, publicPath: JsFilename | undefined | null, baseUri: string | undefined | null, originalModule: string, originalModuleContext: string | undefined | null, callback: any): void
278
278
  get entries(): JsEntries
279
279
  addRuntimeModule(chunk: JsChunk, runtimeModule: JsAddingRuntimeModule): void
280
280
  get moduleGraph(): JsModuleGraph
@@ -493,6 +493,7 @@ export declare enum BuiltinPluginName {
493
493
  CssExtractRspackPlugin = 'CssExtractRspackPlugin',
494
494
  SubresourceIntegrityPlugin = 'SubresourceIntegrityPlugin',
495
495
  RsdoctorPlugin = 'RsdoctorPlugin',
496
+ RstestPlugin = 'RstestPlugin',
496
497
  CircularDependencyRspackPlugin = 'CircularDependencyRspackPlugin',
497
498
  JsLoaderRspackPlugin = 'JsLoaderRspackPlugin',
498
499
  LazyCompilationPlugin = 'LazyCompilationPlugin',
@@ -1628,20 +1629,93 @@ export interface RawContextReplacementPluginOptions {
1628
1629
  }
1629
1630
 
1630
1631
  export interface RawCopyGlobOptions {
1632
+ /**
1633
+ * Whether the match is case sensitive
1634
+ * @default true
1635
+ */
1631
1636
  caseSensitiveMatch?: boolean
1637
+ /**
1638
+ * Whether to match files starting with `.`
1639
+ * @default true
1640
+ */
1632
1641
  dot?: boolean
1642
+ /**
1643
+ * An array of strings in glob format, which can be used to ignore specific paths
1644
+ * @default undefined
1645
+ */
1633
1646
  ignore?: Array<string>
1634
1647
  }
1635
1648
 
1636
1649
  export interface RawCopyPattern {
1650
+ /**
1651
+ * The source path of the copy operation, which can be an absolute path, a relative
1652
+ * path, or a glob pattern. It can refer to a file or a directory. If a relative path
1653
+ * is passed, it is relative to the `context` option.
1654
+ * @default undefined
1655
+ */
1637
1656
  from: string
1657
+ /**
1658
+ * The destination path of the copy operation, which can be an absolute path, a
1659
+ * relative path, or a template string. If not specified, it is equal to Rspack's
1660
+ * `output.path`.
1661
+ * @default Rspack's `output.path`
1662
+ */
1638
1663
  to?: string | ((pathData: { context: string; absoluteFilename?: string }) => string | Promise<string>)
1664
+ /**
1665
+ * `context` is a path to be prepended to `from` and removed from the start of the
1666
+ * result paths. `context` can be an absolute path or a relative path. If it is a
1667
+ * relative path, then it will be converted to an absolute path based on Rspack's
1668
+ * `context`.
1669
+ * `context` should be explicitly set only when `from` contains a glob. Otherwise,
1670
+ * `context` is automatically set based on whether `from` is a file or a directory:
1671
+ * - If `from` is a file, then `context` is its directory. The result path will be
1672
+ * the filename alone.
1673
+ * - If `from` is a directory, then `context` equals `from`. The result paths will
1674
+ * be the paths of the directory's contents (including nested contents), relative
1675
+ * to the directory.
1676
+ * @default Rspack's `context`
1677
+ */
1639
1678
  context?: string
1679
+ /**
1680
+ * Specify the type of [to](#to), which can be a directory, a file, or a template
1681
+ * name in Rspack. If not specified, it will be automatically inferred.
1682
+ * The automatic inference rules are as follows:
1683
+ * - `dir`: If `to` has no extension, or ends on `/`.
1684
+ * - `file`: If `to` is not a directory and is not a template.
1685
+ * - `template`: If `to` contains a template pattern.
1686
+ * @default undefined
1687
+ */
1640
1688
  toType?: string
1689
+ /**
1690
+ * Whether to ignore the error if there are missing files or directories.
1691
+ * @default false
1692
+ */
1641
1693
  noErrorOnMissing: boolean
1694
+ /**
1695
+ * Whether to force the copy operation to overwrite the destination file if it
1696
+ * already exists.
1697
+ * @default false
1698
+ */
1642
1699
  force: boolean
1700
+ /**
1701
+ * The priority of the copy operation. The higher the priority, the earlier the copy
1702
+ * operation will be executed. When `force` is set to `true`, if a matching file is
1703
+ * found, the one with higher priority will overwrite the one with lower priority.
1704
+ * @default 0
1705
+ */
1643
1706
  priority: number
1707
+ /**
1708
+ * Set the glob options for the copy operation.
1709
+ * @default undefined
1710
+ */
1644
1711
  globOptions: RawCopyGlobOptions
1712
+ /**
1713
+ * Allows to add some assets info to the copied files, which may affect some behaviors
1714
+ * in the build process. For example, by default, the copied JS and CSS files will be
1715
+ * minified by Rspack's minimizer, if you want to skip minification for copied files,
1716
+ * you can set `info.minimized` to `true`.
1717
+ * @default undefined
1718
+ */
1645
1719
  info?: RawInfo
1646
1720
  /**
1647
1721
  * Determines whether to copy file permissions from the source to the destination.
@@ -1650,10 +1724,15 @@ export interface RawCopyPattern {
1650
1724
  * @default false
1651
1725
  */
1652
1726
  copyPermissions?: boolean
1727
+ /**
1728
+ * Allows to modify the file contents.
1729
+ * @default undefined
1730
+ */
1653
1731
  transform?: { transformer: (input: Buffer, absoluteFilename: string) => string | Buffer | Promise<string> | Promise<Buffer> } | ((input: Buffer, absoluteFilename: string) => string | Buffer | Promise<string> | Promise<Buffer>)
1654
1732
  }
1655
1733
 
1656
1734
  export interface RawCopyRspackPluginOptions {
1735
+ /** An array of objects that describe the copy operations to be performed. */
1657
1736
  patterns: Array<RawCopyPattern>
1658
1737
  }
1659
1738
 
@@ -1934,6 +2013,10 @@ export interface RawIncremental {
1934
2013
 
1935
2014
  export interface RawInfo {
1936
2015
  immutable?: boolean
2016
+ /**
2017
+ * Whether to skip minification for the copied files.
2018
+ * @default false
2019
+ */
1937
2020
  minimized?: boolean
1938
2021
  chunkHash?: Array<string>
1939
2022
  contentHash?: Array<string>
@@ -2349,6 +2432,10 @@ export interface RawRspackFuture {
2349
2432
 
2350
2433
  }
2351
2434
 
2435
+ export interface RawRstestPluginOptions {
2436
+ injectModulePathName: boolean
2437
+ }
2438
+
2352
2439
  export interface RawRuleSetCondition {
2353
2440
  type: RawRuleSetConditionType
2354
2441
  string?: string
@@ -2627,4 +2714,5 @@ export declare function transform(source: string, options: string): Promise<Tran
2627
2714
  export interface TransformOutput {
2628
2715
  code: string
2629
2716
  map?: string
2717
+ diagnostics: Array<string>
2630
2718
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "1.3.11",
3
+ "version": "1.3.12",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "binding.js",
@@ -17,8 +17,8 @@
17
17
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
18
18
  "repository": "web-infra-dev/rspack",
19
19
  "devDependencies": {
20
- "@napi-rs/cli": "3.0.0-alpha.78",
21
- "@napi-rs/wasm-runtime": "^0.2.9",
20
+ "@napi-rs/cli": "3.0.0-alpha.80",
21
+ "@napi-rs/wasm-runtime": "^0.2.10",
22
22
  "emnapi": "^1.4.3",
23
23
  "typescript": "^5.8.3",
24
24
  "@emnapi/core": "^1.4.3"
@@ -37,8 +37,7 @@
37
37
  "aarch64-unknown-linux-gnu",
38
38
  "aarch64-apple-darwin",
39
39
  "aarch64-unknown-linux-musl",
40
- "aarch64-pc-windows-msvc",
41
- "wasm32-wasip1-threads"
40
+ "aarch64-pc-windows-msvc"
42
41
  ],
43
42
  "wasm": {
44
43
  "initialMemory": 16384,
@@ -48,15 +47,15 @@
48
47
  }
49
48
  },
50
49
  "optionalDependencies": {
51
- "@rspack/binding-darwin-arm64": "1.3.11",
52
- "@rspack/binding-linux-arm64-gnu": "1.3.11",
53
- "@rspack/binding-win32-arm64-msvc": "1.3.11",
54
- "@rspack/binding-darwin-x64": "1.3.11",
55
- "@rspack/binding-linux-arm64-musl": "1.3.11",
56
- "@rspack/binding-win32-ia32-msvc": "1.3.11",
57
- "@rspack/binding-win32-x64-msvc": "1.3.11",
58
- "@rspack/binding-linux-x64-gnu": "1.3.11",
59
- "@rspack/binding-linux-x64-musl": "1.3.11"
50
+ "@rspack/binding-darwin-arm64": "1.3.12",
51
+ "@rspack/binding-win32-arm64-msvc": "1.3.12",
52
+ "@rspack/binding-linux-arm64-gnu": "1.3.12",
53
+ "@rspack/binding-linux-arm64-musl": "1.3.12",
54
+ "@rspack/binding-darwin-x64": "1.3.12",
55
+ "@rspack/binding-win32-ia32-msvc": "1.3.12",
56
+ "@rspack/binding-win32-x64-msvc": "1.3.12",
57
+ "@rspack/binding-linux-x64-gnu": "1.3.12",
58
+ "@rspack/binding-linux-x64-musl": "1.3.12"
60
59
  },
61
60
  "scripts": {
62
61
  "build:dev": "node scripts/build.js",