Skip to content

Commit 83287aa

Browse files
authored
Merge pull request #5 from SkywardAI/vite
move React to Vite+React
2 parents 2af1d35 + 8e7b93c commit 83287aa

25 files changed

+2660
-11066
lines changed

.gitignore

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
3-
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.js
7-
8-
# testing
9-
/coverage
10-
11-
# production
12-
/build
13-
14-
# misc
15-
.DS_Store
16-
.env.local
17-
.env.development.local
18-
.env.test.local
19-
.env.production.local
20-
1+
# Logs
2+
logs
3+
*.log
214
npm-debug.log*
225
yarn-debug.log*
236
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
build
15+
16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?

electron.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { app, BrowserWindow } = require('electron');
1+
import { app, BrowserWindow } from 'electron';
22

33
function createWindow() {
44
const win = new BrowserWindow({
@@ -20,6 +20,7 @@ app.whenReady().then(() => {
2020
createWindow();
2121

2222
app.on('window-all-closed', () => {
23+
// eslint-disable-next-line
2324
process.platform !== 'darwin' && app.quit()
2425
});
2526

eslint.config.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import react from 'eslint-plugin-react'
4+
import reactHooks from 'eslint-plugin-react-hooks'
5+
import reactRefresh from 'eslint-plugin-react-refresh'
6+
7+
export default [
8+
{ ignores: ['dist'] },
9+
{
10+
files: ['**/*.{js,jsx}'],
11+
languageOptions: {
12+
ecmaVersion: 2020,
13+
globals: globals.browser,
14+
parserOptions: {
15+
ecmaVersion: 'latest',
16+
ecmaFeatures: { jsx: true },
17+
sourceType: 'module',
18+
},
19+
},
20+
settings: { react: { version: '18.3' } },
21+
plugins: {
22+
react,
23+
'react-hooks': reactHooks,
24+
'react-refresh': reactRefresh,
25+
},
26+
rules: {
27+
...js.configs.recommended.rules,
28+
...react.configs.recommended.rules,
29+
...react.configs['jsx-runtime'].rules,
30+
...reactHooks.configs.recommended.rules,
31+
'react/jsx-no-target-blank': 'off',
32+
'react-refresh/only-export-components': [
33+
'warn',
34+
{ allowConstantExport: true },
35+
],
36+
"react/prop-types": "off"
37+
},
38+
},
39+
]

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>SkywardAI</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.jsx"></script>
12+
</body>
13+
</html>

package.json

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,37 @@
11
{
2-
"name": "shibuya",
3-
"version": "0.1.0",
2+
"name": "vite-test",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"main": "electron.js",
7+
"scripts": {
8+
"dev": "npm run start & npm run electron",
9+
"start": "vite",
10+
"build": "vite build",
11+
"lint": "eslint .",
12+
"preview": "vite preview",
13+
"electron": "electron ."
14+
},
415
"dependencies": {
16+
"@huggingface/jinja": "^0.3.0",
17+
"@wllama/wllama": "^1.16.0",
518
"react": "^18.3.1",
619
"react-bootstrap-icons": "^1.11.4",
720
"react-dom": "^18.3.1",
8-
"react-router-dom": "^6.26.0",
9-
"react-scripts": "5.0.1",
10-
"web-vitals": "^2.1.4"
11-
},
12-
"main": "electron.js",
13-
"scripts": {
14-
"dev": "node backend/index.js & npm run start & npm run electron",
15-
"electron": "electron .",
16-
"start": "BROWSER=none react-scripts start",
17-
"build": "react-scripts build",
18-
"test": "react-scripts test",
19-
"eject": "react-scripts eject"
20-
},
21-
"eslintConfig": {
22-
"extends": [
23-
"react-app",
24-
"react-app/jest"
25-
]
26-
},
27-
"browserslist": {
28-
"production": [
29-
">0.2%",
30-
"not dead",
31-
"not op_mini all"
32-
],
33-
"development": [
34-
"last 1 chrome version",
35-
"last 1 firefox version",
36-
"last 1 safari version"
37-
]
21+
"react-markdown": "^9.0.1",
22+
"react-router-dom": "^6.26.1"
3823
},
3924
"devDependencies": {
25+
"@eslint/js": "^9.9.0",
26+
"@types/react": "^18.3.3",
27+
"@types/react-dom": "^18.3.0",
28+
"@vitejs/plugin-react": "^4.3.1",
29+
"eslint": "^9.9.0",
30+
"eslint-plugin-react": "^7.35.0",
31+
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
32+
"eslint-plugin-react-refresh": "^0.4.9",
33+
"globals": "^15.9.0",
34+
"vite": "^5.4.1",
4035
"electron": "^32.0.0"
4136
}
4237
}

0 commit comments

Comments
 (0)