Skip to content

Commit 037ecb7

Browse files
committed
chore: upgrade toolchain
1 parent 8b0be16 commit 037ecb7

File tree

20 files changed

+4352
-4026
lines changed

20 files changed

+4352
-4026
lines changed

.github/workflows/ci.yaml

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
target: 'aarch64-pc-windows-msvc'
9797
build: |
9898
npm i -g @napi-rs/cli
99-
yarn workspaces foreach --no-private -j 1 --exclude @node-rs/jsonwebtoken run build --target aarch64-pc-windows-msvc
99+
yarn build --target aarch64-pc-windows-msvc
100100
101101
name: stable - ${{ matrix.settings.target }} - node@18
102102
runs-on: ${{ matrix.settings.host }}
@@ -115,7 +115,7 @@ jobs:
115115
uses: dtolnay/rust-toolchain@stable
116116
if: ${{ !matrix.settings.docker }}
117117
with:
118-
toolchain: nightly-2023-07-19
118+
toolchain: nightly-2023-10-25
119119
targets: ${{ matrix.settings.target }}
120120

121121
- name: Cache cargo registry
@@ -184,30 +184,32 @@ jobs:
184184
- uses: actions/checkout@v3
185185
- name: Build
186186
id: build
187-
uses: vmactions/freebsd-vm@v0
187+
uses: cross-platform-actions/action@v0.21.0
188188
env:
189189
DEBUG: 'napi:*'
190-
RUSTUP_HOME: /usr/local/rustup
191-
CARGO_HOME: /usr/local/cargo
190+
RUSTUP_HOME: /home/runner/rustup
191+
CARGO_HOME: /home/runner/cargo
192192
RUSTUP_IO_THREADS: 1
193193
with:
194-
envs: 'DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS'
195-
usesh: true
196-
mem: 3000
197-
prepare: |
198-
pkg install -y -f curl node libnghttp2 npm
199-
npm install -g yarn --ignore-scripts
194+
operating_system: freebsd
195+
version: '13.2'
196+
memory: 13G
197+
cpu_count: 3
198+
environment_variables: 'DEBUG RUSTUP_IO_THREADS'
199+
shell: bash
200+
run: |
201+
env | sort
202+
sudo pkg install -y -f curl node libnghttp2 npm
203+
sudo npm install -g yarn --ignore-scripts
200204
curl https://sh.rustup.rs -sSf --output rustup.sh
201-
sh rustup.sh -y --profile minimal --default-toolchain stable
202-
export PATH="/usr/local/cargo/bin:$PATH"
205+
sh rustup.sh -y --default-toolchain nightly-2023-10-25
206+
source "$HOME/.cargo/env"
203207
echo "~~~~ rustc --version ~~~~"
204208
rustc --version
205209
echo "~~~~ node -v ~~~~"
206210
node -v
207211
echo "~~~~ yarn --version ~~~~"
208212
yarn --version
209-
run: |
210-
export PATH="/usr/local/cargo/bin:$PATH"
211213
pwd
212214
ls -lah
213215
whoami
@@ -241,7 +243,7 @@ jobs:
241243
target: 'x86_64-apple-darwin'
242244
- host: windows-latest
243245
target: 'x86_64-pc-windows-msvc'
244-
node: ['16', '18']
246+
node: ['18', '20']
245247
runs-on: ${{ matrix.settings.host }}
246248

247249
steps:
@@ -287,7 +289,7 @@ jobs:
287289
strategy:
288290
fail-fast: false
289291
matrix:
290-
node: ['16', '18']
292+
node: ['18', '20']
291293
runs-on: ubuntu-latest
292294

293295
steps:
@@ -332,17 +334,11 @@ jobs:
332334
needs:
333335
- build
334336
runs-on: ubuntu-latest
335-
container:
336-
image: centos:7
337337
steps:
338-
- uses: actions/checkout@v3
338+
- uses: actions/checkout@v4
339339

340340
- name: Install dependencies
341-
run: |
342-
curl -sL https://rpm.nodesource.com/setup_16.x | bash -
343-
yum install nodejs -y
344-
npm install -g yarn
345-
yarn install --immutable --mode=skip-build
341+
run: yarn install --immutable --mode=skip-build
346342

