Skip to content

Commit c4a488d

Browse files
authored
Merge pull request #28 from sean1292/staging
Made changes so that the app can build without having specific file path
2 parents dca78bd + b68f65c commit c4a488d

28 files changed

+755
-494
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Created by https://www.gitignore.io/api/node,linux,macos,windows,visualstudio,yarn
22
yarn.lock
33
package-lock.json
4+
.prettierrc.json
45
### Linux ###
56
*~
67

electron-builder.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ linux:
77
target:
88
- AppImage
99
- deb
10-
maintainer: spincycle01@yahoo.com
10+
maintainer: sean.sadykoff@gmail.com
1111
mac:
1212
category: public.app-category.developer-tools
1313
target: dmg
@@ -29,4 +29,4 @@ dmg:
2929
'y': 150
3030
type: link
3131
path: /Applications
32-
electronVersion: 2.0.7
32+
electronVersion: 3.0.0

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"AppImage",
3131
"deb"
3232
],
33-
"maintainer": "spincycle01@yahoo.com"
33+
"maintainer": "sean.sadykoff@gmail.com"
3434
},
3535
"mac": {
3636
"category": "public.app-category.developer-tools",
@@ -73,7 +73,7 @@
7373
"build-bin": "electron-builder -mwl",
7474
"test": "cross-env NODE_ENV=test jest",
7575
"linter": "eslint src",
76-
"develop": "concurrently \"yarn run dev\" \"yarn run electron\""
76+
"develop": "concurrently \"npm run dev\" \"npm run electron\""
7777
},
7878
"bin": {
7979
"reactype": "./index.js"
@@ -92,7 +92,6 @@
9292
"dependencies": {
9393
"@material-ui/core": "^3.9.3",
9494
"@material-ui/icons": "^2.0.0",
95-
"@material-ui/styles": "^4.9.0",
9695
"@types/prettier": "^1.19.0",
9796
"@types/react": "^16.8.14",
9897
"@types/react-dom": "^16.8.4",
@@ -103,6 +102,7 @@
103102
"classnames": "^2.2.6",
104103
"cli-spinner": "^0.2.8",
105104
"commander": "^2.17.1",
105+
"concurrently": "^5.1.0",
106106
"d3": "^5.9.2",
107107
"electron-reload": "^1.4.0",
108108
"enzyme": "^3.4.1",
@@ -126,6 +126,7 @@
126126
},
127127
"devDependencies": {
128128
"@babel/preset-typescript": "^7.3.3",
129+
"@material-ui/styles": "^4.9.6",
129130
"awesome-typescript-loader": "^5.2.1",
130131
"babel-core": "^6.26.3",
131132
"babel-eslint": "^8.2.6",
@@ -139,7 +140,7 @@
139140
"cross-env": "^5.2.0",
140141
"css-loader": "^0.28.11",
141142
"electron": "^2.0.7",
142-
"electron-builder": "^20.28.1",
143+
"electron-builder": "^20.44.4",
143144
"electron-devtools-installer": "^2.2.4",
144145
"electron-installer-dmg": "^2.0.0",
145146
"enzyme-adapter-react-16": "^1.2.0",

src/actions/components.ts

Lines changed: 69 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import { ComponentInt, ComponentsInt, PropInt, ChildInt, Action } from '../utils/Interfaces';
1+
import {
2+
ComponentInt,
3+
ComponentsInt,
4+
PropInt,
5+
ChildInt,
6+
Action,
7+
} from '../utils/Interfaces';
28

39
import {
410
LOAD_INIT_DATA,
@@ -27,7 +33,7 @@ import {
2733
// UPDATE_CHILDREN_SORT, --The reason why this is commented out is because of the unused reducer of the same name, for the component that is unfinished with the same name. Check out the Sort Children component to see what it does.
2834
CHANGE_IMAGE_SOURCE,
2935
DELETE_IMAGE,
30-
CHANGE_TUTORIAL
36+
CHANGE_TUTORIAL,
3137
} from '../actionTypes/index';
3238

3339
import { loadState } from '../localStorage'; //this is a warning from 'localStorage' being a .js file instead of .ts. Convert to .ts to remove this warning.
@@ -36,33 +42,35 @@ import createApplicationUtil from '../utils/createApplication.util';
3642

3743
export const changeTutorial = (tutorial: number) => ({
3844
type: CHANGE_TUTORIAL,
39-
payload: { tutorial }
45+
payload: { tutorial },
4046
});
4147

4248
export const changeImagePath = (imageSource: string) => ({
4349
type: CHANGE_IMAGE_SOURCE,
44-
payload: { imageSource }
50+
payload: { imageSource },
4551
});
4652

4753
export const loadInitData = () => (dispatch: (arg: Action) => void) => {
4854
loadState().then((data: any) => {
4955
dispatch({
5056
type: LOAD_INIT_DATA,
5157
payload: {
52-
data: data ? data.workspace : {}
53-
}
58+
data: data ? data.workspace : {},
59+
},
5460
});
5561
});
5662
};
5763

58-
export const addComponent = ({ title }: { title: string }) => (dispatch: (arg: Action) => void) => {
64+
export const addComponent = ({ title }: { title: string }) => (
65+
dispatch: (arg: Action) => void,
66+
) => {
5967
dispatch({ type: ADD_COMPONENT, payload: { title } });
6068
};
6169

6270
export const addChild = ({
6371
title,
6472
childType,
65-
HTMLInfo
73+
HTMLInfo,
6674
}: {
6775
title: string;
6876
childType: string;
@@ -78,7 +86,7 @@ export const deleteChild = ({}) => (dispatch: (arg: Action) => void) => {
7886

7987
export const deleteComponent = ({
8088
componentId,
81-
stateComponents
89+
stateComponents,
8290
}: {
8391
componentId: number;
8492
stateComponents: ComponentsInt;
@@ -93,8 +101,8 @@ export const deleteComponent = ({
93101
payload: {
94102
parentId: parent.id,
95103
childId: child.childId,
96-
calledFromDeleteComponent: true
97-
}
104+
calledFromDeleteComponent: true,
105+
},
98106
});
99107
});
100108
});
@@ -106,40 +114,40 @@ export const deleteComponent = ({
106114
};
107115

108116
export const changeFocusComponent = ({ title }: { title: string }) => (
109-
dispatch: (arg: Action) => void
117+
dispatch: (arg: Action) => void,
110118
) => {
111119
dispatch({ type: CHANGE_FOCUS_COMPONENT, payload: { title } });
112120
};
113121

114122
// make sure childId is being sent in
115123
export const changeFocusChild = ({ childId }: { childId: number }) => (
116-
dispatch: (arg: Action) => void
124+
dispatch: (arg: Action) => void,
117125
) => {
118126
dispatch({ type: CHANGE_FOCUS_CHILD, payload: { childId } });
119127
};
120128

121129
export const changeComponentFocusChild = ({
122130
componentId,
123-
childId
131+
childId,
124132
}: {
125133
componentId: number;
126134
childId: number;
127135
}) => (dispatch: (arg: Action) => void) => {
128136
dispatch({
129137
type: CHANGE_COMPONENT_FOCUS_CHILD,
130-
payload: { componentId, childId }
138+
payload: { componentId, childId },
131139
});
132140
};
133141

134142
export const deleteImage = () => ({
135-
type: DELETE_IMAGE
143+
type: DELETE_IMAGE,
136144
});
137145

138146
export const exportFiles = ({
139147
components,
140148
path,
141149
appName,
142-
exportAppBool
150+
exportAppBool,
143151
}: {
144152
components: ComponentsInt;
145153
path: string;
@@ -148,32 +156,37 @@ export const exportFiles = ({
148156
}) => (dispatch: (arg: Action) => void) => {
149157
// this dispatch sets the global state property 'loading' to true until the createFiles call resolves below
150158
dispatch({
151-
type: EXPORT_FILES
159+
type: EXPORT_FILES,
152160
});
153161
createFiles(components, path, appName, exportAppBool)
154162
.then((dir: any) =>
155163
dispatch({
156164
type: EXPORT_FILES_SUCCESS,
157-
payload: { status: true, dir: dir[0] }
158-
})
165+
payload: { status: true, dir: dir[0] },
166+
}),
159167
)
160168
.catch((err: string) =>
161169
dispatch({
162170
type: EXPORT_FILES_ERROR,
163-
payload: { status: true, err }
164-
})
171+
payload: { status: true, err },
172+
}),
165173
);
166174
};
167175

168176
export const handleClose = () => ({
169177
type: HANDLE_CLOSE,
170-
payload: false
178+
payload: false,
171179
});
172180

173181
export const handleTransform = (
174182
componentId: number,
175183
childId: number,
176-
{ x, y, width, height }: { x: number; y: number; width: number; height: number }
184+
{
185+
x,
186+
y,
187+
width,
188+
height,
189+
}: { x: number; y: number; width: number; height: number },
177190
) => ({
178191
type: HANDLE_TRANSFORM,
179192
payload: {
@@ -182,16 +195,16 @@ export const handleTransform = (
182195
x,
183196
y,
184197
width,
185-
height
186-
}
198+
height,
199+
},
187200
});
188201

189202
export const createApplication = ({
190203
path,
191204
components = [],
192205
genOption,
193206
appName = 'reactype_app',
194-
exportAppBool
207+
exportAppBool,
195208
}: {
196209
path: string;
197210
components: ComponentsInt;
@@ -206,73 +219,83 @@ export const createApplication = ({
206219
appName,
207220
path,
208221
components,
209-
exportAppBool
210-
})
222+
exportAppBool,
223+
}),
211224
);
212225
} else if (genOption) {
213226
exportAppBool = true;
214227
dispatch({
215-
type: CREATE_APPLICATION
228+
type: CREATE_APPLICATION,
216229
});
217230
createApplicationUtil({
218231
path,
219232
appName,
220-
genOption
233+
genOption,
221234
})
222235
.then(() => {
223236
dispatch({
224-
type: CREATE_APPLICATION_SUCCESS
237+
type: CREATE_APPLICATION_SUCCESS,
225238
});
226239
dispatch(
227240
exportFiles({
228241
appName,
229242
path,
230243
components,
231-
exportAppBool
232-
})
244+
exportAppBool,
245+
}),
233246
);
234247
})
235248
.catch((err: string) =>
236249
dispatch({
237250
type: CREATE_APPLICATION_ERROR,
238-
payload: { status: true, err }
239-
})
251+
payload: { status: true, err },
252+
}),
240253
);
241254
}
242255
};
243256

