Skip to content

Commit

Permalink
build: add release node script
Browse files Browse the repository at this point in the history
fix: remove libz-sys dependencies
  • Loading branch information
Myriad-Dreamin committed Jun 28, 2024
1 parent d2c8708 commit 6fa28be
Show file tree
Hide file tree
Showing 21 changed files with 2,813 additions and 177 deletions.
428 changes: 428 additions & 0 deletions .github/workflows/release-node.yaml

Large diffs are not rendered by default.

52 changes: 0 additions & 52 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ vergen = { version = "8.3.1", features = [
"build",
"cargo",
"git",
"git2",
"gitcl",
"rustc",
] }

Expand Down
2 changes: 1 addition & 1 deletion packages/typst.node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ yarn add @myriaddreamin/typst-ts-node-compiler

### Build

After `yarn build/npm run 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).
After `yarn build/npm run build` command, you can see `typst-ts-node-compiler.[darwin|win32|linux].node` file in project root. This is the native addon built from [lib.rs](./src/lib.rs).

### Test

Expand Down
28 changes: 14 additions & 14 deletions packages/typst.node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ switch (platform) {
loadError = e;
}
break;
case 'ia32':
localFileExisted = existsSync(
join(__dirname, 'typst-ts-node-compiler.win32-ia32-msvc.node'),
);
try {
if (localFileExisted) {
nativeBinding = require('./typst-ts-node-compiler.win32-ia32-msvc.node');
} else {
nativeBinding = require('@myriaddreamin/typst-ts-node-compiler-win32-ia32-msvc');
}
} catch (e) {
loadError = e;
}
break;
// case 'ia32':
// localFileExisted = existsSync(
// join(__dirname, 'typst-ts-node-compiler.win32-ia32-msvc.node'),
// );
// try {
// if (localFileExisted) {
// nativeBinding = require('./typst-ts-node-compiler.win32-ia32-msvc.node');
// } else {
// nativeBinding = require('@myriaddreamin/typst-ts-node-compiler-win32-ia32-msvc');
// }
// } catch (e) {
// loadError = e;
// }
// break;
case 'arm64':
localFileExisted = existsSync(
join(__dirname, 'typst-ts-node-compiler.win32-arm64-msvc.node'),
Expand Down
4 changes: 2 additions & 2 deletions packages/typst.node/npm/android-arm-eabi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"cpu": [
"arm"
],
"main": "package-template.android-arm-eabi.node",
"main": "typst-ts-node-compiler.android-arm-eabi.node",
"files": [
"package-template.android-arm-eabi.node"
"typst-ts-node-compiler.android-arm-eabi.node"
],
"description": "Compile or Render Typst documents in Node environment.",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typst.node/npm/android-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"cpu": [
"arm64"
],
"main": "package-template.android-arm64.node",
"main": "typst-ts-node-compiler.android-arm64.node",
"files": [
"package-template.android-arm64.node"
"typst-ts-node-compiler.android-arm64.node"
],
"description": "Compile or Render Typst documents in Node environment.",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typst.node/npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"cpu": [
"arm64"
],
"main": "package-template.darwin-arm64.node",
"main": "typst-ts-node-compiler.darwin-arm64.node",
"files": [
"package-template.darwin-arm64.node"
"typst-ts-node-compiler.darwin-arm64.node"
],
"description": "Compile or Render Typst documents in Node environment.",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typst.node/npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"cpu": [
"x64"
],
"main": "package-template.darwin-x64.node",
"main": "typst-ts-node-compiler.darwin-x64.node",
"files": [
"package-template.darwin-x64.node"
"typst-ts-node-compiler.darwin-x64.node"
],
"description": "Compile or Render Typst documents in Node environment.",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typst.node/npm/freebsd-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"cpu": [
"x64"
],
"main": "package-template.freebsd-x64.node",
"main": "typst-ts-node-compiler.freebsd-x64.node",
"files": [
"package-template.freebsd-x64.node"
"typst-ts-node-compiler.freebsd-x64.node"
],
"description": "Compile or Render Typst documents in Node environment.",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typst.node/npm/linux-arm-gnueabihf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"cpu": [
"arm"
],
"main": "package-template.linux-arm-gnueabihf.node",
"main": "typst-ts-node-compiler.linux-arm-gnueabihf.node",
"files": [
"package-template.linux-arm-gnueabihf.node"
"typst-ts-node-compiler.linux-arm-gnueabihf.node"
],
"description": "Compile or Render Typst documents in Node environment.",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typst.node/npm/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"libc": [
"glibc"
],
"main": "package-template.linux-arm64-gnu.node",
"main": "typst-ts-node-compiler.linux-arm64-gnu.node",
"files": [
"package-template.linux-arm64-gnu.node"
"typst-ts-node-compiler.linux-arm64-gnu.node"
],
"description": "Compile or Render Typst documents in Node environment.",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typst.node/npm/linux-arm64-musl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"libc": [
"musl"
],
"main": "package-template.linux-arm64-musl.node",
"main": "typst-ts-node-compiler.linux-arm64-musl.node",
"files": [
"package-template.linux-arm64-musl.node"
"typst-ts-node-compiler.linux-arm64-musl.node"
],
"description": "Compile or Render Typst documents in Node environment.",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typst.node/npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"libc": [
"glibc"
],
"main": "package-template.linux-x64-gnu.node",
"main": "typst-ts-node-compiler.linux-x64-gnu.node",
"files": [
"package-template.linux-x64-gnu.node"
"typst-ts-node-compiler.linux-x64-gnu.node"
],
"description": "Compile or Render Typst documents in Node environment.",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typst.node/npm/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"libc": [
"musl"
],
"main": "package-template.linux-x64-musl.node",
"main": "typst-ts-node-compiler.linux-x64-musl.node",
"files": [
"package-template.linux-x64-musl.node"
"typst-ts-node-compiler.linux-x64-musl.node"
],
"description": "Compile or Render Typst documents in Node environment.",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typst.node/npm/win32-arm64-msvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"cpu": [
"arm64"
],
"main": "package-template.win32-arm64-msvc.node",
"main": "typst-ts-node-compiler.win32-arm64-msvc.node",
"files": [
"package-template.win32-arm64-msvc.node"
"typst-ts-node-compiler.win32-arm64-msvc.node"
],
"description": "Compile or Render Typst documents in Node environment.",
"keywords": [
Expand Down
3 changes: 0 additions & 3 deletions packages/typst.node/npm/win32-ia32-msvc/README.md

This file was deleted.

31 changes: 0 additions & 31 deletions packages/typst.node/npm/win32-ia32-msvc/package.json

This file was deleted.

4 changes: 2 additions & 2 deletions packages/typst.node/npm/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"cpu": [
"x64"
],
"main": "package-template.win32-x64-msvc.node",
"main": "typst-ts-node-compiler.win32-x64-msvc.node",
"files": [
"package-template.win32-x64-msvc.node"
"typst-ts-node-compiler.win32-x64-msvc.node"
],
"description": "Compile or Render Typst documents in Node environment.",
"keywords": [
Expand Down
9 changes: 4 additions & 5 deletions packages/typst.node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
"additional": [
"x86_64-unknown-linux-musl",
"aarch64-unknown-linux-gnu",
"i686-pc-windows-msvc",
"armv7-unknown-linux-gnueabihf",
"aarch64-apple-darwin",
"aarch64-linux-android",
"x86_64-unknown-freebsd",
"armv7-unknown-linux-gnueabihf",
"aarch64-unknown-linux-musl",
"aarch64-pc-windows-msvc",
"armv7-linux-androideabi"
Expand Down Expand Up @@ -59,9 +58,9 @@
"version": "napi version"
},
"devDependencies": {
"@napi-rs/cli": "^2.16.4",
"@swc-node/register": "^1.6.8",
"@swc/core": "^1.3.95",
"@napi-rs/cli": "3.0.0-alpha.43",
"@swc-node/register": "^1.10.0",
"@swc/core": "^1.6.5",
"@taplo/cli": "^0.5.2",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
Expand Down
Loading

0 comments on commit 6fa28be

Please sign in to comment.