Skip to content

Commit b60d099

Browse files
authored
Merge pull request #132 from napi-rs/napi-cli
build: upgrade to new napi
2 parents b130865 + 4414a23 commit b60d099

Some content is hidden

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

52 files changed

+822
-426
lines changed

.github/workflows/ci.yaml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: CI
2+
env:
3+
DEBUG: 'napi:*'
24

35
on:
46
push:
@@ -188,7 +190,7 @@ jobs:
188190
path: artifacts
189191

190192
- name: Move artifacts
191-
run: node scripts/mv-artifacts.js
193+
run: yarn artifacts
192194
shell: bash
193195

194196
- name: Test bindings
@@ -214,25 +216,22 @@ jobs:
214216
steps:
215217
- uses: actions/checkout@v2
216218

219+
- name: 'Install dependencies'
220+
run: yarn install --frozen-lockfile --ignore-scripts --registry https://registry.npmjs.org
221+
217222
- name: Download artifacts
218223
uses: actions/download-artifact@v2
219224
with:
220225
name: bindings-linux-musl
221226
path: artifacts
222227

223228
- name: Move artifacts
224-
run: node scripts/mv-artifacts.js
225-
shell: bash
226-
env:
227-
MOVE_TARGET: linux-musl
229+
run: yarn artifacts
228230

229231
- name: List packages
230232
run: ls -R packages
231233
shell: bash
232234

233-
- name: 'Install dependencies'
234-
run: yarn install --frozen-lockfile --ignore-scripts --registry https://registry.npmjs.org
235-
236235
- name: Build TypeScript
237236
run: yarn build:ts
238237

@@ -287,19 +286,11 @@ jobs:
287286
shell: bash
288287

289288
- name: Move artifacts
290-
run: node scripts/mv-artifacts.js
291-
env:
292-
MOVE_TARGET: all
289+
run: yarn artifacts
293290

294291
- name: Build TypeScript
295292
run: yarn build:ts
296293

297-
- name: Upload artifacts to Github release
298-
run: |
299-
node scripts/upload-to-release.js
300-
env:
301-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
302-
303294
- name: List packages
304295
run: ls -R packages
305296
shell: bash
@@ -310,3 +301,4 @@ jobs:
310301
npx lerna publish from-package --no-verify-access --yes
311302
env:
312303
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
304+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,4 @@ temp/
178178

179179
*.node
180180
lib
181+
artifacts

