-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2db983e
Showing
23 changed files
with
747 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
|
||
# Created by https://www.gitignore.io/api/node,visualstudiocode | ||
# Edit at https://www.gitignore.io/?templates=node,visualstudiocode | ||
|
||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# rollup.js default build output | ||
dist/ | ||
|
||
# Uncomment the public line if your project uses Gatsby | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# https://create-react-app.dev/docs/using-the-public-folder/#docsNav | ||
# public | ||
|
||
# Storybook build outputs | ||
.out | ||
.storybook-out | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# Temporary folders | ||
tmp/ | ||
temp/ | ||
|
||
### VisualStudioCode ### | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
|
||
### VisualStudioCode Patch ### | ||
# Ignore all local history of files | ||
.history | ||
|
||
# End of https://www.gitignore.io/api/node,visualstudiocode | ||
.DS_Store | ||
release-builds | ||
|
||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
yarn.lock | ||
|
||
### for a while | ||
assets/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"useTabs": false, | ||
"tabWidth": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const electron = require("electron"); | ||
const isDev = require("electron-is-dev"); | ||
if (isDev) require("electron-reload")(__dirname); | ||
const path = require("path"); | ||
const MainWindow = require("./windows/MainWindow"); | ||
const { app } = electron; | ||
|
||
let mainWindow; | ||
|
||
function createMainWindow() { | ||
const width = 800; | ||
const height = 800; | ||
mainWindow = new MainWindow({ | ||
width: width, | ||
height: height, | ||
minWidth: width, | ||
minHeight: height - 300, | ||
maxWidth: width, | ||
webPreferences: { preload: path.join(__dirname, "preload.js") }, | ||
icon: path.join(__dirname, "assets/icons/png/1204x1024.png"), | ||
}); | ||
|
||
mainWindow.on("close", () => { | ||
mainWindow = null; | ||
}); | ||
} | ||
|
||
app.on("ready", createMainWindow); | ||
|
||
app.on("window-all-closed", () => { | ||
if (process.platform !== "darwin") { | ||
app.quit(); | ||
} | ||
}); | ||
|
||
app.on("activate", () => { | ||
if (mainWindow === null) { | ||
createMainWindow(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
window.ipcRenderer = require("electron").ipcRenderer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
const { app, BrowserWindow, Menu, ipcMain } = require("electron"); | ||
const url = require("url"); | ||
const isDev = require("electron-is-dev"); | ||
const path = require("path"); | ||
|
||
class MainWindow extends BrowserWindow { | ||
constructor(options) { | ||
super(options); | ||
this.init(); | ||
} | ||
|
||
init = () => { | ||
this.loadURL( | ||
isDev | ||
? "http://localhost:3000" | ||
: url.format({ | ||
pathname: path.join(__dirname, "../../index.html"), | ||
protocol: "file:", | ||
slashes: true, | ||
}) | ||
); | ||
this.createMainMenu(); | ||
|
||
this.ipcInit(); | ||
}; | ||
|
||
createMainMenu = () => { | ||
const mainMenuTemplate = [ | ||
{ | ||
label: "File", | ||
submenu: [ | ||
{ role: "reload" }, | ||
{ | ||
label: "Quit", | ||
role: "quit", | ||
}, | ||
], | ||
}, | ||
]; | ||
|
||
if (process.platform === "darwin") { | ||
mainMenuTemplate.unshift({ | ||
label: app.name, | ||
}); | ||
} | ||
|
||
if (isDev) { | ||
mainMenuTemplate.push({ | ||
label: "Developer Tools", | ||
submenu: [ | ||
{ | ||
label: "Toggle DevTools", | ||
click(item, focusedWindow) { | ||
focusedWindow.toggleDevTools(); | ||
}, | ||
accelerator: process.platform === "darwin" ? "Command+I" : "Ctrl+I", | ||
}, | ||
{ role: "reload" }, | ||
], | ||
}); | ||
} | ||
|
||
const mainMenu = Menu.buildFromTemplate(mainMenuTemplate); | ||
Menu.setApplicationMenu(mainMenu); | ||
}; | ||
|
||
ipcInit = () => { | ||
ipcMain.on("reload", () => { | ||
this.reload(); | ||
}); | ||
}; | ||
} | ||
|
||
module.exports = MainWindow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"name": "metronome", | ||
"version": "0.1.0", | ||
"private": true, | ||
"main": "electron/main.js", | ||
"homepage": "./", | ||
"author": { | ||
"name": "Tolga Erdonmez", | ||
"email": "tolgaerdonmez@gmail.com" | ||
}, | ||
"dependencies": { | ||
"@testing-library/jest-dom": "^4.2.4", | ||
"@testing-library/react": "^9.3.2", | ||
"@testing-library/user-event": "^7.1.2", | ||
"react": "^16.13.1", | ||
"react-dom": "^16.13.1", | ||
"react-scripts": "3.4.1", | ||
"typescript": "~3.7.2", | ||
"electron-is-dev": "^1.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^24.0.0", | ||
"@types/node": "^12.0.0", | ||
"@types/react": "^16.9.0", | ||
"@types/react-dom": "^16.9.0", | ||
"asar": "^3.0.3", | ||
"concurrently": "^5.2.0", | ||
"electron": "^8.2.5", | ||
"electron-builder": "^22.6.0", | ||
"electron-packager": "^14.2.1", | ||
"electron-reload": "^1.5.0", | ||
"npm-run-all": "^4.1.5", | ||
"wait-on": "^4.0.2" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test", | ||
"eject": "react-scripts eject", | ||
"dev": "concurrently \"BROWSER=none yarn start\" \"wait-on http://localhost:3000 && electron .\"", | ||
"package-mac": "electron-builder build --mac -c.extraMetadata.main=build/electron/main.js", | ||
"package-linux": "electron-builder build --linux appImage -c.extraMetadata.main=build/electron/main.js", | ||
"package-win": "electron-builder build --win portable -c.extraMetadata.main=build/electron/main.js", | ||
"prepackage": "yarn build && cp -r electron build/", | ||
"prepackage-linux": "yarn prepackage", | ||
"prepackage-mac": "yarn prepackage", | ||
"prepackage-win": "yarn prepackage" | ||
}, | ||
"build": { | ||
"appId": "com.example.electron-cra", | ||
"files": [ | ||
"build/**/*", | ||
"node_modules/**/*" | ||
], | ||
"directories": { | ||
"buildResources": "assets" | ||
} | ||
}, | ||
"eslintConfig": { | ||
"extends": "react-app" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta | ||
name="description" | ||
content="Web site created using create-react-app" | ||
/> | ||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> | ||
<!-- | ||
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" /> | ||
<!-- | ||
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. | ||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will | ||
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>React App</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. | ||
You can add webfonts, meta tags, or analytics to this file. | ||
The build step will place the bundled scripts into the <body> tag. | ||
To begin the development, run `npm start` or `yarn start`. | ||
To create a production bundle, use `npm run build` or `yarn build`. | ||
--> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.