Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge ZeroMQ-NG back into ZeroMQ.js #343

Merged
merged 9 commits into from
Nov 3, 2019
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
68 changes: 68 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -4
AlignAfterOpenBracket: false
AlignConsecutiveAssignments: false
AlignEscapedNewlinesLeft: false
AlignOperands: false
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 90
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 4
UseTab: Never
...

13 changes: 6 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true

[*.js]
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.cc]
indent_style = space
[*.{js,ts}]
indent_size = 2

[*.{h,cc}]
indent_size = 4
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
35 changes: 10 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
*.swp
*.swo
*.o
build
*.lock*
binding.node
examples/stress-test-client
node_modules
Makefile.gyp
binding.Makefile
binding.target.gyp.mk
npm-debug.log
gyp-mac-tool
out/
zmq
docs

npm-debug.log
prebuilds
zmq-build.log
windows/lib/libzmq.lib

# Coverage directory used by tools like istanbul
coverage
.nyc_output
coverage.lcov

lib
tmp
node_modules
yarn.lock
yarn-error.log
package-lock.json
lib/binary/*.node
lib/binary/napi-v*/*.node
build-tmp-napi-v*
prebuilds
test.js
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

197 changes: 143 additions & 54 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,157 @@
language: node_js
node_js:
- "6"
- "8"
- "10"
- "11"
sudo: required

matrix:
cache: yarn
dist: bionic

jobs:
include:
- os: linux
dist: trusty
env:
- DEPLOY="true"
- MAIN="true"
- os: linux
dist: trusty
env:
- DEPLOY="true"
- ARCH="armv7"
- os: linux
dist: trusty
env:
- DEPLOY="true"
- ARCH="armv8"
- os: linux
dist: trusty
env:
- ELECTRON="3.0.0"
- os: osx
env:
- DEPLOY="true"
## TEST STAGE

env:
global:
- GH_REF: github.com/nteract/zmq-prebuilt.git
- secure: AMY9chDNyNawxPhxAksCREhbQoOmphQKo2hDuYIPXBCUNF6Zik969QlB07TVjo+Bo0KVEbG4ANTdI0FkFIhg4MuJIWUkW30ZDyCSovUx8zyWB/7IN23A4Cx4p4ZnKjezTHUQpZ9InRIZzy9kOR+215IIBP6GfxbUY89eDA6ARElcv1rwDjZqSnLAxfie6v80vIbhWxNK4kQjiEyIez5eWBjRg4//dmb63TvJjc78GFTaqmh6lRIApAyA0uKka14XR/PJw5IpDR+0Q2omHl4t4zbu9MdVNYMSD+c6iNxOq3fqZJwnyJ1ELErbtR8oeKgZX1SOew5QTCUZWQsa+ySYTCzUnhWjhCgN6W0ciVtT2PslS/ZcvnrGGIxJAOmTZwINw8sAp8yYdY9QCJOGdB5ah2oUBLGKElcFGqSblohXUEM1tXeRchmpXiiAxnPNtxc6lkZzz6NxDl2OFXSmjMS4Cr8cA//Bn6gM04xRJyETy86/8KDoL+ENc7gkeiuYUOFqkAn5X8PrqPdsPmF7yA61IF1ru/OgtiuCh+eqnzZKBPImJo2KfUIqVuRi/6eUaDfWLT7d/J84Vbe3p2nPxoFd2pSw60f/lIkzFSRZx3vBjQiW2MVUN7ZTdawMOzE4TpIV7rDOkKe7qJJobquJEjd2X9Z+8JiTYXK2pPN2GceiqAM=
# Test main OSes on Node 10.x branch.
- os: linux
node_js: "10.16"
env: ZMQ_DRAFT=true INCLUDE_COMPAT_TESTS=true

- os: linux
env: ALPINE_CHROOT=3.10 ZMQ_DRAFT=true INCLUDE_COMPAT_TESTS=true
sudo: required

- os: osx
env: ZMQ_DRAFT=true
node_js: "10.16"

- os: windows
node_js: "10.16"
# https://travis-ci.community/t/build-doesnt-finish-after-completing-tests/288
env: ZMQ_DRAFT=true YARN_GPG=no

- os: windows
node_js: "10.16/x86"
# https://travis-ci.community/t/build-doesnt-finish-after-completing-tests/288
env: ZMQ_DRAFT=true YARN_GPG=no

# Test shared libraries on Linux and macOS.
- os: linux
node_js: "10.16"
env: ZMQ_SHARED=true
addons: {apt: {packages: libzmq3-dev}}

- os: osx
node_js: "10.16"
env: ZMQ_SHARED=true
addons: {homebrew: {packages: zeromq, update: true}}

