Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
6XGate committed Jan 13, 2020
2 parents 94df34d + c63c018 commit a02c34a
Show file tree
Hide file tree
Showing 69 changed files with 1,046 additions and 702 deletions.
28 changes: 1 addition & 27 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,32 +259,6 @@ module.exports = {
}],
"vue/script-indent": ["error", 4, {
baseIndent: 1,
// "switchCase": 0,
// "ignores": [],
}],"vue/order-in-components": ["error", {
"order": [
"el",
"name",
"parent",
"functional",
["delimiters", "comments"],
["components", "directives", "filters"],
"extends",
"mixins",
"inheritAttrs",
"model",
["props", "propsData"],
"fetch",
"asyncData",
"data",
"computed",
"watch",
"methods",
"LIFECYCLE_HOOKS",
"head",
["template", "render"],
"renderError",
]
}],
},
"overrides": [
Expand All @@ -297,7 +271,7 @@ module.exports = {
],
"settings": {
"import/ignore": [
/^xdg-basedir$/u,
(/^xdg-basedir$/u),
],
},
};
File renamed without changes.
File renamed without changes.
7 changes: 1 addition & 6 deletions PLANS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
Next milestone

- GUI to configure switches, ties, and sources.
- Debian/Raspbian package.

2nd milestone

- Settings page with the following general options
- A switch to enable power-on signal during start-up for switches/monitors.
- A switch to enable or disable start-up with login session.

3rd milestone
2nd milestone

- Device descriptors to allow for capability definitions of devices supported by a driver.
111 changes: 71 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A/V switch and monitor controller

### BridgeCmdr

