Skip to content

Commit 861bd6e

Browse files
author
Abel Chalier
committed
initial commit
0 parents  commit 861bd6e

File tree

9 files changed

+3152
-0
lines changed

9 files changed

+3152
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist
7.1 MB
Loading
316 KB
Loading

assets/images/electron-logo.png

115 KB
Loading

build/icon.icns

162 KB
Binary file not shown.

build/icon.ico

353 KB
Binary file not shown.

index.electron.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// Modules to control application life and create native browser window
2+
const { app, BrowserWindow } = require('electron');
3+
4+
const { NODE_ENV } = process.env;
5+
6+
// Keep a global reference of the window object, if you don't, the window will
7+
// be closed automatically when the JavaScript object is garbage collected.
8+
let mainWindow;
9+
10+
function createWindow() {
11+
// Create the browser window.
12+
mainWindow = new BrowserWindow({
13+
webPreferences: {
14+
webSecurity: false,
15+
allowDisplayingInsecureContent: true,
16+
},
17+
title: 'Wavy X',
18+
transparent: true,
19+
width: 1024,
20+
height: 768,
21+
center: true,
22+
enableLargerThanScreen: false,
23+
resizable: true,
24+
frame: true,
25+
titleBarStyle: 'hidden',
26+
});
27+
28+
console.log({ NODE_ENV });
29+
// and load the index.html of the app.
30+
if (NODE_ENV === 'development') {
31+
mainWindow.loadURL('http://localhost:9000/');
32+
} else {
33+
mainWindow.loadURL('https://app.wavy.fr');
34+
}
35+
36+
// Open the DevTools.
37+
// mainWindow.webContents.openDevTools()
38+
39+
// Emitted when the window is closed.
40+
mainWindow.on('closed', () => {
41+
// Dereference the window object, usually you would store windows
42+
// in an array if your app supports multi windows, this is the time
43+
// when you should delete the corresponding element.
44+
mainWindow = null;
45+
});
46+
}
47+
48+
// This method will be called when Electron has finished
49+
// initialization and is ready to create browser windows.
50+
// Some APIs can only be used after this event occurs.
51+
app.on('ready', createWindow);
52+
53+
// Quit when all windows are closed.
54+
app.on('window-all-closed', () => {
55+
// On OS X it is common for applications and their menu bar
56+
// to stay active until the user quits explicitly with Cmd + Q
57+
if (process.platform !== 'darwin') {
58+
app.quit();
59+
}
60+
});
61+
62+
app.on('activate', () => {
63+
// On OS X it's common to re-create a window in the app when the
64+
// dock icon is clicked and there are no other windows open.
65+
if (mainWindow === null) {
66+
createWindow();
67+
}
68+
});
69+
70+
// In this file you can include the rest of your app's specific main process
71+
// code. You can also put them in separate files and require them here.

package.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "wavy-x-desktop",
3+
"description": "🌊 Amazing Wavy App targeting iOS, Android, Web and Desktop wavy.fr",
4+
"version": "2.2.2",
5+
"author": "www.wavy.fr",
6+
"dependencies": {
7+
},
8+
"devDependencies": {
9+
"electron": "^3.0.3",
10+
"electron-builder": "^19.56.2",
11+
"electron-icon-maker": "^0.0.4",
12+
"electron-packager": "^12.2.0",
13+
"electron-publish": "^20.28.3",
14+
"electron-publisher-s3": "^20.17.2"
15+
},
16+
"main": "index.electron.js",
17+
"private": true,
18+
"scripts": {
19+
"electron-icon": "yarn electron-icon-maker --input ./assets/images/electron-logo.png --output build",
20+
"copy-icons": "cp build/icons/mac/icon.icns build/; cp build/icons/win/icon.ico build/;rm -fr build/icons",
21+
"build": "electron-builder",
22+
"clean": "rm -fr build/*",
23+
"prebuild": "yarn clean && yarn electron-icon && yarn copy-icons",
24+
"watch:electron": "NODE_ENV=development electron .",
25+
"watch:native": "react-native start",
26+
"watch:native:clean": "react-native start --resetCache"
27+
},
28+
"build": {
29+
"productName": "Wavy X",
30+
"appId": "fr.wavy.x",
31+
"publish": {
32+
"provider": "s3",
33+
"bucket": "wavy-desktop-release"
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)