Skip to content

Commit 526a5b0

Browse files
committed
Merge branch 'master' into pr/391
2 parents bd4504c + 2f976d8 commit 526a5b0

File tree

96 files changed

+5743
-1206
lines changed

Some content is hidden

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

96 files changed

+5743
-1206
lines changed

.eslintrc

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
11
{
2-
"parser": "@typescript-eslint/parser",
32
"plugins": [
4-
"@typescript-eslint",
53
"prettier"
64
],
75
"extends": [
8-
"eslint:recommended",
9-
"plugin:@typescript-eslint/eslint-recommended",
10-
"plugin:@typescript-eslint/recommended",
116
"plugin:prettier/recommended",
12-
"prettier/@typescript-eslint"
7+
"eslint-config-atomic"
138
],
149
"rules": {
15-
"prettier/prettier": "error",
16-
"no-fallthrough": "error",
17-
"no-inner-declarations": "off",
18-
"no-prototype-builtins": "off",
19-
"no-unused-expressions": "warn",
20-
"prefer-const": ["warn", {"destructuring": "all"}],
21-
"@typescript-eslint/no-empty-interface": "off",
22-
"@typescript-eslint/no-non-null-assertion": "off",
23-
"@typescript-eslint/no-use-before-define": "off",
24-
"@typescript-eslint/no-explicit-any": "off",
25-
"@typescript-eslint/no-unused-vars": "off",
26-
"@typescript-eslint/explicit-function-return-type": "off",
27-
"@typescript-eslint/quotes": ["error", "double"],
28-
}
10+
"@typescript-eslint/quotes": ["error", "double"]
11+
},
12+
"ignorePatterns": ["node_modules/", "build/", "lib/", "libzmq/", "tmp/", "zmq/"]
2913
}

.github/workflows/CI.yml

Lines changed: 72 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ name: CI
22
on:
33
pull_request:
44
push:
5-
6-
defaults:
7-
run:
8-
shell: bash
5+
branches:
6+
- master
97

108
jobs:
119
Build:
@@ -16,28 +14,77 @@ jobs:
1614
matrix:
1715
os:
1816
- ubuntu-20.04
19-
- macos-latest
20-
- windows-latest
17+
- macos-11
18+
- windows-2019
2119
node_version:
2220
- 14
2321
node_arch:
2422
- x64
25-
include:
26-
- os: windows-latest
27-
node_version: 14
28-
node_arch: x86
29-
# - os: macos-11.0
30-
# node_version: 15
31-
# node_arch: arm64
23+
zmq_draft:
24+
- false
25+
zmq_shared:
26+
- false
27+
zmq_version:
28+
- 4.3.4
29+
skip_gc_finalizer_tests:
30+
- true
31+
32+
# include:
33+
# - os: windows-latest
34+
# node_version: 14
35+
# node_arch: x86
36+
# zmq_draft: false
37+
# zmq_shared: false
38+
# skip_gc_finalizer_tests: true
39+
40+
# - os: macos-11.0
41+
# node_version: 15
42+
# node_arch: arm64
43+
# zmq_draft: false
44+
# zmq_shared: false
45+
46+
env:
47+
ZMQ_VERSION: ${{ matrix.zmq_version }}
48+
ZMQ_DRAFT: ${{ matrix.zmq_draft }}
49+
ZMQ_SHARED: ${{ matrix.zmq_shared }}
50+
SKIP_GC_FINALIZER_TESTS: ${{ matrix.skip_gc_finalizer_tests }}
3251
steps:
33-
- uses: actions/checkout@v2
52+
- uses: actions/checkout@v3
53+
54+
- name: Cache
55+
uses: actions/cache@v3
56+
with:
57+
path: |
58+
./node_modules/
59+
~/.npm
60+
~/AppData/Roaming/npm-cache
61+
./build/zeromq-${{ matrix.zmq_version }}.tar.gz
62+
./zeromq-${{ matrix.zmq_version }}.tar.gz
63+
./libzmq
64+
./build/libzmq
65+
key: "cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-ZMQ_DRAFT:${{ matrix.zmq_draft }}-ZMQ_VERSION:${{ matrix.zmq_version }}-Node:${{ matrix.node_version }}-${{ hashFiles('./package.json') }}"
66+
restore-keys: |
67+
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-ZMQ_DRAFT:${{ matrix.zmq_draft }}-ZMQ_VERSION:${{ matrix.zmq_version }}-Node:${{ matrix.node_version }}"
68+
69+
- name: Setup Cpp
70+
uses: aminya/setup-cpp@v1
71+
with:
72+
vcvarsall: ${{ contains(matrix.os, 'windows') }}
73+
cmake: true
74+
ninja: true
75+
architecture: ${{ matrix.node_arch }}
3476

