@rspack/binding 0.1.1 → 0.1.2

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 +20 -1
  2. package/package.json +18 -17
package/binding.d.ts CHANGED
@@ -26,6 +26,7 @@ export interface RawPattern {
26
26
  export interface RawGlobOptions {
27
27
  caseSensitiveMatch?: boolean
28
28
  dot?: boolean
29
+ ignore?: Array<string>
29
30
  }
30
31
  export interface RawCopyConfig {
31
32
  patterns: Array<RawPattern>
@@ -191,11 +192,12 @@ export interface JsLoader {
191
192
  func: (...args: any[]) => any
192
193
  }
193
194
  export interface RawRuleSetCondition {
194
- type: "string" | "regexp" | "logical" | "array"
195
+ type: "string" | "regexp" | "logical" | "array" | "function"
195
196
  stringMatcher?: string
196
197
  regexpMatcher?: string
197
198
  logicalMatcher?: Array<RawRuleSetLogicalConditions>
198
199
  arrayMatcher?: Array<RawRuleSetCondition>
200
+ funcMatcher?: (value: string) => boolean
199
201
  }
200
202
  export interface RawRuleSetLogicalConditions {
201
203
  and?: Array<RawRuleSetCondition>
@@ -265,6 +267,7 @@ export interface JsLoaderResult {
265
267
  }
266
268
  export interface RawNodeOption {
267
269
  dirname: string
270
+ filename: string
268
271
  global: string
269
272
  }
270
273
  export interface RawOptimizationOptions {
@@ -423,12 +426,27 @@ export interface JsHooks {
423
426
  afterEmit: (...args: any[]) => any
424
427
  make: (...args: any[]) => any
425
428
  optimizeChunkModule: (...args: any[]) => any
429
+ normalModuleFactoryResolveForScheme: (...args: any[]) => any
426
430
  }
427
431
  export interface JsModule {
428
432
  originalSource?: JsCompatSource
429
433
  resource: string
430
434
  moduleIdentifier: string
431
435
  }
436
+ export interface SchemeAndJsResourceData {
437
+ resourceData: JsResourceData
438
+ scheme: string
439
+ }
440
+ export interface JsResourceData {
441
+ /** Resource with absolute path, query and fragment */
442
+ resource: string
443
+ /** Absolute resource path only */
444
+ path: string
445
+ /** Resource query with `?` prefix */
446
+ query?: string
447
+ /** Resource fragment with `#` prefix */
448
+ fragment?: string
449
+ }
432
450
  export interface JsCompatSource {
433
451
  /** Whether the underlying data structure is a `RawSource` */
434
452
  isRaw: boolean
@@ -527,6 +545,7 @@ export class JsCompilation {
527
545
  getAsset(name: string): JsAsset | null
528
546
  getAssetSource(name: string): JsCompatSource | null
529
547
  getModules(): Array<JsModule>
548
+ getChunks(): Array<JsChunk>
530
549
  /**
531
550
  * Only available for those none Js and Css source,
532
551
  * return true if set module source successfully, false if failed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "binding.js",
@@ -17,32 +17,33 @@
17
17
  "repository": "web-infra-dev/rspack",
18
18
  "devDependencies": {
19
19
  "@napi-rs/cli": "2.14.2",
20
- "why-is-node-running": "2.2.1",
21
- "npm-run-all": "4.1.5"
20
+ "cross-env": "^7.0.3",
21
+ "npm-run-all": "4.1.5",
22
+ "why-is-node-running": "2.2.1"
22
23
  },
23
24
  "napi": {
24
25
  "name": "rspack"
25
26
  },
26
27
  "optionalDependencies": {
27
- "@rspack/binding-darwin-arm64": "0.1.1",
28
- "@rspack/binding-win32-arm64-msvc": "0.1.1",
29
- "@rspack/binding-linux-arm64-gnu": "0.1.1",
30
- "@rspack/binding-linux-arm64-musl": "0.1.1",
31
- "@rspack/binding-win32-ia32-msvc": "0.1.1",
32
- "@rspack/binding-darwin-x64": "0.1.1",
33
- "@rspack/binding-win32-x64-msvc": "0.1.1",
34
- "@rspack/binding-linux-x64-gnu": "0.1.1",
35
- "@rspack/binding-linux-x64-musl": "0.1.1"
28
+ "@rspack/binding-darwin-arm64": "0.1.2",
29
+ "@rspack/binding-win32-arm64-msvc": "0.1.2",
30
+ "@rspack/binding-linux-arm64-gnu": "0.1.2",
31
+ "@rspack/binding-linux-arm64-musl": "0.1.2",
32
+ "@rspack/binding-win32-ia32-msvc": "0.1.2",
33
+ "@rspack/binding-darwin-x64": "0.1.2",
34
+ "@rspack/binding-win32-x64-msvc": "0.1.2",
35
+ "@rspack/binding-linux-x64-gnu": "0.1.2",
36
+ "@rspack/binding-linux-x64-musl": "0.1.2"
36
37
  },
37
38
  "scripts": {
38
39
  "build:debug": "node scripts/build.js",
39
- "build:debug:x64": "RUST_TARGET=x86_64-apple-darwin node scripts/build.js",
40
- "build:debug:linux": "RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js",
40
+ "build:debug:x64": "cross-env RUST_TARGET=x86_64-apple-darwin node scripts/build.js",
41
+ "build:debug:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js",
41
42
  "build:release:all": "run-p build:release build:release:x64 build:release:linux && pnpm move-binding",
42
43
  "build:release": "node scripts/build.js --release",
43
- "build:release:x64": "RUST_TARGET=x86_64-apple-darwin node scripts/build.js --release",
44
- "build:release:linux": "RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js --release",
45
- "build:release:win": "RUST_TARGET=x86_64-pc-windows-msvc node scripts/build.js --release",
44
+ "build:release:x64": "cross-env RUST_TARGET=x86_64-apple-darwin node scripts/build.js --release",
45
+ "build:release:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js --release",
46
+ "build:release:win": "cross-env RUST_TARGET=x86_64-pc-windows-msvc node scripts/build.js --release",
46
47
  "move-binding": "node scripts/move-binding"
47
48
  }
48
49
  }