Skip to content

Commit 8d5934f

Browse files
committed
Merge branch 'feature/migrate-vite' of https://github.com/msdio/skill-set-generator
2 parents 3ee92c5 + 81dc3b8 commit 8d5934f

File tree

22 files changed

+636
-5299
lines changed

22 files changed

+636
-5299
lines changed

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
31
# dependencies
42
/node_modules
53
/.pnp
@@ -10,6 +8,9 @@
108

119
# production
1210
/build
11+
dist
12+
dist-ssr
13+
*.local
1314

1415
# misc
1516
.DS_Store
@@ -18,8 +19,12 @@
1819
.env.test.local
1920
.env.production.local
2021

22+
# Logs
23+
logs
24+
*.log
2125
npm-debug.log*
2226
yarn-debug.log*
2327
yarn-error.log*
28+
pnpm-debug.log*
2429

2530
.env

index.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#0066FF" />
8+
<meta name="description" content="Create skill set for project" />
9+
<meta property="og:title" content="stackticon" />
10+
<meta
11+
property="og:image"
12+
content="https://user-images.githubusercontent.com/59170680/224671255-09ba02cd-873e-4559-bf08-4d48040f6c14.png"
13+
/>
14+
<meta property="og:description" content="Create skill set for project" />
15+
16+
<link rel="apple-touch-icon" href="/favicon.png" />
17+
18+
<link rel="manifest" href="/manifest.json" />
19+
20+
<title>Stackticon</title>
21+
</head>
22+
<body>
23+
<noscript>You need to enable JavaScript to run this app.</noscript>
24+
<div id="root"></div>
25+
26+
<script type="module" src="/src/index.tsx"></script>
27+
</body>
28+
</html>

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"license": "MIT",
1010
"homepage": ".",
1111
"scripts": {
12-
"start": "react-scripts start",
13-
"build": "react-scripts build",
14-
"test": "react-scripts test --watchAll",
15-
"eject": "react-scripts eject",
12+
"start": "vite",
13+
"build": "tsc && vite build",
14+
"preview": "vite preview",
15+
"test": "jest --watchAll",
1616
"predeploy": "yarn build",
1717
"deploy": "gh-pages -d build"
1818
},
@@ -49,9 +49,7 @@
4949
"react-dom": "^18.2.0",
5050
"react-ga4": "^2.0.0",
5151
"react-router-dom": "^6.8.1",
52-
"react-scripts": "5.0.1",
53-
"simple-icons": "^8.5.0",
54-
"web-vitals": "^2.1.0"
52+
"simple-icons": "^8.5.0"
5553
},
5654
"devDependencies": {
5755
"@babel/core": "^7.21.3",
@@ -64,6 +62,7 @@
6462
"@types/react-dom": "^18.0.10",
6563
"@typescript-eslint/eslint-plugin": "^5.51.0",
6664
"@typescript-eslint/parser": "^5.51.0",
65+
"@vitejs/plugin-react": "^3.1.0",
6766
"eslint": "^8.34.0",
6867
"eslint-config-prettier": "^8.6.0",
6968
"eslint-config-react": "^1.1.7",
@@ -75,6 +74,8 @@
7574
"jest": "^29.5.0",
7675
"prettier": "2.8.4",
7776
"ts-jest": "^29.0.5",
78-
"typescript": "^4.9.5"
77+
"typescript": "^4.9.5",
78+
"vite": "^4.2.1",
79+
"vite-tsconfig-paths": "^4.2.0"
7980
}
8081
}

public/index.html

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

public/logo192.png

-5.22 KB
Binary file not shown.

public/logo512.png

-9.44 KB
Binary file not shown.

public/manifest.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
{
2-
"short_name": "React App",
3-
"name": "Create React App Sample",
2+
"short_name": "Stackticon",
3+
"name": "Stackticon App",
44
"icons": [
55
{
66
"src": "favicon.ico",
77
"sizes": "64x64 32x32 24x24 16x16",
88
"type": "image/x-icon"
9-
},
10-
{
11-
"src": "logo192.png",
12-
"type": "image/png",
13-
"sizes": "192x192"
14-
},
15-
{
16-
"src": "logo512.png",
17-
"type": "image/png",
18-
"sizes": "512x512"
199
}
2010
],
2111
"start_url": ".",

src/Router.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import Loading from 'components/loading';
22
import RequireState from 'components/requireState';
3-
import BackgroundColors from 'pages/background-colors';
4-
import Home from 'pages/home';
53
import Cute404 from 'pages/page404/Cute404';
6-
import Result from 'pages/result';
4+
import { lazy } from 'react';
75
import { Route, Routes } from 'react-router-dom';
86

7+
const Home = lazy(() => import('pages/home'));
8+
const BackgroundColors = lazy(() => import('pages/background-colors'));
9+
const Result = lazy(() => import('pages/result'));
10+
911
const Router = () => (
1012
<Routes>
1113
<Route path='/' element={<Home />} />

src/RouterContainer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
import { Box } from '@mui/material';
2+
import { Suspense } from 'react';
23
import Router from 'Router';
34
import GoogleAnalyticsTracker from 'services/google-analytics/GoogleAnalyticsTracker';
45

6+
const loading = <div>Assembling UIs...</div>;
7+
58
const RouterContainer = () => {
69
GoogleAnalyticsTracker();
710

811
return (
912
<Box bgcolor='background.default' width='100vw' height='fit-content' minHeight='100vh'>
10-
<Router />
13+
<Suspense fallback={loading}>
14+
<Router />
15+
</Suspense>
1116
</Box>
1217
);
1318
};

src/assets/icons/logoWithBackground.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Box } from '@mui/material';
22

3+
import Logo from '../images/logo.png';
4+
35
interface LogoProps {
46
width: number;
57
height: number;
@@ -17,12 +19,7 @@ const LogoWithBackground = ({ width, height }: LogoProps) => {
1719
height={`${height}px`}
1820
gap='9.6px'
1921
>
20-
<img
21-
src={require('../images/logo.png')}
22-
alt='logo'
23-
width={`${width - 2}px)`}
24-
height={`calc(${height - 2}px)`}
25-
/>
22+
<img src={Logo} alt='logo' width={`${width - 2}px)`} height={`calc(${height - 2}px)`} />
2623
</Box>
2724
);
2825
};

0 commit comments

Comments
 (0)