diff --git a/.gitignore b/.gitignore index 9b502ce..5bb986e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ npm-debug.log yarn-error.log dist/ +release/ diff --git a/README.md b/README.md index 91ba614..a96474e 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,17 @@ -ReactNativeRX +ReactNative === -# Run +This is a GUI for running React Native commands. It is built with electron so it works on Linux, Mac and Windows. -```javascript -reactors run web -reactors run desktop -reactors run ios -reactors run android -``` +# Downloads -# Upgrade +[v0.1.1](http://v1.1.1) is out! Choose your weapon. -```javascript -reactors run web -reactors run desktop -reactors run ios -reactors run android -``` -More info about [reactors](https://github.com/co2-git/reactors). +[Mac](https://drive.google.com/open?id=12GdTnRph5DMrAj5b8Kmntykm0lXbOcT-) +[Windows](http://google.es) +[Linux](https://drive.google.com/open?id=1F5Luv13r9QkX8MDCqUN1NtyPN3FFHKaQ) + +# Screenshots + +![alt text](https://raw.githubusercontent.com/co2-git/ReactNative/master/assets/screenshots/v0.1.1/Home.png) diff --git a/app/components/Terminal/Console.js b/app/components/Terminal/Console.js index 42d694d..251f8a4 100644 --- a/app/components/Terminal/Console.js +++ b/app/components/Terminal/Console.js @@ -49,7 +49,10 @@ class Terminal extends PureComponent<$TerminalProps, $TerminalState> { inputHandler(data.message, this.ps); } })); - this.ps.on('error', error => this.setState({error})); + this.ps.on('error', (error) => { + console.log(error.stack); + this.setState({error}); + }); this.ps.on('done', () => this.setState({done: true, code: 0}, () => { if (typeof this.props.onDone === 'function') { this.props.onDone(); @@ -125,13 +128,13 @@ export default Terminal; const styles = { console: { - padding: 10, backgroundColor: '#000', + borderRadius: 8, + boxShadow: '1px 1px 2px 2px rgba(0, 0, 0, 0.25)', color: '#fff', - maxHeight: 300, marginTop: 12, - borderRadius: 8, + maxHeight: 300, overflow: 'auto', - boxShadow: '1px 1px 2px 2px rgba(0, 0, 0, 0.25)', + padding: 10, }, }; diff --git a/app/index.js b/app/index.js index 624e8bf..1e9ead8 100644 --- a/app/index.js +++ b/app/index.js @@ -1,9 +1,12 @@ // @flow import React from 'react'; import ReactDOM from 'react-dom'; +import fixPath from 'fix-path'; import App from './App'; +fixPath(); + const root = document.getElementById('root'); ReactDOM.render(, root); diff --git a/app/lib/exec.js b/app/lib/exec.js index 12a3e20..ac691ec 100644 --- a/app/lib/exec.js +++ b/app/lib/exec.js @@ -4,42 +4,46 @@ import Emitter from 'events'; const $spawn = (cmd, options = {}) => { const emitter = new Emitter(); setTimeout(() => { - const [entry, ...bits] = cmd.trim().split(/\s+/); - const ps = spawn(entry, bits, options); - let done = false; - emitter.emit('pid', ps.pid); - ps - .on('error', error => emitter.emit('error', error)) - .on('exit', (status) => { - done = true; - if (status === 0) { - emitter.emit('done'); - } else { - emitter.emit('failed', status); - } - }) - .on('close', (status) => { - if (!done) { + try { + const [entry, ...bits] = cmd.trim().split(/\s+/); + const ps = spawn(entry, bits, options); + let done = false; + emitter.emit('pid', ps.pid); + ps + .on('error', error => emitter.emit('error', error)) + .on('exit', (status) => { done = true; if (status === 0) { emitter.emit('done'); } else { emitter.emit('failed', status); } - } - }); - ps.stdout.on('data', data => emitter.emit('data', { - std: 'out', - buffer: data, - message: data.toString(), - })); - ps.stderr.on('data', data => emitter.emit('data', { - std: 'err', - buffer: data, - message: data.toString(), - })); - emitter.on('write', message => ps.stdin.write(message)); - emitter.on('kill', () => $spawn(`kill -9 ${ps.pid}`)); + }) + .on('close', (status) => { + if (!done) { + done = true; + if (status === 0) { + emitter.emit('done'); + } else { + emitter.emit('failed', status); + } + } + }); + ps.stdout.on('data', data => emitter.emit('data', { + std: 'out', + buffer: data, + message: data.toString(), + })); + ps.stderr.on('data', data => emitter.emit('data', { + std: 'err', + buffer: data, + message: data.toString(), + })); + emitter.on('write', message => ps.stdin.write(message)); + emitter.on('kill', () => $spawn(`kill -9 ${ps.pid}`)); + } catch (error) { + console.log(error.stack); + } }); return emitter; }; diff --git a/assets/screenshots/v0.1.1/Home.png b/assets/screenshots/v0.1.1/Home.png new file mode 100644 index 0000000..6f46f8c Binary files /dev/null and b/assets/screenshots/v0.1.1/Home.png differ diff --git a/index.html b/index.html index 060c096..d1437fe 100644 --- a/index.html +++ b/index.html @@ -8,6 +8,13 @@ font: 12px/1.5em 'Trebuchet MS', Trebuchet, sans-serif; background-color: #eee; } + #splash { + height: 100vh; + width: 100vw; + display: flex; + justify-content: center; + align-items: center; + }
- +
+ +