@rspack/binding 0.1.1 → 0.1.3
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 +32 -2
- package/package.json +18 -17
package/binding.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export interface RawPattern {
|
|
|
26
26
|
export interface RawGlobOptions {
|
|
27
27
|
caseSensitiveMatch?: boolean
|
|
28
28
|
dot?: boolean
|
|
29
|
+
ignore?: Array<string>
|
|
29
30
|
}
|
|
30
31
|
export interface RawCopyConfig {
|
|
31
32
|
patterns: Array<RawPattern>
|
|
@@ -159,12 +160,18 @@ export interface RawEntryItem {
|
|
|
159
160
|
export interface RawExperiments {
|
|
160
161
|
lazyCompilation: boolean
|
|
161
162
|
incrementalRebuild: boolean
|
|
163
|
+
asyncWebAssembly: boolean
|
|
162
164
|
}
|
|
163
165
|
export interface RawExternalItem {
|
|
164
166
|
type: "string" | "regexp" | "object"
|
|
165
167
|
stringPayload?: string
|
|
166
168
|
regexpPayload?: string
|
|
167
|
-
objectPayload?: Record<string,
|
|
169
|
+
objectPayload?: Record<string, RawExternalItemValue>
|
|
170
|
+
}
|
|
171
|
+
export interface RawExternalItemValue {
|
|
172
|
+
type: "string" | "bool"
|
|
173
|
+
stringPayload?: string
|
|
174
|
+
boolPayload?: boolean
|
|
168
175
|
}
|
|
169
176
|
export interface RawExternalsPresets {
|
|
170
177
|
node: boolean
|
|
@@ -191,11 +198,12 @@ export interface JsLoader {
|
|
|
191
198
|
func: (...args: any[]) => any
|
|
192
199
|
}
|
|
193
200
|
export interface RawRuleSetCondition {
|
|
194
|
-
type: "string" | "regexp" | "logical" | "array"
|
|
201
|
+
type: "string" | "regexp" | "logical" | "array" | "function"
|
|
195
202
|
stringMatcher?: string
|
|
196
203
|
regexpMatcher?: string
|
|
197
204
|
logicalMatcher?: Array<RawRuleSetLogicalConditions>
|
|
198
205
|
arrayMatcher?: Array<RawRuleSetCondition>
|
|
206
|
+
funcMatcher?: (value: string) => boolean
|
|
199
207
|
}
|
|
200
208
|
export interface RawRuleSetLogicalConditions {
|
|
201
209
|
and?: Array<RawRuleSetCondition>
|
|
@@ -265,6 +273,7 @@ export interface JsLoaderResult {
|
|
|
265
273
|
}
|
|
266
274
|
export interface RawNodeOption {
|
|
267
275
|
dirname: string
|
|
276
|
+
filename: string
|
|
268
277
|
global: string
|
|
269
278
|
}
|
|
270
279
|
export interface RawOptimizationOptions {
|
|
@@ -295,6 +304,7 @@ export interface RawOutputOptions {
|
|
|
295
304
|
path: string
|
|
296
305
|
publicPath: string
|
|
297
306
|
assetModuleFilename: string
|
|
307
|
+
webassemblyModuleFilename: string
|
|
298
308
|
filename: string
|
|
299
309
|
chunkFilename: string
|
|
300
310
|
cssFilename: string
|
|
@@ -305,6 +315,8 @@ export interface RawOutputOptions {
|
|
|
305
315
|
enabledLibraryTypes?: Array<string>
|
|
306
316
|
globalObject: string
|
|
307
317
|
importFunctionName: string
|
|
318
|
+
iife: boolean
|
|
319
|
+
module: boolean
|
|
308
320
|
}
|
|
309
321
|
export interface RawResolveOptions {
|
|
310
322
|
preferRelative?: boolean
|
|
@@ -318,6 +330,7 @@ export interface RawResolveOptions {
|
|
|
318
330
|
symlinks?: boolean
|
|
319
331
|
tsConfigPath?: string
|
|
320
332
|
modules?: Array<string>
|
|
333
|
+
byDependency?: Record<string, RawResolveOptions>
|
|
321
334
|
}
|
|
322
335
|
export interface RawSnapshotStrategy {
|
|
323
336
|
hash: boolean
|
|
@@ -423,12 +436,28 @@ export interface JsHooks {
|
|
|
423
436
|
afterEmit: (...args: any[]) => any
|
|
424
437
|
make: (...args: any[]) => any
|
|
425
438
|
optimizeChunkModule: (...args: any[]) => any
|
|
439
|
+
finishModules: (...args: any[]) => any
|
|
440
|
+
normalModuleFactoryResolveForScheme: (...args: any[]) => any
|
|
426
441
|
}
|
|
427
442
|
export interface JsModule {
|
|
428
443
|
originalSource?: JsCompatSource
|
|
429
444
|
resource: string
|
|
430
445
|
moduleIdentifier: string
|
|
431
446
|
}
|
|
447
|
+
export interface SchemeAndJsResourceData {
|
|
448
|
+
resourceData: JsResourceData
|
|
449
|
+
scheme: string
|
|
450
|
+
}
|
|
451
|
+
export interface JsResourceData {
|
|
452
|
+
/** Resource with absolute path, query and fragment */
|
|
453
|
+
resource: string
|
|
454
|
+
/** Absolute resource path only */
|
|
455
|
+
path: string
|
|
456
|
+
/** Resource query with `?` prefix */
|
|
457
|
+
query?: string
|
|
458
|
+
/** Resource fragment with `#` prefix */
|
|
459
|
+
fragment?: string
|
|
460
|
+
}
|
|
432
461
|
export interface JsCompatSource {
|
|
433
462
|
/** Whether the underlying data structure is a `RawSource` */
|
|
434
463
|
isRaw: boolean
|
|
@@ -527,6 +556,7 @@ export class JsCompilation {
|
|
|
527
556
|
getAsset(name: string): JsAsset | null
|
|
528
557
|
getAssetSource(name: string): JsCompatSource | null
|
|
529
558
|
getModules(): Array<JsModule>
|
|
559
|
+
getChunks(): Array<JsChunk>
|
|
530
560
|
/**
|
|
531
561
|
* Only available for those none Js and Css source,
|
|
532
562
|
* return true if set module source successfully, false if failed.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/binding",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Node binding for rspack",
|
|
6
6
|
"main": "binding.js",
|
|
@@ -17,32 +17,33 @@
|
|
|
17
17
|
"repository": "web-infra-dev/rspack",
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@napi-rs/cli": "2.14.2",
|
|
20
|
-
"
|
|
21
|
-
"npm-run-all": "4.1.5"
|
|
20
|
+
"cross-env": "^7.0.3",
|
|
21
|
+
"npm-run-all": "4.1.5",
|
|
22
|
+
"why-is-node-running": "2.2.1"
|
|
22
23
|
},
|
|
23
24
|
"napi": {
|
|
24
25
|
"name": "rspack"
|
|
25
26
|
},
|
|
26
27
|
"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.
|
|
28
|
+
"@rspack/binding-darwin-arm64": "0.1.3",
|
|
29
|
+
"@rspack/binding-win32-arm64-msvc": "0.1.3",
|
|
30
|
+
"@rspack/binding-linux-arm64-gnu": "0.1.3",
|
|
31
|
+
"@rspack/binding-linux-arm64-musl": "0.1.3",
|
|
32
|
+
"@rspack/binding-win32-ia32-msvc": "0.1.3",
|
|
33
|
+
"@rspack/binding-darwin-x64": "0.1.3",
|
|
34
|
+
"@rspack/binding-win32-x64-msvc": "0.1.3",
|
|
35
|
+
"@rspack/binding-linux-x64-gnu": "0.1.3",
|
|
36
|
+
"@rspack/binding-linux-x64-musl": "0.1.3"
|
|
36
37
|
},
|
|
37
38
|
"scripts": {
|
|
38
39
|
"build:debug": "node scripts/build.js",
|
|
39
|
-
"build:debug:x64": "RUST_TARGET=x86_64-apple-darwin node scripts/build.js",
|
|
40
|
-
"build:debug:linux": "RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js",
|
|
40
|
+
"build:debug:x64": "cross-env RUST_TARGET=x86_64-apple-darwin node scripts/build.js",
|
|
41
|
+
"build:debug:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js",
|
|
41
42
|
"build:release:all": "run-p build:release build:release:x64 build:release:linux && pnpm move-binding",
|
|
42
43
|
"build:release": "node scripts/build.js --release",
|
|
43
|
-
"build:release:x64": "RUST_TARGET=x86_64-apple-darwin node scripts/build.js --release",
|
|
44
|
-
"build:release:linux": "RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js --release",
|
|
45
|
-
"build:release:win": "RUST_TARGET=x86_64-pc-windows-msvc node scripts/build.js --release",
|
|
44
|
+
"build:release:x64": "cross-env RUST_TARGET=x86_64-apple-darwin node scripts/build.js --release",
|
|
45
|
+
"build:release:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js --release",
|
|
46
|
+
"build:release:win": "cross-env RUST_TARGET=x86_64-pc-windows-msvc node scripts/build.js --release",
|
|
46
47
|
"move-binding": "node scripts/move-binding"
|
|
47
48
|
}
|
|
48
49
|
}
|