From e1fe5b93bf2b1aec86c57602d7b2c6092d0cc591 Mon Sep 17 00:00:00 2001 From: Bluephlame Date: Sat, 29 Jun 2019 12:19:48 +0100 Subject: [PATCH 1/2] working upgrade to node 10 --- index.ts | 10 +++++----- lib/DoorSensorPort.ts | 2 +- lib/DoorStateExtension.ts | 2 +- lib/GPIOGarageDoorAccessory.ts | 6 +++--- lib/GPIOPort.ts | 4 ---- lib/SwitchPort.ts | 4 ++-- package.json | 11 +++++------ tsconfig.json | 11 +++++++---- typings.json | 9 --------- 9 files changed, 24 insertions(+), 35 deletions(-) delete mode 100644 typings.json diff --git a/index.ts b/index.ts index b9c1ba4..0fd3161 100644 --- a/index.ts +++ b/index.ts @@ -1,9 +1,9 @@ -/// +import {DoorSensorPort} from "./lib/DoorSensorPort"; +import {SwitchPort} from "./lib/SwitchPort"; +import {GPIOGarageDoorAccessory} from "./lib/GPIOGarageDoorAccessory"; +import {DoorStateExtension} from "./lib/DoorStateExtension"; -import DoorSensorPort from "./lib/DoorSensorPort"; -import SwitchPort from "./lib/SwitchPort"; -import GPIOGarageDoorAccessory from "./lib/GPIOGarageDoorAccessory"; -import DoorStateExtension from "./lib/DoorStateExtension"; +declare var module; module.exports = function (homebridge) { var exportTypes = { diff --git a/lib/DoorSensorPort.ts b/lib/DoorSensorPort.ts index 47a001a..bf0b590 100644 --- a/lib/DoorSensorPort.ts +++ b/lib/DoorSensorPort.ts @@ -7,7 +7,7 @@ import {getCurrentDoorState, getTargetDoorState} from "./DoorStateExtension"; var Characteristic; -export default class DoorSensorPort extends GPIOPort { +export class DoorSensorPort extends GPIOPort { private service: any; private log: any; private closedSensorValue; diff --git a/lib/DoorStateExtension.ts b/lib/DoorStateExtension.ts index 8a56cf9..14d4954 100644 --- a/lib/DoorStateExtension.ts +++ b/lib/DoorStateExtension.ts @@ -4,7 +4,7 @@ var Characteristic; -export default class DoorStateExtension { +export class DoorStateExtension { static init(exportedTypes): void { Characteristic = exportedTypes.Characteristic; } diff --git a/lib/GPIOGarageDoorAccessory.ts b/lib/GPIOGarageDoorAccessory.ts index fcd7f26..7ea201a 100644 --- a/lib/GPIOGarageDoorAccessory.ts +++ b/lib/GPIOGarageDoorAccessory.ts @@ -7,12 +7,12 @@ import Promise = require("bluebird"); import GPIO = require("onoff"); import {getCurrentDoorStateDescription} from "./DoorStateExtension"; import {changeBase} from "./Runtime"; -import DoorSensorPort from "./DoorSensorPort"; -import SwitchPort from "./SwitchPort"; +import {DoorSensorPort} from "./DoorSensorPort"; +import {SwitchPort} from "./SwitchPort"; var Accessory, Service, Characteristic, uuid; -export default class GPIOGarageDoorAccessory { +export class GPIOGarageDoorAccessory { private log; private name: string; private doorSensor: DoorSensorPort; diff --git a/lib/GPIOPort.ts b/lib/GPIOPort.ts index 818ed33..d4a722f 100644 --- a/lib/GPIOPort.ts +++ b/lib/GPIOPort.ts @@ -1,10 +1,6 @@ /** * Created by kraig on 7/2/16. */ - -/// -/// - import util = require("util"); import Promise = require("bluebird"); import onoff = require("onoff"); diff --git a/lib/SwitchPort.ts b/lib/SwitchPort.ts index 1503750..143ab15 100644 --- a/lib/SwitchPort.ts +++ b/lib/SwitchPort.ts @@ -2,13 +2,13 @@ * Created by kraig on 7/2/16. */ -import DoorSensorPort from "./DoorSensorPort"; +import {DoorSensorPort} from "./DoorSensorPort"; import {GPIOPort, GPIOState} from "./GPIOPort"; import {asDoorState, asOperationState, getCurrentDoorState} from "./DoorStateExtension"; var Characteristic; -export default class SwitchPort extends GPIOPort { +export class SwitchPort extends GPIOPort { private isOperating: boolean; private service; private log; diff --git a/package.json b/package.json index c8f9ab4..8218879 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "homebridge-gpio-garagedoor", "description": "Raspberry Pi GPIO based Garage Door plugin for Homebridge", - "version": "0.2.2", + "version": "0.2.3", "repository": { "type": "git", "url": "git://github.com/kraigm/homebridge-gpio-garagedoor.git" @@ -21,13 +21,12 @@ "homebridge": ">=0.2.5" }, "dependencies": { - "bluebird": "^3.3.4", - "onoff" : "1.1.0" + "bluebird": "^3.5.5", + "onoff": "^4.1.2" }, "devDependencies": { + "@types/bluebird": "^3.5.27", + "@types/onoff": "^3.2.1", "typescript": "^1.8" - }, - "scripts": { - "prepublish": "node node_modules/typescript/bin/tsc --module commonjs index.ts -t ES5" } } diff --git a/tsconfig.json b/tsconfig.json index 3c117f0..dd7006c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,10 +2,13 @@ "compilerOptions": { "module": "commonjs", "moduleResolution": "node", - "target": "es5", + "target": "es6", "sourceMap": true - }, + }, +"types":[ + "util" +], "exclude": [ - "node_modules" - ] + "node_modules" + ] } \ No newline at end of file diff --git a/typings.json b/typings.json deleted file mode 100644 index b00b881..0000000 --- a/typings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "devDependencies": { - "bluebird": "registry:npm/bluebird#3.3.4+20160622205516" - }, - "globalDevDependencies": { - "node": "registry:dt/node#0.12.0+20160608055420", - "onoff": "registry:dt/onoff#0.0.0+20160206144506" - } -} From 2cb2662e30100a33409d43a97f7c05f3b3c829d2 Mon Sep 17 00:00:00 2001 From: Justin Boyd Date: Sun, 14 Jul 2019 01:10:36 +1000 Subject: [PATCH 2/2] Update package.json --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 8218879..7cf548c 100644 --- a/package.json +++ b/package.json @@ -28,5 +28,8 @@ "@types/bluebird": "^3.5.27", "@types/onoff": "^3.2.1", "typescript": "^1.8" + }, + "scripts": { + "prepublish": "node node_modules/typescript/bin/tsc --module commonjs index.ts -t ES6" } }