244257
export const openExpansionPanel = (component: ComponentInt) => ({
245258
type: OPEN_EXPANSION_PANEL,
246-
payload: { component }
259+
payload: { component },
247260
});
248261

249262
export const deleteAllData = () => ({
250-
type: DELETE_ALL_DATA
263+
type: DELETE_ALL_DATA,
251264
});
252265

253-
export const deleteProp = (propId: number) => (dispatch: (arg: Action) => void) => {
266+
export const deleteProp = (propId: number) => (
267+
dispatch: (arg: Action) => void,
268+
) => {
254269
dispatch({ type: DELETE_PROP, payload: propId });
255270
};
256271

257-
export const toggleComponentState = (id: string) => (dispatch: (arg: Action) => void) => {
272+
export const toggleComponentState = (id: string) => (
273+
dispatch: (arg: Action) => void,
274+
) => {
258275
dispatch({ type: TOGGLE_STATE, payload: id });
259276
};
260277

261-
export const toggleComponentClass = (id: string) => (dispatch: (arg: Action) => void) => {
278+
export const toggleComponentClass = (id: string) => (
279+
dispatch: (arg: Action) => void,
280+
) => {
262281
dispatch({ type: TOGGLE_CLASS, payload: id });
263282
};
264283

265284
export const addProp = (prop: PropInt) => ({
266285
type: ADD_PROP,
267-
payload: { ...prop }
286+
payload: { ...prop },
268287
});
269288

270-
export const updateHtmlAttr = ({ attr, value }: { attr: string; value: string }) => (
271-
dispatch: (arg: Action) => void
272-
) => {
289+
export const updateHtmlAttr = ({
290+
attr,
291+
value,
292+
}: {
293+
attr: string;
294+
value: string;
295+
}) => (dispatch: (arg: Action) => void) => {
273296
dispatch({
274297
type: UPDATE_HTML_ATTR,
275-
payload: { attr, value }
298+
payload: { attr, value },
276299
});
277300
};
278301

0 commit comments

Comments
 (0)