Skip to content

Commit 826b8c5

Browse files
mxschmittmartijnrusschen
authored andcommitted
feat: updated dependencies (Hacker0x01#1855)
* feat: updated dependencies * feat: bumped eslint * fix: build * fix: docs * fix: cleanup * fix: warnings warning * fix: tests * fix: Cannot find module 'babel-helpers' * fix: use latest firefox * fix: cleanup * fix: warning * feat: cleanup * fix: readded .flowconfig * feat: added mocha reporter * fix: unit tests * fix: added npm cache * fix: cleanup babelrc config * feat: reduce bundle size of docs
1 parent d4d7c38 commit 826b8c5

33 files changed

+5065
-3134
lines changed

.babelrc

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

.babelrc.js

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,19 @@
1-
var NODE_ENV = process.env.NODE_ENV;
2-
var MODULES = process.env.MODULES;
1+
const { NODE_ENV, MODULES } = process.env;
32

4-
var modules = MODULES === "false" || NODE_ENV === "test" ? "commonjs" : false;
3+
const modules = MODULES === "false" || NODE_ENV === "test" ? "commonjs" : false;
54

6-
var config = {
7-
presets: [
8-
[
9-
"env",
10-
{
11-
loose: true,
12-
modules: modules,
13-
forceAllTransforms: NODE_ENV === "production"
14-
}
15-
],
16-
"stage-0",
17-
"react"
18-
],
19-
plugins: []
20-
};
21-
22-
if (NODE_ENV === "development") {
23-
config.plugins = config.plugins.concat([
24-
"transform-class-properties",
25-
[
26-
"react-transform",
27-
{
28-
transforms: [
29-
{
30-
transform: "react-transform-hmr",
31-
imports: ["react"],
32-
locals: ["module"]
33-
}
34-
]
35-
}
36-
],
37-
"add-react-displayname"
38-
]);
39-
}
5+
const presets = [
6+
"@babel/preset-env",
7+
"@babel/preset-react",
8+
"@babel/preset-flow"
9+
];
10+
const plugins = [
11+
"@babel/plugin-transform-react-jsx",
12+
"@babel/plugin-proposal-class-properties"
13+
];
4014

4115
if (NODE_ENV === "production") {
42-
config.plugins = config.plugins.concat(["transform-react-remove-prop-types"]);
16+
plugins.push("transform-react-remove-prop-types");
4317
}
4418

45-
module.exports = config;
19+
module.exports = { presets, plugins };

.gitignore

Lines changed: 100 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,110 @@
1-
node_modules
2-
.sass-cache
3-
npm-debug.log
4-
.DS_Store
5-
.idea
6-
.vscode
7-
.history
1+
# Created by https://www.gitignore.io/api/node
2+
# Edit at https://www.gitignore.io/?templates=node
3+
4+
### Node ###
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
lerna-debug.log*
12+
13+
# Diagnostic reports (https://nodejs.org/api/report.html)
14+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
15+
16+
# Runtime data
17+
pids
18+
*.pid
19+
*.seed
20+
*.pid.lock
21+
22+
# Directory for instrumented libs generated by jscoverage/JSCover
23+
lib-cov
24+
25+
# Coverage directory used by tools like istanbul
26+
coverage
27+
*.lcov
28+
29+
# nyc test coverage
30+
.nyc_output
31+
32+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
33+
.grunt
34+
35+
# Bower dependency directory (https://bower.io/)
36+
bower_components
37+
38+
# node-waf configuration
39+
.lock-wscript
40+
41+
# Compiled binary addons (https://nodejs.org/api/addons.html)
42+
build/Release
43+
44+
# Dependency directories
45+
node_modules/
46+
jspm_packages/
47+
48+
# TypeScript v1 declaration files
49+
typings/
50+
51+
# TypeScript cache
52+
*.tsbuildinfo
53+
54+
# Optional npm cache directory
55+
.npm
56+
57+
# Optional eslint cache
58+
.eslintcache
59+
60+
# Optional REPL history
61+
.node_repl_history
62+
63+
# Output of 'npm pack'
64+
*.tgz
65+
66+
# Yarn Integrity file
67+
.yarn-integrity
68+
69+
# dotenv environment variables file
70+
.env
71+
.env.test
72+
73+
# parcel-bundler cache (https://parceljs.org/)
74+
.cache
75+
76+
# next.js build output
77+
.next
78+
79+
# nuxt.js build output
80+
.nuxt
81+
82+
# vuepress build output
83+
.vuepress/dist
84+
85+
# Serverless directories
86+
.serverless/
87+
88+
# FuseBox cache
89+
.fusebox/
90+
91+
# DynamoDB Local files
92+
.dynamodb/
93+
94+
# End of https://www.gitignore.io/api/node
95+
896
dist
997
lib
1098
es
1199
tmp
12-
coverage
13-
docs-site/bundle.js
14-
docs-site/style.css
100+
101+
.vscode
15102
*.iml
16103
.idea
17104

105+
docs-site/*bundle.js
106+
docs-site/style.css
107+
18108
docs/calendar.md
19109
docs/date_input.md
20110
docs/day.md

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
language: node_js
22
node_js:
33
- "node"
4-
cache: yarn
4+
cache:
5+
- npm
6+
- yarn
57
script:
68
- yarn lint
79
- yarn test
@@ -15,6 +17,8 @@ deploy:
1517
local_dir: docs-site
1618
on:
1719
branch: master
20+
addons:
21+
firefox: latest
1822
notifications:
1923
slack:
2024
secure: kAmrLltV0ZLuhl6rKk26fDLGuoCch6AYaObRQje4UZlxVQjR2467k430vOZLqv39Mr3U5XmYl6VLcCGmBr3tjM/9c1zjoXnRT8MRy4eIYaUr/thXeh2FlfHKOk8rXnNOoRZ1kBsCzCDFCNDYZZA4jya8S5ITcQyGyYcOqBWVy1w=

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,15 @@ import "react-datepicker/dist/react-datepicker.css";
3232
// import 'react-datepicker/dist/react-datepicker-cssmodules.css';
3333

3434
class Example extends React.Component {
35-
constructor(props) {
36-
super(props);
37-
this.state = {
38-
startDate: new Date()
39-
};
40-
this.handleChange = this.handleChange.bind(this);
41-
}
35+
state = {
36+
startDate: new Date()
37+
};
4238

43-
handleChange(date) {
39+
handleChange = date => {
4440
this.setState({
4541
startDate: date
4642
});
47-
}
43+
};
4844

4945
render() {
5046
return (
@@ -117,7 +113,6 @@ registerLocale('es', es)
117113
Locales can be changed in the following way:
118114

119115
- **Globally** - `setDefaultLocale('es');`
120-
121116

122117
## Compatibility
123118

docs-site/src/boot.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import "core-js/stable";
2+
13
import React from "react";
24
import ReactDOM from "react-dom";
35
import Root from "./root";

docs-site/src/example_components.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from "react";
2-
import hljs from "highlight.js";
2+
import hljs from "highlight.js/lib/highlight";
3+
import hljsJavaScriptLanguage from "highlight.js/lib/languages/javascript";
34
import Default from "./examples/default";
45
import CodeExampleComponent from "./code_example_component";
56

@@ -66,6 +67,7 @@ import "./style.scss";
6667
export default class exampleComponents extends React.Component {
6768
componentDidMount() {
6869
hljs.initHighlightingOnLoad();
70+
hljs.registerLanguage("javascript", hljsJavaScriptLanguage);
6971
}
7072

7173
examples = [
File renamed without changes.
File renamed without changes.

docs-site/src/root.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default class Root extends React.Component {
1717
<a href="https://hackerone.com" className="hero__crafted-by-link">
1818
Crafted by{" "}
1919
<img
20-
src="images/logo.png"
20+
src="src/images/logo.png"
2121
className="hero__image"
2222
alt="HackerOne"
2323
title="HackerOne"
@@ -71,6 +71,10 @@ export default class Root extends React.Component {
7171
<p>
7272
<code>npm install react-datepicker --save</code>
7373
</p>
74+
<p>Or by using Yarn:</p>
75+
<p>
76+
<code>yarn add react-datepicker</code>
77+
</p>
7478
</div>
7579
<div className="wrapper">
7680
<ExampleComponents />
@@ -79,7 +83,7 @@ export default class Root extends React.Component {
7983
<a href="https://github.com/Hacker0x01/react-datepicker/">
8084
<img
8185
className="github-ribbon"
82-
src="images/ribbon.png"
86+
src="src/images/ribbon.png"
8387
alt="Fork me on GitHub"
8488
/>
8589
</a>

0 commit comments

Comments
 (0)