Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
Created with `nwb new react-app react-nwb-github-issues`
  • Loading branch information
insin committed Dec 6, 2015
0 parents commit b7559f5
Show file tree
Hide file tree
Showing 10 changed files with 142 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/coverage
/node_modules
/public/build
npm-debug.log
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 <repository-url>` 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)
4 changes: 4 additions & 0 deletions nwb.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
// Let nwb know this is a React app when generic build commands are used
type: 'react-app'
}
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": ""
}
17 changes: 17 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>react-nwb-github-issues</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="build/vendor.css">
<link rel="stylesheet" href="build/app.css">
</head>
<body>
<div id="app"></div>
<script src="build/vendor.js"></script>
<script src="build/app.js"></script>
</body>
</html>
9 changes: 9 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

export default React.createClass({
render() {
return <div>
<h2>Welcome to React</h2>
</div>
}
})
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react'
import {render} from 'react-dom'

import App from './App'

render(<App/>, document.querySelector('#app'))
5 changes: 5 additions & 0 deletions tests/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"env": {
"mocha": true
}
}
23 changes: 23 additions & 0 deletions tests/App-test.js
Original file line number Diff line number Diff line change
@@ -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(<App/>, node, () => {
expect(node.innerHTML).toContain('Welcome to React')
})
})
})

0 comments on commit b7559f5

Please sign in to comment.