@rspack/binding 0.0.23 → 0.0.24
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/README.md +16 -0
- package/binding.d.ts +80 -56
- package/binding.js +2 -1
- package/package.json +5 -5
package/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<picture>
|
|
2
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://lf3-static.bytednsdoc.com/obj/eden-cn/rjhwzy/ljhwZthlaukjlkulzlp/rspack-banner-1610-dark.png">
|
|
3
|
+
<img alt="Rspack Banner" src="https://lf3-static.bytednsdoc.com/obj/eden-cn/rjhwzy/ljhwZthlaukjlkulzlp/rspack-banner-1610.png">
|
|
4
|
+
</picture>
|
|
5
|
+
|
|
6
|
+
# @rspack/binding
|
|
7
|
+
|
|
8
|
+
Node binding for rspack.
|
|
9
|
+
|
|
10
|
+
## Documentation
|
|
11
|
+
|
|
12
|
+
See [https://rspack.org](https://rspack.org) for details.
|
|
13
|
+
|
|
14
|
+
## License
|
|
15
|
+
|
|
16
|
+
Rspack is [MIT licensed](https://github.com/modern-js-dev/rspack/blob/main/LICENSE).
|
package/binding.d.ts
CHANGED
|
@@ -3,16 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
/* auto-generated by NAPI-RS */
|
|
5
5
|
|
|
6
|
-
export interface ThreadsafeNodeFs {
|
|
7
|
-
writeFile: (...args: any[]) => any
|
|
8
|
-
mkdir: (...args: any[]) => any
|
|
9
|
-
mkdirp: (...args: any[]) => any
|
|
10
|
-
}
|
|
11
|
-
export interface NodeFs {
|
|
12
|
-
writeFile: (...args: any[]) => any
|
|
13
|
-
mkdir: (...args: any[]) => any
|
|
14
|
-
mkdirp: (...args: any[]) => any
|
|
15
|
-
}
|
|
16
6
|
export interface RawPattern {
|
|
17
7
|
from: string
|
|
18
8
|
to?: string
|
|
@@ -34,7 +24,7 @@ export interface RawCssPluginConfig {
|
|
|
34
24
|
modules: RawCssModulesConfig
|
|
35
25
|
}
|
|
36
26
|
export interface RawCssModulesConfig {
|
|
37
|
-
localsConvention:
|
|
27
|
+
localsConvention: "asIs" | "camelCase" | "camelCaseOnly" | "dashes" | "dashesOnly"
|
|
38
28
|
localIdentName: string
|
|
39
29
|
exportsOnly: boolean
|
|
40
30
|
}
|
|
@@ -63,6 +53,23 @@ export interface RawHtmlPluginConfig {
|
|
|
63
53
|
favicon?: string
|
|
64
54
|
meta?: Record<string, Record<string, string>>
|
|
65
55
|
}
|
|
56
|
+
export interface RawStyleConfig {
|
|
57
|
+
styleLibraryDirectory?: string
|
|
58
|
+
custom?: string
|
|
59
|
+
css?: string
|
|
60
|
+
bool?: boolean
|
|
61
|
+
}
|
|
62
|
+
export interface RawPluginImportConfig {
|
|
63
|
+
libraryName: string
|
|
64
|
+
libraryDirectory?: string
|
|
65
|
+
customName?: string
|
|
66
|
+
customStyleName?: string
|
|
67
|
+
style?: RawStyleConfig
|
|
68
|
+
camelToDashComponentName?: boolean
|
|
69
|
+
transformToDefaultImport?: boolean
|
|
70
|
+
ignoreEsComponent?: Array<string>
|
|
71
|
+
ignoreStyleComponent?: Array<string>
|
|
72
|
+
}
|
|
66
73
|
export interface RawPostCssConfig {
|
|
67
74
|
pxtorem?: RawPxToRemConfig
|
|
68
75
|
}
|
|
@@ -89,6 +96,10 @@ export interface RawReactOptions {
|
|
|
89
96
|
useSpread?: boolean
|
|
90
97
|
refresh?: boolean
|
|
91
98
|
}
|
|
99
|
+
export interface RawRelayConfig {
|
|
100
|
+
artifactDirectory?: string
|
|
101
|
+
language: 'javascript' | 'typescript' | 'flow'
|
|
102
|
+
}
|
|
92
103
|
export interface RawMinification {
|
|
93
104
|
passes: number
|
|
94
105
|
dropConsole: boolean
|
|
@@ -114,6 +125,8 @@ export interface RawBuiltins {
|
|
|
114
125
|
emotion?: string
|
|
115
126
|
devFriendlySplitChunks: boolean
|
|
116
127
|
copy?: RawCopyConfig
|
|
128
|
+
pluginImport?: Array<RawPluginImportConfig>
|
|
129
|
+
relay?: RawRelayConfig
|
|
117
130
|
}
|
|
118
131
|
export interface RawCacheOptions {
|
|
119
132
|
type: string
|
|
@@ -158,45 +171,34 @@ export interface JsLoader {
|
|
|
158
171
|
name: string
|
|
159
172
|
func: (...args: any[]) => any
|
|
160
173
|
}
|
|
161
|
-
export interface
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
* - "regexp": The value will be matched against the raw regexp source from JS side.
|
|
168
|
-
*/
|
|
169
|
-
matcher?: string
|
|
174
|
+
export interface RawRuleSetCondition {
|
|
175
|
+
type: "string" | "regexp" | "logical" | "array"
|
|
176
|
+
stringMatcher?: string
|
|
177
|
+
regexpMatcher?: string
|
|
178
|
+
logicalMatcher?: Array<RawRuleSetLogicalConditions>
|
|
179
|
+
arrayMatcher?: Array<RawRuleSetCondition>
|
|
170
180
|
}
|
|
171
|
-
export interface
|
|
172
|
-
|
|
181
|
+
export interface RawRuleSetLogicalConditions {
|
|
182
|
+
and?: Array<RawRuleSetCondition>
|
|
183
|
+
or?: Array<RawRuleSetCondition>
|
|
184
|
+
not?: RawRuleSetCondition
|
|
173
185
|
}
|
|
174
186
|
export interface RawModuleRule {
|
|
175
|
-
/**
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* A condition matcher matching an absolute path.
|
|
185
|
-
* See `test` above
|
|
186
|
-
*/
|
|
187
|
-
resource?: RawModuleRuleCondition
|
|
188
|
-
/**
|
|
189
|
-
* A condition matcher against the resource query.
|
|
190
|
-
* TODO: align with webpack's `?` prefixed `resourceQuery`
|
|
191
|
-
*/
|
|
192
|
-
resourceQuery?: RawModuleRuleCondition
|
|
187
|
+
/** A condition matcher matching an absolute path. */
|
|
188
|
+
test?: RawRuleSetCondition
|
|
189
|
+
include?: RawRuleSetCondition
|
|
190
|
+
exclude?: RawRuleSetCondition
|
|
191
|
+
/** A condition matcher matching an absolute path. */
|
|
192
|
+
resource?: RawRuleSetCondition
|
|
193
|
+
/** A condition matcher against the resource query. */
|
|
194
|
+
resourceQuery?: RawRuleSetCondition
|
|
193
195
|
sideEffects?: boolean
|
|
194
196
|
use?: Array<RawModuleRuleUse>
|
|
195
197
|
type?: string
|
|
196
198
|
parser?: RawModuleRuleParser
|
|
197
199
|
generator?: RawModuleRuleGenerator
|
|
198
200
|
resolve?: RawResolveOptions
|
|
199
|
-
issuer?:
|
|
201
|
+
issuer?: RawRuleSetCondition
|
|
200
202
|
oneOf?: Array<RawModuleRule>
|
|
201
203
|
}
|
|
202
204
|
export interface RawModuleRuleGenerator {
|
|
@@ -244,6 +246,7 @@ export interface JsLoaderResult {
|
|
|
244
246
|
}
|
|
245
247
|
export interface RawNodeOption {
|
|
246
248
|
dirname: string
|
|
249
|
+
global: string
|
|
247
250
|
}
|
|
248
251
|
export interface RawOptimizationOptions {
|
|
249
252
|
splitChunks?: RawSplitChunksOptions
|
|
@@ -251,6 +254,17 @@ export interface RawOptimizationOptions {
|
|
|
251
254
|
removeAvailableModules: boolean
|
|
252
255
|
sideEffects: string
|
|
253
256
|
}
|
|
257
|
+
export interface RawLibraryName {
|
|
258
|
+
amd?: string
|
|
259
|
+
commonjs?: string
|
|
260
|
+
root?: Array<string>
|
|
261
|
+
}
|
|
262
|
+
export interface RawLibraryOptions {
|
|
263
|
+
name?: RawLibraryName
|
|
264
|
+
export?: Array<string>
|
|
265
|
+
libraryType: string
|
|
266
|
+
umdNamedDefine?: boolean
|
|
267
|
+
}
|
|
254
268
|
export interface RawOutputOptions {
|
|
255
269
|
path: string
|
|
256
270
|
publicPath: string
|
|
@@ -260,8 +274,9 @@ export interface RawOutputOptions {
|
|
|
260
274
|
cssFilename: string
|
|
261
275
|
cssChunkFilename: string
|
|
262
276
|
uniqueName: string
|
|
263
|
-
library?:
|
|
277
|
+
library?: RawLibraryOptions
|
|
264
278
|
strictModuleErrorHandling: boolean
|
|
279
|
+
enabledLibraryTypes?: Array<string>
|
|
265
280
|
}
|
|
266
281
|
export interface RawResolveOptions {
|
|
267
282
|
preferRelative?: boolean
|
|
@@ -327,6 +342,16 @@ export interface RawOptions {
|
|
|
327
342
|
experiments: RawExperiments
|
|
328
343
|
node: RawNodeOption
|
|
329
344
|
}
|
|
345
|
+
export interface ThreadsafeNodeFs {
|
|
346
|
+
writeFile: (...args: any[]) => any
|
|
347
|
+
mkdir: (...args: any[]) => any
|
|
348
|
+
mkdirp: (...args: any[]) => any
|
|
349
|
+
}
|
|
350
|
+
export interface NodeFs {
|
|
351
|
+
writeFile: (...args: any[]) => any
|
|
352
|
+
mkdir: (...args: any[]) => any
|
|
353
|
+
mkdirp: (...args: any[]) => any
|
|
354
|
+
}
|
|
330
355
|
export interface JsAssetInfoRelated {
|
|
331
356
|
sourceMap?: string
|
|
332
357
|
}
|
|
@@ -446,26 +471,23 @@ export interface JsStatsChunk {
|
|
|
446
471
|
names: Array<string>
|
|
447
472
|
size: number
|
|
448
473
|
}
|
|
449
|
-
export interface
|
|
474
|
+
export interface JsStatsChunkGroupAsset {
|
|
450
475
|
name: string
|
|
451
476
|
size: number
|
|
452
477
|
}
|
|
453
|
-
export interface
|
|
478
|
+
export interface JsStatsChunkGroup {
|
|
454
479
|
name: string
|
|
455
|
-
assets: Array<
|
|
480
|
+
assets: Array<JsStatsChunkGroupAsset>
|
|
456
481
|
chunks: Array<string>
|
|
457
482
|
assetsSize: number
|
|
458
483
|
}
|
|
459
|
-
export interface
|
|
484
|
+
export interface JsStatsAssetsByChunkName {
|
|
485
|
+
name: string
|
|
486
|
+
files: Array<string>
|
|
487
|
+
}
|
|
488
|
+
export interface JsStatsGetAssets {
|
|
460
489
|
assets: Array<JsStatsAsset>
|
|
461
|
-
|
|
462
|
-
chunks: Array<JsStatsChunk>
|
|
463
|
-
entrypoints: Array<JsStatsEntrypoint>
|
|
464
|
-
errors: Array<JsStatsError>
|
|
465
|
-
errorsCount: number
|
|
466
|
-
warnings: Array<JsStatsWarning>
|
|
467
|
-
warningsCount: number
|
|
468
|
-
hash: string
|
|
490
|
+
assetsByChunkName: Array<JsStatsAssetsByChunkName>
|
|
469
491
|
}
|
|
470
492
|
export function initCustomTraceSubscriber(): void
|
|
471
493
|
export class JsCompilation {
|
|
@@ -499,16 +521,18 @@ export class JsCompilation {
|
|
|
499
521
|
addBuildDependencies(deps: Array<string>): void
|
|
500
522
|
}
|
|
501
523
|
export class JsStats {
|
|
502
|
-
getAssets():
|
|
524
|
+
getAssets(): JsStatsGetAssets
|
|
503
525
|
getModules(showReasons: boolean): Array<JsStatsModule>
|
|
504
526
|
getChunks(): Array<JsStatsChunk>
|
|
505
|
-
getEntrypoints(): Array<
|
|
527
|
+
getEntrypoints(): Array<JsStatsChunkGroup>
|
|
528
|
+
getNamedChunkGroups(): Array<JsStatsChunkGroup>
|
|
506
529
|
getErrors(): Array<JsStatsError>
|
|
507
530
|
getWarnings(): Array<JsStatsWarning>
|
|
508
531
|
getHash(): string
|
|
509
532
|
}
|
|
510
533
|
export class Rspack {
|
|
511
534
|
constructor(options: RawOptions, jsHooks: JsHooks | undefined | null, outputFilesystem: ThreadsafeNodeFS)
|
|
535
|
+
unsafe_set_disabled_hooks(hooks: Array<string>): void
|
|
512
536
|
/**
|
|
513
537
|
* Build with the given option passed to the constructor
|
|
514
538
|
*
|
package/binding.js
CHANGED
|
@@ -11,7 +11,8 @@ function isMusl() {
|
|
|
11
11
|
// For Node 10
|
|
12
12
|
if (!process.report || typeof process.report.getReport !== 'function') {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const lddPath = require('child_process').execSync('which ldd').toString().trim();
|
|
15
|
+
return readFileSync(lddPath, 'utf8').includes('musl')
|
|
15
16
|
} catch (e) {
|
|
16
17
|
return true
|
|
17
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/binding",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Node binding for rspack",
|
|
6
6
|
"main": "binding.js",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"npm-run-all": "4.1.5"
|
|
22
22
|
},
|
|
23
23
|
"optionalDependencies": {
|
|
24
|
-
"@rspack/binding-
|
|
25
|
-
"@rspack/binding-darwin-x64": "0.0.
|
|
26
|
-
"@rspack/binding-win32-x64-msvc": "0.0.
|
|
27
|
-
"@rspack/binding-
|
|
24
|
+
"@rspack/binding-darwin-arm64": "0.0.24",
|
|
25
|
+
"@rspack/binding-darwin-x64": "0.0.24",
|
|
26
|
+
"@rspack/binding-win32-x64-msvc": "0.0.24",
|
|
27
|
+
"@rspack/binding-linux-x64-gnu": "0.0.24"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build:debug": "napi build --platform --js false --dts binding.d.ts --config napirs.rc.json",
|