@rspack/binding 1.0.0-alpha.5 → 1.0.0-beta.0
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 +45 -24
- package/package.json +13 -11
package/binding.d.ts
CHANGED
|
@@ -29,14 +29,18 @@ export class JsCompilation {
|
|
|
29
29
|
getChunks(): Array<JsChunk>
|
|
30
30
|
getNamedChunkKeys(): Array<string>
|
|
31
31
|
getNamedChunk(name: string): JsChunk | null
|
|
32
|
+
getNamedChunkGroupKeys(): Array<string>
|
|
33
|
+
getNamedChunkGroup(name: string): JsChunkGroup | null
|
|
32
34
|
setAssetSource(name: string, source: JsCompatSource): void
|
|
33
35
|
deleteAssetSource(name: string): void
|
|
34
36
|
getAssetFilenames(): Array<string>
|
|
35
37
|
hasAsset(name: string): boolean
|
|
38
|
+
emitAssetFromLoader(filename: string, source: JsCompatSource, assetInfo: JsAssetInfo, module: string): void
|
|
36
39
|
emitAsset(filename: string, source: JsCompatSource, assetInfo: JsAssetInfo): void
|
|
37
40
|
deleteAsset(filename: string): void
|
|
38
41
|
renameAsset(filename: string, newName: string): void
|
|
39
42
|
get entrypoints(): Record<string, JsChunkGroup>
|
|
43
|
+
get chunkGroups(): Array<JsChunkGroup>
|
|
40
44
|
get hash(): string | null
|
|
41
45
|
getFileDependencies(): Array<string>
|
|
42
46
|
getContextDependencies(): Array<string>
|
|
@@ -57,7 +61,7 @@ export class JsCompilation {
|
|
|
57
61
|
addMissingDependencies(deps: Array<string>): void
|
|
58
62
|
addBuildDependencies(deps: Array<string>): void
|
|
59
63
|
rebuildModule(moduleIdentifiers: Array<string>, f: (...args: any[]) => any): void
|
|
60
|
-
importModule(request: string, publicPath:
|
|
64
|
+
importModule(request: string, publicPath: JsFilename | undefined | null, baseUri: string | undefined | null, originalModule: string | undefined | null, originalModuleContext: string | undefined | null, callback: (...args: any[]) => any): void
|
|
61
65
|
}
|
|
62
66
|
|
|
63
67
|
export class JsResolver {
|
|
@@ -118,6 +122,7 @@ export class JsStatsModule {
|
|
|
118
122
|
get issuer(): string | undefined
|
|
119
123
|
get issuerName(): string | undefined
|
|
120
124
|
get issuerId(): string | undefined
|
|
125
|
+
get issuerPath(): Array<JsStatsModuleIssuer>
|
|
121
126
|
get nameForCondition(): string | undefined
|
|
122
127
|
get assets(): Array<string> | undefined
|
|
123
128
|
get source(): string | Buffer | undefined
|
|
@@ -137,7 +142,6 @@ export class JsStatsModule {
|
|
|
137
142
|
get errors(): number
|
|
138
143
|
get warnings(): number
|
|
139
144
|
get sizes(): Array<JsStatsSize>
|
|
140
|
-
get issuerPath(): Array<JsStatsModuleIssuer>
|
|
141
145
|
get profile(): JsStatsModuleProfile | undefined
|
|
142
146
|
get reasons(): Array<JsStatsModuleReason> | undefined
|
|
143
147
|
get modules(): Array<JsStatsModule> | undefined
|
|
@@ -270,6 +274,10 @@ export enum BuiltinPluginName {
|
|
|
270
274
|
|
|
271
275
|
export function cleanupGlobalTrace(): void
|
|
272
276
|
|
|
277
|
+
export interface ContextInfo {
|
|
278
|
+
issuer: string
|
|
279
|
+
}
|
|
280
|
+
|
|
273
281
|
export interface JsAdditionalTreeRuntimeRequirementsArg {
|
|
274
282
|
chunk: JsChunk
|
|
275
283
|
runtimeRequirements: JsRuntimeGlobals
|
|
@@ -305,16 +313,15 @@ export interface JsAssetInfo {
|
|
|
305
313
|
immutable: boolean
|
|
306
314
|
/** whether the asset is minimized */
|
|
307
315
|
minimized: boolean
|
|
308
|
-
/**
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
chunkHash: Array<string>
|
|
316
|
+
/** the value(s) of the full hash used for this asset */
|
|
317
|
+
fullhash: Array<string>
|
|
318
|
+
/** the value(s) of the chunk hash used for this asset */
|
|
319
|
+
chunkhash: Array<string>
|
|
313
320
|
/**
|
|
314
321
|
* the value(s) of the module hash used for this asset
|
|
315
322
|
* the value(s) of the content hash used for this asset
|
|
316
323
|
*/
|
|
317
|
-
|
|
324
|
+
contenthash: Array<string>
|
|
318
325
|
sourceFilename?: string
|
|
319
326
|
/**
|
|
320
327
|
* size in bytes, only set after asset has been emitted
|
|
@@ -473,7 +480,6 @@ export interface JsLoaderContext {
|
|
|
473
480
|
contextDependencies: Array<string>
|
|
474
481
|
missingDependencies: Array<string>
|
|
475
482
|
buildDependencies: Array<string>
|
|
476
|
-
assetFilenames: Array<string>
|
|
477
483
|
loaderItems: Array<JsLoaderItem>
|
|
478
484
|
loaderIndex: number
|
|
479
485
|
loaderState: Readonly<JsLoaderState>
|
|
@@ -605,8 +611,9 @@ export interface JsStatsAssetInfo {
|
|
|
605
611
|
sourceFilename?: string
|
|
606
612
|
immutable: boolean
|
|
607
613
|
javascriptModule?: boolean
|
|
608
|
-
|
|
609
|
-
|
|
614
|
+
chunkhash: Array<string>
|
|
615
|
+
contenthash: Array<string>
|
|
616
|
+
fullhash: Array<string>
|
|
610
617
|
related: Array<JsStatsAssetInfoRelated>
|
|
611
618
|
}
|
|
612
619
|
|
|
@@ -747,8 +754,8 @@ export interface RawAssetGeneratorDataUrlOptions {
|
|
|
747
754
|
|
|
748
755
|
export interface RawAssetGeneratorOptions {
|
|
749
756
|
emit?: boolean
|
|
750
|
-
filename?:
|
|
751
|
-
publicPath?:
|
|
757
|
+
filename?: JsFilename
|
|
758
|
+
publicPath?: "auto" | JsFilename
|
|
752
759
|
dataUrl?: RawAssetGeneratorDataUrlOptions | ((arg: RawAssetGeneratorDataUrlFnArgs) => string)
|
|
753
760
|
}
|
|
754
761
|
|
|
@@ -771,8 +778,8 @@ export interface RawAssetParserOptions {
|
|
|
771
778
|
|
|
772
779
|
export interface RawAssetResourceGeneratorOptions {
|
|
773
780
|
emit?: boolean
|
|
774
|
-
filename?:
|
|
775
|
-
publicPath?:
|
|
781
|
+
filename?: JsFilename
|
|
782
|
+
publicPath?: "auto" | JsFilename
|
|
776
783
|
}
|
|
777
784
|
|
|
778
785
|
export interface RawBannerContentFnCtx {
|
|
@@ -961,9 +968,9 @@ export interface RawEntryOptions {
|
|
|
961
968
|
runtime?: false | string
|
|
962
969
|
chunkLoading?: string
|
|
963
970
|
asyncChunks?: boolean
|
|
964
|
-
publicPath?:
|
|
971
|
+
publicPath?: "auto" | JsFilename
|
|
965
972
|
baseUri?: string
|
|
966
|
-
filename?:
|
|
973
|
+
filename?: JsFilename
|
|
967
974
|
library?: RawLibraryOptions
|
|
968
975
|
dependOn?: Array<string>
|
|
969
976
|
}
|
|
@@ -1000,6 +1007,7 @@ export interface RawExternalItemFnCtx {
|
|
|
1000
1007
|
request: string
|
|
1001
1008
|
context: string
|
|
1002
1009
|
dependencyType: string
|
|
1010
|
+
contextInfo: ContextInfo
|
|
1003
1011
|
}
|
|
1004
1012
|
|
|
1005
1013
|
export interface RawExternalItemFnResult {
|
|
@@ -1155,6 +1163,9 @@ export interface RawLightningCssMinimizerRspackPluginOptions {
|
|
|
1155
1163
|
unusedSymbols: Array<string>
|
|
1156
1164
|
removeUnusedLocalIdents: boolean
|
|
1157
1165
|
browserslist: Array<string>
|
|
1166
|
+
test?: string | RegExp | (string | RegExp)[]
|
|
1167
|
+
include?: string | RegExp | (string | RegExp)[]
|
|
1168
|
+
exclude?: string | RegExp | (string | RegExp)[]
|
|
1158
1169
|
}
|
|
1159
1170
|
|
|
1160
1171
|
export interface RawLimitChunkCountPluginOptions {
|
|
@@ -1283,7 +1294,7 @@ export interface RawOutputOptions {
|
|
|
1283
1294
|
path: string
|
|
1284
1295
|
pathinfo: boolean | "verbose"
|
|
1285
1296
|
clean: boolean
|
|
1286
|
-
publicPath:
|
|
1297
|
+
publicPath: "auto" | JsFilename
|
|
1287
1298
|
assetModuleFilename: JsFilename
|
|
1288
1299
|
wasmLoading: string
|
|
1289
1300
|
enabledWasmLoadingTypes: Array<string>
|
|
@@ -1306,6 +1317,8 @@ export interface RawOutputOptions {
|
|
|
1306
1317
|
iife: boolean
|
|
1307
1318
|
module: boolean
|
|
1308
1319
|
chunkLoading: string
|
|
1320
|
+
chunkLoadTimeout: number
|
|
1321
|
+
charset: boolean
|
|
1309
1322
|
enabledChunkLoadingTypes?: Array<string>
|
|
1310
1323
|
trustedTypes?: RawTrustedTypes
|
|
1311
1324
|
sourceMapFilename: string
|
|
@@ -1428,12 +1441,20 @@ export interface RawRspackFuture {
|
|
|
1428
1441
|
}
|
|
1429
1442
|
|
|
1430
1443
|
export interface RawRuleSetCondition {
|
|
1431
|
-
type:
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1444
|
+
type: RawRuleSetConditionType
|
|
1445
|
+
string?: string
|
|
1446
|
+
regexp?: RawRegex
|
|
1447
|
+
logical?: Array<RawRuleSetLogicalConditions>
|
|
1448
|
+
array?: Array<RawRuleSetCondition>
|
|
1449
|
+
func?: (value: string) => boolean
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
export enum RawRuleSetConditionType {
|
|
1453
|
+
string = 'string',
|
|
1454
|
+
regexp = 'regexp',
|
|
1455
|
+
logical = 'logical',
|
|
1456
|
+
array = 'array',
|
|
1457
|
+
func = 'func'
|
|
1437
1458
|
}
|
|
1438
1459
|
|
|
1439
1460
|
export interface RawRuleSetLogicalConditions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/binding",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Node binding for rspack",
|
|
6
6
|
"main": "binding.js",
|
|
@@ -17,21 +17,22 @@
|
|
|
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.45"
|
|
20
|
+
"@napi-rs/cli": "3.0.0-alpha.45",
|
|
21
|
+
"typescript": "5.0.2"
|
|
21
22
|
},
|
|
22
23
|
"napi": {
|
|
23
24
|
"binaryName": "rspack"
|
|
24
25
|
},
|
|
25
26
|
"optionalDependencies": {
|
|
26
|
-
"@rspack/binding-darwin-arm64": "1.0.0-
|
|
27
|
-
"@rspack/binding-win32-arm64-msvc": "1.0.0-
|
|
28
|
-
"@rspack/binding-
|
|
29
|
-
"@rspack/binding-linux-arm64-musl": "1.0.0-
|
|
30
|
-
"@rspack/binding-
|
|
31
|
-
"@rspack/binding-
|
|
32
|
-
"@rspack/binding-win32-x64-msvc": "1.0.0-
|
|
33
|
-
"@rspack/binding-linux-x64-
|
|
34
|
-
"@rspack/binding-linux-x64-
|
|
27
|
+
"@rspack/binding-darwin-arm64": "1.0.0-beta.0",
|
|
28
|
+
"@rspack/binding-win32-arm64-msvc": "1.0.0-beta.0",
|
|
29
|
+
"@rspack/binding-linux-arm64-gnu": "1.0.0-beta.0",
|
|
30
|
+
"@rspack/binding-linux-arm64-musl": "1.0.0-beta.0",
|
|
31
|
+
"@rspack/binding-darwin-x64": "1.0.0-beta.0",
|
|
32
|
+
"@rspack/binding-win32-ia32-msvc": "1.0.0-beta.0",
|
|
33
|
+
"@rspack/binding-win32-x64-msvc": "1.0.0-beta.0",
|
|
34
|
+
"@rspack/binding-linux-x64-musl": "1.0.0-beta.0",
|
|
35
|
+
"@rspack/binding-linux-x64-gnu": "1.0.0-beta.0"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
38
|
"build:debug": "node scripts/build.js",
|
|
@@ -52,6 +53,7 @@
|
|
|
52
53
|
"build:release-prod:x64": "cross-env RUST_TARGET=x86_64-apple-darwin node scripts/build.js --release-prod",
|
|
53
54
|
"build:release-prod:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js --release-prod",
|
|
54
55
|
"build:release-prod:win": "cross-env RUST_TARGET=x86_64-pc-windows-msvc node scripts/build.js --release-prod",
|
|
56
|
+
"build:release-debug": "node scripts/build.js --release-debug",
|
|
55
57
|
"move-binding": "node scripts/move-binding",
|
|
56
58
|
"test": "tsc -p tsconfig.type-test.json"
|
|
57
59
|
}
|