Fixed and refactored a bunch of stuff
This commit is contained in:
parent
61cfe26b24
commit
919d7a5082
@ -1,10 +1,10 @@
|
||||
import { observer } from "mobx-react";
|
||||
import DevTools from "mobx-react-devtools";
|
||||
// import DevTools from "mobx-react-devtools";
|
||||
import * as React from "react";
|
||||
import { Container } from "semantic-ui-react";
|
||||
|
||||
import { DevicesView, MessagesView } from "@app/components";
|
||||
import MessageTest from "@app/components/MessageTest";
|
||||
// import MessageTest from "@app/components/MessageTest";
|
||||
|
||||
import "@app/styles/app.css";
|
||||
import "font-awesome/css/font-awesome.css";
|
||||
|
@ -3,12 +3,11 @@ import * as ReactDOM from "react-dom";
|
||||
import { AppContainer } from "react-hot-loader";
|
||||
|
||||
import App from "@app/components/App";
|
||||
import { MqttApiState, ProvideState, WebApiState } from "@app/state";
|
||||
import log from "@common/logger";
|
||||
import { ProvideState, WebApiState } from "@app/state";
|
||||
// import log from "@common/logger";
|
||||
|
||||
Object.assign(log, { name: "sprinklers3/app", level: "debug" });
|
||||
// Object.assign(log, { name: "sprinklers3/app", level: "debug" });
|
||||
|
||||
// const state = new MqttApiState();
|
||||
const state = new WebApiState();
|
||||
state.start();
|
||||
|
||||
|
@ -6,7 +6,8 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
||||
const CaseSensitivePathsPlugin = require("case-sensitive-paths-webpack-plugin");
|
||||
const WatchMissingNodeModulesPlugin = require("react-dev-utils/WatchMissingNodeModulesPlugin");
|
||||
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
|
||||
// const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
|
||||
const MinifyPlugin = require("babel-minify-webpack-plugin");
|
||||
|
||||
const { getClientEnvironment } = require("../env");
|
||||
const paths = require("../paths");
|
||||
@ -99,7 +100,7 @@ const rules = (env) => {
|
||||
test: /\.tsx?$/,
|
||||
enforce: "pre",
|
||||
loader: require.resolve("tslint-loader"),
|
||||
options: { typecheck: true, tsConfigFile: paths.appTsConfig },
|
||||
options: { typeCheck: true, tsConfigFile: paths.appTsConfig },
|
||||
},
|
||||
{
|
||||
// "oneOf" will traverse all following loaders until one will
|
||||
@ -183,7 +184,11 @@ const getConfig = module.exports = (env) => {
|
||||
isProd && new ExtractTextPlugin({
|
||||
filename: cssFilename,
|
||||
}),
|
||||
isProd && new UglifyJsPlugin({
|
||||
// TODO: doesn't work with typescript target: es6
|
||||
// isProd && new UglifyJsPlugin({
|
||||
// sourceMap: shouldUseSourceMap,
|
||||
// }),
|
||||
isProd && new MinifyPlugin({}, {
|
||||
sourceMap: shouldUseSourceMap,
|
||||
}),
|
||||
isDev && new webpack.NamedModulesPlugin(),
|
||||
|
@ -81,10 +81,6 @@ function filter(value: any) {
|
||||
return result;
|
||||
}
|
||||
|
||||
function asISODate(time: string) {
|
||||
return new Date(time).toISOString();
|
||||
}
|
||||
|
||||
function formatSource(value: any): { str: string, args: any[] } {
|
||||
if (value.source) {
|
||||
return { str: "%c(" + value.source + ") ", args: ["color: #FF00FF"] };
|
||||
|
@ -209,6 +209,7 @@ class MqttSprinklersDevice extends s.SprinklersDevice {
|
||||
});
|
||||
}
|
||||
|
||||
/* tslint:disable:no-unused-variable */
|
||||
@handler(/^connected$/)
|
||||
private handleConnected(payload: string) {
|
||||
this.connected = (payload === "true");
|
||||
@ -261,6 +262,7 @@ class MqttSprinklersDevice extends s.SprinklersDevice {
|
||||
cb(data);
|
||||
}
|
||||
}
|
||||
/* tslint:enable:no-unused-variable */
|
||||
}
|
||||
|
||||
interface IResponseData {
|
||||
|
66
package.json
66
package.json
@ -31,6 +31,15 @@
|
||||
},
|
||||
"homepage": "https://github.com/amikhalev/sprinklers3#readme",
|
||||
"dependencies": {
|
||||
"express": "^4.15.4",
|
||||
"express-pino-logger": "^2.0.0",
|
||||
"mobx": "^3.1.11",
|
||||
"module-alias": "^2.0.1",
|
||||
"mqtt": "^2.13.0",
|
||||
"pino": "^4.7.2",
|
||||
"serializr": "^1.1.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/async": "^2.0.43",
|
||||
"@types/chalk": "^0.4.31",
|
||||
"@types/classnames": "^2.2.0",
|
||||
@ -42,60 +51,59 @@
|
||||
"@types/object-assign": "^4.0.30",
|
||||
"@types/pino": "^4.7.0",
|
||||
"@types/prop-types": "^15.5.1",
|
||||
"@types/react": "^16",
|
||||
"@types/react-dom": "^15.5.0",
|
||||
"@types/react": "^16.0.10",
|
||||
"@types/react-dom": "^16.0.1",
|
||||
"@types/react-fontawesome": "^1.5.0",
|
||||
"@types/react-hot-loader": "^3.0.4",
|
||||
"@types/webpack-env": "^1.13.0",
|
||||
"@types/ws": "^3.2.0",
|
||||
"async": "^2.5.0",
|
||||
"autoprefixer": "^7.1.4",
|
||||
"awesome-typescript-loader": "^3.1.3",
|
||||
"babel-minify-webpack-plugin": "^0.2.0",
|
||||
"case-sensitive-paths-webpack-plugin": "^2.1.1",
|
||||
"classnames": "^2.2.5",
|
||||
"css-loader": "^0.28.4",
|
||||
"dotenv": "^4.0.0",
|
||||
"express": "^4.15.4",
|
||||
"express-pino-logger": "^2.0.0",
|
||||
"extract-text-webpack-plugin": "^3.0.0",
|
||||
"file-loader": "^1.1.5",
|
||||
"font-awesome": "^4.7.0",
|
||||
"html-webpack-plugin": "^2.28.0",
|
||||
"lodash": "^4.17.4",
|
||||
"mobx": "^3.1.11",
|
||||
"mobx-react": "^4.2.1",
|
||||
"module-alias": "^2.0.1",
|
||||
"mqtt": "^2.13.0",
|
||||
"mobx-react-devtools": "^4.2.13",
|
||||
"nodemon": "^1.12.1",
|
||||
"npm-run-all": "^4.1.1",
|
||||
"object-assign": "^4.1.1",
|
||||
"pino": "^4.7.2",
|
||||
"postcss-flexbugs-fixes": "^3.2.0",
|
||||
"postcss-loader": "^2.0.6",
|
||||
"promise": "^8.0.1",
|
||||
"prop-types": "^15.5.10",
|
||||
"react": ">=15.6.1 <16",
|
||||
"react": "^16.0.0",
|
||||
"react-dev-utils": "^4.1.0",
|
||||
"react-dom": ">=15.6.1 <16",
|
||||
"react-dom": "^16.0.0",
|
||||
"react-fontawesome": "^1.6.1",
|
||||
"semantic-ui-css": "^2.2.10",
|
||||
"semantic-ui-react": "^0.73.0",
|
||||
"serializr": "^1.1.13",
|
||||
"tslint-loader": "^3.5.3",
|
||||
"uglifyjs-webpack-plugin": "^0.4.6",
|
||||
"url-loader": "^0.5.9",
|
||||
"ws": "^3.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/webpack-env": "^1.13.0",
|
||||
"awesome-typescript-loader": "^3.1.3",
|
||||
"css-loader": "^0.28.4",
|
||||
"file-loader": "^0.11.1",
|
||||
"html-webpack-plugin": "^2.28.0",
|
||||
"mobx-react-devtools": "^4.2.13",
|
||||
"nodemon": "^1.12.1",
|
||||
"npm-run-all": "^4.1.1",
|
||||
"react-hot-loader": "^3.0.0-beta.6",
|
||||
"semantic-ui-css": "^2.2.10",
|
||||
"semantic-ui-react": "^0.74.2",
|
||||
"source-map-loader": "^0.2.1",
|
||||
"style-loader": "^0.18.1",
|
||||
"style-loader": "^0.19.0",
|
||||
"ts-loader": "^2.1.0",
|
||||
"tslint": "^5.4.2",
|
||||
"tslint-loader": "^3.5.3",
|
||||
"tslint-react": "^3.2.0",
|
||||
"typescript": "^2.3.4",
|
||||
"uglifyjs-webpack-plugin": "^0.4.6",
|
||||
"url-loader": "^0.6.2",
|
||||
"webpack": "^3.0.0",
|
||||
"webpack-dev-server": "^2.4.4"
|
||||
"webpack-dev-server": "^2.4.4",
|
||||
"ws": "^3.2.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"**/@types/react": "16.0.10",
|
||||
"**/@types/react-dom": "16.0.1",
|
||||
"**/react": "16.0.0",
|
||||
"**/react-dom": "16.0.0",
|
||||
"**/uglify-es": "3.1.3"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user