Skip to content

Commit 0be6ec7

Browse files
authored
Merge pull request #55 from tsully/build
Fixed Electron-builder configuration
2 parents 452a5d4 + 77c1d8b commit 0be6ec7

File tree

16 files changed

+3
-41
lines changed

16 files changed

+3
-41
lines changed

app/electron/main.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const MenuBuilder = require('./menu');
2424
const path = require('path');
2525
// const fs = require('fs');
2626

27-
console.log('NODE ENV is ', process.env.NODE_ENV);
2827
const isDev =
2928
process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';
3029
const port = 8080;
@@ -238,8 +237,6 @@ app.on('web-contents-created', (event, contents) => {
238237

239238
contents.on('will-redirect', (event, navigationUrl) => {
240239
const parsedUrl = new URL(navigationUrl);
241-
//console.log('parsedUrl is', parsedUrl);
242-
//console.log('parsedUrl.origin is', parsedUrl.origin);
243240
const validOrigins = [
244241
selfHost,
245242
'http://localhost:5000',

app/src/components/App.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ export const App = (): JSX.Element => {
3636
});
3737
} else {
3838
// otherwise if a user is logged in, use a fetch request to load user's projects from DB
39-
// getProjects().then(projects =>
40-
// console.log('UseEffect in App getprojects() returns', projects)
41-
// );
4239
let userId;
4340
if (Cookies.get('ssid')) {
4441
userId = Cookies.get('ssid');
@@ -69,10 +66,8 @@ export const App = (): JSX.Element => {
6966
userId = window.localStorage.getItem('ssid');
7067
}
7168
if (state.isLoggedIn === false) {
72-
//console.log('Saving guest project as', state);
7369
localforage.setItem('guestProject', state);
7470
} else if (state.name !== '') {
75-
//console.log('Saving user project as', state);
7671
saveProject(state.name, state);
7772
localforage.setItem(userId, state);
7873
}

app/src/components/login/SignIn.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,11 @@ const SignIn: React.FC<LoginInt & RouteComponentProps> = props => {
121121
*/
122122
const handleLogin = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
123123
e.preventDefault();
124-
console.log('click fired on handleLogin');
125124
setInvalidUser(false);
126125
setInvalidUserMsg('');
127126
setInvalidPass(false);
128127
setInvalidPassMsg('');
129128
sessionIsCreated(username, password).then(loginStatus => {
130-
console.log('login fetch', loginStatus);
131129
if (loginStatus === 'Success') {
132130
props.history.push('/');
133131
} else {
@@ -157,7 +155,6 @@ const SignIn: React.FC<LoginInt & RouteComponentProps> = props => {
157155
const handleLoginGuest = (
158156
e: React.MouseEvent<HTMLButtonElement, MouseEvent>
159157
) => {
160-
console.log('Handle login guest fired');
161158
e.preventDefault();
162159
// generate "cookie" in localStorage for guest users
163160
window.localStorage.setItem('ssid', 'guest');
@@ -247,9 +244,6 @@ const SignIn: React.FC<LoginInt & RouteComponentProps> = props => {
247244

248245
<Grid container>
249246
<Grid item xs>
250-
{/* <Link href="#" variant="body2">
251-
Forgot password?
252-
</Link> */}
253247
<RouteLink to={`/signup`} className="nav_link">
254248
Forgot password?
255249
</RouteLink>

app/src/components/login/SignUp.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,9 @@ const SignUp: React.FC<LoginInt & RouteComponentProps> = props => {
182182
setInvalidVerifyPassword(false);
183183
}
184184

185-
console.log('invalidUsername', invalidUsername);
186-
console.log('invalidPassword', invalidPassword);
187-
console.log('invalidEmail', invalidEmail);
188-
console.log('invalidVerifyPassword', invalidVerifyPassword);
189185
// if(!invalidUsername && !invalidPassword && !invalidEmail && !invalidVerifyPassword) {
190186
newUserIsCreated(username, email, password).then(userCreated => {
191187
if (userCreated === 'Success') {
192-
console.log('user created');
193188

194189
props.history.push('/');
195190
} else {

app/src/components/main/Canvas.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import renderChildren from '../../helperFunctions/renderChildren';
99
function Canvas() {
1010
const [state, dispatch] = useContext(stateContext);
1111

12-
console.log('state is ', state);
1312
// find the current component to render on the canvas
1413
const currentComponent: Component = state.components.find(
1514
(elem: Component) => elem.id === state.canvasFocus.componentId

app/src/components/main/IndirectChild.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ function IndirectChild({ style, children, placeHolder, linkId }) {
2525
combinedStyle = combineStyles(combinedStyle, { color: 'blue' });
2626
}
2727

28-
//console.log('children are ', children);
29-
//console.log('place holder is ', placeHolder);
3028
return (
3129
<div style={combinedStyle}>
3230
{linkId ? (

app/src/components/right/ProjectsFolder.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ function ProjectsDialog(props: ProjectDialogProps) {
2727
const { onClose, open, projects } = props;
2828
const [_, dispatch] = useContext(stateContext);
2929

30-
useEffect(() => {
31-
console.log('state is', _);
32-
}, [_]);
33-
3430
// If no projects selected, keep the name of the current displayed
3531
const handleClose = () => {
3632
// onClose(selectedValue);

app/src/helperFunctions/auth.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export const sessionIsCreated = (
1212
username,
1313
password
1414
});
15-
console.log(process.env.NODE_ENV);
1615
const result = fetch(`${serverURL}/login`, {
1716
method: 'POST',
1817
credentials: 'include',
@@ -25,10 +24,8 @@ export const sessionIsCreated = (
2524
return res.json();
2625
})
2726
.then(data => {
28-
console.log('the data', data);
2927
if (data.sessionId && typeof data.sessionId === 'string') {
3028
// check that a session id was passed down
31-
console.log('Inside success');
3229
window.localStorage.setItem('ssid', data.sessionId);
3330
return 'Success';
3431
} else {
@@ -64,7 +61,6 @@ export const newUserIsCreated = (
6461
return res.json();
6562
})
6663
.then(data => {
67-
console.log('the data', data);
6864
if (data.sessionId && typeof data.sessionId === 'string') {
6965
// check that a session id was passed down
7066
window.localStorage.setItem('ssid', data.sessionId);

app/src/helperFunctions/generateCode.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const generateUnformattedCode = (
2727

2828
// get metadata for each child (e.g. the name/tag of the component/elemnt)
2929
const getEnrichedChildren = (currentComponent: Component | ChildElement) => {
30-
console.log('enriching component ', currentComponent);
3130
const enrichedChildren = currentComponent.children.map((elem: any) => {
3231
const child = { ...elem };
3332
if (child.type === 'Component') {
@@ -60,7 +59,6 @@ const generateUnformattedCode = (
6059
const writeNestedElements = (enrichedChildren: any) => {
6160
return `${enrichedChildren
6261
.map((child: any) => {
63-
console.log('the child is ', child);
6462
if (child.type === 'Component') {
6563
return `<${child.name}${formatStyles(child.style)} />`;
6664
} else if (child.type === 'HTML Element') {
@@ -127,7 +125,6 @@ const generateUnformattedCode = (
127125

128126
const enrichedChildren: any = getEnrichedChildren(currentComponent);
129127

130-
console.log(enrichedChildren);
131128
const next = true;
132129

133130
// import statements differ between root (pages) and regular components (components)
@@ -248,8 +245,6 @@ const generateCode = (
248245
rootComponents: number[],
249246
projectType: string
250247
) => {
251-
console.log('generating next.js code');
252-
// return ''
253248
const code = generateUnformattedCode(
254249
components,
255250
componentId,

app/src/helperFunctions/projectGetSave.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ if (isDev) {
66
// helper functions that will do fetch requests to get and save user/guest projects
77

88
export const getProjects = (): Promise<Object> => {
9-
//console.log("Loading user's projects...");
109
let userId = window.localStorage.getItem('ssid');
11-
//console.log('userId from localStorage is', userId);
1210
const body = JSON.stringify({ userId });
1311
const projects = fetch(`${serverURL}/getProjects`, {
1412
method: 'POST',
@@ -21,7 +19,6 @@ export const getProjects = (): Promise<Object> => {
2119
})
2220
.then(res => res.json())
2321
.then(data => {
24-
//console.log("User's projects are", data);
2522
return data;
2623
})
2724
.catch(err => console.log(`Error getting project ${err}`));
@@ -32,7 +29,7 @@ export const saveProject = (
3229
name: String,
3330
workspace: Object
3431
): Promise<Object> => {
35-
//console.log("Saving user's project...");
32+
3633
const body = JSON.stringify({
3734
name,
3835
project: workspace,
@@ -48,7 +45,6 @@ export const saveProject = (
4845
})
4946
.then(res => res.json())
5047
.then(data => {
51-
//console.log('Saved project is', data.project);
5248
return data.project;
5349
})
5450
.catch(err => console.log(`Error saving project ${err}`));

app/src/utils/createApplication.util.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ function createIndexHtml(path, appName) {
3030
let dirComponent;
3131
if (!dir.match(/`${appName}`|\*$/)) {
3232
dir = `${dir}/${appName}`;
33-
console.log('dir is ', dir);
3433
if (!window.api.existsSync(dir)) {
3534
window.api.mkdirSync(dir);
3635
dirSrc = `${dir}/src`;

electron-builder.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ linux:
1313
- rpm
1414
- snap
1515
- AppImage
16+
maintainer: [email protected]
1617
mac:
1718
category: public.app-category.developer-tools
1819
target: dmg

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "Prototyping tool for React/Typescript Applications.",
55
"private": true,
66
"main": "app/electron/main.js",
7+
"author": "OS Labs",
78
"contributors": [
89
"Adam Singer",
910
"Charles Finocchiaro",

resources/icon.icns

-61.5 KB
Binary file not shown.

resources/icon.ico

-5.68 KB
Binary file not shown.

resources/icon.png

39.1 KB
Loading

0 commit comments

Comments
 (0)