Skip to content

Commit

Permalink
Move recharts site to vite (#295)
Browse files Browse the repository at this point in the history
* refactor: move website to vite

* fix: re-add cname and 404

---------

Co-authored-by: Coltin Kifer <ckifer@amazon.com>
  • Loading branch information
ckifer and Coltin Kifer committed May 6, 2024
1 parent ecf6428 commit 3702362
Show file tree
Hide file tree
Showing 23 changed files with 5,813 additions and 14,615 deletions.
36 changes: 0 additions & 36 deletions .babelrc

This file was deleted.

2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

# VITE_RECHARTS_LATEST_VERSION=2.12.6
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": ["demo/**", "test/**", "*.config.js", "scripts/**", "**/Spec.js"]
"devDependencies": ["demo/**", "test/**", "*.config.js", "scripts/**", "**/Spec.js", "./vite.config.ts"]
}
],
"max-len": ["warn", 120],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Install dependencies
run: npm install
- name: Build with npm
run: RECHARTS_LATEST_VERSION=`curl -X GET "https://registry.npmjs.org/recharts/latest" | jq --raw-output '.version'` npm run build
run: VITE_RECHARTS_LATEST_VERSION=`curl -X GET "https://registry.npmjs.org/recharts/latest" | jq --raw-output '.version'` npm run build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,3 @@ node_modules
build/
public/examples
/docs/
!/docs/index.html
!/docs/404.html
!/docs/CNAME
1 change: 0 additions & 1 deletion docs/CNAME

This file was deleted.

50 changes: 3 additions & 47 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,14 @@
<meta name="description" content="Recharts - Re-designed charting library built with React and D3." />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2" />
<link
href="//fonts.googleapis.com/css?family=Source+Sans+Pro:400,600|Roboto Mono|Oswald:300"
href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600|Roboto Mono|Oswald:300"
rel="stylesheet"
type="text/css"
/>
<link href="//recharts.org/style.css" rel="stylesheet" />
<!-- Start Single Page Apps for GitHub Pages -->
<script type="text/javascript">
// Single Page Apps for GitHub Pages
// https://github.com/rafrex/spa-github-pages
// Copyright (c) 2016 Rafael Pedicini, licensed under the MIT License
// ----------------------------------------------------------------------
// This script checks to see if a redirect is present in the query string
// and converts it back into the correct url and adds it to the
// browser's history using window.history.replaceState(...),
// which won't cause the browser to attempt to load the new url.
// When the single page app is loaded further down in this file,
// the correct url will be waiting in the browser's history for
// the single page app to route accordingly.
(function (l) {
if (l.search) {
var q = {};
l.search
.slice(1)
.split('&')
.forEach(function (v) {
var a = v.split('=');
q[a[0]] = a.slice(1).join('=').replace(/~and~/g, '&');
});
if (q.p !== undefined) {
window.history.replaceState(
null,
null,
l.pathname.slice(0, -1) + (q.p || '') + (q.q ? '?' + q.q : '') + l.hash,
);
}
}
})(window.location);
</script>
<!-- End Single Page Apps for GitHub Pages -->
<script type="module" crossorigin src="/assets/index-B-3JKlUm.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DR0Pzb8K.css">
</head>
<body>
<div id="app"></div>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-72434206-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());

gtag('config', 'UA-72434206-1');
</script>
<script type="text/javascript" src="//recharts.org/app.js"></script>
</body>
</html>
63 changes: 63 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Recharts</title>
<meta charset="utf-8" />
<meta name="description" content="Recharts - Re-designed charting library built with React and D3." />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2" />
<link
href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600|Roboto Mono|Oswald:300"
rel="stylesheet"
type="text/css"
/>
<link href="//recharts.org/style.css" rel="stylesheet" />
<!-- Start Single Page Apps for GitHub Pages -->
<script type="text/javascript">
// Single Page Apps for GitHub Pages
// https://github.com/rafrex/spa-github-pages
// Copyright (c) 2016 Rafael Pedicini, licensed under the MIT License
// ----------------------------------------------------------------------
// This script checks to see if a redirect is present in the query string
// and converts it back into the correct url and adds it to the
// browser's history using window.history.replaceState(...),
// which won't cause the browser to attempt to load the new url.
// When the single page app is loaded further down in this file,
// the correct url will be waiting in the browser's history for
// the single page app to route accordingly.
(function (l) {
if (l.search) {
var q = {};
l.search
.slice(1)
.split('&')
.forEach(function (v) {
var a = v.split('=');
q[a[0]] = a.slice(1).join('=').replace(/~and~/g, '&');
});
if (q.p !== undefined) {
window.history.replaceState(
null,
null,
l.pathname.slice(0, -1) + (q.p || '') + (q.q ? '?' + q.q : '') + l.hash,
);
}
}
})(window.location);
</script>
<!-- End Single Page Apps for GitHub Pages -->
</head>
<body>
<div id="app"></div>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-72434206-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());

gtag('config', 'UA-72434206-1');
</script>
<script type="module" src="/src/app.js"></script>
</body>
</html>

0 comments on commit 3702362

Please sign in to comment.