Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

UI updates: dependency updates and toolchain cleanup

Rich Turner25d57fd74d8d
diff --git a/package.json b/package.json
index 1ecad51c7..1d1482935 100644
--- a/package.json
+++ b/package.json
@@ -1,10 +1,10 @@
{
"private": true,
"workspaces": [
+ "ui/util",
"ui/app/*",
"ui/component/*",
- "ui/demo/*",
- "client/src/main/webapp"
+ "ui/demo/*"
],
"devDependencies": {
"lerna": "^3.18.1"
diff --git a/ui/app/main/package.json b/ui/app/main/package.json
index 4ddc50ff8..84fe640fc 100644
--- a/ui/app/main/package.json
+++ b/ui/app/main/package.json
@@ -1,16 +1,16 @@
{
- "name": "demo",
+ "name": "@openremote/main",
"version": "1.0.4",
- "description": "Demo App",
+ "description": "OpenRemote Main App",
"author": "OpenRemote",
"license": "AGPL-3.0-or-later",
"private": true,
"scripts": {
"clean": "npx shx rm -rf dist",
- "modelBuild": "node ../../model-build.js",
- "modelWatch": "node ../../model-watch.js",
+ "modelBuild": "npx orutil build",
+ "modelWatch": "npx orutil watch",
"build": "npx tsc -b -f && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack --mode production",
- "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack-dev-server --mode development",
+ "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack serve --mode development",
"watch": "npx tsc -b -w",
"test": "echo \"Error: no test specified\" && exit 1"
},
@@ -18,29 +18,8 @@
"@openremote/or-app": "^1.0.4"
},
"devDependencies": {
- "@babel/core": "^7.2.2",
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
- "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
- "@babel/plugin-transform-regenerator": "^7.0.0",
- "@babel/plugin-transform-runtime": "^7.8.3",
- "@babel/preset-env": "^7.8.3",
- "@babel/runtime": "^7.8.3",
- "babel-loader": "^8.0.4",
- "copy-webpack-plugin": "^7.0.0",
- "cross-env": "^7.0.3",
- "css-loader": "^5.0.1",
- "fast-async": "^6.3.8",
- "file-loader": "^6.2.0",
- "html-webpack-plugin": "^5.0.0-beta.6",
- "raw-loader": "^4.0.2",
- "shx": "^0.3.2",
- "source-map-loader": "^2.0.0",
- "style-loader": "^2.0.0",
+ "@openremote/util": "^1.0.4",
"tslint": ">=5.11.0",
- "typescript": ">=4.1.3",
- "url-loader": "^4.1.1",
- "webpack": "^5.16.0",
- "webpack-cli": "^4.4.0",
- "webpack-dev-server": "^3.9.0"
+ "typescript": ">=4.1.3"
}
}
diff --git a/ui/app/main/webpack.config.js b/ui/app/main/webpack.config.js
index 189be51b6..821504319 100644
--- a/ui/app/main/webpack.config.js
+++ b/ui/app/main/webpack.config.js
@@ -1,120 +1,6 @@
-var webpack = require("webpack");
-var path = require("path");
-var CopyWebpackPlugin = require("copy-webpack-plugin");
-var HtmlWebpackPlugin = require("html-webpack-plugin");
-
-var config = {
- entry: {
- 'bundle': './src/index.js'
- },
- output: {
- path: __dirname + "/dist",
- publicPath: "",
- filename: "[name].[hash].js"
- },
- module: {
- rules: [
- {
- test: /\.css$/,
- use: [
- { loader: "css-loader" }
- ]
- },
- {
- test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
- loader: 'url-loader',
- options: {
- outputPath: "images/",
- limit: 10000,
- },
- }
- ]
- }
-};
+const util = require("@openremote/util");
module.exports = (env, argv) => {
-
- const production = argv.mode === "production";
- const managerUrl = production ? undefined : "http://localhost:8080";
- const IS_DEV_SERVER = process.argv.find(arg => arg.includes('webpack-dev-server'));
- const OUTPUT_PATH = IS_DEV_SERVER ? 'src' : 'dist';
-
- // Only use babel for production otherwise source maps don't work
- if (production) {
- config.module.rules.push(
- {
- test: /\.js$/,
- include: function(modulePath) {
- return /(@webcomponents[\/|\\]shadycss|lit-css|styled-lit-element|lit-element|lit-html|@polymer|@lit|pwa-helpers)/.test(modulePath) || !/node_modules/.test(modulePath);
- },
- use: [
- {
- loader: 'babel-loader'
- }
- ]
- },
- );
- } else {
- config.module.rules.push(
- {
- test: /\.js$/,
- use: ["source-map-loader"],
- enforce: "pre",
- exclude: [
- /node_modules/
- ]
- },
- );
- }
-
- config.plugins = [
- // Conditional compilation variables
- new webpack.DefinePlugin({
- PRODUCTION: JSON.stringify(production),
- MANAGER_URL: JSON.stringify(managerUrl),
- "process.env": {
- BABEL_ENV: JSON.stringify(argv.mode)
- }
- }),
- new HtmlWebpackPlugin({
- chunksSortMode: 'none',
- inject: false,
- template: 'index.html'
- }),
- new CopyWebpackPlugin([
- {
- from: path.dirname(require.resolve("@webcomponents/webcomponentsjs")),
- to: "modules/@webcomponents/webcomponentsjs",
- ignore: "!*.js"
- },
- // {
- // from: path.join(path.dirname(require.resolve("@openremote/or-app/package.json")), "locales"),
- // to: "locales"
- // },
- {
- from: "./images",
- to: "images"
- }
- // {
- // from: "./locales",
- // to: "locales"
- // }
- ])
- ];
-
- config.devtool = production ? false :"inline-source-map",
- config.devServer = {
- historyApiFallback: {
- index: "/" + __dirname.split(path.sep).slice(-1)[0] + "/",
- },
- port: 9000,
- publicPath: "/" + __dirname.split(path.sep).slice(-1)[0] + "/",
- contentBase: OUTPUT_PATH,
- disableHostCheck: true
- };
- config.watchOptions = {
- ignored: ['**/*.ts', 'node_modules']
- }
-
- return config;
-};
\ No newline at end of file
+ const IS_DEV_SERVER = process.argv.find(arg => arg.includes('webpack serve'));
+ return util.getAppConfig(argv.mode, IS_DEV_SERVER, __dirname);
+};
diff --git a/ui/app/mobile/package.json b/ui/app/mobile/package.json
index 3a9f56ee0..eb9d71aaf 100644
--- a/ui/app/mobile/package.json
+++ b/ui/app/mobile/package.json
@@ -7,10 +7,10 @@
"private": true,
"scripts": {
"clean": "npx shx rm -rf dist",
- "modelBuild": "node ../../model-build.js",
- "modelWatch": "node ../../model-watch.js",
- "build": "npx tsc -b && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack --mode production",
- "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack-dev-server --host 0.0.0.0 --mode development",
+ "modelBuild": "npx orutil build",
+ "modelWatch": "npx orutil watch",
+ "build": "npx tsc -b -f && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack --mode production",
+ "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack serve --host 0.0.0.0 --mode development",
"watch": "npx tsc -b -w",
"test": "echo \"Error: no test specified\" && exit 1"
},
@@ -18,29 +18,8 @@
"@openremote/or-app": "^1.0.4"
},
"devDependencies": {
- "@babel/core": "^7.2.2",
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
- "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
- "@babel/plugin-transform-regenerator": "^7.0.0",
- "@babel/plugin-transform-runtime": "^7.8.3",
- "@babel/preset-env": "^7.8.3",
- "@babel/runtime": "^7.8.3",
- "babel-loader": "^8.0.4",
- "copy-webpack-plugin": "^7.0.0",
- "cross-env": "^7.0.3",
- "css-loader": "^5.0.1",
- "fast-async": "^6.3.8",
- "file-loader": "^6.2.0",
- "html-webpack-plugin": "^5.0.0-beta.6",
- "raw-loader": "^4.0.2",
- "shx": "^0.3.2",
- "source-map-loader": "^2.0.0",
- "style-loader": "^2.0.0",
+ "@openremote/util": "^1.0.4",
"tslint": ">=5.11.0",
- "typescript": ">=4.1.3",
- "url-loader": "^4.1.1",
- "webpack": "^5.16.0",
- "webpack-cli": "^4.4.0",
- "webpack-dev-server": "^3.9.0"
+ "typescript": ">=4.1.3"
}
}
diff --git a/ui/app/mobile/src/index.ts b/ui/app/mobile/src/index.ts
index 15540ed96..ce47e927d 100644
--- a/ui/app/mobile/src/index.ts
+++ b/ui/app/mobile/src/index.ts
@@ -55,7 +55,7 @@ const onboardingConfig:OnboardingConfig = {
}
const splashConfig:SplashConfig = {
- redirect: "#!onboarding/",
+ redirect: "#onboarding/",
interval: 3000,
logoMobile: require("../images/logo-mobile.svg")
}
diff --git a/ui/app/mobile/webpack.config.js b/ui/app/mobile/webpack.config.js
index 189be51b6..821504319 100644
--- a/ui/app/mobile/webpack.config.js
+++ b/ui/app/mobile/webpack.config.js
@@ -1,120 +1,6 @@
-var webpack = require("webpack");
-var path = require("path");
-var CopyWebpackPlugin = require("copy-webpack-plugin");
-var HtmlWebpackPlugin = require("html-webpack-plugin");
-
-var config = {
- entry: {
- 'bundle': './src/index.js'
- },
- output: {
- path: __dirname + "/dist",
- publicPath: "",
- filename: "[name].[hash].js"
- },
- module: {
- rules: [
- {
- test: /\.css$/,
- use: [
- { loader: "css-loader" }
- ]
- },
- {
- test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
- loader: 'url-loader',
- options: {
- outputPath: "images/",
- limit: 10000,
- },
- }
- ]
- }
-};
+const util = require("@openremote/util");
module.exports = (env, argv) => {
-
- const production = argv.mode === "production";
- const managerUrl = production ? undefined : "http://localhost:8080";
- const IS_DEV_SERVER = process.argv.find(arg => arg.includes('webpack-dev-server'));
- const OUTPUT_PATH = IS_DEV_SERVER ? 'src' : 'dist';
-
- // Only use babel for production otherwise source maps don't work
- if (production) {
- config.module.rules.push(
- {
- test: /\.js$/,
- include: function(modulePath) {
- return /(@webcomponents[\/|\\]shadycss|lit-css|styled-lit-element|lit-element|lit-html|@polymer|@lit|pwa-helpers)/.test(modulePath) || !/node_modules/.test(modulePath);
- },
- use: [
- {
- loader: 'babel-loader'
- }
- ]
- },
- );
- } else {
- config.module.rules.push(
- {
- test: /\.js$/,
- use: ["source-map-loader"],
- enforce: "pre",
- exclude: [
- /node_modules/
- ]
- },
- );
- }
-
- config.plugins = [
- // Conditional compilation variables
- new webpack.DefinePlugin({
- PRODUCTION: JSON.stringify(production),
- MANAGER_URL: JSON.stringify(managerUrl),
- "process.env": {
- BABEL_ENV: JSON.stringify(argv.mode)
- }
- }),
- new HtmlWebpackPlugin({
- chunksSortMode: 'none',
- inject: false,
- template: 'index.html'
- }),
- new CopyWebpackPlugin([
- {
- from: path.dirname(require.resolve("@webcomponents/webcomponentsjs")),
- to: "modules/@webcomponents/webcomponentsjs",
- ignore: "!*.js"
- },
- // {
- // from: path.join(path.dirname(require.resolve("@openremote/or-app/package.json")), "locales"),
- // to: "locales"
- // },
- {
- from: "./images",
- to: "images"
- }
- // {
- // from: "./locales",
- // to: "locales"
- // }
- ])
- ];
-
- config.devtool = production ? false :"inline-source-map",
- config.devServer = {
- historyApiFallback: {
- index: "/" + __dirname.split(path.sep).slice(-1)[0] + "/",
- },
- port: 9000,
- publicPath: "/" + __dirname.split(path.sep).slice(-1)[0] + "/",
- contentBase: OUTPUT_PATH,
- disableHostCheck: true
- };
- config.watchOptions = {
- ignored: ['**/*.ts', 'node_modules']
- }
-
- return config;
-};
\ No newline at end of file
+ const IS_DEV_SERVER = process.argv.find(arg => arg.includes('webpack serve'));
+ return util.getAppConfig(argv.mode, IS_DEV_SERVER, __dirname);
+};
diff --git a/ui/app/or-app/package.json b/ui/app/or-app/package.json
index d841da659..0c08fe96c 100644
--- a/ui/app/or-app/package.json
+++ b/ui/app/or-app/package.json
@@ -9,10 +9,10 @@
"types": "dist/index.d.ts",
"scripts": {
"clean": "npx shx rm -rf dist",
- "modelBuild": "node ../../model-build.js",
- "modelWatch": "node ../../model-watch.js",
+ "modelBuild": "npx orutil build",
+ "modelWatch": "npx orutil watch",
"build": "npx tsc -b && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack --mode production",
- "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack-dev-server --mode development",
+ "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack serve --mode development",
"watch": "npx tsc -b -w",
"test": "echo \"Error: no test specified\" && exit 1"
},
@@ -26,7 +26,7 @@
"@openremote/or-smart-notify": "^1.0.3",
"@openremote/or-timeline": "^1.0.3",
"@openremote/rest": "^1.0.3",
- "@reduxjs/toolkit": "^1.3.6",
+ "@reduxjs/toolkit": "^1.5.0",
"@types/navigo": "^7.0.1",
"@webcomponents/webcomponentsjs": "^2.2.10",
"lit-element": "^2.4.0",
@@ -35,29 +35,8 @@
"pwa-helpers": "^0.9.0"
},
"devDependencies": {
- "@babel/core": "^7.2.2",
- "@babel/plugin-syntax-dynamic-import": "^7.2.0",
- "@babel/plugin-syntax-object-rest-spread": "^7.2.0",
- "@babel/plugin-transform-regenerator": "^7.0.0",
- "@babel/plugin-transform-runtime": "^7.2.0",
- "@babel/preset-env": "^7.2.0",
- "@babel/runtime": "^7.2.0",
- "babel-loader": "^8.0.4",
- "copy-webpack-plugin": "^7.0.0",
- "cross-env": "^7.0.3",
- "css-loader": "^5.0.1",
- "fast-async": "^6.3.8",
- "file-loader": "^6.2.0",
- "html-webpack-plugin": "^5.0.0-beta.6",
- "raw-loader": "^4.0.2",
- "shx": "^0.3.2",
- "source-map-loader": "^2.0.0",
- "style-loader": "^2.0.0",
+ "@openremote/util": "^1.0.4",
"tslint": ">=5.11.0",
- "typescript": ">=4.1.3",
- "url-loader": "^4.1.1",
- "webpack": "^5.16.0",
- "webpack-cli": "^4.4.0",
- "webpack-dev-server": "^3.9.0"
+ "typescript": ">=4.1.3"
}
}
diff --git a/ui/app/or-app/src/index.ts b/ui/app/or-app/src/index.ts
index 651658ef4..0f5784d23 100644
--- a/ui/app/or-app/src/index.ts
+++ b/ui/app/or-app/src/index.ts
@@ -71,7 +71,7 @@ export function headerItemGatewayConnection<S extends AppStateKeyed, A extends A
return {
icon: "cloud",
value: "gateway",
- href: "#!gateway",
+ href: "#gateway",
text: "gatewayConnection",
roles: ["write:admin", "read:admin"]
};
@@ -296,8 +296,8 @@ export class OrApp<S extends AppStateKeyed> extends LitElement {
if (provider.routes) {
provider.routes.forEach((route) => {
router.on(
- route, (params, query) => {
- this._store.dispatch(updatePage({page: pageName, params: params}));
+ route, ({ data, params, queryString }) => {
+ this._store.dispatch(updatePage({page: pageName, params: data}));
}
)
});
@@ -305,10 +305,14 @@ export class OrApp<S extends AppStateKeyed> extends LitElement {
});
if (this.appConfig.pages.default) {
- router.on("*", (params, query) => {
+ router.on(() => {
this._store.dispatch(updatePage("default"));
- })
+ });
}
+
+ // router.notFound(() => {
+ // this._store.dispatch(updatePage("default"));
+ // })
router.resolve();
} else {
diff --git a/ui/app/or-app/src/or-header.ts b/ui/app/or-app/src/or-header.ts
index 58dce6458..f191e8f32 100644
--- a/ui/app/or-app/src/or-header.ts
+++ b/ui/app/or-app/src/or-header.ts
@@ -13,7 +13,6 @@ import "@openremote/or-icon";
import {getContentWithMenuTemplate, MenuItem} from "@openremote/or-mwc-components/dist/or-mwc-menu";
import {Tenant} from "@openremote/model";
import {router} from "./index";
-import {ResolveOptions} from "navigo";
export interface HeaderConfig {
mainMenu: HeaderItem[];
@@ -65,6 +64,10 @@ function hasRequiredRole(option: HeaderItem): boolean {
return Object.entries(option.roles).some(([client, roles]) => roles.some((r) => manager.hasRole(r, client)));
}
+function getCurrentMenuItemRef(defaultRef?: string): string | undefined {
+ return window.location.hash && window.location.hash.length > 2 ? window.location.hash.substr(2).split("/")[0] : defaultRef;
+}
+
@customElement("or-header")
class OrHeader extends LitElement {
@@ -331,7 +334,7 @@ class OrHeader extends LitElement {
private _drawerOpened = false;
@property({ type: String })
- private activeMenu: string | undefined = window.location.hash ? window.location.hash.split("/")[0].substr(2) : "map";
+ private activeMenu: string | undefined = getCurrentMenuItemRef();
public connectedCallback(): void {
super.connectedCallback();
@@ -344,8 +347,8 @@ class OrHeader extends LitElement {
}
public _onHashChanged(e: Event) {
- const menu = window.location.hash.split("/")[0];
- this.activeMenu = menu.substr(2);
+ const menu = getCurrentMenuItemRef(this.config.mainMenu?.length > 0 ? this.config.mainMenu[0].href : undefined);
+ this.activeMenu = menu;
}
public _onRealmSelect(realm: string) {
@@ -470,7 +473,11 @@ class OrHeader extends LitElement {
if (headerItem.action) {
headerItem.action();
} else if (headerItem.href) {
- router.navigate(headerItem.href, {resolveOptions: });
+ if (headerItem.absolute) {
+ window.location.href = headerItem.href!;
+ } else {
+ router.navigate(headerItem.href);
+ }
}
}
diff --git a/ui/app/or-app/src/pages/page-assets.ts b/ui/app/or-app/src/pages/page-assets.ts
index fe57ed5cd..790c69059 100644
--- a/ui/app/or-app/src/pages/page-assets.ts
+++ b/ui/app/or-app/src/pages/page-assets.ts
@@ -25,6 +25,7 @@ import {EnhancedStore} from "@reduxjs/toolkit";
import {showOkCancelDialog} from "@openremote/or-mwc-components/dist/or-mwc-dialog";
import i18next from "i18next";
import {AssetEventCause} from "@openremote/model";
+import { NavigateOptions } from "navigo";
export interface PageAssetsConfig {
viewer?: ViewerConfig;
@@ -241,15 +242,7 @@ class PageAssets<S extends AppStateKeyed> extends Page<S> {
}
protected _updateRoute(silent: boolean = true) {
- if (silent) {
- router.pause();
- }
const assetId = this._assetIds && this._assetIds.length === 1 ? this._assetIds[0] : undefined;
- router.navigate(getAssetsRoute(this._editMode, assetId));
- if (silent) {
- window.setTimeout(() => {
- router.resume();
- }, 0);
- }
+ router.navigate(getAssetsRoute(this._editMode, assetId), silent ? {callHandler: false} : undefined);
}
}
diff --git a/ui/app/or-app/src/pages/page-roles.ts b/ui/app/or-app/src/pages/page-roles.ts
index 9b27e8e63..c1d575631 100644
--- a/ui/app/or-app/src/pages/page-roles.ts
+++ b/ui/app/or-app/src/pages/page-roles.ts
@@ -19,7 +19,7 @@ import { OrIcon } from "@openremote/or-icon";
import { InputType, OrInputChangedEvent } from "@openremote/or-input";
import {showOkCancelDialog} from "@openremote/or-mwc-components/dist/or-mwc-dialog";
-const tableStyle = require("!!raw-loader!@material/data-table/dist/mdc.data-table.css");
+const tableStyle = require("@material/data-table/dist/mdc.data-table.css");
export function pageRolesProvider<S extends AppStateKeyed>(
store: EnhancedStore<S>
diff --git a/ui/app/or-app/src/pages/page-users.ts b/ui/app/or-app/src/pages/page-users.ts
index 9ec444b4c..f0698a19e 100644
--- a/ui/app/or-app/src/pages/page-users.ts
+++ b/ui/app/or-app/src/pages/page-users.ts
@@ -19,7 +19,7 @@ import { OrIcon } from "@openremote/or-icon";
import { InputType, OrInputChangedEvent } from "@openremote/or-input";
import {showOkCancelDialog} from "@openremote/or-mwc-components/dist/or-mwc-dialog";
-const tableStyle = require("!!raw-loader!@material/data-table/dist/mdc.data-table.css");
+const tableStyle = require("@material/data-table/dist/mdc.data-table.css");
export function pageUsersProvider<S extends AppStateKeyed>(
store: EnhancedStore<S>
diff --git a/ui/app/or-app/src/types.ts b/ui/app/or-app/src/types.ts
index 0ab5a26f4..91b47d3b6 100644
--- a/ui/app/or-app/src/types.ts
+++ b/ui/app/or-app/src/types.ts
@@ -8,7 +8,14 @@ import {ThunkMiddleware} from "redux-thunk";
import Navigo from "navigo";
// Configure routing
-export const router = new Navigo(null, true, "#!");
+export const router = new Navigo("/", {hash: true, noMatchWarning: false}).hooks(
+ {
+ before(done, match) {
+ // do something
+ done();
+ }
+ }
+);
export interface DefaultAppConfig {
appTitle: string;
diff --git a/ui/app/or-app/webpack.config.js b/ui/app/or-app/webpack.config.js
index 38892358d..c04cc64f9 100644
--- a/ui/app/or-app/webpack.config.js
+++ b/ui/app/or-app/webpack.config.js
@@ -1,7 +1,7 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index.orbundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/core/package.json b/ui/component/core/package.json
index 4121f26a0..3a9f12a5e 100644
--- a/ui/component/core/package.json
+++ b/ui/component/core/package.json
@@ -5,9 +5,6 @@
"main": "dist/umd/index.bundle.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
- "exports": {
- "./": "./dist/"
- },
"scripts": {
"generate": "node mdi-iconset-generator.js",
"test": "echo \"No tests\" && exit 0",
diff --git a/ui/component/core/webpack.config.js b/ui/component/core/webpack.config.js
index bd4463ceb..b8431e890 100644
--- a/ui/component/core/webpack.config.js
+++ b/ui/component/core/webpack.config.js
@@ -1,4 +1,4 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index": {
@@ -13,4 +13,4 @@ bundles = {
"index.orbundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-asset-tree/webpack.config.js b/ui/component/or-asset-tree/webpack.config.js
index bd4463ceb..b8431e890 100644
--- a/ui/component/or-asset-tree/webpack.config.js
+++ b/ui/component/or-asset-tree/webpack.config.js
@@ -1,4 +1,4 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index": {
@@ -13,4 +13,4 @@ bundles = {
"index.orbundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-asset-viewer/src/index.ts b/ui/component/or-asset-viewer/src/index.ts
index 3aadc6d2e..8c8d54fc5 100644
--- a/ui/component/or-asset-viewer/src/index.ts
+++ b/ui/component/or-asset-viewer/src/index.ts
@@ -738,7 +738,7 @@ export async function saveAsset(asset: Asset): Promise<SaveResult> {
}
// TODO: Add webpack/rollup to build so consumers aren't forced to use the same tooling
-const tableStyle = require("!!raw-loader!@material/data-table/dist/mdc.data-table.css");
+const tableStyle = require("@material/data-table/dist/mdc.data-table.css");
@customElement("or-asset-viewer")
export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElement)) {
diff --git a/ui/component/or-asset-viewer/src/or-edit-asset-panel.ts b/ui/component/or-asset-viewer/src/or-edit-asset-panel.ts
index 8c8177c13..c72b305b7 100644
--- a/ui/component/or-asset-viewer/src/or-edit-asset-panel.ts
+++ b/ui/component/or-asset-viewer/src/or-edit-asset-panel.ts
@@ -17,7 +17,7 @@ import { OrAssetTree, UiAssetTreeNode } from "@openremote/or-asset-tree";
import { OrAttributeInputChangedEvent } from "@openremote/or-attribute-input";
// TODO: Add webpack/rollup to build so consumers aren't forced to use the same tooling
-const tableStyle = require("!!raw-loader!@material/data-table/dist/mdc.data-table.css");
+const tableStyle = require("@material/data-table/dist/mdc.data-table.css");
// language=CSS
const style = css`
diff --git a/ui/component/or-asset-viewer/webpack.config.js b/ui/component/or-asset-viewer/webpack.config.js
index bda3df670..a5cdec63b 100644
--- a/ui/component/or-asset-viewer/webpack.config.js
+++ b/ui/component/or-asset-viewer/webpack.config.js
@@ -1,4 +1,4 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index": {
@@ -7,4 +7,4 @@ bundles = {
"index.orbundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-attribute-card/src/index.ts b/ui/component/or-attribute-card/src/index.ts
index 27de34fb3..1c897abc1 100644
--- a/ui/component/or-attribute-card/src/index.ts
+++ b/ui/component/or-attribute-card/src/index.ts
@@ -22,8 +22,6 @@ import {getContentWithMenuTemplate} from "@openremote/or-mwc-components/dist/or-
export type ContextMenuOptions = "editAttribute" | "editDelta" | "editCurrentValue";
-const dialogStyle = require("!!raw-loader!@material/dialog/dist/mdc.dialog.css");
-
// language=CSS
const style = css`
@@ -232,7 +230,6 @@ export class OrAttributeCard extends LitElement {
static get styles() {
return [
- css`${unsafeCSS(dialogStyle)}`,
style
];
}
diff --git a/ui/component/or-attribute-card/webpack.config.js b/ui/component/or-attribute-card/webpack.config.js
index 9fe13702d..06448283a 100644
--- a/ui/component/or-attribute-card/webpack.config.js
+++ b/ui/component/or-attribute-card/webpack.config.js
@@ -1,7 +1,7 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index.bundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-attribute-history/src/index.ts b/ui/component/or-attribute-history/src/index.ts
index c3d2575fd..f9f972bc6 100644
--- a/ui/component/or-attribute-history/src/index.ts
+++ b/ui/component/or-attribute-history/src/index.ts
@@ -97,7 +97,7 @@ export interface HistoryConfig {
}
// TODO: Add webpack/rollup to build so consumers aren't forced to use the same tooling
-const tableStyle = require("!!raw-loader!@material/data-table/dist/mdc.data-table.css");
+const tableStyle = require("@material/data-table/dist/mdc.data-table.css");
// language=CSS
const style = css`
diff --git a/ui/component/or-attribute-history/webpack.config.js b/ui/component/or-attribute-history/webpack.config.js
index aa67f2961..c48ec7b80 100644
--- a/ui/component/or-attribute-history/webpack.config.js
+++ b/ui/component/or-attribute-history/webpack.config.js
@@ -1,4 +1,4 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index": {
@@ -15,4 +15,4 @@ bundles = {
"index.orbundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-attribute-input/webpack.config.js b/ui/component/or-attribute-input/webpack.config.js
index bda3df670..a5cdec63b 100644
--- a/ui/component/or-attribute-input/webpack.config.js
+++ b/ui/component/or-attribute-input/webpack.config.js
@@ -1,4 +1,4 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index": {
@@ -7,4 +7,4 @@ bundles = {
"index.orbundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-chart/package.json b/ui/component/or-chart/package.json
index cfbfc429a..a53546587 100644
--- a/ui/component/or-chart/package.json
+++ b/ui/component/or-chart/package.json
@@ -21,6 +21,7 @@
"@openremote/or-mwc-components": "^1.0.3",
"@openremote/or-panel": "^1.0.3",
"@openremote/or-translate": "^1.0.3",
+ "@types/chartjs-plugin-annotation": "^0.5.1",
"chart.js": "2.9.4",
"chartjs-plugin-annotation": "0.5.7",
"jsonpath-plus": "^5.0.2",
diff --git a/ui/component/or-chart/src/index.ts b/ui/component/or-chart/src/index.ts
index 1041d5d74..793140c48 100644
--- a/ui/component/or-chart/src/index.ts
+++ b/ui/component/or-chart/src/index.ts
@@ -79,8 +79,8 @@ export interface OrChartConfig {
}};
}
// TODO: Add webpack/rollup to build so consumers aren't forced to use the same tooling
-const dialogStyle = require("!!raw-loader!@material/dialog/dist/mdc.dialog.css");
-const tableStyle = require("!!raw-loader!@material/data-table/dist/mdc.data-table.css");
+const dialogStyle = require("@material/dialog/dist/mdc.dialog.css");
+const tableStyle = require("@material/data-table/dist/mdc.data-table.css");
// language=CSS
const style = css`
diff --git a/ui/component/or-chart/tsconfig.json b/ui/component/or-chart/tsconfig.json
index 087f61aa4..1f1cc13a3 100644
--- a/ui/component/or-chart/tsconfig.json
+++ b/ui/component/or-chart/tsconfig.json
@@ -6,8 +6,7 @@
"rootDir": "src"
},
"include": [
- "./src",
- "./@types"
+ "./src"
],
"references": [
{ "path": "../core" },
diff --git a/ui/component/or-chart/webpack.config.js b/ui/component/or-chart/webpack.config.js
index aa67f2961..c48ec7b80 100644
--- a/ui/component/or-chart/webpack.config.js
+++ b/ui/component/or-chart/webpack.config.js
@@ -1,4 +1,4 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index": {
@@ -15,4 +15,4 @@ bundles = {
"index.orbundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-data-viewer/webpack.config.js b/ui/component/or-data-viewer/webpack.config.js
index bda3df670..a5cdec63b 100644
--- a/ui/component/or-data-viewer/webpack.config.js
+++ b/ui/component/or-data-viewer/webpack.config.js
@@ -1,4 +1,4 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index": {
@@ -7,4 +7,4 @@ bundles = {
"index.orbundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-icon/webpack.config.js b/ui/component/or-icon/webpack.config.js
index 9fe13702d..06448283a 100644
--- a/ui/component/or-icon/webpack.config.js
+++ b/ui/component/or-icon/webpack.config.js
@@ -1,7 +1,7 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index.bundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-input/src/index.ts b/ui/component/or-input/src/index.ts
index b7d02797e..be673fbf6 100644
--- a/ui/component/or-input/src/index.ts
+++ b/ui/component/or-input/src/index.ts
@@ -17,21 +17,21 @@ import i18next from "i18next";
import { ValueFormat, ValueFormatStyleRepresentation, AssetDescriptor, ValueDescriptorHolder, ValueDescriptor, WellknownValueTypes, MetaHolder, WellknownMetaItems, ValueHolder, NameHolder, Attribute, ValueConstraint, AttributeDescriptor, ValueConstraintSize, ValueConstraintPattern, ValueConstraintMax, ValueConstraintMin, ValueConstraintAllowedValues, ValueConstraintPastOrPresent, ValueConstraintPast, ValueConstraintFuture, ValueConstraintFutureOrPresent, ValueConstraintNotNull, ValueConstraintNotBlank, ValueConstraintNotEmpty, NameValueHolder } from "@openremote/model";
// TODO: Add webpack/rollup to build so consumers aren't forced to use the same tooling
-const buttonStyle = require("!!raw-loader!@material/button/dist/mdc.button.css");
-const buttonFabStyle = require("!!raw-loader!@material/fab/dist/mdc.fab.css");
-const iconButtonStyle = require("!!raw-loader!@material/icon-button/dist/mdc.icon-button.css");
-const textfieldStyle = require("!!raw-loader!@material/textfield/dist/mdc.textfield.css");
-const rippleStyle = require("!!raw-loader!@material/ripple/dist/mdc.ripple.css");
-const lineRippleStyle = require("!!raw-loader!@material/line-ripple/dist/mdc.line-ripple.css");
-const floatingLabelStyle = require("!!raw-loader!@material/floating-label/dist/mdc.floating-label.css");
-const formFieldStyle = require("!!raw-loader!@material/form-field/dist/mdc.form-field.css");
-const checkboxStyle = require("!!raw-loader!@material/checkbox/dist/mdc.checkbox.css");
-const switchStyle = require("!!raw-loader!@material/switch/dist/mdc.switch.css");
-const selectStyle = require("!!raw-loader!@material/select/dist/mdc.select.css");
-const listStyle = require("!!raw-loader!@material/list/dist/mdc.list.css");
-const menuSurfaceStyle = require("!!raw-loader!@material/menu-surface/dist/mdc.menu-surface.css");
-const menuStyle = require("!!raw-loader!@material/menu/dist/mdc.menu.css");
-const sliderStyle = require("!!raw-loader!@material/slider/dist/mdc.slider.css");
+const buttonStyle = require("@material/button/dist/mdc.button.css");
+const buttonFabStyle = require("@material/fab/dist/mdc.fab.css");
+const iconButtonStyle = require("@material/icon-button/dist/mdc.icon-button.css");
+const textfieldStyle = require("@material/textfield/dist/mdc.textfield.css");
+const rippleStyle = require("@material/ripple/dist/mdc.ripple.css");
+const lineRippleStyle = require("@material/line-ripple/dist/mdc.line-ripple.css");
+const floatingLabelStyle = require("@material/floating-label/dist/mdc.floating-label.css");
+const formFieldStyle = require("@material/form-field/dist/mdc.form-field.css");
+const checkboxStyle = require("@material/checkbox/dist/mdc.checkbox.css");
+const switchStyle = require("@material/switch/dist/mdc.switch.css");
+const selectStyle = require("@material/select/dist/mdc.select.css");
+const listStyle = require("@material/list/dist/mdc.list.css");
+const menuSurfaceStyle = require("@material/menu-surface/dist/mdc.menu-surface.css");
+const menuStyle = require("@material/menu/dist/mdc.menu.css");
+const sliderStyle = require("@material/slider/dist/mdc.slider.css");
export class OrInputChangedEvent extends CustomEvent<OrInputChangedEventDetail> {
diff --git a/ui/component/or-input/webpack.config.js b/ui/component/or-input/webpack.config.js
index 9fe13702d..06448283a 100644
--- a/ui/component/or-input/webpack.config.js
+++ b/ui/component/or-input/webpack.config.js
@@ -1,7 +1,7 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index.bundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-log-viewer/src/index.ts b/ui/component/or-log-viewer/src/index.ts
index 02d84e383..325dec8ea 100644
--- a/ui/component/or-log-viewer/src/index.ts
+++ b/ui/component/or-log-viewer/src/index.ts
@@ -25,7 +25,7 @@ import { GenericAxiosResponse } from "axios";
// TODO: Add webpack/rollup to build so consumers aren't forced to use the same tooling
const linkParser = require("parse-link-header");
-const tableStyle = require("!!raw-loader!@material/data-table/dist/mdc.data-table.css");
+const tableStyle = require("@material/data-table/dist/mdc.data-table.css");
export interface ViewerConfig {
allowedCategories?: Model.SyslogCategory[];
diff --git a/ui/component/or-log-viewer/webpack.config.js b/ui/component/or-log-viewer/webpack.config.js
index aa67f2961..c48ec7b80 100644
--- a/ui/component/or-log-viewer/webpack.config.js
+++ b/ui/component/or-log-viewer/webpack.config.js
@@ -1,4 +1,4 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index": {
@@ -15,4 +15,4 @@ bundles = {
"index.orbundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-map/@types/mapbox.js/index.d.ts b/ui/component/or-map/@types/mapbox.js/index.d.ts
deleted file mode 100644
index 7c5608bc4..000000000
--- a/ui/component/or-map/@types/mapbox.js/index.d.ts
+++ /dev/null
@@ -1,140 +0,0 @@
-/* tslint:disable:class-name */
-declare module "mapbox.js" {
-
- export type Point2d = [number, number];
- export type Point3d = [number, number, number];
-
- export type LatLngLike = Point2d | Point3d | LatLng;
- export type LatLngBoundsLike = [LatLngLike, LatLngLike] | LatLngBounds;
-
- export default L;
-
- export class LatLng {
- public alt?: number;
- public lat: number;
- public lng: number;
- private constructor(lat: number, lng: number, alt?: number);
- }
-
- export class LatLngBounds {
- private constructor();
- public getSouthEast(): LatLng;
- public getNorthWest(): LatLng;
- public getNorthEast(): LatLng;
- public getSouthWest(): LatLng;
- public getCenter(): LatLng;
- }
-
- export class Map {
- private constructor();
- public getBoundsZoom(bounds: LatLngBoundsLike, inside?: boolean): number;
- public setMaxZoom(zoom: number): this;
- public setMinZoom(zoom: number): this;
- public on(type: string, func: any): this;
- public getContainer(): HTMLElement;
- public setView(center: LatLngLike, zoom?: number, options?: ZoomPanOptions): this;
- public setZoom(zoom: number, options?: ZoomOptions): this;
- }
-
- export interface MapOptions {
- zoom?: number;
- boxZoom?: boolean;
- center?: LatLngLike;
- maxBounds?: LatLngBoundsLike;
- maxZoom?: number;
- minZoom?: number;
- }
-
- export interface IconOptions {
- iconUrl?: string;
- iconRetinaUrl?: string;
- iconSize?: Point;
- iconAnchor?: Point;
- popupAnchor?: Point;
- tooltipAnchor?: Point;
- shadowUrl?: string;
- shadowRetinaUrl?: string;
- shadowSize?: Point;
- shadowAnchor?: Point;
- className?: string;
- }
-
- export interface DivIconOptions extends IconOptions {
- html?: string;
- bgPos?: Point;
- }
-
- export interface MarkerOptions {
- icon?: Icon;
- keyboard?: boolean;
- title?: string;
- alt?: string;
- zIndexOffset?: number;
- opacity?: number;
- clickable?: boolean;
- }
-
- export interface ZoomOptions {
- animate?: boolean;
- }
-
- export interface PanOptions extends ZoomOptions {
- duration?: number;
- easeLinearity?: number;
- noMoveStart?: boolean;
- }
-
- export interface ZoomPanOptions extends ZoomOptions {
- reset?: boolean;
- pan?: PanOptions;
- zoom?: ZoomOptions;
- }
-
- export interface Icon {
-
- }
-
- export interface DivIcon extends Icon {
-
- }
-
- export interface Point {
- x: number;
- y: number;
- }
-
- export class Marker extends Layer {
- public setLatLng(latLng: LatLngLike): this;
- public on(event: any, func: any): this;
- public off(event: any, func?: any): this;
- public getElement(): HTMLElement;
- }
-
- class Layer {
- public addTo(addTo: Map): this;
- public removeFrom(removeFrom: Map): this;
- }
-
- namespace L {
-
- namespace mapbox {
- function map(element: string | Element, tilejson: object, options?: MapOptions): Map;
- }
-
- function icon(options: IconOptions): Icon;
-
- function divIcon(options: DivIconOptions): DivIcon;
-
- function point(x: number, y: number): Point;
-
- function latLng(lat: number, lng: number, alt?: number): LatLng;
-
- function latLng(pos: LatLngLike): LatLng;
-
- function latLngBounds(corner1: LatLngLike, corner2: LatLngLike): LatLngBounds;
-
- function latLngBounds(bounds: LatLngBoundsLike): LatLngBounds;
-
- function marker(pos: LatLngLike, options: MarkerOptions): Marker;
- }
-}
diff --git a/ui/component/or-map/package.json b/ui/component/or-map/package.json
index f2e2ff794..a5c82f81f 100644
--- a/ui/component/or-map/package.json
+++ b/ui/component/or-map/package.json
@@ -21,8 +21,10 @@
"@openremote/or-translate": "^1.0.3",
"@openremote/rest": "^1.0.3",
"@polymer/polymer": "^3.3.1",
+ "@types/mapbox": "^1.6.41",
+ "@types/mapbox-gl": "^2.0.2",
"lit-element": "^2.4.0",
- "mapbox-gl": "2.0.1",
+ "mapbox-gl": "^1.13.0",
"mapbox.js": "^3.2.0"
},
"devDependencies": {
diff --git a/ui/component/or-map/src/index.ts b/ui/component/or-map/src/index.ts
index 8d9c122de..87a4a2d8c 100644
--- a/ui/component/or-map/src/index.ts
+++ b/ui/component/or-map/src/index.ts
@@ -15,7 +15,7 @@ import { i18next } from "@openremote/or-translate";
export {Util, LngLatLike};
export * from "./markers/or-map-marker";
export * from "./markers/or-map-marker-asset";
-export {Control, IControl, Map as MapGL} from "mapbox-gl";
+export {Control, IControl} from "mapbox-gl";
export * from "./or-map-asset-card";
export interface ViewSettings {
diff --git a/ui/component/or-map/src/mapwidget.ts b/ui/component/or-map/src/mapwidget.ts
index 8700e99fa..8a5073f90 100644
--- a/ui/component/or-map/src/mapwidget.ts
+++ b/ui/component/or-map/src/mapwidget.ts
@@ -1,19 +1,16 @@
-// tslint:disable-next-line:no-reference
-///<reference path="../@types/mapbox.js/index.d.ts" />
import manager, {MapType} from "@openremote/core";
import {LngLatLike, Map as MapGL, MapboxOptions as OptionsGL, Marker as MarkerGL, Style as StyleGL, LngLat,
MapMouseEvent,
NavigationControl,
Control,
IControl} from "mapbox-gl";
-import L, {Map as MapJS, MapOptions as OptionsJS, Marker as MarkerJS} from "mapbox.js";
import {ControlPosition, OrMapClickedEvent, OrMapLoadedEvent, ViewSettings} from "./index";
import {
OrMapMarker
} from "./markers/or-map-marker";
import {getLatLngBounds, getLngLat} from "./util";
-const mapboxJsStyles = require("!!raw-loader!mapbox.js/dist/mapbox.css");
-const mapboxGlStyles = require("!!raw-loader!mapbox-gl/dist/mapbox-gl.css");
+const mapboxJsStyles = require("mapbox.js/dist/mapbox.css");
+const mapboxGlStyles = require("mapbox-gl/dist/mapbox-gl.css");
// TODO: fix any type
const metersToPixelsAtMaxZoom = (meters:number, latitude:number) =>
@@ -21,13 +18,13 @@ const metersToPixelsAtMaxZoom = (meters:number, latitude:number) =>
export class MapWidget {
- protected _mapJs?: MapJS;
+ protected _mapJs?: L.mapbox.Map;
protected _mapGl?: MapGL;
protected _type: MapType;
protected _styleParent: Node;
protected _mapContainer: HTMLElement;
protected _loaded: boolean = false;
- protected _markersJs: Map<OrMapMarker, MarkerJS> = new Map();
+ protected _markersJs: Map<OrMapMarker, L.Marker> = new Map();
protected _markersGl: Map<OrMapMarker, MarkerGL> = new Map();
protected _viewSettings?: ViewSettings;
protected _center?: LngLatLike;
@@ -185,7 +182,7 @@ export class MapWidget {
this._styleParent.appendChild(style);
const settings = await this.loadViewSettings();
- let options: OptionsJS | undefined;
+ let options: L.mapbox.MapOptions | undefined;
if (this._viewSettings) {
options = {};
@@ -200,10 +197,12 @@ export class MapWidget {
options.maxBounds = getLatLngBounds(this._viewSettings.bounds);
}
if (this._viewSettings.center) {
- options.center = getLngLat(this._viewSettings.center);
+ const lngLat = getLngLat(this._viewSettings.center);
+ options.center = lngLat ? L.latLng(lngLat.lat, lngLat.lng) : undefined;
}
if (this._center) {
- options.center = getLngLat(this._center);
+ const lngLat = getLngLat(this._center);
+ options.center = lngLat ? L.latLng(lngLat.lat, lngLat.lng) : undefined;
}
if (this._zoom) {
options.zoom = this._zoom + 1;
@@ -219,7 +218,7 @@ export class MapWidget {
if (options && options.maxBounds) {
const minZoom = this._mapJs.getBoundsZoom(options.maxBounds, true);
if (!options.minZoom || options.minZoom < minZoom) {
- this._mapJs.setMinZoom(minZoom);
+ (this._mapJs as any).setMinZoom(minZoom);
}
}
} else {
@@ -347,7 +346,7 @@ export class MapWidget {
protected _updateMarkerPosition(marker: OrMapMarker) {
switch (this._type) {
case MapType.RASTER:
- const m: MarkerJS | undefined = this._markersJs.get(marker);
+ const m: L.Marker | undefined = this._markersJs.get(marker);
if (m) {
m.setLatLng([marker.lat!, marker.lng!]);
}
@@ -370,7 +369,7 @@ export class MapWidget {
if (m) {
this._removeMarkerClickHandler(marker, marker.markerContainer as HTMLElement);
marker._actualMarkerElement = undefined;
- m.removeFrom(this._mapJs!);
+ (m as any).removeFrom(this._mapJs!);
this._markersJs.delete(marker);
}
@@ -380,7 +379,7 @@ export class MapWidget {
const icon = L.divIcon({html: elem.outerHTML, className: "or-marker-raster"});
m = L.marker([marker.lat!, marker.lng!], {icon: icon, clickable: marker.interactive});
m.addTo(this._mapJs!);
- marker._actualMarkerElement = m.getElement() ? m.getElement().firstElementChild as HTMLDivElement : undefined;
+ marker._actualMarkerElement = (m as any).getElement() ? (m as any).getElement().firstElementChild as HTMLDivElement : undefined;
if (marker.interactive) {
this._addMarkerClickHandler(marker, marker.markerContainer as HTMLElement);
}
diff --git a/ui/component/or-map/src/util.ts b/ui/component/or-map/src/util.ts
index 49d7fc03b..b0d36d1f0 100644
--- a/ui/component/or-map/src/util.ts
+++ b/ui/component/or-map/src/util.ts
@@ -1,5 +1,4 @@
import {LngLat, LngLatBounds, LngLatBoundsLike, LngLatLike} from "mapbox-gl";
-import L, {LatLng, LatLngBounds} from "mapbox.js";
import {Asset, Attribute, GeoJSONPoint, ValueHolder, WellknownAttributes} from "@openremote/model";
export function getLngLat(lngLatLike?: LngLatLike | Asset | ValueHolder<any> | GeoJSONPoint): { lng: number, lat: number } | undefined {
@@ -73,7 +72,7 @@ export function getLngLatBounds(lngLatBoundsLike?: LngLatBoundsLike): LngLatBoun
}
}
-export function getLatLngBounds(lngLatBoundsLike?: LngLatBoundsLike): LatLngBounds | undefined {
+export function getLatLngBounds(lngLatBoundsLike?: LngLatBoundsLike): L.LatLngBounds | undefined {
const lngLatBounds = getLngLatBounds(lngLatBoundsLike);
if (lngLatBounds) {
return L.latLngBounds(lngLatBounds.getNorthEast()!, lngLatBounds.getSouthWest()!);
diff --git a/ui/component/or-map/webpack.config.js b/ui/component/or-map/webpack.config.js
index b578e45bd..59ee22935 100644
--- a/ui/component/or-map/webpack.config.js
+++ b/ui/component/or-map/webpack.config.js
@@ -1,4 +1,4 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index": {
@@ -15,4 +15,4 @@ bundles = {
"index.orbundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-mwc-components/src/or-mwc-dialog.ts b/ui/component/or-mwc-components/src/or-mwc-dialog.ts
index 9b33073d3..97825df0d 100644
--- a/ui/component/or-mwc-components/src/or-mwc-dialog.ts
+++ b/ui/component/or-mwc-components/src/or-mwc-dialog.ts
@@ -6,8 +6,8 @@ import {InputType} from "@openremote/or-input";
import { i18next } from "@openremote/or-translate";
import { Util } from "@openremote/core";
-const dialogStyle = require("!!raw-loader!@material/dialog/dist/mdc.dialog.css");
-const listStyle = require("!!raw-loader!@material/list/dist/mdc.list.css");
+const dialogStyle = require("@material/dialog/dist/mdc.dialog.css");
+const listStyle = require("@material/list/dist/mdc.list.css");
export interface DialogConfig {
title?: TemplateResult | string;
diff --git a/ui/component/or-mwc-components/src/or-mwc-drawer.ts b/ui/component/or-mwc-components/src/or-mwc-drawer.ts
index 3a1131733..1da5612fb 100644
--- a/ui/component/or-mwc-components/src/or-mwc-drawer.ts
+++ b/ui/component/or-mwc-components/src/or-mwc-drawer.ts
@@ -2,7 +2,7 @@ import { css, customElement, html, LitElement, property, TemplateResult, unsafeC
import { MDCDrawer } from "@material/drawer";
import { classMap } from "lit-html/directives/class-map";
-const drawerStyle = require("!!raw-loader!@material/drawer/dist/mdc.drawer.css");
+const drawerStyle = require("@material/drawer/dist/mdc.drawer.css");
export class OrMwcDrawerChangedEvent extends CustomEvent<boolean> {
diff --git a/ui/component/or-mwc-components/src/or-mwc-list.ts b/ui/component/or-mwc-components/src/or-mwc-list.ts
index 596f9fe25..9a27feebd 100644
--- a/ui/component/or-mwc-components/src/or-mwc-list.ts
+++ b/ui/component/or-mwc-components/src/or-mwc-list.ts
@@ -14,8 +14,8 @@ import {ifDefined} from "lit-html/directives/if-defined";
import {MDCList, MDCListActionEvent} from "@material/list";
import { DefaultColor8, DefaultColor4, Util } from "@openremote/core";
import i18next from "i18next";
-const listStyle = require("!!raw-loader!@material/list/dist/mdc.list.css");
-const checkboxStyle = require("!!raw-loader!@material/checkbox/dist/mdc.checkbox.css");
+const listStyle = require("@material/list/dist/mdc.list.css");
+const checkboxStyle = require("@material/checkbox/dist/mdc.checkbox.css");
export interface ListItem {
icon?: string;
diff --git a/ui/component/or-mwc-components/src/or-mwc-menu.ts b/ui/component/or-mwc-components/src/or-mwc-menu.ts
index d1a4425ba..25ec7da65 100644
--- a/ui/component/or-mwc-components/src/or-mwc-menu.ts
+++ b/ui/component/or-mwc-components/src/or-mwc-menu.ts
@@ -13,9 +13,12 @@ import {styleMap} from "lit-html/directives/style-map";
import {MDCMenu} from "@material/menu";
import { DefaultColor8, DefaultColor4 } from "@openremote/core";
-const listStyle = require("!!raw-loader!@material/list/dist/mdc.list.css");
-const menuSurfaceStyle = require("!!raw-loader!@material/menu-surface/dist/mdc.menu-surface.css");
-const menuStyle = require("!!raw-loader!@material/menu/dist/mdc.menu.css");
+// @ts-ignore
+import listStyle from "@material/list/dist/mdc.list.css";
+// @ts-ignore
+import menuSurfaceStyle from "@material/menu-surface/dist/mdc.menu-surface.css";
+// @ts-ignore
+const menuStyle = require("@material/menu/dist/mdc.menu.css");
export interface MenuItem {
icon?: string;
diff --git a/ui/component/or-mwc-components/webpack.config.js b/ui/component/or-mwc-components/webpack.config.js
index 9fe13702d..06448283a 100644
--- a/ui/component/or-mwc-components/webpack.config.js
+++ b/ui/component/or-mwc-components/webpack.config.js
@@ -1,7 +1,7 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index.bundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-panel/src/index.ts b/ui/component/or-panel/src/index.ts
index e8cf7391d..9193681b6 100644
--- a/ui/component/or-panel/src/index.ts
+++ b/ui/component/or-panel/src/index.ts
@@ -3,8 +3,8 @@ import SimpleBar from "simplebar";
import {DefaultColor2} from "@openremote/core";
// TODO: Add webpack/rollup to build so consumers aren't forced to use the same tooling
-const simpleBarStyle = require("!!raw-loader!simplebar/dist/simplebar.css");
-const elevationStyle = require("!!raw-loader!@material/elevation/dist/mdc.elevation.css");
+const simpleBarStyle = require("simplebar/dist/simplebar.css");
+const elevationStyle = require("@material/elevation/dist/mdc.elevation.css");
// language=CSS
const style = css`
@@ -91,4 +91,4 @@ export class OrPanel extends LitElement {
</div>
`;
}
-}
\ No newline at end of file
+}
diff --git a/ui/component/or-panel/webpack.config.js b/ui/component/or-panel/webpack.config.js
index 9fe13702d..06448283a 100644
--- a/ui/component/or-panel/webpack.config.js
+++ b/ui/component/or-panel/webpack.config.js
@@ -1,7 +1,7 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index.bundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-rules/webpack.config.js b/ui/component/or-rules/webpack.config.js
index 9fe13702d..06448283a 100644
--- a/ui/component/or-rules/webpack.config.js
+++ b/ui/component/or-rules/webpack.config.js
@@ -1,7 +1,7 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index.bundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-smart-notify/webpack.config.js b/ui/component/or-smart-notify/webpack.config.js
index bd4463ceb..b8431e890 100644
--- a/ui/component/or-smart-notify/webpack.config.js
+++ b/ui/component/or-smart-notify/webpack.config.js
@@ -1,4 +1,4 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index": {
@@ -13,4 +13,4 @@ bundles = {
"index.orbundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-survey-results/webpack.config.js b/ui/component/or-survey-results/webpack.config.js
index 1ae985da5..cd4bc1144 100644
--- a/ui/component/or-survey-results/webpack.config.js
+++ b/ui/component/or-survey-results/webpack.config.js
@@ -1,4 +1,4 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index": {
@@ -10,4 +10,4 @@ bundles = {
"index.orbundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-survey/webpack.config.js b/ui/component/or-survey/webpack.config.js
index 24dbce9fe..e726d4269 100644
--- a/ui/component/or-survey/webpack.config.js
+++ b/ui/component/or-survey/webpack.config.js
@@ -1,4 +1,4 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index": {
@@ -10,4 +10,4 @@ bundles = {
"index.orbundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-table/src/index.ts b/ui/component/or-table/src/index.ts
index 45d83b7ee..773dcf655 100644
--- a/ui/component/or-table/src/index.ts
+++ b/ui/component/or-table/src/index.ts
@@ -5,7 +5,7 @@ import {MDCDataTable} from "@material/data-table";
import {DefaultColor1, DefaultColor4, DefaultColor8} from "@openremote/core";
-const dataTableStyle = require("!!raw-loader!@material/data-table/dist/mdc.data-table.css");
+const dataTableStyle = require("@material/data-table/dist/mdc.data-table.css");
interface TableOptions {
columnFilter?: string[];
diff --git a/ui/component/or-table/webpack.config.js b/ui/component/or-table/webpack.config.js
index 9fe13702d..06448283a 100644
--- a/ui/component/or-table/webpack.config.js
+++ b/ui/component/or-table/webpack.config.js
@@ -1,7 +1,7 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index.bundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-thermostat/webpack.config.js b/ui/component/or-thermostat/webpack.config.js
index 9fe13702d..06448283a 100644
--- a/ui/component/or-thermostat/webpack.config.js
+++ b/ui/component/or-thermostat/webpack.config.js
@@ -1,7 +1,7 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index.bundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-timeline/webpack.config.js b/ui/component/or-timeline/webpack.config.js
index bd4463ceb..b8431e890 100644
--- a/ui/component/or-timeline/webpack.config.js
+++ b/ui/component/or-timeline/webpack.config.js
@@ -1,4 +1,4 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index": {
@@ -13,4 +13,4 @@ bundles = {
"index.orbundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-translate/webpack.config.js b/ui/component/or-translate/webpack.config.js
index 35fdc4d34..9579d1e63 100644
--- a/ui/component/or-translate/webpack.config.js
+++ b/ui/component/or-translate/webpack.config.js
@@ -1,4 +1,4 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index": {
@@ -13,4 +13,4 @@ bundles = {
"index.orbundle": undefined
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/rest/webpack.config.js b/ui/component/rest/webpack.config.js
index 323131d98..d2bebf8c4 100644
--- a/ui/component/rest/webpack.config.js
+++ b/ui/component/rest/webpack.config.js
@@ -1,4 +1,4 @@
-const util = require("../webpack.util");
+const util = require("@openremote/util");
bundles = {
"index": {
@@ -13,4 +13,4 @@ bundles = {
}
};
-module.exports = util.generateExports(__dirname);
\ No newline at end of file
+module.exports = util.generateExports(__dirname);
diff --git a/ui/component/webpack.util.js b/ui/component/webpack.util.js
deleted file mode 100644
index b54e0dd55..000000000
--- a/ui/component/webpack.util.js
+++ /dev/null
@@ -1,63 +0,0 @@
-const path = require("path");
-
-function getLibName(componentName) {
- if (componentName.startsWith("or-")) {
- componentName = componentName.substr(3);
- }
- componentName = componentName.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
- return "OR" + componentName.charAt(0).toUpperCase() + componentName.substring(1);
-}
-
-function ORExternals(context, request, callback) {
- const match = request.match(/^@openremote\/([^\/]*)$/);
- if (match) {
- let component = getLibName(match[1]);
- console.log(request + " => " + component);
- return callback(null, "umd " + component);
- }
- callback();
-}
-
-function generateExternals(bundle) {
- if (!bundle) {
- return;
- }
-
- const externals = [];
-
- if (bundle.excludeOr) {
- externals.push(ORExternals);
- }
- if (bundle.vendor) {
- externals.push(bundle.vendor);
- }
-
- return externals;
-}
-
-function generateExports(dirname) {
-
- let libName = getLibName(dirname.split(path.sep).pop());
-
- return Object.entries(bundles).map(([name, bundle]) => {
- entry = {};
- entry[name] = "./dist/index.js";
-
- return {
- entry: entry,
- mode: "production",
- output: {
- filename: "[name].js",
- path: path.resolve(dirname, "dist/umd"),
- library: libName,
- libraryTarget: "umd"
- },
- externals: generateExternals(bundle)
- };
- });
-}
-
-module.exports = {
- getLibName: getLibName,
- generateExports: generateExports
-};
\ No newline at end of file
diff --git a/ui/demo/demo-core/package.json b/ui/demo/demo-core/package.json
index 1d04dd592..4b0480b42 100644
--- a/ui/demo/demo-core/package.json
+++ b/ui/demo/demo-core/package.json
@@ -5,10 +5,10 @@
"private": true,
"scripts": {
"clean": "npx shx rm -rf dist",
- "modelBuild": "node ../../model-build.js",
- "modelWatch": "node ../../model-watch.js",
+ "modelBuild": "npx orutil build",
+ "modelWatch": "npx orutil watch",
"build": "npx tsc -b && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack --mode production",
- "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack-dev-server --mode development",
+ "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack serve --mode development",
"watch": "npx tsc -b -w",
"test": "echo \"Error: no test specified\" && exit 1"
},
@@ -22,29 +22,8 @@
"lit-element": "^2.4.0"
},
"devDependencies": {
- "@babel/core": "^7.2.2",
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
- "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
- "@babel/plugin-transform-regenerator": "^7.0.0",
- "@babel/plugin-transform-runtime": "^7.8.3",
- "@babel/preset-env": "^7.8.3",
- "@babel/runtime": "^7.8.3",
- "babel-loader": "^8.0.4",
- "copy-webpack-plugin": "^7.0.0",
- "cross-env": "^7.0.3",
- "css-loader": "^5.0.1",
- "fast-async": "^6.3.8",
- "file-loader": "^6.2.0",
- "html-webpack-plugin": "^5.0.0-beta.6",
- "raw-loader": "^4.0.2",
- "shx": "^0.3.2",
- "source-map-loader": "^2.0.0",
- "style-loader": "^2.0.0",
+ "@openremote/util": "^1.0.4",
"tslint": ">=5.11.0",
- "typescript": ">=4.1.3",
- "url-loader": "^4.1.1",
- "webpack": "^5.16.0",
- "webpack-cli": "^4.4.0",
- "webpack-dev-server": "^3.9.0"
+ "typescript": ">=4.1.3"
}
}
diff --git a/ui/demo/demo-core/webpack.config.js b/ui/demo/demo-core/webpack.config.js
index 0fbaf35cb..821504319 100644
--- a/ui/demo/demo-core/webpack.config.js
+++ b/ui/demo/demo-core/webpack.config.js
@@ -1,120 +1,6 @@
-var webpack = require("webpack");
-var path = require("path");
-var CopyWebpackPlugin = require("copy-webpack-plugin");
-var HtmlWebpackPlugin = require("html-webpack-plugin");
-
-var config = {
- entry: {
- 'bundle': './src/index.js'
- },
- output: {
- path: __dirname + "/dist",
- publicPath: "",
- filename: "[name].[hash].js"
- },
- module: {
- rules: [
- {
- test: /\.css$/,
- use: [
- { loader: "css-loader" }
- ]
- },
- {
- test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
- loader: 'url-loader',
- options: {
- outputPath: "images/",
- limit: 10000,
- },
- }
- ]
- }
-};
+const util = require("@openremote/util");
module.exports = (env, argv) => {
-
- const production = argv.mode === "production";
- const managerUrl = production ? undefined : "http://localhost:8080";
- const IS_DEV_SERVER = process.argv.find(arg => arg.includes('webpack-dev-server'));
- const OUTPUT_PATH = IS_DEV_SERVER ? 'src' : 'dist';
-
- // Only use babel for production otherwise source maps don't work
- if (production) {
- config.module.rules.push(
- {
- test: /\.js$/,
- include: function(modulePath) {
- return /(@webcomponents[\/|\\]shadycss|lit-css|styled-lit-element|lit-element|lit-html|@polymer|@lit|pwa-helpers)/.test(modulePath) || !/node_modules/.test(modulePath);
- },
- use: [
- {
- loader: 'babel-loader'
- }
- ]
- },
- );
- } else {
- config.module.rules.push(
- {
- test: /\.js$/,
- use: ["source-map-loader"],
- enforce: "pre",
- exclude: [
- /node_modules/
- ]
- },
- );
- }
-
- config.plugins = [
- // Conditional compilation variables
- new webpack.DefinePlugin({
- PRODUCTION: JSON.stringify(production),
- MANAGER_URL: JSON.stringify(managerUrl),
- "process.env": {
- BABEL_ENV: JSON.stringify(argv.mode)
- }
- }),
- new HtmlWebpackPlugin({
- chunksSortMode: 'none',
- inject: false,
- template: 'index.html'
- }),
- new CopyWebpackPlugin([
- {
- from: path.dirname(require.resolve("@webcomponents/webcomponentsjs")),
- to: "modules/@webcomponents/webcomponentsjs",
- ignore: "!*.js"
- },
- // {
- // from: path.join(path.dirname(require.resolve("@openremote/or-app/package.json")), "locales"),
- // to: "locales"
- // },
- // {
- // from: "./images",
- // to: "images"
- // }
- // {
- // from: "./locales",
- // to: "locales"
- // }
- ])
- ];
-
- config.devtool = production ? false :"inline-source-map",
- config.devServer = {
- historyApiFallback: {
- index: "/" + __dirname.split(path.sep).slice(-1)[0] + "/",
- },
- port: 9000,
- publicPath: "/" + __dirname.split(path.sep).slice(-1)[0] + "/",
- contentBase: OUTPUT_PATH,
- disableHostCheck: true
- };
- config.watchOptions = {
- ignored: ['**/*.ts', 'node_modules']
- }
-
- return config;
+ const IS_DEV_SERVER = process.argv.find(arg => arg.includes('webpack serve'));
+ return util.getAppConfig(argv.mode, IS_DEV_SERVER, __dirname);
};
diff --git a/ui/demo/demo-or-asset-tree/package.json b/ui/demo/demo-or-asset-tree/package.json
index 9a016c80c..19b1dbe6b 100644
--- a/ui/demo/demo-or-asset-tree/package.json
+++ b/ui/demo/demo-or-asset-tree/package.json
@@ -4,10 +4,10 @@
"description": "Component Demo",
"scripts": {
"clean": "npx shx rm -rf dist",
- "modelBuild": "node ../../model-build.js",
- "modelWatch": "node ../../model-watch.js",
+ "modelBuild": "npx orutil build",
+ "modelWatch": "npx orutil watch",
"build": "npx tsc -b && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack --mode production",
- "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack-dev-server --mode development",
+ "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack serve --mode development",
"watch": "npx tsc -b -w",
"test": "echo \"Error: no test specified\" && exit 1"
},
@@ -18,30 +18,8 @@
"@openremote/or-asset-tree": "^1.0.4"
},
"devDependencies": {
- "@babel/core": "^7.2.2",
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
- "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
- "@babel/plugin-transform-regenerator": "^7.0.0",
- "@babel/plugin-transform-runtime": "^7.8.3",
- "@babel/preset-env": "^7.8.3",
- "@babel/runtime": "^7.8.3",
- "@polymer/iron-demo-helpers": "^3.0.0-pre.19",
- "babel-loader": "^8.0.4",
- "copy-webpack-plugin": "^7.0.0",
- "cross-env": "^7.0.3",
- "css-loader": "^5.0.1",
- "fast-async": "^6.3.8",
- "file-loader": "^6.2.0",
- "html-webpack-plugin": "^5.0.0-beta.6",
- "raw-loader": "^4.0.2",
- "shx": "^0.3.2",
- "source-map-loader": "^2.0.0",
- "style-loader": "^2.0.0",
+ "@openremote/util": "^1.0.4",
"tslint": ">=5.11.0",
- "typescript": ">=4.1.3",
- "url-loader": "^4.1.1",
- "webpack": "^5.16.0",
- "webpack-cli": "^4.4.0",
- "webpack-dev-server": "^3.9.0"
+ "typescript": ">=4.1.3"
}
}
diff --git a/ui/demo/demo-or-asset-tree/webpack.config.js b/ui/demo/demo-or-asset-tree/webpack.config.js
index 632e19aa7..821504319 100644
--- a/ui/demo/demo-or-asset-tree/webpack.config.js
+++ b/ui/demo/demo-or-asset-tree/webpack.config.js
@@ -1,75 +1,6 @@
-var HtmlWebpackPlugin = require("html-webpack-plugin");
-var path = require("path");
-var CopyWebpackPlugin = require("copy-webpack-plugin");
+const util = require("@openremote/util");
-module.exports = {
- mode: 'development',
- entry: {
- 'bundle': './src/index.js'
- },
- output: {
- path: __dirname + "/dist",
- filename: "[name].[hash].js",
- publicPath: ""
- },
- devtool: 'inline-source-map',
- devServer: {
- port: 9000,
- contentBase: './dist',
- publicPath: "/" + __dirname.split(path.sep).slice(-1)[0] + "/"
- },
- watchOptions: {
- ignored: ['**/*.ts', 'node_modules']
- },
- plugins: [
- new HtmlWebpackPlugin({
- chunksSortMode: 'none',
- inject: false,
- template: 'index.html'
- }),
- new CopyWebpackPlugin([
- {
- from: path.dirname(require.resolve("@webcomponents/webcomponentsjs")),
- to: "modules/@webcomponents/webcomponentsjs",
- ignore: "!*.js"
- }
- ])
- ],
- module: {
- rules: [
- {
- test: /\.js$/,
- use: ["source-map-loader"],
- enforce: "pre",
- exclude: [
- /node_modules/
- ]
- },
- {
- test: /\.js$/,
- include: function(modulePath) {
- return /(@webcomponents[\/|\\]shadycss|lit-css|styled-lit-element|lit-html|lit-element|@polymer|@lit|pwa-helpers)/.test(modulePath) || !/node_modules/.test(modulePath);
- },
- use: [
- {
- loader: 'babel-loader'
- }
- ]
- },
- {
- test: /\.css$/,
- use: [
- { loader: "css-loader" }
- ]
- },
- {
- test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
- loader: 'url-loader',
- options: {
- outputPath: "images/",
- limit: 10000
- }
- }
- ]
- }
-};
\ No newline at end of file
+module.exports = (env, argv) => {
+ const IS_DEV_SERVER = process.argv.find(arg => arg.includes('webpack serve'));
+ return util.getAppConfig(argv.mode, IS_DEV_SERVER, __dirname);
+};
diff --git a/ui/demo/demo-or-map/package.json b/ui/demo/demo-or-map/package.json
index 928a1e0af..ff6055421 100644
--- a/ui/demo/demo-or-map/package.json
+++ b/ui/demo/demo-or-map/package.json
@@ -4,10 +4,10 @@
"description": "Component Demo",
"scripts": {
"clean": "npx shx rm -rf dist",
- "modelBuild": "node ../../model-build.js",
- "modelWatch": "node ../../model-watch.js",
+ "modelBuild": "npx orutil build",
+ "modelWatch": "npx orutil watch",
"build": "npx tsc -b && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack --mode production",
- "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack-dev-server --mode development",
+ "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack serve --mode development",
"watch": "npx tsc -b -w",
"test": "echo \"Error: no test specified\" && exit 1"
},
@@ -18,30 +18,8 @@
"@openremote/or-map": "^1.0.4"
},
"devDependencies": {
- "@babel/core": "^7.2.2",
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
- "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
- "@babel/plugin-transform-regenerator": "^7.0.0",
- "@babel/plugin-transform-runtime": "^7.8.3",
- "@babel/preset-env": "^7.8.3",
- "@babel/runtime": "^7.8.3",
- "@polymer/iron-demo-helpers": "^3.0.0-pre.19",
- "babel-loader": "^8.0.4",
- "copy-webpack-plugin": "^7.0.0",
- "cross-env": "^7.0.3",
- "css-loader": "^5.0.1",
- "fast-async": "^6.3.8",
- "file-loader": "^6.2.0",
- "html-webpack-plugin": "^5.0.0-beta.6",
- "raw-loader": "^4.0.2",
- "shx": "^0.3.2",
- "source-map-loader": "^2.0.0",
- "style-loader": "^2.0.0",
+ "@openremote/util": "^1.0.4",
"tslint": ">=5.11.0",
- "typescript": ">=4.1.3",
- "url-loader": "^4.1.1",
- "webpack": "^5.16.0",
- "webpack-cli": "^4.4.0",
- "webpack-dev-server": "^3.9.0"
+ "typescript": ">=4.1.3"
}
}
diff --git a/ui/demo/demo-or-map/webpack.config.js b/ui/demo/demo-or-map/webpack.config.js
index 632e19aa7..821504319 100644
--- a/ui/demo/demo-or-map/webpack.config.js
+++ b/ui/demo/demo-or-map/webpack.config.js
@@ -1,75 +1,6 @@
-var HtmlWebpackPlugin = require("html-webpack-plugin");
-var path = require("path");
-var CopyWebpackPlugin = require("copy-webpack-plugin");
+const util = require("@openremote/util");
-module.exports = {
- mode: 'development',
- entry: {
- 'bundle': './src/index.js'
- },
- output: {
- path: __dirname + "/dist",
- filename: "[name].[hash].js",
- publicPath: ""
- },
- devtool: 'inline-source-map',
- devServer: {
- port: 9000,
- contentBase: './dist',
- publicPath: "/" + __dirname.split(path.sep).slice(-1)[0] + "/"
- },
- watchOptions: {
- ignored: ['**/*.ts', 'node_modules']
- },
- plugins: [
- new HtmlWebpackPlugin({
- chunksSortMode: 'none',
- inject: false,
- template: 'index.html'
- }),
- new CopyWebpackPlugin([
- {
- from: path.dirname(require.resolve("@webcomponents/webcomponentsjs")),
- to: "modules/@webcomponents/webcomponentsjs",
- ignore: "!*.js"
- }
- ])
- ],
- module: {
- rules: [
- {
- test: /\.js$/,
- use: ["source-map-loader"],
- enforce: "pre",
- exclude: [
- /node_modules/
- ]
- },
- {
- test: /\.js$/,
- include: function(modulePath) {
- return /(@webcomponents[\/|\\]shadycss|lit-css|styled-lit-element|lit-html|lit-element|@polymer|@lit|pwa-helpers)/.test(modulePath) || !/node_modules/.test(modulePath);
- },
- use: [
- {
- loader: 'babel-loader'
- }
- ]
- },
- {
- test: /\.css$/,
- use: [
- { loader: "css-loader" }
- ]
- },
- {
- test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
- loader: 'url-loader',
- options: {
- outputPath: "images/",
- limit: 10000
- }
- }
- ]
- }
-};
\ No newline at end of file
+module.exports = (env, argv) => {
+ const IS_DEV_SERVER = process.argv.find(arg => arg.includes('webpack serve'));
+ return util.getAppConfig(argv.mode, IS_DEV_SERVER, __dirname);
+};
diff --git a/ui/demo/demo-or-thermostat/package.json b/ui/demo/demo-or-thermostat/package.json
index 60c36f2cd..aa2c37d95 100644
--- a/ui/demo/demo-or-thermostat/package.json
+++ b/ui/demo/demo-or-thermostat/package.json
@@ -4,10 +4,10 @@
"description": "Component Demo",
"scripts": {
"clean": "npx shx rm -rf dist",
- "modelBuild": "node ../../model-build.js",
- "modelWatch": "node ../../model-watch.js",
+ "modelBuild": "npx orutil build",
+ "modelWatch": "npx orutil watch",
"build": "npx tsc -b && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack --mode production",
- "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack-dev-server --mode development",
+ "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack serve --mode development",
"watch": "npx tsc -b -w",
"test": "echo \"Error: no test specified\" && exit 1"
},
@@ -18,30 +18,8 @@
"source-map-loader": "^2.0.0"
},
"devDependencies": {
- "@babel/core": "^7.2.2",
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
- "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
- "@babel/plugin-transform-regenerator": "^7.0.0",
- "@babel/plugin-transform-runtime": "^7.8.3",
- "@babel/preset-env": "^7.8.3",
- "@babel/runtime": "^7.8.3",
- "@polymer/iron-demo-helpers": "^3.0.0-pre.19",
- "babel-loader": "^8.0.4",
- "copy-webpack-plugin": "^7.0.0",
- "cross-env": "^7.0.3",
- "css-loader": "^5.0.1",
- "fast-async": "^6.3.8",
- "file-loader": "^6.2.0",
- "html-webpack-plugin": "^5.0.0-beta.6",
- "raw-loader": "^4.0.2",
- "shx": "^0.3.2",
- "source-map-loader": "^0.2.4",
- "style-loader": "^2.0.0",
+ "@openremote/util": "^1.0.4",
"tslint": ">=5.11.0",
- "typescript": ">=4.1.3",
- "url-loader": "^4.1.1",
- "webpack": "^5.16.0",
- "webpack-cli": "^4.4.0",
- "webpack-dev-server": "^3.9.0"
+ "typescript": ">=4.1.3"
}
}
diff --git a/ui/demo/demo-or-thermostat/webpack.config.js b/ui/demo/demo-or-thermostat/webpack.config.js
index 632e19aa7..821504319 100644
--- a/ui/demo/demo-or-thermostat/webpack.config.js
+++ b/ui/demo/demo-or-thermostat/webpack.config.js
@@ -1,75 +1,6 @@
-var HtmlWebpackPlugin = require("html-webpack-plugin");
-var path = require("path");
-var CopyWebpackPlugin = require("copy-webpack-plugin");
+const util = require("@openremote/util");
-module.exports = {
- mode: 'development',
- entry: {
- 'bundle': './src/index.js'
- },
- output: {
- path: __dirname + "/dist",
- filename: "[name].[hash].js",
- publicPath: ""
- },
- devtool: 'inline-source-map',
- devServer: {
- port: 9000,
- contentBase: './dist',
- publicPath: "/" + __dirname.split(path.sep).slice(-1)[0] + "/"
- },
- watchOptions: {
- ignored: ['**/*.ts', 'node_modules']
- },
- plugins: [
- new HtmlWebpackPlugin({
- chunksSortMode: 'none',
- inject: false,
- template: 'index.html'
- }),
- new CopyWebpackPlugin([
- {
- from: path.dirname(require.resolve("@webcomponents/webcomponentsjs")),
- to: "modules/@webcomponents/webcomponentsjs",
- ignore: "!*.js"
- }
- ])
- ],
- module: {
- rules: [
- {
- test: /\.js$/,
- use: ["source-map-loader"],
- enforce: "pre",
- exclude: [
- /node_modules/
- ]
- },
- {
- test: /\.js$/,
- include: function(modulePath) {
- return /(@webcomponents[\/|\\]shadycss|lit-css|styled-lit-element|lit-html|lit-element|@polymer|@lit|pwa-helpers)/.test(modulePath) || !/node_modules/.test(modulePath);
- },
- use: [
- {
- loader: 'babel-loader'
- }
- ]
- },
- {
- test: /\.css$/,
- use: [
- { loader: "css-loader" }
- ]
- },
- {
- test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
- loader: 'url-loader',
- options: {
- outputPath: "images/",
- limit: 10000
- }
- }
- ]
- }
-};
\ No newline at end of file
+module.exports = (env, argv) => {
+ const IS_DEV_SERVER = process.argv.find(arg => arg.includes('webpack serve'));
+ return util.getAppConfig(argv.mode, IS_DEV_SERVER, __dirname);
+};
diff --git a/ui/demo/demo-rest/package.json b/ui/demo/demo-rest/package.json
index e65b77118..2270ebf34 100644
--- a/ui/demo/demo-rest/package.json
+++ b/ui/demo/demo-rest/package.json
@@ -5,10 +5,10 @@
"private": true,
"scripts": {
"clean": "npx shx rm -rf dist",
- "modelBuild": "node ../../model-build.js",
- "modelWatch": "node ../../model-watch.js",
+ "modelBuild": "npx orutil build",
+ "modelWatch": "npx orutil watch",
"build": "npx tsc -b && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack --mode production",
- "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack-dev-server --mode development",
+ "serve": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack serve --mode development",
"watch": "npx tsc -b -w",
"test": "echo \"Error: no test specified\" && exit 1"
},
@@ -19,29 +19,8 @@
"lit-element": "^2.4.0"
},
"devDependencies": {
- "@babel/core": "^7.2.2",
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
- "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
- "@babel/plugin-transform-regenerator": "^7.0.0",
- "@babel/plugin-transform-runtime": "^7.8.3",
- "@babel/preset-env": "^7.8.3",
- "@babel/runtime": "^7.8.3",
- "babel-loader": "^8.0.4",
- "copy-webpack-plugin": "^7.0.0",
- "cross-env": "^7.0.3",
- "css-loader": "^5.0.1",
- "fast-async": "^6.3.8",
- "file-loader": "^6.2.0",
- "html-webpack-plugin": "^5.0.0-beta.6",
- "raw-loader": "^4.0.2",
- "shx": "^0.3.2",
- "source-map-loader": "^2.0.0",
- "style-loader": "^2.0.0",
+ "@openremote/util": "^1.0.4",
"tslint": ">=5.11.0",
- "typescript": ">=4.1.3",
- "url-loader": "^4.1.1",
- "webpack": "^5.16.0",
- "webpack-cli": "^4.4.0",
- "webpack-dev-server": "^3.9.0"
+ "typescript": ">=4.1.3"
}
}
diff --git a/ui/demo/demo-rest/webpack.config.js b/ui/demo/demo-rest/webpack.config.js
index fe0e277df..821504319 100644
--- a/ui/demo/demo-rest/webpack.config.js
+++ b/ui/demo/demo-rest/webpack.config.js
@@ -1,67 +1,6 @@
-var HtmlWebpackPlugin = require("html-webpack-plugin");
-var path = require("path");
+const util = require("@openremote/util");
-module.exports = {
- mode: 'development',
- entry: {
- 'bundle': './src/index.js'
- },
- output: {
- path: __dirname + "/dist",
- filename: "[name].[hash].js",
- publicPath: ""
- },
- devtool: 'inline-source-map',
- devServer: {
- port: 9000,
- contentBase: './dist',
- publicPath: "/" + __dirname.split(path.sep).slice(-1)[0] + "/"
- },
- watchOptions: {
- ignored: ['**/*.ts', 'node_modules']
- },
- plugins: [
- new HtmlWebpackPlugin({
- chunksSortMode: 'none',
- inject: false,
- template: 'index.html'
- })
- ],
- module: {
- rules: [
- {
- test: /\.js$/,
- use: ["source-map-loader"],
- enforce: "pre",
- exclude: [
- /node_modules/
- ]
- },
- {
- test: /\.js$/,
- include: function(modulePath) {
- return /(@webcomponents[\/|\\]shadycss|lit-css|styled-lit-element|lit-html|@polymer|@lit|pwa-helpers)/.test(modulePath) || !/node_modules/.test(modulePath);
- },
- use: [
- {
- loader: 'babel-loader'
- }
- ]
- },
- {
- test: /\.css$/,
- use: [
- { loader: "css-loader" }
- ]
- },
- {
- test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
- loader: 'url-loader',
- options: {
- outputPath: "images/",
- limit: 10000
- }
- }
- ]
- }
-};
\ No newline at end of file
+module.exports = (env, argv) => {
+ const IS_DEV_SERVER = process.argv.find(arg => arg.includes('webpack serve'));
+ return util.getAppConfig(argv.mode, IS_DEV_SERVER, __dirname);
+};
diff --git a/ui/model-build.js b/ui/model-build.js
deleted file mode 100644
index c30a99a42..000000000
--- a/ui/model-build.js
+++ /dev/null
@@ -1,34 +0,0 @@
-var path = require("path");
-const fs = require("fs");
-const { spawnSync } = require("child_process");
-
-function getWorkingDirectory() {
- let dirs = __dirname.split(path.sep);
- dirs.pop();
-
- let cwd = dirs.join(path.sep);
-
- // Dirs is now the repo root but is this a custom project repo or OR repo
- let isDirCalledOR = dirs.pop() === "openremote";
- if(isDirCalledOR) {
- try {
- if (fs.existsSync(path.join(cwd, "..", ".gitmodules"))) {
- cwd = path.join(cwd, "..");
- }
- } catch(err) {
- console.error(err);
- process.exit(1);
- }
- }
-
- return cwd;
-}
-
-let cwd = getWorkingDirectory();
-console.log("Running gradlew modelBuild task...");
-const gradleModelWatch = spawnSync((process.platform === "win32" ? "gradlew" : "./gradlew"), ["modelWatch"], {
- cwd: cwd,
- shell: true
-});
-console.log("gradlew modelWatch finished! Status = " + gradleModelWatch.status);
-process.exit(gradleModelWatch.status);
\ No newline at end of file
diff --git a/ui/model-watch.js b/ui/model-watch.js
deleted file mode 100644
index a5d7cd94b..000000000
--- a/ui/model-watch.js
+++ /dev/null
@@ -1,41 +0,0 @@
-var path = require("path");
-const fs = require("fs");
-const { spawn } = require("child_process");
-
-function getWorkingDirectory() {
- let dirs = __dirname.split(path.sep);
- dirs.pop();
-
- let cwd = dirs.join(path.sep);
-
- // Dirs is now the repo root but is this a custom project repo or OR repo
- let isDirCalledOR = dirs.pop() === "openremote";
- if(isDirCalledOR) {
- try {
- if (fs.existsSync(path.join(cwd, "..", ".gitmodules"))) {
- cwd = path.join(cwd, "..");
- }
- } catch(err) {
- console.error(err);
- process.exit(1);
- }
- }
-
- return cwd;
-}
-
-let cwd = getWorkingDirectory();
-console.log("Watching model for changes...");
-const child = spawn((process.platform === "win32" ? "gradlew" : "./gradlew"), ["-t", "modelWatch"], {
- cwd: cwd,
- shell: true
-});
-child.stdout.removeAllListeners("data");
-child.stderr.removeAllListeners("data");
-child.stdout.pipe(process.stdout);
-child.stderr.pipe(process.stderr);
-
-child.on("exit", function() {
- console.log("gradlew modelWatch finished! Status = " + child.status);
- process.exit(child.status);
-});
\ No newline at end of file
diff --git a/ui/util/cli.js b/ui/util/cli.js
new file mode 100644
index 000000000..08b14cb60
--- /dev/null
+++ b/ui/util/cli.js
@@ -0,0 +1,60 @@
+#!/usr/bin/env node
+const path = require("path");
+const fs = require("fs");
+const { spawnSync } = require("child_process");
+const { spawn } = require("child_process");
+
+/* THIS IS JUST A WRAPPER THAT LAUNCHES GRADLE TASKS */
+
+/* Try and get the gradle root project dir this could be the openremote repo or a custom project */
+function getWorkingDirectory() {
+ let dirs = __dirname.split(path.sep);
+ dirs.pop();
+
+ // get CWD as the openremote repo root
+ let cwd = dirs.join(path.sep);
+ cwd = path.join(cwd, "..");
+
+ try {
+ if (fs.existsSync(path.join(cwd, "..", ".gitmodules"))) {
+ // Go up a level to custom project
+ cwd = path.join(cwd, "..");
+ }
+ } catch(err) {
+ console.error(err);
+ process.exit(1);
+ }
+
+ return cwd;
+}
+
+if (process.argv.length >= 3 && process.argv[2] =="watch") {
+
+ // Do watch
+ let cwd = getWorkingDirectory();
+ console.log("Watching model for changes...");
+ const child = spawn((process.platform === "win32" ? "gradlew" : "./gradlew"), ["-t", "modelWatch"], {
+ cwd: cwd,
+ shell: true
+ });
+ child.stdout.removeAllListeners("data");
+ child.stderr.removeAllListeners("data");
+ child.stdout.pipe(process.stdout);
+ child.stderr.pipe(process.stderr);
+
+ child.on("exit", function() {
+ console.log("gradlew modelWatch finished! Status = " + child.status);
+ process.exit(child.status);
+ });
+} else {
+
+ // Do build
+ let cwd = getWorkingDirectory();
+ console.log("Running gradlew modelBuild task...");
+ const gradleModelWatch = spawnSync((process.platform === "win32" ? "gradlew" : "./gradlew"), ["modelWatch"], {
+ cwd: cwd,
+ shell: true
+ });
+ console.log("gradlew modelWatch finished! Status = " + gradleModelWatch.status);
+ process.exit(gradleModelWatch.status);
+}
diff --git a/ui/util/package.json b/ui/util/package.json
new file mode 100644
index 000000000..1d2c40763
--- /dev/null
+++ b/ui/util/package.json
@@ -0,0 +1,33 @@
+{
+ "name": "@openremote/util",
+ "version": "1.0.4",
+ "description": "Build Util",
+ "private": true,
+ "author": "OpenRemote",
+ "main": "webpack.util.js",
+ "bin": {
+ "orutil": "./cli.js"
+ },
+ "license": "AGPL-3.0-or-later",
+ "devDependencies": {
+ "@babel/core": "^7.2.2",
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
+ "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
+ "@babel/plugin-transform-regenerator": "^7.0.0",
+ "@babel/plugin-transform-runtime": "^7.8.3",
+ "@babel/preset-env": "^7.8.3",
+ "@babel/runtime": "^7.8.3",
+ "babel-loader": "^8.0.4",
+ "copy-webpack-plugin": "^7.0.0",
+ "cross-env": "^7.0.3",
+ "css-loader": "^5.0.1",
+ "fast-async": "^6.3.8",
+ "html-webpack-plugin": "^5.0.0-beta.6",
+ "shx": "^0.3.3",
+ "source-map-loader": "^2.0.0",
+ "style-loader": "^2.0.0",
+ "webpack": "^5.16.0",
+ "webpack-cli": "^4.4.0",
+ "webpack-dev-server": "^3.11.2"
+ }
+}
diff --git a/ui/util/webpack.util.js b/ui/util/webpack.util.js
new file mode 100644
index 000000000..ed775d7bd
--- /dev/null
+++ b/ui/util/webpack.util.js
@@ -0,0 +1,231 @@
+const fs = require("fs");
+const path = require("path");
+const webpack = require("webpack");
+const CopyWebpackPlugin = require("copy-webpack-plugin");
+const HtmlWebpackPlugin = require("html-webpack-plugin");
+
+function getAppConfig(mode, isDevServer, dirname) {
+ const production = mode === "production";
+ const managerUrl = production ? undefined : "http://localhost:8080";
+ const OUTPUT_PATH = isDevServer ? 'src' : 'dist';
+
+ const config = {
+ entry: {
+ 'bundle': './src/index.js'
+ },
+ output: {
+ path: dirname + "/dist",
+ publicPath: "",
+ filename: "[name].[contenthash].js"
+ },
+ module: {
+ rules: [
+ {
+ test: /(mapbox|@material).*\.css$/, //output mapbox and material css as strings
+ type: "asset/source"
+ },
+ {
+ test: /\.css$/, //
+ exclude: /(mapbox|@material).*\.css$/,
+ use: [
+ { loader: "css-loader" }
+ ]
+ },
+ {
+ test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
+ type: "asset",
+ generator: {
+ filename: 'images/[hash][ext][query]'
+ }
+ }
+ ]
+ },
+ // optimization: {
+ // minimize: true,
+ // minimizer: [
+ // // For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
+ // // `...`,
+ // new CssMinimizerPlugin(),
+ // ],
+ // },
+ resolve: {
+ fallback: { "vm": false }
+ }
+ };
+
+ if (production) {
+ // Only use babel for production otherwise source maps don't work
+ config.module.rules.push(
+ {
+ test: /\.js$/,
+ include: function(modulePath) {
+ return /(@webcomponents[\/|\\]shadycss|lit-css|styled-lit-element|lit-element|lit-html|@polymer|@lit|pwa-helpers)/.test(modulePath) || !/node_modules/.test(modulePath);
+ },
+ use: [
+ {
+ loader: 'babel-loader'
+ }
+ ]
+ },
+ );
+ } else {
+ // Load source maps generated by typescript
+ config.module.rules.push(
+ {
+ test: /\.js$/,
+ use: ["source-map-loader"],
+ enforce: "pre",
+ exclude: [
+ /node_modules/
+ ]
+ },
+ );
+ }
+
+ config.plugins = [];
+
+ // Conditional compilation variables
+ config.plugins.push(
+ new webpack.DefinePlugin({
+ PRODUCTION: JSON.stringify(production),
+ MANAGER_URL: JSON.stringify(managerUrl),
+ "process.env": {
+ BABEL_ENV: JSON.stringify(mode)
+ }
+ })
+ );
+
+ // Generate our index page
+ config.plugins.push(
+ new HtmlWebpackPlugin({
+ chunksSortMode: 'none',
+ inject: false,
+ template: 'index.html'
+ })
+ );
+
+ // Build list of resources to copy
+ const patterns = [
+ {
+ from: path.dirname(require.resolve("@webcomponents/webcomponentsjs")),
+ to: "modules/@webcomponents/webcomponentsjs",
+ globOptions: {
+ ignore: ["!*.js"]
+ }
+ },
+ ];
+ // Check if images dir exists
+ if (fs.existsSync(path.join(dirname, "images"))) {
+ patterns.push(
+ {
+ from: "./images",
+ to: "images"
+ }
+ );
+ }
+ // Check if locales dir exists
+ if (fs.existsSync(path.join(dirname, "locales"))) {
+ patterns.push(
+ {
+ from: "./locales",
+ to: "locales"
+ }
+ );
+ }
+ // Check if htaccess file exists
+ if (fs.existsSync(path.join(dirname, ".htaccess"))) {
+ patterns.push(
+ {
+ from: ".htaccess",
+ to: ".htaccess",
+ toType: 'file'
+ }
+ );
+ }
+
+ // Copy unprocessed files
+ config.plugins.push(
+ new CopyWebpackPlugin({
+ patterns: patterns
+ })
+ );
+
+ config.devtool = production ? false :"inline-source-map",
+ config.devServer = {
+ historyApiFallback: {
+ index: "/" + dirname.split(path.sep).slice(-1)[0] + "/",
+ },
+ port: 9000,
+ publicPath: "/" + dirname.split(path.sep).slice(-1)[0] + "/",
+ contentBase: OUTPUT_PATH,
+ disableHostCheck: true
+ };
+ config.watchOptions = {
+ ignored: ['**/*.ts', 'node_modules']
+ }
+
+ return config;
+}
+
+function getLibName(componentName) {
+ if (componentName.startsWith("or-")) {
+ componentName = componentName.substr(3);
+ }
+ componentName = componentName.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
+ return "OR" + componentName.charAt(0).toUpperCase() + componentName.substring(1);
+}
+
+function ORExternals(context, request, callback) {
+ const match = request.match(/^@openremote\/([^\/]*)$/);
+ if (match) {
+ let component = getLibName(match[1]);
+ console.log(request + " => " + component);
+ return callback(null, "umd " + component);
+ }
+ callback();
+}
+
+function generateExternals(bundle) {
+ if (!bundle) {
+ return;
+ }
+
+ const externals = [];
+
+ if (bundle.excludeOr) {
+ externals.push(ORExternals);
+ }
+ if (bundle.vendor) {
+ externals.push(bundle.vendor);
+ }
+
+ return externals;
+}
+
+function generateExports(dirname) {
+
+ let libName = getLibName(dirname.split(path.sep).pop());
+
+ return Object.entries(bundles).map(([name, bundle]) => {
+ const entry = {};
+ entry[name] = "./dist/index.js";
+
+ return {
+ entry: entry,
+ mode: "production",
+ output: {
+ filename: "[name].js",
+ path: path.resolve(dirname, "dist/umd"),
+ library: libName,
+ libraryTarget: "umd"
+ },
+ externals: generateExternals(bundle)
+ };
+ });
+}
+
+module.exports = {
+ getLibName: getLibName,
+ generateExports: generateExports,
+ getAppConfig: getAppConfig
+};
diff --git a/yarn.lock b/yarn.lock
index 22af69349..8d1374594 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -372,7 +372,7 @@
dependencies:
"@babel/helper-plugin-utils" "^7.10.4"
-"@babel/plugin-syntax-dynamic-import@^7.2.0", "@babel/plugin-syntax-dynamic-import@^7.8.0", "@babel/plugin-syntax-dynamic-import@^7.8.3":
+"@babel/plugin-syntax-dynamic-import@^7.8.0", "@babel/plugin-syntax-dynamic-import@^7.8.3":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3"
integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==
@@ -414,7 +414,7 @@
dependencies:
"@babel/helper-plugin-utils" "^7.10.4"
-"@babel/plugin-syntax-object-rest-spread@^7.2.0", "@babel/plugin-syntax-object-rest-spread@^7.8.0", "@babel/plugin-syntax-object-rest-spread@^7.8.3":
+"@babel/plugin-syntax-object-rest-spread@^7.8.0", "@babel/plugin-syntax-object-rest-spread@^7.8.3":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871"
integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==
@@ -640,7 +640,7 @@
dependencies:
"@babel/helper-plugin-utils" "^7.10.4"
-"@babel/plugin-transform-runtime@^7.2.0", "@babel/plugin-transform-runtime@^7.8.3":
+"@babel/plugin-transform-runtime@^7.8.3":
version "7.12.10"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.12.10.tgz#af0fded4e846c4b37078e8e5d06deac6cd848562"
integrity sha512-xOrUfzPxw7+WDm9igMgQCbO3cJKymX7dFdsgRr1eu9n3KjjyU4pptIXbXPseQDquw+W+RuJEJMHKHNsPNNm3CA==
@@ -700,7 +700,7 @@
"@babel/helper-create-regexp-features-plugin" "^7.12.1"
"@babel/helper-plugin-utils" "^7.10.4"
-"@babel/preset-env@^7.2.0", "@babel/preset-env@^7.8.3":
+"@babel/preset-env@^7.8.3":
version "7.12.11"
resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.12.11.tgz#55d5f7981487365c93dbbc84507b1c7215e857f9"
integrity sha512-j8Tb+KKIXKYlDBQyIOy4BLxzv1NUOwlHfZ74rvW+Z0Gp4/cI2IMDPBWAgWceGcE7aep9oL/0K9mlzlMGxA8yNw==
@@ -783,7 +783,7 @@
"@babel/types" "^7.4.4"
esutils "^2.0.2"
-"@babel/runtime@^7.12.0", "@babel/runtime@^7.2.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4":
+"@babel/runtime@^7.12.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4":
version "7.12.5"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e"
integrity sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==
@@ -1636,10 +1636,10 @@
resolved "https://registry.yarnpkg.com/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz#ce56e539f83552b58d10d672ea4d6fc9adc7b234"
integrity sha1-zlblOfg1UrWNENZy6k1vya3HsjQ=
-"@mapbox/mapbox-gl-supported@^2.0.0":
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-2.0.0.tgz#bb133cd91e562c006713fbc83f21e4b6f711a388"
- integrity sha512-zu4udqYiBrKMQKwpKJ4hhPON7tz0QR/JZ3iGpHnNWFmH3Sv/ysxlICATUtGCFpsyJf2v1WpFhlzaZ3GhhKmPMA==
+"@mapbox/mapbox-gl-supported@^1.5.0":
+ version "1.5.0"
+ resolved "https://registry.yarnpkg.com/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-1.5.0.tgz#f60b6a55a5d8e5ee908347d2ce4250b15103dc8e"
+ integrity sha512-/PT1P6DNf7vjEEiPkVIRJkvibbqWtqnyGaBz3nfRdcxclNSnSdaLU5tfAgcD7I8Yt5i+L19s406YLl1koLnLbg==
"@mapbox/[email protected]", "@mapbox/point-geometry@^0.1.0", "@mapbox/point-geometry@~0.1.0":
version "0.1.0"
@@ -2137,10 +2137,10 @@
is-plain-object "^5.0.0"
universal-user-agent "^6.0.0"
-"@octokit/openapi-types@^3.0.0":
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-3.0.0.tgz#f73d48af2d21bf4f97fbf38fae43b54699e0dbba"
- integrity sha512-jOp1CVRw+OBJaZtG9QzZggvJXvyzgDXuW948SWsDiwmyDuCjeYCiF3TDD/qvhpF580RfP7iBIos4AVU6yhgMlA==
+"@octokit/openapi-types@^3.1.1":
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-3.1.1.tgz#628f81b87cf4390f9f2b0ad3d89ef5524ddd10fe"
+ integrity sha512-4BsrIf9/WLRbl0IVPEPLDTROduvYR57xCldy47YFQp/TZ9DbREQZbeCrJIe7a+Qjb3qk0KwZmxNYYW8mNQY/HQ==
"@octokit/plugin-enterprise-rest@^6.0.1":
version "6.0.1"
@@ -2229,68 +2229,21 @@
"@types/node" ">= 8"
"@octokit/types@^6.0.0", "@octokit/types@^6.0.3":
- version "6.4.0"
- resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.4.0.tgz#f3f47be70bcdb3c26f2c2619f3dd0ced466a265c"
- integrity sha512-1FEmuVppZE2zG0rBdQlviRz5cp0udyI63zyhBVPrm0FRNAsQkAXU7IYWQg1XvhChFut8YbFYN1usQpk54D6/4w==
+ version "6.4.2"
+ resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.4.2.tgz#e4cdc33643c7af2c4806ad5f3592af5cb13c4bcb"
+ integrity sha512-c3OswFOjp0MydgIxWcu/wIXK9sfoBL2gLjqMZA+KKdvvcwh6g2z0eMu219rFrZzi0KQunO9l/a9yHb9T/AlU1A==
dependencies:
- "@octokit/openapi-types" "^3.0.0"
+ "@octokit/openapi-types" "^3.1.1"
"@types/node" ">= 8"
-"@polymer/font-roboto@^3.0.0-pre.25":
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/@polymer/font-roboto/-/font-roboto-3.0.2.tgz#80cdaa7225db2359130dfb2c6d9a3be1820020c3"
- integrity sha512-tx5TauYSmzsIvmSqepUPDYbs4/Ejz2XbZ1IkD7JEGqkdNUJlh+9KU85G56Tfdk/xjEZ8zorFfN09OSwiMrIQWA==
-
-"@polymer/iron-demo-helpers@^3.0.0-pre.19":
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/@polymer/iron-demo-helpers/-/iron-demo-helpers-3.1.0.tgz#89dbbc019f9200331d77c94144d8afc9920dc122"
- integrity sha512-C+U9ghRnjluJNLIga7r30YGNuQeCu7E7mOOcjgWOL/bMfWvrnbr2TcYoO4DXHO6NdUfV6daGtRA1VwG3d8H39g==
- dependencies:
- "@polymer/font-roboto" "^3.0.0-pre.25"
- "@polymer/iron-flex-layout" "^3.0.0-pre.25"
- "@polymer/iron-location" "^3.0.0-pre.25"
- "@polymer/marked-element" "^3.0.0-pre.25"
- "@polymer/polymer" "^3.0.0"
- "@polymer/prism-element" "^3.0.0-pre.25"
-
-"@polymer/iron-flex-layout@^3.0.0-pre.25":
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/@polymer/iron-flex-layout/-/iron-flex-layout-3.0.1.tgz#36f9e1a8eb792d279b2bc75d362628721ad37f0c"
- integrity sha512-7gB869czArF+HZcPTVSgvA7tXYFze9EKckvM95NB7SqYF+NnsQyhoXgKnpFwGyo95lUjUW9TFDLUwDXnCYFtkw==
- dependencies:
- "@polymer/polymer" "^3.0.0"
-
-"@polymer/iron-location@^3.0.0-pre.25":
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/@polymer/iron-location/-/iron-location-3.0.2.tgz#7ca2df089c57deb8a6f54f5cc3722af0ff871441"
- integrity sha512-75XlPsrm6RQUPNzWWaA0TnTQaWZUYX8UB4Q6WCjikKWzmaSCCxlBrVVYf8WRqtCxw/PeCvLn5kGL6qhTlNTCEA==
- dependencies:
- "@polymer/polymer" "^3.0.0"
-
-"@polymer/marked-element@^3.0.0-pre.25":
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/@polymer/marked-element/-/marked-element-3.0.1.tgz#56add62080404dea142c055977807ae9ca773a89"
- integrity sha512-WJQzQetxdStVGQbyTBUBgd+hSI0Rl39uJg7b2zL3r6EfMnibzmA/YNT06M8jVZdxPF+B4SumrFWRtasVtGQRUQ==
- dependencies:
- "@polymer/polymer" "^3.0.0"
- marked "~0.3.9"
-
-"@polymer/polymer@^3.0.0", "@polymer/polymer@^3.3.1":
+"@polymer/polymer@^3.3.1":
version "3.4.1"
resolved "https://registry.yarnpkg.com/@polymer/polymer/-/polymer-3.4.1.tgz#333bef25711f8411bb5624fb3eba8212ef8bee96"
integrity sha512-KPWnhDZibtqKrUz7enIPOiO4ZQoJNOuLwqrhV2MXzIt3VVnUVJVG5ORz4Z2sgO+UZ+/UZnPD0jqY+jmw/+a9mQ==
dependencies:
"@webcomponents/shadycss" "^1.9.1"
-"@polymer/prism-element@^3.0.0-pre.25":
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/@polymer/prism-element/-/prism-element-3.0.1.tgz#b35d53eec9ecea5e5fec7c82c7e978e760e53501"
- integrity sha512-mam3oZZwVoxmC8i2srCxaTsvCqZF2HX4yxbm1JN9OGZS2JMwu7bnjjk7O8haoj9u6w+ocUi+vTLjYeIIoPx7vQ==
- dependencies:
- "@polymer/polymer" "^3.0.0"
- prismjs "^1.11.0"
-
-"@reduxjs/toolkit@^1.3.6":
+"@reduxjs/toolkit@^1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@reduxjs/toolkit/-/toolkit-1.5.0.tgz#1025c1ccb224d1fc06d8d98a61f6717d57e6d477"
integrity sha512-E/FUraRx+8guw9Hlg/Ja8jI/hwCrmIKed8Annt9YsZw3BQp+F24t5I5b2OWR6pkEHY4hn1BgP08FrTZFRKsdaQ==
@@ -2300,13 +2253,21 @@
redux-thunk "^2.3.0"
reselect "^4.0.0"
-"@types/chart.js@^2.8.5":
+"@types/chart.js@*", "@types/chart.js@^2.8.5":
version "2.9.29"
resolved "https://registry.yarnpkg.com/@types/chart.js/-/chart.js-2.9.29.tgz#73bf7f02387402943f29946012492f10bde7ed43"
integrity sha512-WOZMitUU3gHDM0oQsCsVivX+oDsIki93szcTmmUPBm39cCvAELBjokjSDVOoA3xiIEbb+jp17z/3S2tIqruwOQ==
dependencies:
moment "^2.10.2"
+"@types/chartjs-plugin-annotation@^0.5.1":
+ version "0.5.1"
+ resolved "https://registry.yarnpkg.com/@types/chartjs-plugin-annotation/-/chartjs-plugin-annotation-0.5.1.tgz#f560fc9e2dc15aa595b6b6043c7f7789dc890a90"
+ integrity sha512-ruMXTjRVQwwbOtuNfFBHbqbhj497+D/VRmMPZiHv/GCupGwUf2l1TL7S1BTRYlP1Hengx798UwaOpAO+3+Sczw==
+ dependencies:
+ "@types/chart.js" "*"
+ moment "^2.10.2"
+
"@types/eslint-scope@^3.7.0":
version "3.7.0"
resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.0.tgz#4792816e31119ebd506902a482caec4951fabd86"
@@ -2356,6 +2317,13 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"
integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==
+"@types/leaflet@^0":
+ version "0.7.34"
+ resolved "https://registry.yarnpkg.com/@types/leaflet/-/leaflet-0.7.34.tgz#7c0619e075399985aa76d7f3633a5c973aae8584"
+ integrity sha512-NOon/TgvB9QiJ6H5EfxfL4PsmNgAh/dvZQ9cSE7LkSGbidPutx7f/JdxdziCSIR5A7TxRiDqm2CrK2Kkc7rorQ==
+ dependencies:
+ "@types/geojson" "*"
+
"@types/lodash-es@^4.17.3":
version "4.17.4"
resolved "https://registry.yarnpkg.com/@types/lodash-es/-/lodash-es-4.17.4.tgz#b2e440d2bf8a93584a9fd798452ec497986c9b97"
@@ -2375,6 +2343,13 @@
dependencies:
"@types/geojson" "*"
+"@types/mapbox@^1.6.41":
+ version "1.6.41"
+ resolved "https://registry.yarnpkg.com/@types/mapbox/-/mapbox-1.6.41.tgz#57acac7237228aa74a00ba8637db892d65da3470"
+ integrity sha512-mR7KWdMShsI9c/HcBjLKDq0DFT2FcgxkC7tGmLehDtUdNVdvvDTlgWBZkZxY7e/Dd5wkrExUjIlNu4LUHOAUzg==
+ dependencies:
+ "@types/leaflet" "^0"
+
"@types/minimatch@*":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
@@ -3327,15 +3302,6 @@ cli-width@^2.0.0:
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48"
integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==
-clipboard@^2.0.0:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.6.tgz#52921296eec0fdf77ead1749421b21c968647376"
- integrity sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==
- dependencies:
- good-listener "^1.2.2"
- select "^1.1.2"
- tiny-emitter "^2.0.0"
-
cliui@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5"
@@ -3907,11 +3873,6 @@ delayed-stream@~1.0.0:
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
-delegate@^3.1.2:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/delegate/-/delegate-3.2.0.tgz#b66b71c3158522e8ab5744f720d8ca0c2af59166"
- integrity sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==
-
delegates@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
@@ -4498,14 +4459,6 @@ figures@^2.0.0:
dependencies:
escape-string-regexp "^1.0.5"
-file-loader@^6.2.0:
- version "6.2.0"
- resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d"
- integrity sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==
- dependencies:
- loader-utils "^2.0.0"
- schema-utils "^3.0.0"
-
version "1.0.0"
resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"
@@ -4910,13 +4863,6 @@ globby@^9.2.0:
pify "^4.0.1"
slash "^2.0.0"
-good-listener@^1.2.2:
- version "1.2.2"
- resolved "https://registry.yarnpkg.com/good-listener/-/good-listener-1.2.2.tgz#d53b30cdf9313dffb7dc9a0d477096aa6d145c50"
- integrity sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=
- dependencies:
- delegate "^3.1.2"
-
graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4:
version "4.2.4"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb"
@@ -6167,15 +6113,15 @@ map-visit@^1.0.0:
dependencies:
object-visit "^1.0.0"
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/mapbox-gl/-/mapbox-gl-2.0.1.tgz#e081c075fca2473fbc0e3a28f57c1b68ced3d997"
- integrity sha512-4sWRh4FztQakCPO/WN2JsMSDOVLKXPSQvHjJgXwIEQtnrxjyFB7Et0VX+h9rDxOA4EB6BRCG8mNgw648/dXNTg==
+mapbox-gl@^1.13.0:
+ version "1.13.0"
+ resolved "https://registry.yarnpkg.com/mapbox-gl/-/mapbox-gl-1.13.0.tgz#23b339ba5116b7e3b5a2043ea968f7fcb53e34a6"
+ integrity sha512-g8zlzuJxYJqbOPXT19/UBYpVrcefBQ06F/Cbj0fyEfFnFesDcU3cFTxd75/FZ6Upx2ZEjCsD61CHxrcxZidVpA==
dependencies:
"@mapbox/geojson-rewind" "^0.5.0"
"@mapbox/geojson-types" "^1.0.2"
"@mapbox/jsonlint-lines-primitives" "^2.0.2"
- "@mapbox/mapbox-gl-supported" "^2.0.0"
+ "@mapbox/mapbox-gl-supported" "^1.5.0"
"@mapbox/point-geometry" "^0.1.0"
"@mapbox/tiny-sdf" "^1.1.1"
"@mapbox/unitbezier" "^0.0.0"
@@ -6206,11 +6152,6 @@ mapbox.js@^3.2.0:
leaflet "1.4.0"
mustache "3.0.1"
-marked@~0.3.9:
- version "0.3.19"
- resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.19.tgz#5d47f709c4c9fc3c216b6d46127280f40b39d790"
- integrity sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==
-
version "0.3.0"
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
@@ -7373,13 +7314,6 @@ pretty-error@^2.1.1:
lodash "^4.17.20"
renderkid "^2.0.4"
-prismjs@^1.11.0:
- version "1.23.0"
- resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.23.0.tgz#d3b3967f7d72440690497652a9d40ff046067f33"
- integrity sha512-c29LVsqOaLbBHuIbsTxaKENh1N2EQBOHaWv7gkHN4dgRbxSREqDnDbtFJYdpPauS4YCplMSNCABQ6Eeor69bAA==
- optionalDependencies:
- clipboard "^2.0.0"
-
process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
@@ -7554,14 +7488,6 @@ [email protected]:
iconv-lite "0.4.24"
unpipe "1.0.0"
-raw-loader@^4.0.2:
- version "4.0.2"
- resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-4.0.2.tgz#1aac6b7d1ad1501e66efdac1522c73e59a584eb6"
- integrity sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==
- dependencies:
- loader-utils "^2.0.0"
- schema-utils "^3.0.0"
-
read-cmd-shim@^1.0.1:
version "1.0.5"
resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.5.tgz#87e43eba50098ba5a32d0ceb583ab8e43b961c16"
@@ -8079,11 +8005,6 @@ select-hose@^2.0.0:
resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca"
integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=
-select@^1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/select/-/select-1.1.2.tgz#0e7350acdec80b1108528786ec1d4418d11b396d"
- integrity sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=
-
selfsigned@^1.10.8:
version "1.10.8"
resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.8.tgz#0d17208b7d12c33f8eac85c41835f27fc3d81a30"
@@ -8232,7 +8153,7 @@ shortid@^2.2.15:
dependencies:
nanoid "^2.1.0"
-shx@^0.3.2:
+shx@^0.3.3:
version "0.3.3"
resolved "https://registry.yarnpkg.com/shx/-/shx-0.3.3.tgz#681a88c7c10db15abe18525349ed474f0f1e7b9f"
integrity sha512-nZJ3HFWVoTSyyB+evEKjJ1STiixGztlqwKLTUNV5KqMWtGey9fTd4KU1gdZ1X9BV6215pswQ/Jew9NsuS/fNDA==
@@ -8808,11 +8729,6 @@ thunky@^1.0.2:
resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d"
integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==
-tiny-emitter@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz#1d1a56edfc51c43e863cbb5382a72330e3555423"
- integrity sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==
-
tinyqueue@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/tinyqueue/-/tinyqueue-2.0.3.tgz#64d8492ebf39e7801d7bd34062e29b45b2035f08"
@@ -9107,15 +9023,6 @@ urix@^0.1.0:
resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=
-url-loader@^4.1.1:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-4.1.1.tgz#28505e905cae158cf07c92ca622d7f237e70a4e2"
- integrity sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA==
- dependencies:
- loader-utils "^2.0.0"
- mime-types "^2.1.27"
- schema-utils "^3.0.0"
-
url-parse@^1.4.3, url-parse@^1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278"
@@ -9270,7 +9177,7 @@ webpack-dev-middleware@^3.7.2:
range-parser "^1.2.1"
webpack-log "^2.0.0"
-webpack-dev-server@^3.9.0:
+webpack-dev-server@^3.11.2:
version "3.11.2"
resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-3.11.2.tgz#695ebced76a4929f0d5de7fd73fafe185fe33708"
integrity sha512-A80BkuHRQfCiNtGBS1EMf2ChTUs0x+B3wGDFmOeT4rmJOHhHTCH2naNxIHhmkr0/UillP4U3yeIyv1pNp+QDLQ==