@vue-jsx-vapor/compiler-rs 2.6.8 → 2.6.12
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.
- package/README.md +3 -83
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -1,85 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vue-jsx-vapor/compiler-rs
|
|
2
2
|
|
|
3
|
-
](https://www.npmjs.com/package/@vue-jsx-vapor/compiler-rs)
|
|
4
4
|
|
|
5
|
-
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-jsx-vapor/compiler-rs",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.12",
|
|
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/
|
|
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.
|
|
72
|
-
"@vue-jsx-vapor/compiler-rs-darwin-arm64": "2.6.
|
|
73
|
-
"@vue-jsx-vapor/compiler-rs-linux-x64-gnu": "2.6.
|
|
74
|
-
"@vue-jsx-vapor/compiler-rs-win32-x64-msvc": "2.6.
|
|
75
|
-
"@vue-jsx-vapor/compiler-rs-linux-x64-musl": "2.6.
|
|
76
|
-
"@vue-jsx-vapor/compiler-rs-linux-arm64-gnu": "2.6.
|
|
77
|
-
"@vue-jsx-vapor/compiler-rs-win32-ia32-msvc": "2.6.
|
|
78
|
-
"@vue-jsx-vapor/compiler-rs-linux-arm-gnueabihf": "2.6.
|
|
79
|
-
"@vue-jsx-vapor/compiler-rs-android-arm64": "2.6.
|
|
80
|
-
"@vue-jsx-vapor/compiler-rs-freebsd-x64": "2.6.
|
|
81
|
-
"@vue-jsx-vapor/compiler-rs-linux-arm64-musl": "2.6.
|
|
82
|
-
"@vue-jsx-vapor/compiler-rs-win32-arm64-msvc": "2.6.
|
|
83
|
-
"@vue-jsx-vapor/compiler-rs-android-arm-eabi": "2.6.
|
|
84
|
-
"@vue-jsx-vapor/compiler-rs-wasm32-wasi": "2.6.
|
|
71
|
+
"@vue-jsx-vapor/compiler-rs-darwin-x64": "2.6.12",
|
|
72
|
+
"@vue-jsx-vapor/compiler-rs-darwin-arm64": "2.6.12",
|
|
73
|
+
"@vue-jsx-vapor/compiler-rs-linux-x64-gnu": "2.6.12",
|
|
74
|
+
"@vue-jsx-vapor/compiler-rs-win32-x64-msvc": "2.6.12",
|
|
75
|
+
"@vue-jsx-vapor/compiler-rs-linux-x64-musl": "2.6.12",
|
|
76
|
+
"@vue-jsx-vapor/compiler-rs-linux-arm64-gnu": "2.6.12",
|
|
77
|
+
"@vue-jsx-vapor/compiler-rs-win32-ia32-msvc": "2.6.12",
|
|
78
|
+
"@vue-jsx-vapor/compiler-rs-linux-arm-gnueabihf": "2.6.12",
|
|
79
|
+
"@vue-jsx-vapor/compiler-rs-android-arm64": "2.6.12",
|
|
80
|
+
"@vue-jsx-vapor/compiler-rs-freebsd-x64": "2.6.12",
|
|
81
|
+
"@vue-jsx-vapor/compiler-rs-linux-arm64-musl": "2.6.12",
|
|
82
|
+
"@vue-jsx-vapor/compiler-rs-win32-arm64-msvc": "2.6.12",
|
|
83
|
+
"@vue-jsx-vapor/compiler-rs-android-arm-eabi": "2.6.12",
|
|
84
|
+
"@vue-jsx-vapor/compiler-rs-wasm32-wasi": "2.6.12"
|
|
85
85
|
}
|
|
86
86
|
}
|