Skip to content

Commit

Permalink
Merge pull request #12 from tue-robotics/update
Browse files Browse the repository at this point in the history
update
  • Loading branch information
MatthijsBurgh authored Jun 26, 2020
2 parents 9c12844 + 2eb6627 commit f12d839
Show file tree
Hide file tree
Showing 18 changed files with 15,281 additions and 12,758 deletions.
167 changes: 149 additions & 18 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,168 @@
"env": {
"test": {
"presets": [
["env", {
"targets": { "node": 11 }
}],
"stage-0"
[
"@babel/preset-env",
{
"targets": {
"node": 11
}
}
]
],
"plugins": ["istanbul"]
"plugins": [
"istanbul",
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-logical-assignment-operators",
"@babel/plugin-proposal-optional-chaining",
[
"@babel/plugin-proposal-pipeline-operator",
{
"proposal": "minimal"
}
],
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-do-expressions",
"@babel/plugin-proposal-function-bind"
]
},
"main": {
"presets": [
["env", {
"targets": { "node": 11 }
}],
"stage-0"
[
"@babel/preset-env",
{
"targets": {
"node": 11
}
}
]
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-logical-assignment-operators",
"@babel/plugin-proposal-optional-chaining",
[
"@babel/plugin-proposal-pipeline-operator",
{
"proposal": "minimal"
}
],
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-do-expressions",
"@babel/plugin-proposal-function-bind"
]
},
"renderer": {
"presets": [
["env", {
"modules": false
}],
"stage-0"
[
"@babel/preset-env",
{
"modules": false
}
]
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-logical-assignment-operators",
"@babel/plugin-proposal-optional-chaining",
[
"@babel/plugin-proposal-pipeline-operator",
{
"proposal": "minimal"
}
],
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-do-expressions",
"@babel/plugin-proposal-function-bind"
]
},
"web": {
"presets": [
["env", {
"modules": false
}],
"stage-0"
[
"@babel/preset-env",
{
"modules": false
}
]
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-logical-assignment-operators",
"@babel/plugin-proposal-optional-chaining",
[
"@babel/plugin-proposal-pipeline-operator",
{
"proposal": "minimal"
}
],
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-do-expressions",
"@babel/plugin-proposal-function-bind"
]
}
},
"plugins": ["transform-runtime"]
"plugins": [
[
"@babel/plugin-transform-runtime",
{
"corejs": 2
}
]
]
}
5 changes: 3 additions & 2 deletions .electron-vue/dev-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const chalk = require('chalk')
const electron = require('electron')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')
const { say } = require('cfonts')
const { spawn } = require('child_process')
Expand Down Expand Up @@ -49,7 +50,7 @@ function startRenderer () {
})