3577
- name: Install Node
36-
uses: actions/setup-node@v2
78+
uses: actions/setup-node@v3
3779
with:
3880
node-version: ${{ matrix.node_version }}
3981
architecture: ${{ matrix.node_arch }}
4082

83+
- name: Install Mac-OS Dependencies
84+
if: contains(matrix.os, 'macos')
85+
run: |
86+
brew install libsodium
87+
4188
- name: Install Dependencies and Build
4289
run: npm install
4390

@@ -51,9 +98,13 @@ jobs:
5198
with:
5299
path: ./prebuilds
53100

54-
Skip:
55-
if: contains(github.event.head_commit.message, '[skip ci]')
56-
runs-on: ubuntu-latest
57-
steps:
58-
- name: Skip CI 🚫
59-
run: echo skip ci
101+
- name: Test
102+
uses: nick-invision/retry@v2
103+
with:
104+
timeout_minutes: 4
105+
max_attempts: 3
106+
command: npm run test
107+
108+
- name: Lint
109+
if: contains(matrix.os, 'ubuntu')
110+
run: npm run lint

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.npmrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public-hoist-pattern[]=*
2+
package-lock=false
3+
lockfile=true
4+
prefer-frozen-lockfile=false
5+
strict-peer-dependencies=false

CONTRIBUTING.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# CONTRIBUTING
2+
3+
This page provides some general technical information about concepts and
4+
tools used in this project. We hope this
5+
will help guide future contributors to
6+
helpful resources.
7+
8+
## What is a binding
9+
10+
A binding makes it easier for a Node.js application to take advantage of the
11+
[ZMQ C++ library](https://github.com/zeromq/libzmq), `libzmq`. The binding
12+
provides native JavaScript support to use the ZMQ library.
13+
14+
## What is `libzmq`
15+
16+
[Libzmq](https://github.com/zeromq/libzmq) is the low-level library behind
17+
most of the different language bindings, including `zeromq.js`. Libzmq exposes
18+
a C-API and is implemented in C++.
19+
20+
## How to create the binding
21+
22+
To create the binding, use [`node-gyp` Node.js native addon build tool](https://www.npmjs.com/package/node-gyp). `node-gyp` is a cross-platform command-line tool
23+
written in Node.js for compiling native addon modules for Node.js.
24+
- `npm install -g node-gyp` to install
25+
- `node-gyp configure`
26+
- `node-gyp build`
27+
- For a debug build add `--debug` to the configure and build commands
28+
29+
## What is a `binding.gyp` file
30+
31+
A `binding.gyp` file describes the configuration to build your module. This file
32+
gets placed in the root of your package, alongside `package.json`.
33+
34+
[GYP](https://gyp.gsrc.io/index.md), short for Generate Your Project, is a build
35+
tool similar to Cmake. GYP was originally created to generate native IDE project
36+
files (Visual Studio, Xcode) for building Chromium.
37+
38+
The `.gyp` file is structured as a Python dictionary.
39+
40+
## Weak-napi
41+
42+
https://www.npmjs.com/package/weak-napi
43+
On certain rarer occasions, you run into the need to be notified when a JavaScript object is going to be garbage collected. This feature is exposed to V8's C++ API, but not to JavaScript.
44+
45+
That's where weak-napi comes in! This module exports the JS engine's GC tracking functionality to JavaScript. This allows you to create weak references, and optionally attach a callback function to any arbitrary JS object.
46+

0 commit comments

Comments
 (0)