Skip to content

Commit 7009606

Browse files
author
kenhughlee
committed
started save and open functionality
2 parents aa49811 + f8d6347 commit 7009606

File tree

11 files changed

+283
-180
lines changed

11 files changed

+283
-180
lines changed

LICENSE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright © 2017 React Primer. All Rights Reserved
2+
3+
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:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 54 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,93 @@
1-
# ReactPrimer
1+
<h1><center>ReactPrimer </center></h1>
2+
<p align="center">
3+
<img src="/assets/icons/png/128x128.png">
4+
</p>
25

3-
One Paragraph of project description goes here
6+
<p align="center">React Primer is component prototyping tool that generates fully connected class component code.</p>
7+
<p align="center">
8+
<img src="/assets/demo/demo_15mb.gif"/>
9+
</p>
410

5-
## Getting Started
11+
## Setup
612

7-
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
13+
###### MacOS
814

9-
### Prerequisites
15+
1. [Download](https://github.com/ReactPrimer/ReactPrimer/releases/download/0.0.0.0.2/ReactPrimer.dmg) the latest release .dmg file.
16+
2. Open the installer.
17+
3. Move React Primer to you local application folder.
1018

11-
What things you need to install the software and how to install them
19+
###### Linux
20+
1. [Download](https://github.com/ReactPrimer/ReactPrimer/releases/download/0.0.0.0.2/React-Primer_1.0.0_amd64.deb) the latest .deb file
21+
2. Unpackage the .deb file
22+
3. Find the executable in usr/lib/React-Primer
1223

13-
```
14-
Give examples
15-
```
24+
###### Windows
25+
*Coming Soon*
1626

17-
### Installing
27+
## Usage
1828

19-
A step by step series of examples that tell you have to get a development env running
29+
* Name individual components, assign parent-child relationships, and add components to the project tree.
2030

21-
Say what the step will be
31+
* Drag and drop individual components to restructure the hierarchy tree view.
2232

23-
```
24-
Give the example
25-
```
33+
* Export project to generate a folder of fully connected component classes.
2634

27-
And repeat
35+
* Save generated components locally to a new or existing project.
2836

29-
```
30-
until finished
31-
```
37+
## Forking Your Own Version
38+
**If you'd like to build your own version of React Primer:**
3239

33-
End with an example of getting some data out of the system or using it for a little demo
40+
1. Clone the repo and `npm install` dependancies.
3441

35-
## Running the tests
42+
2. Open one terminal and `npm run dev` to generate the webpack build.
3643

37-
Explain how to run the automated tests for this system
44+
3. Open another terminal and `npm start` to start Electron.
3845

39-
### Break down into end to end tests
46+
4. Uncomment line 23 `require('electron-reload')(__dirname);` for hot reloading (Optional).
4047

41-
Explain what these tests test and why
48+
3. Enable Devloper Tools (Optional).
4249

43-
```
44-
Give an example
45-
```
50+
&nbsp;&nbsp;&nbsp;&nbsp; *Chrome Developer Tool*
4651

47-
### And coding style tests
52+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a. Uncomment line 45 `mainWindow.webContents.openDevTools()`
4853

49-
Explain what these tests test and why
54+
&nbsp;&nbsp;&nbsp;&nbsp; *React Developer Tool*
55+
56+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a. Uncomment line 78 `const configValues = require('./config');`
57+
58+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b. Uncomment line 79 `BrowserWindow.addDevToolsExtension(configValues.absolutePath);`
59+
60+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c. Create `./config` in root directory:
5061

5162
```
52-
Give an example
63+
{
64+
"absolutePath": "/Users/*User*/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/2.5.2_0"
65+
}
5366
```
5467

55-
## Deployment
68+
## Why
69+
70+
React Primer provides a visual representation of your project during the preliminary stages of development, before you write a single line of code.
5671

57-
Add additional notes about how to deploy this on a live system
72+
This simple to use application saves time by generating component files that automatically require and render their child components based on the prototyped hierarchy.
5873

59-
## Built With
74+
React Primer’s component tree GUI makes it easy to test, edit, and re-export your component tree as many times as needed.
6075

61-
* [Dropwizard](http://www.dropwizard.io/1.0.2/docs/) - The web framework used
62-
* [Maven](https://maven.apache.org/) - Dependency Management
63-
* [ROME](https://rometools.github.io/rome/) - Used to generate RSS Feeds
6476

6577
## Contributing
6678

67-
Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.
6879

69-
## Versioning
80+
Please submit issues/pull requests if you have feedback or message the React Primer team to be added as a contributor: [email protected]
7081

7182

7283
## Authors
7384

74-
* *Kat* - https://github.com/ksampias
75-
* *Vince* - https://github.com/vincevuong
76-
* *Ken* - https://github.com/kenhughlee
85+
Ken Lee (https://github.com/kenhughlee)
7786

78-
## License
87+
Kat Sampias (https://github.com/ksampias)
7988

80-
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
89+
Vince Vuong (https://github.com/vincevuong)
8190

82-
## Acknowledgments
91+
## License
8392

84-
* Hat tip to anyone who's code was used
85-
* Inspiration
86-
* etc
93+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

assets/demo/demo_15mb.gif

15.5 MB
Loading

assets/logo/32x32.png

1.32 KB
Loading

assets/logo/48x48.png

2.31 KB
Loading

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<head>
55
<meta charset="UTF-8">
6-
<title>ReactPrimer</title>
6+
<title>RPrimer</title>
77
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans" rel="stylesheet">
88
<link rel="stylesheet" type="text/css" href="build/bundle.css">
99
</head>
@@ -13,4 +13,4 @@
1313
<script src='build/bundle.js'></script>
1414
</body>
1515

16-
</html>
16+
</html>

main.js

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ const electron = require('electron');
44
const app = electron.app
55
const BrowserWindow = electron.BrowserWindow
66
const IPC = require('electron').ipcMain;
7-
const { dialog, Menu } = require('electron');
7+
const { dialog } = require('electron');
8+
const Menu = electron.Menu;
9+
const openAboutWindow = require('about-window').default;
810

911
const path = require('path');
1012
const url = require('url');
@@ -13,10 +15,8 @@ const fs = require('fs');
1315
// file template generator function
1416
const fileContent = require('./fileContent.js');
1517
const flattenComponent = require('./flattenComponent.js');
16-
const openFile = require('./openFile.js');
17-
const saveFile = require('./saveFile.js');
1818

19-
require('electron-reload')(__dirname);
19+
// require('electron-reload')(__dirname);
2020
// Keep a global reference of the window object, if you don't, the window will
2121
// be closed automatically when the JavaScript object is garbage collected.
2222
let mainWindow
@@ -71,8 +71,28 @@ function createWindow() {
7171
slashes: true
7272
}))
7373

74+
// About React Primer window in menu
75+
const menu = Menu.buildFromTemplate([
76+
{
77+
label: 'React Primer',
78+
submenu: [
79+
{
80+
label: 'About React Primer',
81+
click: () => openAboutWindow({
82+
icon_path: path.join(__dirname, './assets/icons/png/256x256.png'),
83+
copyright: 'Copyright © 2017 React Primer. All Rights Reserved.',
84+
homepage: 'http://react-primer.com/',
85+
bug_report_url: 'https://github.com/ReactPrimer/ReactPrimer/issues',
86+
description: "React Prototyping Tool"
87+
})
88+
}
89+
]
90+
}
91+
]);
92+
Menu.setApplicationMenu(menu);
93+
7494
// Open the DevTools.
75-
mainWindow.webContents.openDevTools()
95+
//mainWindow.webContents.openDevTools()
7696

7797

7898

@@ -114,7 +134,7 @@ IPC.on('openFile',(event) =>{
114134
},
115135
filename => {
116136
fs.readFileSync(filename, data => {
117-
event.sender.send('fileData', data);
137+
IPC.send('fileData', data);
118138
})
119139
}
120140
)

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"dev": "webpack",
1010
"start": "electron .",
1111
"package-win": "electron-packager . --overwrite --asar=true --platform=win32 --arch=ia32 --icon=assets/icons/png/32x32.png --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"React Primer\"",
12-
"package-linux": "electron-packager . Reactprimer --overwrite --asar=true --platform=linux --arch=x64 --icon=assets/icons/png/256x256.png --prune=true --out=release-builds",
13-
"package-mac": "electron-packager . --overwrite --platform=darwin --arch=x64 --icon=assets/icons/mac/icon.icns --prune=true --out=release-builds",
1412
"create-installer-win": "node installers/windows/createinstaller.js",
13+
"package-linux": "electron-packager . Reactprimer --overwrite --asar=true --platform=linux --arch=x64 --icon=assets/icons/png/256x256.png --prune=true --out=release-builds",
1514
"create-debian-installer": "electron-installer-debian --src release-builds/Reactprimer-linux-x64/ --arch amd64 --config debian.json",
15+
"package-mac": "electron-packager . --overwrite --platform=darwin --arch=x64 --icon=assets/icons/mac/icon.icns --prune=true --out=release-builds",
1616
"installer-mac": "electron-installer-dmg ./release-builds/ReactPrimer-darwin-x64/ReactPrimer.app ReactPrimer"
1717
},
1818
"jest": {
@@ -46,7 +46,8 @@
4646
"file-loader": "^0.9.0",
4747
"identity-obj-proxy": "^3.0.0",
4848
"sinon": "^4.1.2",
49-
"webpack": "^2.2.1"
49+
"webpack": "^2.2.1",
50+
"about-window": "^1.8.0"
5051
},
5152
"dependencies": {
5253
"babel-preset-es2015": "^6.24.1",

0 commit comments

Comments
 (0)