@rspack/binding 1.3.0-beta.0 → 1.3.0-beta.1

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 +29 -13
  2. package/package.json +11 -11
package/binding.d.ts CHANGED
@@ -31,12 +31,12 @@ interface NormalModuleConstructor {
31
31
  export var NormalModule: NormalModuleConstructor;
32
32
 
33
33
  export interface NormalModule extends Module {
34
- get resource(): string | undefined;
35
- get request(): string | undefined
36
- get userRequest(): string | undefined
37
- set userRequest(val: string | undefined)
38
- get rawRequest(): string | undefined
39
- get loaders(): Array<JsLoaderItem> | undefined
34
+ get resource(): string;
35
+ get request(): string
36
+ get userRequest(): string
37
+ set userRequest(val: string)
38
+ get rawRequest(): string
39
+ get loaders(): Array<JsLoaderItem>
40
40
  get resourceResolveData(): JsResourceData | undefined
41
41
  get matchResource(): string | undefined
42
42
  set matchResource(val: string | undefined)
@@ -66,7 +66,7 @@ export declare class AsyncDependenciesBlock {
66
66
  }
67
67
 
68
68
  export declare class ConcatenatedModule {
69
- get modules(): Module[] | undefined
69
+ get modules(): Module[]
70
70
  _originalSource(): JsCompatSource | undefined
71
71
  identifier(): string
72
72
  nameForCondition(): string | undefined
@@ -132,8 +132,8 @@ export declare class EntryOptionsDto {
132
132
  export type EntryOptionsDTO = EntryOptionsDto
133
133
 
134
134
  export declare class ExternalModule {
135
- get userRequest(): string | undefined
136
- set userRequest(val: string | undefined)
135
+ get userRequest(): string
136
+ set userRequest(val: string)
137
137
  _originalSource(): JsCompatSource | undefined
138
138
  identifier(): string
139
139
  nameForCondition(): string | undefined
@@ -175,7 +175,7 @@ export declare class JsChunkGraph {
175
175
  getChunkEntryDependentChunksIterable(chunk: JsChunk): JsChunk[]
176
176
  getChunkModulesIterableBySourceType(chunk: JsChunk, sourceType: string): Module[]
177
177
  getModuleChunks(module: Module): JsChunk[]
178
- getModuleId(module: Module): string | null
178
+ getModuleId(module: Module): string | number | null
179
179
  getModuleHash(module: Module, runtime: string | string[] | undefined): string | null
180
180
  getBlockChunkGroup(jsBlock: AsyncDependenciesBlock): JsChunkGroup | null
181
181
  }
@@ -455,6 +455,7 @@ export declare enum BuiltinPluginName {
455
455
  CssExtractRspackPlugin = 'CssExtractRspackPlugin',
456
456
  SubresourceIntegrityPlugin = 'SubresourceIntegrityPlugin',
457
457
  RsdoctorPlugin = 'RsdoctorPlugin',
458
+ CircularDependencyRspackPlugin = 'CircularDependencyRspackPlugin',
458
459
  JsLoaderRspackPlugin = 'JsLoaderRspackPlugin',
459
460
  LazyCompilationPlugin = 'LazyCompilationPlugin',
460
461
  ModuleInfoHeaderPlugin = 'ModuleInfoHeaderPlugin'
@@ -834,7 +835,7 @@ export declare enum JsLoaderState {
834
835
  export interface JsModuleDescriptor {
835
836
  identifier: string
836
837
  name: string
837
- id?: string
838
+ id?: string | number | null
838
839
  }
839
840
 
840
841
  export interface JsNormalModuleFactoryCreateModuleArgs {
@@ -1492,6 +1493,17 @@ export interface RawCacheOptions {
1492
1493
  maxGenerations?: number
1493
1494
  }
1494
1495
 
1496
+ export interface RawCircularDependencyRspackPluginOptions {
1497
+ failOnError?: boolean
1498
+ allowAsyncCycles?: boolean
1499
+ exclude?: RegExp
1500
+ ignoredConnections?: Array<[string | RegExp, string | RegExp]>
1501
+ onDetected?: (entrypoint: Module, modules: string[], compilation: JsCompilation) => void
1502
+ onIgnored?: (entrypoint: Module, modules: string[], compilation: JsCompilation) => void
1503
+ onStart?: (compilation: JsCompilation) => void
1504
+ onEnd?: (compilation: JsCompilation) => void
1505
+ }
1506
+
1495
1507
  export interface RawConsumeOptions {
1496
1508
  key: string
1497
1509
  import?: string
@@ -1558,7 +1570,7 @@ export interface RawCopyPattern {
1558
1570
  * @default false
1559
1571
  */
1560
1572
  copyPermissions?: boolean
1561
- transform?: (input: Buffer, absoluteFilename: string) => string | Buffer | Promise<string> | Promise<Buffer>
1573
+ transform?: { transformer: (input: string, absoluteFilename: string) => string | Buffer | Promise<string> | Promise<Buffer> } | ((input: Buffer, absoluteFilename: string) => string | Buffer | Promise<string> | Promise<Buffer>)
1562
1574
  }
1563
1575
 
1564
1576
  export interface RawCopyRspackPluginOptions {
@@ -2360,7 +2372,11 @@ export interface RawSwcJsMinimizerRspackPluginOptions {
2360
2372
 
2361
2373
  export interface RawToOptions {
2362
2374
  context: string
2363
- absoluteFilename: string
2375
+ absoluteFilename?: string
2376
+ }
2377
+
2378
+ export interface RawTransformOptions {
2379
+ transformer: { transformer: (input: string, absoluteFilename: string) => string | Buffer | Promise<string> | Promise<Buffer> }
2364
2380
  }
2365
2381
 
2366
2382
  export interface RawTrustedTypes {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "1.3.0-beta.0",
3
+ "version": "1.3.0-beta.1",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "binding.js",
@@ -17,7 +17,7 @@
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.73",
20
+ "@napi-rs/cli": "3.0.0-alpha.75",
21
21
  "@napi-rs/wasm-runtime": "^0.2.7",
22
22
  "emnapi": "^1.3.1",
23
23
  "typescript": "^5.7.3",
@@ -48,15 +48,15 @@
48
48
  }
49
49
  },
50
50
  "optionalDependencies": {
51
- "@rspack/binding-darwin-arm64": "1.3.0-beta.0",
52
- "@rspack/binding-win32-arm64-msvc": "1.3.0-beta.0",
53
- "@rspack/binding-linux-arm64-musl": "1.3.0-beta.0",
54
- "@rspack/binding-linux-arm64-gnu": "1.3.0-beta.0",
55
- "@rspack/binding-win32-ia32-msvc": "1.3.0-beta.0",
56
- "@rspack/binding-darwin-x64": "1.3.0-beta.0",
57
- "@rspack/binding-win32-x64-msvc": "1.3.0-beta.0",
58
- "@rspack/binding-linux-x64-gnu": "1.3.0-beta.0",
59
- "@rspack/binding-linux-x64-musl": "1.3.0-beta.0"
51
+ "@rspack/binding-darwin-arm64": "1.3.0-beta.1",
52
+ "@rspack/binding-win32-arm64-msvc": "1.3.0-beta.1",
53
+ "@rspack/binding-linux-arm64-musl": "1.3.0-beta.1",
54
+ "@rspack/binding-linux-arm64-gnu": "1.3.0-beta.1",
55
+ "@rspack/binding-win32-ia32-msvc": "1.3.0-beta.1",
56
+ "@rspack/binding-win32-x64-msvc": "1.3.0-beta.1",
57
+ "@rspack/binding-darwin-x64": "1.3.0-beta.1",
58
+ "@rspack/binding-linux-x64-gnu": "1.3.0-beta.1",
59
+ "@rspack/binding-linux-x64-musl": "1.3.0-beta.1"
60
60
  },
61
61
  "scripts": {
62
62
  "build:dev": "node scripts/build.js",