Skip to content

Commit c4e566e

Browse files
committed
feat(electron): basic electron setup
1 parent 41936ac commit c4e566e

File tree

13 files changed

+300
-84
lines changed

13 files changed

+300
-84
lines changed

angular.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,14 @@
110110
"defaultProject": "ink-bucket",
111111
"cli": {
112112
"packageManager": "npm"
113+
},
114+
"schematics": {
115+
"@schematics/angular:component": {
116+
"prefix": "inkapp",
117+
"styleext": "scss"
118+
},
119+
"@schematics/angular:directive": {
120+
"prefix": "inkapp"
121+
}
113122
}
114123
}

main.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
const { app, BrowserWindow } = require('electron');
2+
3+
let win;
4+
5+
function createWindow() {
6+
// Create the browser window.
7+
win = new BrowserWindow({
8+
width: 600,
9+
height: 600,
10+
backgroundColor: '#ffffff',
11+
icon: `file://${__dirname}/dist/ink-bucket/assets/logo.png`
12+
});
13+
14+
setTimeout(() => {
15+
win.loadURL(`file://${__dirname}/dist/ink-bucket/index.html`);
16+
}, 2000);
17+
18+
//// uncomment below to open the DevTools.
19+
// win.webContents.openDevTools()
20+
21+
// Event when the window is closed.
22+
win.on('closed', function() {
23+
win = null;
24+
});
25+
}
26+
27+
// Create window on electron intialization
28+
app.on('ready', createWindow);
29+
30+
// Quit when all windows are closed.
31+
app.on('window-all-closed', function() {
32+
// On macOS specific close process
33+
if (process.platform !== 'darwin') {
34+
app.quit();
35+
}
36+
});
37+
38+
app.on('activate', function() {
39+
// macOS specific close process
40+
if (win === null) {
41+
createWindow();
42+
}
43+
});

package-lock.json

Lines changed: 231 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)