@rspack/binding 0.1.12 → 0.2.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.
Files changed (2) hide show
  1. package/binding.d.ts +29 -3
  2. package/package.json +11 -14
package/binding.d.ts CHANGED
@@ -20,7 +20,7 @@ export class JsCompilation {
20
20
  emitAsset(filename: string, source: JsCompatSource, assetInfo: JsAssetInfo): void
21
21
  deleteAsset(filename: string): void
22
22
  get entrypoints(): Record<string, JsChunkGroup>
23
- get hash(): string
23
+ get hash(): string | null
24
24
  getFileDependencies(): Array<string>
25
25
  getContextDependencies(): Array<string>
26
26
  getMissingDependencies(): Array<string>
@@ -87,7 +87,7 @@ export class Rspack {
87
87
 
88
88
  export interface AfterResolveData {
89
89
  request: string
90
- context?: string
90
+ context: string
91
91
  fileDependencies: Array<string>
92
92
  contextDependencies: Array<string>
93
93
  missingDependencies: Array<string>
@@ -95,7 +95,7 @@ export interface AfterResolveData {
95
95
 
96
96
  export interface BeforeResolveData {
97
97
  request: string
98
- context?: string
98
+ context: string
99
99
  }
100
100
 
101
101
  /**
@@ -113,6 +113,12 @@ export interface JsAsset {
113
113
  info: JsAssetInfo
114
114
  }
115
115
 
116
+ export interface JsAssetEmittedArgs {
117
+ filename: string
118
+ outputPath: string
119
+ targetPath: string
120
+ }
121
+
116
122
  export interface JsAssetInfo {
117
123
  /** if the asset can be long term cached forever (contains a hash) */
118
124
  immutable: boolean
@@ -138,6 +144,11 @@ export interface JsAssetInfo {
138
144
  * related object to other assets, keyed by type of relation (only points from parent to child)
139
145
  */
140
146
  related: JsAssetInfoRelated
147
+ /**
148
+ * the asset version, emit can be skipped when both filename and version are the same
149
+ * An empty string means no version, it will always emit
150
+ */
151
+ version: string
141
152
  }
142
153
 
143
154
  export interface JsAssetInfoRelated {
@@ -178,6 +189,7 @@ export interface JsHooks {
178
189
  compilation: (...args: any[]) => any
179
190
  thisCompilation: (...args: any[]) => any
180
191
  emit: (...args: any[]) => any
192
+ assetEmitted: (...args: any[]) => any
181
193
  afterEmit: (...args: any[]) => any
182
194
  make: (...args: any[]) => any
183
195
  optimizeModules: (...args: any[]) => any
@@ -185,11 +197,14 @@ export interface JsHooks {
185
197
  beforeCompile: (...args: any[]) => any
186
198
  afterCompile: (...args: any[]) => any
187
199
  finishModules: (...args: any[]) => any
200
+ finishMake: (...args: any[]) => any
188
201
  beforeResolve: (...args: any[]) => any
189
202
  afterResolve: (...args: any[]) => any
190
203
  contextModuleBeforeResolve: (...args: any[]) => any
191
204
  normalModuleFactoryResolveForScheme: (...args: any[]) => any
192
205
  chunkAsset: (...args: any[]) => any
206
+ succeedModule: (...args: any[]) => any
207
+ stillValidModule: (...args: any[]) => any
193
208
  }
194
209
 
195
210
  export interface JsLoader {
@@ -524,6 +539,10 @@ export interface RawExternalItemValue {
524
539
  export interface RawExternalsPresets {
525
540
  node: boolean
526
541
  web: boolean
542
+ electron: boolean
543
+ electronMain: boolean
544
+ electronPreload: boolean
545
+ electronRenderer: boolean
527
546
  }
528
547
 
529
548
  export interface RawFallbackCacheGroupOptions {
@@ -618,6 +637,7 @@ export interface RawModuleRule {
618
637
  scheme?: RawRuleSetCondition
619
638
  mimetype?: RawRuleSetCondition
620
639
  oneOf?: Array<RawModuleRule>
640
+ rules?: Array<RawModuleRule>
621
641
  /** Specifies the category of the loader. No value means normal loader. */
622
642
  enforce?: 'pre' | 'post'
623
643
  }
@@ -719,6 +739,10 @@ export interface RawOutputOptions {
719
739
  enabledChunkLoadingTypes?: Array<string>
720
740
  trustedTypes?: RawTrustedTypes
721
741
  sourceMapFilename: string
742
+ hashFunction: string
743
+ hashDigest: string
744
+ hashDigestLength: number
745
+ hashSalt?: string
722
746
  }
723
747
 
724
748
  export interface RawParserOptions {
@@ -804,6 +828,7 @@ export interface RawResolveOptions {
804
828
  byDependency?: Record<string, RawResolveOptions>
805
829
  fullySpecified?: boolean
806
830
  exportsFields?: Array<string>
831
+ extensionAlias?: Record<string, Array<string>>
807
832
  }
808
833
 
809
834
  export interface RawRuleSetCondition {
@@ -865,6 +890,7 @@ export interface RawTrustedTypes {
865
890
 
866
891
  export interface ThreadsafeNodeFS {
867
892
  writeFile: (...args: any[]) => any
893
+ removeFile: (...args: any[]) => any
868
894
  mkdir: (...args: any[]) => any
869
895
  mkdirp: (...args: any[]) => any
870
896
  removeDirAll: (...args: any[]) => any
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "0.1.12",
3
+ "version": "0.2.1",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "binding.js",
@@ -16,24 +16,21 @@
16
16
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
17
17
  "repository": "web-infra-dev/rspack",
18
18
  "devDependencies": {
19
- "@napi-rs/cli": "3.0.0-alpha.3",
20
- "cross-env": "^7.0.3",
21
- "npm-run-all": "4.1.5",
22
- "why-is-node-running": "2.2.1"
19
+ "@napi-rs/cli": "3.0.0-alpha.3"
23
20
  },
24
21
  "napi": {
25
22
  "binaryName": "rspack"
26
23
  },
27
24
  "optionalDependencies": {
28
- "@rspack/binding-darwin-arm64": "0.1.12",
29
- "@rspack/binding-win32-arm64-msvc": "0.1.12",
30
- "@rspack/binding-linux-arm64-gnu": "0.1.12",
31
- "@rspack/binding-linux-arm64-musl": "0.1.12",
32
- "@rspack/binding-win32-ia32-msvc": "0.1.12",
33
- "@rspack/binding-darwin-x64": "0.1.12",
34
- "@rspack/binding-win32-x64-msvc": "0.1.12",
35
- "@rspack/binding-linux-x64-gnu": "0.1.12",
36
- "@rspack/binding-linux-x64-musl": "0.1.12"
25
+ "@rspack/binding-darwin-arm64": "0.2.1",
26
+ "@rspack/binding-win32-arm64-msvc": "0.2.1",
27
+ "@rspack/binding-linux-arm64-gnu": "0.2.1",
28
+ "@rspack/binding-linux-arm64-musl": "0.2.1",
29
+ "@rspack/binding-win32-ia32-msvc": "0.2.1",
30
+ "@rspack/binding-darwin-x64": "0.2.1",
31
+ "@rspack/binding-win32-x64-msvc": "0.2.1",
32
+ "@rspack/binding-linux-x64-gnu": "0.2.1",
33
+ "@rspack/binding-linux-x64-musl": "0.2.1"
37
34
  },
38
35
  "scripts": {
39
36
  "build:debug": "node scripts/build.js",