Skip to content

Commit 81d18ae

Browse files
authored
Merge pull request #519 from zeromq/dev
2 parents 016187f + 4812cad commit 81d18ae

File tree

12 files changed

+669
-169
lines changed

12 files changed

+669
-169
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"rules": {
1010
"@typescript-eslint/quotes": ["error", "double"]
1111
},
12-
"ignorePatterns": ["node_modules/", "build/", "lib/", "libzmq/", "tmp/", "zmq/"]
12+
"ignorePatterns": ["node_modules/", "build/", "lib/", "libzmq/", "tmp/", "zmq/", "v5-compat.d.ts", "draft.d.ts"]
1313
}

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,4 @@ jobs:
107107

108108
- name: Lint
109109
if: contains(matrix.os, 'ubuntu')
110-
run: npm run lint
110+
run: npm run lint-test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ lib/binary/napi-v*/*.node
1111
build-tmp-napi-v*
1212
prebuilds
1313
test.js
14+
.cache/
15+
test/typings-compatibility/

binding.gyp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@
1616
["zmq_shared == 'false'", {
1717
'actions': [{
1818
'action_name': 'build_libzmq',
19-
'inputs': ['package.json'],
20-
'outputs': ['libzmq/lib'],
21-
'action': ['sh', '<(PRODUCT_DIR)/../../script/build.sh', '<(CONFIGURATION_NAME)'],
19+
'inputs': ['package.json', './script/build.ts'],
20+
'conditions': [
21+
['OS != "win"', {
22+
'outputs': ['build/libzmq/lib/libzmq.a', 'build/libzmq/include/zmq.h', 'build/libzmq/include/zmq_utils.h'],
23+
}],
24+
['OS == "win"', {
25+
'outputs': ['build/libzmq/lib/libzmq.lib', 'build/libzmq/include/zmq.h', 'build/libzmq/include/zmq_utils.h'],
26+
}],
27+
],
28+
'action': ['ts-node', '<(PRODUCT_DIR)/../../script/build.ts'],
2229
}],
2330
}],
2431
],
@@ -95,6 +102,7 @@
95102
],
96103
'conditions': [
97104
['OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {
105+
# flag removal
98106
'cflags_cc!': [
99107
'-std=gnu++0x',
100108
'-std=gnu++1y'
@@ -172,6 +180,7 @@
172180
'defines': [
173181
'NAPI_CPP_EXCEPTIONS',
174182
],
183+
# flag removal
175184
'cflags_cc!': [
176185
"-fno-exceptions",
177186
],

package.json

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@
1717
"url": "https://github.com/zeromq/zeromq.js.git"
1818
},
1919
"dependencies": {
20-
"node-gyp-build": "^4.5.0"
20+
"@types/node": "^18.11.9",
21+
"@types/shelljs": "^0.8.11",
22+
"cross-env": "^7.0.3",
23+
"node-gyp-build": "^4.5.0",
24+
"shelljs": "^0.8.5",
25+
"ts-node": "10.9"
2126
},
2227
"devDependencies": {
2328
"@gnd/typedoc": "^0.15.0-0",
2429
"@types/chai": ">=4.3",
2530
"@types/fs-extra": "^9.0.13",
2631
"@types/mocha": ">=10.0",
27-
"@types/node": ">=18.11",
2832
"@types/semver": ">=7",
2933
"@types/weak-napi": "^2.0.1",
3034
"benchmark": ">=2",
@@ -38,13 +42,14 @@
3842
"mocha": ">=10.1",
3943
"node-addon-api": "^5.0.0",
4044
"node-fetch": "^3.3.0",
45+
"node-gyp": "^9.3.0",
46+
"npm-run-all2": "^6.0.4",
4147
"prebuildify": "^5.0.1",
4248
"prettier": "^2.7.1",
4349
"semver": ">=7",
4450
"shx": "^0.3.4",
4551
"tar-fs": "^2.1.1",
4652
"ts-morph": "^16.0.0",
47-
"ts-node": ">=10",
4853
"typescript": "4.8",
4954
"weak-napi": "^2.0.2"
5055
},
@@ -75,12 +80,16 @@
7580
"build.js": "tsc --project tsconfig-build.json && node script/ci/downlevel-dts.js",
7681
"build.doc": "typedoc --out docs --name zeromq.js --excludeProtected --excludePrivate --excludeNotExported --excludeExternals --externalPattern 'src/+(draft|native|compat).ts' --tsconfig tsconfig-build.json --mode file",
7782
"prebuild": "ts-node -P ./tsconfig.json ./script/prebuild.ts",
78-
"build.native": "prebuildify --napi --build-from-source",
79-
"build.native.debug": "npm run build.native -- --debug",
80-
"build": "npm run build.js && npm run build.native",
81-
"build.debug": "npm run build.js && npm run build.native.debug",
82-
"test": "npm run build.debug && mocha",
83-
"lint": "sh script/lint.sh",
83+
"build.native": "node-gyp configure --release && node-gyp build --release",
84+
"build.native.debug": "cross-env CMAKE_BUILD_TYPE=Debug node-gyp configure --debug && cross-env CMAKE_BUILD_TYPE=Debug node-gyp build --debug",
85+
"build": "run-p build.js build.native",
86+
"build.debug": "run-p build.js build.native.debug",
87+
"test": "run-s build.debug && mocha",
88+
"lint.clang-format": "clang-format -i -style=file src/*.{cc,h} src/*/*.h",
89+
"lint-test.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/",
90+
"lint.eslint": "run-s lint-test.eslint -- --fix",
91+
"lint": "run-p lint.eslint lint.clang-format",
92+
"lint-test": "run-s lint-test.eslint",
8493
"bench": "node --expose-gc test/bench"
8594
},
8695
"keywords": [

0 commit comments

Comments
 (0)