Skip to content

Commit dc46d03

Browse files
authored
refactor: move electron files into dedicated folder (#1284)
* chore: move files * chore: update paths * fix: use `path.resolve` for loading images
1 parent 8b42763 commit dc46d03

File tree

5 files changed

+17
-31
lines changed

5 files changed

+17
-31
lines changed

package.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "gitify",
33
"version": "5.9.0",
44
"description": "GitHub Notifications on your menu bar.",
5-
"main": "main.js",
5+
"main": "src/electron/main.js",
66
"scripts": {
77
"build": "webpack --config webpack.prod.js",
88
"clean": "rimraf build coverage node_modules",
@@ -64,14 +64,7 @@
6464
"build": {
6565
"appId": "com.electron.gitify",
6666
"productName": "Gitify",
67-
"files": [
68-
"build/**/*",
69-
"assets/**/*",
70-
"index.html",
71-
"LICENSE",
72-
"main.js",
73-
"first-run.js"
74-
],
67+
"files": ["build/**/*", "assets/**/*", "src/electron/*", "LICENSE"],
7568
"mac": {
7669
"category": "public.app-category.developer-tools",
7770
"icon": "assets/images/app-icon.icns",
File renamed without changes.

index.html renamed to src/electron/index.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
></div>
1616
</body>
1717

18-
<script src="./build/js/app.js"></script>
18+
<script src="./../../build/js/app.js"></script>
1919

2020
<style>
2121
html,
@@ -27,34 +27,34 @@
2727

2828
html::-webkit-scrollbar,
2929
div.flex-grow::-webkit-scrollbar {
30-
width: 10px;
30+
width: 10px;
3131
}
3232

3333
html::-webkit-scrollbar-thumb,
3434
div.flex-grow::-webkit-scrollbar-thumb {
35-
background-color: #c1c1c1;
36-
border-radius: 10px;
35+
background-color: #c1c1c1;
36+
border-radius: 10px;
3737
}
3838

3939
html::-webkit-scrollbar-thumb:hover,
4040
div.flex-grow::-webkit-scrollbar-thumb:hover {
41-
background-color: #a8a8a8;
42-
border-radius: 10px;
41+
background-color: #a8a8a8;
42+
border-radius: 10px;
4343
}
4444

4545
html.dark::-webkit-scrollbar-track,
4646
html.dark div.flex-grow::-webkit-scrollbar-track {
47-
background-color: #090E15;
47+
background-color: #090e15;
4848
}
4949

5050
html.dark::-webkit-scrollbar-thumb,
5151
html.dark div.flex-grow::-webkit-scrollbar-thumb {
52-
background-color: #24292e;
52+
background-color: #24292e;
5353
}
5454

5555
html.dark::-webkit-scrollbar-thumb:hover,
5656
html.dark div.flex-grow::-webkit-scrollbar-thumb:hover {
57-
background-color: #3a3f44;
57+
background-color: #3a3f44;
5858
}
5959

6060
body {

main.js renamed to src/electron/main.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ const path = require('node:path');
1313
// TODO: Remove @electron/remote use - see #650
1414
require('@electron/remote/main').initialize();
1515

16-
const idleIcon = path.join(
17-
__dirname,
18-
'assets',
19-
'images',
20-
'tray-idleTemplate.png',
16+
const idleIcon = path.resolve(
17+
`${__dirname}/../../assets/images/tray-idleTemplate.png`,
18+
);
19+
const activeIcon = path.resolve(
20+
`${__dirname}/../../assets/images/tray-active.png`,
2121
);
22-
const activeIcon = path.join(__dirname, 'assets', 'images', 'tray-active.png');
2322

2423
const browserWindowOpts = {
2524
width: 500,

tsconfig.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,5 @@
1515
"skipLibCheck": true,
1616
"checkJs": true
1717
},
18-
"include": [
19-
"src/**/*.js",
20-
"src/**/*.ts",
21-
"src/**/*.tsx",
22-
"first-run.js",
23-
"main.js"
24-
]
18+
"include": ["src/**/*.js", "src/**/*.ts", "src/**/*.tsx"]
2519
}

0 commit comments

Comments
 (0)