From eca1edf0943aa1531f41542508fa8504c96bc491 Mon Sep 17 00:00:00 2001 From: syn Date: Mon, 23 Dec 2019 22:58:41 +0300 Subject: Initial commit from nwb v0.23.0 --- .gitignore | 4 ++++ .travis.yml | 16 ++++++++++++++++ CONTRIBUTING.md | 27 +++++++++++++++++++++++++++ README.md | 3 +++ nwb.config.js | 3 +++ package.json | 24 ++++++++++++++++++++++++ public/.gitkeep | 0 src/App.css | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/App.js | 19 +++++++++++++++++++ src/index.css | 8 ++++++++ src/index.html | 13 +++++++++++++ src/index.js | 8 ++++++++ src/react.svg | 35 +++++++++++++++++++++++++++++++++++ tests/.eslintrc | 5 +++++ tests/App-test.js | 23 +++++++++++++++++++++++ 15 files changed, 236 insertions(+) create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 CONTRIBUTING.md create mode 100644 README.md create mode 100644 nwb.config.js create mode 100644 package.json create mode 100644 public/.gitkeep create mode 100644 src/App.css create mode 100644 src/App.js create mode 100644 src/index.css create mode 100644 src/index.html create mode 100644 src/index.js create mode 100644 src/react.svg create mode 100644 tests/.eslintrc create mode 100644 tests/App-test.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..95c5d52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/coverage +/dist +/node_modules +npm-debug.log* diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..06e30d9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +sudo: false + +language: node_js +node_js: + - 8 + +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/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..dd641ce --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,27 @@ +## Prerequisites + +[Node.js](http://nodejs.org/) >= 6 must be installed. + +## Installation + +- Running `npm install` in the app's root directory will install everything you need for development. + +## Development Server + +- `npm start` will run the app's development server at [http://localhost:3000](http://localhost:3000) with hot module reloading. + +## Running Tests + +- `npm test` will run the tests once. + +- `npm run test:coverage` will run the tests and produce a coverage report in `coverage/`. + +- `npm run test:watch` will run the tests on every change. + +## Building + +- `npm run build` creates a production build by default. + + To create a development build, set the `NODE_ENV` environment variable to `development` while running this command. + +- `npm run clean` will delete built resources. diff --git a/README.md b/README.md new file mode 100644 index 0000000..73f395d --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# fcked-rt + +Describe fcked-rt here. diff --git a/nwb.config.js b/nwb.config.js new file mode 100644 index 0000000..89ee4a9 --- /dev/null +++ b/nwb.config.js @@ -0,0 +1,3 @@ +module.exports = { + type: 'react-app' +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..b6f25e0 --- /dev/null +++ b/package.json @@ -0,0 +1,24 @@ +{ + "name": "fcked-rt", + "version": "1.0.0", + "description": "Describe fcked-rt here", + "private": true, + "scripts": { + "build": "nwb build-react-app", + "clean": "nwb clean-app", + "start": "nwb serve-react-app", + "test": "nwb test-react", + "test:coverage": "nwb test-react --coverage", + "test:watch": "nwb test-react --server" + }, + "dependencies": { + "react": "^16.12.0", + "react-dom": "^16.12.0" + }, + "devDependencies": { + "nwb": "0.23.x" + }, + "author": "", + "license": "MIT", + "repository": "" +} diff --git a/public/.gitkeep b/public/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/App.css b/src/App.css new file mode 100644 index 0000000..3837551 --- /dev/null +++ b/src/App.css @@ -0,0 +1,48 @@ +.App { + height: 100%; + min-height: 400px; + text-align: center; + display: flex; + flex-direction: column; + justify-content: stretch; +} + +.App-flex { + flex: 1; + display: flex; + align-items: center; + justify-content: center; +} + +.App-heading { + background-color: #222; + color: #f8f8f8; + font-size: 6vh; + box-shadow: 0px 4px 4vh 4px rgba(34,34,34,0.9); + z-index: 2; +} + +.App-react { + color: #00d8ff; + text-decoration: overline underline; +} + +.App-logo { + max-height: 30vh; + max-width: 30vh; +} + +.App-instructions { + background-color: #f8f8f8; + color: #222; + font-size: 3vh; + line-height: 1.5; + padding: 0 1em; +} + +.App-instructions code { + background-color: #222; + color: #00d8ff; + padding: .2em .3em; + border-radius: .2em; +} diff --git a/src/App.js b/src/App.js new file mode 100644 index 0000000..b890840 --- /dev/null +++ b/src/App.js @@ -0,0 +1,19 @@ +import './App.css' + +import React, {Component} from 'react' + +class App extends Component { + render() { + return
+
+

Welcome to React

+
+
+ +

Edit src/App.js and save to hot reload your changes.

+
+
+ } +} + +export default App diff --git a/src/index.css b/src/index.css new file mode 100644 index 0000000..8f8b785 --- /dev/null +++ b/src/index.css @@ -0,0 +1,8 @@ +html, body, #app { + height: 100%; +} +body { + font-family: sans-serif; + margin: 0; + padding: 0; +} diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..d0bdd15 --- /dev/null +++ b/src/index.html @@ -0,0 +1,13 @@ + + + + + + + fcked-rt + + + +
+ + diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..6223095 --- /dev/null +++ b/src/index.js @@ -0,0 +1,8 @@ +import './index.css' + +import React from 'react' +import {render} from 'react-dom' + +import App from './App' + +render(, document.querySelector('#app')) diff --git a/src/react.svg b/src/react.svg new file mode 100644 index 0000000..467e1dc --- /dev/null +++ b/src/react.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + 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..367dfea --- /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.textContent).toContain('Welcome to React') + }) + }) +}) -- cgit v1.2.1-18-gbd029