diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f779468 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/coverage +/node_modules +/public/build +npm-debug.log diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..e3313b3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,20 @@ +sudo: false + +language: node_js +node_js: + - 4.2 + +cache: + directories: + - node_modules + +before_install: + - npm install codecov.io coveralls + +after_success: + - cat ./coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js + - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +branches: + only: + - master diff --git a/README.md b/README.md new file mode 100644 index 0000000..0fa2953 --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# react-nwb-github-issues + +Collaborating on this React app: + +## Prerequisites + +You will need the following things properly installed on your computer. + +* [Git](http://git-scm.com/) +* [Node.js](http://nodejs.org/) (with npm) +* [nwb](https://github.com/insin/nwb/) - `npm install -g nwb` + +## Installation + +* `git clone ` this repository +* change into the new directory +* `npm install` + +## Running / Development + +* `nwb serve` will run the app +* Visit the app at [http://localhost:3000](http://localhost:3000) + +### Running Tests + +* `nwb test` will run the tests once +* `nwb test --server` will run the tests on every change + +### Building + +* `nwb build` (production) +* `nwb build --set-env-NODE_ENV=development` (development) diff --git a/nwb.config.js b/nwb.config.js new file mode 100644 index 0000000..7aa5e9a --- /dev/null +++ b/nwb.config.js @@ -0,0 +1,4 @@ +module.exports = { + // Let nwb know this is a React app when generic build commands are used + type: 'react-app' +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..aeb4ce3 --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "react-nwb-github-issues", + "version": "0.0.1", + "description": "Describe react-nwb-github-issues here", + "private": true, + "scripts": { + "build": "nwb build", + "clean": "nwb clean", + "start": "nwb serve", + "test": "nwb test" + }, + "dependencies": { + "react": "~0.14.0", + "react-dom": "~0.14.0" + }, + "devDependencies": { + "nwb": "~0.3.0-beta.0" + }, + "author": "", + "license": "MIT", + "repository": "" +} diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..fd669cc --- /dev/null +++ b/public/index.html @@ -0,0 +1,17 @@ + + + + + + react-nwb-github-issues + + + + + + +
+ + + + diff --git a/src/App.js b/src/App.js new file mode 100644 index 0000000..0cb2814 --- /dev/null +++ b/src/App.js @@ -0,0 +1,9 @@ +import React from 'react' + +export default React.createClass({ + render() { + return
+

Welcome to React

+
+ } +}) diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..0d9725d --- /dev/null +++ b/src/index.js @@ -0,0 +1,6 @@ +import React from 'react' +import {render} from 'react-dom' + +import App from './App' + +render(, document.querySelector('#app')) diff --git a/tests/.eslintrc b/tests/.eslintrc new file mode 100644 index 0000000..7eeefc3 --- /dev/null +++ b/tests/.eslintrc @@ -0,0 +1,5 @@ +{ + "env": { + "mocha": true + } +} diff --git a/tests/App-test.js b/tests/App-test.js new file mode 100644 index 0000000..7b20f32 --- /dev/null +++ b/tests/App-test.js @@ -0,0 +1,23 @@ +import expect from 'expect' +import React from 'react' +import {render, unmountComponentAtNode} from 'react-dom' + +import App from 'src/App' + +describe('App component', () => { + let node + + beforeEach(() => { + node = document.createElement('div') + }) + + afterEach(() => { + unmountComponentAtNode(node) + }) + + it('displays a welcome message', () => { + render(, node, () => { + expect(node.innerHTML).toContain('Welcome to React') + }) + }) +})