Skip to content

Commit 6082e75

Browse files
authored
Merge pull request #2 from co2-git/V0.1.2
V0.1.2
2 parents 44d080a + 69debfa commit 6082e75

File tree

9 files changed

+608
-51
lines changed

9 files changed

+608
-51
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"presets": ["env", "react", "stage-0"]
2+
"presets": ["env", "react", "stage-0"],
3+
"plugins": ["dynamic-import-node"]
34
}

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
ReactNative
22
===
33

4-
This is a GUI for running React Native commands. It is built with electron so it works on Linux, Mac and Windows.
4+
GUI client for React Native. It is built with electron so it works on Linux, Mac and Windows.
55

66
# Downloads
77

8-
[v0.1.1](http://v1.1.1) is out! Choose your weapon.
8+
v0.1.2 is out! Choose your weapon.
99

1010

11-
[<img alt="Mac" src="http://clinsite.com/wp-content/uploads/2017/01/Apple-logo-120x120.png" />](https://drive.google.com/open?id=12GdTnRph5DMrAj5b8Kmntykm0lXbOcT-)
12-
[<img alt="Windows" src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Windows_logo_-_2012_derivative.svg/120px-Windows_logo_-_2012_derivative.svg.png" />](http://google.es)
13-
[<img alt="Linux" src="http://www.linuxscrew.com/wp-content/uploads/2007/11/120px-crystal_128_penguin.png" />](https://drive.google.com/open?id=1F5Luv13r9QkX8MDCqUN1NtyPN3FFHKaQ)
11+
[<img alt="Mac" src="http://clinsite.com/wp-content/uploads/2017/01/Apple-logo-120x120.png" />](https://drive.google.com/open?id=10mNTPIkciCO3VkkUY_HjCLORsRZDc3lJ)
12+
[<img alt="Windows" src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Windows_logo_-_2012_derivative.svg/120px-Windows_logo_-_2012_derivative.svg.png" />](https://drive.google.com/open?id=120US9Yz6VownTAS6x2Ts_im6HdK4xO8H)
13+
[<img alt="Linux" src="http://www.linuxscrew.com/wp-content/uploads/2007/11/120px-crystal_128_penguin.png" />](https://drive.google.com/open?id=1-uZPb7VMFt0K8A9-P9ybmYRReLNZY-g2)
1414

1515
# Screenshots
1616

1717
## Home screen
1818

19-
![Home](https://raw.githubusercontent.com/co2-git/ReactNative/master/assets/screenshots/v0.1.1/Home.png)
19+
![Home](https://raw.githubusercontent.com/co2-git/ReactNative/master/assets/screenshots/v0.1.2/Home.png)
2020

2121
## Init app
2222

@@ -27,3 +27,15 @@ This is a GUI for running React Native commands. It is built with electron so it
2727
### Interactive terminal
2828

2929
![Init app terminal](https://raw.githubusercontent.com/co2-git/ReactNative/master/assets/screenshots/v0.1.1/Init_App_Terminal.png)
30+
31+
# License
32+
33+
The MIT License (MIT)
34+
35+
Copyright (c) 2018 Francois V (https://francoisv.herokuapp.com/)
36+
37+
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:
38+
39+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
40+
41+
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.

app/components/Layout/AppCard.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
// @flow
22
import React, {PureComponent} from 'react';
3-
import {Card, CardHeader} from 'material-ui/Card';
3+
import {Card, CardHeader, CardActions} from 'material-ui/Card';
44
import path from 'path';
5+
import RaisedButton from 'material-ui/RaisedButton';
6+
import CloseIcon from 'material-ui/svg-icons/navigation/close';
57

68
import Animated from '../Base/Animated';
9+
import {closeApp} from '../../redux/actions/appsActions';
710

811
type $AppCardOwnProps = {
912
app: $App,
@@ -28,6 +31,13 @@ class AppCard extends PureComponent<$AppCardProps> {
2831
actAsExpander
2932
showExpandableButton={false}
3033
/>
34+
<CardActions>
35+
<RaisedButton
36+
label="Remove app from list"
37+
icon={<CloseIcon style={{marginTop: -4}} />}
38+
onClick={() => closeApp(this.props.app)}
39+
/>
40+
</CardActions>
3141
</Card>
3242
</Animated>
3343
);

app/redux/actions/appsActions.js

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
// eslint-disable-next-line import/no-unresolved, import/extensions
12
import {remote} from 'electron';
23
import first from 'lodash/first';
34
import find from 'lodash/find';
45

56
import store from '../store';
67
import * as types from '../types';
7-
import {read, stat} from '../../helpers/fsHelpers';
88

99
export const openApp = async (appPath, cb) => {
1010
try {
@@ -13,7 +13,7 @@ export const openApp = async (appPath, cb) => {
1313
path = appPath;
1414
} else {
1515
const directories = await remote.dialog.showOpenDialog({
16-
properties: ['openDirectory']
16+
properties: ['openDirectory'],
1717
});
1818
if (directories) {
1919
path = first(directories);
@@ -29,24 +29,22 @@ export const openApp = async (appPath, cb) => {
2929
}
3030
});
3131
}
32-
store.dispatch({type: types.OPEN_APP, payload: {path}});
33-
store.dispatch({type: types.SELECT_APP, payload: {path}});
3432
try {
35-
const stats = await stat(`${path}/package.json`);
36-
store.dispatch({type: types.APP_HAS_PACKAGE, payload: {path, hasPackage: true}});
33+
const info = await import(`${path}/package.json`);
34+
store.dispatch({type: types.OPEN_APP, payload: {path, info}});
3735
} catch (error) {
38-
if (error.code === 'ENOENT') {
39-
store.dispatch({type: types.APP_HAS_PACKAGE, payload: {path, hasPackage: false}});
40-
} else {
41-
throw error;
42-
}
36+
store.dispatch({
37+
type: types.ERROR,
38+
payload: {
39+
error: new Error(`${path} is not a React Native app`),
40+
},
41+
});
4342
}
4443
}
4544
} catch (error) {
46-
console.log(error.stack);
4745
store.dispatch({type: types.ERROR, payload: {error}});
4846
}
49-
}
47+
};
5048

5149
export const closeApp = async (app) => {
5250
try {
@@ -55,20 +53,3 @@ export const closeApp = async (app) => {
5553
store.dispatch({type: types.ERROR, payload: {error}});
5654
}
5755
};
58-
59-
export const openBase = async () => {
60-
try {
61-
let path;
62-
const directories = await remote.dialog.showOpenDialog({
63-
properties: ['openDirectory']
64-
});
65-
if (directories) {
66-
path = first(directories);
67-
}
68-
if (path) {
69-
}
70-
} catch (error) {
71-
console.log(error.stack);
72-
store.dispatch({type: types.ERROR, payload: {error}});
73-
}
74-
};

assets/icons/icon.ico

66.1 KB
Binary file not shown.

assets/screenshots/v0.1.2/Home.png

116 KB
Loading

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{
22
"name": "ReactNative",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"scripts": {
55
"start": "electron main.js",
66
"babel": "babel --out-dir dist/ app/",
77
"build": "bash scripts/build.sh $npm_package_name $npm_package_version",
88
"build:osx": "yarn build darwin",
99
"build:linux": "yarn build linux",
10-
"build:windows": "yarn build win32"
10+
"build:windows": "yarn build win32",
11+
"build:all": "npm-run-parallel build:osx build:linux build:windows"
1112
},
1213
"dependencies": {
1314
"babel-polyfill": "^6.26.0",
15+
"chokidar": "^2.0.3",
1416
"fix-path": "^2.1.0",
1517
"lodash": "^4.17.5",
1618
"material-ui": "^0.20.0",
@@ -27,6 +29,8 @@
2729
"babel-core": "^6.26.0",
2830
"babel-eslint": "^8.2.3",
2931
"babel-loader": "^7.1.2",
32+
"babel-plugin-dynamic-import-node": "^1.2.0",
33+
"babel-plugin-syntax-dynamic-import": "^6.18.0",
3034
"babel-plugin-syntax-flow": "^6.18.0",
3135
"babel-preset-electron": "^1.4.15",
3236
"babel-preset-env": "^1.6.1",

scripts/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
APP_NAME="$1"
33
APP_VERSION="$2"
44
PLATFORM=${3:-all}
5-
ELECTRON_VERSION=1.7.0
5+
ELECTRON_VERSION=1.8.4
66

77
electron-packager . $APP_NAME \
88
--electron-version=$ELECTRON_VERSION \
99
--platform=$PLATFORM \
1010
--version=$ELECTRON_VERSION \
1111
--icon=assets/icons/icon \
1212
--out=release/$APP_VERSION \
13-
--ignore=release
13+
--ignore=release \
1414
--ignore=assets/screenshots

0 commit comments

Comments
 (0)