[package.json] added 'electron-packager' to build sources + 'electron-installer-debian' for .deb files + added electron.js to load index.html + added electron.json to describe our app

This commit is contained in:
xdrm-brackets 2018-04-10 16:04:52 +02:00
parent bdbfa902fb
commit 9695d30e5f
5 changed files with 79 additions and 39 deletions

3
.gitignore vendored
View File

@ -6,3 +6,6 @@
!/public_htm/.htaccess
/package-lock.json
.cache
/releases
/packages
/electron-build

43
electron.js Normal file
View File

@ -0,0 +1,43 @@
const electron = require('electron');
const app = electron.app; // Module to control application life.
const BrowserWindow = electron.BrowserWindow; // Module to create native browser window.
const path = require('path');
const url = require('url');
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
var mainWindow = null;
// Quit when all windows are closed.
app.on('window-all-closed', function() {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform != 'darwin') {
app.quit();
}
});
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
app.on('ready', function() {
// Create the browser window.
mainWindow = new BrowserWindow({width: 800, height: 600});
// and load the index.html of the app.
// mainWindow.loadURL('file://' + __dirname + '/index.html');
mainWindow.loadURL( url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',
slashes: true
}) );
// mainWindow.loadURL('http://douscord/');
// Emitted when the window is closed.
mainWindow.on('closed', function(){
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;
});
});

19
electron.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "douscord",
"description": "Douscord non-copyright respectful copy",
"version": "1.0.0",
"author": "xdrm-brackets <xdrm.brackets.dev@gmail.com> SeekDaSky <mascaro.lucas@yahoo.fr G. Fauvet <gfauvet@gmail.com>",
"license": "MIT",
"private": true,
"dependencies": {
"vue": "^2.5.9",
"vue-router": "^2.5.3"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"devDependencies": {
}
}

View File

@ -1,5 +1,5 @@
{
"name": "ptut-vhost",
"name": "douscord",
"description": "PTUT",
"version": "1.0.0",
"author": "xdrm-brackets <xdrm.brackets.dev@gmail.com> SeekDaSky <mascaro.lucas@yahoo.fr G. Fauvet <gfauvet@gmail.com>",
@ -7,12 +7,20 @@
"private": true,
"scripts": {
"clean": "rm ./public_html/*.html; rm ./public_html/*.js; rm ./public_html/*.css; rm ./public_html/*svg; rm ./public_html/*.map; exit 0",
"clean:all": "npm run clean; npm run clean:electron; npm run clean:release; npm run clean:package; exit 0",
"clean:electron": "rm -r ./electron-build; exit 0",
"clean:release": "rm -r ./releases; exit 0",
"clean:package": "rm -r ./package; exit 0",
"dev": "parcel watch ./parcel/index.html --out-dir ./public_html --no-hmr",
"build:alternative": "cross-env NODE_ENV=production parcel watch ./parcel/index.html --out-dir ./public_html --no-hmr",
"build": "parcel build ./parcel/index.html --public-url ./ --out-dir ./public_html --no-source-maps --no-minify",
"build:electron": "parcel build ./parcel/index.html --public-url ./ --out-dir ./electron-build --no-source-maps --no-minify --target=electron",
"electron": "electron ./electron-build/index.html"
"build:electron": "parcel build ./parcel/index.html --public-url ./ --out-dir ./electron-build --no-source-maps --no-minify --target=electron; npm run build:electron:setup",
"build:electron:setup": "npm run build:electron:setup-config; npm run build:electron:setup-index;",
"build:electron:setup-config": "cp ./electron.json ./electron-build/package.json; npm --prefix ./electron-build install",
"build:electron:setup-index": "cp ./electron.js ./electron-build/index.js",
"electron": "electron ./electron-build",
"package": "npm run build:electron; electron-packager ./electron-build douscord --asar --platform linux --arch x64 --out ./releases --overwrite;",
"package:deb": "electron-installer-debian --src ./releases/douscord-linux-x64 --dest ./packages --arch x64"
},
"dependencies": {
"vue": "^2.5.9",
@ -32,6 +40,8 @@
"babel-preset-stage-3": "^6.24.1",
"cross-env": "^5.0.5",
"electron": "^1.8.4",
"electron-installer-debian": "^0.8.1",
"electron-packager": "^12.0.0",
"node-sass": "^4.8.3",
"parcel-bundler": "^1.7.0",
"vue-template-compiler": "^2.5.16"

View File

@ -1,35 +0,0 @@
<html>
<!-- HEADER -->
<head>
<title>Douscord</title>
<!-- META -->
<meta charset="utf-8">
<meta name="author" content="xdrm-brackets (Adrien Marquès)">
<meta name="description" content="[Home] Home page">
<!-- STYLESHEET -->
<link type="text/css" rel="stylesheet" href="/layout.31d667d7.css">
<link type="text/css" rel="stylesheet" href="/global.7895a364.css">
<link type="text/css" rel="stylesheet" href="/menu.a63622af.css">
<link type="text/css" rel="stylesheet" href="/dialog.822894d6.css">
<link type="text/css" rel="stylesheet" href="/side-menu.1af96421.css">
<link type="text/css" rel="stylesheet" href="/container.ae3a9ab5.css">
<link type="text/css" rel="stylesheet" href="/pop-up.bc403d11.css">
<!-- FONT -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
<!-- BODY -->
</head>
<body>
<div id="vue"></div>
<script type="text/javascript" src="/main.e14b04ba.js"></script>
</body>
</html>