package.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"private": true,
99
"workspaces": ["packages/*"],
1010
"scripts": {
11+
"artifacts": "napi artifacts",
1112
"bench": "lerna run bench --concurrency 1 --stream --no-prefix",
1213
"build:ts": "tsc -b tsconfig.project.json -verbose",
1314
"lint": "eslint . -c ./.eslintrc.yml 'packages/**/*.{ts,js}'",
@@ -20,32 +21,29 @@
2021
"typecheck": "tsc -b tsconfig.project.json -verbose"
2122
},
2223
"devDependencies": {
23-
"@octokit/rest": "^18.0.4",
24-
"@swc-node/register": "^0.4.3",
25-
"@typescript-eslint/eslint-plugin": "^4.0.0",
26-
"@typescript-eslint/parser": "^3.10.1",
24+
"@swc-node/register": "^0.4.5",
25+
"@typescript-eslint/eslint-plugin": "^4.0.1",
26+
"@typescript-eslint/parser": "^4.0.1",
2727
"ava": "^3.12.1",
2828
"benchmark": "^2.1.4",
29-
"chalk": "^4.1.0",
3029
"codecov": "^3.7.2",
3130
"cross-env": "^7.0.2",
32-
"eslint": "^7.7.0",
31+
"eslint": "^7.8.1",
3332
"eslint-config-prettier": "^6.11.0",
3433
"eslint-plugin-import": "^2.22.0",
3534
"eslint-plugin-prettier": "^3.1.4",
3635
"eslint-plugin-sonarjs": "^0.5.0",
3736
"husky": "^4.2.5",
3837
"lerna": "^3.22.1",
39-
"lint-staged": "^10.2.13",
40-
"napi-rs": "^0.2.6",
38+
"lint-staged": "^10.3.0",
39+
"napi-rs": "^0.3.0",
4140
"npm-run-all": "^4.1.5",
4241
"nyc": "^15.1.0",
4342
"prettier": "^2.1.1",
44-
"putasset": "^5.0.3",
4543
"typescript": "^4.0.2"
4644
},
4745
"optionalDependencies": {
48-
"@swc-node/core-linux-musl": "^0.6.0"
46+
"@swc-node/core-linux-musl": "^0.6.1"
4947
},
5048
"ava": {
5149
"extensions": ["ts"],

packages/bcrypt/Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ crate-type = ["cdylib"]
1111
radix64 = "0.6"
1212
blowfish = { version = "0.6", features = ["bcrypt"] }
1313
byteorder = "1"
14-
napi = { version = "0.4"}
15-
napi-derive = { version = "0.4.2" }
14+
napi = { version = "0.5" }
15+
napi-derive = { version = "0.5" }
1616
rand = "0.7"
1717
phf = { version = "0.8", features = ["macros"] }
1818

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

22+
[target.'cfg(windows)'.dependencies]
23+
mimalloc = { version = "0.1" }
24+
2225
[dev-dependencies]
2326
quickcheck = "0.9"
2427

packages/bcrypt/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const { loadBinding } = require('@node-rs/helper')
22

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

55
const DEFAULT_COST = 12
66

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
`#@node-rs/bcrypt-darwin`
2+
3+
this is the **darwin** 64-bit binary for `@node-rs/bcrypt`
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "@node-rs/bcrypt-darwin",
3+
"version": "0.4.1",
4+
"os": [
5+
"darwin"
6+
],
7+
"main": "bcrypt.darwin.node",
8+
"files": [
9+
"bcrypt.darwin.node"
10+
],
11+
"description": "Rust bcrypt binding",
12+
"keywords": [
13+
"bcrypt",
14+
"auth",
15+
"password",
16+
"authentication",
17+
"encryption",
18+
"crypto",
19+
"N-API",
20+
"napi-rs",
21+
"node-rs"
22+
],
23+
"author": "LongYinan <[email protected]>",
24+
"homepage": "https://github.com/napi-rs/node-rs",
25+
"license": "MIT",
26+
"engines": {
27+
"node": ">= 8.9"
28+
},
29+
"publishConfig": {
30+
"registry": "https://registry.npmjs.org/",
31+
"access": "public"
32+
},
33+
"repository": {
34+
"type": "git",
35+
"url": "git+https://github.com/napi-rs/node-rs.git"
36+
},
37+
"bugs": {
38+
"url": "https://github.com/napi-rs/node-rs/issues"
39+
}
40+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
`#@node-rs/bcrypt-linux-musl`
2+
3+
this is the **linux-musl** 64-bit binary for `@node-rs/bcrypt`
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "@node-rs/bcrypt-linux-musl",
3+
"version": "0.4.1",
4+
"os": [
5+
"linux-musl"
6+
],
7+
"main": "bcrypt.linux-musl.node",
8+
"files": [
9+
"bcrypt.linux-musl.node"
10+
],
11+
"description": "Rust bcrypt binding",
12+
"keywords": [
13+
"bcrypt",
14+
"auth",
15+
"password",
16+
"authentication",
17+
"encryption",
18+
"crypto",
19+
"N-API",
20+
"napi-rs",
21+
"node-rs"
22+
],
23+
"author": "LongYinan <[email protected]>",
24+
"homepage": "https://github.com/napi-rs/node-rs",
25+
"license": "MIT",
26+
"engines": {
27+
"node": ">= 8.9"
28+
},
29+
"publishConfig": {
30+
"registry": "https://registry.npmjs.org/",
31+
"access": "public"
32+
},
33+
"repository": {
34+
"type": "git",
35+
"url": "git+https://github.com/napi-rs/node-rs.git"
36+
},
37+
"bugs": {
38+
"url": "https://github.com/napi-rs/node-rs/issues"
39+
}
40+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
`#@node-rs/bcrypt-linux`
2+
3+
this is the **linux** 64-bit binary for `@node-rs/bcrypt`

0 commit comments

Comments
 (0)