Skip to content

Commit

Permalink
chore: upgrade toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Oct 26, 2023
1 parent 8b0be16 commit fdecc8d
Show file tree
Hide file tree
Showing 19 changed files with 3,971 additions and 3,945 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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.0.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.0.cjs
6 changes: 3 additions & 3 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.0",
"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 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"
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
6 changes: 0 additions & 6 deletions packages/bcrypt/binding.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/* tslint:disable */
/* eslint-disable */
/* prettier-ignore */

/* auto-generated by NAPI-RS */

const { existsSync, readFileSync } = require('fs')
const { join } = require('path')

Expand Down
6 changes: 0 additions & 6 deletions packages/deno-lint/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/* tslint:disable */
/* eslint-disable */
/* prettier-ignore */

/* auto-generated by NAPI-RS */

const { existsSync, readFileSync } = require('fs')
const { join } = require('path')

Expand Down
6 changes: 0 additions & 6 deletions packages/jieba/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/* tslint:disable */
/* eslint-disable */
/* prettier-ignore */

/* auto-generated by NAPI-RS */

const { existsSync, readFileSync } = require('fs')
const { join } = require('path')

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
6 changes: 0 additions & 6 deletions packages/jsonwebtoken/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/* tslint:disable */
/* eslint-disable */
/* prettier-ignore */

/* auto-generated by NAPI-RS */

const { existsSync, readFileSync } = require('fs')
const { join } = require('path')

Expand Down
4 changes: 1 addition & 3 deletions packages/jsonwebtoken/src/sign.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use jsonwebtoken::{self};
use napi::{bindgen_prelude::*, JsBuffer, JsBufferValue, Ref};
use napi_derive::napi;
use std::borrow::Borrow;

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

Expand Down Expand Up @@ -68,7 +66,7 @@ pub struct SignTask {
impl SignTask {
#[inline]
pub fn sign(claims: &Claims, header: &Header, key: &[u8]) -> Result<String> {
let header: &jsonwebtoken::Header = &header.borrow().into();
let header: &jsonwebtoken::Header = &header.into();
let claims = &claims;
let sign_key = &into_encoding_key(key, &header.alg)?;

Expand Down
7 changes: 3 additions & 4 deletions packages/jsonwebtoken/src/verify.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use napi::{bindgen_prelude::*, JsBuffer, JsBufferValue, Ref};
use napi_derive::napi;
use std::borrow::Borrow;

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

Expand Down Expand Up @@ -66,7 +65,7 @@ pub struct VerifyTask {

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

let first_alg = validation.algorithms.first().ok_or(Error::new(
Status::InvalidArg,
Expand Down Expand Up @@ -112,7 +111,7 @@ pub fn verify(
VerifyTask {
token,
key: AsyncKeyInput::from_either(key)?,
validation: validation.unwrap_or(Validation::default()),
validation: validation.unwrap_or_default(),
},
abort_signal,
))
Expand All @@ -124,6 +123,6 @@ pub fn verify_sync(
key: Either<String, Buffer>,
validation: Option<Validation>,
) -> Result<Claims> {
let validation = validation.unwrap_or(Validation::default());
let validation = validation.unwrap_or_default();
VerifyTask::verify(&token, key.as_ref(), &validation)
}
6 changes: 0 additions & 6 deletions packages/xxhash/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/* tslint:disable */
/* eslint-disable */
/* prettier-ignore */

/* auto-generated by NAPI-RS */

const { existsSync, readFileSync } = require('fs')
const { join } = require('path')

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2023-07-19
nightly-2023-10-25
Loading

0 comments on commit fdecc8d

Please sign in to comment.