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
26 changes: 9 additions & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: CI
env:
DEBUG: 'napi:*'

on:
push:
Expand Down Expand Up @@ -188,7 +190,7 @@ jobs:
path: artifacts

- name: Move artifacts
run: node scripts/mv-artifacts.js
run: yarn artifacts
shell: bash

- name: Test bindings
Expand All @@ -214,25 +216,22 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: 'Install dependencies'
run: yarn install --frozen-lockfile --ignore-scripts --registry https://registry.npmjs.org

- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: bindings-linux-musl
path: artifacts

- name: Move artifacts
run: node scripts/mv-artifacts.js
shell: bash
env:
MOVE_TARGET: linux-musl
run: yarn artifacts

- name: List packages
run: ls -R packages
shell: bash

- name: 'Install dependencies'
run: yarn install --frozen-lockfile --ignore-scripts --registry https://registry.npmjs.org

- name: Build TypeScript
run: yarn build:ts

Expand Down Expand Up @@ -287,19 +286,11 @@ jobs:
shell: bash

- name: Move artifacts
run: node scripts/mv-artifacts.js
env:
MOVE_TARGET: all
run: yarn artifacts

- name: Build TypeScript
run: yarn build:ts

- name: Upload artifacts to Github release
run: |
node scripts/upload-to-release.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: List packages
run: ls -R packages
shell: bash
Expand All @@ -310,3 +301,4 @@ jobs:
npx lerna publish from-package --no-verify-access --yes
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,4 @@ temp/

*.node
lib
artifacts
18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"private": true,
"workspaces": ["packages/*"],
"scripts": {
"artifacts": "napi artifacts",
"bench": "lerna run bench --concurrency 1 --stream --no-prefix",
"build:ts": "tsc -b tsconfig.project.json -verbose",
"lint": "eslint . -c ./.eslintrc.yml 'packages/**/*.{ts,js}'",
Expand All @@ -20,32 +21,29 @@
"typecheck": "tsc -b tsconfig.project.json -verbose"
},
"devDependencies": {
"@octokit/rest": "^18.0.4",
"@swc-node/register": "^0.4.3",
"@typescript-eslint/eslint-plugin": "^4.0.0",
"@typescript-eslint/parser": "^3.10.1",
"@swc-node/register": "^0.4.5",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"ava": "^3.12.1",
"benchmark": "^2.1.4",
"chalk": "^4.1.0",
"codecov": "^3.7.2",
"cross-env": "^7.0.2",
"eslint": "^7.7.0",
"eslint": "^7.8.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-sonarjs": "^0.5.0",
"husky": "^4.2.5",
"lerna": "^3.22.1",
"lint-staged": "^10.2.13",
"napi-rs": "^0.2.6",
"lint-staged": "^10.3.0",
"napi-rs": "^0.3.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"prettier": "^2.1.1",
"putasset": "^5.0.3",
"typescript": "^4.0.2"
},
"optionalDependencies": {
"@swc-node/core-linux-musl": "^0.6.0"
"@swc-node/core-linux-musl": "^0.6.1"
},
"ava": {
"extensions": ["ts"],
Expand Down
7 changes: 5 additions & 2 deletions packages/bcrypt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ crate-type = ["cdylib"]
radix64 = "0.6"
blowfish = { version = "0.6", features = ["bcrypt"] }
byteorder = "1"
napi = { version = "0.4"}
napi-derive = { version = "0.4.2" }
napi = { version = "0.5" }
napi-derive = { version = "0.5" }
rand = "0.7"
phf = { version = "0.8", features = ["macros"] }

[target.'cfg(all(unix, not(target_env = "musl")))'.dependencies]
jemallocator = { version = "0.3", features = ["disable_initial_exec_tls"] }

[target.'cfg(windows)'.dependencies]
mimalloc = { version = "0.1" }

[dev-dependencies]
quickcheck = "0.9"

Expand Down
2 changes: 1 addition & 1 deletion packages/bcrypt/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { loadBinding } = require('@node-rs/helper')

const binding = loadBinding(__dirname, 'bcrypt')
const binding = loadBinding(__dirname, 'bcrypt', '@node-rs/bcrypt')

const DEFAULT_COST = 12

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

this is the **darwin** 64-bit binary for `@node-rs/bcrypt`
40 changes: 40 additions & 0 deletions packages/bcrypt/npm/darwin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "@node-rs/bcrypt-darwin",
"version": "0.4.1",
"os": [
"darwin"
],
"main": "bcrypt.darwin.node",
"files": [
"bcrypt.darwin.node"
],
"description": "Rust bcrypt binding",
"keywords": [
"bcrypt",
"auth",
"password",
"authentication",
"encryption",
"crypto",
"N-API",
"napi-rs",
"node-rs"
],
"author": "LongYinan <lynweklm@gmail.com>",
"homepage": "https://github.com/napi-rs/node-rs",
"license": "MIT",
"engines": {
"node": ">= 8.9"
},
"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"
}
}
3 changes: 3 additions & 0 deletions packages/bcrypt/npm/linux-musl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
`#@node-rs/bcrypt-linux-musl`

