Skip to content

Commit

Permalink
initial electron build
Browse files Browse the repository at this point in the history
  • Loading branch information
YeonV committed Sep 22, 2021
1 parent 30a2cb1 commit 4fe5cf4
Show file tree
Hide file tree
Showing 22 changed files with 2,522 additions and 90 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# production
/build
/dist

# misc
.DS_Store
Expand Down
52 changes: 52 additions & 0 deletions electron-builder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"publish": {
"provider": "generic",
"url": "https://myappserver.com/updates/"
},
"productName": "LedFx-Client",
"appId": "com.ledfx.app",
"directories": {
"buildResources": "buildResources",
"output": "release"
},
"files": [
"src/",
"node_modules/",
"package.json"
],
"mac": {
"target": [
"dmg",
"zip"
],
"artifactName": "${productName}-${version}-${os}.${ext}"
},
"win": {
"target": [
"nsis",
"zip"
],
"artifactName": "${productName}-${version}-${os}.${ext}"
},
"linux": {
"target": [
"AppImage"
],
"artifactName": "${productName}-${version}-${os}.${ext}"
},
"dmg": {
"title": "${productName}-${version}",
"contents": [
{
"x": 300,
"y": 360
},
{
"x": 490,
"y": 360,
"type": "link",
"path": "/Applications"
}
]
}
}
64 changes: 61 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "ledfx",
"version": "2.0.0-beta27",
"version": "0.1.0",
"description": "LedFx - BladeMOD",
"author": "YeonV aka Blade",
"private": true,
"main": "public/electron.js",
"homepage": "./",
"dependencies": {
"@babel/runtime": "^7.14.0",
"@electron/remote": "^2.0.1",
"@material-ui/core": "^4.11.4",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.58",
Expand All @@ -16,6 +19,9 @@
"@types/reactour": "^1.18.1",
"axios": "^0.21.1",
"clsx": "^1.1.1",
"custom-electron-titlebar": "^3.2.7",
"electron-is-dev": "^2.0.0",
"electron-squirrel-startup": "^1.0.0",
"moment": "^2.29.1",
"prop-types": "^15.7.2",
"react": "^17.0.2",
Expand All @@ -42,7 +48,13 @@
"eject": "react-scripts eject",
"predeploy": "yarn buildgh",
"deploy": "gh-pages -d build",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"pack": "electron-builder --dir",
"dist": "react-scripts build && electron-builder",
"dist-multi": "react-scripts build && electron-builder -mwl",
"dev": "concurrently \"cross-env BROWSER=none yarn start\" \"wait-on http://localhost:3000 && electron .\"",
"electron": "wait-on tcp:3000 && electron .",
"postinstall": "electron-builder install-app-deps"
},
"eslintConfig": {
"extends": [
Expand All @@ -63,10 +75,19 @@
]
},
"devDependencies": {
"@electron-forge/maker-deb": "^6.0.0-beta.61",
"@electron-forge/maker-rpm": "^6.0.0-beta.61",
"@electron-forge/maker-squirrel": "^6.0.0-beta.61",
"@electron-forge/maker-zip": "^6.0.0-beta.61",
"@types/react-router-dom": "^5.1.7",
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"babel-eslint": "^10.1.0",
"concurrently": "^6.2.1",
"cross-env": "^7.0.3",
"electron": "^14.0.1",
"electron-builder": "^22.11.7",
"electron-devtools-installer": "^3.2.0",
"eslint": "^7.27.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-airbnb-typescript": "^12.3.1",
Expand All @@ -83,6 +104,43 @@
"eslint-plugin-react-hooks": "^4.0.8",
"gh-pages": "^3.2.0",
"prettier": "^2.3.0",
"react-is": "^17.0.2"
"react-is": "^17.0.2",
"wait-on": "^6.0.0"
},
"config": {
"forge": {
"packagerConfig": {
"icon": "src/icons/mac/icon.icns",
"name": "LedFx Client by Blade",
"title": "LedFx Client by Blade"
},
"makers": [
{
"name": "@electron-forge/maker-squirrel",
"config": {
"name": "ledfx"
}
},
{
"name": "@electron-forge/maker-zip",
"platforms": [
"darwin"
]
},
{
"name": "@electron-forge/maker-deb",
"config": {}
},
{
"name": "@electron-forge/maker-rpm",
"config": {}
}
]
}
},
"build": {
"win": {
"icon": "build/icon.ico"
}
}
}
112 changes: 112 additions & 0 deletions public/electron.js

Large diffs are not rendered by default.

Binary file added public/icon.ico
Binary file not shown.
Binary file added public/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 40 additions & 37 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<meta
name="description"
content="LedFx Client - by Blade"
/>
<link rel="apple-touch-icon" sizes="57x57" href="%PUBLIC_URL%/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="%PUBLIC_URL%/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="%PUBLIC_URL%/favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="%PUBLIC_URL%/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="%PUBLIC_URL%/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="%PUBLIC_URL%/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="%PUBLIC_URL%/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="%PUBLIC_URL%/favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="%PUBLIC_URL%/favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="%PUBLIC_URL%/favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/favicon/favicon-16x16.png">
<meta name="msapplication-TileColor" content="#0dbedc">
<meta name="msapplication-TileImage" content="%PUBLIC_URL%/favicon/ms-icon-144x144.png">
<meta name="theme-color" content="#0dbedc">
<meta name="background-color" content="#020202">
<!--

<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="description" content="LedFx Client - by Blade" />
<link rel="apple-touch-icon" sizes="57x57" href="%PUBLIC_URL%/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="%PUBLIC_URL%/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="%PUBLIC_URL%/favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="%PUBLIC_URL%/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="%PUBLIC_URL%/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="%PUBLIC_URL%/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="%PUBLIC_URL%/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="%PUBLIC_URL%/favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="%PUBLIC_URL%/favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="%PUBLIC_URL%/favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/favicon/favicon-16x16.png">
<meta name="msapplication-TileColor" content="#0dbedc">
<meta name="msapplication-TileImage" content="%PUBLIC_URL%/favicon/ms-icon-144x144.png">
<meta name="theme-color" content="#0dbedc">
<meta name="background-color" content="#020202">
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Expand All @@ -40,12 +38,13 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>LedFx</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
<title>LedFx</title>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand All @@ -55,5 +54,9 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

<!-- <script src="./renderer.js"></script> -->

</body>

</html>
7 changes: 7 additions & 0 deletions public/preload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// const customTitlebar = require('custom-electron-titlebar');

// window.addEventListener('DOMContentLoaded', () => {
// new customTitlebar.Titlebar({
// backgroundColor: customTitlebar.Color.fromHex('#ECECEC')
// });
// })
13 changes: 13 additions & 0 deletions public/renderer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// This file is required by the index.html file and will
// be executed in the renderer process for that window.
// No Node.js APIs are available in this process because
// `nodeIntegration` is turned off. Use `preload.js` to
// selectively enable features needed in the rendering
// process.
// import { Titlebar } from 'custom-electron-titlebar'

// window.addEventListener('DOMContentLoaded', () => {
// new Titlebar({
// backgroundColor: '#800000'
// })
// })
Binary file added src/app-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/mac/icon.icns
Binary file not shown.
Binary file added src/icons/png/1024x1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/png/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/png/16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/png/24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/png/256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/png/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/png/48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/png/512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/png/64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/win/icon.ico
Binary file not shown.
Loading

0 comments on commit 4fe5cf4

Please sign in to comment.