mirror of
https://github.com/TheGreyDiamond/Enlight.git
synced 2025-12-16 23:10:45 +01:00
New try
This commit is contained in:
@@ -1,15 +1,6 @@
|
|||||||
{
|
{
|
||||||
"comments": false,
|
"comments": false,
|
||||||
"env": {
|
"env": {
|
||||||
"test": {
|
|
||||||
"presets": [
|
|
||||||
["env", {
|
|
||||||
"targets": { "node": 7 }
|
|
||||||
}],
|
|
||||||
"stage-0"
|
|
||||||
],
|
|
||||||
"plugins": ["istanbul"]
|
|
||||||
},
|
|
||||||
"main": {
|
"main": {
|
||||||
"presets": [
|
"presets": [
|
||||||
["env", {
|
["env", {
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
test/unit/coverage/**
|
|
||||||
test/unit/*.js
|
|
||||||
test/e2e/*.js
|
|
||||||
|
|||||||
1
enlight/.gitignore
vendored
1
enlight/.gitignore
vendored
@@ -3,7 +3,6 @@ dist/electron/*
|
|||||||
dist/web/*
|
dist/web/*
|
||||||
build/*
|
build/*
|
||||||
!build/icons
|
!build/icons
|
||||||
coverage
|
|
||||||
node_modules/
|
node_modules/
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
npm-debug.log.*
|
npm-debug.log.*
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# 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
|
|
||||||
osx_image: xcode8.3
|
osx_image: xcode8.3
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: trusty
|
||||||
@@ -20,22 +18,18 @@ addons:
|
|||||||
packages:
|
packages:
|
||||||
- libgnome-keyring-dev
|
- libgnome-keyring-dev
|
||||||
- icnsutils
|
- icnsutils
|
||||||
#- xvfb
|
|
||||||
before_install:
|
before_install:
|
||||||
- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([
|
- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([
|
||||||
"$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.2.1.tar.gz
|
"$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.2.1.tar.gz
|
||||||
| tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull
|
| tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi
|
||||||
install:
|
install:
|
||||||
#- export DISPLAY=':99.0'
|
|
||||||
#- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
|
|
||||||
- nvm install 10
|
- nvm install 10
|
||||||
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||||
- source ~/.bashrc
|
- source ~/.bashrc
|
||||||
- npm install -g xvfb-maybe
|
- npm install -g xvfb-maybe
|
||||||
- yarn
|
- yarn
|
||||||
script:
|
script:
|
||||||
#- xvfb-maybe node_modules/.bin/karma start test/unit/karma.conf.js
|
|
||||||
- yarn run build
|
- yarn run build
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
|
|||||||
@@ -14,9 +14,6 @@ npm run dev
|
|||||||
# build electron application for production
|
# build electron application for production
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
# run unit tests
|
|
||||||
npm test
|
|
||||||
|
|
||||||
|
|
||||||
# lint all JS/Vue component files in `src/`
|
# lint all JS/Vue component files in `src/`
|
||||||
npm run lint
|
npm run lint
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# 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
|
|
||||||
version: 0.1.{build}
|
version: 0.1.{build}
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
@@ -26,7 +24,6 @@ install:
|
|||||||
- node --version
|
- node --version
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
#- yarn test
|
|
||||||
- yarn build
|
- yarn build
|
||||||
|
|
||||||
test: off
|
test: off
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "enlight",
|
"name": "enlight",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"author": "TheGreydiamond (grey@thegreydiamond.de)",
|
"author": "TheGreyDiamond <s-einkauf@oest-rs.de>",
|
||||||
"description": "Smart open source lighting control",
|
"description": "Smart open source lighting control",
|
||||||
"license": null,
|
"license": null,
|
||||||
"main": "./dist/electron/main.js",
|
"main": "./dist/electron/main.js",
|
||||||
@@ -11,13 +11,11 @@
|
|||||||
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
|
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
|
||||||
"build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
|
"build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
|
||||||
"dev": "node .electron-vue/dev-runner.js",
|
"dev": "node .electron-vue/dev-runner.js",
|
||||||
"lint": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter src test",
|
"lint": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter src",
|
||||||
"lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src test",
|
"lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src",
|
||||||
"pack": "npm run pack:main && npm run pack:renderer",
|
"pack": "npm run pack:main && npm run pack:renderer",
|
||||||
"pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js",
|
"pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js",
|
||||||
"pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js",
|
"pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js",
|
||||||
"test": "npm run unit",
|
|
||||||
"unit": "karma start test/unit/karma.conf.js",
|
|
||||||
"postinstall": "npm run lint:fix"
|
"postinstall": "npm run lint:fix"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
@@ -56,7 +54,6 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vue": "^2.5.16",
|
"vue": "^2.5.16",
|
||||||
"axios": "^0.18.0",
|
|
||||||
"vue-electron": "^1.0.6",
|
"vue-electron": "^1.0.6",
|
||||||
"vue-router": "^3.0.1",
|
"vue-router": "^3.0.1",
|
||||||
"vuex": "^3.0.1",
|
"vuex": "^3.0.1",
|
||||||
@@ -95,18 +92,6 @@
|
|||||||
"mini-css-extract-plugin": "0.4.0",
|
"mini-css-extract-plugin": "0.4.0",
|
||||||
"file-loader": "^1.1.11",
|
"file-loader": "^1.1.11",
|
||||||
"html-webpack-plugin": "^3.2.0",
|
"html-webpack-plugin": "^3.2.0",
|
||||||
"inject-loader": "^4.0.1",
|
|
||||||
"karma": "^2.0.2",
|
|
||||||
"karma-chai": "^0.1.0",
|
|
||||||
"karma-coverage": "^1.1.2",
|
|
||||||
"karma-electron": "^6.0.0",
|
|
||||||
"karma-mocha": "^1.3.0",
|
|
||||||
"karma-sourcemap-loader": "^0.3.7",
|
|
||||||
"karma-spec-reporter": "^0.0.32",
|
|
||||||
"karma-webpack": "^3.0.0",
|
|
||||||
"babel-plugin-istanbul": "^4.1.6",
|
|
||||||
"chai": "^4.1.2",
|
|
||||||
"mocha": "^5.2.0",
|
|
||||||
"multispinner": "^0.2.1",
|
"multispinner": "^0.2.1",
|
||||||
"node-loader": "^0.6.0",
|
"node-loader": "^0.6.0",
|
||||||
"style-loader": "^0.21.0",
|
"style-loader": "^0.21.0",
|
||||||
|
|||||||
@@ -2,10 +2,23 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
<title>enlight</title>
|
||||||
|
<% if (htmlWebpackPlugin.options.nodeModules) { %>
|
||||||
|
<!-- Add `node_modules/` to global paths so `require` works properly in development -->
|
||||||
|
<script>
|
||||||
|
require('module').globalPaths.push('<%= htmlWebpackPlugin.options.nodeModules.replace(/\\/g, '\\\\') %>')
|
||||||
|
</script>
|
||||||
|
<% } %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
<!-- Set `__static` path to static files in production -->
|
||||||
|
<% if (!process.browser) { %>
|
||||||
|
<script>
|
||||||
|
if (process.env.NODE_ENV !== 'development') window.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
|
||||||
|
</script>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
<!-- webpack builds are automatically injected -->
|
<!-- webpack builds are automatically injected -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -5,88 +5,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'enlight'
|
name: 'enlight'
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
/*@import url("./fonts/Quicksand-Regular.ttf");*/
|
/* CSS */
|
||||||
body,
|
|
||||||
html {
|
|
||||||
margin: 0px;
|
|
||||||
background-color: rgb(51, 51, 51);
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
font-family: "Quicksand", sans-serif;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
small {
|
|
||||||
font-size: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-bar {
|
|
||||||
margin: 0px;
|
|
||||||
padding: 0px;
|
|
||||||
width: 100%;
|
|
||||||
height: 34px;
|
|
||||||
background-color: rgba(36, 36, 36, 0.9);
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-clock {
|
|
||||||
padding: 2px;
|
|
||||||
padding-right: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.battery {
|
|
||||||
right: 80px;
|
|
||||||
position: fixed;
|
|
||||||
padding: 2px;
|
|
||||||
padding-right: 4px;
|
|
||||||
}
|
|
||||||
.loader1 {
|
|
||||||
position: fixed;
|
|
||||||
right: 80px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.areaRight {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown-content {
|
|
||||||
display: none;
|
|
||||||
position: absolute;
|
|
||||||
background-color: #f1f1f1;
|
|
||||||
min-width: 160px;
|
|
||||||
overflow: auto;
|
|
||||||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
|
||||||
z-index: 1;
|
|
||||||
right: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown-content a {
|
|
||||||
color: black;
|
|
||||||
padding: 12px 16px;
|
|
||||||
text-decoration: none;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown a:hover {
|
|
||||||
background-color: #ddd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.show {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
network {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.headerIframe {
|
|
||||||
width: 100%;
|
|
||||||
border: 0px;
|
|
||||||
height: 2.5%;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import axios from 'axios'
|
|
||||||
|
|
||||||
import App from './App'
|
import App from './App'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
import store from './store'
|
import store from './store'
|
||||||
|
|
||||||
if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
|
if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
|
||||||
Vue.http = Vue.prototype.$http = axios
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
/* eslint-disable no-new */
|
/* eslint-disable no-new */
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"env": {
|
|
||||||
"mocha": true
|
|
||||||
},
|
|
||||||
"globals": {
|
|
||||||
"assert": true,
|
|
||||||
"expect": true,
|
|
||||||
"should": true,
|
|
||||||
"__static": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import Vue from 'vue'
|
|
||||||
Vue.config.devtools = false
|
|
||||||
Vue.config.productionTip = false
|
|
||||||
|
|
||||||
// require all test files (files that ends with .spec.js)
|
|
||||||
const testsContext = require.context('./specs', true, /\.spec$/)
|
|
||||||
testsContext.keys().forEach(testsContext)
|
|
||||||
|
|
||||||
// require all src files except main.js for coverage.
|
|
||||||
// you can also change this to match only the subset of files that
|
|
||||||
// you want coverage for.
|
|
||||||
const srcContext = require.context('../../src/renderer', true, /^\.\/(?!main(\.js)?$)/)
|
|
||||||
srcContext.keys().forEach(srcContext)
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
'use strict'
|
|
||||||
|
|
||||||
const path = require('path')
|
|
||||||
const merge = require('webpack-merge')
|
|
||||||
const webpack = require('webpack')
|
|
||||||
|
|
||||||
const baseConfig = require('../../.electron-vue/webpack.renderer.config')
|
|
||||||
const projectRoot = path.resolve(__dirname, '../../src/renderer')
|
|
||||||
|
|
||||||
// Set BABEL_ENV to use proper preset config
|
|
||||||
process.env.BABEL_ENV = 'test'
|
|
||||||
|
|
||||||
let webpackConfig = merge(baseConfig, {
|
|
||||||
devtool: '#inline-source-map',
|
|
||||||
plugins: [
|
|
||||||
new webpack.DefinePlugin({
|
|
||||||
'process.env.NODE_ENV': '"testing"'
|
|
||||||
})
|
|
||||||
]
|
|
||||||
})
|
|
||||||
|
|
||||||
// don't treat dependencies as externals
|
|
||||||
delete webpackConfig.entry
|
|
||||||
delete webpackConfig.externals
|
|
||||||
delete webpackConfig.output.libraryTarget
|
|
||||||
|
|
||||||
// apply vue option to apply isparta-loader on js
|
|
||||||
webpackConfig.module.rules
|
|
||||||
.find(rule => rule.use.loader === 'vue-loader').use.options.loaders.js = 'babel-loader'
|
|
||||||
|
|
||||||
module.exports = config => {
|
|
||||||
config.set({
|
|
||||||
browsers: ['visibleElectron'],
|
|
||||||
client: {
|
|
||||||
useIframe: false
|
|
||||||
},
|
|
||||||
coverageReporter: {
|
|
||||||
dir: './coverage',
|
|
||||||
reporters: [
|
|
||||||
{ type: 'lcov', subdir: '.' },
|
|
||||||
{ type: 'text-summary' }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
customLaunchers: {
|
|
||||||
'visibleElectron': {
|
|
||||||
base: 'Electron',
|
|
||||||
flags: ['--show']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
frameworks: ['mocha', 'chai'],
|
|
||||||
files: ['./index.js'],
|
|
||||||
preprocessors: {
|
|
||||||
'./index.js': ['webpack', 'sourcemap']
|
|
||||||
},
|
|
||||||
reporters: ['spec', 'coverage'],
|
|
||||||
singleRun: true,
|
|
||||||
webpack: webpackConfig,
|
|
||||||
webpackMiddleware: {
|
|
||||||
noInfo: true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import Vue from 'vue'
|
|
||||||
import LandingPage from '@/components/LandingPage'
|
|
||||||
|
|
||||||
describe('LandingPage.vue', () => {
|
|
||||||
it('should render correct contents', () => {
|
|
||||||
const vm = new Vue({
|
|
||||||
el: document.createElement('div'),
|
|
||||||
render: h => h(LandingPage)
|
|
||||||
}).$mount()
|
|
||||||
|
|
||||||
expect(vm.$el.querySelector('.title').textContent).to.contain('Welcome to your new project!')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
2010
enlight/yarn.lock
2010
enlight/yarn.lock
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user