Better directory structure

This commit is contained in:
Nathan Kellenicki 2019-12-16 17:31:22 -08:00
parent 406e9e99bc
commit 225f331811
26 changed files with 110 additions and 110 deletions

View File

@ -6,8 +6,8 @@
"main": "dist/node/index-node.js", "main": "dist/node/index-node.js",
"types": "dist/node/index-node.d.ts", "types": "dist/node/index-node.d.ts",
"scripts": { "scripts": {
"build:node": "tslint -c tslint.json \"./src/*.ts\" && tsc", "build:node": "tslint -c tslint.json \"./src/**/*.ts\" && tsc",
"build:browser": "tslint -c tslint.json \"./src/*.ts\" && webpack --mode=production", "build:browser": "tslint -c tslint.json \"./src/**/*.ts\" && webpack --mode=production",
"build:all": "tslint -c tslint.json \"./src/*.ts\" && tsc && 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", "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", "all": "npm run build:all && npm run docs",

View File

@ -1,10 +1,10 @@
import { Device } from "./device"; 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 { export class BasicMotor extends Device {

View File

@ -1,8 +1,8 @@
import { Device } from "./device"; 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 { export class ColorDistanceSensor extends Device {

View File

@ -1,8 +1,8 @@
import { EventEmitter } from "events"; 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 { export class Device extends EventEmitter {

View File

@ -1,8 +1,8 @@
import { Device } from "./device"; 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 { export class Light extends Device {

View File

@ -1,8 +1,8 @@
import { TachoMotor } from "./tachomotor"; 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 { export class MediumLinearMotor extends TachoMotor {

View File

@ -1,8 +1,8 @@
import { Device } from "./device"; 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 { export class MotionSensor extends Device {

View File

@ -1,8 +1,8 @@
import { TachoMotor } from "./tachomotor"; 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 { export class MoveHubMediumLinearMotor extends TachoMotor {

View File

@ -1,8 +1,8 @@
import { BasicMotor } from "./basicmotor"; 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 { export class SimpleMediumLinearMotor extends BasicMotor {

View File

@ -1,9 +1,9 @@
import { BasicMotor } from "./basicmotor"; import { BasicMotor } from "./basicmotor";
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 TachoMotor extends BasicMotor { export class TachoMotor extends BasicMotor {

View File

@ -1,8 +1,8 @@
import { TachoMotor } from "./tachomotor"; 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 { export class TechnicLargeLinearMotor extends TachoMotor {

View File

@ -1,8 +1,8 @@
import { TachoMotor } from "./tachomotor"; 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 { export class TechnicXLargeLinearMotor extends TachoMotor {

View File

@ -1,8 +1,8 @@
import { Device } from "./device"; 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 { export class TiltSensor extends Device {

View File

@ -1,8 +1,8 @@
import { BasicMotor } from "./basicmotor"; 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 { export class TrainMotor extends BasicMotor {

View File

@ -1,11 +1,11 @@
import { Peripheral } from "@abandonware/noble"; import { Peripheral } from "@abandonware/noble";
import compareVersion from "compare-versions"; import compareVersion from "compare-versions";
import { IBLEAbstraction } from "./interfaces"; import { IBLEAbstraction } from "../interfaces";
import { LPF2Hub } from "./lpf2hub"; import { LPF2Hub } from "./lpf2hub";
import * as Consts from "./consts"; import * as Consts from "../consts";
import Debug = require("debug"); import Debug = require("debug");
const debug = Debug("boostmovehub"); const debug = Debug("boostmovehub");

View File

@ -1,10 +1,10 @@
import { Peripheral } from "@abandonware/noble"; import { Peripheral } from "@abandonware/noble";
import { IBLEAbstraction } from "./interfaces"; import { IBLEAbstraction } from "../interfaces";
import { LPF2Hub } from "./lpf2hub"; import { LPF2Hub } from "./lpf2hub";
import * as Consts from "./consts"; import * as Consts from "../consts";
import Debug = require("debug"); import Debug = require("debug");
const debug = Debug("ControlPlusHub"); const debug = Debug("ControlPlusHub");

View File

@ -2,10 +2,10 @@ import { Peripheral } from "@abandonware/noble";
import { LPF2Hub } from "./lpf2hub"; import { LPF2Hub } from "./lpf2hub";
import * as Consts from "./consts"; import * as Consts from "../consts";
import Debug = require("debug"); import Debug = require("debug");
import { IBLEAbstraction } from "./interfaces"; import { IBLEAbstraction } from "../interfaces";
const debug = Debug("duplotrainbase"); const debug = Debug("duplotrainbase");

View File

@ -1,20 +1,20 @@
import { EventEmitter } from "events"; import { EventEmitter } from "events";
import { IBLEAbstraction } from "./interfaces"; import { IBLEAbstraction } from "../interfaces";
import { ColorDistanceSensor } from "./colordistancesensor"; import { ColorDistanceSensor } from "../devices/colordistancesensor";
import { Device } from "./device"; import { Device } from "../devices/device";
import { Light } from "./light"; import { Light } from "../devices/light";
import { MediumLinearMotor } from "./mediumlinearmotor"; import { MediumLinearMotor } from "../devices/mediumlinearmotor";
import { MotionSensor } from "./motionsensor"; import { MotionSensor } from "../devices/motionsensor";
import { MoveHubMediumLinearMotor } from "./movehubmediumlinearmotor"; import { MoveHubMediumLinearMotor } from "../devices/movehubmediumlinearmotor";
import { SimpleMediumLinearMotor } from "./simplemediumlinearmotor"; import { SimpleMediumLinearMotor } from "../devices/simplemediumlinearmotor";
import { TechnicLargeLinearMotor } from "./techniclargelinearmotor"; import { TechnicLargeLinearMotor } from "../devices/techniclargelinearmotor";
import { TechnicXLargeLinearMotor } from "./technicxlargelinearmotor"; import { TechnicXLargeLinearMotor } from "../devices/technicxlargelinearmotor";
import { TiltSensor } from "./tiltsensor"; import { TiltSensor } from "../devices/tiltsensor";
import { TrainMotor } from "./trainmotor"; import { TrainMotor } from "../devices/trainmotor";
import * as Consts from "./consts"; import * as Consts from "../consts";
import Debug = require("debug"); import Debug = require("debug");
const debug = Debug("hub"); const debug = Debug("hub");
@ -26,8 +26,6 @@ const debug = Debug("hub");
*/ */
export class Hub extends EventEmitter { export class Hub extends EventEmitter {
public useSpeedMap: boolean = true;
protected _attachedDevices: {[portId: number]: Device} = {}; protected _attachedDevices: {[portId: number]: Device} = {};
protected _portNames: {[port: string]: number} = {}; protected _portNames: {[port: string]: number} = {};

View File

@ -1,8 +1,8 @@
import { Hub } from "./hub"; 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"); import Debug = require("debug");
const debug = Debug("lpf2hub"); const debug = Debug("lpf2hub");

View File

@ -1,11 +1,11 @@
import { Peripheral } from "@abandonware/noble"; import { Peripheral } from "@abandonware/noble";
import compareVersion from "compare-versions"; import compareVersion from "compare-versions";
import { IBLEAbstraction } from "./interfaces"; import { IBLEAbstraction } from "../interfaces";
import { LPF2Hub } from "./lpf2hub"; import { LPF2Hub } from "./lpf2hub";
import * as Consts from "./consts"; import * as Consts from "../consts";
import Debug = require("debug"); import Debug = require("debug");
const debug = Debug("puphub"); const debug = Debug("puphub");

View File

@ -1,10 +1,10 @@
import { Peripheral } from "@abandonware/noble"; import { Peripheral } from "@abandonware/noble";
import { IBLEAbstraction } from "./interfaces"; import { IBLEAbstraction } from "../interfaces";
import { LPF2Hub } from "./lpf2hub"; import { LPF2Hub } from "./lpf2hub";
import * as Consts from "./consts"; import * as Consts from "../consts";
import Debug = require("debug"); import Debug = require("debug");
const debug = Debug("pupremote"); const debug = Debug("pupremote");

View File

@ -1,12 +1,12 @@
import { Peripheral } from "@abandonware/noble"; import { Peripheral } from "@abandonware/noble";
import { IBLEAbstraction } from "./interfaces"; import { IBLEAbstraction } from "../interfaces";
import { Hub } from "./hub"; 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"); import Debug = require("debug");
const debug = Debug("wedo2smarthub"); const debug = Debug("wedo2smarthub");

View File

@ -2,25 +2,25 @@ import * as Consts from "./consts";
import { PoweredUP } from "./poweredup-browser"; import { PoweredUP } from "./poweredup-browser";
import { BoostMoveHub } from "./boostmovehub"; import { BoostMoveHub } from "./hubs/boostmovehub";
import { ControlPlusHub } from "./controlplushub"; import { ControlPlusHub } from "./hubs/controlplushub";
import { DuploTrainBase } from "./duplotrainbase"; import { DuploTrainBase } from "./hubs/duplotrainbase";
import { Hub } from "./hub"; import { Hub } from "./hubs/hub";
import { PUPHub } from "./puphub"; import { PUPHub } from "./hubs/puphub";
import { PUPRemote } from "./pupremote"; import { PUPRemote } from "./hubs/pupremote";
import { WeDo2SmartHub } from "./wedo2smarthub"; import { WeDo2SmartHub } from "./hubs/wedo2smarthub";
import { ColorDistanceSensor } from "./colordistancesensor"; import { ColorDistanceSensor } from "./devices/colordistancesensor";
import { Device } from "./device"; import { Device } from "./devices/device";
import { Light } from "./light"; import { Light } from "./devices/light";
import { MediumLinearMotor } from "./mediumlinearmotor"; import { MediumLinearMotor } from "./devices/mediumlinearmotor";
import { MotionSensor } from "./motionsensor"; import { MotionSensor } from "./devices/motionsensor";
import { MoveHubMediumLinearMotor } from "./movehubmediumlinearmotor"; import { MoveHubMediumLinearMotor } from "./devices/movehubmediumlinearmotor";
import { SimpleMediumLinearMotor } from "./simplemediumlinearmotor"; import { SimpleMediumLinearMotor } from "./devices/simplemediumlinearmotor";
import { TechnicLargeLinearMotor } from "./techniclargelinearmotor"; import { TechnicLargeLinearMotor } from "./devices/techniclargelinearmotor";
import { TechnicXLargeLinearMotor } from "./technicxlargelinearmotor"; import { TechnicXLargeLinearMotor } from "./devices/technicxlargelinearmotor";
import { TiltSensor } from "./tiltsensor"; import { TiltSensor } from "./devices/tiltsensor";
import { TrainMotor } from "./trainmotor"; import { TrainMotor } from "./devices/trainmotor";
import { isWebBluetooth } from "./utils"; import { isWebBluetooth } from "./utils";

View File

@ -2,25 +2,25 @@ import * as Consts from "./consts";
import { PoweredUP } from "./poweredup-node"; import { PoweredUP } from "./poweredup-node";
import { BoostMoveHub } from "./boostmovehub"; import { BoostMoveHub } from "./hubs/boostmovehub";
import { ControlPlusHub } from "./controlplushub"; import { ControlPlusHub } from "./hubs/controlplushub";
import { DuploTrainBase } from "./duplotrainbase"; import { DuploTrainBase } from "./hubs/duplotrainbase";
import { Hub } from "./hub"; import { Hub } from "./hubs/hub";
import { PUPHub } from "./puphub"; import { PUPHub } from "./hubs/puphub";
import { PUPRemote } from "./pupremote"; import { PUPRemote } from "./hubs/pupremote";
import { WeDo2SmartHub } from "./wedo2smarthub"; import { WeDo2SmartHub } from "./hubs/wedo2smarthub";
import { ColorDistanceSensor } from "./colordistancesensor"; import { ColorDistanceSensor } from "./devices/colordistancesensor";
import { Device } from "./device"; import { Device } from "./devices/device";
import { Light } from "./light"; import { Light } from "./devices/light";
import { MediumLinearMotor } from "./mediumlinearmotor"; import { MediumLinearMotor } from "./devices/mediumlinearmotor";
import { MotionSensor } from "./motionsensor"; import { MotionSensor } from "./devices/motionsensor";
import { MoveHubMediumLinearMotor } from "./movehubmediumlinearmotor"; import { MoveHubMediumLinearMotor } from "./devices/movehubmediumlinearmotor";
import { SimpleMediumLinearMotor } from "./simplemediumlinearmotor"; import { SimpleMediumLinearMotor } from "./devices/simplemediumlinearmotor";
import { TechnicLargeLinearMotor } from "./techniclargelinearmotor"; import { TechnicLargeLinearMotor } from "./devices/techniclargelinearmotor";
import { TechnicXLargeLinearMotor } from "./technicxlargelinearmotor"; import { TechnicXLargeLinearMotor } from "./devices/technicxlargelinearmotor";
import { TiltSensor } from "./tiltsensor"; import { TiltSensor } from "./devices/tiltsensor";
import { TrainMotor } from "./trainmotor"; import { TrainMotor } from "./devices/trainmotor";
import { isWebBluetooth } from "./utils"; import { isWebBluetooth } from "./utils";

View File

@ -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 { 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"; import * as Consts from "./consts";

View File

@ -1,13 +1,14 @@
import { Peripheral } from "@abandonware/noble"; 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 { NobleDevice } from "./nobleabstraction";
import { PUPHub } from "./puphub";
import { PUPRemote } from "./pupremote"; import { BoostMoveHub } from "./hubs/boostmovehub";
import { WeDo2SmartHub } from "./wedo2smarthub"; 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"; import * as Consts from "./consts";