Updated dependencies, fixed build
This commit is contained in:
parent
d13a0a50e5
commit
bee49922ad
@ -19,7 +19,7 @@ const ConnectionState = ({connected}: { connected: boolean }) =>
|
||||
</span>;
|
||||
|
||||
@observer
|
||||
export default class DeviceView extends React.PureComponent<{ device: SprinklersDevice }, void> {
|
||||
export default class DeviceView extends React.PureComponent<{ device: SprinklersDevice }, {}> {
|
||||
render() {
|
||||
const {id, connected, sections, programs} = this.props.device;
|
||||
return (
|
||||
|
@ -5,7 +5,7 @@ import {Input} from "semantic-ui-react";
|
||||
export default class DurationInput extends React.Component<{
|
||||
duration: Duration,
|
||||
onDurationChange?: (newDuration: Duration) => void;
|
||||
}, void> {
|
||||
}, {}> {
|
||||
render() {
|
||||
const duration = this.props.duration;
|
||||
// const editing = this.props.onDurationChange != null;
|
||||
|
@ -4,7 +4,7 @@ import {UiStore, Message as UiMessage} from "../ui";
|
||||
import {Message} from "semantic-ui-react";
|
||||
|
||||
@observer
|
||||
export default class MessagesView extends React.PureComponent<{ uiStore: UiStore }, void> {
|
||||
export default class MessagesView extends React.PureComponent<{ uiStore: UiStore }, {}> {
|
||||
render() {
|
||||
return <div>
|
||||
{this.props.uiStore.messages.map(this.renderMessage)}
|
||||
|
@ -4,7 +4,7 @@ import {Program, Schedule} from "../sprinklers";
|
||||
import {Table} from "semantic-ui-react";
|
||||
|
||||
@observer
|
||||
export class ScheduleView extends React.PureComponent<{ schedule: Schedule }, void> {
|
||||
export class ScheduleView extends React.PureComponent<{ schedule: Schedule }, {}> {
|
||||
render() {
|
||||
return (
|
||||
<div>{JSON.stringify(this.props.schedule)}</div>
|
||||
@ -13,7 +13,7 @@ export class ScheduleView extends React.PureComponent<{ schedule: Schedule }, vo
|
||||
}
|
||||
|
||||
@observer
|
||||
export default class ProgramTable extends React.PureComponent<{ programs: Program[] }, void> {
|
||||
export default class ProgramTable extends React.PureComponent<{ programs: Program[] }, {}> {
|
||||
private static renderRow(program: Program, i: number): JSX.Element[] {
|
||||
if (!program) {
|
||||
return null;
|
||||
|
@ -9,7 +9,7 @@ import {Section} from "../sprinklers";
|
||||
/* tslint:disable:object-literal-sort-keys */
|
||||
|
||||
@observer
|
||||
export default class SectionTable extends React.PureComponent<{ sections: Section[] }, void> {
|
||||
export default class SectionTable extends React.PureComponent<{ sections: Section[] }, {}> {
|
||||
private static renderRow(section: Section, index: number) {
|
||||
if (!section) {
|
||||
return null;
|
||||
|
@ -6,7 +6,6 @@ import {
|
||||
SprinklersDevice, ISprinklersApi, Section, Program, Schedule, ITimeOfDay, Duration, SectionRunner, ISectionRun,
|
||||
} from "./sprinklers";
|
||||
import {checkedIndexOf} from "./utils";
|
||||
import * as Promise from "bluebird";
|
||||
|
||||
export class MqttApiClient extends EventEmitter implements ISprinklersApi {
|
||||
private static newClientId() {
|
||||
@ -167,6 +166,7 @@ class MqttSprinklersDevice extends SprinklersDevice {
|
||||
matches = topic.match(/^section_runner$/);
|
||||
if (matches != null) {
|
||||
(this.sectionRunner as MqttSectionRunner).onMessage(null, payload);
|
||||
return;
|
||||
}
|
||||
matches = topic.match(/^responses\/(\d+)$/);
|
||||
if (matches != null) {
|
||||
@ -340,7 +340,11 @@ class MqttSectionRunner extends SectionRunner {
|
||||
}
|
||||
|
||||
updateFromJSON(json: ISectionRunnerJSON) {
|
||||
this.queue.replace(json.queue);
|
||||
if (!json.queue) { // null means empty queue
|
||||
this.queue.clear();
|
||||
} else {
|
||||
this.queue.replace(json.queue);
|
||||
}
|
||||
this.current = json.current;
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ export class SectionRunner {
|
||||
this.device = device;
|
||||
}
|
||||
|
||||
cancelRunById(id: number): Promise<void> {
|
||||
cancelRunById(id: number): Promise<{}> {
|
||||
return this.device.cancelSectionRunById(id);
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ export abstract class SprinklersDevice {
|
||||
|
||||
abstract runProgram(program: number | Program): Promise<{}>;
|
||||
|
||||
abstract cancelSectionRunById(id: number): Promise<void>;
|
||||
abstract cancelSectionRunById(id: number): Promise<{}>;
|
||||
|
||||
abstract get id(): string;
|
||||
}
|
||||
|
10
package.json
10
package.json
@ -22,15 +22,15 @@
|
||||
},
|
||||
"homepage": "https://github.com/amikhalev/sprinklers3#readme",
|
||||
"dependencies": {
|
||||
"@types/bluebird": "^3.5.5",
|
||||
"@types/classnames": "^2.2.0",
|
||||
"@types/node": "^7.0.27",
|
||||
"@types/core-js": "^0.9.42",
|
||||
"@types/node": "^8.0.6",
|
||||
"@types/object-assign": "^4.0.30",
|
||||
"@types/react": "^15.0.26",
|
||||
"@types/react-dom": "^15.5.0",
|
||||
"@types/react-fontawesome": "^1.5.0",
|
||||
"bluebird": "^3.5.0",
|
||||
"classnames": "^2.2.5",
|
||||
"core-js": "^2.4.1",
|
||||
"font-awesome": "^4.7.0",
|
||||
"mobx": "^3.1.11",
|
||||
"mobx-react": "^4.2.1",
|
||||
@ -40,7 +40,7 @@
|
||||
"react-dom": "^15.5.4",
|
||||
"react-fontawesome": "^1.6.1",
|
||||
"semantic-ui-css": "^2.2.10",
|
||||
"semantic-ui-react": "^0.68.5",
|
||||
"semantic-ui-react": "^0.70.0",
|
||||
"webpack-merge": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -56,7 +56,7 @@
|
||||
"ts-loader": "^2.1.0",
|
||||
"tslint": "^5.4.2",
|
||||
"typescript": "^2.3.4",
|
||||
"webpack": "^2.6.1",
|
||||
"webpack": "^3.0.0",
|
||||
"webpack-dev-server": "^2.4.4"
|
||||
},
|
||||
"false": {}
|
||||
|
@ -4,6 +4,7 @@
|
||||
"jsx": "react",
|
||||
"experimentalDecorators": true,
|
||||
"target": "es5",
|
||||
"lib": ["es6", "dom"],
|
||||
"typeRoots": ["node_modules/@types"]
|
||||
},
|
||||
"files": [
|
||||
@ -11,4 +12,4 @@
|
||||
"./app/script/paho-mqtt.d.ts",
|
||||
"./app/script/index.tsx"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,8 @@ module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{ test: /\.css$/, loader: "style-loader!css-loader" },
|
||||
{ test: /\.(ttf|eot|svg|woff(2)?|png|jpg)(\?[a-z0-9=&.]+)?$/, loader: "file-loader" }
|
||||
{ test: /\.(ttf|eot|svg|woff(2)?|png|jpg)(\?[a-z0-9=&.]+)?$/, loader: "file-loader" },
|
||||
{ test: /\.tsx?$/, loader: "awesome-typescript-loader" },
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
|
@ -7,17 +7,13 @@ module.exports = webpackMerge.smart(base, {
|
||||
"react-hot-loader/patch",
|
||||
"webpack-dev-server/client?http://localhost:8080",
|
||||
"webpack/hot/only-dev-server",
|
||||
"core-js",
|
||||
"./app/script/index.tsx"
|
||||
],
|
||||
devtool: "inline-source-map",
|
||||
module: {
|
||||
rules: [
|
||||
{ test: /\.tsx?$/, loaders: ["react-hot-loader/webpack", "awesome-typescript-loader"] },
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new webpack.NamedModulesPlugin(),
|
||||
new webpack.HotModuleReplacementPlugin()
|
||||
// new webpack.HotModuleReplacementPlugin(),
|
||||
],
|
||||
devServer: {
|
||||
hot: true
|
||||
|
@ -3,14 +3,10 @@ const base = require("./base.config");
|
||||
|
||||
module.exports = webpackMerge.smart(base, {
|
||||
entry: [
|
||||
"core-js",
|
||||
"./app/script/index.tsx"
|
||||
],
|
||||
devtool: "none",
|
||||
module: {
|
||||
rules: [
|
||||
{ test: /\.tsx?$/, loader: "awesome-typescript-loader" },
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
]
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user