Better directory structure
This commit is contained in:
parent
406e9e99bc
commit
225f331811
@ -6,8 +6,8 @@
|
||||
"main": "dist/node/index-node.js",
|
||||
"types": "dist/node/index-node.d.ts",
|
||||
"scripts": {
|
||||
"build:node": "tslint -c tslint.json \"./src/*.ts\" && tsc",
|
||||
"build:browser": "tslint -c tslint.json \"./src/*.ts\" && webpack --mode=production",
|
||||
"build:node": "tslint -c tslint.json \"./src/**/*.ts\" && tsc",
|
||||
"build:browser": "tslint -c tslint.json \"./src/**/*.ts\" && webpack --mode=production",
|
||||
"build:all": "tslint -c tslint.json \"./src/*.ts\" && tsc && webpack --mode=production",
|
||||
"docs": "jsdoc -d docs -c jsdoc.conf.json -t ./node_modules/ink-docstrap/template -R README.md dist/node/consts.js dist/node/poweredup-node.js dist/node/lpf2hub.js dist/node/wedo2smarthub.js dist/node/boostmovehub.js dist/node/puphub.js dist/node/pupremote.js dist/node/duplotrainbase.js dist/node/controlplushub.js dist/node/hub.js dist/node/consts.js",
|
||||
"all": "npm run build:all && npm run docs",
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { Device } from "./device";
|
||||
|
||||
import { IDeviceInterface } from "./interfaces";
|
||||
import { IDeviceInterface } from "../interfaces";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
import { mapSpeed } from "./utils";
|
||||
import { mapSpeed } from "../utils";
|
||||
|
||||
export class BasicMotor extends Device {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Device } from "./device";
|
||||
|
||||
import { IDeviceInterface } from "./interfaces";
|
||||
import { IDeviceInterface } from "../interfaces";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
export class ColorDistanceSensor extends Device {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { EventEmitter } from "events";
|
||||
|
||||
import { IDeviceInterface } from "./interfaces";
|
||||
import { IDeviceInterface } from "../interfaces";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
export class Device extends EventEmitter {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Device } from "./device";
|
||||
|
||||
import { IDeviceInterface } from "./interfaces";
|
||||
import { IDeviceInterface } from "../interfaces";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
export class Light extends Device {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { TachoMotor } from "./tachomotor";
|
||||
|
||||
import { IDeviceInterface } from "./interfaces";
|
||||
import { IDeviceInterface } from "../interfaces";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
export class MediumLinearMotor extends TachoMotor {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Device } from "./device";
|
||||
|
||||
import { IDeviceInterface } from "./interfaces";
|
||||
import { IDeviceInterface } from "../interfaces";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
export class MotionSensor extends Device {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { TachoMotor } from "./tachomotor";
|
||||
|
||||
import { IDeviceInterface } from "./interfaces";
|
||||
import { IDeviceInterface } from "../interfaces";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
export class MoveHubMediumLinearMotor extends TachoMotor {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { BasicMotor } from "./basicmotor";
|
||||
|
||||
import { IDeviceInterface } from "./interfaces";
|
||||
import { IDeviceInterface } from "../interfaces";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
export class SimpleMediumLinearMotor extends BasicMotor {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { BasicMotor } from "./basicmotor";
|
||||
|
||||
import { IDeviceInterface } from "./interfaces";
|
||||
import { IDeviceInterface } from "../interfaces";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import { mapSpeed } from "./utils";
|
||||
import * as Consts from "../consts";
|
||||
import { mapSpeed } from "../utils";
|
||||
|
||||
export class TachoMotor extends BasicMotor {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { TachoMotor } from "./tachomotor";
|
||||
|
||||
import { IDeviceInterface } from "./interfaces";
|
||||
import { IDeviceInterface } from "../interfaces";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
export class TechnicLargeLinearMotor extends TachoMotor {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { TachoMotor } from "./tachomotor";
|
||||
|
||||
import { IDeviceInterface } from "./interfaces";
|
||||
import { IDeviceInterface } from "../interfaces";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
export class TechnicXLargeLinearMotor extends TachoMotor {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Device } from "./device";
|
||||
|
||||
import { IDeviceInterface } from "./interfaces";
|
||||
import { IDeviceInterface } from "../interfaces";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
export class TiltSensor extends Device {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { BasicMotor } from "./basicmotor";
|
||||
|
||||
import { IDeviceInterface } from "./interfaces";
|
||||
import { IDeviceInterface } from "../interfaces";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
export class TrainMotor extends BasicMotor {
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Peripheral } from "@abandonware/noble";
|
||||
import compareVersion from "compare-versions";
|
||||
|
||||
import { IBLEAbstraction } from "./interfaces";
|
||||
import { IBLEAbstraction } from "../interfaces";
|
||||
|
||||
import { LPF2Hub } from "./lpf2hub";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
import Debug = require("debug");
|
||||
const debug = Debug("boostmovehub");
|
@ -1,10 +1,10 @@
|
||||
import { Peripheral } from "@abandonware/noble";
|
||||
|
||||
import { IBLEAbstraction } from "./interfaces";
|
||||
import { IBLEAbstraction } from "../interfaces";
|
||||
|
||||
import { LPF2Hub } from "./lpf2hub";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
import Debug = require("debug");
|
||||
const debug = Debug("ControlPlusHub");
|
@ -2,10 +2,10 @@ import { Peripheral } from "@abandonware/noble";
|
||||
|
||||
import { LPF2Hub } from "./lpf2hub";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
import Debug = require("debug");
|
||||
import { IBLEAbstraction } from "./interfaces";
|
||||
import { IBLEAbstraction } from "../interfaces";
|
||||
const debug = Debug("duplotrainbase");
|
||||
|
||||
|
@ -1,20 +1,20 @@
|
||||
import { EventEmitter } from "events";
|
||||
|
||||
import { IBLEAbstraction } from "./interfaces";
|
||||
import { IBLEAbstraction } from "../interfaces";
|
||||
|
||||
import { ColorDistanceSensor } from "./colordistancesensor";
|
||||
import { Device } from "./device";
|
||||
import { Light } from "./light";
|
||||
import { MediumLinearMotor } from "./mediumlinearmotor";
|
||||
import { MotionSensor } from "./motionsensor";
|
||||
import { MoveHubMediumLinearMotor } from "./movehubmediumlinearmotor";
|
||||
import { SimpleMediumLinearMotor } from "./simplemediumlinearmotor";
|
||||
import { TechnicLargeLinearMotor } from "./techniclargelinearmotor";
|
||||
import { TechnicXLargeLinearMotor } from "./technicxlargelinearmotor";
|
||||
import { TiltSensor } from "./tiltsensor";
|
||||
import { TrainMotor } from "./trainmotor";
|
||||
import { ColorDistanceSensor } from "../devices/colordistancesensor";
|
||||
import { Device } from "../devices/device";
|
||||
import { Light } from "../devices/light";
|
||||
import { MediumLinearMotor } from "../devices/mediumlinearmotor";
|
||||
import { MotionSensor } from "../devices/motionsensor";
|
||||
import { MoveHubMediumLinearMotor } from "../devices/movehubmediumlinearmotor";
|
||||
import { SimpleMediumLinearMotor } from "../devices/simplemediumlinearmotor";
|
||||
import { TechnicLargeLinearMotor } from "../devices/techniclargelinearmotor";
|
||||
import { TechnicXLargeLinearMotor } from "../devices/technicxlargelinearmotor";
|
||||
import { TiltSensor } from "../devices/tiltsensor";
|
||||
import { TrainMotor } from "../devices/trainmotor";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
import Debug = require("debug");
|
||||
const debug = Debug("hub");
|
||||
@ -26,8 +26,6 @@ const debug = Debug("hub");
|
||||
*/
|
||||
export class Hub extends EventEmitter {
|
||||
|
||||
public useSpeedMap: boolean = true;
|
||||
|
||||
protected _attachedDevices: {[portId: number]: Device} = {};
|
||||
|
||||
protected _portNames: {[port: string]: number} = {};
|
@ -1,8 +1,8 @@
|
||||
import { Hub } from "./hub";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
import { decodeMACAddress, decodeVersion, toBin, toHex } from "./utils";
|
||||
import { decodeMACAddress, decodeVersion, toBin, toHex } from "../utils";
|
||||
|
||||
import Debug = require("debug");
|
||||
const debug = Debug("lpf2hub");
|
@ -1,11 +1,11 @@
|
||||
import { Peripheral } from "@abandonware/noble";
|
||||
import compareVersion from "compare-versions";
|
||||
|
||||
import { IBLEAbstraction } from "./interfaces";
|
||||
import { IBLEAbstraction } from "../interfaces";
|
||||
|
||||
import { LPF2Hub } from "./lpf2hub";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
import Debug = require("debug");
|
||||
const debug = Debug("puphub");
|
@ -1,10 +1,10 @@
|
||||
import { Peripheral } from "@abandonware/noble";
|
||||
|
||||
import { IBLEAbstraction } from "./interfaces";
|
||||
import { IBLEAbstraction } from "../interfaces";
|
||||
|
||||
import { LPF2Hub } from "./lpf2hub";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
import Debug = require("debug");
|
||||
const debug = Debug("pupremote");
|
@ -1,12 +1,12 @@
|
||||
import { Peripheral } from "@abandonware/noble";
|
||||
|
||||
import { IBLEAbstraction } from "./interfaces";
|
||||
import { IBLEAbstraction } from "../interfaces";
|
||||
|
||||
import { Hub } from "./hub";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
import * as Consts from "../consts";
|
||||
|
||||
import { isWebBluetooth } from "./utils";
|
||||
import { isWebBluetooth } from "../utils";
|
||||
|
||||
import Debug = require("debug");
|
||||
const debug = Debug("wedo2smarthub");
|
@ -2,25 +2,25 @@ import * as Consts from "./consts";
|
||||
|
||||
import { PoweredUP } from "./poweredup-browser";
|
||||
|
||||
import { BoostMoveHub } from "./boostmovehub";
|
||||
import { ControlPlusHub } from "./controlplushub";
|
||||
import { DuploTrainBase } from "./duplotrainbase";
|
||||
import { Hub } from "./hub";
|
||||
import { PUPHub } from "./puphub";
|
||||
import { PUPRemote } from "./pupremote";
|
||||
import { WeDo2SmartHub } from "./wedo2smarthub";
|
||||
import { BoostMoveHub } from "./hubs/boostmovehub";
|
||||
import { ControlPlusHub } from "./hubs/controlplushub";
|
||||
import { DuploTrainBase } from "./hubs/duplotrainbase";
|
||||
import { Hub } from "./hubs/hub";
|
||||
import { PUPHub } from "./hubs/puphub";
|
||||
import { PUPRemote } from "./hubs/pupremote";
|
||||
import { WeDo2SmartHub } from "./hubs/wedo2smarthub";
|
||||
|
||||
import { ColorDistanceSensor } from "./colordistancesensor";
|
||||
import { Device } from "./device";
|
||||
import { Light } from "./light";
|
||||
import { MediumLinearMotor } from "./mediumlinearmotor";
|
||||
import { MotionSensor } from "./motionsensor";
|
||||
import { MoveHubMediumLinearMotor } from "./movehubmediumlinearmotor";
|
||||
import { SimpleMediumLinearMotor } from "./simplemediumlinearmotor";
|
||||
import { TechnicLargeLinearMotor } from "./techniclargelinearmotor";
|
||||
import { TechnicXLargeLinearMotor } from "./technicxlargelinearmotor";
|
||||
import { TiltSensor } from "./tiltsensor";
|
||||
import { TrainMotor } from "./trainmotor";
|
||||
import { ColorDistanceSensor } from "./devices/colordistancesensor";
|
||||
import { Device } from "./devices/device";
|
||||
import { Light } from "./devices/light";
|
||||
import { MediumLinearMotor } from "./devices/mediumlinearmotor";
|
||||
import { MotionSensor } from "./devices/motionsensor";
|
||||
import { MoveHubMediumLinearMotor } from "./devices/movehubmediumlinearmotor";
|
||||
import { SimpleMediumLinearMotor } from "./devices/simplemediumlinearmotor";
|
||||
import { TechnicLargeLinearMotor } from "./devices/techniclargelinearmotor";
|
||||
import { TechnicXLargeLinearMotor } from "./devices/technicxlargelinearmotor";
|
||||
import { TiltSensor } from "./devices/tiltsensor";
|
||||
import { TrainMotor } from "./devices/trainmotor";
|
||||
|
||||
import { isWebBluetooth } from "./utils";
|
||||
|
||||
|
@ -2,25 +2,25 @@ import * as Consts from "./consts";
|
||||
|
||||
import { PoweredUP } from "./poweredup-node";
|
||||
|
||||
import { BoostMoveHub } from "./boostmovehub";
|
||||
import { ControlPlusHub } from "./controlplushub";
|
||||
import { DuploTrainBase } from "./duplotrainbase";
|
||||
import { Hub } from "./hub";
|
||||
import { PUPHub } from "./puphub";
|
||||
import { PUPRemote } from "./pupremote";
|
||||
import { WeDo2SmartHub } from "./wedo2smarthub";
|
||||
import { BoostMoveHub } from "./hubs/boostmovehub";
|
||||
import { ControlPlusHub } from "./hubs/controlplushub";
|
||||
import { DuploTrainBase } from "./hubs/duplotrainbase";
|
||||
import { Hub } from "./hubs/hub";
|
||||
import { PUPHub } from "./hubs/puphub";
|
||||
import { PUPRemote } from "./hubs/pupremote";
|
||||
import { WeDo2SmartHub } from "./hubs/wedo2smarthub";
|
||||
|
||||
import { ColorDistanceSensor } from "./colordistancesensor";
|
||||
import { Device } from "./device";
|
||||
import { Light } from "./light";
|
||||
import { MediumLinearMotor } from "./mediumlinearmotor";
|
||||
import { MotionSensor } from "./motionsensor";
|
||||
import { MoveHubMediumLinearMotor } from "./movehubmediumlinearmotor";
|
||||
import { SimpleMediumLinearMotor } from "./simplemediumlinearmotor";
|
||||
import { TechnicLargeLinearMotor } from "./techniclargelinearmotor";
|
||||
import { TechnicXLargeLinearMotor } from "./technicxlargelinearmotor";
|
||||
import { TiltSensor } from "./tiltsensor";
|
||||
import { TrainMotor } from "./trainmotor";
|
||||
import { ColorDistanceSensor } from "./devices/colordistancesensor";
|
||||
import { Device } from "./devices/device";
|
||||
import { Light } from "./devices/light";
|
||||
import { MediumLinearMotor } from "./devices/mediumlinearmotor";
|
||||
import { MotionSensor } from "./devices/motionsensor";
|
||||
import { MoveHubMediumLinearMotor } from "./devices/movehubmediumlinearmotor";
|
||||
import { SimpleMediumLinearMotor } from "./devices/simplemediumlinearmotor";
|
||||
import { TechnicLargeLinearMotor } from "./devices/techniclargelinearmotor";
|
||||
import { TechnicXLargeLinearMotor } from "./devices/technicxlargelinearmotor";
|
||||
import { TiltSensor } from "./devices/tiltsensor";
|
||||
import { TrainMotor } from "./devices/trainmotor";
|
||||
|
||||
import { isWebBluetooth } from "./utils";
|
||||
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { BoostMoveHub } from "./boostmovehub";
|
||||
import { ControlPlusHub } from "./controlplushub";
|
||||
import { DuploTrainBase } from "./duplotrainbase";
|
||||
import { Hub } from "./hub";
|
||||
import { PUPHub } from "./puphub";
|
||||
import { PUPRemote } from "./pupremote";
|
||||
import { WebBLEDevice } from "./webbleabstraction";
|
||||
import { WeDo2SmartHub } from "./wedo2smarthub";
|
||||
|
||||
import { BoostMoveHub } from "./hubs/boostmovehub";
|
||||
import { ControlPlusHub } from "./hubs/controlplushub";
|
||||
import { DuploTrainBase } from "./hubs/duplotrainbase";
|
||||
import { Hub } from "./hubs/hub";
|
||||
import { PUPHub } from "./hubs/puphub";
|
||||
import { PUPRemote } from "./hubs/pupremote";
|
||||
import { WeDo2SmartHub } from "./hubs/wedo2smarthub";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
|
||||
|
@ -1,13 +1,14 @@
|
||||
import { Peripheral } from "@abandonware/noble";
|
||||
|
||||
import { BoostMoveHub } from "./boostmovehub";
|
||||
import { ControlPlusHub } from "./controlplushub";
|
||||
import { DuploTrainBase } from "./duplotrainbase";
|
||||
import { Hub } from "./hub";
|
||||
import { NobleDevice } from "./nobleabstraction";
|
||||
import { PUPHub } from "./puphub";
|
||||
import { PUPRemote } from "./pupremote";
|
||||
import { WeDo2SmartHub } from "./wedo2smarthub";
|
||||
|
||||
import { BoostMoveHub } from "./hubs/boostmovehub";
|
||||
import { ControlPlusHub } from "./hubs/controlplushub";
|
||||
import { DuploTrainBase } from "./hubs/duplotrainbase";
|
||||
import { Hub } from "./hubs/hub";
|
||||
import { PUPHub } from "./hubs/puphub";
|
||||
import { PUPRemote } from "./hubs/pupremote";
|
||||
import { WeDo2SmartHub } from "./hubs/wedo2smarthub";
|
||||
|
||||
import * as Consts from "./consts";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user