compiler.hooks.compilation.tap('compilation', compilation => {
compilation.hooks.htmlWebpackPluginAfterEmit.tapAsync('html-webpack-plugin-after-emit', (data, cb) => {
HtmlWebpackPlugin.getHooks(compilation).afterEmit.tapAsync('html-webpack-plugin-after-emit', (data, cb) => {
hotMiddleware.publish({ action: 'reload' })
cb()
})
Expand Down Expand Up @@ -127,7 +128,7 @@ function startElectron () {
}

electronProcess = spawn(electron, args)

electronProcess.stdout.on('data', data => {
electronLog(data, 'blue')
})
Expand Down
7 changes: 4 additions & 3 deletions .electron-vue/webpack.main.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ const path = require('path')
const { dependencies } = require('../package.json')
const webpack = require('webpack')

const MinifyPlugin = require("babel-minify-webpack-plugin")
const TerserPlugin = require('terser-webpack-plugin');

let mainConfig = {
entry: {
main: path.join(__dirname, '../src/main/index.js')
},
externals: [
...Object.keys(dependencies || {})
...Object.keys(dependencies || {}),
{'electron-debug': 'electron-debug'}
],
module: {
rules: [
Expand Down Expand Up @@ -73,7 +74,7 @@ if (process.env.NODE_ENV !== 'production') {
*/
if (process.env.NODE_ENV === 'production') {
mainConfig.plugins.push(
new MinifyPlugin(),
new TerserPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
})
Expand Down
19 changes: 10 additions & 9 deletions .electron-vue/webpack.renderer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const path = require('path')
const { dependencies } = require('../package.json')
const webpack = require('webpack')

const MinifyPlugin = require("babel-minify-webpack-plugin")
const TerserPlugin = require('terser-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
Expand Down Expand Up @@ -170,14 +170,15 @@ if (process.env.NODE_ENV === 'production') {
rendererConfig.devtool = ''

rendererConfig.plugins.push(
new MinifyPlugin(),
new CopyWebpackPlugin([
{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/electron/static'),
ignore: ['.*']
}
]),
new TerserPlugin(),
new CopyWebpackPlugin({
patterns: [
{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/electron/static')
}
]
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
}),
Expand Down
19 changes: 10 additions & 9 deletions .electron-vue/webpack.web.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ process.env.BABEL_ENV = 'web'
const path = require('path')
const webpack = require('webpack')

const MinifyPlugin = require("babel-minify-webpack-plugin")
const TerserPlugin = require('terser-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
Expand Down Expand Up @@ -131,14 +131,15 @@ if (process.env.NODE_ENV === 'production') {
webConfig.devtool = ''

webConfig.plugins.push(
new MinifyPlugin(),
new CopyWebpackPlugin([
{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/web/static'),
ignore: ['.*']
}
]),
new TerserPlugin(),
new CopyWebpackPlugin({
patterns: [
{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/web/static')
}
]
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
}),
Expand Down
5 changes: 3 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = {
root: true,
parser: 'babel-eslint',
parser: "vue-eslint-parser",
parserOptions: {
parser: "babel-eslint",
sourceType: 'module'
},
env: {
Expand All @@ -13,7 +14,7 @@ module.exports = {
__static: true
},
plugins: [
'html'
'vue'
],
'rules': {
// allow paren-less arrow functions
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.DS_Store
dist/electron/*
dist/web/*
dist/*
build/*
!build/icons
coverage
Expand Down
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Commented sections below can be used to run tests on the CI server
# https://simulatedgreg.gitbooks.io/electron-vue/content/en/testing.html#on-the-subject-of-ci-testing
os: linux
dist: trusty
dist: bionic
language: node_js
node_js:
- '11'
- '12'
- '14'

cache:
directories:
Expand All @@ -27,8 +28,8 @@ before_script:
- Xvfb :99 -screen 0 1024x600x24 > /dev/null 2>&1 &

script:
- npm run build
- npm run test
- PROGRESS="--no-progress" npm run build
- PROGRESS="--no-progress" npm run test

deploy:
provider: releases
Expand All @@ -40,3 +41,4 @@ deploy:
repo: tue-robotics/hero-display
tags: true
all_branches: true
node_js: '12'
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# hero-display
[![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![devDependency Status][daviddm-image-dev]][daviddm-url-dev] [![optionalDependencies Status][daviddm-image-optional]][daviddm-url-optional]


Display sink for the hero display that presents information to the user.

Expand Down Expand Up @@ -41,3 +43,17 @@ rostopic pub /text_to_speech/output std_msgs/String -- "I am hero, an awesome ro
# Run hero-display executable
export NO_FULLSCREEN=1 && ./hero-display.AppImage
```

---

This project was generated with [electron-vue](https://github.com/SimulatedGREG/electron-vue)@[45a3e22](https://github.com/SimulatedGREG/electron-vue/tree/45a3e224e7bb8fc71909021ccfdcfec0f461f634) using [vue-cli](https://github.com/vuejs/vue-cli). Documentation about the original structure can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/index.html).

[travis-image]: https://travis-ci.com/tue-robotics/hero-display.svg?branch=master
[travis-url]: https://travis-ci.com/tue-robotics/hero-display

[daviddm-image]: https://david-dm.org/tue-robotics/hero-display/status.svg
[daviddm-url]: https://david-dm.org/tue-robotics/hero-display
[daviddm-image-dev]: https://david-dm.org/tue-robotics/hero-display/dev-status.svg
[daviddm-url-dev]: https://david-dm.org/tue-robotics/hero-display?type=dev
[daviddm-image-optional]: https://david-dm.org/tue-robotics/hero-display/optional-status.svg
[daviddm-url-optional]: https://david-dm.org/tue-robotics/hero-display?type=optional
Loading

0 comments on commit f12d839

Please sign in to comment.