347343
- name: Download artifacts
348344
uses: actions/download-artifact@v3
@@ -362,8 +358,16 @@ jobs:
362358
run: yarn build:ts
363359

364360
- name: Test bindings
365-
run: |
366-
yarn test -s
361+
uses: addnab/docker-run-action@v3
362+
with:
363+
image: centos:7
364+
options: -e YARN_IGNORE_NODE=1 -v ${{ github.workspace }}:/build -w /build
365+
run: |
366+
curl -sL https://rpm.nodesource.com/setup_16.x | bash -
367+
yum install nodejs -y
368+
npm install -g yarn
369+
yarn install --immutable --mode=skip-build
370+
yarn test -s
367371
368372
test-linux-x64-musl-binding:
369373
name: Test bindings on x86_64-unknown-linux-musl - node@${{ matrix.node }}
@@ -372,7 +376,7 @@ jobs:
372376
strategy:
373377
fail-fast: false
374378
matrix:
375-
node: ['16', '18']
379+
node: ['18', '20']
376380
runs-on: ubuntu-latest
377381

378382
steps:
@@ -421,7 +425,7 @@ jobs:
421425
strategy:
422426
fail-fast: false
423427
matrix:
424-
node: ['16', '18']
428+
node: ['18', '20']
425429
runs-on: ubuntu-latest
426430

427431
steps:
@@ -517,7 +521,7 @@ jobs:
517521
strategy:
518522
fail-fast: false
519523
matrix:
520-
node: ['16', '18']
524+
node: ['18', '20']
521525
runs-on: ubuntu-latest
522526

523527
steps:

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Install
2424
uses: dtolnay/rust-toolchain@stable
2525
with:
26-
toolchain: nightly-2023-07-19
26+
toolchain: nightly-2023-10-25
2727
components: rustfmt, clippy
2828

2929
- name: 'Install dependencies'

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Lines changed: 0 additions & 28 deletions
This file was deleted.

.yarn/releases/yarn-3.6.4.cjs

Lines changed: 0 additions & 874 deletions
This file was deleted.

.yarn/releases/yarn-4.0.1.cjs

Lines changed: 893 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,4 @@ nodeLinker: node-modules
22

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