this is the **linux-musl** 64-bit binary for `@node-rs/bcrypt`
40 changes: 40 additions & 0 deletions packages/bcrypt/npm/linux-musl/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "@node-rs/bcrypt-linux-musl",
"version": "0.4.1",
"os": [
"linux-musl"
],
"main": "bcrypt.linux-musl.node",
"files": [
"bcrypt.linux-musl.node"
],
"description": "Rust bcrypt binding",
"keywords": [
"bcrypt",
"auth",
"password",
"authentication",
"encryption",
"crypto",
"N-API",
"napi-rs",
"node-rs"
],
"author": "LongYinan <lynweklm@gmail.com>",
"homepage": "https://github.com/napi-rs/node-rs",
"license": "MIT",
"engines": {
"node": ">= 8.9"
},
"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"
}
}
3 changes: 3 additions & 0 deletions packages/bcrypt/npm/linux/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
`#@node-rs/bcrypt-linux`

this is the **linux** 64-bit binary for `@node-rs/bcrypt`
40 changes: 40 additions & 0 deletions packages/bcrypt/npm/linux/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "@node-rs/bcrypt-linux",
"version": "0.4.1",
"os": [
"linux"
],
"main": "bcrypt.linux.node",
"files": [
"bcrypt.linux.node"
],
"description": "Rust bcrypt binding",
"keywords": [
"bcrypt",
"auth",
"password",
"authentication",
"encryption",
"crypto",
"N-API",
"napi-rs",
"node-rs"
],
"author": "LongYinan <lynweklm@gmail.com>",
"homepage": "https://github.com/napi-rs/node-rs",
"license": "MIT",
"engines": {
"node": ">= 8.9"
},
"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"
}
}
3 changes: 3 additions & 0 deletions packages/bcrypt/npm/win32/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
`#@node-rs/bcrypt-win32`

this is the **win32** 64-bit binary for `@node-rs/bcrypt`
40 changes: 40 additions & 0 deletions packages/bcrypt/npm/win32/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "@node-rs/bcrypt-win32",
"version": "0.4.1",
"os": [
"win32"
],
"main": "bcrypt.win32.node",
"files": [
"bcrypt.win32.node"
],
"description": "Rust bcrypt binding",
"keywords": [
"bcrypt",
"auth",
"password",
"authentication",
"encryption",
"crypto",
"N-API",
"napi-rs",
"node-rs"
],
"author": "LongYinan <lynweklm@gmail.com>",
"homepage": "https://github.com/napi-rs/node-rs",
"license": "MIT",
"engines": {
"node": ">= 8.9"
},
"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"
}
}
12 changes: 9 additions & 3 deletions packages/bcrypt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
"license": "MIT",
"main": "index.js",
"typings": "index.d.ts",
"files": ["index.js", "index.d.ts", "*.node", "LICENSE", "LICENSE.rust-bcrypt"],
"files": ["index.js", "index.d.ts", "LICENSE", "LICENSE.rust-bcrypt"],
"os": ["darwin", "linux", "win32"],
"napi": {
"name": "bcrypt",
"musl": ["linux"]
},
"engines": {
"node": ">= 8.9"
},
Expand All @@ -23,8 +27,10 @@
},
"scripts": {
"bench": "cross-env NODE_ENV=production node benchmark/bcrypt.js",
"build": "napi build --platform --release ./bcrypt",
"build:debug": "napi build --platform ./bcrypt"
"build": "napi build --platform --release",
"build:debug": "napi build --platform",
"prepublishOnly": "napi prepublish",
"version": "napi version"
},
"bugs": {
"url": "https://github.com/napi-rs/node-rs/issues"
Expand Down
4 changes: 4 additions & 0 deletions packages/bcrypt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ mod verify_task;
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

#[cfg(windows)]
#[global_allocator]
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;

mod b64;
mod bcrypt;
mod errors;
Expand Down
7 changes: 5 additions & 2 deletions packages/crc32/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ edition = "2018"
crate-type = ["cdylib"]

[dependencies]
napi = { version = "0.4" }
napi-derive = { version = "0.4.2" }
napi = { version = "0.5" }
napi-derive = { version = "0.5" }
crc32fast = "1.2"

[target.'cfg(all(unix, not(target_env = "musl")))'.dependencies]
jemallocator = { version = "0.3", features = ["disable_initial_exec_tls"] }

[target.'cfg(windows)'.dependencies]
mimalloc = { version = "0.1" }

[build-dependencies]
napi-build = { version = "0.2" }
Loading