# Test older versions of ZMQ.
- os: linux
node_js: "10.16"
env: ZMQ_VERSION=4.2.4

# Test recent Node versions.
- os: linux
node_js: "12"
env: ZMQ_DRAFT=true INCLUDE_COMPAT_TESTS=true

- os: linux
node_js: "13"
env: ZMQ_DRAFT=true

## PREBUILD STAGE

- stage: prebuild
os: linux
env: ARCHIVE_SUFFIX=-x64
node_js: "10.16"
script: script/ci/prebuild.sh

- stage: prebuild
os: linux
env: ALPINE_CHROOT=3.10 ARCHIVE_SUFFIX=-x64-musl
sudo: required
script: script/ci/prebuild.sh

before_install:
- export DISPLAY=':99.0'
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- if [ -n "$ELECTRON" ]; then npm install electron@${ELECTRON}; fi
- stage: prebuild
os: linux
node_js: "10.16"
env: ARCH=arm TRIPLE=arm-linux-gnueabihf GCC=8 ARCHIVE_SUFFIX=-armv7
addons: {apt: {packages: [gcc-8-arm-linux-gnueabihf, g++-8-arm-linux-gnueabihf]}}
script: script/ci/prebuild.sh

- stage: prebuild
os: linux
node_js: "10.16"
env: ARCH=arm64 TRIPLE=aarch64-linux-gnu GCC=8 ARCHIVE_SUFFIX=-armv8
addons: {apt: {packages: [gcc-8-aarch64-linux-gnu, g++-8-aarch64-linux-gnu]}}
script: script/ci/prebuild.sh

- stage: prebuild
os: osx
node_js: "10.16"
script: script/ci/prebuild.sh

- stage: prebuild
os: windows
node_js: "10.16"
# https://travis-ci.community/t/build-doesnt-finish-after-completing-tests/288
env: YARN_GPG=no ARCHIVE_SUFFIX=-x64
script: script/ci/prebuild.sh

- stage: prebuild
os: windows
node_js: "10.16/x86"
# https://travis-ci.community/t/build-doesnt-finish-after-completing-tests/288
env: YARN_GPG=no ARCHIVE_SUFFIX=-x86
script: script/ci/prebuild.sh

## PUBLISH STAGE

- stage: publish
os: linux
node_js: "10.16"
env: IGNORE_SCRIPTS=true
script: script/ci/package.sh

fast_finish: true
allow_failures:
- os: linux
node_js: "13"

stages:
- name: test
- name: prebuild
if: tag IS present
- name: publish
if: tag IS present

install:
- if [ -n "$ARCH" ]; then bash ./scripts/cross_compile.sh ${ARCH}; fi
- if [ -n "$ELECTRON" ]; then npm install --runtime=electron --target=${ELECTRON} --disturl=https://atom.io/download/electron; fi
- if [ -z "$ARCH" ] && [ -z "$ELECTRON" ]; then npm install; fi
- travis_retry script/ci/install.sh

script:
- if [ -n "$ELECTRON" ]; then travis_retry npm run test:electron; fi
- if [ -z "$ARCH" ] && [ -z "$ELECTRON" ]; then travis_retry npm run coverage; fi

