@rspack/binding 0.2.12 → 0.3.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.
Files changed (2) hide show
  1. package/binding.d.ts +35 -33
  2. package/package.json +10 -10
package/binding.d.ts CHANGED
@@ -1,6 +1,13 @@
1
1
  /* auto-generated by NAPI-RS */
2
2
  /* eslint-disable */
3
3
 
4
+
5
+ export class ExternalObject<T> {
6
+ readonly '': {
7
+ readonly '': unique symbol
8
+ [K: symbol]: T
9
+ }
10
+ }
4
11
  export class JsCompilation {
5
12
  updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSource) => JsCompatSource), assetInfoUpdateOrFunction?: JsAssetInfo | ((assetInfo: JsAssetInfo) => JsAssetInfo)): void
6
13
  getAssets(): Readonly<JsAsset>[]
@@ -26,6 +33,7 @@ export class JsCompilation {
26
33
  getMissingDependencies(): Array<string>
27
34
  getBuildDependencies(): Array<string>
28
35
  pushDiagnostic(severity: "error" | "warning", title: string, message: string): void
36
+ pushNativeDiagnostics(diagnostics: ExternalObject<Array<Diagnostic>>): void
29
37
  getStats(): JsStats
30
38
  getAssetPath(filename: string, data: PathData): string
31
39
  getAssetPathWithInfo(filename: string, data: PathData): PathWithInfo
@@ -47,7 +55,7 @@ export class JsStats {
47
55
  getErrors(): Array<JsStatsError>
48
56
  getWarnings(): Array<JsStatsWarning>
49
57
  getLogging(acceptedTypes: number): Array<JsStatsLogging>
50
- getHash(): string
58
+ getHash(): string | null
51
59
  }
52
60
 
53
61
  export class Rspack {
@@ -101,21 +109,12 @@ export interface BeforeResolveData {
101
109
  context: string
102
110
  }
103
111
 
104
- export function cleanupCustomTraceSubscriber(): void
112
+ export function cleanupGlobalTrace(): void
105
113
 
106
114
  export interface FactoryMeta {
107
115
  sideEffects?: boolean
108
116
  }
109
117
 
110
- /**
111
- * Some code is modified based on
112
- * https://github.com/swc-project/swc/blob/d1d0607158ab40463d1b123fed52cc526eba8385/bindings/binding_core_node/src/util.rs#L29-L58
113
- * Apache-2.0 licensed
114
- * Author Donny/강동윤
115
- * Copyright (c)
116
- */
117
- export function initCustomTraceSubscriber(): void
118
-
119
118
  export interface JsAsset {
120
119
  name: string
121
120
  source?: JsCompatSource
@@ -228,11 +227,6 @@ export interface JsHooks {
228
227
  stillValidModule: (...args: any[]) => any
229
228
  }
230
229
 
231
- export interface JsLoader {
232
- /** composed loader name, xx-loader$yy-loader$zz-loader */
233
- identifier: string
234
- }
235
-
236
230
  export interface JsLoaderContext {
237
231
  /** Content maybe empty in pitching stage */
238
232
  content?: Buffer
@@ -250,6 +244,16 @@ export interface JsLoaderContext {
250
244
  assetFilenames: Array<string>
251
245
  currentLoader: string
252
246
  isPitching: boolean
247
+ /**
248
+ * Internal loader context
249
+ * @internal
250
+ */
251
+ context: ExternalObject<LoaderRunnerContext>
252
+ /**
253
+ * Internal loader diagnostic
254
+ * @internal
255
+ */
256
+ diagnostics: ExternalObject<Array<Diagnostic>>
253
257
  }
254
258
 
255
259
  export interface JsLoaderResult {
@@ -377,6 +381,7 @@ export interface JsStatsModule {
377
381
  issuerPath: Array<JsStatsModuleIssuer>
378
382
  reasons?: Array<JsStatsModuleReason>
379
383
  assets?: Array<string>
384
+ modules?: Array<JsStatsModule>
380
385
  source?: string | Buffer
381
386
  profile?: JsStatsModuleProfile
382
387
  }
@@ -491,7 +496,6 @@ export interface RawBannerConfig {
491
496
  export interface RawBuiltins {
492
497
  html?: Array<RawHtmlPluginConfig>
493
498
  css?: RawCssPluginConfig
494
- postcss?: RawPostCssConfig
495
499
  minifyOptions?: RawMinification
496
500
  presetEnv?: RawPresetEnv
497
501
  define: Record<string, string>
@@ -772,8 +776,7 @@ export interface RawModuleRule {
772
776
  * `builtin_loader`.
773
777
  */
774
778
  export interface RawModuleRuleUse {
775
- jsLoader?: JsLoader
776
- builtinLoader?: string
779
+ loader: string
777
780
  options?: string
778
781
  }
779
782
 
@@ -792,6 +795,7 @@ export interface RawNodeOption {
792
795
  export interface RawOptimizationOptions {
793
796
  splitChunks?: RawSplitChunksOptions
794
797
  moduleIds: string
798
+ chunkIds: string
795
799
  removeAvailableModules: boolean
796
800
  removeEmptyChunks: boolean
797
801
  sideEffects: string
@@ -894,10 +898,6 @@ export interface RawPluginImportConfig {
894
898
  ignoreStyleComponent?: Array<string>
895
899
  }
896
900
 
897
- export interface RawPostCssConfig {
898
- pxtorem?: RawPxToRemConfig
899
- }
900
-
901
901
  export interface RawPresetEnv {
902
902
  targets: Array<string>
903
903
  mode?: 'usage' | 'entry'
@@ -908,16 +908,6 @@ export interface RawProgressPluginConfig {
908
908
  prefix?: string
909
909
  }
910
910
 
911
- export interface RawPxToRemConfig {
912
- rootValue?: number
913
- unitPrecision?: number
914
- selectorBlackList?: Array<string>
915
- propList?: Array<string>
916
- replace?: boolean
917
- mediaQuery?: boolean
918
- minPixelValue?: number
919
- }
920
-
921
911
  export interface RawReactOptions {
922
912
  runtime?: "automatic" | "classic"
923
913
  importSource?: string
@@ -1010,6 +1000,18 @@ export interface RawTrustedTypes {
1010
1000
  policyName?: string
1011
1001
  }
1012
1002
 
1003
+ /**
1004
+ * Some code is modified based on
1005
+ * https://github.com/swc-project/swc/blob/d1d0607158ab40463d1b123fed52cc526eba8385/bindings/binding_core_node/src/util.rs#L29-L58
1006
+ * Apache-2.0 licensed
1007
+ * Author Donny/강동윤
1008
+ * Copyright (c)
1009
+ */
1010
+ export function registerGlobalTrace(filter: string, layer: "chrome" | "logger", output: string): void
1011
+
1012
+ /** Builtin loader runner */
1013
+ export function runBuiltinLoader(builtin: string, options: string | undefined | null, loaderContext: JsLoaderContext): Promise<JsLoaderContext>
1014
+
1013
1015
  export interface ThreadsafeNodeFS {
1014
1016
  writeFile: (...args: any[]) => any
1015
1017
  removeFile: (...args: any[]) => any
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "0.2.12",
3
+ "version": "0.3.0",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "binding.js",
@@ -22,15 +22,15 @@
22
22
  "binaryName": "rspack"
23
23
  },
24
24
  "optionalDependencies": {
25
- "@rspack/binding-darwin-arm64": "0.2.12",
26
- "@rspack/binding-win32-arm64-msvc": "0.2.12",
27
- "@rspack/binding-linux-arm64-gnu": "0.2.12",
28
- "@rspack/binding-linux-arm64-musl": "0.2.12",
29
- "@rspack/binding-win32-ia32-msvc": "0.2.12",
30
- "@rspack/binding-darwin-x64": "0.2.12",
31
- "@rspack/binding-win32-x64-msvc": "0.2.12",
32
- "@rspack/binding-linux-x64-gnu": "0.2.12",
33
- "@rspack/binding-linux-x64-musl": "0.2.12"
25
+ "@rspack/binding-darwin-arm64": "0.3.0",
26
+ "@rspack/binding-win32-arm64-msvc": "0.3.0",
27
+ "@rspack/binding-linux-arm64-gnu": "0.3.0",
28
+ "@rspack/binding-linux-arm64-musl": "0.3.0",
29
+ "@rspack/binding-win32-ia32-msvc": "0.3.0",
30
+ "@rspack/binding-darwin-x64": "0.3.0",
31
+ "@rspack/binding-win32-x64-msvc": "0.3.0",
32
+ "@rspack/binding-linux-x64-gnu": "0.3.0",
33
+ "@rspack/binding-linux-x64-musl": "0.3.0"
34
34
  },
35
35
  "scripts": {
36
36
  "build:debug": "node scripts/build.js",