@rspack/binding 0.1.0 → 0.1.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.
- package/binding.d.ts +35 -13
- package/package.json +10 -10
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
|
|
@@ -150,6 +160,15 @@ export interface RawExperiments {
|
|
|
150
160
|
lazyCompilation: boolean
|
|
151
161
|
incrementalRebuild: boolean
|
|
152
162
|
}
|
|
163
|
+
export interface RawExternalItem {
|
|
164
|
+
type: "string" | "regexp" | "object"
|
|
165
|
+
stringPayload?: string
|
|
166
|
+
regexpPayload?: string
|
|
167
|
+
objectPayload?: Record<string, string>
|
|
168
|
+
}
|
|
169
|
+
export interface RawExternalsPresets {
|
|
170
|
+
node: boolean
|
|
171
|
+
}
|
|
153
172
|
/**
|
|
154
173
|
* `loader` is for js side loader, `builtin_loader` is for rust side loader,
|
|
155
174
|
* which is mapped to real rust side loader by [get_builtin_loader].
|
|
@@ -330,6 +349,7 @@ export interface RawCacheGroupOptions {
|
|
|
330
349
|
}
|
|
331
350
|
export interface RawStatsOptions {
|
|
332
351
|
colors: boolean
|
|
352
|
+
reasons: boolean
|
|
333
353
|
}
|
|
334
354
|
export interface RawOptions {
|
|
335
355
|
entry: Record<string, RawEntryItem>
|
|
@@ -340,8 +360,9 @@ export interface RawOptions {
|
|
|
340
360
|
resolve: RawResolveOptions
|
|
341
361
|
module: RawModuleOptions
|
|
342
362
|
builtins: RawBuiltins
|
|
343
|
-
externals
|
|
363
|
+
externals?: Array<RawExternalItem>
|
|
344
364
|
externalsType: string
|
|
365
|
+
externalsPresets: RawExternalsPresets
|
|
345
366
|
devtool: string
|
|
346
367
|
optimization: RawOptimizationOptions
|
|
347
368
|
stats: RawStatsOptions
|
|
@@ -351,16 +372,6 @@ export interface RawOptions {
|
|
|
351
372
|
experiments: RawExperiments
|
|
352
373
|
node: RawNodeOption
|
|
353
374
|
}
|
|
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
375
|
export interface JsAssetInfoRelated {
|
|
365
376
|
sourceMap?: string
|
|
366
377
|
}
|
|
@@ -479,6 +490,10 @@ export interface JsStatsChunk {
|
|
|
479
490
|
initial: boolean
|
|
480
491
|
names: Array<string>
|
|
481
492
|
size: number
|
|
493
|
+
modules?: Array<JsStatsModule>
|
|
494
|
+
parents?: Array<string>
|
|
495
|
+
children?: Array<string>
|
|
496
|
+
siblings?: Array<string>
|
|
482
497
|
}
|
|
483
498
|
export interface JsStatsChunkGroupAsset {
|
|
484
499
|
name: string
|
|
@@ -498,6 +513,13 @@ export interface JsStatsGetAssets {
|
|
|
498
513
|
assets: Array<JsStatsAsset>
|
|
499
514
|
assetsByChunkName: Array<JsStatsAssetsByChunkName>
|
|
500
515
|
}
|
|
516
|
+
/**
|
|
517
|
+
* Some code is modified based on
|
|
518
|
+
* https://github.com/swc-project/swc/blob/d1d0607158ab40463d1b123fed52cc526eba8385/bindings/binding_core_node/src/util.rs#L29-L58
|
|
519
|
+
* Apache-2.0 licensed
|
|
520
|
+
* Author Donny/강동윤
|
|
521
|
+
* Copyright (c)
|
|
522
|
+
*/
|
|
501
523
|
export function initCustomTraceSubscriber(): void
|
|
502
524
|
export class JsCompilation {
|
|
503
525
|
updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSource) => JsCompatSource), assetInfoUpdateOrFunction?: JsAssetInfo | ((assetInfo: JsAssetInfo) => JsAssetInfo)): void
|
|
@@ -531,8 +553,8 @@ export class JsCompilation {
|
|
|
531
553
|
}
|
|
532
554
|
export class JsStats {
|
|
533
555
|
getAssets(): JsStatsGetAssets
|
|
534
|
-
getModules(
|
|
535
|
-
getChunks(): Array<JsStatsChunk>
|
|
556
|
+
getModules(): Array<JsStatsModule>
|
|
557
|
+
getChunks(chunkModules: boolean, chunksRelations: boolean): Array<JsStatsChunk>
|
|
536
558
|
getEntrypoints(): Array<JsStatsChunkGroup>
|
|
537
559
|
getNamedChunkGroups(): Array<JsStatsChunkGroup>
|
|
538
560
|
getErrors(): Array<JsStatsError>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/binding",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Node binding for rspack",
|
|
6
6
|
"main": "binding.js",
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"name": "rspack"
|
|
25
25
|
},
|
|
26
26
|
"optionalDependencies": {
|
|
27
|
-
"@rspack/binding-darwin-arm64": "0.1.
|
|
28
|
-
"@rspack/binding-win32-arm64-msvc": "0.1.
|
|
29
|
-
"@rspack/binding-linux-arm64-gnu": "0.1.
|
|
30
|
-
"@rspack/binding-linux-arm64-musl": "0.1.
|
|
31
|
-
"@rspack/binding-win32-ia32-msvc": "0.1.
|
|
32
|
-
"@rspack/binding-darwin-x64": "0.1.
|
|
33
|
-
"@rspack/binding-win32-x64-msvc": "0.1.
|
|
34
|
-
"@rspack/binding-linux-x64-gnu": "0.1.
|
|
35
|
-
"@rspack/binding-linux-x64-musl": "0.1.
|
|
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"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build:debug": "node scripts/build.js",
|