Skip to content

Commit 3acde76

Browse files
Merge pull request #180 from oslabs-beta/staging
Staging
2 parents e1ac043 + d62847a commit 3acde76

File tree

111 files changed

+521
-1364
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+521
-1364
lines changed

Dockerfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 ReacType
3+
Copyright (c) 2022 ReacType
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

README.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/team-reactype/ReacType/pulls)
77
![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)
8-
![Version 9.0.0]
8+
![Version 10.0.0]
99

1010
**ReacType** is a rapid prototyping tool for developers employing **React** component architecture alongside the comprehensive type-checking of **TypeScript**.
1111
In other words, **you can draw prototypes and export React / TypeScript code!**
@@ -16,13 +16,14 @@ Download for [MacOS](https://github.com/team-reactype/ReacType/releases), [Windo
1616

1717
- **Mac users**: After opening the dmg and dragging ReacType into your Applications folder, ctrl+click the icon and select 'Open' from the context menu to run the app. This extra step is necessary since we don't have an Apple developer license yet.
1818

19-
- **Windows users**: Install the application by running ReacType Setup 9.0.0.exe.
19+
- **Windows users**: Install the application by running ReacType Setup 10.0.0.exe.
2020

2121
- **Linux users**: Run the application as a super user in order to read and write files.
2222

23-
![openingGif](https://raw.githubusercontent.com/open-source-labs/ReacType/master/resources/canvas_tutorial_images/drag1.gif)
24-
25-
### How to use
23+
<p align='center'>
24+
<img src='./app/src/public/ezgif.com-gif-maker.gif'/>
25+
</p>
26+
How to use
2627

2728
- **Sign-in page**: Sign up for an account or just continue as a guest. Registered users enjoy additional project-saving functionality.
2829
- **Tutorial**: Click ‘Tutorial’ from the Help tab’s dropdown menu (at the top left of the application) to view a tutorial.
@@ -34,7 +35,7 @@ Download for [MacOS](https://github.com/team-reactype/ReacType/releases), [Windo
3435
- **Create Instances on the Canvas**: Each component has its own canvas. Add an element to a component by dragging it onto the canvas. Div components are arbitrarily nestable and useful for complex layouts. Next.js and Gatsby.js projects have Link components to enable client-side navigation to other routes.
3536
- **Component Tree**: Click on the Component Tree tab next to the Code Preview tab to view the component tree hierarchy.
3637
- **Update Styling**: Select an element on the canvas to update its basic style attributes on the right panel. As you create new instances and add styling, watch as your code dynamically generates in the code preview in the bottom panel.
37-
- **Using State in Elements**: As of 9.0.0, you can now select an HTML element on the canvas and then navigate to the customization panel to click a button to pass a variable from state into your element's text or link field.
38+
- **Using State in Elements**: As of 10.0.0, you can now select an HTML element on the canvas and then navigate to the customization panel to click a button to pass a variable from state into your element's text or link field.
3839
- **User Preference Features**: With the click of a button, toggle between light mode and dark mode, depending on your preference.
3940
- **Export project**: Click the “Export Project’ button to export the project’s application files into a TypeScript file. The exported project is fully functional with Webpack, Express server, routing, etc., and will match what is mocked on the canvas.
4041
- **Export project with Tests**: Click the "includes tests" checkbox while exporting to include pre-configured Webpack, Jest, and Typescript files along with tests for your project.
@@ -60,10 +61,8 @@ Download for [MacOS](https://github.com/team-reactype/ReacType/releases), [Windo
6061
- Tutorial has been updated to reflect other modifications
6162

6263

63-
**New with version 9.0.0:**
64-
- **React Router**: Drag-and-drop LinkTo and Router elements (located below the HTML elements list) to implement fully-functional React Router components into your application to dynamically and quickly render components in the live demo render and in your exported application.
65-
- **Global State Management**: For the first time in ReacType history, users can utilize global state management in the form of the Context API! Any state that is added will automatically be passed around your application with the appropriate UseContext hooks.
66-
- **Composite Data Structures in State**: State creation in ReacType can now handle composite data types, which includes arrays, objects, and any amount of nesting of composite data types within other composite data types (i.e. arrays of objects and objects with objects as values).
64+
**New with version 10.0.0:**
65+
- **Live Code Preview**: See your code preview update in real time as you build. React hooks are enabled for application lifecycle management. Dynamically render functional components using a live code editor. User's can hook event listeners to components and see them render in real time.
6766

6867
### Keyboard Shortcuts
6968

@@ -89,6 +88,8 @@ Download for [MacOS](https://github.com/team-reactype/ReacType/releases), [Windo
8988

9089
#### Contributors
9190

91+
[Abeer Faizan](https://www.linkedin.com/in/abeerfaizan/) [@abeer-f](https://github.com/abeer-f)
92+
9293
[Alex Yu](https://www.linkedin.com/in/alexjihunyu/) [@buddhajjigae](https://github.com/buddhajjigae)
9394

9495
[Aaron Bumanglag](https://www.linkedin.com/in/akbuma) [@akbuma](https://github.com/akbuma)
@@ -103,6 +104,8 @@ Download for [MacOS](https://github.com/team-reactype/ReacType/releases), [Windo
103104

104105
[Brian Han](https://www.linkedin.com/in/brianjisoohan/) [@brianjshan](https://github.com/brianjshan)
105106

107+
[Bryan Chau](https://www.linkedin.com/in/chaubryan1/) [@bchauu](https://github.com/bchauu)
108+
106109
[Charles Finocchiaro](https://www.linkedin.com/in/charles-finocchiaro-62440040/) [@null267](https://github.com/null267)
107110

108111
[Chelsey Fewer](https://www.linkedin.com/in/chelsey-fewer/) [@chelseyeslehc](https://github.com/chelseyeslehc)
@@ -113,8 +116,7 @@ Download for [MacOS](https://github.com/team-reactype/ReacType/releases), [Windo
113116

114117
[Crystal Lim](https://linkedin.com/in/crystallim) [@crlim](https://github.com/crlim)
115118

116-
[Danial Reilley](https://linkedin.com/in/daniel-reilley)
117-
[@dreille](https://github.com/dreille)
119+
[Danial Reilley](https://linkedin.com/in/daniel-reilley) [@dreille](https://github.com/dreille)
118120

119121
[Daryl Foster](https://www.linkedin.com/in/darylfosterma/) [@MadinventorZero](https://github.com/MadinventorZero)
120122

@@ -144,17 +146,15 @@ Download for [MacOS](https://github.com/team-reactype/ReacType/releases), [Windo
144146

145147
[Luke Madden](https://www.linkedin.com/in/lukemadden/) [@lukemadden](https://github.com/lukemadden)
146148

147-
[Miles Wright](https://www.linkedin.com/in/miles-m-wright)
148-
[@Miles818](https://github.com/Miles818)
149+
[Miles Wright](https://www.linkedin.com/in/miles-m-wright) [@Miles818](https://github.com/Miles818)
149150

150151
[Mitchel Severe](https://www.linkedin.com/in/misevere/) [@mitchelsevere](https://github.com/mitchelsevere)
151152

152153
[Natalie Vick](https://www.linkedin.com/in/vicknatalie/) [@natattackvick](https://github.com/natattackvick)
153154

154155
[Nel Malikova](https://www.linkedin.com/in/gmalikova/) [@gmal1](https://github.com/gmal1)
155156

156-
[Philip Hua](https://www.linkedin.com/in/philip-minh-hua)
157-
[@pmhua](https://github.com/pmhua)
157+
[Philip Hua](https://www.linkedin.com/in/philip-minh-hua) [@pmhua](https://github.com/pmhua)
158158

159159
[Ron Fu](https://www.linkedin.com/in/ronfu)[@rfvisuals](https://github.com/rfvisuals)
160160

@@ -166,6 +166,8 @@ Download for [MacOS](https://github.com/team-reactype/ReacType/releases), [Windo
166166

167167
[Sophia Huttner](https://www.linkedin.com/in/sophia-huttner-68315975/) [@sophjean](https://github.com/sophjean)
168168

169+
[Stephen Kim](https://www.linkedin.com/in/stephenkim612/) [@stephenkim612](https://github.com/stephenkim612)
170+
169171
[Stormi Hashimoto](https://www.linkedin.com/in/stormikph/) [@stormikph](https://github.com/stormikph)
170172

171173
[Tolga Mizrakci](https://linkedin.com/in/tolga-mizrakci) [@tolgamizrakci](https://github.com/tolgamizrakci)
@@ -174,10 +176,11 @@ Download for [MacOS](https://github.com/team-reactype/ReacType/releases), [Windo
174176

175177
[Tyler Sullberg](https://www.linkedin.com/in/tyler-sullberg) [@tsully](https://github.com/tsully)
176178

179+
[Ulrich Neujahr](https://www.linkedin.com/in/nobrackets/) [@nobrackets](https://github.com/nobrackets)
180+
177181
[William Cheng](https://www.linkedin.com/in/william-cheng-0723/) [@williamcheng12345](https://github.com/WilliamCheng12345)
178182

179-
[William Rittwage](https://www.linkedin.com/in/william-rittwage)
180-
[@wbrittwage](https://github.com/wbrittwage)
183+
[William Rittwage](https://www.linkedin.com/in/william-rittwage) [@wbrittwage](https://github.com/wbrittwage)
181184

182185
[William Yoon](https://www.linkedin.com/in/williamdyoon/) [@williamdyoon](https://github.com/williamdyoon)
183186

__tests__/BottomTabs.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import BottomTabs from '../app/src/components/bottom/BottomTabs';
66
import StateContext from '../app/src/context/context';
77
import initialState from '../app/src/context/initialState';
88
import reducer from '../app/src/reducers/componentReducer';
9-
109
function Test() {
1110
const [state, dispatch] = useReducer(reducer, initialState);
1211
return (
@@ -15,7 +14,6 @@ function Test() {
1514
</StateContext.Provider>
1615
)
1716
}
18-
1917
test('Bottom Panel Contains Two Tabs: Code Preview and Component Tree', () => {
2018
render(<Test/>);
2119
expect(screen.getAllByRole('tab')).toHaveLength(2);

__tests__/HTMLPanel.test.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ import '@testing-library/jest-dom';
33
import { DndProvider } from 'react-dnd';
44
import { HTML5Backend } from 'react-dnd-html5-backend';
55
import { render, fireEvent, cleanup, screen } from '@testing-library/react';
6-
76
import StateContext from '../app/src/context/context';
87
import initialState from '../app/src/context/initialState';
98
import reducer from '../app/src/reducers/componentReducer';
109
import HTMLPanel from '../app/src/components/left/HTMLPanel';
11-
12-
1310
function Test() {
1411
const [state, dispatch] = useReducer(reducer, initialState);
1512
return (
@@ -20,8 +17,6 @@ function Test() {
2017
</DndProvider>
2118
)
2219
}
23-
24-
2520
test('Renders HTMLPanel component properly', () => {
2621
render(
2722
<Test/>
@@ -44,15 +39,12 @@ test('Adds new custom element', () => {
4439
render(
4540
<Test/>
4641
);
47-
4842
fireEvent.change(screen.getAllByRole('textbox')[0], {
4943
target: { value: 'Testing' }
5044
});
5145
fireEvent.change(screen.getAllByRole('textbox')[1], {
5246
target: { value: 'Testing' }
5347
});
54-
5548
fireEvent.click(screen.getByDisplayValue('Add Element'));
56-
5749
expect(screen.getByText('Testing')).toBeInTheDocument();
5850
});

__tests__/componentReducer.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,25 +218,19 @@ describe('Testing componentReducer functionality', () => {
218218
expect(state.components[focusIndex].future.length).toEqual(1);
219219
})
220220
});
221-
222-
223221
// TEST 'REDO'
224222
describe('REDO reducer', () => {
225223
it('should remove the last element from the future array and push it to the past array', () => {
226224
const focusIndex = state.canvasFocus.componentId - 1;
227-
228225
const actionRedo: Action = {
229226
type: 'REDO',
230227
payload: {},
231228
};
232229
state = reducer(state, actionRedo);
233-
234230
expect(state.components[focusIndex].future.length).toEqual(0);
235231
expect(state.components[focusIndex].past.length).toEqual(1);
236232
})
237233
});
238-
239-
240234
// TEST 'RESET STATE'
241235
describe('RESET STATE reducer', () => {
242236
it('should reset project to initial state', () => {

__tests__/gql.projects.test.js renamed to __tests__/gql.projects.test.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ const { Mongoose } = require('mongoose');
22
const request = require('supertest');
33
const http = require('http');
44
const app = require('../server/server.js');
5-
65
const mock = require('../mockData');
7-
86
// tests user signup and login routes
97
describe('GraphQL tests', () => {
108
let server;
@@ -14,17 +12,14 @@ describe('GraphQL tests', () => {
1412
const makeCopyUserIdTest = '604333d10004ad51c899e250';
1513
const makeCopyUsernameTest = 'test1';
1614
let makeCopyProjId = '';
17-
1815
beforeAll((done) => {
1916
server = http.createServer(app);
2017
server.listen(done);
2118
});
22-
2319
afterAll((done) => {
2420
Mongoose.disconnect();
2521
server.close(done);
2622
});
27-
2823
// GraphQL Query
2924
describe('Testing GraphQL query', () => {
3025
it('getAllProjects should return more than 1 project by default', () => request(server)
@@ -35,7 +30,6 @@ describe('GraphQL tests', () => {
3530
})
3631
.expect(200)
3732
.then(res => expect(res.body.data.getAllProjects.length).toBeGreaterThanOrEqual(1)));
38-
3933
it('getAllProjects should return projects that matches the provided userId', () => request(server)
4034
.post('/graphql')
4135
.set('Content-Type', 'application/json')
@@ -48,7 +42,6 @@ describe('GraphQL tests', () => {
4842
.expect(200)
4943
.then(res => expect(res.body.data.getAllProjects[0].userId).toBe('604d21b2b61a1c95f2dc9105')));
5044
});
51-
5245
// GraphQL Mutation
5346
describe('Testing GraphQL mutation', () => {
5447
// Add likes
@@ -64,7 +57,6 @@ describe('GraphQL tests', () => {
6457
})
6558
.expect(200)
6659
.then(res => expect(res.body.data.addLike.likes).toBe(testNum)));
67-
6860
// Publish project
6961
it('Should set the "published" on the project document to TRUE', () => request(server)
7062
.post('/graphql')
@@ -78,7 +70,6 @@ describe('GraphQL tests', () => {
7870
})
7971
.expect(200)
8072
.then(res => expect(res.body.data.publishProject.published).toBe(true)));
81-
8273
it('Should set the "published" on the project document to FALSE', () => request(server)
8374
.post('/graphql')
8475
.set('Content-Type', 'application/json')
@@ -91,7 +82,6 @@ describe('GraphQL tests', () => {
9182
})
9283
.expect(200)
9384
.then(res => expect(res.body.data.publishProject.published).toBe(false)));
94-
9585
// Make copy
9686
it('Should make a copy of an existing project and change the userId and userName', () => request(server)
9787
.post('/graphql')
File renamed without changes.
File renamed without changes.
File renamed without changes.

app/electron/main.js

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const {
1919

2020

2121
// The splash screen is what appears while the app is loading
22-
const { initSplashScreen, OfficeTemplate } = require('electron-splashscreen');
22+
// const { initSplashScreen, OfficeTemplate } = require('electron-splashscreen');
2323
const { resolve } = require('app-root-path');
2424

2525
// to install react dev tool extension
@@ -49,14 +49,10 @@ let menuBuilder;
4949
async function createWindow() {
5050
// install react dev tools if we are in development mode
5151
if (isDev) {
52-
await installExtension([REACT_DEVELOPER_TOOLS])
53-
.then(name => console.log(`Added Extension: ${name}`))
54-
.catch(err => console.log('An error occurred: ', err));
5552
} else {
5653
// this will happen before creating the browser window. it returns a Boolean whether the protocol of scheme 'app://' was successfully registered and a file (index-prod.html) was sent as the response
5754
protocol.registerBufferProtocol(Protocol.scheme, Protocol.requestHandler);
5855
}
59-
6056
// Create the browser window.
6157
win = new BrowserWindow({
6258
// full screen
@@ -69,7 +65,6 @@ async function createWindow() {
6965
// the browser window will not display initially as it's loading
7066
// once the browser window renders, a function is called below that hides the splash screen and displays the browser window
7167
show: false,
72-
// icon: path.join(__dirname, '../src/public/icons/png/256x256.png'),
7368
webPreferences: {
7469
zoomFactor: 0.7,
7570
// enable devtools when in development mode
@@ -79,7 +74,7 @@ async function createWindow() {
7974
// web workers will not have access to node
8075
nodeIntegrationInWorker: false,
8176
// disallow experimental feature to allow node.js support in sub-frames (i-frames/child windows)
82-
nodeIntegrationInSubFrames: false,
77+
nodeIntegrationInSubFrames: true,
8378
// runs electron apis and preload script in a separate JS context
8479
// separate context has access to document/window but has it's own built-ins and is isolate from changes to global environment by located page
8580
// Electron API only available from preload, not loaded page
@@ -93,20 +88,19 @@ async function createWindow() {
9388
});
9489

9590
// Splash screen that appears while loading
96-
const hideSplashscreen = initSplashScreen({
97-
mainWindow: win,
98-
icon: resolve('app/src/public/icons/png/64x64.png'),
99-
url: OfficeTemplate,
100-
width: 500,
101-
height: 300,
102-
brand: 'OS Labs',
103-
productName: 'ReacType',
104-
logo: resolve('app/src/public/icons/png/64x64.png'),
105-
color: '#3BBCAF',
106-
website: 'www.reactype.io',
107-
text: 'Initializing ...',
108-
});
109-
91+
// const hideSplashscreen = initSplashScreen({
92+
// mainWindow: win,
93+
// icon: resolve('app/src/public/icons/png/64x64.png'),
94+
// url: OfficeTemplate,
95+
// width: 500,
96+
// height: 300,
97+
// brand: 'OS Labs',
98+
// productName: 'ReacType',
99+
// logo: resolve('app/src/public/icons/png/64x64.png'),
100+
// color: '#3BBCAF',
101+
// website: 'www.reactype.io',
102+
// text: 'Initializing ...',
103+
// });
110104
// Load app
111105
if (isDev) {
112106
// load app from web-dev server
@@ -119,7 +113,6 @@ async function createWindow() {
119113
// load page once window is loaded
120114
win.once('ready-to-show', () => {
121115
win.show();
122-
hideSplashscreen();
123116
});
124117

125118
// automatically open DevTools when opening the app
@@ -381,7 +374,6 @@ ipcMain.on('delete_cookie', event => {
381374
session.defaultSession.cookies
382375
.remove(serverUrl, 'ssid')
383376
// .then(removed => {
384-
// console.log('Cookies deleted', removed);
385377
// })
386378
.catch(err => console.log('Error deleting cookie:', err));
387379
});

app/electron/menu.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ var MenuBuilder = function(mainWindow, appName) {
6464

6565
let defaultTemplate = function() {
6666
return [
67-
// { role: "appMenu" }
6867
...(isMac
6968
? [
7069
{

0 commit comments

Comments
 (0)