@vue-jsx-vapor/compiler-rs 2.6.8 → 2.6.13

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 (4) hide show
  1. package/README.md +3 -83
  2. package/index.d.ts +13 -10
  3. package/index.js +85 -280
  4. package/package.json +16 -16
package/README.md CHANGED
@@ -1,85 +1,5 @@
1
- # `@napi-rs/package-template`
1
+ # @vue-jsx-vapor/compiler-rs
2
2
 
3
- ![https://github.com/napi-rs/package-template/actions](https://github.com/napi-rs/package-template/workflows/CI/badge.svg)
3
+ [![NPM version](https://img.shields.io/npm/v/@vue-jsx-vapor/compiler-rs?color=a1b858&label=)](https://www.npmjs.com/package/@vue-jsx-vapor/compiler-rs)
4
4
 
5
- > Template project for writing node packages with napi-rs.
6
-
7
- # Usage
8
-
9
- 1. Click **Use this template**.
10
- 2. **Clone** your project.
11
- 3. Run `pnpm install` to install dependencies.
12
- 4. Run `npx napi rename -n [name]` command under the project folder to rename your package.
13
-
14
- ## Install this test package
15
-
16
- ```
17
- pnpm add @napi-rs/package-template
18
- ```
19
-
20
- ## Usage
21
-
22
- ### Build
23
-
24
- After `pnpm build` command, you can see `package-template.[darwin|win32|linux].node` file in project root. This is the native addon built from [lib.rs](./src/lib.rs).
25
-
26
- ### Test
27
-
28
- With [ava](https://github.com/avajs/ava), run `pnpm test` to testing native addon. You can also switch to another testing framework if you want.
29
-
30
- ### CI
31
-
32
- With GitHub Actions, each commit and pull request will be built and tested automatically in [`node@18`, `node@20`] x [`macOS`, `Linux`, `Windows`] matrix. You will never be afraid of the native addon broken in these platforms.
33
-
34
- ### Release
35
-
36
- Release native package is very difficult in old days. Native packages may ask developers who use it to install `build toolchain` like `gcc/llvm`, `node-gyp` or something more.
37
-
38
- With `GitHub actions`, we can easily prebuild a `binary` for major platforms. And with `N-API`, we should never be afraid of **ABI Compatible**.
39
-
40
- The other problem is how to deliver prebuild `binary` to users. Downloading it in `postinstall` script is a common way that most packages do it right now. The problem with this solution is it introduced many other packages to download binary that has not been used by `runtime codes`. The other problem is some users may not easily download the binary from `GitHub/CDN` if they are behind a private network (But in most cases, they have a private NPM mirror).
41
-
42
- In this package, we choose a better way to solve this problem. We release different `npm packages` for different platforms. And add it to `optionalDependencies` before releasing the `Major` package to npm.
43
-
44
- `NPM` will choose which native package should download from `registry` automatically. You can see [npm](./npm) dir for details. And you can also run `pnpm add @napi-rs/package-template` to see how it works.
45
-
46
- ## Develop requirements
47
-
48
- - Install the latest `Rust`
49
- - Install `Node.js@16+` which fully supported `Node-API`
50
- - Run `corepack enable`
51
-
52
- ## Test in local
53
-
54
- - pnpm
55
- - pnpm build
56
- - pnpm test
57
-
58
- And you will see:
59
-
60
- ```bash
61
- $ ava --verbose
62
-
63
- ✔ sync function from native code
64
- ✔ sleep function from native code (201ms)
65
-
66
-
67
- 2 tests passed
68
- ✨ Done in 1.12s.
69
- ```
70
-
71
- ## Release package
72
-
73
- Ensure you have set your **NPM_TOKEN** in the `GitHub` project setting.
74
-
75
- In `Settings -> Secrets`, add **NPM_TOKEN** into it.
76
-
77
- When you want to release the package:
78
-
79
- ```
80
- npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]
81
-
82
- git push
83
- ```
84
-
85
- GitHub actions will do the rest job for you.
5
+ Rust version of @vue-jsx-vapor/compiler.
package/index.d.ts CHANGED
@@ -1,9 +1,6 @@
1
1
  /* auto-generated by NAPI-RS */
2
2
  /* eslint-disable */
3
- export declare function compile(
4
- source: string,
5
- options?: CompilerOptions | undefined | null,
6
- ): CompileCodegenResult
3
+ export declare function compile(source: string, options?: CompilerOptions | undefined | null): CompileCodegenResult
7
4
 
8
5
  export interface CompileCodegenResult {
9
6
  helpers: Set<string>
@@ -39,6 +36,14 @@ export interface CompilerOptions {
39
36
  * while all other JSX is transformed to Virtual DOM.
40
37
  */
41
38
  interop?: boolean
39
+ /** * Enabled HMR support.
40
+ * @default false
41
+ */
42
+ hmr?: boolean
43
+ /** * Enabled SSR support.
44
+ * @default false
45
+ */
46
+ ssr?: boolean
42
47
  }
43
48
 
44
49
  export declare const enum ErrorCodes {
@@ -62,15 +67,13 @@ export declare const enum ErrorCodes {
62
67
  VModelOnFileInputElement = 59,
63
68
  VModelUnnecessaryValue = 60,
64
69
  VShowNoExpression = 61,
65
- VSlotsNoExpression = 62,
70
+ VSlotsNoExpression = 62
66
71
  }
67
72
 
68
- export type Template = [string, boolean]
73
+ export type Template =
74
+ [string, boolean]
69
75
 
70
- export declare function transform(
71
- source: string,
72
- options?: CompilerOptions | undefined | null,
73
- ): TransformReturn
76
+ export declare function transform(source: string, options?: CompilerOptions | undefined | null): TransformReturn
74
77
 
75
78
  export interface TransformReturn {
76
79
  code: string
package/index.js CHANGED
@@ -56,9 +56,7 @@ const isMuslFromReport = () => {
56
56
 
57
57
  const isMuslFromChildProcess = () => {
58
58
  try {
59
- return require('child_process')
60
- .execSync('ldd --version', { encoding: 'utf8' })
61
- .includes('musl')
59
+ return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
62
60
  } catch (e) {
63
61
  // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
64
62
  return false
@@ -68,7 +66,7 @@ const isMuslFromChildProcess = () => {
68
66
  function requireNative() {
69
67
  if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
70
68
  try {
71
- return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)
69
+ return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
72
70
  } catch (err) {
73
71
  loadErrors.push(err)
74
72
  }
@@ -81,16 +79,9 @@ function requireNative() {
81
79
  }
82
80
  try {
83
81
  const binding = require('@vue-jsx-vapor/compiler-rs-android-arm64')
84
- const bindingPackageVersion =
85
- require('@vue-jsx-vapor/compiler-rs-android-arm64/package.json').version
86
- if (
87
- bindingPackageVersion !== '1.1.1' &&
88
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
89
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
90
- ) {
91
- throw new Error(
92
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
93
- )
82
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-android-arm64/package.json').version
83
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
94
85
  }
95
86
  return binding
96
87
  } catch (e) {
@@ -104,25 +95,16 @@ function requireNative() {
104
95
  }
105
96
  try {
106
97
  const binding = require('@vue-jsx-vapor/compiler-rs-android-arm-eabi')
107
- const bindingPackageVersion =
108
- require('@vue-jsx-vapor/compiler-rs-android-arm-eabi/package.json').version
109
- if (
110
- bindingPackageVersion !== '1.1.1' &&
111
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
112
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
113
- ) {
114
- throw new Error(
115
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
116
- )
98
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-android-arm-eabi/package.json').version
99
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
101
  }
118
102
  return binding
119
103
  } catch (e) {
120
104
  loadErrors.push(e)
121
105
  }
122
106
  } else {
123
- loadErrors.push(
124
- new Error(`Unsupported architecture on Android ${process.arch}`),
125
- )
107
+ loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
126
108
  }
127
109
  } else if (process.platform === 'win32') {
128
110
  if (process.arch === 'x64') {
@@ -133,16 +115,9 @@ function requireNative() {
133
115
  }
134
116
  try {
135
117
  const binding = require('@vue-jsx-vapor/compiler-rs-win32-x64-msvc')
136
- const bindingPackageVersion =
137
- require('@vue-jsx-vapor/compiler-rs-win32-x64-msvc/package.json').version
138
- if (
139
- bindingPackageVersion !== '1.1.1' &&
140
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
141
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
142
- ) {
143
- throw new Error(
144
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
145
- )
118
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-win32-x64-msvc/package.json').version
119
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
146
121
  }
147
122
  return binding
148
123
  } catch (e) {
@@ -156,16 +131,9 @@ function requireNative() {
156
131
  }
157
132
  try {
158
133
  const binding = require('@vue-jsx-vapor/compiler-rs-win32-ia32-msvc')
159
- const bindingPackageVersion =
160
- require('@vue-jsx-vapor/compiler-rs-win32-ia32-msvc/package.json').version
161
- if (
162
- bindingPackageVersion !== '1.1.1' &&
163
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
164
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
165
- ) {
166
- throw new Error(
167
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
168
- )
134
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-win32-ia32-msvc/package.json').version
135
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
169
137
  }
170
138
  return binding
171
139
  } catch (e) {
@@ -179,25 +147,16 @@ function requireNative() {
179
147
  }
180
148
  try {
181
149
  const binding = require('@vue-jsx-vapor/compiler-rs-win32-arm64-msvc')
182
- const bindingPackageVersion =
183
- require('@vue-jsx-vapor/compiler-rs-win32-arm64-msvc/package.json').version
184
- if (
185
- bindingPackageVersion !== '1.1.1' &&
186
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
187
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
188
- ) {
189
- throw new Error(
190
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
191
- )
150
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-win32-arm64-msvc/package.json').version
151
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
192
153
  }
193
154
  return binding
194
155
  } catch (e) {
195
156
  loadErrors.push(e)
196
157
  }
197
158
  } else {
198
- loadErrors.push(
199
- new Error(`Unsupported architecture on Windows: ${process.arch}`),
200
- )
159
+ loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
201
160
  }
202
161
  } else if (process.platform === 'darwin') {
203
162
  try {
@@ -207,16 +166,9 @@ function requireNative() {
207
166
  }
208
167
  try {
209
168
  const binding = require('@vue-jsx-vapor/compiler-rs-darwin-universal')
210
- const bindingPackageVersion =
211
- require('@vue-jsx-vapor/compiler-rs-darwin-universal/package.json').version
212
- if (
213
- bindingPackageVersion !== '1.1.1' &&
214
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
215
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
216
- ) {
217
- throw new Error(
218
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
219
- )
169
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-darwin-universal/package.json').version
170
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
220
172
  }
221
173
  return binding
222
174
  } catch (e) {
@@ -230,16 +182,9 @@ function requireNative() {
230
182
  }
231
183
  try {
232
184
  const binding = require('@vue-jsx-vapor/compiler-rs-darwin-x64')
233
- const bindingPackageVersion =
234
- require('@vue-jsx-vapor/compiler-rs-darwin-x64/package.json').version
235
- if (
236
- bindingPackageVersion !== '1.1.1' &&
237
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
238
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
239
- ) {
240
- throw new Error(
241
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
242
- )
185
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-darwin-x64/package.json').version
186
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
243
188
  }
244
189
  return binding
245
190
  } catch (e) {
@@ -253,25 +198,16 @@ function requireNative() {
253
198
  }
254
199
  try {
255
200
  const binding = require('@vue-jsx-vapor/compiler-rs-darwin-arm64')
256
- const bindingPackageVersion =
257
- require('@vue-jsx-vapor/compiler-rs-darwin-arm64/package.json').version
258
- if (
259
- bindingPackageVersion !== '1.1.1' &&
260
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
261
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
262
- ) {
263
- throw new Error(
264
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
265
- )
201
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-darwin-arm64/package.json').version
202
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
266
204
  }
267
205
  return binding
268
206
  } catch (e) {
269
207
  loadErrors.push(e)
270
208
  }
271
209
  } else {
272
- loadErrors.push(
273
- new Error(`Unsupported architecture on macOS: ${process.arch}`),
274
- )
210
+ loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
275
211
  }
276
212
  } else if (process.platform === 'freebsd') {
277
213
  if (process.arch === 'x64') {
@@ -282,16 +218,9 @@ function requireNative() {
282
218
  }
283
219
  try {
284
220
  const binding = require('@vue-jsx-vapor/compiler-rs-freebsd-x64')
285
- const bindingPackageVersion =
286
- require('@vue-jsx-vapor/compiler-rs-freebsd-x64/package.json').version
287
- if (
288
- bindingPackageVersion !== '1.1.1' &&
289
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
290
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
291
- ) {
292
- throw new Error(
293
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
294
- )
221
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-freebsd-x64/package.json').version
222
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
295
224
  }
296
225
  return binding
297
226
  } catch (e) {
@@ -305,25 +234,16 @@ function requireNative() {
305
234
  }
306
235
  try {
307
236
  const binding = require('@vue-jsx-vapor/compiler-rs-freebsd-arm64')
308
- const bindingPackageVersion =
309
- require('@vue-jsx-vapor/compiler-rs-freebsd-arm64/package.json').version
310
- if (
311
- bindingPackageVersion !== '1.1.1' &&
312
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
313
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
314
- ) {
315
- throw new Error(
316
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
317
- )
237
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-freebsd-arm64/package.json').version
238
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
318
240
  }
319
241
  return binding
320
242
  } catch (e) {
321
243
  loadErrors.push(e)
322
244
  }
323
245
  } else {
324
- loadErrors.push(
325
- new Error(`Unsupported architecture on FreeBSD: ${process.arch}`),
326
- )
246
+ loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
327
247
  }
328
248
  } else if (process.platform === 'linux') {
329
249
  if (process.arch === 'x64') {
@@ -335,16 +255,9 @@ function requireNative() {
335
255
  }
336
256
  try {
337
257
  const binding = require('@vue-jsx-vapor/compiler-rs-linux-x64-musl')
338
- const bindingPackageVersion =
339
- require('@vue-jsx-vapor/compiler-rs-linux-x64-musl/package.json').version
340
- if (
341
- bindingPackageVersion !== '1.1.1' &&
342
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
343
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
344
- ) {
345
- throw new Error(
346
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
347
- )
258
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-linux-x64-musl/package.json').version
259
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
348
261
  }
349
262
  return binding
350
263
  } catch (e) {
@@ -358,16 +271,9 @@ function requireNative() {
358
271
  }
359
272
  try {
360
273
  const binding = require('@vue-jsx-vapor/compiler-rs-linux-x64-gnu')
361
- const bindingPackageVersion =
362
- require('@vue-jsx-vapor/compiler-rs-linux-x64-gnu/package.json').version
363
- if (
364
- bindingPackageVersion !== '1.1.1' &&
365
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
366
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
367
- ) {
368
- throw new Error(
369
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
370
- )
274
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-linux-x64-gnu/package.json').version
275
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
371
277
  }
372
278
  return binding
373
279
  } catch (e) {
@@ -383,16 +289,9 @@ function requireNative() {
383
289
  }
384
290
  try {
385
291
  const binding = require('@vue-jsx-vapor/compiler-rs-linux-arm64-musl')
386
- const bindingPackageVersion =
387
- require('@vue-jsx-vapor/compiler-rs-linux-arm64-musl/package.json').version
388
- if (
389
- bindingPackageVersion !== '1.1.1' &&
390
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
391
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
392
- ) {
393
- throw new Error(
394
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
395
- )
292
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-linux-arm64-musl/package.json').version
293
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
396
295
  }
397
296
  return binding
398
297
  } catch (e) {
@@ -406,16 +305,9 @@ function requireNative() {
406
305
  }
407
306
  try {
408
307
  const binding = require('@vue-jsx-vapor/compiler-rs-linux-arm64-gnu')
409
- const bindingPackageVersion =
410
- require('@vue-jsx-vapor/compiler-rs-linux-arm64-gnu/package.json').version
411
- if (
412
- bindingPackageVersion !== '1.1.1' &&
413
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
414
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
415
- ) {
416
- throw new Error(
417
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
418
- )
308
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-linux-arm64-gnu/package.json').version
309
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
419
311
  }
420
312
  return binding
421
313
  } catch (e) {
@@ -431,16 +323,9 @@ function requireNative() {
431
323
  }
432
324
  try {
433
325
  const binding = require('@vue-jsx-vapor/compiler-rs-linux-arm-musleabihf')
434
- const bindingPackageVersion =
435
- require('@vue-jsx-vapor/compiler-rs-linux-arm-musleabihf/package.json').version
436
- if (
437
- bindingPackageVersion !== '1.1.1' &&
438
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
439
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
440
- ) {
441
- throw new Error(
442
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
443
- )
326
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-linux-arm-musleabihf/package.json').version
327
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
444
329
  }
445
330
  return binding
446
331
  } catch (e) {
@@ -454,16 +339,9 @@ function requireNative() {
454
339
  }
455
340
  try {
456
341
  const binding = require('@vue-jsx-vapor/compiler-rs-linux-arm-gnueabihf')
457
- const bindingPackageVersion =
458
- require('@vue-jsx-vapor/compiler-rs-linux-arm-gnueabihf/package.json').version
459
- if (
460
- bindingPackageVersion !== '1.1.1' &&
461
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
462
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
463
- ) {
464
- throw new Error(
465
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
466
- )
342
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-linux-arm-gnueabihf/package.json').version
343
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
467
345
  }
468
346
  return binding
469
347
  } catch (e) {
@@ -479,16 +357,9 @@ function requireNative() {
479
357
  }
480
358
  try {
481
359
  const binding = require('@vue-jsx-vapor/compiler-rs-linux-loong64-musl')
482
- const bindingPackageVersion =
483
- require('@vue-jsx-vapor/compiler-rs-linux-loong64-musl/package.json').version
484
- if (
485
- bindingPackageVersion !== '1.1.1' &&
486
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
487
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
488
- ) {
489
- throw new Error(
490
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
491
- )
360
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-linux-loong64-musl/package.json').version
361
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
492
363
  }
493
364
  return binding
494
365
  } catch (e) {
@@ -502,16 +373,9 @@ function requireNative() {
502
373
  }
503
374
  try {
504
375
  const binding = require('@vue-jsx-vapor/compiler-rs-linux-loong64-gnu')
505
- const bindingPackageVersion =
506
- require('@vue-jsx-vapor/compiler-rs-linux-loong64-gnu/package.json').version
507
- if (
508
- bindingPackageVersion !== '1.1.1' &&
509
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
510
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
511
- ) {
512
- throw new Error(
513
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
514
- )
376
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-linux-loong64-gnu/package.json').version
377
+ if (bindingPackageVersion !== '2.6.12' && 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 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
515
379
  }
516
380
  return binding
517
381
  } catch (e) {
@@ -527,16 +391,9 @@ function requireNative() {
527
391
  }
528
392
  try {
529
393
  const binding = require('@vue-jsx-vapor/compiler-rs-linux-riscv64-musl')
530
- const bindingPackageVersion =
531
- require('@vue-jsx-vapor/compiler-rs-linux-riscv64-musl/package.json').version
532
- if (
533
- bindingPackageVersion !== '1.1.1' &&
534
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
535
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
536
- ) {
537
- throw new Error(
538
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
539
- )
394
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-linux-riscv64-musl/package.json').version
395
+ if (bindingPackageVersion !== '2.6.12' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
396
+ throw new Error(`Native binding package version mismatch, expected 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
540
397
  }
541
398
  return binding
542
399
  } catch (e) {
@@ -550,16 +407,9 @@ function requireNative() {
550
407
  }
551
408
  try {
552
409
  const binding = require('@vue-jsx-vapor/compiler-rs-linux-riscv64-gnu')
553
- const bindingPackageVersion =
554
- require('@vue-jsx-vapor/compiler-rs-linux-riscv64-gnu/package.json').version
555
- if (
556
- bindingPackageVersion !== '1.1.1' &&
557
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
558
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
559
- ) {
560
- throw new Error(
561
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
562
- )
410
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-linux-riscv64-gnu/package.json').version
411
+ if (bindingPackageVersion !== '2.6.12' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
412
+ throw new Error(`Native binding package version mismatch, expected 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
563
413
  }
564
414
  return binding
565
415
  } catch (e) {
@@ -574,16 +424,9 @@ function requireNative() {
574
424
  }
575
425
  try {
576
426
  const binding = require('@vue-jsx-vapor/compiler-rs-linux-ppc64-gnu')
577
- const bindingPackageVersion =
578
- require('@vue-jsx-vapor/compiler-rs-linux-ppc64-gnu/package.json').version
579
- if (
580
- bindingPackageVersion !== '1.1.1' &&
581
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
582
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
583
- ) {
584
- throw new Error(
585
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
586
- )
427
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-linux-ppc64-gnu/package.json').version
428
+ if (bindingPackageVersion !== '2.6.12' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
429
+ throw new Error(`Native binding package version mismatch, expected 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
587
430
  }
588
431
  return binding
589
432
  } catch (e) {
@@ -597,25 +440,16 @@ function requireNative() {
597
440
  }
598
441
  try {
599
442
  const binding = require('@vue-jsx-vapor/compiler-rs-linux-s390x-gnu')
600
- const bindingPackageVersion =
601
- require('@vue-jsx-vapor/compiler-rs-linux-s390x-gnu/package.json').version
602
- if (
603
- bindingPackageVersion !== '1.1.1' &&
604
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
605
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
606
- ) {
607
- throw new Error(
608
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
609
- )
443
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-linux-s390x-gnu/package.json').version
444
+ if (bindingPackageVersion !== '2.6.12' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
445
+ throw new Error(`Native binding package version mismatch, expected 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
610
446
  }
611
447
  return binding
612
448
  } catch (e) {
613
449
  loadErrors.push(e)
614
450
  }
615
451
  } else {
616
- loadErrors.push(
617
- new Error(`Unsupported architecture on Linux: ${process.arch}`),
618
- )
452
+ loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
619
453
  }
620
454
  } else if (process.platform === 'openharmony') {
621
455
  if (process.arch === 'arm64') {
@@ -626,16 +460,9 @@ function requireNative() {
626
460
  }
627
461
  try {
628
462
  const binding = require('@vue-jsx-vapor/compiler-rs-openharmony-arm64')
629
- const bindingPackageVersion =
630
- require('@vue-jsx-vapor/compiler-rs-openharmony-arm64/package.json').version
631
- if (
632
- bindingPackageVersion !== '1.1.1' &&
633
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
634
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
635
- ) {
636
- throw new Error(
637
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
638
- )
463
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-openharmony-arm64/package.json').version
464
+ if (bindingPackageVersion !== '2.6.12' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
465
+ throw new Error(`Native binding package version mismatch, expected 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
639
466
  }
640
467
  return binding
641
468
  } catch (e) {
@@ -649,16 +476,9 @@ function requireNative() {
649
476
  }
650
477
  try {
651
478
  const binding = require('@vue-jsx-vapor/compiler-rs-openharmony-x64')
652
- const bindingPackageVersion =
653
- require('@vue-jsx-vapor/compiler-rs-openharmony-x64/package.json').version
654
- if (
655
- bindingPackageVersion !== '1.1.1' &&
656
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
657
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
658
- ) {
659
- throw new Error(
660
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
661
- )
479
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-openharmony-x64/package.json').version
480
+ if (bindingPackageVersion !== '2.6.12' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
481
+ throw new Error(`Native binding package version mismatch, expected 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
662
482
  }
663
483
  return binding
664
484
  } catch (e) {
@@ -672,32 +492,19 @@ function requireNative() {
672
492
  }
673
493
  try {
674
494
  const binding = require('@vue-jsx-vapor/compiler-rs-openharmony-arm')
675
- const bindingPackageVersion =
676
- require('@vue-jsx-vapor/compiler-rs-openharmony-arm/package.json').version
677
- if (
678
- bindingPackageVersion !== '1.1.1' &&
679
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
680
- process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
681
- ) {
682
- throw new Error(
683
- `Native binding package version mismatch, expected 1.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
684
- )
495
+ const bindingPackageVersion = require('@vue-jsx-vapor/compiler-rs-openharmony-arm/package.json').version
496
+ if (bindingPackageVersion !== '2.6.12' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
497
+ throw new Error(`Native binding package version mismatch, expected 2.6.12 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
685
498
  }
686
499
  return binding
687
500
  } catch (e) {
688
501
  loadErrors.push(e)
689
502
  }
690
503
  } else {
691
- loadErrors.push(
692
- new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`),
693
- )
504
+ loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`))
694
505
  }
695
506
  } else {
696
- loadErrors.push(
697
- new Error(
698
- `Unsupported OS: ${process.platform}, architecture: ${process.arch}`,
699
- ),
700
- )
507
+ loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
701
508
  }
702
509
  }
703
510
 
@@ -726,9 +533,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
726
533
  }
727
534
  }
728
535
  if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {
729
- const error = new Error(
730
- 'WASI binding not found and NAPI_RS_FORCE_WASI is set to error',
731
- )
536
+ const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error')
732
537
  error.cause = wasiBindingError
733
538
  throw error
734
539
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-jsx-vapor/compiler-rs",
3
- "version": "2.6.8",
3
+ "version": "2.6.13",
4
4
  "packageManager": "pnpm@10.17.1",
5
5
  "description": "Template project for writing node package with napi-rs",
6
6
  "keywords": [
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "license": "MIT",
15
15
  "repository": {
16
- "url": "git+ssh://git@github.com/napi-rs/package-template-pnpm.git",
16
+ "url": "git+ssh://git@github.com/zhiyuanzmj/compiler-rs.git",
17
17
  "type": "git"
18
18
  },
19
19
  "files": [
@@ -68,19 +68,19 @@
68
68
  "emnapi": "^1.5.0"
69
69
  },
70
70
  "optionalDependencies": {
71
- "@vue-jsx-vapor/compiler-rs-darwin-x64": "2.6.8",
72
- "@vue-jsx-vapor/compiler-rs-darwin-arm64": "2.6.8",
73
- "@vue-jsx-vapor/compiler-rs-linux-x64-gnu": "2.6.8",
74
- "@vue-jsx-vapor/compiler-rs-win32-x64-msvc": "2.6.8",
75
- "@vue-jsx-vapor/compiler-rs-linux-x64-musl": "2.6.8",
76
- "@vue-jsx-vapor/compiler-rs-linux-arm64-gnu": "2.6.8",
77
- "@vue-jsx-vapor/compiler-rs-win32-ia32-msvc": "2.6.8",
78
- "@vue-jsx-vapor/compiler-rs-linux-arm-gnueabihf": "2.6.8",
79
- "@vue-jsx-vapor/compiler-rs-android-arm64": "2.6.8",
80
- "@vue-jsx-vapor/compiler-rs-freebsd-x64": "2.6.8",
81
- "@vue-jsx-vapor/compiler-rs-linux-arm64-musl": "2.6.8",
82
- "@vue-jsx-vapor/compiler-rs-win32-arm64-msvc": "2.6.8",
83
- "@vue-jsx-vapor/compiler-rs-android-arm-eabi": "2.6.8",
84
- "@vue-jsx-vapor/compiler-rs-wasm32-wasi": "2.6.8"
71
+ "@vue-jsx-vapor/compiler-rs-darwin-x64": "2.6.13",
72
+ "@vue-jsx-vapor/compiler-rs-darwin-arm64": "2.6.13",
73
+ "@vue-jsx-vapor/compiler-rs-linux-x64-gnu": "2.6.13",
74
+ "@vue-jsx-vapor/compiler-rs-win32-x64-msvc": "2.6.13",
75
+ "@vue-jsx-vapor/compiler-rs-linux-x64-musl": "2.6.13",
76
+ "@vue-jsx-vapor/compiler-rs-linux-arm64-gnu": "2.6.13",
77
+ "@vue-jsx-vapor/compiler-rs-win32-ia32-msvc": "2.6.13",
78
+ "@vue-jsx-vapor/compiler-rs-linux-arm-gnueabihf": "2.6.13",
79
+ "@vue-jsx-vapor/compiler-rs-android-arm64": "2.6.13",
80
+ "@vue-jsx-vapor/compiler-rs-freebsd-x64": "2.6.13",
81
+ "@vue-jsx-vapor/compiler-rs-linux-arm64-musl": "2.6.13",
82
+ "@vue-jsx-vapor/compiler-rs-win32-arm64-msvc": "2.6.13",
83
+ "@vue-jsx-vapor/compiler-rs-android-arm-eabi": "2.6.13",
84
+ "@vue-jsx-vapor/compiler-rs-wasm32-wasi": "2.6.13"
85
85
  }
86
86
  }