Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Commit a3f7311

Browse files
committed
restructure demo and dependencies
1 parent 4bab534 commit a3f7311

File tree

13 files changed

+5437
-145
lines changed

13 files changed

+5437
-145
lines changed

.babelrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
"env",
4+
"react"
5+
],
6+
"plugins": [
7+
[
8+
"transform-object-rest-spread",
9+
"add-module-exports"
10+
]
11+
]
12+
}

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ node_modules/
55
.git/
66
src/
77
demo/
8+
webpack.config.js
9+
yarn.lock.js
10+
.postcssconfig
11+
.babelrc

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
# react-date-range
2-
![](https://badge.fury.io/js/react-date-range.svg)
3-
![](https://david-dm.org/Adphorus/react-date-range.svg)
4-
![](https://david-dm.org/Adphorus/react-date-range/dev-status.svg)
2+
[![npm](https://img.shields.io/npm/v/react-date-range.svg?style=flat-square)](https://www.npmjs.com/package/react-date-range)
3+
![](https://img.shields.io/bithound/dependencies/github/adphorus/react-date-range.svg?style=flat-square)
4+
5+
[![npm](https://img.shields.io/npm/l/react-date-range.svg?style=flat-square)]()
6+
[![npm](https://img.shields.io/npm/dm/localeval.svg?style=flat-square)](https://www.npmjs.com/package/react-date-range)
7+
58

69
A React component for choosing dates and date ranges. Uses [Moment.js](http://momentjs.com/) for date operations.
710

811
**Live Demo :** [http://adphorus.github.io/react-date-range](http://adphorus.github.io/react-date-range)
912

1013
![](https://cdn.pbrd.co/images/1fjQlZzy.png)
1114

15+
## React Range Picker v2 is coming!
16+
17+
** Want to help us testing the next version? Let's go
18+
[next branch](https://github.com/adphorus/react-date-range/tree/next)!**
19+
This version will be depricated soon.
20+
1221
## Getting Started
1322
### Installation
1423

demo/.babelrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"presets": [
3+
["env", { "modules": false }],
4+
"react"
5+
],
6+
"plugins": [
7+
["transform-object-rest-spread"]
8+
],
9+
"env": {
10+
"development": {
11+
"plugins": ["react-hot-loader/babel"]
12+
}
13+
}
14+
}

demo/build.js

Lines changed: 0 additions & 93 deletions
This file was deleted.

demo/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>React Date Range Demo</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script src="/main.js"></script>
12+
</body>
13+
</html>

demo/package.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

demo/src/index.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

demo/src/main.dev.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import { AppContainer } from 'react-hot-loader';
4+
import Main from './components/Main';
5+
6+
const render = Component => {
7+
ReactDOM.render(
8+
<AppContainer>
9+
<Main />
10+
</AppContainer>,
11+
document.getElementById('root'),
12+
)
13+
}
14+
15+
render(Main)
16+
17+
// Webpack Hot Module Replacement API
18+
if (module.hot) {
19+
module.hot.accept('./components/Main', () => {
20+
render(Main)
21+
})
22+
}

package.json

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"description": "A React component for choosing dates and date ranges.",
55
"main": "lib/index.js",
66
"scripts": {
7-
"start-dev": "babel ./src --watch --out-dir ./lib & cd demo && npm install && npm run start-dev",
7+
"dev": "NODE_ENV=development & webpack-dev-server --hot --inline",
88
"prebuild": "rm -rf lib/*",
9-
"build": "babel ./src --out-dir ./lib",
9+
"build": "NODE_ENV=production & babel ./src --out-dir ./lib",
1010
"prepublish": "npm run build"
1111
},
1212
"keywords": [
@@ -31,9 +31,27 @@
3131
"prop-types": "^15.5.10"
3232
},
3333
"peerDependencies": {
34-
"react": "^0.14 || ^15.0.0-rc || ^15.0"
34+
"react": "^0.14 || ^15.0.0-rc || >=15.0"
3535
},
3636
"devDependencies": {
37-
"babel": "^5.8.23"
37+
"autoprefixer": "^7.2.4",
38+
"babel-cli": "^6.26.0",
39+
"babel-loader": "^7.1.2",
40+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
41+
"babel-preset-env": "^1.6.1",
42+
"babel-preset-react": "^6.24.1",
43+
"css-loader": "^0.28.8",
44+
"node-sass": "^4.7.2",
45+
"normalize.css": "^7.0.0",
46+
"postcss-loader": "^2.0.10",
47+
"postcss-modules": "^1.1.0",
48+
"precss": "^2.0.0",
49+
"react": "^16.2.0",
50+
"react-dom": "^16.2.0",
51+
"react-hot-loader": "^3.1.3",
52+
"style-loader": "^0.19.1",
53+
"webpack": "^3.10.0",
54+
"webpack-dev-server": "^2.9.7",
55+
"webpack-hot-middleware": "^2.21.0"
3856
}
3957
}

0 commit comments

Comments
 (0)