usb 1.8.1 → 1.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.8.8] - 2022-02-07
4
+
5
+ ### Fixed
6
+ - Reverted exit delay and hang by moving queue start/stop to device open/close - [`460`](https://github.com/node-usb/node-usb/pull/460) ([MikeColeGuru](https://github.com/MikeColeGuru))
7
+
8
+ ## [1.8.7] - 2022-02-07
9
+
10
+ ### Fixed
11
+ - Fixed prebuildify tags which lead to missing binaries - [`477`](https://github.com/node-usb/node-usb/pull/477) ([Rob Moran](https://github.com/thegecko))
12
+
13
+ ## [1.8.5] - 2022-01-29
14
+
15
+ ### Fixed
16
+ - Fixed lack of universal binary for MacOS darwin arm64 - [`473`](https://github.com/node-usb/node-usb/pull/473) ([Rob Moran](https://github.com/thegecko))
17
+
18
+ ## [1.8.2] - 2022-01-07
19
+
20
+ ### Added
21
+ - Added definition for `NAPI_VERSION 4` and added N-API v4 target to prebuildify - ([Rob Moran](https://github.com/thegecko))
22
+
23
+ ### Fixed
24
+ - Fixed exit delay and hang by moving queue start/stop to device open/close - [`460`](https://github.com/node-usb/node-usb/pull/460) ([MikeColeGuru](https://github.com/MikeColeGuru))
25
+
3
26
  ## [1.8.1] - 2021-11-08
4
27
 
5
28
  ### Added
package/binding.gyp CHANGED
@@ -49,8 +49,18 @@
49
49
  }],
50
50
  ['OS=="mac"', {
51
51
  'xcode_settings': {
52
- 'OTHER_CFLAGS': [ '-std=c++1y', '-stdlib=libc++' ],
53
- 'OTHER_LDFLAGS': [ '-framework', 'CoreFoundation', '-framework', 'IOKit' ],
52
+ 'OTHER_CFLAGS': [
53
+ '-std=c++1y',
54
+ '-stdlib=libc++',
55
+ '-arch x86_64',
56
+ '-arch arm64'
57
+ ],
58
+ 'OTHER_LDFLAGS': [
59
+ '-framework', 'CoreFoundation',
60
+ '-framework', 'IOKit',
61
+ '-arch x86_64',
62
+ '-arch arm64'
63
+ ],
54
64
  'SDKROOT': 'macosx',
55
65
  'MACOSX_DEPLOYMENT_TARGET': '10.7',
56
66
  },
package/libusb.gypi CHANGED
@@ -103,6 +103,14 @@
103
103
  'defines': [
104
104
  'OS_DARWIN=1',
105
105
  ],
106
+ 'xcode_settings': {
107
+ 'OTHER_CFLAGS': [
108
+ '-arch x86_64',
109
+ '-arch arm64'
110
+ ],
111
+ 'CLANG_CXX_LIBRARY': 'libc++',
112
+ 'MACOSX_DEPLOYMENT_TARGET': '10.7'
113
+ }
106
114
  }],
107
115
  [ 'OS == "win"', {
108
116
  'sources': [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "usb",
3
3
  "description": "Library to access USB devices",
4
- "version": "1.8.1",
4
+ "version": "1.8.8",
5
5
  "engines": {
6
6
  "node": ">=10.16.0"
7
7
  },
@@ -37,16 +37,11 @@
37
37
  "scripts": {
38
38
  "install": "node-gyp-build",
39
39
  "test": "mocha --require coffeescript/register --grep Module test/*",
40
- "full-test": "mocha --require coffeescript/register test/*",
41
- "valgrind": "coffee -c test/usb.coffee; valgrind --leak-check=full --show-possibly-lost=no node --expose-gc --trace-gc node_modules/mocha/bin/_mocha -R spec",
42
- "prebuild": "prebuildify --napi --strip",
43
- "prebuild-darwin": "prebuildify --napi --strip --arch x64+arm64",
44
- "prebuild-win32-x86": "prebuildify --napi --strip",
45
- "prebuild-win32-x64": "prebuildify --napi --strip",
46
- "prebuild-linux-x86": "prebuildify-cross -i ghcr.io/node-usb/linux-x86 --napi --strip",
47
- "prebuild-linux-x64": "prebuildify-cross -i ghcr.io/node-usb/centos7-devtoolset7 -i ghcr.io/node-usb/alpine --napi --strip --tag-libc",
48
- "prebuild-linux-arm": "prebuildify-cross -i ghcr.io/node-usb/linux-arm64 -i ghcr.io/node-usb/linux-armv7 -i ghcr.io/node-usb/linux-armv6 --napi --strip --tag-armv",
49
- "prebuild-android-arm": "prebuildify-cross -i ghcr.io/node-usb/android-arm64 -i ghcr.io/node-usb/android-armv7 --napi --strip --tag-armv",
40
+ "full-test": "mocha --require coffeescript/register test/*.coffee",
41
+ "valgrind": "coffee -c test/*.coffee; valgrind --leak-check=full --show-possibly-lost=no node --expose-gc --trace-gc node_modules/mocha/bin/_mocha -R spec",
42
+ "prebuild": "prebuildify --napi --target 10.16.0 --strip",
43
+ "prebuild-cross": "prebuildify-cross --napi --target 10.16.0 --strip",
44
+ "prepublishOnly": "prebuildify-ci download",
50
45
  "prebuild-download": "prebuildify-ci download"
51
46
  },
52
47
  "dependencies": {
@@ -55,7 +50,7 @@
55
50
  },
56
51
  "devDependencies": {
57
52
  "coffeescript": "~2.4.1",
58
- "mocha": "^9.1.3",
53
+ "mocha": "^9.2.0",
59
54
  "node-gyp": "^7.1.2",
60
55
  "prebuildify": "^4.2.1",
61
56
  "prebuildify-ci": "^1.0.5",
Binary file
Binary file
Binary file
package/src/device.cc CHANGED
@@ -21,8 +21,6 @@ Device::Device(const Napi::CallbackInfo & info) : Napi::ObjectWrap<Device>(info)
21
21
  byPtr.insert(std::make_pair(device, this));
22
22
  #ifndef USE_POLL
23
23
  completionQueue.start(info.Env());
24
- // Unref threadsafe function immediately to avoid delay in program exit
25
- completionQueue.unref(info.Env());
26
24
  #endif
27
25
  DEBUG_LOG("Created device %p", this);
28
26
  Constructor(info);
@@ -30,6 +28,9 @@ Device::Device(const Napi::CallbackInfo & info) : Napi::ObjectWrap<Device>(info)
30
28
 
31
29
  Device::~Device(){
32
30
  DEBUG_LOG("Freed device %p", this);
31
+ #ifndef USE_POLL
32
+ completionQueue.stop();
33
+ #endif
33
34
  byPtr.erase(device);
34
35
  libusb_close(device_handle);
35
36
  libusb_unref_device(device);
package/src/node_usb.h CHANGED
@@ -10,6 +10,7 @@
10
10
  #endif
11
11
  #include <libusb.h>
12
12
 
13
+ #define NAPI_VERSION 4
13
14
  #include <napi.h>
14
15
  #include <node_buffer.h>
15
16