mirror of
https://github.com/Fabio286/antares.git
synced 2025-04-17 19:47:28 +02:00
Structuring project
This commit is contained in:
parent
e969383afe
commit
4b6ed99785
3
.eslintignore
Normal file
3
.eslintignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/node_modules
|
||||||
|
/assets/vendor
|
||||||
|
/out
|
63
.eslintrc
Normal file
63
.eslintrc
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es6": true,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"standard",
|
||||||
|
"plugin:vue/recommended"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 2017,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"indent": [
|
||||||
|
"error",
|
||||||
|
3,
|
||||||
|
{ "SwitchCase": 1 }
|
||||||
|
],
|
||||||
|
"linebreak-style": [
|
||||||
|
"error",
|
||||||
|
"windows"
|
||||||
|
],
|
||||||
|
"brace-style": [
|
||||||
|
"error",
|
||||||
|
"stroustrup"
|
||||||
|
],
|
||||||
|
"quotes": [
|
||||||
|
"error",
|
||||||
|
"single"
|
||||||
|
],
|
||||||
|
"semi": [
|
||||||
|
"error",
|
||||||
|
"always"
|
||||||
|
],
|
||||||
|
"curly": [
|
||||||
|
"error",
|
||||||
|
"multi-or-nest"
|
||||||
|
],
|
||||||
|
"no-console": "off",
|
||||||
|
"no-undef": "off",
|
||||||
|
"plugins": [
|
||||||
|
"vue"
|
||||||
|
],
|
||||||
|
"vue/no-side-effects-in-computed-properties": "off",
|
||||||
|
"vue/require-default-prop": "off",
|
||||||
|
"vue/no-v-html": "off",
|
||||||
|
"vue/html-indent": ["error", 3, {
|
||||||
|
"attribute": 1,
|
||||||
|
"baseIndent": 1,
|
||||||
|
"closeBracket": 0,
|
||||||
|
"ignores": []
|
||||||
|
}],
|
||||||
|
"vue/max-attributes-per-line": ["error", {
|
||||||
|
"singleline": 2,
|
||||||
|
"multiline": {
|
||||||
|
"max": 1,
|
||||||
|
"allowFirstLine": false
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
.DS_Store
|
||||||
|
dist/
|
||||||
|
node_modules/
|
||||||
|
thumbs.db
|
||||||
|
.idea/
|
||||||
|
.vscode
|
13209
package-lock.json
generated
Normal file
13209
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
39
package.json
Normal file
39
package.json
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"name": "antares",
|
||||||
|
"productName": "Antares",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"description": "A multi-platform easy to use SQL client. ",
|
||||||
|
"license": "MIT",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "electron-webpack dev",
|
||||||
|
"compile": "electron-webpack",
|
||||||
|
"dist": "yarn compile && electron-builder",
|
||||||
|
"dist:dir": "yarn dist --dir -c.compression=store -c.mac.identity=null"
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"appId": "com.app.antares",
|
||||||
|
"artifactName": "${productName}.${ext}"
|
||||||
|
},
|
||||||
|
"electronWebpack": {},
|
||||||
|
"dependencies": {
|
||||||
|
"source-map-support": "^0.5.16"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"electron": "^8.2.4",
|
||||||
|
"electron-builder": "^22.4.1",
|
||||||
|
"electron-devtools-installer": "^3.0.0",
|
||||||
|
"electron-webpack": "^2.8.2",
|
||||||
|
"electron-webpack-vue": "^2.4.0",
|
||||||
|
"eslint": "^6.8.0",
|
||||||
|
"eslint-config-standard": "^14.1.1",
|
||||||
|
"eslint-plugin-import": "^2.20.1",
|
||||||
|
"eslint-plugin-node": "^11.1.0",
|
||||||
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
|
"eslint-plugin-standard": "^4.0.1",
|
||||||
|
"eslint-plugin-vue": "^6.2.2",
|
||||||
|
"node-sass": "^4.14.0",
|
||||||
|
"sass-loader": "^8.0.2",
|
||||||
|
"vue": "^2.6.11",
|
||||||
|
"webpack": "^4.43.0"
|
||||||
|
}
|
||||||
|
}
|
76
src/main/index.js
Normal file
76
src/main/index.js
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
import { app, BrowserWindow } from 'electron';
|
||||||
|
import * as path from 'path';
|
||||||
|
import { format as formatUrl } from 'url';
|
||||||
|
import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer';
|
||||||
|
|
||||||
|
const isDevelopment = process.env.NODE_ENV !== 'production';
|
||||||
|
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true';
|
||||||
|
|
||||||
|
// global reference to mainWindow (necessary to prevent window from being garbage collected)
|
||||||
|
let mainWindow;
|
||||||
|
|
||||||
|
function createMainWindow () {
|
||||||
|
const window = new BrowserWindow({
|
||||||
|
width: 1024,
|
||||||
|
height: 800,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true,
|
||||||
|
'web-security': false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (isDevelopment)
|
||||||
|
window.loadURL(`http://localhost:${process.env.ELECTRON_WEBPACK_WDS_PORT}`);
|
||||||
|
else {
|
||||||
|
window.loadURL(formatUrl({
|
||||||
|
pathname: path.join(__dirname, 'index.html'),
|
||||||
|
protocol: 'file',
|
||||||
|
slashes: true
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isDevelopment) {
|
||||||
|
window.webContents.openDevTools();
|
||||||
|
|
||||||
|
installExtension(VUEJS_DEVTOOLS)
|
||||||
|
.then(name => {
|
||||||
|
console.log(name, 'installed');
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
window.on('closed', () => {
|
||||||
|
mainWindow = null;
|
||||||
|
});
|
||||||
|
|
||||||
|
window.webContents.on('devtools-opened', () => {
|
||||||
|
window.focus();
|
||||||
|
setImmediate(() => {
|
||||||
|
window.focus();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return window;
|
||||||
|
};
|
||||||
|
|
||||||
|
// quit application when all windows are closed
|
||||||
|
app.on('window-all-closed', () => {
|
||||||
|
// on macOS it is common for applications to stay open until the user explicitly quits
|
||||||
|
if (process.platform !== 'darwin')
|
||||||
|
app.quit();
|
||||||
|
});
|
||||||
|
|
||||||
|
app.on('activate', () => {
|
||||||
|
// on macOS it is common to re-create a window even after all windows have been closed
|
||||||
|
if (mainWindow === null)
|
||||||
|
mainWindow = createMainWindow();
|
||||||
|
});
|
||||||
|
|
||||||
|
// create main BrowserWindow when electron is ready
|
||||||
|
app.on('ready', () => {
|
||||||
|
mainWindow = createMainWindow();
|
||||||
|
});
|
32
src/renderer/App.vue
Normal file
32
src/renderer/App.vue
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<template>
|
||||||
|
<div id="app">
|
||||||
|
<img alt="Vue logo" src="logo.png">
|
||||||
|
<HelloWorld msg="Welcome to Your Vue.js App" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import HelloWorld from './components/HelloWorld.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'App',
|
||||||
|
components: {
|
||||||
|
HelloWorld
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
body{
|
||||||
|
background: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
#app {
|
||||||
|
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
text-align: center;
|
||||||
|
color: #2c3e50;
|
||||||
|
margin-top: 60px;
|
||||||
|
}
|
||||||
|
</style>
|
58
src/renderer/components/HelloWorld.vue
Normal file
58
src/renderer/components/HelloWorld.vue
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<template>
|
||||||
|
<div class="hello">
|
||||||
|
<h1>{{ msg }}</h1>
|
||||||
|
<p>
|
||||||
|
For a guide and recipes on how to configure / customize this project,<br>
|
||||||
|
check out the
|
||||||
|
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
|
||||||
|
</p>
|
||||||
|
<h3>Installed CLI Plugins</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
|
||||||
|
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>Essential Links</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
|
||||||
|
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
|
||||||
|
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
|
||||||
|
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
|
||||||
|
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>Ecosystem</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
|
||||||
|
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
|
||||||
|
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
|
||||||
|
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
|
||||||
|
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'HelloWorld',
|
||||||
|
props: {
|
||||||
|
msg: String
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||||
|
<style scoped>
|
||||||
|
h3 {
|
||||||
|
margin: 40px 0 0;
|
||||||
|
}
|
||||||
|
ul {
|
||||||
|
list-style-type: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
li {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: #42b983;
|
||||||
|
}
|
||||||
|
</style>
|
8
src/renderer/index.js
Normal file
8
src/renderer/index.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import Vue from 'vue';
|
||||||
|
import App from './App.vue';
|
||||||
|
|
||||||
|
Vue.config.productionTip = false;
|
||||||
|
|
||||||
|
new Vue({
|
||||||
|
render: h => h(App)
|
||||||
|
}).$mount('#app');
|
8
src/renderer/main.js
Normal file
8
src/renderer/main.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import Vue from 'vue';
|
||||||
|
import App from './App.vue';
|
||||||
|
|
||||||
|
Vue.config.productionTip = false;
|
||||||
|
|
||||||
|
new Vue({
|
||||||
|
render: h => h(App)
|
||||||
|
}).$mount('#app');
|
BIN
static/logo.png
Normal file
BIN
static/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
Loading…
x
Reference in New Issue
Block a user