Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
exclude = ["node_modules/**/*.toml"]

# https://taplo.tamasfe.dev/configuration/formatter-options.html
[formatting]
align_entries = true
indent_tables = true
reorder_keys = true
28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ 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.3.1.cjs
47 changes: 24 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,30 @@ Make rust crates binding to Node.js use [napi-rs](https://github.com/napi-rs/nap

# Support matrix

| | node12 | node14 | node16 | node18 |
| --------------------- | ------ | ------ | ------ | ------ |
| Windows x64 | ✓ | ✓ | ✓ | ✓ |
| Windows x32 | ✓ | ✓ | ✓ | ✓ |
| Windows arm64 | ✓ | ✓ | ✓ | ✓ |
| macOS x64 | ✓ | ✓ | ✓ | ✓ |
| macOS arm64 (m chips) | ✓ | ✓ | ✓ | ✓ |
| Linux x64 gnu | ✓ | ✓ | ✓ | ✓ |
| Linux x64 musl | ✓ | ✓ | ✓ | ✓ |
| Linux arm gnu | ✓ | ✓ | ✓ | ✓ |
| Linux arm64 gnu | ✓ | ✓ | ✓ | ✓ |
| Linux arm64 musl | ✓ | ✓ | ✓ | ✓ |
| Android arm64 | ✓ | ✓ | ✓ | ✓ |
| Android armv7 | ✓ | ✓ | ✓ | ✓ |
| FreeBSD x64 | ✓ | ✓ | ✓ | ✓ |
| | node12 | node14 | node16 | node18 |
| ---------------------------- | ------ | ------ | ------ | ------ |
| Windows x64 | ✓ | ✓ | ✓ | ✓ |
| Windows x32 | ✓ | ✓ | ✓ | ✓ |
| Windows arm64 | ✓ | ✓ | ✓ | ✓ |
| macOS x64 | ✓ | ✓ | ✓ | ✓ |
| macOS arm64 (m chips) | ✓ | ✓ | ✓ | ✓ |
| Linux x64 gnu (glibc 2.17) | ✓ | ✓ | ✓ | ✓ |
| Linux x64 musl | ✓ | ✓ | ✓ | ✓ |
| Linux arm gnu (glibc 2.17) | ✓ | ✓ | ✓ | ✓ |
| Linux arm64 gnu (glibc 2.17) | ✓ | ✓ | ✓ | ✓ |
| Linux arm64 musl | ✓ | ✓ | ✓ | ✓ |
| Android arm64 | ✓ | ✓ | ✓ | ✓ |
| Android armv7 | ✓ | ✓ | ✓ | ✓ |
| FreeBSD x64 | ✓ | ✓ | ✓ | ✓ |

# Packages

| Package | Version | Downloads | Description |
| -------------------------------------------- | -------------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| [`@node-rs/crc32`](./packages/crc32) | ![](https://img.shields.io/npm/v/@node-rs/crc32.svg) | ![](https://img.shields.io/npm/dm/@node-rs/crc32.svg?sanitize=true) | Fastest `CRC32` implementation using `SIMD` |
| [`@node-rs/jieba`](./packages/jieba) | ![](https://img.shields.io/npm/v/@node-rs/jieba.svg) | ![](https://img.shields.io/npm/dm/@node-rs/jieba.svg?sanitize=true) | [`jieba-rs`](https://github.com/messense/jieba-rs) binding |
| [`@node-rs/bcrypt`](./packages/bcrypt) | ![](https://img.shields.io/npm/v/@node-rs/bcrypt.svg) | ![](https://img.shields.io/npm/dm/@node-rs/bcrypt.svg?sanitize=true) | Fastest bcrypt implementation |
| [`@node-rs/deno-lint`](./packages/deno-lint) | ![](https://img.shields.io/npm/v/@node-rs/deno-lint.svg) | ![](https://img.shields.io/npm/dm/@node-rs/deno-lint.svg?sanitize=true) | [deno_lint](https://github.com/denoland/deno_lint) Node.js binding |
| [`@node-rs/xxhash`](./packages/xxhash) | ![](https://img.shields.io/npm/v/@node-rs/xxhash.svg) | ![](https://img.shields.io/npm/dm/@node-rs/xxhash.svg?sanitize=true) | [`xxhash-rust`](https://github.com/DoumanAsh/xxhash-rust) Node.js binding |
| [`@node-rs/argon2`](./packages/argon2) | ![](https://img.shields.io/npm/v/@node-rs/argon2.svg) | ![](https://img.shields.io/npm/dm/@node-rs/argon2.svg?sanitize=true) | [argon2](https://crates.io/crates/argon2) binding for Node.js. |
| Package | Version | Downloads | Description |
| -------------------------------------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| [`@node-rs/crc32`](./packages/crc32) | ![](https://img.shields.io/npm/v/@node-rs/crc32.svg) | ![](https://img.shields.io/npm/dm/@node-rs/crc32.svg?sanitize=true) | Fastest `CRC32` implementation using `SIMD` |
| [`@node-rs/jieba`](./packages/jieba) | ![](https://img.shields.io/npm/v/@node-rs/jieba.svg) | ![](https://img.shields.io/npm/dm/@node-rs/jieba.svg?sanitize=true) | [`jieba-rs`](https://github.com/messense/jieba-rs) binding |
| [`@node-rs/bcrypt`](./packages/bcrypt) | ![](https://img.shields.io/npm/v/@node-rs/bcrypt.svg) | ![](https://img.shields.io/npm/dm/@node-rs/bcrypt.svg?sanitize=true) | Fastest bcrypt implementation |
| [`@node-rs/deno-lint`](./packages/deno-lint) | ![](https://img.shields.io/npm/v/@node-rs/deno-lint.svg) | ![](https://img.shields.io/npm/dm/@node-rs/deno-lint.svg?sanitize=true) | [deno_lint](https://github.com/denoland/deno_lint) Node.js binding |
| [`@node-rs/xxhash`](./packages/xxhash) | ![](https://img.shields.io/npm/v/@node-rs/xxhash.svg) | ![](https://img.shields.io/npm/dm/@node-rs/xxhash.svg?sanitize=true) | [`xxhash-rust`](https://github.com/DoumanAsh/xxhash-rust) Node.js binding |
| [`@node-rs/argon2`](./packages/argon2) | ![](https://img.shields.io/npm/v/@node-rs/argon2.svg) | ![](https://img.shields.io/npm/dm/@node-rs/argon2.svg?sanitize=true) | [argon2](https://crates.io/crates/argon2) binding for Node.js. |
| [`@node-rs/jsonwebtoken`](./packages/jsonwebtoken) | ![](https://img.shields.io/npm/v/@node-rs/jsonwebtoken.svg) | ![](https://img.shields.io/npm/dm/@node-rs/jsonwebtoken.svg?sanitize=true) | [jsonwebtoken](https://github.com/Keats/jsonwebtoken) binding for Node.js. |
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"packages/*"
],
"scripts": {
"artifacts": "lerna run artifacts",
"artifacts": "yarn workspaces foreach --no-private run artifacts",
"bench": "lerna run bench --concurrency 1 --stream --no-prefix",
"build": "lerna run build --concurrency 1 --stream --no-prefix",
"build": "yarn workspaces foreach --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 @@ -24,30 +24,30 @@
"postinstall": "husky install"
},
"devDependencies": {
"@napi-rs/cli": "2.14.0",
"@swc-node/core": "^1.9.1",
"@swc-node/register": "^1.5.4",
"@swc/core": "^1.3.24",
"@napi-rs/cli": "2.14.8",
"@swc-node/core": "^1.10.1",
"@swc-node/register": "^1.6.2",
"@swc/core": "^1.3.37",
"@taplo/cli": "^0.5.2",
"@types/node": "^18.11.18",
"@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.48.0",
"ava": "^5.1.0",
"@types/node": "^18.14.6",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"ava": "^5.2.0",
"benchmark": "^2.1.4",
"codecov": "^3.8.3",
"cross-env": "^7.0.3",
"eslint": "^8.31.0",
"eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.2",
"lerna": "^6.3.0",
"lint-staged": "^13.1.0",
"husky": "^8.0.3",
"lerna": "^6.5.1",
"lint-staged": "^13.1.2",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.1",
"prettier": "^2.8.4",
"ts-node": "^10.9.1",
"tslib": "^2.4.1",
"typescript": "^4.9.4"
"tslib": "^2.5.0",
"typescript": "^4.9.5"
},
"lint-staged": {
"*.@(js|ts|tsx)": [
Expand Down
2 changes: 1 addition & 1 deletion packages/argon2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
"version": "napi version"
},
"devDependencies": {
"argon2": "^0.30.2"
"argon2": "^0.30.3"
}
}
2 changes: 1 addition & 1 deletion packages/crc32/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"devDependencies": {
"@types/crc": "^3.8.0",
"buffer": "^6.0.3",
"crc": "^4.2.0",
"crc": "^4.3.2",
"sse4_crc32": "^7.0.0"
},
"funding": {
Expand Down
26 changes: 13 additions & 13 deletions packages/deno-lint/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[package]
authors = ["LongYinan <lynweklm@gmail.com>"]
edition = "2021"
name = "deno-lint"
name = "deno-lint"
version = "0.1.0"

[lib]
crate-type = ["cdylib"]

[dependencies]
annotate-snippets = { version = "0.9", features = ["color"] }
anyhow = "1"
deno_ast = "=0.21.0"
deno_lint = "=0.35.0"
env_logger = "0.10"
global_alloc = { path = "../../crates/alloc" }
globwalk = "0.8"
ignore = "0.4"
miette = { version = "5", features = ["fancy-no-backtrace"] }
napi = { version = "2", default-features = false, features = ["napi3"] }
napi-derive = { version = "2" }
serde = "1"
serde_json = "1"
anyhow = "1"
deno_ast = "=0.24.0"
deno_lint = "=0.41.0"
env_logger = "0.10"
global_alloc = { path = "../../crates/alloc" }
globwalk = "0.8"
ignore = "0.4"
miette = { version = "5", features = ["fancy-no-backtrace"] }
napi = { version = "2", default-features = false, features = ["napi3"] }
napi-derive = { version = "2" }
serde = "1"
serde_json = "1"

[build-dependencies]
napi-build = "2"
2 changes: 1 addition & 1 deletion packages/deno-lint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"url": "https://github.com/napi-rs/node-rs/issues"
},
"dependencies": {
"clipanion": "^3.1.0",
"clipanion": "^3.2.0",
"typanion": "^3.12.1"
},
"devDependencies": {
Expand Down
5 changes: 2 additions & 3 deletions packages/deno-lint/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
use deno_lint::rules::{get_filtered_rules, LintRule};
use serde::Deserialize;
use std::path::Path;
use std::sync::Arc;

#[derive(Debug, Default, Deserialize)]
#[serde(default)]
Expand All @@ -27,7 +26,7 @@ pub struct Config {
}

impl Config {
pub fn get_rules(&self) -> Vec<Arc<dyn LintRule>> {
pub fn get_rules(&self) -> Vec<&'static dyn LintRule> {
get_filtered_rules(
Some(self.rules.tags.clone()),
Some(self.rules.exclude.clone()),
Expand Down Expand Up @@ -64,7 +63,7 @@ mod tests {
}}
}

fn into_codes(rules: Vec<Arc<dyn LintRule>>) -> HashSet<&'static str> {
fn into_codes(rules: Vec<&'static dyn LintRule>) -> HashSet<&'static str> {
rules.iter().map(|rule| rule.code()).collect()
}

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"downlevelIteration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"importHelpers": false,
"module": "CommonJS",
"moduleResolution": "node",
"newLine": "LF",
Expand Down
Loading