Skip to content

Commit

Permalink
Merge pull request #729 from napi-rs/upgrade-toolchain
Browse files Browse the repository at this point in the history
chore: upgrade toolchain
  • Loading branch information
Brooooooklyn authored Oct 31, 2023
2 parents 8b0be16 + fa1fcb5 commit 2a87ddc
Show file tree
Hide file tree
Showing 22 changed files with 4,397 additions and 4,028 deletions.
66 changes: 34 additions & 32 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
target: 'aarch64-pc-windows-msvc'
build: |
npm i -g @napi-rs/cli
yarn workspaces foreach --no-private -j 1 --exclude @node-rs/jsonwebtoken run build --target aarch64-pc-windows-msvc
yarn build --target aarch64-pc-windows-msvc
name: stable - ${{ matrix.settings.target }} - node@18
runs-on: ${{ matrix.settings.host }}
Expand All @@ -115,7 +115,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable
if: ${{ !matrix.settings.docker }}
with:
toolchain: nightly-2023-07-19
toolchain: nightly-2023-10-25
targets: ${{ matrix.settings.target }}

- name: Cache cargo registry
Expand Down Expand Up @@ -184,30 +184,32 @@ jobs:
- uses: actions/checkout@v3
- name: Build
id: build
uses: vmactions/freebsd-vm@v0
uses: cross-platform-actions/action@v0.21.0
env:
DEBUG: 'napi:*'
RUSTUP_HOME: /usr/local/rustup
CARGO_HOME: /usr/local/cargo
RUSTUP_HOME: /home/runner/rustup
CARGO_HOME: /home/runner/cargo
RUSTUP_IO_THREADS: 1
with:
envs: 'DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS'
usesh: true
mem: 3000
prepare: |
pkg install -y -f curl node libnghttp2 npm
npm install -g yarn --ignore-scripts
operating_system: freebsd
version: '13.2'
memory: 13G
cpu_count: 3
environment_variables: 'DEBUG RUSTUP_IO_THREADS'
shell: bash
run: |
env | sort
sudo pkg install -y -f curl node libnghttp2 npm
sudo npm install -g yarn --ignore-scripts
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain stable
export PATH="/usr/local/cargo/bin:$PATH"
sh rustup.sh -y --default-toolchain nightly-2023-10-25
source "$HOME/.cargo/env"
echo "~~~~ rustc --version ~~~~"
rustc --version
echo "~~~~ node -v ~~~~"
node -v
echo "~~~~ yarn --version ~~~~"
yarn --version
run: |
export PATH="/usr/local/cargo/bin:$PATH"
pwd
ls -lah
whoami
Expand All @@ -217,7 +219,6 @@ jobs:
yarn build:ts
yarn build
strip -x packages/*/*.node
yarn test
rm -rf node_modules
rm -rf target
rm -rf .yarn/cache
Expand All @@ -241,7 +242,7 @@ jobs:
target: 'x86_64-apple-darwin'
- host: windows-latest
target: 'x86_64-pc-windows-msvc'
node: ['16', '18']
node: ['18', '20']
runs-on: ${{ matrix.settings.host }}

steps:
Expand Down Expand Up @@ -287,7 +288,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['16', '18']
node: ['18', '20']
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -332,17 +333,11 @@ jobs:
needs:
- build
runs-on: ubuntu-latest
container:
image: centos:7
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: |
curl -sL https://rpm.nodesource.com/setup_16.x | bash -
yum install nodejs -y
npm install -g yarn
yarn install --immutable --mode=skip-build
run: yarn install --immutable --mode=skip-build

- name: Download artifacts
uses: actions/download-artifact@v3
Expand All @@ -362,8 +357,16 @@ jobs:
run: yarn build:ts

- name: Test bindings
run: |
yarn test -s
uses: addnab/docker-run-action@v3
with:
image: centos:7
options: -e YARN_IGNORE_NODE=1 -v ${{ github.workspace }}:/build -w /build
run: |
curl -sL https://rpm.nodesource.com/setup_16.x | bash -
yum install nodejs -y
npm install -g yarn
yarn install --immutable --mode=skip-build
yarn test -s
test-linux-x64-musl-binding:
name: Test bindings on x86_64-unknown-linux-musl - node@${{ matrix.node }}
Expand All @@ -372,7 +375,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['16', '18']
node: ['18', '20']
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -421,7 +424,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['16', '18']
node: ['18', '20']
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -517,7 +520,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['16', '18']
node: ['18', '20']
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -577,7 +580,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 18
check-latest: true
cache: yarn

- name: 'Install dependencies'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2023-07-19
toolchain: nightly-2023-10-25
components: rustfmt, clippy

- name: 'Install dependencies'
Expand Down
28 changes: 0 additions & 28 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

This file was deleted.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.4.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.1.cjs

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@ nodeLinker: node-modules

npmRegistryServer: 'https://registry.npmjs.org/'

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: '@yarnpkg/plugin-workspace-tools'

yarnPath: .yarn/releases/yarn-3.6.4.cjs
yarnPath: .yarn/releases/yarn-4.0.1.cjs
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-rs",
"packageManager": "yarn@3.6.4",
"packageManager": "yarn@4.0.1",
"version": "0.0.0",
"description": "Node & Rust bindings monorepo",
"author": "LongYinan <lynweklm@gmail.com>",
Expand All @@ -10,9 +10,9 @@
"packages/*"
],
"scripts": {
"artifacts": "yarn workspaces foreach --no-private run artifacts",
"artifacts": "yarn workspaces foreach -A --no-private run artifacts",
"bench": "lerna run bench --concurrency 1 --stream --no-prefix",
"build": "yarn workspaces foreach --no-private -j 1 run build",
"build": "yarn workspaces foreach -A --no-private -j 1 run build",
"build:ts": "tsc -b tsconfig.project.json -verbose",
"lint": "eslint . -c ./.eslintrc.yml \"packages/**/*.{ts,js}\"",
"test": "ava",
Expand All @@ -25,29 +25,29 @@
},
"devDependencies": {
"@napi-rs/cli": "2.16.3",
"@swc-node/core": "^1.10.4",
"@swc-node/register": "^1.6.6",
"@swc/core": "^1.3.72",
"@swc-node/core": "^1.10.6",
"@swc-node/register": "^1.6.8",
"@swc/core": "^1.3.95",
"@taplo/cli": "^0.5.2",
"@types/node": "^20.4.5",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"@types/node": "^20.8.9",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"ava": "^5.3.1",
"benchmark": "^2.1.4",
"codecov": "^3.8.3",
"cross-env": "^7.0.3",
"eslint": "^8.46.0",
"eslint": "^8.52.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-prettier": "^5.0.1",
"husky": "^8.0.3",
"lerna": "^7.1.4",
"lint-staged": "^15.0.0",
"lerna": "^7.4.1",
"lint-staged": "^15.0.2",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.0",
"prettier": "^3.0.3",
"ts-node": "^10.9.1",
"tslib": "^2.6.1",
"typescript": "^5.1.6"
"tslib": "^2.6.2",
"typescript": "^5.2.2"
},
"lint-staged": {
"*.@(js|ts|tsx)": [
Expand Down
4 changes: 2 additions & 2 deletions packages/argon2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ version = "0.0.0"
crate-type = ["cdylib"]

[dependencies]
argon2 = "0.5"
argon2 = { version = "0.5", features = ["rand"] }
global_alloc = { path = "../../crates/alloc" }
napi = { version = "2", default-features = false, features = ["napi3"] }
napi-derive = { version = "2", default-features = false, features = [
"type-def",
] }
rand = { version = "0.8", features = ["nightly", "simd_support", "getrandom"] }
rand_core = { version = "0.6", features = ["getrandom"] }

[build-dependencies]
napi-build = "2"
2 changes: 1 addition & 1 deletion packages/argon2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"devDependencies": {
"@napi-rs/cli": "2.16.3",
"argon2": "^0.31.0",
"argon2": "^0.31.1",
"cross-env": "^7.0.3"
}
}
3 changes: 2 additions & 1 deletion packages/argon2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ use napi::bindgen_prelude::*;
use napi_derive::napi;

use argon2::{
password_hash::{rand_core::OsRng, PasswordHasher, PasswordVerifier, SaltString},
password_hash::{PasswordHasher, PasswordVerifier, SaltString},
Argon2, Params,
};
use rand_core::OsRng;

#[napi]
pub enum Algorithm {
Expand Down
4 changes: 2 additions & 2 deletions packages/bcrypt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
},
"devDependencies": {
"@napi-rs/cli": "2.16.3",
"@types/bcrypt": "^5.0.0",
"bcrypt": "^5.1.0",
"@types/bcrypt": "^5.0.1",
"bcrypt": "^5.1.1",
"bcryptjs": "^2.4.3",
"cross-env": "^7.0.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/crc32/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
"devDependencies": {
"@napi-rs/cli": "2.16.3",
"@types/crc": "^3.8.0",
"@types/crc": "^3.8.2",
"buffer": "^6.0.3",
"crc": "^4.3.2",
"sse4_crc32": "^7.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/deno-lint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@
},
"dependencies": {
"clipanion": "^3.2.1",
"typanion": "^3.13.0"
"typanion": "^3.14.0"
},
"devDependencies": {
"@napi-rs/cli": "2.16.3",
"@types/webpack": "^5.28.1"
"@types/webpack": "^5.28.4"
},
"funding": {
"type": "github",
Expand Down
2 changes: 1 addition & 1 deletion packages/jsonwebtoken/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ napi = { version = "2", default-features = false, features = [
"serde-json",
] }
napi-derive = { version = "2" }
rand = "0.8"
rand_core = { version = "0.6", features = ["std"] }
serde = "1.0"
serde_json = "1.0"

Expand Down
3 changes: 3 additions & 0 deletions packages/jsonwebtoken/npm/win32-arm64-msvc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `@node-rs/jsonwebtoken-win32-arm64-msvc`

This is the **aarch64-pc-windows-msvc** binary for `@node-rs/jsonwebtoken`
42 changes: 42 additions & 0 deletions packages/jsonwebtoken/npm/win32-arm64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "@node-rs/jsonwebtoken-win32-arm64-msvc",
"version": "0.2.3",
"os": [
"win32"
],
"cpu": [
"arm64"
],
"main": "jsonwebtoken.win32-arm64-msvc.node",
"files": [
"jsonwebtoken.win32-arm64-msvc.node"
],
"description": "Rust jsonwebtoken binding for Node.js",
"keywords": [
"jsonwebtoken",
"jwt",
"napi-rs",
"node-rs"
],
"author": {
"name": "Francesco Benedetto",
"url": "https://github.com/nebarf",
"email": "francesco.benedetto263@gmail.com"
},
"homepage": "https://github.com/napi-rs/node-rs#readme",
"license": "MIT",
"engines": {
"node": ">= 10"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/napi-rs/node-rs.git"
},
"bugs": {
"url": "https://github.com/napi-rs/node-rs/issues"
}
}
5 changes: 3 additions & 2 deletions packages/jsonwebtoken/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"aarch64-linux-android",
"aarch64-unknown-linux-gnu",
"aarch64-unknown-linux-musl",
"aarch64-pc-windows-msvc",
"armv7-unknown-linux-gnueabihf",
"x86_64-unknown-linux-musl",
"x86_64-unknown-freebsd",
Expand Down Expand Up @@ -62,7 +63,7 @@
},
"devDependencies": {
"@napi-rs/cli": "2.16.3",
"@types/jsonwebtoken": "^9.0.2",
"jsonwebtoken": "^9.0.1"
"@types/jsonwebtoken": "^9.0.4",
"jsonwebtoken": "^9.0.2"
}
}
Loading

0 comments on commit 2a87ddc

Please sign in to comment.