oxc-parser 0.46.0 → 0.47.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 +6 -3
  2. package/index.d.ts +10 -3
  3. package/package.json +10 -10
package/bindings.js CHANGED
@@ -1,9 +1,12 @@
1
1
  // prettier-ignore
2
2
  /* eslint-disable */
3
+ // @ts-nocheck
3
4
  /* auto-generated by NAPI-RS */
4
5
 
5
- const { readFileSync } = require('fs')
6
+ const { createRequire } = require('node:module')
7
+ require = createRequire(__filename)
6
8
 
9
+ const { readFileSync } = require('node:fs')
7
10
  let nativeBinding = null
8
11
  const loadErrors = []
9
12
 
@@ -336,7 +339,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
336
339
  nativeBinding = require('./parser.wasi.cjs')
337
340
  } catch (err) {
338
341
  if (process.env.NAPI_RS_FORCE_WASI) {
339
- console.error(err)
342
+ loadErrors.push(err)
340
343
  }
341
344
  }
342
345
  if (!nativeBinding) {
@@ -344,7 +347,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
344
347
  nativeBinding = require('@oxc-parser/binding-wasm32-wasi')
345
348
  } catch (err) {
346
349
  if (process.env.NAPI_RS_FORCE_WASI) {
347
- console.error(err)
350
+ loadErrors.push(err)
348
351
  }
349
352
  }
350
353
  }
package/index.d.ts CHANGED
@@ -37,6 +37,12 @@ export interface Comment {
37
37
  end: number
38
38
  }
39
39
 
40
+ export interface DynamicImport {
41
+ start: number
42
+ end: number
43
+ moduleRequest: Span
44
+ }
45
+
40
46
  export interface EcmaScriptModule {
41
47
  /**
42
48
  * Has ESM syntax.
@@ -46,10 +52,12 @@ export interface EcmaScriptModule {
46
52
  * Dynamic imports `import('foo')` are ignored since they can be used in non-ESM files.
47
53
  */
48
54
  hasModuleSyntax: boolean
49
- /** Import Statements. */
55
+ /** Import statements. */
50
56
  staticImports: Array<StaticImport>
51
- /** Export Statements. */
57
+ /** Export statements. */
52
58
  staticExports: Array<StaticExport>
59
+ /** Dynamic import expressions. */
60
+ dynamicImports: Array<DynamicImport>
53
61
  /** Span positions` of `import.meta` */
54
62
  importMetas: Array<Span>
55
63
  }
@@ -274,4 +282,3 @@ export interface ValueSpan {
274
282
  start: number
275
283
  end: number
276
284
  }
277
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxc-parser",
3
- "version": "0.46.0",
3
+ "version": "0.47.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.46.0"
27
+ "@oxc-project/types": "^0.47.0"
28
28
  },
29
29
  "optionalDependencies": {
30
- "@oxc-parser/binding-win32-x64-msvc": "0.46.0",
31
- "@oxc-parser/binding-win32-arm64-msvc": "0.46.0",
32
- "@oxc-parser/binding-linux-x64-gnu": "0.46.0",
33
- "@oxc-parser/binding-linux-arm64-gnu": "0.46.0",
34
- "@oxc-parser/binding-linux-x64-musl": "0.46.0",
35
- "@oxc-parser/binding-linux-arm64-musl": "0.46.0",
36
- "@oxc-parser/binding-darwin-x64": "0.46.0",
37
- "@oxc-parser/binding-darwin-arm64": "0.46.0"
30
+ "@oxc-parser/binding-win32-x64-msvc": "0.47.0",
31
+ "@oxc-parser/binding-win32-arm64-msvc": "0.47.0",
32
+ "@oxc-parser/binding-linux-x64-gnu": "0.47.0",
33
+ "@oxc-parser/binding-linux-arm64-gnu": "0.47.0",
34
+ "@oxc-parser/binding-linux-x64-musl": "0.47.0",
35
+ "@oxc-parser/binding-linux-arm64-musl": "0.47.0",
36
+ "@oxc-parser/binding-darwin-x64": "0.47.0",
37
+ "@oxc-parser/binding-darwin-arm64": "0.47.0"
38
38
  }
39
39
  }