From 8755a3660295cffcea7ba8681f2502c5eba9c977 Mon Sep 17 00:00:00 2001 From: dilin-MS Date: Mon, 23 Mar 2020 16:01:02 +0800 Subject: [PATCH] move usb-native to node-usb-native --- .travis.yml | 1 + CHANGELOG.md | 10 ++++++++++ package-lock.json | 20 ++++++++++---------- package.json | 2 +- src/debug/debuggerManager.ts | 2 +- src/serialmonitor/serialportctrl.ts | 2 +- src/serialmonitor/usbDetector.ts | 2 +- test/extension.test.ts | 2 +- webpack.config.js | 2 +- 9 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4cb80476..7a9331c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,7 @@ addons: branches: only: - master + - develop - /v?[0-9]+\.[0-9]+\.[0-9]+(.*)?/ env: diff --git a/CHANGELOG.md b/CHANGELOG.md index ad626e42..1cca65db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ # Change Log All notable changes to this project will be documented in this file. +## Version 0.3.0 + +### Fixed + +- Support Electron v7. Fix issue of "Unable to use serial port in VS Code Version 1.43.0". [[#980](https://github.com/microsoft/vscode-arduino/issues/980)] +- Fix issue of "Fail to debug on Ubuntu". [[#933](https://github.com/microsoft/vscode-arduino/issues/933)] +- Remove line ending selection. Fix the issue of "Save the last used end of line". [[#952](https://github.com/microsoft/vscode-arduino/issues/952)] +- Fix the issue of "Can't install libraries from VS Code for ESP8266". [[#930](https://github.com/microsoft/vscode-arduino/issues/930)] +- Fix the issue of "Project path can not be changed". [[#978](https://github.com/microsoft/vscode-arduino/issues/978)] + ## Version 0.2.29 - Release date: January 2, 2020 diff --git a/package-lock.json b/package-lock.json index 6ab0102e..35d6ddbc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6207,6 +6207,16 @@ } } }, + "node-usb-native": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/node-usb-native/-/node-usb-native-0.0.2.tgz", + "integrity": "sha512-OAGhHUyQoOrxETAoXHXNFroWkAwvoanbHzoS34PIjWAD2nnfgMKx7a0HHJOtrS1RfcXg6Z92bzbUOKFfQsQrBg==", + "requires": { + "glob": "^7.1.6", + "serialport": "^8.0.7", + "usb-detection": "^4.7.0" + } + }, "noop-logger": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", @@ -8532,16 +8542,6 @@ } } }, - "usb-native": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/usb-native/-/usb-native-5.0.12.tgz", - "integrity": "sha512-+vBBDNy/paCeql85uaChGxyBMz5T+RrtRkQYbDuRWsSzUsoKd/cBxYhNic6eXFY3TyiLXJSUat116IbDWt3/8Q==", - "requires": { - "glob": "^7.1.6", - "serialport": "^8.0.7", - "usb-detection": "^4.7.0" - } - }, "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", diff --git a/package.json b/package.json index fb1d784d..349c8252 100644 --- a/package.json +++ b/package.json @@ -580,8 +580,8 @@ "glob": "^7.1.1", "iconv-lite": "^0.4.18", "impor": "^0.1.1", + "node-usb-native": "^0.0.2", "properties": "^1.2.1", - "usb-native": "^5.0.12", "uuid": "^3.0.1", "vscode-extension-telemetry": "0.0.18", "winreg": "^1.2.3", diff --git a/src/debug/debuggerManager.ts b/src/debug/debuggerManager.ts index c6608ed8..1c9e81f0 100644 --- a/src/debug/debuggerManager.ts +++ b/src/debug/debuggerManager.ts @@ -43,7 +43,7 @@ export class DebuggerManager { } } } - this._usbDetector = require("usb-native").detector; + this._usbDetector = require("node-usb-native").detector; this._debugServerPath = platform.findFile(platform.getExecutableFileName("openocd"), path.join(this._arduinoSettings.packagePath, "packages")); if (!util.fileExistsSync(this._debugServerPath)) { diff --git a/src/serialmonitor/serialportctrl.ts b/src/serialmonitor/serialportctrl.ts index d8705b0e..ee15e40a 100644 --- a/src/serialmonitor/serialportctrl.ts +++ b/src/serialmonitor/serialportctrl.ts @@ -15,7 +15,7 @@ interface ISerialPortDetail { export class SerialPortCtrl { public static get serialport(): any { if (!SerialPortCtrl._serialport) { - SerialPortCtrl._serialport = require("usb-native").SerialPort; + SerialPortCtrl._serialport = require("node-usb-native").SerialPort; } return SerialPortCtrl._serialport; } diff --git a/src/serialmonitor/usbDetector.ts b/src/serialmonitor/usbDetector.ts index d4d66c8f..e965c678 100644 --- a/src/serialmonitor/usbDetector.ts +++ b/src/serialmonitor/usbDetector.ts @@ -45,7 +45,7 @@ export class UsbDetector { if (os.platform() === "linux" || !enableUSBDetection) { return; } - this._usbDetector = require("usb-native").detector; + this._usbDetector = require("node-usb-native").detector; if (!this._usbDetector) { return; diff --git a/test/extension.test.ts b/test/extension.test.ts index d2de24a9..c301d3ac 100644 --- a/test/extension.test.ts +++ b/test/extension.test.ts @@ -68,7 +68,7 @@ suite("Arduino: Extension Tests", () => { // When running test on osx, the vscode instance is hanging there after tests finished and cause mocha timeout. // As a workaround, closing usb-detection process manually would make test window exit normally. if (os.platform() !== "linux") { - const usbDector = require("usb-native").detector; + const usbDector = require("node-usb-native").detector; usbDector.stopMonitoring(); } }); diff --git a/webpack.config.js b/webpack.config.js index 1bb149a6..24ccd7b3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -12,7 +12,7 @@ function getEntry() { const mod = JSON.parse(npmListRes); const unbundledModule = ['impor', 'uuid', // usb-native modules can not be bundled - 'usb-native', 'usb-detection', '@serialport/bindings', 'bindings', 'serialport']; + 'node-usb-native', 'usb-detection', '@serialport/bindings', 'bindings', 'serialport']; for (const mod of unbundledModule) { const p = 'node_modules/' + mod;