Skip to content

Commit 5edf580

Browse files
committed
chore: refresh the infra
1 parent 0313600 commit 5edf580

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+873
-1227
lines changed

.github/workflows/ci.yaml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,60 @@ jobs:
4242
run: yarn lint
4343

4444
- name: TypeCheck
45-
run: yarn typecheck
45+
run: yarn build:ts
4646

4747
- name: Cargo fmt
4848
run: cargo fmt -- --check
4949

5050
- name: Clippy
5151
run: cargo clippy
52+
bench:
53+
name: Bench
54+
runs-on: ${{ matrix.settings.host }}
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
settings:
59+
- target: 'x86_64-unknown-linux-gnu'
60+
host: ubuntu-latest
61+
- target: 'aarch64-apple-darwin'
62+
host: macos-latest
63+
steps:
64+
- uses: actions/checkout@v4
65+
66+
- name: Setup node
67+
uses: actions/setup-node@v4
68+
with:
69+
node-version: 20
70+
71+
- name: Cache cargo registry
72+
uses: actions/cache@v4
73+
with:
74+
path: |
75+
~/.cargo/registry
76+
~/.cargo/git
77+
~/.napi-rs
78+
target
79+
key: bench-cargo-registry-${{ matrix.settings.target }}
80+
81+
- name: Install
82+
uses: ./.github/actions/setup-rust
83+
with:
84+
targets: ${{ matrix.settings.target }}
85+
86+
- name: Setup macos
87+
if: ${{ matrix.settings.host == 'macos-latest' }}
88+
run: brew install python-setuptools
89+
90+
- name: 'Install dependencies'
91+
run: yarn install
92+
93+
- name: build
94+
run: yarn build
95+
96+
- name: Bench
97+
run: yarn workspaces foreach -A -j 1 --no-private run bench
98+
5299
build:
53100
strategy:
54101
fail-fast: false
@@ -578,6 +625,7 @@ jobs:
578625
runs-on: ubuntu-latest
579626
needs:
580627
- lint
628+
- bench
581629
- build-freebsd
582630
- test-linux-x64-gnu-binding
583631
- test-linux-x64-musl-binding

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ resolver = "2"
2323
rand_core = { version = "0.6", features = ["getrandom"] }
2424
serde = "1.0"
2525
serde_json = "1.0"
26-
xxhash-rust = { version = "0.8", features = ["xxh32", "xxh64", "xxh3"] }
26+
xxhash-rust = { version = "0.8", features = ["xxh32", "const_xxh32", "xxh64", "const_xxh64", "xxh3", "const_xxh3"] }
2727
[profile.release]
2828
codegen-units = 1
2929
lto = true

ava.config.mjs

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

depracted/deno-lint/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"typanion": "^3.14.0"
7474
},
7575
"devDependencies": {
76-
"@napi-rs/cli": "^3.0.0-alpha.63",
76+
"@napi-rs/cli": "^3.0.0-alpha.64",
7777
"@types/webpack": "^5.28.5"
7878
},
7979
"funding": {

package.json

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,30 @@
1111
],
1212
"scripts": {
1313
"artifacts": "yarn workspaces foreach -A --no-private run artifacts",
14-
"bench": "lerna run bench --concurrency 1 --stream --no-prefix",
1514
"build": "yarn workspaces foreach -A --no-private -j 1 run build",
16-
"build:ts": "tsc -b tsconfig.project.json -verbose",
15+
"build:ts": "tsc -b tsconfig.json -verbose",
1716
"lint": "oxlint .",
1817
"test": "ava",
1918
"format": "run-p format:prettier format:rs format:toml",
2019
"format:prettier": "prettier --config ./package.json -w .",
2120
"format:rs": "cargo fmt --all",
2221
"format:toml": "taplo format",
23-
"typecheck": "tsc -b tsconfig.project.json -verbose",
2422
"postinstall": "husky install"
2523
},
2624
"devDependencies": {
27-
"@napi-rs/cli": "^3.0.0-alpha.63",
25+
"@napi-rs/cli": "^3.0.0-alpha.64",
2826
"@napi-rs/wasm-runtime": "^0.2.5",
29-
"@swc-node/core": "^1.13.3",
30-
"@swc-node/register": "^1.10.9",
31-
"@swc/core": "^1.7.26",
3227
"@taplo/cli": "^0.7.0",
3328
"@tybys/wasm-util": "^0.9.0",
3429
"@types/node": "^22.7.4",
3530
"ava": "^6.1.3",
36-
"benchmark": "^2.1.4",
37-
"codecov": "^3.8.3",
3831
"cross-env": "^7.0.3",
3932
"husky": "^9.1.6",
4033
"lerna": "^8.1.8",
4134
"lint-staged": "^15.2.10",
4235
"npm-run-all2": "^7.0.0",
4336
"oxlint": "^0.10.0",
4437
"prettier": "^3.3.3",
45-
"ts-node": "^10.9.2",
4638
"tslib": "^2.7.0",
4739
"typescript": "^5.6.2"
4840
},
@@ -60,6 +52,20 @@
6052
"cargo fmt --"
6153
]
6254
},
55+
"ava": {
56+
"extensions": {
57+
"ts": "module"
58+
},
59+
"nodeArguments": [
60+
"--import",
61+
"@oxc-node/core/register"
62+
],
63+
"timeout": "1m",
64+
"cache": false,
65+
"files": [
66+
"packages/*/__test__/**/*.spec.ts"
67+
]
68+
},
6369
"prettier": {
6470
"printWidth": 120,
6571
"semi": false,

packages/argon2/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ It has a simple design aimed at the highest memory filling rate and effective us
2929

3030
# Benchmarks
3131

32-
See [benchmark/](benchmark/argon2.js).
32+
See [benchmark/](benchmark/argon2.ts).
3333

3434
## API
3535

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}

packages/argon2/benchmark/argon2.js renamed to packages/argon2/benchmark/argon2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const HASHED = await hash(PASSWORD, {
1313
parallelism: CORES,
1414
})
1515

16-
const bench = new Bench('Hash with all cores')
16+
const bench = new Bench()
1717

1818
bench
1919
.add('@node-rs/argon hash', async () => {

packages/argon2/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
// prettier-ignore
22
/* eslint-disable */
3+
// @ts-nocheck
34
/* auto-generated by NAPI-RS */
45

5-
const { readFileSync } = require('fs')
6+
const { createRequire } = require('node:module')
7+
require = createRequire(__filename)
68

9+
const { readFileSync } = require('node:fs')
710
let nativeBinding = null
811
const loadErrors = []
912

packages/argon2/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@
5555
},
5656
"scripts": {
5757
"artifacts": "napi artifacts -d ../../artifacts",
58-
"bench": "cross-env NODE_ENV=production node benchmark/argon2.js",
58+
"bench": "cross-env NODE_ENV=production node --import @oxc-node/core/register benchmark/argon2.ts",
5959
"build": "napi build --platform --release",
6060
"build:debug": "napi build --platform",
6161
"prepublishOnly": "napi prepublish",
6262
"version": "napi version && git add npm"
6363
},
6464
"devDependencies": {
65-
"@napi-rs/cli": "^3.0.0-alpha.63",
65+
"@napi-rs/cli": "^3.0.0-alpha.64",
6666
"argon2": "^0.41.0",
6767
"cross-env": "^7.0.3",
6868
"tinybench": "^2.9.0"

0 commit comments

Comments
 (0)