-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It works on the phone. It's awesome.
- Loading branch information
stefanonepa
committed
Mar 3, 2017
0 parents
commit fa686ea
Showing
39 changed files
with
1,191 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"presets": [["es2015", {"modules": false}], "stage-2"], | ||
"plugins": ["transform-runtime"], | ||
"comments": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build/*.js | ||
config/*.js | ||
dist/*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module.exports = { | ||
root: true, | ||
parserOptions: { | ||
sourceType: 'module' | ||
}, | ||
env: { | ||
browser: true | ||
}, | ||
globals: { | ||
'cordova': true, | ||
'Velocity': true, | ||
'DEV': true, | ||
'PROD': true, | ||
'__THEME': true | ||
}, | ||
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style | ||
extends: 'standard', | ||
// required to lint *.vue files | ||
plugins: [ | ||
'html' | ||
], | ||
// add your custom rules here | ||
'rules': { | ||
// allow paren-less arrow functions | ||
'arrow-parens': 0, | ||
'one-var': 0, | ||
// allow debugger during development | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, | ||
'brace-style': [2, 'stroustrup', { 'allowSingleLine': true }] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.DS_Store | ||
node_modules/ | ||
dist/ | ||
npm-debug.log | ||
npm-debug.log.* | ||
selenium-debug.log | ||
test/unit/coverage | ||
test/e2e/reports | ||
cordova/platforms | ||
cordova/plugins | ||
thumbs.db | ||
!.gitkeep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"blocks": "never", | ||
"brackets": "never", | ||
"colons": "never", | ||
"colors": "always", | ||
"commaSpace": "always", | ||
"commentSpace": "always", | ||
"cssLiteral": "never", | ||
"depthLimit": false, | ||
"duplicates": true, | ||
"efficient": "always", | ||
"extendPref": false, | ||
"globalDupe": true, | ||
"indentPref": 2, | ||
"leadingZero": "never", | ||
"maxErrors": false, | ||
"maxWarnings": false, | ||
"mixed": false, | ||
"namingConvention": false, | ||
"namingConventionStrict": false, | ||
"none": "never", | ||
"noImportant": false, | ||
"parenSpace": "never", | ||
"placeholder": false, | ||
"prefixVarsWithDollar": "always", | ||
"quotePref": "single", | ||
"semicolons": "never", | ||
"sortOrder": false, | ||
"stackedProperties": "never", | ||
"trailingWhitespace": "never", | ||
"universal": "never", | ||
"valid": true, | ||
"zeroUnits": "never", | ||
"zIndexNormalize": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"vsicons.presets.angular": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Quasar App | ||
|
||
> A Quasar project | ||
## Build Setup | ||
|
||
``` bash | ||
# install dependencies | ||
$ npm install | ||
|
||
# serve with hot reload at localhost:8080 | ||
$ quasar dev | ||
|
||
# build for production with minification | ||
$ quasar build | ||
|
||
# lint code | ||
$ quasar lint | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
var | ||
ExtractTextPlugin = require('extract-text-webpack-plugin'), | ||
autoprefixer = require('autoprefixer') | ||
|
||
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var | ||
config = require('../config'), | ||
theme = process.argv[2] || config.defaultTheme | ||
|
||
module.exports = { | ||
dev: process.env.NODE_ENV === 'development', | ||
prod: process.env.NODE_ENV === 'production', | ||
|
||
platform: { | ||
theme: theme, | ||
cordovaAssets: './cordova/platforms/' + (theme === 'mat' ? 'android' : 'ios') + '/platform_www' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* eslint-disable */ | ||
require('eventsource-polyfill') | ||
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') | ||
|
||
hotClient.subscribe(function (event) { | ||
if (event.action === 'reload') { | ||
window.location.reload() | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
process.env.NODE_ENV = 'production' | ||
|
||
require('colors') | ||
|
||
var | ||
shell = require('shelljs'), | ||
path = require('path'), | ||
env = require('./env-utils'), | ||
webpack = require('webpack'), | ||
webpackConfig = require('./webpack.prod.conf'), | ||
targetPath = path.join(__dirname, '../dist') | ||
|
||
console.log(' WARNING!'.bold) | ||
console.log(' Do NOT use VueRouter\'s "history" mode if') | ||
console.log(' building for Cordova or Electron.\n') | ||
|
||
require('./script.clean.js') | ||
console.log((' Building Quasar App with "' + env.platform.theme + '" theme...\n').bold) | ||
|
||
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') | ||
|
||
console.log(( | ||
'\n Build complete with "' + env.platform.theme.bold + '" theme in ' + | ||
'"/dist"'.bold + ' folder.\n').cyan) | ||
|
||
console.log(' Built files are meant to be served over an HTTP server.'.bold) | ||
console.log(' Opening index.html over file:// won\'t work.'.bold) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var | ||
shell = require('shelljs'), | ||
path = require('path') | ||
|
||
shell.rm('-rf', path.resolve(__dirname, '../dist')) | ||
console.log(' Cleaned build artifacts.\n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
process.env.NODE_ENV = 'development' | ||
|
||
require('colors') | ||
|
||
var | ||
path = require('path'), | ||
express = require('express'), | ||
webpack = require('webpack'), | ||
env = require('./env-utils'), | ||
config = require('../config'), | ||
opn = require('opn'), | ||
proxyMiddleware = require('http-proxy-middleware'), | ||
webpackConfig = require('./webpack.dev.conf'), | ||
app = express(), | ||
port = process.env.PORT || config.dev.port, | ||
uri = 'http://localhost:' + port | ||
|
||
console.log(' Starting dev server with "' + (process.argv[2] || env.platform.theme).bold + '" theme...') | ||
console.log(' Will listen at ' + uri.bold) | ||
if (config.dev.openBrowser) { | ||
console.log(' Browser will open when build is ready.\n') | ||
} | ||
|
||
var compiler = webpack(webpackConfig) | ||
|
||
// Define HTTP proxies to your custom API backend | ||
// https://github.com/chimurai/http-proxy-middleware | ||
var proxyTable = config.dev.proxyTable | ||
|
||
var devMiddleware = require('webpack-dev-middleware')(compiler, { | ||
publicPath: webpackConfig.output.publicPath, | ||
quiet: true | ||
}) | ||
|
||
var 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) { | ||
var 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 | ||
var 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)) | ||
|
||
module.exports = app.listen(port, function (err) { | ||
if (err) { | ||
console.log(err) | ||
return | ||
} | ||
|
||
// open browser if set so in /config/index.js | ||
if (config.dev.openBrowser) { | ||
devMiddleware.waitUntilValid(function () { | ||
opn(uri) | ||
}) | ||
} | ||
}) |
Oops, something went wrong.