oxc-parser 0.51.0 → 0.52.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 (3) hide show
  1. package/bindings.js +7 -1
  2. package/index.js +2 -0
  3. package/package.json +10 -10
package/bindings.js CHANGED
@@ -60,7 +60,13 @@ const isMuslFromChildProcess = () => {
60
60
  }
61
61
 
62
62
  function requireNative() {
63
- if (process.platform === 'android') {
63
+ if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
64
+ try {
65
+ nativeBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
66
+ } catch (err) {
67
+ loadErrors.push(err);
68
+ }
69
+ } else if (process.platform === 'android') {
64
70
  if (process.arch === 'arm64') {
65
71
  try {
66
72
  return require('./parser.android-arm64.node')
package/index.js CHANGED
@@ -13,6 +13,8 @@ function wrap(result) {
13
13
  return {
14
14
  get program() {
15
15
  if (!program) {
16
+ // Note: This code is repeated in `wasm/parser/update-bindings.mjs` and `crates/oxc-wasm/update-bindings.mjs`.
17
+ // Any changes should be applied in those 2 scripts too.
16
18
  program = JSON.parse(result.program, function(key, value) {
17
19
  // Set `value` field of `Literal`s for `BigInt`s and `RegExp`s.
18
20
  // This is not possible to do on Rust side, as neither can be represented correctly in JSON.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxc-parser",
3
- "version": "0.51.0",
3
+ "version": "0.52.0",
4
4
  "description": "Oxc Parser Node API",
5
5
  "keywords": [
6
6
  "Parser"
@@ -24,16 +24,16 @@
24
24
  "bindings.js"
25
25
  ],
26
26
  "dependencies": {
27
- "@oxc-project/types": "^0.51.0"
27
+ "@oxc-project/types": "^0.52.0"
28
28
  },
29
29
  "optionalDependencies": {
30
- "@oxc-parser/binding-win32-x64-msvc": "0.51.0",
31
- "@oxc-parser/binding-win32-arm64-msvc": "0.51.0",
32
- "@oxc-parser/binding-linux-x64-gnu": "0.51.0",
33
- "@oxc-parser/binding-linux-arm64-gnu": "0.51.0",
34
- "@oxc-parser/binding-linux-x64-musl": "0.51.0",
35
- "@oxc-parser/binding-linux-arm64-musl": "0.51.0",
36
- "@oxc-parser/binding-darwin-x64": "0.51.0",
37
- "@oxc-parser/binding-darwin-arm64": "0.51.0"
30
+ "@oxc-parser/binding-win32-x64-msvc": "0.52.0",
31
+ "@oxc-parser/binding-win32-arm64-msvc": "0.52.0",
32
+ "@oxc-parser/binding-linux-x64-gnu": "0.52.0",
33
+ "@oxc-parser/binding-linux-arm64-gnu": "0.52.0",
34
+ "@oxc-parser/binding-linux-x64-musl": "0.52.0",
35
+ "@oxc-parser/binding-linux-arm64-musl": "0.52.0",
36
+ "@oxc-parser/binding-darwin-x64": "0.52.0",
37
+ "@oxc-parser/binding-darwin-arm64": "0.52.0"
38
38
  }
39
39
  }