@rspack/binding 1.0.0-alpha.5 → 1.0.0-beta.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 +57 -24
- package/package.json +14 -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 {
|
|
@@ -109,6 +113,7 @@ export class JsStatsModule {
|
|
|
109
113
|
get type(): string
|
|
110
114
|
get moduleType(): string
|
|
111
115
|
get identifier(): string
|
|
116
|
+
get layer(): string | undefined
|
|
112
117
|
get name(): string
|
|
113
118
|
get id(): string | undefined
|
|
114
119
|
get chunks(): Array<string | undefined | null>
|
|
@@ -118,6 +123,7 @@ export class JsStatsModule {
|
|
|
118
123
|
get issuer(): string | undefined
|
|
119
124
|
get issuerName(): string | undefined
|
|
120
125
|
get issuerId(): string | undefined
|
|
126
|
+
get issuerPath(): Array<JsStatsModuleIssuer>
|
|
121
127
|
get nameForCondition(): string | undefined
|
|
122
128
|
get assets(): Array<string> | undefined
|
|
123
129
|
get source(): string | Buffer | undefined
|
|
@@ -137,7 +143,6 @@ export class JsStatsModule {
|
|
|
137
143
|
get errors(): number
|
|
138
144
|
get warnings(): number
|
|
139
145
|
get sizes(): Array<JsStatsSize>
|
|
140
|
-
get issuerPath(): Array<JsStatsModuleIssuer>
|
|
141
146
|
get profile(): JsStatsModuleProfile | undefined
|
|
142
147
|
get reasons(): Array<JsStatsModuleReason> | undefined
|
|
143
148
|
get modules(): Array<JsStatsModule> | undefined
|
|
@@ -270,6 +275,10 @@ export enum BuiltinPluginName {
|
|
|
270
275
|
|
|
271
276
|
export function cleanupGlobalTrace(): void
|
|
272
277
|
|
|
278
|
+
export interface ContextInfo {
|
|
279
|
+
issuer: string
|
|
280
|
+
}
|
|
281
|
+
|
|
273
282
|
export interface JsAdditionalTreeRuntimeRequirementsArg {
|
|
274
283
|
chunk: JsChunk
|
|
275
284
|
runtimeRequirements: JsRuntimeGlobals
|
|
@@ -305,16 +314,15 @@ export interface JsAssetInfo {
|
|
|
305
314
|
immutable: boolean
|
|
306
315
|
/** whether the asset is minimized */
|
|
307
316
|
minimized: boolean
|
|
308
|
-
/**
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
chunkHash: Array<string>
|
|
317
|
+
/** the value(s) of the full hash used for this asset */
|
|
318
|
+
fullhash: Array<string>
|
|
319
|
+
/** the value(s) of the chunk hash used for this asset */
|
|
320
|
+
chunkhash: Array<string>
|
|
313
321
|
/**
|
|
314
322
|
* the value(s) of the module hash used for this asset
|
|
315
323
|
* the value(s) of the content hash used for this asset
|
|
316
324
|
*/
|
|
317
|
-
|
|
325
|
+
contenthash: Array<string>
|
|
318
326
|
sourceFilename?: string
|
|
319
327
|
/**
|
|
320
328
|
* size in bytes, only set after asset has been emitted
|
|
@@ -473,7 +481,6 @@ export interface JsLoaderContext {
|
|
|
473
481
|
contextDependencies: Array<string>
|
|
474
482
|
missingDependencies: Array<string>
|
|
475
483
|
buildDependencies: Array<string>
|
|
476
|
-
assetFilenames: Array<string>
|
|
477
484
|
loaderItems: Array<JsLoaderItem>
|
|
478
485
|
loaderIndex: number
|
|
479
486
|
loaderState: Readonly<JsLoaderState>
|
|
@@ -503,6 +510,7 @@ export interface JsModule {
|
|
|
503
510
|
rawRequest?: string
|
|
504
511
|
factoryMeta?: JsFactoryMeta
|
|
505
512
|
type: string
|
|
513
|
+
layer?: string
|
|
506
514
|
}
|
|
507
515
|
|
|
508
516
|
export interface JsNormalModuleFactoryCreateModuleArgs {
|
|
@@ -558,6 +566,7 @@ export interface JsRspackError {
|
|
|
558
566
|
name: string
|
|
559
567
|
message: string
|
|
560
568
|
moduleIdentifier?: string
|
|
569
|
+
loc?: string
|
|
561
570
|
file?: string
|
|
562
571
|
stack?: string
|
|
563
572
|
hideStack?: boolean
|
|
@@ -605,8 +614,9 @@ export interface JsStatsAssetInfo {
|
|
|
605
614
|
sourceFilename?: string
|
|
606
615
|
immutable: boolean
|
|
607
616
|
javascriptModule?: boolean
|
|
608
|
-
|
|
609
|
-
|
|
617
|
+
chunkhash: Array<string>
|
|
618
|
+
contenthash: Array<string>
|
|
619
|
+
fullhash: Array<string>
|
|
610
620
|
related: Array<JsStatsAssetInfoRelated>
|
|
611
621
|
}
|
|
612
622
|
|
|
@@ -645,6 +655,7 @@ export interface JsStatsError {
|
|
|
645
655
|
chunkName?: string
|
|
646
656
|
chunkEntry?: boolean
|
|
647
657
|
chunkInitial?: boolean
|
|
658
|
+
loc?: string
|
|
648
659
|
file?: string
|
|
649
660
|
moduleIdentifier?: string
|
|
650
661
|
moduleName?: string
|
|
@@ -747,8 +758,8 @@ export interface RawAssetGeneratorDataUrlOptions {
|
|
|
747
758
|
|
|
748
759
|
export interface RawAssetGeneratorOptions {
|
|
749
760
|
emit?: boolean
|
|
750
|
-
filename?:
|
|
751
|
-
publicPath?:
|
|
761
|
+
filename?: JsFilename
|
|
762
|
+
publicPath?: "auto" | JsFilename
|
|
752
763
|
dataUrl?: RawAssetGeneratorDataUrlOptions | ((arg: RawAssetGeneratorDataUrlFnArgs) => string)
|
|
753
764
|
}
|
|
754
765
|
|
|
@@ -771,8 +782,8 @@ export interface RawAssetParserOptions {
|
|
|
771
782
|
|
|
772
783
|
export interface RawAssetResourceGeneratorOptions {
|
|
773
784
|
emit?: boolean
|
|
774
|
-
filename?:
|
|
775
|
-
publicPath?:
|
|
785
|
+
filename?: JsFilename
|
|
786
|
+
publicPath?: "auto" | JsFilename
|
|
776
787
|
}
|
|
777
788
|
|
|
778
789
|
export interface RawBannerContentFnCtx {
|
|
@@ -807,6 +818,7 @@ export interface RawCacheGroupOptions {
|
|
|
807
818
|
/** What kind of chunks should be selected. */
|
|
808
819
|
chunks?: RegExp | 'async' | 'initial' | 'all'
|
|
809
820
|
type?: RegExp | string
|
|
821
|
+
layer?: RegExp | string
|
|
810
822
|
automaticNameDelimiter?: string
|
|
811
823
|
minChunks?: number
|
|
812
824
|
minSize?: number | RawSplitChunkSizes
|
|
@@ -961,11 +973,12 @@ export interface RawEntryOptions {
|
|
|
961
973
|
runtime?: false | string
|
|
962
974
|
chunkLoading?: string
|
|
963
975
|
asyncChunks?: boolean
|
|
964
|
-
publicPath?:
|
|
976
|
+
publicPath?: "auto" | JsFilename
|
|
965
977
|
baseUri?: string
|
|
966
|
-
filename?:
|
|
978
|
+
filename?: JsFilename
|
|
967
979
|
library?: RawLibraryOptions
|
|
968
980
|
dependOn?: Array<string>
|
|
981
|
+
layer?: string
|
|
969
982
|
}
|
|
970
983
|
|
|
971
984
|
export interface RawEntryPluginOptions {
|
|
@@ -986,6 +999,7 @@ export interface RawEvalDevToolModulePluginOptions {
|
|
|
986
999
|
}
|
|
987
1000
|
|
|
988
1001
|
export interface RawExperiments {
|
|
1002
|
+
layers: boolean
|
|
989
1003
|
topLevelAwait: boolean
|
|
990
1004
|
rspackFuture: RawRspackFuture
|
|
991
1005
|
}
|
|
@@ -1000,6 +1014,7 @@ export interface RawExternalItemFnCtx {
|
|
|
1000
1014
|
request: string
|
|
1001
1015
|
context: string
|
|
1002
1016
|
dependencyType: string
|
|
1017
|
+
contextInfo: ContextInfo
|
|
1003
1018
|
}
|
|
1004
1019
|
|
|
1005
1020
|
export interface RawExternalItemFnResult {
|
|
@@ -1111,6 +1126,7 @@ export interface RawJavascriptParserOptions {
|
|
|
1111
1126
|
strictExportPresence: boolean
|
|
1112
1127
|
worker: Array<string>
|
|
1113
1128
|
overrideStrict?: string
|
|
1129
|
+
importMeta: boolean
|
|
1114
1130
|
}
|
|
1115
1131
|
|
|
1116
1132
|
export interface RawLazyCompilationOption {
|
|
@@ -1155,6 +1171,9 @@ export interface RawLightningCssMinimizerRspackPluginOptions {
|
|
|
1155
1171
|
unusedSymbols: Array<string>
|
|
1156
1172
|
removeUnusedLocalIdents: boolean
|
|
1157
1173
|
browserslist: Array<string>
|
|
1174
|
+
test?: string | RegExp | (string | RegExp)[]
|
|
1175
|
+
include?: string | RegExp | (string | RegExp)[]
|
|
1176
|
+
exclude?: string | RegExp | (string | RegExp)[]
|
|
1158
1177
|
}
|
|
1159
1178
|
|
|
1160
1179
|
export interface RawLimitChunkCountPluginOptions {
|
|
@@ -1213,13 +1232,16 @@ export interface RawModuleRule {
|
|
|
1213
1232
|
resourceQuery?: RawRuleSetCondition
|
|
1214
1233
|
resourceFragment?: RawRuleSetCondition
|
|
1215
1234
|
descriptionData?: Record<string, RawRuleSetCondition>
|
|
1235
|
+
with?: Record<string, RawRuleSetCondition>
|
|
1216
1236
|
sideEffects?: boolean
|
|
1217
1237
|
use?: RawModuleRuleUse[] | ((arg: RawFuncUseCtx) => RawModuleRuleUse[])
|
|
1218
1238
|
type?: string
|
|
1239
|
+
layer?: string
|
|
1219
1240
|
parser?: RawParserOptions
|
|
1220
1241
|
generator?: RawGeneratorOptions
|
|
1221
1242
|
resolve?: RawResolveOptions
|
|
1222
1243
|
issuer?: RawRuleSetCondition
|
|
1244
|
+
issuerLayer?: RawRuleSetCondition
|
|
1223
1245
|
dependency?: RawRuleSetCondition
|
|
1224
1246
|
scheme?: RawRuleSetCondition
|
|
1225
1247
|
mimetype?: RawRuleSetCondition
|
|
@@ -1283,7 +1305,7 @@ export interface RawOutputOptions {
|
|
|
1283
1305
|
path: string
|
|
1284
1306
|
pathinfo: boolean | "verbose"
|
|
1285
1307
|
clean: boolean
|
|
1286
|
-
publicPath:
|
|
1308
|
+
publicPath: "auto" | JsFilename
|
|
1287
1309
|
assetModuleFilename: JsFilename
|
|
1288
1310
|
wasmLoading: string
|
|
1289
1311
|
enabledWasmLoadingTypes: Array<string>
|
|
@@ -1303,9 +1325,12 @@ export interface RawOutputOptions {
|
|
|
1303
1325
|
enabledLibraryTypes?: Array<string>
|
|
1304
1326
|
globalObject: string
|
|
1305
1327
|
importFunctionName: string
|
|
1328
|
+
importMetaName: string
|
|
1306
1329
|
iife: boolean
|
|
1307
1330
|
module: boolean
|
|
1308
1331
|
chunkLoading: string
|
|
1332
|
+
chunkLoadTimeout: number
|
|
1333
|
+
charset: boolean
|
|
1309
1334
|
enabledChunkLoadingTypes?: Array<string>
|
|
1310
1335
|
trustedTypes?: RawTrustedTypes
|
|
1311
1336
|
sourceMapFilename: string
|
|
@@ -1428,12 +1453,20 @@ export interface RawRspackFuture {
|
|
|
1428
1453
|
}
|
|
1429
1454
|
|
|
1430
1455
|
export interface RawRuleSetCondition {
|
|
1431
|
-
type:
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1456
|
+
type: RawRuleSetConditionType
|
|
1457
|
+
string?: string
|
|
1458
|
+
regexp?: RawRegex
|
|
1459
|
+
logical?: Array<RawRuleSetLogicalConditions>
|
|
1460
|
+
array?: Array<RawRuleSetCondition>
|
|
1461
|
+
func?: (value: string) => boolean
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
export enum RawRuleSetConditionType {
|
|
1465
|
+
string = 'string',
|
|
1466
|
+
regexp = 'regexp',
|
|
1467
|
+
logical = 'logical',
|
|
1468
|
+
array = 'array',
|
|
1469
|
+
func = 'func'
|
|
1437
1470
|
}
|
|
1438
1471
|
|
|
1439
1472
|
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.1",
|
|
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-
|
|
33
|
-
"@rspack/binding-
|
|
34
|
-
"@rspack/binding-
|
|
27
|
+
"@rspack/binding-darwin-arm64": "1.0.0-beta.1",
|
|
28
|
+
"@rspack/binding-win32-arm64-msvc": "1.0.0-beta.1",
|
|
29
|
+
"@rspack/binding-linux-arm64-gnu": "1.0.0-beta.1",
|
|
30
|
+
"@rspack/binding-linux-arm64-musl": "1.0.0-beta.1",
|
|
31
|
+
"@rspack/binding-win32-ia32-msvc": "1.0.0-beta.1",
|
|
32
|
+
"@rspack/binding-linux-x64-gnu": "1.0.0-beta.1",
|
|
33
|
+
"@rspack/binding-linux-x64-musl": "1.0.0-beta.1",
|
|
34
|
+
"@rspack/binding-win32-x64-msvc": "1.0.0-beta.1",
|
|
35
|
+
"@rspack/binding-darwin-x64": "1.0.0-beta.1"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
38
|
"build:debug": "node scripts/build.js",
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
"build:release:arm64": "cross-env RUST_TARGET=aarch64-apple-darwin node scripts/build.js --release",
|
|
45
46
|
"build:release:x64": "cross-env RUST_TARGET=x86_64-apple-darwin node scripts/build.js --release",
|
|
46
47
|
"build:release:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js --release",
|
|
48
|
+
"build:release:musl": "cross-env RUST_TARGET=aarch64-unknown-linux-musl node scripts/build.js --release",
|
|
47
49
|
"build:release:win": "cross-env RUST_TARGET=x86_64-pc-windows-msvc node scripts/build.js --release",
|
|
48
50
|
"build:release-prod:all": "run-p build:release-prod:arm64 build:release-prod:x64 build:release-prod:linux && pnpm move-binding",
|
|
49
51
|
"build:release-prod": "node scripts/build.js --release-prod",
|
|
@@ -52,6 +54,7 @@
|
|
|
52
54
|
"build:release-prod:x64": "cross-env RUST_TARGET=x86_64-apple-darwin node scripts/build.js --release-prod",
|
|
53
55
|
"build:release-prod:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js --release-prod",
|
|
54
56
|
"build:release-prod:win": "cross-env RUST_TARGET=x86_64-pc-windows-msvc node scripts/build.js --release-prod",
|
|
57
|
+
"build:release-debug": "node scripts/build.js --release-debug",
|
|
55
58
|
"move-binding": "node scripts/move-binding",
|
|
56
59
|
"test": "tsc -p tsconfig.type-test.json"
|
|
57
60
|
}
|