Skip to content

Commit 47c1bd3

Browse files
chore(deps): lock file maintenance npm packages (#646)
This PR contains the following updates: | Package | Type | Update | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---|---|---| | | | lockFileMaintenance | All locks refreshed | | | | | | [@napi-rs/wasm-runtime](https://redirect.github.com/napi-rs/napi-rs) ([source](https://redirect.github.com/napi-rs/napi-rs/tree/HEAD/wasi-runtime)) | devDependencies | patch | [`1.0.1` -> `1.0.3`](https://renovatebot.com/diffs/npm/@napi-rs%2fwasm-runtime/1.0.1/1.0.3) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@napi-rs%2fwasm-runtime/1.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@napi-rs%2fwasm-runtime/1.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@napi-rs%2fwasm-runtime/1.0.1/1.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@napi-rs%2fwasm-runtime/1.0.1/1.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@types/node](https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)) | devDependencies | patch | [`24.2.0` -> `24.2.1`](https://renovatebot.com/diffs/npm/@types%2fnode/24.2.0/24.2.1) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2fnode/24.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@types%2fnode/24.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@types%2fnode/24.2.0/24.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2fnode/24.2.0/24.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [napi-postinstall](https://redirect.github.com/un-ts/napi-postinstall) | dependencies | patch | [`0.3.2` -> `0.3.3`](https://renovatebot.com/diffs/npm/napi-postinstall/0.3.2/0.3.3) | [![age](https://developer.mend.io/api/mc/badges/age/npm/napi-postinstall/0.3.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/napi-postinstall/0.3.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/napi-postinstall/0.3.2/0.3.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/napi-postinstall/0.3.2/0.3.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | 🔧 This Pull Request updates lock files to use the latest dependency versions. --- ### Release Notes <details> <summary>napi-rs/napi-rs (@&#8203;napi-rs/wasm-runtime)</summary> ### [`v1.0.3`](https://redirect.github.com/napi-rs/napi-rs/releases/tag/%40napi-rs/wasm-runtime%401.0.3) [Compare Source](https://redirect.github.com/napi-rs/napi-rs/compare/@napi-rs/[email protected]...@napi-rs/[email protected]) #### What's Changed - fix(wasm-runtime): publish `dist/*.cjs` by [@&#8203;colinaaa](https://redirect.github.com/colinaaa) in [https://github.com/napi-rs/napi-rs/pull/2845](https://redirect.github.com/napi-rs/napi-rs/pull/2845) #### New Contributors - [@&#8203;colinaaa](https://redirect.github.com/colinaaa) made their first contribution in [https://github.com/napi-rs/napi-rs/pull/2845](https://redirect.github.com/napi-rs/napi-rs/pull/2845) **Full Changelog**: https://github.com/napi-rs/napi-rs/compare/napi-v3.2.0...[@&#8203;napi-rs/wasm-runtime](https://redirect.github.com/napi-rs/wasm-runtime)@&#8203;1.0.3 ### [`v1.0.2`](https://redirect.github.com/napi-rs/napi-rs/releases/tag/%40napi-rs/wasm-runtime%401.0.2) [Compare Source](https://redirect.github.com/napi-rs/napi-rs/compare/@napi-rs/[email protected]...@napi-rs/[email protected]) #### What's Changed - fix(wasm-runtime): add constructors for nested values in objects by [@&#8203;CPunisher](https://redirect.github.com/CPunisher) in [https://github.com/napi-rs/napi-rs/pull/2827](https://redirect.github.com/napi-rs/napi-rs/pull/2827) - fix(wasm-runtime): avoid wasm-util from tree shaking by rollup by [@&#8203;Brooooooklyn](https://redirect.github.com/Brooooooklyn) in [https://github.com/napi-rs/napi-rs/pull/2810](https://redirect.github.com/napi-rs/napi-rs/pull/2810) **Full Changelog**: https://github.com/napi-rs/napi-rs/compare/napi-v3.1.6...[@&#8203;napi-rs/wasm-runtime](https://redirect.github.com/napi-rs/wasm-runtime)@&#8203;1.0.2 </details> <details> <summary>un-ts/napi-postinstall (napi-postinstall)</summary> ### [`v0.3.3`](https://redirect.github.com/un-ts/napi-postinstall/blob/HEAD/CHANGELOG.md#033) [Compare Source](https://redirect.github.com/un-ts/napi-postinstall/compare/v0.3.2...v0.3.3) ##### Patch Changes - [#&#8203;47](https://redirect.github.com/un-ts/napi-postinstall/pull/47) [`8447abb`](https://redirect.github.com/un-ts/napi-postinstall/commit/8447abbbd8cd8aa2640f7b0e58643f386f75eb78) Thanks [@&#8203;WooWan](https://redirect.github.com/WooWan)! - feat: support for HTTP protocol in private registries - [#&#8203;51](https://redirect.github.com/un-ts/napi-postinstall/pull/51) [`1d9c7d5`](https://redirect.github.com/un-ts/napi-postinstall/commit/1d9c7d56ce5266046409167ba31fb9aa079c3d9e) Thanks [@&#8203;mrginglymus](https://redirect.github.com/mrginglymus)! - feat: try reading `package.json` from `cwd` for cli usage </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 9am on monday" in timezone Asia/Shanghai, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc-resolver). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS42MC40IiwidXBkYXRlZEluVmVyIjoiNDEuNjAuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Boshen <[email protected]>
1 parent 94e036d commit 47c1bd3

File tree

2 files changed

+464
-361
lines changed

2 files changed

+464
-361
lines changed

napi/index.js

Lines changed: 141 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@ function requireNative() {
7878
loadErrors.push(e)
7979
}
8080
try {
81-
return require('@oxc-resolver/binding-android-arm64')
81+
const binding = require('@oxc-resolver/binding-android-arm64')
82+
const bindingPackageVersion = require('@oxc-resolver/binding-android-arm64/package.json').version
83+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
84+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
85+
}
86+
return binding
8287
} catch (e) {
8388
loadErrors.push(e)
8489
}
@@ -89,7 +94,12 @@ function requireNative() {
8994
loadErrors.push(e)
9095
}
9196
try {
92-
return require('@oxc-resolver/binding-android-arm-eabi')
97+
const binding = require('@oxc-resolver/binding-android-arm-eabi')
98+
const bindingPackageVersion = require('@oxc-resolver/binding-android-arm-eabi/package.json').version
99+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
100+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
101+
}
102+
return binding
93103
} catch (e) {
94104
loadErrors.push(e)
95105
}
@@ -104,7 +114,12 @@ function requireNative() {
104114
loadErrors.push(e)
105115
}
106116
try {
107-
return require('@oxc-resolver/binding-win32-x64-msvc')
117+
const binding = require('@oxc-resolver/binding-win32-x64-msvc')
118+
const bindingPackageVersion = require('@oxc-resolver/binding-win32-x64-msvc/package.json').version
119+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
120+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
121+
}
122+
return binding
108123
} catch (e) {
109124
loadErrors.push(e)
110125
}
@@ -115,7 +130,12 @@ function requireNative() {
115130
loadErrors.push(e)
116131
}
117132
try {
118-
return require('@oxc-resolver/binding-win32-ia32-msvc')
133+
const binding = require('@oxc-resolver/binding-win32-ia32-msvc')
134+
const bindingPackageVersion = require('@oxc-resolver/binding-win32-ia32-msvc/package.json').version
135+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
136+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
137+
}
138+
return binding
119139
} catch (e) {
120140
loadErrors.push(e)
121141
}
@@ -126,7 +146,12 @@ function requireNative() {
126146
loadErrors.push(e)
127147
}
128148
try {
129-
return require('@oxc-resolver/binding-win32-arm64-msvc')
149+
const binding = require('@oxc-resolver/binding-win32-arm64-msvc')
150+
const bindingPackageVersion = require('@oxc-resolver/binding-win32-arm64-msvc/package.json').version
151+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
152+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
153+
}
154+
return binding
130155
} catch (e) {
131156
loadErrors.push(e)
132157
}
@@ -140,7 +165,12 @@ function requireNative() {
140165
loadErrors.push(e)
141166
}
142167
try {
143-
return require('@oxc-resolver/binding-darwin-universal')
168+
const binding = require('@oxc-resolver/binding-darwin-universal')
169+
const bindingPackageVersion = require('@oxc-resolver/binding-darwin-universal/package.json').version
170+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
171+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
172+
}
173+
return binding
144174
} catch (e) {
145175
loadErrors.push(e)
146176
}
@@ -151,7 +181,12 @@ function requireNative() {
151181
loadErrors.push(e)
152182
}
153183
try {
154-
return require('@oxc-resolver/binding-darwin-x64')
184+
const binding = require('@oxc-resolver/binding-darwin-x64')
185+
const bindingPackageVersion = require('@oxc-resolver/binding-darwin-x64/package.json').version
186+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
187+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
188+
}
189+
return binding
155190
} catch (e) {
156191
loadErrors.push(e)
157192
}
@@ -162,7 +197,12 @@ function requireNative() {
162197
loadErrors.push(e)
163198
}
164199
try {
165-
return require('@oxc-resolver/binding-darwin-arm64')
200+
const binding = require('@oxc-resolver/binding-darwin-arm64')
201+
const bindingPackageVersion = require('@oxc-resolver/binding-darwin-arm64/package.json').version
202+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
203+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
204+
}
205+
return binding
166206
} catch (e) {
167207
loadErrors.push(e)
168208
}
@@ -177,7 +217,12 @@ function requireNative() {
177217
loadErrors.push(e)
178218
}
179219
try {
180-
return require('@oxc-resolver/binding-freebsd-x64')
220+
const binding = require('@oxc-resolver/binding-freebsd-x64')
221+
const bindingPackageVersion = require('@oxc-resolver/binding-freebsd-x64/package.json').version
222+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
223+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
224+
}
225+
return binding
181226
} catch (e) {
182227
loadErrors.push(e)
183228
}
@@ -188,7 +233,12 @@ function requireNative() {
188233
loadErrors.push(e)
189234
}
190235
try {
191-
return require('@oxc-resolver/binding-freebsd-arm64')
236+
const binding = require('@oxc-resolver/binding-freebsd-arm64')
237+
const bindingPackageVersion = require('@oxc-resolver/binding-freebsd-arm64/package.json').version
238+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
239+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
240+
}
241+
return binding
192242
} catch (e) {
193243
loadErrors.push(e)
194244
}
@@ -204,7 +254,12 @@ function requireNative() {
204254
loadErrors.push(e)
205255
}
206256
try {
207-
return require('@oxc-resolver/binding-linux-x64-musl')
257+
const binding = require('@oxc-resolver/binding-linux-x64-musl')
258+
const bindingPackageVersion = require('@oxc-resolver/binding-linux-x64-musl/package.json').version
259+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
260+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
261+
}
262+
return binding
208263
} catch (e) {
209264
loadErrors.push(e)
210265
}
@@ -215,7 +270,12 @@ function requireNative() {
215270
loadErrors.push(e)
216271
}
217272
try {
218-
return require('@oxc-resolver/binding-linux-x64-gnu')
273+
const binding = require('@oxc-resolver/binding-linux-x64-gnu')
274+
const bindingPackageVersion = require('@oxc-resolver/binding-linux-x64-gnu/package.json').version
275+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
276+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
277+
}
278+
return binding
219279
} catch (e) {
220280
loadErrors.push(e)
221281
}
@@ -228,7 +288,12 @@ function requireNative() {
228288
loadErrors.push(e)
229289
}
230290
try {
231-
return require('@oxc-resolver/binding-linux-arm64-musl')
291+
const binding = require('@oxc-resolver/binding-linux-arm64-musl')
292+
const bindingPackageVersion = require('@oxc-resolver/binding-linux-arm64-musl/package.json').version
293+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
294+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
295+
}
296+
return binding
232297
} catch (e) {
233298
loadErrors.push(e)
234299
}
@@ -239,7 +304,12 @@ function requireNative() {
239304
loadErrors.push(e)
240305
}
241306
try {
242-
return require('@oxc-resolver/binding-linux-arm64-gnu')
307+
const binding = require('@oxc-resolver/binding-linux-arm64-gnu')
308+
const bindingPackageVersion = require('@oxc-resolver/binding-linux-arm64-gnu/package.json').version
309+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
310+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
311+
}
312+
return binding
243313
} catch (e) {
244314
loadErrors.push(e)
245315
}
@@ -252,7 +322,12 @@ function requireNative() {
252322
loadErrors.push(e)
253323
}
254324
try {
255-
return require('@oxc-resolver/binding-linux-arm-musleabihf')
325+
const binding = require('@oxc-resolver/binding-linux-arm-musleabihf')
326+
const bindingPackageVersion = require('@oxc-resolver/binding-linux-arm-musleabihf/package.json').version
327+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
328+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
329+
}
330+
return binding
256331
} catch (e) {
257332
loadErrors.push(e)
258333
}
@@ -263,7 +338,12 @@ function requireNative() {
263338
loadErrors.push(e)
264339
}
265340
try {
266-
return require('@oxc-resolver/binding-linux-arm-gnueabihf')
341+
const binding = require('@oxc-resolver/binding-linux-arm-gnueabihf')
342+
const bindingPackageVersion = require('@oxc-resolver/binding-linux-arm-gnueabihf/package.json').version
343+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
344+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
345+
}
346+
return binding
267347
} catch (e) {
268348
loadErrors.push(e)
269349
}
@@ -276,7 +356,12 @@ function requireNative() {
276356
loadErrors.push(e)
277357
}
278358
try {
279-
return require('@oxc-resolver/binding-linux-riscv64-musl')
359+
const binding = require('@oxc-resolver/binding-linux-riscv64-musl')
360+
const bindingPackageVersion = require('@oxc-resolver/binding-linux-riscv64-musl/package.json').version
361+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
362+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
363+
}
364+
return binding
280365
} catch (e) {
281366
loadErrors.push(e)
282367
}
@@ -287,7 +372,12 @@ function requireNative() {
287372
loadErrors.push(e)
288373
}
289374
try {
290-
return require('@oxc-resolver/binding-linux-riscv64-gnu')
375+
const binding = require('@oxc-resolver/binding-linux-riscv64-gnu')
376+
const bindingPackageVersion = require('@oxc-resolver/binding-linux-riscv64-gnu/package.json').version
377+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
378+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
379+
}
380+
return binding
291381
} catch (e) {
292382
loadErrors.push(e)
293383
}
@@ -299,7 +389,12 @@ function requireNative() {
299389
loadErrors.push(e)
300390
}
301391
try {
302-
return require('@oxc-resolver/binding-linux-ppc64-gnu')
392+
const binding = require('@oxc-resolver/binding-linux-ppc64-gnu')
393+
const bindingPackageVersion = require('@oxc-resolver/binding-linux-ppc64-gnu/package.json').version
394+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
395+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
396+
}
397+
return binding
303398
} catch (e) {
304399
loadErrors.push(e)
305400
}
@@ -310,7 +405,12 @@ function requireNative() {
310405
loadErrors.push(e)
311406
}
312407
try {
313-
return require('@oxc-resolver/binding-linux-s390x-gnu')
408+
const binding = require('@oxc-resolver/binding-linux-s390x-gnu')
409+
const bindingPackageVersion = require('@oxc-resolver/binding-linux-s390x-gnu/package.json').version
410+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412+
}
413+
return binding
314414
} catch (e) {
315415
loadErrors.push(e)
316416
}
@@ -320,34 +420,49 @@ function requireNative() {
320420
} else if (process.platform === 'openharmony') {
321421
if (process.arch === 'arm64') {
322422
try {
323-
return require('./resolver.linux-arm64-ohos.node')
423+
return require('./resolver.openharmony-arm64.node')
324424
} catch (e) {
325425
loadErrors.push(e)
326426
}
327427
try {
328-
return require('@oxc-resolver/binding-linux-arm64-ohos')
428+
const binding = require('@oxc-resolver/binding-openharmony-arm64')
429+
const bindingPackageVersion = require('@oxc-resolver/binding-openharmony-arm64/package.json').version
430+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
431+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
432+
}
433+
return binding
329434
} catch (e) {
330435
loadErrors.push(e)
331436
}
332437
} else if (process.arch === 'x64') {
333438
try {
334-
return require('./resolver.linux-x64-ohos.node')
439+
return require('./resolver.openharmony-x64.node')
335440
} catch (e) {
336441
loadErrors.push(e)
337442
}
338443
try {
339-
return require('@oxc-resolver/binding-linux-x64-ohos')
444+
const binding = require('@oxc-resolver/binding-openharmony-x64')
445+
const bindingPackageVersion = require('@oxc-resolver/binding-openharmony-x64/package.json').version
446+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
447+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
448+
}
449+
return binding
340450
} catch (e) {
341451
loadErrors.push(e)
342452
}
343453
} else if (process.arch === 'arm') {
344454
try {
345-
return require('./resolver.linux-arm-ohos.node')
455+
return require('./resolver.openharmony-arm.node')
346456
} catch (e) {
347457
loadErrors.push(e)
348458
}
349459
try {
350-
return require('@oxc-resolver/binding-linux-arm-ohos')
460+
const binding = require('@oxc-resolver/binding-openharmony-arm')
461+
const bindingPackageVersion = require('@oxc-resolver/binding-openharmony-arm/package.json').version
462+
if (bindingPackageVersion !== '11.6.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
463+
throw new Error(`Native binding package version mismatch, expected 11.6.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
464+
}
465+
return binding
351466
} catch (e) {
352467
loadErrors.push(e)
353468
}

0 commit comments

Comments
 (0)