5-
plugins:
6-
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
7-
spec: '@yarnpkg/plugin-workspace-tools'
8-
9-
yarnPath: .yarn/releases/yarn-3.6.4.cjs
5+
yarnPath: .yarn/releases/yarn-4.0.1.cjs

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-rs",
3-
"packageManager": "yarn@3.6.4",
3+
"packageManager": "yarn@4.0.1",
44
"version": "0.0.0",
55
"description": "Node & Rust bindings monorepo",
66
"author": "LongYinan <lynweklm@gmail.com>",
@@ -10,9 +10,9 @@
1010
"packages/*"
1111
],
1212
"scripts": {
13-
"artifacts": "yarn workspaces foreach --no-private run artifacts",
13+
"artifacts": "yarn workspaces foreach -A --no-private run artifacts",
1414
"bench": "lerna run bench --concurrency 1 --stream --no-prefix",
15-
"build": "yarn workspaces foreach --no-private -j 1 run build",
15+
"build": "yarn workspaces foreach -A --no-private -j 1 run build",
1616
"build:ts": "tsc -b tsconfig.project.json -verbose",
1717
"lint": "eslint . -c ./.eslintrc.yml \"packages/**/*.{ts,js}\"",
1818
"test": "ava",
@@ -25,29 +25,29 @@
2525
},
2626
"devDependencies": {
2727
"@napi-rs/cli": "2.16.3",
28-
"@swc-node/core": "^1.10.4",
29-
"@swc-node/register": "^1.6.6",
30-
"@swc/core": "^1.3.72",
28+
"@swc-node/core": "^1.10.6",
29+
"@swc-node/register": "^1.6.8",
30+
"@swc/core": "^1.3.95",
3131
"@taplo/cli": "^0.5.2",
32-
"@types/node": "^20.4.5",
33-
"@typescript-eslint/eslint-plugin": "^6.2.0",
34-
"@typescript-eslint/parser": "^6.2.0",
32+
"@types/node": "^20.8.9",
33+
"@typescript-eslint/eslint-plugin": "^6.9.0",
34+
"@typescript-eslint/parser": "^6.9.0",
3535
"ava": "^5.3.1",
3636
"benchmark": "^2.1.4",
3737
"codecov": "^3.8.3",
3838
"cross-env": "^7.0.3",
39-
"eslint": "^8.46.0",
39+
"eslint": "^8.52.0",
4040
"eslint-config-prettier": "^9.0.0",
41-
"eslint-plugin-import": "^2.28.0",
42-
"eslint-plugin-prettier": "^5.0.0",
41+
"eslint-plugin-import": "^2.29.0",
42+
"eslint-plugin-prettier": "^5.0.1",
4343
"husky": "^8.0.3",
44-
"lerna": "^7.1.4",
45-
"lint-staged": "^15.0.0",
44+
"lerna": "^7.4.1",
45+
"lint-staged": "^15.0.2",
4646
"npm-run-all": "^4.1.5",
47-
"prettier": "^3.0.0",
47+
"prettier": "^3.0.3",
4848
"ts-node": "^10.9.1",
49-
"tslib": "^2.6.1",
50-
"typescript": "^5.1.6"
49+
"tslib": "^2.6.2",
50+
"typescript": "^5.2.2"
5151
},
5252
"lint-staged": {
5353
"*.@(js|ts|tsx)": [

packages/argon2/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ version = "0.0.0"
77
crate-type = ["cdylib"]
88

99
[dependencies]
10-
argon2 = "0.5"
10+
argon2 = { version = "0.5", features = ["rand"] }
1111
global_alloc = { path = "../../crates/alloc" }
1212
napi = { version = "2", default-features = false, features = ["napi3"] }
1313
napi-derive = { version = "2", default-features = false, features = [
1414
"type-def",
1515
] }
16-
rand = { version = "0.8", features = ["nightly", "simd_support", "getrandom"] }
16+
rand_core = { version = "0.6", features = ["getrandom"] }
1717

1818
[build-dependencies]
1919
napi-build = "2"

packages/argon2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
},
5656
"devDependencies": {
5757
"@napi-rs/cli": "2.16.3",
58-
"argon2": "^0.31.0",
58+
"argon2": "^0.31.1",
5959
"cross-env": "^7.0.3"
6060
}
6161
}

packages/argon2/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ use napi::bindgen_prelude::*;
77
use napi_derive::napi;
88

99
use argon2::{
10-
password_hash::{rand_core::OsRng, PasswordHasher, PasswordVerifier, SaltString},
10+
password_hash::{PasswordHasher, PasswordVerifier, SaltString},
1111
Argon2, Params,
1212
};
13+
use rand_core::OsRng;
1314

1415
#[napi]
1516
pub enum Algorithm {

packages/bcrypt/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
},
6969
"devDependencies": {
7070
"@napi-rs/cli": "2.16.3",
71-
"@types/bcrypt": "^5.0.0",
72-
"bcrypt": "^5.1.0",
71+
"@types/bcrypt": "^5.0.1",
72+
"bcrypt": "^5.1.1",
7373
"bcryptjs": "^2.4.3",
7474
"cross-env": "^7.0.3"
7575
},

