@rspack/binding 0.0.0-canary-e387726a3 → 0.0.0-canary-2e8a2a7

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 (3) hide show
  1. package/README.md +1 -1
  2. package/binding.d.ts +40 -30
  3. package/package.json +11 -6
package/README.md CHANGED
@@ -9,7 +9,7 @@ Node binding for rspack.
9
9
 
10
10
  ## Documentation
11
11
 
12
- See [https://rspack.org](https://rspack.org) for details.
12
+ See [https://rspack.dev](https://rspack.dev) for details.
13
13
 
14
14
  ## License
15
15
 
package/binding.d.ts CHANGED
@@ -3,6 +3,16 @@
3
3
 
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
+ export interface NodeFS {
7
+ writeFile: (...args: any[]) => any
8
+ mkdir: (...args: any[]) => any
9
+ mkdirp: (...args: any[]) => any
10
+ }
11
+ export interface ThreadsafeNodeFS {
12
+ writeFile: (...args: any[]) => any
13
+ mkdir: (...args: any[]) => any
14
+ mkdirp: (...args: any[]) => any
15
+ }
6
16
  export interface RawPattern {
7
17
  from: string
8
18
  to?: string
@@ -16,6 +26,7 @@ export interface RawPattern {
16
26
  export interface RawGlobOptions {
17
27
  caseSensitiveMatch?: boolean
18
28
  dot?: boolean
29
+ ignore?: Array<string>
19
30
  }
20
31
  export interface RawCopyConfig {
21
32
  patterns: Array<RawPattern>
@@ -150,6 +161,15 @@ export interface RawExperiments {
150
161
  lazyCompilation: boolean
151
162
  incrementalRebuild: boolean
152
163
  }
164
+ export interface RawExternalItem {
165
+ type: "string" | "regexp" | "object"
166
+ stringPayload?: string
167
+ regexpPayload?: string
168
+ objectPayload?: Record<string, string>
169
+ }
170
+ export interface RawExternalsPresets {
171
+ node: boolean
172
+ }
153
173
  /**
154
174
  * `loader` is for js side loader, `builtin_loader` is for rust side loader,
155
175
  * which is mapped to real rust side loader by [get_builtin_loader].
@@ -172,11 +192,12 @@ export interface JsLoader {
172
192
  func: (...args: any[]) => any
173
193
  }
174
194
  export interface RawRuleSetCondition {
175
- type: "string" | "regexp" | "logical" | "array"
195
+ type: "string" | "regexp" | "logical" | "array" | "function"
176
196
  stringMatcher?: string
177
197
  regexpMatcher?: string
178
198
  logicalMatcher?: Array<RawRuleSetLogicalConditions>
179
199
  arrayMatcher?: Array<RawRuleSetCondition>
200
+ funcMatcher?: (value: string) => boolean
180
201
  }
181
202
  export interface RawRuleSetLogicalConditions {
182
203
  and?: Array<RawRuleSetCondition>
@@ -246,6 +267,7 @@ export interface JsLoaderResult {
246
267
  }
247
268
  export interface RawNodeOption {
248
269
  dirname: string
270
+ filename: string
249
271
  global: string
250
272
  }
251
273
  export interface RawOptimizationOptions {
@@ -330,6 +352,7 @@ export interface RawCacheGroupOptions {
330
352
  }
331
353
  export interface RawStatsOptions {
332
354
  colors: boolean
355
+ reasons: boolean
333
356
  }
334
357
  export interface RawOptions {
335
358
  entry: Record<string, RawEntryItem>
@@ -340,8 +363,9 @@ export interface RawOptions {
340
363
  resolve: RawResolveOptions
341
364
  module: RawModuleOptions
342
365
  builtins: RawBuiltins
343
- externals: Record<string, string>
366
+ externals?: Array<RawExternalItem>
344
367
  externalsType: string
368
+ externalsPresets: RawExternalsPresets
345
369
  devtool: string
346
370
  optimization: RawOptimizationOptions
347
371
  stats: RawStatsOptions
@@ -351,16 +375,6 @@ export interface RawOptions {
351
375
  experiments: RawExperiments
352
376
  node: RawNodeOption
353
377
  }
354
- export interface ThreadsafeNodeFS {
355
- writeFile: (...args: any[]) => any
356
- mkdir: (...args: any[]) => any
357
- mkdirp: (...args: any[]) => any
358
- }
359
- export interface NodeFS {
360
- writeFile: (...args: any[]) => any
361
- mkdir: (...args: any[]) => any
362
- mkdirp: (...args: any[]) => any
363
- }
364
378
  export interface JsAssetInfoRelated {
365
379
  sourceMap?: string
366
380
  }
@@ -411,7 +425,6 @@ export interface JsHooks {
411
425
  emit: (...args: any[]) => any
412
426
  afterEmit: (...args: any[]) => any
413
427
  make: (...args: any[]) => any
414
- resolve: (...args: any[]) => any
415
428
  optimizeChunkModule: (...args: any[]) => any
416
429
  }
417
430
  export interface JsModule {
@@ -480,6 +493,10 @@ export interface JsStatsChunk {
480
493
  initial: boolean
481
494
  names: Array<string>
482
495
  size: number
496
+ modules?: Array<JsStatsModule>
497
+ parents?: Array<string>
498
+ children?: Array<string>
499
+ siblings?: Array<string>
483
500
  }
484
501
  export interface JsStatsChunkGroupAsset {
485
502
  name: string
@@ -499,21 +516,13 @@ export interface JsStatsGetAssets {
499
516
  assets: Array<JsStatsAsset>
500
517
  assetsByChunkName: Array<JsStatsAssetsByChunkName>
501
518
  }
502
- export interface JsResolveJsPluginArgs {
503
- importer?: string
504
- context?: string
505
- specifier: string
506
- resolveToContext: boolean
507
- }
508
- export interface JsResolveResult {
509
- type: string
510
- info?: JsResolveInfo
511
- }
512
- export interface JsResolveInfo {
513
- path: string
514
- query: string
515
- fragment: string
516
- }
519
+ /**
520
+ * Some code is modified based on
521
+ * https://github.com/swc-project/swc/blob/d1d0607158ab40463d1b123fed52cc526eba8385/bindings/binding_core_node/src/util.rs#L29-L58
522
+ * Apache-2.0 licensed
523
+ * Author Donny/강동윤
524
+ * Copyright (c)
525
+ */
517
526
  export function initCustomTraceSubscriber(): void
518
527
  export class JsCompilation {
519
528
  updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSource) => JsCompatSource), assetInfoUpdateOrFunction?: JsAssetInfo | ((assetInfo: JsAssetInfo) => JsAssetInfo)): void
@@ -521,6 +530,7 @@ export class JsCompilation {
521
530
  getAsset(name: string): JsAsset | null
522
531
  getAssetSource(name: string): JsCompatSource | null
523
532
  getModules(): Array<JsModule>
533
+ getChunks(): Array<JsChunk>
524
534
  /**
525
535
  * Only available for those none Js and Css source,
526
536
  * return true if set module source successfully, false if failed.
@@ -547,8 +557,8 @@ export class JsCompilation {
547
557
  }
548
558
  export class JsStats {
549
559
  getAssets(): JsStatsGetAssets
550
- getModules(showReasons: boolean): Array<JsStatsModule>
551
- getChunks(): Array<JsStatsChunk>
560
+ getModules(): Array<JsStatsModule>
561
+ getChunks(chunkModules: boolean, chunksRelations: boolean): Array<JsStatsChunk>
552
562
  getEntrypoints(): Array<JsStatsChunkGroup>
553
563
  getNamedChunkGroups(): Array<JsStatsChunkGroup>
554
564
  getErrors(): Array<JsStatsError>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "0.0.0-canary-e387726a3",
3
+ "version": "0.0.0-canary-2e8a2a7",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "binding.js",
@@ -12,7 +12,7 @@
12
12
  "binding.js",
13
13
  "binding.d.ts"
14
14
  ],
15
- "homepage": "https://rspack.org",
15
+ "homepage": "https://rspack.dev",
16
16
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
17
17
  "repository": "web-infra-dev/rspack",
18
18
  "devDependencies": {
@@ -24,10 +24,15 @@
24
24
  "name": "rspack"
25
25
  },
26
26
  "optionalDependencies": {
27
- "@rspack/binding-darwin-x64": "0.0.0-canary-e387726a3",
28
- "@rspack/binding-win32-x64-msvc": "0.0.0-canary-e387726a3",
29
- "@rspack/binding-linux-x64-gnu": "0.0.0-canary-e387726a3",
30
- "@rspack/binding-darwin-arm64": "0.0.0-canary-e387726a3"
27
+ "@rspack/binding-darwin-arm64": "0.0.0-canary-2e8a2a7",
28
+ "@rspack/binding-win32-arm64-msvc": "0.0.0-canary-2e8a2a7",
29
+ "@rspack/binding-linux-arm64-gnu": "0.0.0-canary-2e8a2a7",
30
+ "@rspack/binding-linux-arm64-musl": "0.0.0-canary-2e8a2a7",
31
+ "@rspack/binding-win32-ia32-msvc": "0.0.0-canary-2e8a2a7",
32
+ "@rspack/binding-darwin-x64": "0.0.0-canary-2e8a2a7",
33
+ "@rspack/binding-win32-x64-msvc": "0.0.0-canary-2e8a2a7",
34
+ "@rspack/binding-linux-x64-gnu": "0.0.0-canary-2e8a2a7",
35
+ "@rspack/binding-linux-x64-musl": "0.0.0-canary-2e8a2a7"
31
36
  },
32
37
  "scripts": {
33
38
  "build:debug": "node scripts/build.js",