after_success:
- if [ "$MAIN" = "true" ]; then bash <(curl -s https://codecov.io/bash); fi
- if [ "$MAIN" = "true" ]; then bash ./scripts/publish_docs.sh; fi
- travis_retry script/ci/test.sh

deploy:
provider: script
# Deploy prebuilds to Github releases.
- provider: releases
draft: false
file: "${TRAVIS_TAG:-latest}-${TRAVIS_OS_NAME}${ARCHIVE_SUFFIX}.tar.gz"
skip_cleanup: true
script:
- if [ -z "$ARCH" ]; then ./node_modules/prebuild/bin.js --all --strip -u ${GH_TOKEN}; else bash ./scripts/cross_compile.sh ${ARCH} ${GH_TOKEN}; fi
on:
condition: $DEPLOY = "true"
tags: true
condition: "$TRAVIS_BUILD_STAGE_NAME = Prebuild"
api_key:
# Github API token for @zeromqjs-integration
secure: LGumSW+o+hjoYeYTR0HPSkeonjipv5jdflV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2jwjhr+szm9MDQcnUxq5zuOCiAMzE51hbhLQATUNQIiqsD0X+NK3o5urb/Fjb6I6q3MO7GJkuvsda1ni5OEPeFAlYKjvgBiwUZnc32uBHfd3iGzbdwzihSKreuIdVTCtmlnhVmM0ztg5E+BQ8SxWJPxLw5c+9ZaEja5bVCkZF4L3P/EcsdBQ1YmorsROgf/p+PsrnqKAy9zU/NynQQYODx28IPcuQgJbhzeTUEINnFej513BRnkREgjLY5bjXY6iLjKdlRo8kPVqrj8=
# Deploy package including all generated prebuilds to NPM.
- provider: npm
email: [email protected]
skip_cleanup: true
on:
tags: true
condition: "$TRAVIS_BUILD_STAGE_NAME = Publish"
api_key:
# NPM API token for @zeromqjs-integration
secure: sJLxdZXXP0pbUEt2PQkJfraPHqG0jrpoesdVDw189KQvOyeLxRMzuF+BpxGhm6wkrOVF+H4AMVbpTC52yZoHZBLMLUNcHhXjMeztxVsuCe54NLDWSZQ9xGzrZh8npZZCykjdkb+Ax0Xf8wNRcBPZy7KNCoA/JD/qkRyzMjIOQLefxdxAQUcFdYh4sWWc6GqJzxVjX7/Q6jh9l+5Ky+ayLypGaZRirSrsVCsrGhhebPCx9RVQrzopips5fC8UJRF+t3oWRmsrqlsh4FAlo6PPRVzraJL8b92krHrea1wtIPJbTH66sWxzvCw3O8TyiQIkTQwCKVSTmJ4UOVsKchIwWABdno/7DS/5kQyvP/f8yuQ+/kburuRxeJWkTuOz08EAQBviGR5VxVbffPBQyakfEhO0Aw9BC4yGZxTx4mXv2JqSAZRuDS4tntAfpVbkBUZvIDMqGAviMlM9JgTyvoEYmRJAUA33vjaKTa2kJ/bls/lSej6Hl/f5BJ7PHHzofmqi4PPdqRVHX61zrm/TaG5OfIO8wS2cTGFwTWOHcn9BCYzkEm8z+xJ9Kz4dRpKCQAKDCr/FXRAGSyWtA7Wk6T9hdx67wKHOXTRaoiT+V1Ci9xPAUFURJKl/Cef7VOMT1imnx0o3VKlX2md/Up9oSi0tuXHrz+Vol/D+3hMEgVsbub8=

env:
global:
# GITHUB_TOKEN=<Github API token for @zeromqjs-integration>
secure: C4S4sfX6e3VubfxkeM1LA3qbKM1BnhnCLVOgCHiHYeRpnVROMQmXqxo9S0cy+M0oj35jdaGWaCjJjbdpE2ofc/9MMEGeBsT91Gz3cE9HAmwDsp4XD12fxjrK0tTr6Bu/G1gxmUYxNw3Vb0EeaRAMx19MO/vRQTbxlSGf38zNLQccioqPq1ihIHAg9g6K9gtoE/WZnCTvydvOQYnBpBaEsiQJBVmmqZnO6Rxg1t8dxRjyUnzEufdKzPT4Qf1sn6zIC7mM362ndIuE4V483BiK5xt/ZDzkb6QPdgWSnTS2dBc2gCrNMnIAdqY1tbQ9PdDr8phY/X5tYqjZwwL8sRcab5gZm5qTzK1fdz3sYOYDU1j8uUyh7W9H10ePHkwhQgQxZc6g8kkwEq8mA/35dMO+x/VaIYYDUoFW8rU+suVFThuSGZhjCzEwM4+b/BkL26Ux1MrXJdsaqpRqBJNJKO9SyaDBrdNHZ4aYLhvnTikE82PR98mQTO7bPdZbrmMPVa1mE9dl1TOdPCk22ykzJuIMYSaFDDm5fUF3smkBqmkvVE3EO4FoVYyVL5tM4PoZzIQVO9H6w8nli49Ry0zZ0mEuUuEKG+uH4ZY6wL49m/f7WJ3ndnUF8FUHoW1Z43V2SZ+MHtIZX8srQxWmXN38x2hHc9HePN629SHEqx7OV8zFoJU=
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### v6.0.0-beta.1

* BREAKING: Complete rewrite of ZeroMQ.js with a modern and safe API. This version is based on ZeroMQ-NG version v5.0.0-beta.26. A compatibility layer for existing users of versions 5.x or earlier of ZeroMQ.js is available as "zeromq/v5-compat".

### Previous changes

* See https://github.com/rolftimmermans/zeromq-ng/blob/master/CHANGELOG.md for the changelog of the next generation API before the merge back into ZeroMQ.js.

* See https://github.com/zeromq/zeromq.js/blob/5.x/History.md for the changelog of the previous API before the merge of ZeroMQ-NG.
Loading