Skip to content

Commit 2f6b6d9

Browse files
committed
feat: initial setup
1 parent 74d407d commit 2f6b6d9

File tree

9 files changed

+347
-19
lines changed

9 files changed

+347
-19
lines changed

.github/workflows/beta-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
push:
33
branches:
4-
- qa
4+
# - qa
55

66
name: Create Beta Release
77

.github/workflows/cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: React GraphQL TypeScript Template CD
22
on:
33
push:
4-
branches: [master]
4+
# branches: [master]
55
jobs:
66
build-and-deploy:
77
runs-on: ubuntu-latest

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: React Template CI
22
on:
33
pull_request:
4-
branches: [master, qa, develop]
4+
# branches: [master, qa, develop]
55
jobs:
66
build-and-test:
77
name: Build & Test

.github/workflows/jest-coverage.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: Jest Coverage Report with Annotations (CI)
22
on:
33
pull_request:
4-
branches:
5-
- master
6-
- qa
7-
- develop
4+
# branches:
5+
# - master
6+
# - qa
7+
# - develop
88
jobs:
99
coverage_report:
1010
name: Jest Coverage Report
@@ -20,10 +20,10 @@ jobs:
2020
with:
2121
path: 'jest.config.json'
2222
prop_path: 'coverageThreshold.global.statements'
23-
23+
2424
- name: Install dependencies
2525
run: yarn
26-
26+
2727
- name: Test and generate coverage report
2828
uses: artiomtr/[email protected]
2929
with:

.github/workflows/prod-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
push:
33
branches:
4-
- master
4+
# - master
55

66
name: Create Production Release
77

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<img src="https://uploads-ssl.webflow.com/5ee36ce1473112550f1e1739/5f5879492fafecdb3e5b0e75_wednesday_logo.svg">
66
</a>
77
<p>
8-
<h3 align="left">React GraphQL TypeScript Template</h3>
8+
<h3 align="left">Electron React GraphQL TypeScript Template</h3>
99
</p>
1010

1111
<p>
@@ -201,7 +201,6 @@ An enterprise react template application showcasing - Testing strategies, Global
201201
- [app/services/tests/repoApi.test.ts](app/services/tests/repoApi.test.ts)
202202
- [app/components/T/tests/index.test.tsx](app/components/T/tests/index.test.tsx)
203203

204-
205204
## Misc
206205

207206
### Aliasing

main/main.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const { app, BrowserWindow } = require('electron');
2+
const path = require('path');
3+
const { default: installer, REDUX_DEVTOOLS, REACT_DEVELOPER_TOOLS } = require('electron-devtools-installer');
4+
5+
function createWindow() {
6+
const win = new BrowserWindow({
7+
width: 800,
8+
height: 600,
9+
webPreferences: {
10+
preload: path.join(__dirname, 'preload.js')
11+
}
12+
});
13+
14+
if (process.env.NODE_ENV === 'development') {
15+
win.loadURL(`http://localhost:3000`);
16+
win.webContents.once('dom-ready', () => {
17+
win.webContents.openDevTools();
18+
});
19+
}
20+
}
21+
22+
app.whenReady().then(() => {
23+
createWindow();
24+
25+
const options = {
26+
loadExtensionOptions: { allowFileAccess: true }
27+
};
28+
installer([REDUX_DEVTOOLS, REACT_DEVELOPER_TOOLS], options);
29+
app.on('activate', () => {
30+
if (BrowserWindow.getAllWindows().length === 0) {
31+
createWindow();
32+
}
33+
});
34+
});
35+
36+
app.on('window-all-closed', () => {
37+
if (process.platform !== 'darwin') {
38+
app.quit();
39+
}
40+
});

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"author": "Mac",
1414
"homepage": "https://github.com/wednesday-solutions/react-graphql-ts-template",
1515
"license": "MIT",
16+
"main": "./main/main.js",
1617
"scripts": {
1718
"analyze:clean": "rimraf stats.json",
1819
"preanalyze": "npm run analyze:clean",
@@ -55,7 +56,8 @@
5556
"storybook": "export ENVIRONMENT_NAME=development && start-storybook -p 6006",
5657
"build-storybook": "export ENVIRONMENT_NAME=production && build-storybook",
5758
"initialize": "git checkout --orphan temp-branch && git add -A && git commit -m 'Initial commit' && git branch -D master && git branch -m master",
58-
"generate": "react-generate"
59+
"generate": "react-generate",
60+
"electron:dev": "export ENVIRONMENT_NAME=local && concurrently -c green.bold,blue.bold,white.bold -n WEBPACK,TYPESCRIPT,ELECTRON \"cross-env NODE_ENV=development node server\" \"yarn tsc:watch\" \"wait-on http://localhost:3000 && cross-env NODE_ENV=development electron .\""
5961
},
6062
"browserslist": [
6163
"last 2 versions",
@@ -94,6 +96,7 @@
9496
"date-fns": "^2.28.0",
9597
"deep-map-keys": "^2.0.1",
9698
"dotenv": "10.0.0",
99+
"electron": "^23.1.0",
97100
"express": "4.16.4",
98101
"fontfaceobserver": "2.1.0",
99102
"git-commit-msg-linter": "^4.1.1",
@@ -177,6 +180,7 @@
177180
"concurrently": "^7.0.0",
178181
"coveralls": "3.0.3",
179182
"css-loader": "^5.2.6",
183+
"electron-devtools-installer": "^3.2.0",
180184
"eslint": "^8.11.0",
181185
"eslint-config-airbnb": "17.1.0",
182186
"eslint-config-airbnb-base": "13.1.0",
@@ -232,6 +236,7 @@
232236
"terser-webpack-plugin": "5.1.3",
233237
"typescript": "^4.6.2",
234238
"url-loader": "4.1.1",
239+
"wait-on": "^7.0.1",
235240
"webpack": "^5.40.0",
236241
"webpack-bundle-analyzer": "^4.4.2",
237242
"webpack-cli": "4.7.2",

0 commit comments

Comments
 (0)