Skip to content

Commit 68c7cd6

Browse files
committed
Added new initiate project using nwb (#8)
1 parent 72a473e commit 68c7cd6

15 files changed

+158
-256
lines changed

.DS_Store

6 KB
Binary file not shown.

.babelrc

-9
This file was deleted.

.gitignore

+7-58
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,8 @@
1-
# Logs
2-
logs
3-
*.log
1+
/coverage
2+
/demo/dist
3+
/es
4+
/lib
5+
/node_modules
6+
/umd
47
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
8-
# Runtime data
9-
pids
10-
*.pid
11-
*.seed
12-
*.pid.lock
13-
14-
# Directory for instrumented libs generated by jscoverage/JSCover
15-
lib-cov
16-
17-
# Coverage directory used by tools like istanbul
18-
coverage
19-
20-
# nyc test coverage
21-
.nyc_output
22-
23-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24-
.grunt
25-
26-
# Bower dependency directory (https://bower.io/)
27-
bower_components
28-
29-
# node-waf configuration
30-
.lock-wscript
31-
32-
# Compiled binary addons (http://nodejs.org/api/addons.html)
33-
build/Release
34-
35-
# Dependency directories
36-
node_modules/
37-
jspm_packages/
38-
39-
# Typescript v1 declaration files
40-
typings/
41-
42-
# Optional npm cache directory
43-
.npm
44-
45-
# Optional eslint cache
46-
.eslintcache
47-
48-
# Optional REPL history
49-
.node_repl_history
50-
51-
# Output of 'npm pack'
52-
*.tgz
53-
54-
# Yarn Integrity file
55-
.yarn-integrity
56-
57-
# dotenv environment variables file
58-
.env
59-
.DS_Store
8+
.DS_Store

.nvmrc

-1
This file was deleted.

.travis.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
sudo: false
2+
3+
language: node_js
4+
node_js:
5+
- 6
6+
7+
before_install:
8+
- npm install codecov.io coveralls
9+
10+
after_success:
11+
- cat ./coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js
12+
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
13+
14+
branches:
15+
only:
16+
- master

CONTRIBUTING.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Prerequisites
2+
3+
[Node.js](http://nodejs.org/) >= v4 must be installed.
4+
5+
## Installation
6+
7+
- Running `npm install` in the components's root directory will install everything you need for development.
8+
9+
## Demo Development Server
10+
11+
- `npm start` will run a development server with the component's demo app at [http://localhost:3000](http://localhost:3000) with hot module reloading.
12+
13+
## Running Tests
14+
15+
- `npm test` will run the tests once.
16+
17+
- `npm run test:coverage` will run the tests and produce a coverage report in `coverage/`.
18+
19+
- `npm run test:watch` will run the tests on every change.
20+
21+
## Building
22+
23+
- `npm run build` will build the component for publishing to npm and also bundle the demo app.
24+
25+
- `npm run clean` will delete built resources.

README.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
11
# pagination-react
2-
Simple pagination component for React + apps.
2+
3+
[![Travis][build-badge]][build]
4+
[![npm package][npm-badge]][npm]
5+
[![Coveralls][coveralls-badge]][coveralls]
6+
7+
Describe pagination-react here.
8+
9+
[build-badge]: https://img.shields.io/travis/user/repo/master.png?style=flat-square
10+
[build]: https://travis-ci.org/user/repo
11+
12+
[npm-badge]: https://img.shields.io/npm/v/npm-package.png?style=flat-square
13+
[npm]: https://www.npmjs.org/package/npm-package
14+
15+
[coveralls-badge]: https://img.shields.io/coveralls/user/repo/master.png?style=flat-square
16+
[coveralls]: https://coveralls.io/github/user/repo

build/index.js

-127
This file was deleted.

demo/src/index.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React, {Component} from 'react'
2+
import {render} from 'react-dom'
3+
4+
import Example from '../../src'
5+
6+
class Demo extends Component {
7+
render() {
8+
return <div>
9+
<h1>pagination-react Demo</h1>
10+
<Example/>
11+
</div>
12+
}
13+
}
14+
15+
render(<Demo/>, document.querySelector('#demo'))

nwb.config.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
type: 'react-component',
3+
npm: {
4+
esModules: true,
5+
umd: {
6+
global: 'PaginationReact',
7+
externals: {
8+
react: 'React'
9+
}
10+
}
11+
}
12+
}

package.json

+32-25
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,37 @@
11
{
2-
"name": "ngx-react-pagination",
3-
"version": "0.0.1",
4-
"description": "Put a description here",
5-
"main": "build/index.js",
6-
"peerDependencies": {
7-
"react": "^15.5.4"
8-
},
9-
"dependencies": {
10-
"react": "^15.5.4",
11-
"webpack": "^2.6.1"
12-
},
2+
"name": "pagination-react",
3+
"version": "1.0.0",
4+
"description": "pagination-react React component",
5+
"main": "lib/index.js",
6+
"module": "es/index.js",
7+
"files": [
8+
"css",
9+
"es",
10+
"lib",
11+
"umd"
12+
],
1313
"scripts": {
14-
"test": "echo \"Error: no test specified\" && exit 1",
15-
"start": "webpack --watch",
16-
"build": "webpack"
14+
"build": "nwb build-react-component",
15+
"clean": "nwb clean-module && nwb clean-demo",
16+
"start": "nwb serve-react-demo",
17+
"test": "nwb test-react",
18+
"test:coverage": "nwb test-react --coverage",
19+
"test:watch": "nwb test-react --server"
1720
},
18-
"author": {
19-
"name": "Your name",
20-
"email": "your email"
21+
"dependencies": {},
22+
"peerDependencies": {
23+
"react": "15.x"
2124
},
2225
"devDependencies": {
23-
"babel-cli": "^6.24.1",
24-
"babel-core": "^6.24.1",
25-
"babel-loader": "^7.0.0",
26-
"babel-plugin-transform-object-rest-spread": "^6.23.0",
27-
"babel-plugin-transform-react-jsx": "^6.24.1",
28-
"babel-preset-env": "^1.5.1"
29-
}
30-
}
26+
"nwb": "0.18.x",
27+
"react": "^15.6.1",
28+
"react-dom": "^15.6.1"
29+
},
30+
"author": "",
31+
"homepage": "",
32+
"license": "MIT",
33+
"repository": "",
34+
"keywords": [
35+
"react-component"
36+
]
37+
}

src/index.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React from 'react';
2-
class Pagination extends React.Component {
3-
render() {
4-
return (
5-
<div>Pagination goes here</div>
6-
);
7-
}
1+
import React, {Component} from 'react'
2+
3+
export default class extends Component {
4+
render() {
5+
return <div>
6+
<h2>Welcome to React components</h2>
7+
</div>
8+
}
89
}
9-
export default Pagination;

tests/.eslintrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"env": {
3+
"mocha": true
4+
}
5+
}

0 commit comments

Comments
 (0)