Copyright ©2019 Matthew Holder
Copyright ©2019-2020 Matthew Holder

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
Expand All @@ -27,6 +27,20 @@ To install BridgeCmdr on the Raspberry Pi, all you need do is download the
[latest release](https://github.com/6XGate/bridgecmdr/releases) and install it with
`sudo apt install ./bridgecmdr_<version>-<revision>_armhf.deb -y`

### System Requirements

I've only tested this software on a Raspberry Pi 3 Model B+. In general I would recommend at minimal a Raspberry Pi 3
Model B or better. Which would include every configuration of the Raspberry Pi 4 Model B. It may run on other models,
but this has not been tested.

You will also need a touchscreen, such as the official Raspberry Pi touchscreen, or a mouse and screen. You will also
need a keyboard while setting up your configuration, but it is not needed during day-to-day use.

You may also need additional USB-to-serial adapters or a serial HAT. Some supported monitors and switches can be
controlled over ethernet. For those you will need an ethernet cable; and if you have more than one such device, an
ethernet hub or switch. See [Wiki](https://github.com/6XGate/bridgecmdr/wiki) for more information on how to connect to
supported monitors and switches.

## Tools, Frameworks, Libraries, and Assets

BridgeCmdr uses the following libraries and frameworks which are available under their respective license.
Expand All @@ -43,28 +57,31 @@ BridgeCmdr uses the following libraries and frameworks which are available under
| [Node UUID](https://github.com/kelektiv/node-uuid) | [MIT](https://github.com/kelektiv/node-uuid/blob/master/LICENSE.md) |
| [electron-unhandled](https://github.com/sindresorhus/electron-unhandled) | [MIT](https://github.com/sindresorhus/electron-unhandled/blob/master/license) |
| [xdg-basedir](https://github.com/sindresorhus/xdg-basedir) | [MIT](https://github.com/sindresorhus/xdg-basedir/blob/master/license) |
| [vue-typed-mixins](https://github.com/ktsn/vue-typed-mixins) | [MIT](https://github.com/ktsn/vue-typed-mixins/blob/master/LICENSE) |

Other dependencies not listed are part of one of the above packages and share the same license.

BridgeCmdr also uses the [Material Design Icons](https://dev.materialdesignicons.com/) font and SVG graphics which is
BridgeCmdr also uses the [Material Design Icons](https://dev.materialdesignicons.com/) font and SVG graphics which are
licensed under the [SIL Open Font License](https://github.com/Templarian/MaterialDesign/blob/master/LICENSE) v1.0.

Finally, the following tools or libraries were used to build BridgeCmdr.

- [cross-env](https://github.com/kentcdodds/cross-env).
- [moment](https://momentjs.com/).
- [read-package-json](https://github.com/npm/read-package-json).
- [TypeScript](https://www.typescriptlang.org/)
- [TypeScript](https://www.typescriptlang.org/).
- [ESLint](https://eslint.org/), and the following third-party plug-ins;
- [ESLint Import Plug-in](https://github.com/benmosher/eslint-plugin-import)
- [ESLint Promise Plug-in](https://github.com/xjamundx/eslint-plugin-promise)
- [ESLint Node Plug-in](https://github.com/mysticatea/eslint-plugin-node)
- [ESLint Import Plug-in](https://github.com/benmosher/eslint-plugin-import),
- [ESLint Promise Plug-in](https://github.com/xjamundx/eslint-plugin-promise),
- [ESLint Node Plug-in](https://github.com/mysticatea/eslint-plugin-node),
- [WebPack](https://webpack.js.org/), and the following third-party plug-ins;
- [TypeScript Loader](https://github.com/TypeStrong/ts-loader)
- [Resolve URL Loader](https://github.com/bholloway/resolve-url-loader)
- [Node Externals](https://github.com/liady/webpack-node-externals)
- [HTML WebPack Plug-in](https://github.com/jantimon/html-webpack-plugin)
- [TypeScript Loader](https://github.com/TypeStrong/ts-loader),
- [Resolve URL Loader](https://github.com/bholloway/resolve-url-loader),
- [Node Externals](https://github.com/liady/webpack-node-externals),
- [HTML WebPack Plug-in](https://github.com/jantimon/html-webpack-plugin),
- [Dart Sass](https://sass-lang.com/dart-sass), and the following third-party plug-ins;
- [Node Fibers](https://github.com/laverdet/node-fibers)
- [Electron DevTools Installer](https://github.com/MarshallOfSound/electron-devtools-installer).
- [Electron Installer (Debian)](https://github.com/electron-userland/electron-installer-debian).
- [PHPStorm](https://www.jetbrains.com/phpstorm/), but no PHP code was harmed in the making of this software.
- [VisualStudio Code](https://code.visualstudio.com/)
Expand All @@ -75,39 +92,53 @@ Other tools or licenses not listed are part of one of the above packages.

### Development

If you want to help with the development of BridgeCmdr, downloading, building, and running the project on a Linux system
is easy.
If you want to help with the development of BridgeCmdr, downloading, building, then running the project on a GNU/Linux
based operating system is required. The following steps will get you setup on a Debian-base operating system.

1. Download the [source](https://github.com/6XGate/bridgecmdr/archive/master.zip) and extract it.
2. Open a terminal clone and go to the folder into which source was extracted.
3. Install the `build-essential` package.
- `sudo apt install build-essential -y`
4. Install the node packages.
- `npm ci` or `npm install`
5. Build the user interface source.
- `npm run prod` or `npm run dev`
1. Install the `build-essential` package; `sudo apt install build-essential -y`
2. Acquire the source:
- **Preferred**, Fork the [GitHub repository](https://github.com/6XGate/bridgecmdr), you may then issue pull
requests back to the official source code. Also start personal branches from `develop`.
- Download the [source](https://github.com/6XGate/bridgecmdr/archive/develop.zip) and extract it.
3. Open a terminal clone and go to the folder into which source was cloned or extracted.
4. Install the node packages; `npm ci`
5. Build the user interface source; `npm run prod` or `npm run dev`

You should now be able to run the program with `npm run start`.

### Packaging the Installer

Though not optimal, the only way to currently building a package requires a Raspberry Pi with Raspbian and a desktop
computer running Debian or Ubuntu. This should change in the future. Other desktop Linux distributions may work, but
it's not tested.

With a Raspberry Pi 4, given the larger memory configuration, it may be possible to do all of this on the Raspberry Pi
system alone.

1. Download the [source](https://github.com/6XGate/bridgecmdr/archive/develop.zip) and extract it on both systems.
2. On both systems; open a terminal clone and go to the folder into which source was extracted.
3. On both systems; install the `build-essential` package.
- `sudo apt install build-essential -y`
4. On both systems; install the node packages.
- `npm ci` or `npm install`
5. On the desktop system, build the user interface source.
- `npm run prod` or `npm run dev`
6. Copy the `dist` folder from the desktop system to project folder on the Raspberry Pi system.
7. Package the installer on the Raspberry Pi system.
- `npm run pack`

You should now have a Debian package in the `out` folder. This package can be installed with `apt` on the Raspberry Pi.
To package or build the install, you will need to follow the above steps you acquire the a working copy of the source
code on a Raspberry Pi running Raspbian, the only supported operating system.

There are two ways to build the installer package depending on which model of Raspberry Pi you have.

#### Using a 1GiB Raspberry Pi and a desktop computer.

The following systems must use this method:

- Raspberry Pi 3 Model B
- Raspberry Pi 3 Model B+
- 1GiB Raspberry Pi 4 Model B,
- Any model with lesser specs than those above, though this is as untested as running BridgeCmdr on it.

Though not optimal, the only way to build a package on a 1GiB Raspberry Pi is to use a desktop computer running a
GNU/Linux based operating system to build the user interface and the Pi to build the installer package.

1. On both systems, install the node packages; `npm ci`
2. On the desktop system, build the user interface source; `npm run prod`
3. Copy the `dist` folder from the desktop system to project folder on the Raspberry Pi system.
4. Package the installer on the Raspberry Pi system; `npm run pack`

#### Using Raspberry Pi with more RAM.

If you are running a Raspberry Pi 4 with 2GiB or 4GiB, all instructions can be done without copying the user interface
files and you will only use that single system. This is a simplest process.

1. Install the node packages; `npm ci`
2. Build the installer package; `npm run package`

#### The Package

You should now have a Raspbian package ending in `.deb` in the `out` folder. This package can be installed with `apt` on
the Raspberry Pi.
2 changes: 1 addition & 1 deletion bridgecmdr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# BridgeCmdr - A/V switch and monitor controller
# Copyright (C) 2019 Matthew Holder
# Copyright (C) 2019-2020 Matthew Holder
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion build/build.common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
BridgeCmdr - A/V switch and monitor controller
Copyright (C) 2019 Matthew Holder
Copyright (C) 2019-2020 Matthew Holder
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion build/electron-packer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
BridgeCmdr - A/V switch and monitor controller
Copyright (C) 2019 Matthew Holder
Copyright (C) 2019-2020 Matthew Holder
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion build/electron.package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
BridgeCmdr - A/V switch and monitor controller
Copyright (C) 2019 Matthew Holder
Copyright (C) 2019-2020 Matthew Holder
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
62 changes: 40 additions & 22 deletions build/webpack-packer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
BridgeCmdr - A/V switch and monitor controller
Copyright (C) 2019 Matthew Holder
Copyright (C) 2019-2020 Matthew Holder
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -31,17 +31,22 @@ const nodeExternals = require("webpack-node-externals");
* =====================================================================================================================
* Plug-ins
*/
const CopyPlugin = require("copy-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const VueLoaderPlugin = require("vue-loader/lib/plugin");
const CopyPlugin = require("copy-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const FriendlyErrorsWebpackPlugin = require("friendly-errors-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const VueLoaderPlugin = require("vue-loader/lib/plugin");

/*
* =====================================================================================================================
* Specials
*/

const isDev = process.env.NODE_ENV !== "development";
const isProd = process.env.NODE_ENV === "production";
const isDev = process.env.NODE_ENV === "development";
if (!isProd && !isDev) {
throw new Error('NODE_ENV must be set to "production" or "development"');
}

/*
* =====================================================================================================================
Expand Down Expand Up @@ -133,7 +138,7 @@ class Packer {
sass: {
loader: "sass-loader",
options: {
sourceMap: isDev,
sourceMap: true,
implementation: require("sass"),
sassOptions: {
fiber: require("fibers"),
Expand All @@ -157,8 +162,9 @@ class Packer {
use: [loaders.esLint],
},
typeScript: {
test: (/\.ts$/u),
use: [loaders.typeScript],
test: (/\.ts$/u),
exclude: (/node_modules/u),
use: [loaders.typeScript],
},
css: {
test: (/\.css$/u),
Expand Down Expand Up @@ -364,6 +370,7 @@ class Packer {
*/
[GeneratePlugins]() {
const plugins = this[myPlugins].concat([
new FriendlyErrorsWebpackPlugin(),
new MiniCssExtractPlugin({
filename: "[name].css",
chunkFilename: "[id].css",
Expand All @@ -381,7 +388,7 @@ class Packer {
title: productName,
filename: path.resolve(packerConfigPath, outdir, "index.html"),
template: path.resolve(packerConfigPath, html),
minify: isDev,
minify: isProd,
// TODO: favicon, meta
}));
}
Expand All @@ -396,25 +403,35 @@ class Packer {
return plugins;
}

// TODO: Set `.context` and `.stats.context` options.

/**
* @param {Object.<string, string>} env
* @param {string} target
* @return {Promise<WebpackOptions>}
*/
generate(env, target) {
generate(target) {
return allReady.then(() => _.merge({
mode: env.NODE_ENV,
mode: process.env.NODE_ENV,
target: target,
stats: {
builtAt: false, // Don't need to know when it was built.
children: false, // Don't need to see all the children.
chunks: false, // Don't really need to know the chunks.
chunkGroups: false, // Don't really need to know the chunk groups.
chunkModules: false, // Don't need to know the modules in a chunk.
chunkOrigins: false, // Don't really need to know the chunk origins.
hash: false, // Don't really need to know the hash.
modules: false, // Don't need to know the modules.
reasons: false, // Don't need to know why modules are included.
builtAt: false, // Don't need to show when it was built.
children: false, // Don't need to see all the children.
chunks: false, // Don't really need to show the chunks.
entrypoints: false, // Don't really need to show the entry-points.
errors: false, // Don't display error details, there is a plug-in for that.
errorDetails: false, // Don't display error details, there is a plug-in for that.
hash: false, // Don't really need to show the hash.
modules: false, // Don't need to show the modules.
performance: isProd, // Base performance reporting on target environment.
publicPath: false, // Don't really need to show the public path.
reasons: false, // Don't need to know why modules are included.
source: false, // Don't really need to show the source code.
timings: false, // Don't really need to show the timing information.
version: false, // Don't really need to show the version information.
},
performance: {
hints: false,
},
externals: [
nodeExternals({
Expand Down Expand Up @@ -445,7 +462,8 @@ class Packer {
},
plugins: this[GeneratePlugins](),
resolve: {
extensions: [ ".wasm", ".vue", ".ts", ".mjs", ".js" ],
extensions: [ ".wasm", ".mjs", ".js", ".ts", ".json", ".vue" ],
alias: { "vue$": "vue/dist/vue.esm.js" },
},
}, this[myExtras]));
}
Expand Down
8 changes: 4 additions & 4 deletions build/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
BridgeCmdr - A/V switch and monitor controller
Copyright (C) 2019 Matthew Holder
Copyright (C) 2019-2020 Matthew Holder
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -26,7 +26,7 @@ const packerConfigPath = "..";
require(path.join(packerConfigPath, "webpack.packer"));

// Now export our functions.
module.exports = env => Promise.all([
packer.main.generate(env, "electron-main"),
packer.render.generate(env, "electron-renderer"),
module.exports = () => Promise.all([
packer.main.generate("electron-main"),
packer.render.generate("electron-renderer"),
]);
Loading

0 comments on commit a02c34a

Please sign in to comment.