Skip to content

Commit 84360d1

Browse files
author
july
committed
fix: start failed
1 parent 228a9f5 commit 84360d1

File tree

8 files changed

+73
-115
lines changed

8 files changed

+73
-115
lines changed

index.html

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico?imageFilter=convert&f=png&w=32" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#4F6AF5" />
8+
</head>
39

4-
<head>
5-
<meta charset="UTF-8" />
6-
<link rel="icon" href="/favicon.ico?imageFilter=convert&f=png&w=32" />
7-
<meta name="viewport" content="width=device-width, initial-scale=1" />
8-
<meta name="theme-color" content="#4F6AF5" />
9-
</head>
10-
11-
<body>
12-
<noscript> You need to enable JavaScript to run this app. </noscript>
13-
<div id="app"></div>
14-
<script type="module" src="/src/index.jsx"></script>
15-
</body>
16-
10+
<body>
11+
<noscript> You need to enable JavaScript to run this app. </noscript>
12+
<div id="app"></div>
13+
<script type="module" src="/src/index.tsx"></script>
14+
</body>
1715
</html>

package.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,10 @@
6868
"monaco-editor": "^0.20.0",
6969
"prettier": "^3.5.1",
7070
"react": "~18.2.0",
71-
"react-dom": "~18.2.0",
72-
"react-router-dom": "^6.29.0",
7371
"react-color": "^2.18.1",
74-
"react-helmet-async": "^1.2.3",
72+
"react-dom": "~18.2.0",
7573
"react-redux": "^7.2.8",
74+
"react-router-dom": "^6.29.0",
7675
"recharts": "^2.1.9",
7776
"redux": "^4.1.2",
7877
"redux-persist": "^6.0.0",
@@ -82,17 +81,21 @@
8281
},
8382
"devDependencies": {
8483
"@arcblock/eslint-config-ts": "^0.3.3",
84+
"@testing-library/react": "^14.0.0",
8585
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
86-
"@vitejs/plugin-react": "^4.3.4",
8786
"@types/codemirror": "^0.0.97",
8887
"@types/dot-prop-immutable": "^1.5.1",
89-
"@typescript-eslint/parser": "~7.16.1",
90-
"@typescript-eslint/eslint-plugin": "^7.18.0",
9188
"@types/react-color": "^3.0.4",
9289
"@types/react-redux": "^7.1.9",
9390
"@types/webfontloader": "^1.6.32",
91+
"@typescript-eslint/eslint-plugin": "^7.18.0",
92+
"@typescript-eslint/parser": "~7.16.1",
93+
"@vitejs/plugin-react": "^4.3.4",
94+
"@vitest/coverage-v8": "^0.34.4",
95+
"@vitest/ui": "^0.34.4",
9496
"bumpp": "^9.11.1",
9597
"eslint": "^8.57.1",
98+
"jsdom": "^22.1.0",
9699
"lint-staged": "^15.4.3",
97100
"rimraf": "^5.0.10",
98101
"simple-git-hooks": "^2.11.1",
@@ -101,12 +104,8 @@
101104
"vite-plugin-blocklet": "^0.9.25",
102105
"vite-plugin-monaco-editor": "^1.1.0",
103106
"vite-plugin-svgr": "^4.3.0",
104-
"zx": "^8.3.2",
105-
"@testing-library/react": "^14.0.0",
106-
"@vitest/coverage-v8": "^0.34.4",
107-
"@vitest/ui": "^0.34.4",
108-
"jsdom": "^22.1.0",
109-
"vitest": "^0.34.4"
107+
"vitest": "^0.34.4",
108+
"zx": "^8.3.2"
110109
},
111110
"license": "0BSD",
112111
"repository": {

pnpm-lock.yaml

Lines changed: 0 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ function App() {
2121
<BrowserRouter>
2222
<Routes>
2323
<Route path="/" element={<HomePage />} />
24-
{/* 添加更多路由 */}
2524
</Routes>
2625
</BrowserRouter>
2726
</PersistGate>

src/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import ReactDOM from 'react-dom/client';
2+
3+
import App from './App';
4+
5+
const root = ReactDOM.createRoot(document.getElementById('app')!);
6+
7+
root.render(<App />);

src/main.tsx

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

src/pages/index.tsx

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Box } from '@mui/material';
2-
import { HelmetProvider } from 'react-helmet-async';
32
import ComponentNavDrawer from 'src/components/ComponentNavDrawer';
43
import ErrorBoundary from 'src/components/ErrorBoundary';
54
import Header from 'src/components/Header';
@@ -11,59 +10,57 @@ import Tutorial from 'src/components/Tutorial';
1110

1211
function IndexPage() {
1312
return (
14-
<HelmetProvider>
15-
<Layout>
16-
<Box
17-
sx={{
18-
display: 'flex',
19-
height: '100vh',
20-
}}>
21-
<ErrorBoundary>
13+
<Layout>
14+
<Box
15+
sx={{
16+
display: 'flex',
17+
height: '100vh',
18+
}}>
19+
<ErrorBoundary>
20+
<Box
21+
sx={{
22+
flex: 1,
23+
display: 'flex',
24+
flexDirection: 'column',
25+
minWidth: 0,
26+
}}>
27+
<Header
28+
sx={{
29+
backgroundColor: '#000000',
30+
position: {
31+
md: 'static',
32+
},
33+
}}
34+
/>
35+
2236
<Box
2337
sx={{
2438
flex: 1,
2539
display: 'flex',
26-
flexDirection: 'column',
27-
minWidth: 0,
40+
minHeight: 0,
2841
}}>
29-
<Header
30-
sx={{
31-
backgroundColor: '#000000',
32-
position: {
33-
md: 'static',
34-
},
35-
}}
36-
/>
42+
<ComponentNavDrawer />
3743

3844
<Box
45+
component="main"
3946
sx={{
47+
minWidth: 0,
48+
minHeight: 0,
4049
flex: 1,
4150
display: 'flex',
42-
minHeight: 0,
51+
flexDirection: 'column',
4352
}}>
44-
<ComponentNavDrawer />
45-
46-
<Box
47-
component="main"
48-
sx={{
49-
minWidth: 0,
50-
minHeight: 0,
51-
flex: 1,
52-
display: 'flex',
53-
flexDirection: 'column',
54-
}}>
55-
<MainWindow />
56-
</Box>
53+
<MainWindow />
5754
</Box>
5855
</Box>
56+
</Box>
5957

60-
<ThemeConfigDrawer />
61-
</ErrorBoundary>
62-
</Box>
63-
<SmallScreenWarning />
64-
<Tutorial />
65-
</Layout>
66-
</HelmetProvider>
58+
<ThemeConfigDrawer />
59+
</ErrorBoundary>
60+
</Box>
61+
<SmallScreenWarning />
62+
<Tutorial />
63+
</Layout>
6764
);
6865
}
6966

vite.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
/* eslint-disable import/no-extraneous-dependencies */
12
import react from '@vitejs/plugin-react';
23
import path from 'path';
34
import { defineConfig } from 'vite';
5+
// @ts-ignore
46
import { createBlockletPlugin } from 'vite-plugin-blocklet';
57
import monacoEditorPlugin from 'vite-plugin-monaco-editor';
68
import svgr from 'vite-plugin-svgr';
@@ -14,6 +16,10 @@ export default defineConfig(() => {
1416
src: path.resolve(__dirname, './src'),
1517
},
1618
},
19+
server: {
20+
port: 3001,
21+
open: true,
22+
},
1723
test: {
1824
globals: true,
1925
environment: 'jsdom',

0 commit comments

Comments
 (0)