@rspack/binding 1.2.7-alpha.0 → 1.2.8
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 +41 -29
- package/binding.js +19 -0
- package/package.json +38 -13
package/binding.d.ts
CHANGED
|
@@ -21,13 +21,29 @@ export declare class ExternalObject<T> {
|
|
|
21
21
|
[K: symbol]: T
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
export declare class Dependency {
|
|
25
|
+
get type(): string
|
|
26
|
+
get category(): string
|
|
27
|
+
get request(): string | undefined
|
|
28
|
+
get critical(): boolean
|
|
29
|
+
set critical(val: boolean)
|
|
30
|
+
get ids(): Array<string> | undefined
|
|
31
|
+
}
|
|
32
|
+
|
|
24
33
|
export declare class EntryDataDto {
|
|
25
|
-
get dependencies():
|
|
26
|
-
get includeDependencies():
|
|
34
|
+
get dependencies(): Dependency[]
|
|
35
|
+
get includeDependencies(): Dependency[]
|
|
27
36
|
get options(): EntryOptionsDto
|
|
28
37
|
}
|
|
29
38
|
export type EntryDataDTO = EntryDataDto
|
|
30
39
|
|
|
40
|
+
export declare class EntryDependency {
|
|
41
|
+
constructor(request: string)
|
|
42
|
+
get type(): string
|
|
43
|
+
get category(): string
|
|
44
|
+
get request(): string | undefined
|
|
45
|
+
}
|
|
46
|
+
|
|
31
47
|
export declare class EntryOptionsDto {
|
|
32
48
|
get name(): string | undefined
|
|
33
49
|
set name(name: string | undefined)
|
|
@@ -93,13 +109,14 @@ export declare class JsChunkGroup {
|
|
|
93
109
|
isInitial(): boolean
|
|
94
110
|
getParents(): JsChunkGroup[]
|
|
95
111
|
getRuntimeChunk(): JsChunk
|
|
112
|
+
getEntrypointChunk(): JsChunk
|
|
96
113
|
getFiles(): Array<string>
|
|
97
114
|
getModulePreOrderIndex(module: JsModule): number | null
|
|
98
115
|
getModulePostOrderIndex(module: JsModule): number | null
|
|
99
116
|
}
|
|
100
117
|
|
|
101
118
|
export declare class JsCompilation {
|
|
102
|
-
updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSourceOwned) => JsCompatSourceOwned), assetInfoUpdateOrFunction?: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo)): void
|
|
119
|
+
updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSourceOwned) => JsCompatSourceOwned), assetInfoUpdateOrFunction?: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo | undefined)): void
|
|
103
120
|
getAssets(): Readonly<JsAsset>[]
|
|
104
121
|
getAsset(name: string): JsAsset | null
|
|
105
122
|
getAssetSource(name: string): JsCompatSource | null
|
|
@@ -148,7 +165,7 @@ export declare class JsCompilation {
|
|
|
148
165
|
addRuntimeModule(chunk: JsChunk, runtimeModule: JsAddingRuntimeModule): void
|
|
149
166
|
get moduleGraph(): JsModuleGraph
|
|
150
167
|
get chunkGraph(): JsChunkGraph
|
|
151
|
-
addInclude(args: [string,
|
|
168
|
+
addInclude(args: [string, EntryDependency, JsEntryOptions | undefined][], callback: (errMsg: Error | null, results: [string | null, JsModule][]) => void): void
|
|
152
169
|
}
|
|
153
170
|
|
|
154
171
|
export declare class JsCompiler {
|
|
@@ -171,7 +188,7 @@ export declare class JsContextModuleFactoryAfterResolveData {
|
|
|
171
188
|
set regExp(rawRegExp: RegExp | undefined)
|
|
172
189
|
get recursive(): boolean
|
|
173
190
|
set recursive(recursive: boolean)
|
|
174
|
-
get dependencies():
|
|
191
|
+
get dependencies(): Dependency[]
|
|
175
192
|
}
|
|
176
193
|
|
|
177
194
|
export declare class JsContextModuleFactoryBeforeResolveData {
|
|
@@ -201,19 +218,10 @@ export declare class JsDependencies {
|
|
|
201
218
|
}
|
|
202
219
|
|
|
203
220
|
export declare class JsDependenciesBlock {
|
|
204
|
-
get dependencies():
|
|
221
|
+
get dependencies(): Dependency[]
|
|
205
222
|
get blocks(): JsDependenciesBlock[]
|
|
206
223
|
}
|
|
207
224
|
|
|
208
|
-
export declare class JsDependency {
|
|
209
|
-
get type(): string
|
|
210
|
-
get category(): string
|
|
211
|
-
get request(): string | undefined
|
|
212
|
-
get critical(): boolean
|
|
213
|
-
set critical(val: boolean)
|
|
214
|
-
get ids(): Array<string> | undefined
|
|
215
|
-
}
|
|
216
|
-
|
|
217
225
|
export declare class JsEntries {
|
|
218
226
|
clear(): void
|
|
219
227
|
get size(): number
|
|
@@ -246,32 +254,34 @@ export declare class JsModule {
|
|
|
246
254
|
get type(): string
|
|
247
255
|
get layer(): string | undefined
|
|
248
256
|
get blocks(): JsDependenciesBlock[]
|
|
249
|
-
get dependencies():
|
|
257
|
+
get dependencies(): Dependency[]
|
|
250
258
|
size(ty?: string | undefined | null): number
|
|
251
259
|
get modules(): JsModule[] | undefined
|
|
252
260
|
get useSourceMap(): boolean
|
|
253
261
|
libIdent(options: JsLibIdentOptions): string | null
|
|
254
262
|
get resourceResolveData(): JsResourceData | undefined
|
|
255
263
|
get matchResource(): string | undefined
|
|
264
|
+
set matchResource(val: string | undefined)
|
|
256
265
|
emitFile(filename: string, source: JsCompatSource, jsAssetInfo?: AssetInfo | undefined | null): void
|
|
257
266
|
}
|
|
258
267
|
|
|
259
268
|
export declare class JsModuleGraph {
|
|
260
|
-
getModule(
|
|
261
|
-
getResolvedModule(
|
|
269
|
+
getModule(dependency: Dependency): JsModule | null
|
|
270
|
+
getResolvedModule(dependency: Dependency): JsModule | null
|
|
262
271
|
getUsedExports(jsModule: JsModule, jsRuntime: string | Array<string>): boolean | Array<string> | null
|
|
263
272
|
getIssuer(module: JsModule): JsModule | null
|
|
264
273
|
getExportsInfo(module: JsModule): JsExportsInfo
|
|
265
|
-
getConnection(dependency:
|
|
274
|
+
getConnection(dependency: Dependency): JsModuleGraphConnection | null
|
|
266
275
|
getOutgoingConnections(module: JsModule): JsModuleGraphConnection[]
|
|
276
|
+
getOutgoingConnectionsInOrder(module: JsModule): JsModuleGraphConnection[]
|
|
267
277
|
getIncomingConnections(module: JsModule): JsModuleGraphConnection[]
|
|
268
|
-
getParentModule(
|
|
269
|
-
getParentBlockIndex(
|
|
278
|
+
getParentModule(dependency: Dependency): JsModule | null
|
|
279
|
+
getParentBlockIndex(dependency: Dependency): number
|
|
270
280
|
isAsync(module: JsModule): boolean
|
|
271
281
|
}
|
|
272
282
|
|
|
273
283
|
export declare class JsModuleGraphConnection {
|
|
274
|
-
get dependency():
|
|
284
|
+
get dependency(): Dependency
|
|
275
285
|
get module(): JsModule | null
|
|
276
286
|
get resolvedModule(): JsModule | null
|
|
277
287
|
get originModule(): JsModule | null
|
|
@@ -381,10 +391,11 @@ export declare enum BuiltinPluginName {
|
|
|
381
391
|
LightningCssMinimizerRspackPlugin = 'LightningCssMinimizerRspackPlugin',
|
|
382
392
|
BundlerInfoRspackPlugin = 'BundlerInfoRspackPlugin',
|
|
383
393
|
CssExtractRspackPlugin = 'CssExtractRspackPlugin',
|
|
394
|
+
SubresourceIntegrityPlugin = 'SubresourceIntegrityPlugin',
|
|
384
395
|
RsdoctorPlugin = 'RsdoctorPlugin',
|
|
385
396
|
JsLoaderRspackPlugin = 'JsLoaderRspackPlugin',
|
|
386
397
|
LazyCompilationPlugin = 'LazyCompilationPlugin',
|
|
387
|
-
|
|
398
|
+
ModuleInfoHeaderPlugin = 'ModuleInfoHeaderPlugin'
|
|
388
399
|
}
|
|
389
400
|
|
|
390
401
|
export declare function cleanupGlobalTrace(): void
|
|
@@ -423,6 +434,7 @@ export interface JsAfterResolveData {
|
|
|
423
434
|
request: string
|
|
424
435
|
context: string
|
|
425
436
|
issuer: string
|
|
437
|
+
issuerLayer?: string
|
|
426
438
|
fileDependencies: Array<string>
|
|
427
439
|
contextDependencies: Array<string>
|
|
428
440
|
missingDependencies: Array<string>
|
|
@@ -489,6 +501,7 @@ export interface JsBeforeResolveArgs {
|
|
|
489
501
|
request: string
|
|
490
502
|
context: string
|
|
491
503
|
issuer: string
|
|
504
|
+
issuerLayer?: string
|
|
492
505
|
}
|
|
493
506
|
|
|
494
507
|
export interface JsBuildMeta {
|
|
@@ -602,8 +615,8 @@ export interface JsDiagnosticLocation {
|
|
|
602
615
|
}
|
|
603
616
|
|
|
604
617
|
export interface JsEntryData {
|
|
605
|
-
dependencies: Array<
|
|
606
|
-
includeDependencies: Array<
|
|
618
|
+
dependencies: Array<Dependency>
|
|
619
|
+
includeDependencies: Array<Dependency>
|
|
607
620
|
options: JsEntryOptions
|
|
608
621
|
}
|
|
609
622
|
|
|
@@ -647,6 +660,7 @@ export interface JsFactorizeArgs {
|
|
|
647
660
|
request: string
|
|
648
661
|
context: string
|
|
649
662
|
issuer: string
|
|
663
|
+
issuerLayer?: string
|
|
650
664
|
}
|
|
651
665
|
|
|
652
666
|
export interface JsFactoryMeta {
|
|
@@ -795,6 +809,7 @@ export interface JsResolveArgs {
|
|
|
795
809
|
request: string
|
|
796
810
|
context: string
|
|
797
811
|
issuer: string
|
|
812
|
+
issuerLayer?: string
|
|
798
813
|
}
|
|
799
814
|
|
|
800
815
|
export interface JsResolveForSchemeArgs {
|
|
@@ -1410,6 +1425,7 @@ export interface RawCacheGroupOptions {
|
|
|
1410
1425
|
|
|
1411
1426
|
export interface RawCacheOptions {
|
|
1412
1427
|
type: string
|
|
1428
|
+
maxGenerations?: number
|
|
1413
1429
|
}
|
|
1414
1430
|
|
|
1415
1431
|
export interface RawConsumeOptions {
|
|
@@ -1521,10 +1537,6 @@ export interface RawCssParserOptions {
|
|
|
1521
1537
|
namedExports?: boolean
|
|
1522
1538
|
}
|
|
1523
1539
|
|
|
1524
|
-
export interface RawDependency {
|
|
1525
|
-
request: string
|
|
1526
|
-
}
|
|
1527
|
-
|
|
1528
1540
|
export interface RawDllEntryPluginOptions {
|
|
1529
1541
|
context: string
|
|
1530
1542
|
entries: Array<string>
|
package/binding.js
CHANGED
|
@@ -212,6 +212,25 @@ switch (platform) {
|
|
|
212
212
|
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
+
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
216
|
+
try {
|
|
217
|
+
nativeBinding = require('./rspack.wasi.cjs')
|
|
218
|
+
} catch (e) {
|
|
219
|
+
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
220
|
+
loadError = e
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (!nativeBinding) {
|
|
224
|
+
try {
|
|
225
|
+
nativeBinding = require('@rspack/binding-wasm32-wasi')
|
|
226
|
+
} catch (e) {
|
|
227
|
+
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
228
|
+
loadError = e
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
215
234
|
if (!nativeBinding) {
|
|
216
235
|
if (loadError) {
|
|
217
236
|
throw loadError
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/binding",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Node binding for rspack",
|
|
6
6
|
"main": "binding.js",
|
|
@@ -17,28 +17,53 @@
|
|
|
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.
|
|
21
|
-
"
|
|
20
|
+
"@napi-rs/cli": "3.0.0-alpha.73",
|
|
21
|
+
"@napi-rs/wasm-runtime": "^0.2.7",
|
|
22
|
+
"emnapi": "^1.3.1",
|
|
23
|
+
"typescript": "^5.7.3",
|
|
24
|
+
"@emnapi/core": "^1.3.1"
|
|
22
25
|
},
|
|
23
26
|
"napi": {
|
|
24
|
-
"binaryName": "rspack"
|
|
27
|
+
"binaryName": "rspack",
|
|
28
|
+
"packageName": "@rspack/binding",
|
|
29
|
+
"targets": [
|
|
30
|
+
"x86_64-apple-darwin",
|
|
31
|
+
"x86_64-pc-windows-msvc",
|
|
32
|
+
"x86_64-unknown-linux-gnu",
|
|
33
|
+
"x86_64-unknown-linux-musl",
|
|
34
|
+
"x86_64-unknown-freebsd",
|
|
35
|
+
"i686-pc-windows-msvc",
|
|
36
|
+
"armv7-unknown-linux-gnueabihf",
|
|
37
|
+
"aarch64-unknown-linux-gnu",
|
|
38
|
+
"aarch64-apple-darwin",
|
|
39
|
+
"aarch64-unknown-linux-musl",
|
|
40
|
+
"aarch64-pc-windows-msvc",
|
|
41
|
+
"wasm32-wasip1-threads"
|
|
42
|
+
],
|
|
43
|
+
"wasm": {
|
|
44
|
+
"initialMemory": 16384,
|
|
45
|
+
"browser": {
|
|
46
|
+
"fs": true
|
|
47
|
+
}
|
|
48
|
+
}
|
|
25
49
|
},
|
|
26
50
|
"optionalDependencies": {
|
|
27
|
-
"@rspack/binding-darwin-arm64": "1.2.
|
|
28
|
-
"@rspack/binding-win32-arm64-msvc": "1.2.
|
|
29
|
-
"@rspack/binding-linux-arm64-
|
|
30
|
-
"@rspack/binding-linux-arm64-
|
|
31
|
-
"@rspack/binding-
|
|
32
|
-
"@rspack/binding-
|
|
33
|
-
"@rspack/binding-win32-x64-msvc": "1.2.
|
|
34
|
-
"@rspack/binding-linux-x64-gnu": "1.2.
|
|
35
|
-
"@rspack/binding-linux-x64-musl": "1.2.
|
|
51
|
+
"@rspack/binding-darwin-arm64": "1.2.8",
|
|
52
|
+
"@rspack/binding-win32-arm64-msvc": "1.2.8",
|
|
53
|
+
"@rspack/binding-linux-arm64-gnu": "1.2.8",
|
|
54
|
+
"@rspack/binding-linux-arm64-musl": "1.2.8",
|
|
55
|
+
"@rspack/binding-win32-ia32-msvc": "1.2.8",
|
|
56
|
+
"@rspack/binding-darwin-x64": "1.2.8",
|
|
57
|
+
"@rspack/binding-win32-x64-msvc": "1.2.8",
|
|
58
|
+
"@rspack/binding-linux-x64-gnu": "1.2.8",
|
|
59
|
+
"@rspack/binding-linux-x64-musl": "1.2.8"
|
|
36
60
|
},
|
|
37
61
|
"scripts": {
|
|
38
62
|
"build:dev": "node scripts/build.js",
|
|
39
63
|
"build:ci": "node scripts/build.js --profile ci",
|
|
40
64
|
"build:profiling": "node scripts/build.js --profile profiling",
|
|
41
65
|
"build:release": "node scripts/build.js --profile release",
|
|
66
|
+
"build:wasm": "DISABLE_PLUGIN=1 RUST_TARGET=wasm32-wasip1-threads node scripts/build.js",
|
|
42
67
|
"move-binding": "node scripts/move-binding",
|
|
43
68
|
"test": "tsc -p tsconfig.type-test.json"
|
|
44
69
|
}
|