Skip to content

Commit

Permalink
Refactor and update deps (reactchartjs#541)
Browse files Browse the repository at this point in the history
* Refactor and update deps

* Refactor and update deps

* Add canvas

* More canvas
  • Loading branch information
jerairrest authored Aug 1, 2020
1 parent 85bc734 commit 1a7e00a
Show file tree
Hide file tree
Showing 18 changed files with 320 additions and 8,288 deletions.
30 changes: 3 additions & 27 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,28 +1,4 @@
{
"env": {
"development": {
"presets": [
["es2015", { "modules": "commonjs", "loose": true }],
"react",
"stage-1"
]
},
"rollup": {
"presets": [
["es2015", { "modules": false, "loose": true }],
"react",
"stage-1"
],
"plugins": [
"external-helpers"
]
},
"jsnext": {
"presets": [
["es2015", { "modules": false, "loose": true }],
"react",
"stage-1"
]
}
}
}
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": ["@babel/plugin-proposal-class-properties"]
}
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

version: 2.1
orbs:
node: circleci/[email protected]
jobs:
build-and-test:
executor:
name: node/default
steps:
- checkout
- node/with-cache:
steps:
- run: yarn
- run: npm test
workflows:
build-and-test:
jobs:
- build-and-test
2 changes: 0 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ src
.editorconfig
.eslintignore
.eslintrc
.travis.yml
bower.json
rollup.config.js
.babelrc
7 changes: 0 additions & 7 deletions .storybook/config.js

This file was deleted.

9 changes: 0 additions & 9 deletions .storybook/webpack.config.js

This file was deleted.

14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

9 changes: 0 additions & 9 deletions LICENSE.md

This file was deleted.

29 changes: 0 additions & 29 deletions bower.json

This file was deleted.

34 changes: 34 additions & 0 deletions example/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import htmlTemplate from "rollup-plugin-generate-html-template";
import resolve from "@rollup/plugin-node-resolve";
import babel from "@rollup/plugin-babel";
import commonjs from "@rollup/plugin-commonjs";
import replace from "@rollup/plugin-replace";
import alias from "@rollup/plugin-alias";
import path from "path";

const pathResolve = (loc) => path.resolve(__dirname, loc);

export default {
input: pathResolve("src/index.js"),
output: {
file: pathResolve("dist/js/bundle.js"),
},
plugins: [
htmlTemplate({
template: pathResolve("src/index.html"),
target: pathResolve("dist/index.html"),
}),
resolve(),
babel({
babelHelpers: "bundled",
exclude: "**/node_modules/**",
}),
commonjs(),
replace({
"process.env.NODE_ENV": JSON.stringify("development"),
}),
alias({
entries: [{ find: "react-chartjs-2", replacement: "../../../src" }],
}),
],
};
57 changes: 0 additions & 57 deletions example/src/example.css

This file was deleted.

92 changes: 78 additions & 14 deletions example/src/index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,82 @@
<!doctype html>
<!DOCTYPE html>
<head>
<title>react-chartjs-2</title>
<title>react-chartjs-2</title>
</head>
<style>
body {
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
color: #333;
margin: 0;
padding: 0;
}

a {
color: #08c;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

.container {
margin-left: auto;
margin-right: auto;
max-width: 720px;
padding: 1em;
}

.footer {
margin-top: 50px;
border-top: 1px solid #eee;
padding: 20px 0;
font-size: 12px;
color: #999;
}

h1,
h2,
h3,
h4,
h5,
h6 {
color: #222;
font-weight: 100;
margin: 0.5em 0;
}

label {
color: #999;
display: inline-block;
font-size: 0.85em;
font-weight: bold;
margin: 1em 0;
text-transform: uppercase;
}

.hint {
margin: 15px 0;
font-style: italic;
color: #999;
}
</style>

<body>
<div class="container">
<h1>react-chartjs-2</h1>
<h2><a href="https://github.com/jerairrest/react-chartjs-2">View project on GitHub</a></h2>
<!-- the example app is rendered into this div -->
<div id="app"></div>
<div class="hint">
<!-- put any hints about your component example here -->
</div>
<div class="footer">
Copyright &copy; 2017 Jeremy Ayerst.
</div>
</div>
<div class="container">
<h1>react-chartjs-2</h1>
<h2>
<a href="https://github.com/jerairrest/react-chartjs-2"
>View project on GitHub</a
>
</h2>
<!-- the example app is rendered into this div -->
<div id="app"></div>
<div class="hint">
<!-- put any hints about your component example here -->
</div>
<div class="footer">
Copyright &copy; 2017 Jeremy Ayerst.
</div>
</div>
</body>
16 changes: 3 additions & 13 deletions example/src/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/app';

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

const render = () => {
const App = require('./components/app').default;

ReactDOM.render(<App />, MOUNT_NODE);
ReactDOM.render(<App />, MOUNT_NODE);
};

render();

if (module.hot) {
module.hot.accept(['./components/app'], () =>
setImmediate(() => {
ReactDOM.unmountComponentAtNode(MOUNT_NODE);
render();
})
);
}
render();
43 changes: 0 additions & 43 deletions gulpfile.js

This file was deleted.

Loading

0 comments on commit 1a7e00a

Please sign in to comment.