@rspack/binding 1.0.0-alpha.2 → 1.0.0-alpha.4
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 +74 -38
- package/package.json +17 -10
package/binding.d.ts
CHANGED
|
@@ -60,6 +60,16 @@ export class JsCompilation {
|
|
|
60
60
|
importModule(request: string, publicPath: string | undefined | null, baseUri: string | undefined | null, originalModule: string | undefined | null, originalModuleContext: string | undefined | null, callback: (...args: any[]) => any): void
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
export class JsResolver {
|
|
64
|
+
resolveSync(path: string, request: string): string | false
|
|
65
|
+
withOptions(raw?: RawResolveOptionsWithDependencyType | undefined | null): this
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export class JsResolverFactory {
|
|
69
|
+
constructor()
|
|
70
|
+
get(type: string, options?: RawResolveOptionsWithDependencyType): JsResolver
|
|
71
|
+
}
|
|
72
|
+
|
|
63
73
|
export class JsStats {
|
|
64
74
|
getAssets(): JsStatsGetAssets
|
|
65
75
|
getModules(reasons: boolean, moduleAssets: boolean, nestedModules: boolean, source: boolean, usedExports: boolean, providedExports: boolean): Array<JsStatsModule>
|
|
@@ -73,7 +83,7 @@ export class JsStats {
|
|
|
73
83
|
}
|
|
74
84
|
|
|
75
85
|
export class Rspack {
|
|
76
|
-
constructor(options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS)
|
|
86
|
+
constructor(options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, resolverFactoryReference: JsResolverFactory)
|
|
77
87
|
setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
|
|
78
88
|
/** Build with the given option passed to the constructor */
|
|
79
89
|
build(callback: (err: null | Error) => void): void
|
|
@@ -418,6 +428,7 @@ export interface JsModule {
|
|
|
418
428
|
userRequest?: string
|
|
419
429
|
rawRequest?: string
|
|
420
430
|
factoryMeta?: JsFactoryMeta
|
|
431
|
+
type: string
|
|
421
432
|
}
|
|
422
433
|
|
|
423
434
|
export interface JsNormalModuleFactoryCreateModuleArgs {
|
|
@@ -462,7 +473,7 @@ export interface JsResourceData {
|
|
|
462
473
|
/** Resource with absolute path, query and fragment */
|
|
463
474
|
resource: string
|
|
464
475
|
/** Absolute resource path only */
|
|
465
|
-
path
|
|
476
|
+
path?: string
|
|
466
477
|
/** Resource query with `?` prefix */
|
|
467
478
|
query?: string
|
|
468
479
|
/** Resource fragment with `#` prefix */
|
|
@@ -474,6 +485,8 @@ export interface JsRspackError {
|
|
|
474
485
|
message: string
|
|
475
486
|
moduleIdentifier?: string
|
|
476
487
|
file?: string
|
|
488
|
+
stack?: string
|
|
489
|
+
hideStack?: boolean
|
|
477
490
|
}
|
|
478
491
|
|
|
479
492
|
export enum JsRspackSeverity {
|
|
@@ -574,10 +587,17 @@ export interface JsStatsChunkGroupChildren {
|
|
|
574
587
|
|
|
575
588
|
export interface JsStatsError {
|
|
576
589
|
message: string
|
|
590
|
+
chunkName?: string
|
|
591
|
+
chunkEntry?: boolean
|
|
592
|
+
chunkInitial?: boolean
|
|
593
|
+
file?: string
|
|
577
594
|
moduleIdentifier?: string
|
|
578
595
|
moduleName?: string
|
|
579
596
|
moduleId?: string
|
|
580
|
-
|
|
597
|
+
chunkId?: string
|
|
598
|
+
details?: string
|
|
599
|
+
stack?: string
|
|
600
|
+
moduleTrace: Array<JsStatsModuleTrace>
|
|
581
601
|
}
|
|
582
602
|
|
|
583
603
|
export interface JsStatsGetAssets {
|
|
@@ -654,6 +674,17 @@ export interface JsStatsModuleReason {
|
|
|
654
674
|
userRequest?: string
|
|
655
675
|
}
|
|
656
676
|
|
|
677
|
+
export interface JsStatsModuleTrace {
|
|
678
|
+
origin: JsStatsModuleTraceModule
|
|
679
|
+
module: JsStatsModuleTraceModule
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
export interface JsStatsModuleTraceModule {
|
|
683
|
+
identifier: string
|
|
684
|
+
name?: string
|
|
685
|
+
id?: string
|
|
686
|
+
}
|
|
687
|
+
|
|
657
688
|
export interface JsStatsOptimizationBailout {
|
|
658
689
|
inner: string
|
|
659
690
|
}
|
|
@@ -665,10 +696,17 @@ export interface JsStatsSize {
|
|
|
665
696
|
|
|
666
697
|
export interface JsStatsWarning {
|
|
667
698
|
message: string
|
|
699
|
+
chunkName?: string
|
|
700
|
+
chunkEntry?: boolean
|
|
701
|
+
chunkInitial?: boolean
|
|
702
|
+
file?: string
|
|
668
703
|
moduleIdentifier?: string
|
|
669
704
|
moduleName?: string
|
|
670
705
|
moduleId?: string
|
|
671
|
-
|
|
706
|
+
chunkId?: string
|
|
707
|
+
details?: string
|
|
708
|
+
stack?: string
|
|
709
|
+
moduleTrace: Array<JsStatsModuleTrace>
|
|
672
710
|
}
|
|
673
711
|
|
|
674
712
|
export interface JsTap {
|
|
@@ -750,10 +788,6 @@ export interface RawBannerPluginOptions {
|
|
|
750
788
|
exclude?: string | RegExp | (string | RegExp)[]
|
|
751
789
|
}
|
|
752
790
|
|
|
753
|
-
export interface RawBuiltins {
|
|
754
|
-
treeShaking: string
|
|
755
|
-
}
|
|
756
|
-
|
|
757
791
|
export interface RawBundlerInfoPluginOptions {
|
|
758
792
|
version: string
|
|
759
793
|
bundler: string
|
|
@@ -845,7 +879,7 @@ export interface RawCopyGlobOptions {
|
|
|
845
879
|
|
|
846
880
|
export interface RawCopyPattern {
|
|
847
881
|
from: string
|
|
848
|
-
to?: string | ((pathData: { context: string; absoluteFilename?: string }) => string)
|
|
882
|
+
to?: string | ((pathData: { context: string; absoluteFilename?: string }) => string | Promise<string>)
|
|
849
883
|
context?: string
|
|
850
884
|
toType?: string
|
|
851
885
|
noErrorOnMissing: boolean
|
|
@@ -1072,6 +1106,7 @@ export interface RawJavascriptParserOptions {
|
|
|
1072
1106
|
reexportExportsPresence?: string
|
|
1073
1107
|
strictExportPresence: boolean
|
|
1074
1108
|
worker: Array<string>
|
|
1109
|
+
overrideStrict?: string
|
|
1075
1110
|
}
|
|
1076
1111
|
|
|
1077
1112
|
export interface RawLazyCompilationOption {
|
|
@@ -1297,18 +1332,6 @@ export interface RawPathData {
|
|
|
1297
1332
|
url?: string
|
|
1298
1333
|
}
|
|
1299
1334
|
|
|
1300
|
-
export interface RawPluginImportConfig {
|
|
1301
|
-
libraryName: string
|
|
1302
|
-
libraryDirectory?: string
|
|
1303
|
-
customName?: string
|
|
1304
|
-
customStyleName?: string
|
|
1305
|
-
style?: RawStyleConfig
|
|
1306
|
-
camelToDashComponentName?: boolean
|
|
1307
|
-
transformToDefaultImport?: boolean
|
|
1308
|
-
ignoreEsComponent?: Array<string>
|
|
1309
|
-
ignoreStyleComponent?: Array<string>
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
1335
|
export interface RawProgressPluginOptions {
|
|
1313
1336
|
prefix: string
|
|
1314
1337
|
profile: boolean
|
|
@@ -1325,18 +1348,6 @@ export interface RawProvideOptions {
|
|
|
1325
1348
|
eager: boolean
|
|
1326
1349
|
}
|
|
1327
1350
|
|
|
1328
|
-
export interface RawReactOptions {
|
|
1329
|
-
runtime?: "automatic" | "classic"
|
|
1330
|
-
importSource?: string
|
|
1331
|
-
pragma?: string
|
|
1332
|
-
pragmaFrag?: string
|
|
1333
|
-
throwIfNamespace?: boolean
|
|
1334
|
-
development?: boolean
|
|
1335
|
-
useBuiltins?: boolean
|
|
1336
|
-
useSpread?: boolean
|
|
1337
|
-
refresh?: boolean
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
1351
|
export interface RawRegex {
|
|
1341
1352
|
source: string
|
|
1342
1353
|
flags: string
|
|
@@ -1376,6 +1387,32 @@ export interface RawResolveOptions {
|
|
|
1376
1387
|
roots?: Array<string>
|
|
1377
1388
|
}
|
|
1378
1389
|
|
|
1390
|
+
export interface RawResolveOptionsWithDependencyType {
|
|
1391
|
+
preferRelative?: boolean
|
|
1392
|
+
preferAbsolute?: boolean
|
|
1393
|
+
extensions?: Array<string>
|
|
1394
|
+
mainFiles?: Array<string>
|
|
1395
|
+
mainFields?: Array<string>
|
|
1396
|
+
conditionNames?: Array<string>
|
|
1397
|
+
alias?: Array<RawAliasOptionItem>
|
|
1398
|
+
fallback?: Array<RawAliasOptionItem>
|
|
1399
|
+
symlinks?: boolean
|
|
1400
|
+
tsconfig?: RawResolveTsconfigOptions
|
|
1401
|
+
modules?: Array<string>
|
|
1402
|
+
byDependency?: Record<string, RawResolveOptions>
|
|
1403
|
+
fullySpecified?: boolean
|
|
1404
|
+
exportsFields?: Array<string>
|
|
1405
|
+
descriptionFiles?: Array<string>
|
|
1406
|
+
enforceExtension?: boolean
|
|
1407
|
+
importsFields?: Array<string>
|
|
1408
|
+
extensionAlias?: Record<string, Array<string>>
|
|
1409
|
+
aliasFields?: Array<string>
|
|
1410
|
+
restrictions?: Array<string>
|
|
1411
|
+
roots?: Array<string>
|
|
1412
|
+
dependencyCategory?: string
|
|
1413
|
+
resolveToContext?: boolean
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1379
1416
|
export interface RawResolveTsconfigOptions {
|
|
1380
1417
|
configFile: string
|
|
1381
1418
|
referencesType: "auto" | "manual" | "disabled"
|
|
@@ -1463,11 +1500,10 @@ export interface RawStatsOptions {
|
|
|
1463
1500
|
colors: boolean
|
|
1464
1501
|
}
|
|
1465
1502
|
|
|
1466
|
-
export interface
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
bool?: boolean
|
|
1503
|
+
export interface RawSwcCssMinimizerRspackPluginOptions {
|
|
1504
|
+
test?: string | RegExp | (string | RegExp)[]
|
|
1505
|
+
include?: string | RegExp | (string | RegExp)[]
|
|
1506
|
+
exclude?: string | RegExp | (string | RegExp)[]
|
|
1471
1507
|
}
|
|
1472
1508
|
|
|
1473
1509
|
export interface RawSwcJsMinimizerRspackPluginOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/binding",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Node binding for rspack",
|
|
6
6
|
"main": "binding.js",
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
"binaryName": "rspack"
|
|
24
24
|
},
|
|
25
25
|
"optionalDependencies": {
|
|
26
|
-
"@rspack/binding-
|
|
27
|
-
"@rspack/binding-
|
|
28
|
-
"@rspack/binding-linux-arm64-musl": "1.0.0-alpha.
|
|
29
|
-
"@rspack/binding-
|
|
30
|
-
"@rspack/binding-win32-
|
|
31
|
-
"@rspack/binding-
|
|
32
|
-
"@rspack/binding-
|
|
33
|
-
"@rspack/binding-
|
|
34
|
-
"@rspack/binding-
|
|
26
|
+
"@rspack/binding-win32-arm64-msvc": "1.0.0-alpha.4",
|
|
27
|
+
"@rspack/binding-linux-arm64-gnu": "1.0.0-alpha.4",
|
|
28
|
+
"@rspack/binding-linux-arm64-musl": "1.0.0-alpha.4",
|
|
29
|
+
"@rspack/binding-win32-ia32-msvc": "1.0.0-alpha.4",
|
|
30
|
+
"@rspack/binding-win32-x64-msvc": "1.0.0-alpha.4",
|
|
31
|
+
"@rspack/binding-linux-x64-musl": "1.0.0-alpha.4",
|
|
32
|
+
"@rspack/binding-linux-x64-gnu": "1.0.0-alpha.4",
|
|
33
|
+
"@rspack/binding-darwin-x64": "1.0.0-alpha.4",
|
|
34
|
+
"@rspack/binding-darwin-arm64": "1.0.0-alpha.4"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build:debug": "node scripts/build.js",
|
|
@@ -45,6 +45,13 @@
|
|
|
45
45
|
"build:release:x64": "cross-env RUST_TARGET=x86_64-apple-darwin node scripts/build.js --release",
|
|
46
46
|
"build:release:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js --release",
|
|
47
47
|
"build:release:win": "cross-env RUST_TARGET=x86_64-pc-windows-msvc node scripts/build.js --release",
|
|
48
|
+
"build:release-prod:all": "run-p build:release-prod:arm64 build:release-prod:x64 build:release-prod:linux && pnpm move-binding",
|
|
49
|
+
"build:release-prod": "node scripts/build.js --release-prod",
|
|
50
|
+
"watch:release-prod": "node scripts/build.js --release-prod --watch",
|
|
51
|
+
"build:release-prod:arm64": "cross-env RUST_TARGET=aarch64-apple-darwin node scripts/build.js --release-prod",
|
|
52
|
+
"build:release-prod:x64": "cross-env RUST_TARGET=x86_64-apple-darwin node scripts/build.js --release-prod",
|
|
53
|
+
"build:release-prod:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js --release-prod",
|
|
54
|
+
"build:release-prod:win": "cross-env RUST_TARGET=x86_64-pc-windows-msvc node scripts/build.js --release-prod",
|
|
48
55
|
"move-binding": "node scripts/move-binding",
|
|
49
56
|
"test": "tsc -p tsconfig.type-test.json"
|
|
50
57
|
}
|