Skip to content

Commit 6b562df

Browse files
authored
Merge pull request #141 from oslabs-beta/electron-packaging
Electron packaging
2 parents d3a4a4b + c33ad34 commit 6b562df

File tree

10 files changed

+104
-21
lines changed

10 files changed

+104
-21
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
node_modules
2+
package-lock.json
3+
Release.key
4+
winehq.key
5+
.env
6+
out
27
public/bundle.js
38
public/bundle.js.map
4-
package-lock.json
59
.DS_Store

main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function createWindow() {
1717
nodeIntegration: true
1818
},
1919
// this is only for Windows and Linux
20-
icon: './public/assets/pictures/ProtoGraphQLLogo.png'
20+
icon: path.join(__dirname, 'public/assets/pictures/ProtoGraphQLLogo64.png')
2121
});
2222

2323
win.setMinimumSize(265, 630);

package.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"name": "protographql",
33
"version": "1.0.0",
4-
"description": "GraphQL prototyping desktop tool, build GQL schemas, queries, and mutations.",
4+
"description": "ProtGraphQl is prototyping tool to easily build and visualize GraphQl schemas and queries",
55
"main": "main.js",
66
"scripts": {
77
"start": "electron .",
88
"build": "webpack -p",
99
"dev": "webpack-dev-server --mode=development",
1010
"test": "test",
11-
"package-all": "electron-packager . --all --asar",
11+
"package": "sudo electron-forge make",
1212
"package-linux": "electron-packager . --linux --asar",
1313
"package-mac": "electron-packager . --darwin --asar",
14-
"package-win": "electron-packager . --win32 --asar"
14+
"package-win": "electron-packager . --platform win32 --arch x64 --asar"
1515
},
1616
"repository": {
1717
"type": "git",
@@ -25,13 +25,21 @@
2525
"homepage": "https://github.com/protographql/protographql#readme",
2626
"config": {
2727
"forge": {
28-
"packagerConfig": {
28+
"electronPackagerConfig": {
2929
"asar": true,
3030
"executableName": "protographql",
3131
"icon": "public/pictures/icon/icon",
3232
"overwrite": true,
33-
"platform": "all",
34-
"prune": true
33+
"prune": true,
34+
"arch": "x64"
35+
},
36+
"make_targets": {
37+
"darwin": [
38+
"dmg"
39+
],
40+
"linux": [
41+
"deb"
42+
]
3543
},
3644
"makers": [
3745
{
@@ -47,13 +55,6 @@
4755
"config": {
4856
"format": "ULFO"
4957
}
50-
},
51-
{
52-
"name": "@electron-forge/maker-squirrel",
53-
"config": {
54-
"certificateFile": "./cert.pfx",
55-
"certificatePassword": "this-is-a-secret"
56-
}
5758
}
5859
]
5960
}
@@ -95,4 +96,4 @@
9596
"react-dom": "^16.8.6",
9697
"react-draggable": "^3.3.0"
9798
}
98-
}
99+
}

public/.DS_Store

-6 KB
Binary file not shown.

public/assets/.DS_Store

-6 KB
Binary file not shown.
4.64 KB
Loading

src/components/navSideBar/navSidebar.jsx

Whitespace-only changes.

src/components/sideBar/navSidebar.jsx

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useContext } from 'react';
22
import NavButton from './navButton';
3+
import NoTableButton from './noTableButton';
34
import styled from 'styled-components';
45
import { Store } from '../../state/store';
56
import {
@@ -40,8 +41,7 @@ function changeButtonStyleOnClick(view) {
4041
}
4142

4243
function NavSideBar() {
43-
const { dispatch } = useContext(Store);
44-
44+
const { dispatch, state: { tableIndex } } = useContext(Store);
4545
return (
4646
<SideBar>
4747
<NavButton
@@ -77,7 +77,7 @@ function NavSideBar() {
7777
document.querySelector("svg") ? document.querySelector("svg").remove() : "";
7878
}}
7979
/>
80-
<NavButton
80+
{tableIndex !== 0 && <NavButton
8181
key='NavButton3'
8282
className='fas fa-plus-square'
8383
view='Add Table'
@@ -94,7 +94,25 @@ function NavSideBar() {
9494
borderTop: '1px solid rgba(0, 0, 0, 0.08)',
9595
width: '100%'
9696
}}
97-
/>
97+
/>}
98+
{tableIndex === 0 && <NoTableButton
99+
key='NavButton4'
100+
className='fas fa-plus-square'
101+
view='Add Table'
102+
click={() => {
103+
dispatch({ type: SET_VIEW, payload: 'schema' })
104+
dispatch({ type: SET_POP_UP, payload: 'table' })
105+
dispatch({ type: ADD_TABLE })
106+
changeButtonStyleOnClick("Schema")
107+
document.querySelector("svg") ? document.querySelector("svg").remove() : "";
108+
}}
109+
style={{
110+
position: 'absolute',
111+
bottom: 0,
112+
borderTop: '1px solid rgba(0, 0, 0, 0.08)',
113+
width: '100%'
114+
}}
115+
/>}
98116
</SideBar>
99117
)
100118
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import React from 'react';
2+
import styled, { keyframes } from 'styled-components';
3+
4+
/*-------------------- Styled Components --------------------*/
5+
6+
const fontColor = keyframes`
7+
0% {
8+
color: rgba(50, 67, 83, 1);
9+
box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.00);
10+
bottom: 0px;
11+
}
12+
50% {
13+
color: #e535ab;
14+
box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.10);
15+
bottom: 25px;
16+
}
17+
100% {
18+
color: rgba(50, 67, 83, 1);
19+
box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.00);
20+
bottom: 0px;
21+
}
22+
`;
23+
24+
const ButtonContainer = styled.div`
25+
padding: 1px;
26+
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
27+
min-width: 200px;
28+
cursor: pointer;
29+
animation: ${fontColor} 2s;
30+
animation-fill-mode: both;
31+
animation-iteration-count: 5;
32+
`;
33+
34+
const Button = styled.div`
35+
height: 60px;
36+
background-color: none;
37+
margin: auto;
38+
margin-left: calc(15.5px + .25vw);
39+
margin-top: 25px;
40+
`;
41+
42+
const Icon = styled.span`
43+
margin: 5px;
44+
font-size: calc(14px + 1vw);
45+
`;
46+
47+
/*-------------------- Functional Component --------------------*/
48+
49+
const NoTableButton = ({ className, click, view, style }) => {
50+
return (
51+
<ButtonContainer style={style} onClick={click} id={view}>
52+
<Button>
53+
<Icon><i className={className} /></Icon>
54+
{view}
55+
</Button>
56+
</ButtonContainer>
57+
)
58+
}
59+
60+
export default NoTableButton;

src/state/store.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-case-declarations */
22
import React from 'react';
3-
import * as state from '../state/mockState';
3+
import * as state from '../state/initialState';
44
import deepClone from '../utils/deepClone';
55
import buildGQLSchema from '../utils/buildGQLSchema';
66
import buildGQLResolvers from '../utils/buildGQLResolvers';

0 commit comments

Comments
 (0)