packages/crc32/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
},
6363
"devDependencies": {
6464
"@napi-rs/cli": "2.16.3",
65-
"@types/crc": "^3.8.0",
65+
"@types/crc": "^3.8.2",
6666
"buffer": "^6.0.3",
6767
"crc": "^4.3.2",
6868
"sse4_crc32": "^7.0.0"

packages/deno-lint/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@
7070
},
7171
"dependencies": {
7272
"clipanion": "^3.2.1",
73-
"typanion": "^3.13.0"
73+
"typanion": "^3.14.0"
7474
},
7575
"devDependencies": {
7676
"@napi-rs/cli": "2.16.3",
77-
"@types/webpack": "^5.28.1"
77+
"@types/webpack": "^5.28.4"
7878
},
7979
"funding": {
8080
"type": "github",

packages/jsonwebtoken/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ napi = { version = "2", default-features = false, features = [
1515
"serde-json",
1616
] }
1717
napi-derive = { version = "2" }
18-
rand = "0.8"
18+
rand_core = { version = "0.6", features = ["std"] }
1919
serde = "1.0"
2020
serde_json = "1.0"
2121

packages/jsonwebtoken/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"aarch64-linux-android",
2626
"aarch64-unknown-linux-gnu",
2727
"aarch64-unknown-linux-musl",
28+
"aarch64-pc-windows-msvc",
2829
"armv7-unknown-linux-gnueabihf",
2930
"x86_64-unknown-linux-musl",
3031
"x86_64-unknown-freebsd",
@@ -62,7 +63,7 @@
6263
},
6364
"devDependencies": {
6465
"@napi-rs/cli": "2.16.3",
65-
"@types/jsonwebtoken": "^9.0.2",
66-
"jsonwebtoken": "^9.0.1"
66+
"@types/jsonwebtoken": "^9.0.4",
67+
"jsonwebtoken": "^9.0.2"
6768
}
6869
}

packages/jsonwebtoken/src/sign.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
use jsonwebtoken::{self};
21
use napi::{bindgen_prelude::*, JsBuffer, JsBufferValue, Ref};
32
use napi_derive::napi;
4-
use std::borrow::Borrow;
53

64
use crate::{claims::Claims, header::Header};
75

@@ -68,7 +66,7 @@ pub struct SignTask {
6866
impl SignTask {
6967
#[inline]
7068
pub fn sign(claims: &Claims, header: &Header, key: &[u8]) -> Result<String> {
71-
let header: &jsonwebtoken::Header = &header.borrow().into();
69+
let header: &jsonwebtoken::Header = &header.into();
7270
let claims = &claims;
7371
let sign_key = &into_encoding_key(key, &header.alg)?;
7472

packages/jsonwebtoken/src/verify.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use napi::{bindgen_prelude::*, JsBuffer, JsBufferValue, Ref};
22
use napi_derive::napi;
3-
use std::borrow::Borrow;
43

54
use crate::{claims::Claims, validation::Validation};
65

@@ -66,7 +65,7 @@ pub struct VerifyTask {
6665

6766
impl VerifyTask {
6867
pub fn verify(token: &str, key: &[u8], validation: &Validation) -> Result<Claims> {
69-
let validation: &jsonwebtoken::Validation = &validation.borrow().into();
68+
let validation: &jsonwebtoken::Validation = &validation.into();
7069

7170
let first_alg = validation.algorithms.first().ok_or(Error::new(
7271
Status::InvalidArg,
@@ -112,7 +111,7 @@ pub fn verify(
112111
VerifyTask {
113112
token,
114113
key: AsyncKeyInput::from_either(key)?,
115-
validation: validation.unwrap_or(Validation::default()),
114+
validation: validation.unwrap_or_default(),
116115
},
117116
abort_signal,
118117
))
@@ -124,6 +123,6 @@ pub fn verify_sync(
124123
key: Either<String, Buffer>,
125124
validation: Option<Validation>,
126125
) -> Result<Claims> {
127-
let validation = validation.unwrap_or(Validation::default());
126+
let validation = validation.unwrap_or_default();
128127
VerifyTask::verify(&token, key.as_ref(), &validation)
129128
}

packages/xxhash/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
},
6565
"devDependencies": {
6666
"@napi-rs/cli": "2.16.3",
67-
"@types/xxhashjs": "^0.2.2",
68-
"webpack": "^5.88.2",
67+
"@types/xxhashjs": "^0.2.3",
68+
"webpack": "^5.89.0",
6969
"xxhash": "^0.3.0",
7070
"xxhashjs": "^0.2.2"
7171
},

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2023-07-19
1+
nightly-2023-10-25

0 commit comments

Comments
 (0)