Skip to content

Commit

Permalink
Migrate from Create React App (CRA) to Vite
Browse files Browse the repository at this point in the history
  • Loading branch information
ldamasio committed Aug 31, 2023
1 parent 4a4bc37 commit 1075862
Show file tree
Hide file tree
Showing 47 changed files with 2,931 additions and 27,478 deletions.
File renamed without changes.
19 changes: 19 additions & 0 deletions frontends/web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Robson is an open source crypto robot"
/>
<title>Robson Bot</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.jsx"></script>
</body>
</html>
12 changes: 7 additions & 5 deletions frontends/web/jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src"]
}
"compilerOptions": {
"baseUrl": "src"
},
"include": [
"src"
]
}
30,277 changes: 2,882 additions & 27,395 deletions frontends/web/package-lock.json

Large diffs are not rendered by default.

18 changes: 7 additions & 11 deletions frontends/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,13 @@
"react-dom": "^18.2.0",
"react-router-bootstrap": "^0.26.2",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"react-use-websocket": "^4.2.0",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
"start": "vite",
"build": "vite build",
"serve": "vite preview"
},
"browserslist": {
"production": [
Expand All @@ -41,5 +33,9 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@vitejs/plugin-react": "^4.0.4",
"vite": "^4.4.9"
}
}
42 changes: 0 additions & 42 deletions frontends/web/public/index.html

This file was deleted.

20 changes: 0 additions & 20 deletions frontends/web/public/manifest.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect, useContext } from 'react'
import AuthContext from 'context/AuthContext'
import AuthContext from '../../context/AuthContext'

function Strategies() {

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Risk from '../components/logged/Risk'
import Volume from '../components/logged/Volume'
import Chart from '../components/logged/Chart'
import Dataframe from '../components/logged/Dataframe'
import AuthContext from 'context/AuthContext'
import AuthContext from '../context/AuthContext'

const LoggedHomeScreen = () => {
return (
Expand All @@ -24,9 +24,9 @@ const LoggedHomeScreen = () => {
<main className="py-5">
<Container>
<p>
<small>You are running this application in <b>{process.env.NODE_ENV}</b> mode.</small>
<small>You are running this application in <b>{import.meta.env.NODE_ENV}</b> mode.</small>
<br />
<small>BACKEND_URL is <b>{process.env.REACT_APP_BACKEND_URL}</b></small>
<small>BACKEND_URL is <b>{import.meta.env.REACT_APP_BACKEND_URL}</b></small>
</p>
<Tabs defaultActiveKey="1">
<Tab eventKey="1" title="Control Panel">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useContext } from 'react'
import AuthContext from 'context/AuthContext'
import AuthContext from '../context/AuthContext'
// import { Link, useHistory } from 'react-router-dom';
import { Container, Row, Col } from 'react-bootstrap'
import Header from "../components/common/Header"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions frontends/web/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig(() => {
return {
build: {
outDir: 'build',
},
plugins: [react()],
};
});

0 comments on commit 1075862

Please sign in to comment.