Commit 4f10875b authored by A. Koch's avatar A. Koch

replaced entire project with quasar 15 version

parent ecfd4629
{
"presets": [
["env", {
"targets": {
"chrome": 52,
"uglify": true
},
"modules": false
}]
[ "env", {"modules": false} ],
"stage-2"
],
"plugins": ["transform-runtime"],
"comments": false
......
# This file was magically generated by robot unicorns
# and will not preserve your edits.
exclude_paths:
- dist/**
- test/**
......@@ -6,24 +6,28 @@ engines:
enabled: true
nodesecurity:
enabled: true
bfixme:
fixme:
enabled: true
eslint:
enabled: true
csslint:
enabled: true
git-legal:
enabled: true
stylelint:
enabled: true
duplication:
enabled: true
config:
languages:
- javascript:
ratings:
paths:
- src/**
- "**.md"
exclude_paths:
- dist/**
- test/**
- node_modules/**
- README.md
- .readme/api.md
# Ignore generated files
dist/*
README.md
_book/*
/dist
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true
browser: true,
mocha: true
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard'
],
// required to lint *.vue files
plugins: [
'html',
'import'
'vue'
],
globals: {
'ga': true, // Google Analytics
'cordova': true,
'DEV': true,
'PROD': true,
'__THEME': true
'__statics': true
},
// add your custom rules here
'rules': {
// allow async-await
'generator-star-spacing': 'off',
// allow paren-less arrow functions
'arrow-parens': 0,
'one-var': 0,
'import/first': 0,
'import/named': 2,
'import/namespace': 2,
'import/default': 2,
'import/export': 2,
'import/extensions': 0,
'import/no-unresolved': 0,
'import/no-extraneous-dependencies': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'brace-style': [2, 'stroustrup', { 'allowSingleLine': true }]
// change default indent behaviour
'indent': 'off',
'indent-legacy': ['error', 2],
// change default brace-style
'brace-style': [2, 'stroustrup', { 'allowSingleLine': true }],
// for mocha & chai tests
'no-unused-vars': ['error', { varsIgnorePattern: 'should|expect' }]
}
}
......@@ -65,4 +65,14 @@ _book
*.mobi
*.pdf
# JetBrains
.idea
# nyc coverage
.nyc_output
# Quasar
.quasar
/src-cordova/platforms
/src-cordova/plugins
/src-cordova/www
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
plugins: [
// to edit target browsers: use "browserslist" field in package.json
require('autoprefixer')
]
}
## Install
```shell
npm install -g vue-cli quasar-cli
npm install
```
## Run
## Run in third-party webserver
Just execute ``npm start`` to serve the static files. Control server address through ``HOST`` and ``PORT`` env variables.
Point your webserver config to the ``dist`` directory. Configure your webserver to serve ``index.html`` with a 200 status code instead of a 404 error page.
## Customise
## Run as standalone server
Execute ``npm start`` to start the built-in webserver. Control server address through ``HOST`` and ``PORT`` env variables.
**Do not edit the `apiConf` in `package.json`, it is auto-generated and will be overwritten**
## Customise
In order to customize the build, use these env vars:
......
......@@ -7,6 +7,8 @@ matrix:
node_js:
- "9.11.1"
script:
- npm run dist || true
- npm run build || true
- npm run lint
- npm test
# macOS 10.12
......@@ -15,5 +17,7 @@ matrix:
node_js:
- "9.11.1"
script:
- npm run dist || true
- npm run build || true
- npm run lint
- npm test
......@@ -2,28 +2,31 @@
[comment]: # (To edit its contents please refer to the project dir '.readme')
# Motion Bank Systems Frontend
> Combined frontend project for Motion Bank web services
[![NPM version](https://badge.fury.io/js/motionbank-systems-frontend.svg)](https://npmjs.org/package/motionbank-systems-frontend)
[![Build status](https://secure.travis-ci.org/motionbank-js/motionbank-systems-frontend.svg)](https://travis-ci.org/motionbank-js/motionbank-systems-frontend)
[![Dependency Status](https://tidelift.com/badges/github/motionbank-js/motionbank-systems-frontend?style=flat)](https://tidelift.com/repo/github/motionbank-js/motionbank-systems-frontend)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/068aa9defed5426e91e2c2f4c1e2190d)](https://www.codacy.com/app/motionbank-js/motionbank-systems-frontend)
[![Maintainability](https://api.codeclimate.com/v1/badges/cba51f9e40aef7db5dec/maintainability)](https://codeclimate.com/github/motionbank-js/motionbank-systems-frontend)
[![Dependency Status](https://tidelift.com/badges/github/motionbank-js/motionbank-systems-frontend)](https://tidelift.com/repo/github/motionbank-js/motionbank-systems-frontend)
[![Maintainability](https://api.codeclimate.com/v1/badges/cba51f9e40aef7db5dec/maintainability)](https://codeclimate.com/github/motionbank-js/motionbank-systems-frontend/maintainability)
## Install
```shell
npm install -g vue-cli quasar-cli
npm install
```
## Run
## Run in third-party webserver
Just execute ``npm start`` to serve the static files. Control server address through ``HOST`` and ``PORT`` env variables.
Point your webserver config to the ``dist`` directory. Configure your webserver to serve ``index.html`` with a 200 status code instead of a 404 error page.
## Customise
## Run as standalone server
**Do not edit the `apiConf` in `package.json`, it is auto-generated and will be overwritten**
Execute ``npm start`` to start the built-in webserver. Control server address through ``HOST`` and ``PORT`` env variables.
## Customise
In order to customize the build, use these env vars:
......
![http://www.blog.tanzmedizin.com/wp-content/uploads/2014/04/logo-motion-bank-klein-300x120.png](https://d19p4zemcycm7a.cloudfront.net/logos/logo-100.png)
Click and confirm that you want to sign in to @@application.name@@.
Your verification code is:
@@code@@
You can also just sign using this link (expires in 1h):
[@@link@@](@@link@@)
If you are having any issues with your account, please don't hesitate to contact us by replying to this mail.
Thanks,
Your Motion Bot
------
If you did not make this request, please contact us by replying to this mail.
const chalk = require('chalk')
class CLI {
static separator (char = '-', len = 90) {
return new Array(len).fill(char).join('')
}
static writer (msg, out = process.stdout) {
if (typeof out.write === 'function') out.write(' ' + msg + '\n')
}
static padLen (str, len = 23, char = ' ') {
return str + new Array(len - str.length).fill(char).join('')
}
static label (str) {
return CLI.padLen(str || '', 23, chalk.gray('.'))
}
static data (str) {
return str ? chalk.bold(str) : ''
}
static line (label, datum, sep = ' ') {
return `${CLI.label(label)}${sep}${CLI.data(datum)}`
}
static col (str, color = 'white', style = undefined) {
str = chalk[color](str)
return style ? chalk[style](str) : str
}
static toText (obj) {
if (!obj) return ''
return JSON.stringify(obj, null, ' ')
}
static toLines (text) {
if (!text) return []
return text.substr(1, text.length - 4)
.replace(/[",]/g, '')
.split('\n')
.map(line => {
const pair = line.split(': ')
if (pair.length > 1) return CLI.line(pair[0].substr(1), pair[1])
return null
})
.filter(line => { return line !== null })
}
static print (lines = []) {
lines.forEach(line => CLI.writer(line))
}
}
module.exports = CLI
var
ExtractTextPlugin = require('extract-text-webpack-plugin'),
autoprefixer = require('autoprefixer'),
purify = require('purify-css'),
glob = require('glob'),
path = require('path'),
fs = require('fs')
module.exports.postcss = [autoprefixer()]
module.exports.styleLoaders = function (options) {
options = options || {}
function generateLoaders (loaders) {
if (options.postcss) {
loaders.splice(1, 0, 'postcss')
}
var sourceLoader = loaders.map(function (loader) {
var extraParamChar
if (/\?/.test(loader)) {
loader = loader.replace(/\?/, '-loader?')
extraParamChar = '&'
}
else {
loader = loader + '-loader'
extraParamChar = '?'
}
return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '')
}).join('!')
if (options.extract) {
return ExtractTextPlugin.extract({
use: sourceLoader,
fallback: 'vue-style-loader'
})
}
else {
return ['vue-style-loader', sourceLoader].join('!')
}
}
return {
css: generateLoaders(['css']),
less: generateLoaders(['css', 'less']),
sass: generateLoaders(['css', 'sass?indentedSyntax']),
scss: generateLoaders(['css', 'sass']),
styl: generateLoaders(['css', 'stylus']),
stylus: generateLoaders(['css', 'stylus'])
}
}
module.exports.styleRules = function (options) {
var output = []
var loaders = exports.styleLoaders(options)
for (var extension in loaders) {
var loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
loader: loader
})
}
return output
}
function getSize (size) {
return (size / 1024).toFixed(2) + 'kb'
}
module.exports.purify = function (cb) {
var css = glob.sync(path.join(__dirname, '../dist/**/*.css'))
var js = glob.sync(path.join(__dirname, '../dist/**/*.js'))
Promise.all(css.map(function (file) {
return new Promise(function (resolve) {
console.log('\n Purifying ' + path.relative(path.join(__dirname, '../dist'), file) + '...')
purify(js, [file], {minify: true}, function (purified) {
var oldSize = fs.statSync(file).size
fs.writeFileSync(file, purified)
var newSize = fs.statSync(file).size
console.log(
' * Reduced size by ' + ((1 - newSize / oldSize) * 100).toFixed(2) + '%, from ' +
getSize(oldSize) + ' to ' + getSize(newSize) + '.'
)
resolve()
})
})
})).then(cb)
}
var
config = require('../src/config'),
theme = process.argv[2] || config.defaultTheme
module.exports = {
dev: process.env.NODE_ENV === 'development',
prod: process.env.NODE_ENV === 'production',
routerMode: process.env.ROUTER_MODE || 'history',
platform: {
theme: theme,
cordovaAssets: './cordova/platforms/' + (theme === 'mat' ? 'android' : 'ios') + '/platform_www'
}
}
/* eslint-disable */
require('eventsource-polyfill')
require('webpack-hot-middleware/client?noInfo=true&reload=true')
const webpack = require('webpack'),
configBase = require('./webpack.base.conf'),
configDist = require('./webpack.dist.conf')
const build = function (config) {
return new Promise(function (resolve, reject) {
webpack(config, function (err, stats) {
if (err) return reject(err)
const ststr = stats ? stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) : stats
if (ststr) {
process.stdout.write(`${ststr}\n\n`)
}
resolve()
})
})
}
build(configBase)
.then(function () { return build(configDist) })
.then(function () { process.exit(0) })
.catch(function (err) {
process.stderr.write(`${err.message}\n\n${err.stack}\n\n`)
process.exit(err.code)
})
process.env.NODE_ENV = 'production'
const
{ col, separator, print } = require('./cli-utils'),
shell = require('shelljs'),
path = require('path'),
css = require('./css-utils'),
config = require('../src/config'),
webpack = require('webpack'),
webpackConfig = require('./webpack.prod.conf'),
targetPath = path.join(__dirname, '../dist')
require('./script.clean.js')
printBuildInfo()
shell.mkdir('-p', targetPath)
shell.cp('-R', 'src/statics', targetPath)
webpack(webpackConfig, function (err, stats) {
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n')
if (stats.hasErrors()) {
process.exit(1)
}
if (config.webpack.build.purifyCSS) {
css.purify(finalize)
}
else {
finalize()
}
})
function printBuildInfo () {
const theme = col(`"${config.webpack.defaultTheme}"`, 'yellow', 'bold')
print([
col(separator(), 'red'),
col('WARNING!', 'red', 'bold'),
col(separator(), 'red'),
col('Do NOT use VueRouter\'s ' + col('"history"', 'white', 'bold') + ' mode'),
col('if building for Cordova or Electron.'), '\n\n',
col(separator(), 'cyan'),
col('Building Quasar App with ', 'cyan') + theme + col(' theme...', 'cyan'), '\n'
])
}
function finalize () {
const theme = col(`"${config.webpack.defaultTheme}"`, 'yellow', 'bold')
print([
'\n', col(separator('='), 'cyan'),
col('Build complete with ' + theme + ' theme in ' +
col('"/dist"', 'yellow', 'bold') + ' folder.'),
col(separator(), 'cyan'),
col('Built files are meant to be served over an HTTP server.'),
col('Opening index.html over file:// won\'t work.'), '\n\n'
])
}
const
{ print, separator, col } = require('./cli-utils'),
shell = require('shelljs'),
path = require('path')
shell.rm('-rf', path.resolve(__dirname, '../dist/*'))
shell.rm('-rf', path.resolve(__dirname, '../dist/.*'))
print([
col('Cleaned build artifacts.', 'yellow'),
col(separator(), 'yellow'), '\n'
])
process.env.NODE_ENV = 'development'
const
{ col, separator, print } = require('./cli-utils'),
path = require('path'),
express = require('express'),
webpack = require('webpack'),
opn = require('opn'),
proxyMiddleware = require('http-proxy-middleware'),
// Configuration
env = require('./env-utils'),
config = require('../src/config'),
webpackConfig = require('./webpack.dev.conf'),
compiler = webpack(webpackConfig),
// Define HTTP proxies to your custom API backend
// https://github.com/chimurai/http-proxy-middleware
proxyTable = config.webpack.dev.proxyTable,
// Express
app = express(),
port = process.env.PORT || config.webpack.dev.port,
uri = config.app.hosts.frontend
const theme = col(`"${config.webpack.defaultTheme}"`, 'cyan', 'bold')
let output = [
col('Starting dev server with ', 'yellow') + theme + col(' theme...', 'yellow'),
col(separator(), 'yellow'), '\n',
col('Will listen at ') + col(uri, 'white', 'bold')
]
if (config.webpack.dev.openBrowser) {
output = output.concat([
col('Browser will open when build is ready.', 'white', 'bold')
])
}
print(
output.concat(['\n'])
)
const
devMiddleware = require('webpack-dev-middleware')(compiler, {
publicPath: webpackConfig.output.publicPath,
quiet: true
}),
hotMiddleware = require('webpack-hot-middleware')(compiler, {
log: function () {}
})
// force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function (compilation) {
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
hotMiddleware.publish({ action: 'reload' })
cb()
})
})
// proxy requests like API. See /config/index.js -> dev.proxyTable
// https://github.com/chimurai/http-proxy-middleware
Object.keys(proxyTable).forEach(function (context) {
let options = proxyTable[context]
if (typeof options === 'string') {
options = { target: options }
}
app.use(proxyMiddleware(context, options))
})
// handle fallback for HTML5 history API
app.use(require('connect-history-api-fallback')())
// serve webpack bundle output
app.use(devMiddleware)
// enable hot-reload and state-preserving
// compilation error display
app.use(hotMiddleware)
// serve pure static assets
const staticsPath = path.posix.join(webpackConfig.output.publicPath, 'statics/')
app.use(staticsPath, express.static('./src/statics'))
// try to serve Cordova statics for Play App
app.use(express.static(env.platform.cordovaAssets))