Skip to content

Commit 1a7e00a

Browse files
authoredAug 1, 2020
Refactor and update deps (#541)
* Refactor and update deps * Refactor and update deps * Add canvas * More canvas
1 parent 85bc734 commit 1a7e00a

18 files changed

+320
-8288
lines changed
 

‎.babelrc

+3-27
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,4 @@
11
{
2-
"env": {
3-
"development": {
4-
"presets": [
5-
["es2015", { "modules": "commonjs", "loose": true }],
6-
"react",
7-
"stage-1"
8-
]
9-
},
10-
"rollup": {
11-
"presets": [
12-
["es2015", { "modules": false, "loose": true }],
13-
"react",
14-
"stage-1"
15-
],
16-
"plugins": [
17-
"external-helpers"
18-
]
19-
},
20-
"jsnext": {
21-
"presets": [
22-
["es2015", { "modules": false, "loose": true }],
23-
"react",
24-
"stage-1"
25-
]
26-
}
27-
}
28-
}
2+
"presets": ["@babel/preset-env", "@babel/preset-react"],
3+
"plugins": ["@babel/plugin-proposal-class-properties"]
4+
}

‎.circleci/config.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
version: 2.1
3+
orbs:
4+
node: circleci/node@1.1.6
5+
jobs:
6+
build-and-test:
7+
executor:
8+
name: node/default
9+
steps:
10+
- checkout
11+
- node/with-cache:
12+
steps:
13+
- run: yarn
14+
- run: npm test
15+
workflows:
16+
build-and-test:
17+
jobs:
18+
- build-and-test

‎.npmignore

-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ src
44
.editorconfig
55
.eslintignore
66
.eslintrc
7-
.travis.yml
8-
bower.json
97
rollup.config.js
108
.babelrc

‎.storybook/config.js

-7
This file was deleted.

‎.storybook/webpack.config.js

-9
This file was deleted.

‎.travis.yml

-14
This file was deleted.

‎LICENSE.md

-9
This file was deleted.

‎bower.json

-29
This file was deleted.

‎example/rollup.config.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import htmlTemplate from "rollup-plugin-generate-html-template";
2+
import resolve from "@rollup/plugin-node-resolve";
3+
import babel from "@rollup/plugin-babel";
4+
import commonjs from "@rollup/plugin-commonjs";
5+
import replace from "@rollup/plugin-replace";
6+
import alias from "@rollup/plugin-alias";
7+
import path from "path";
8+
9+
const pathResolve = (loc) => path.resolve(__dirname, loc);
10+
11+
export default {
12+
input: pathResolve("src/index.js"),
13+
output: {
14+
file: pathResolve("dist/js/bundle.js"),
15+
},
16+
plugins: [
17+
htmlTemplate({
18+
template: pathResolve("src/index.html"),
19+
target: pathResolve("dist/index.html"),
20+
}),
21+
resolve(),
22+
babel({
23+
babelHelpers: "bundled",
24+
exclude: "**/node_modules/**",
25+
}),
26+
commonjs(),
27+
replace({
28+
"process.env.NODE_ENV": JSON.stringify("development"),
29+
}),
30+
alias({
31+
entries: [{ find: "react-chartjs-2", replacement: "../../../src" }],
32+
}),
33+
],
34+
};

‎example/src/example.css

-57
This file was deleted.

‎example/src/index.html

+78-14
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,82 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<head>
3-
<title>react-chartjs-2</title>
3+
<title>react-chartjs-2</title>
44
</head>
5+
<style>
6+
body {
7+
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
8+
font-size: 14px;
9+
color: #333;
10+
margin: 0;
11+
padding: 0;
12+
}
13+
14+
a {
15+
color: #08c;
16+
text-decoration: none;
17+
}
18+
19+
a:hover {
20+
text-decoration: underline;
21+
}
22+
23+
.container {
24+
margin-left: auto;
25+
margin-right: auto;
26+
max-width: 720px;
27+
padding: 1em;
28+
}
29+
30+
.footer {
31+
margin-top: 50px;
32+
border-top: 1px solid #eee;
33+
padding: 20px 0;
34+
font-size: 12px;
35+
color: #999;
36+
}
37+
38+
h1,
39+
h2,
40+
h3,
41+
h4,
42+
h5,
43+
h6 {
44+
color: #222;
45+
font-weight: 100;
46+
margin: 0.5em 0;
47+
}
48+
49+
label {
50+
color: #999;
51+
display: inline-block;
52+
font-size: 0.85em;
53+
font-weight: bold;
54+
margin: 1em 0;
55+
text-transform: uppercase;
56+
}
57+
58+
.hint {
59+
margin: 15px 0;
60+
font-style: italic;
61+
color: #999;
62+
}
63+
</style>
64+
565
<body>
6-
<div class="container">
7-
<h1>react-chartjs-2</h1>
8-
<h2><a href="https://github.com/jerairrest/react-chartjs-2">View project on GitHub</a></h2>
9-
<!-- the example app is rendered into this div -->
10-
<div id="app"></div>
11-
<div class="hint">
12-
<!-- put any hints about your component example here -->
13-
</div>
14-
<div class="footer">
15-
Copyright &copy; 2017 Jeremy Ayerst.
16-
</div>
17-
</div>
66+
<div class="container">
67+
<h1>react-chartjs-2</h1>
68+
<h2>
69+
<a href="https://github.com/jerairrest/react-chartjs-2"
70+
>View project on GitHub</a
71+
>
72+
</h2>
73+
<!-- the example app is rendered into this div -->
74+
<div id="app"></div>
75+
<div class="hint">
76+
<!-- put any hints about your component example here -->
77+
</div>
78+
<div class="footer">
79+
Copyright &copy; 2017 Jeremy Ayerst.
80+
</div>
81+
</div>
1882
</body>

‎example/src/index.js

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3+
import App from './components/app';
34

45
const MOUNT_NODE = document.getElementById('app');
56

67
const render = () => {
7-
const App = require('./components/app').default;
8-
9-
ReactDOM.render(<App />, MOUNT_NODE);
8+
ReactDOM.render(<App />, MOUNT_NODE);
109
};
1110

12-
render();
13-
14-
if (module.hot) {
15-
module.hot.accept(['./components/app'], () =>
16-
setImmediate(() => {
17-
ReactDOM.unmountComponentAtNode(MOUNT_NODE);
18-
render();
19-
})
20-
);
21-
}
11+
render();

‎gulpfile.js

-43
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.