Skip to content

Commit 14a79f1

Browse files
committed
Merge branch 'react-sqlite-modernized-frontend'
2 parents fb8a5a0 + 2b15302 commit 14a79f1

32 files changed

+8561
-7
lines changed

.github/workflows/app.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Based on the github actions "static" template
2+
name: Deploy viewer app
3+
4+
on:
5+
# run if the app changed on master
6+
push:
7+
branches: ["master"]
8+
paths: ["app/**", ".github/workflows/app.yml"]
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
20+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
21+
concurrency:
22+
group: "pages"
23+
cancel-in-progress: false
24+
25+
jobs:
26+
deploy:
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
- name: Set up Node
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: 22
38+
cache: 'npm'
39+
- name: Install dependencies
40+
run: |
41+
cd app
42+
npm ci
43+
- name: Build
44+
run: |
45+
cd app
46+
npm run build
47+
- name: Setup Pages
48+
uses: actions/configure-pages@v5
49+
- name: Upload artifact
50+
uses: actions/upload-pages-artifact@v3
51+
with:
52+
path: app/dist
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ out
9999
.nuxt
100100
dist
101101

102-
# react / gatsby
103-
public/
104-
105102
# Gatsby files
106103
.cache/
107104
# Comment in the public line in if your project uses Gatsby and not Next.js

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ const res = isMyDataValid(data)
120120
* `npm run test` - run build process and tests for all modules
121121
* `npm run test:build` - run build process for all modules
122122

123-
#### Docs
123+
### Benchmark Viewer App
124124

125-
* `npm run docs:serve` - result viewer
126-
* `npm run docs:build` - build docs
127-
* `npm run docs:watch` - watch docs for changes and rebuild
125+
1. `cd app`
126+
2. `npm install`
127+
3. `npm dev`
128128

129129
#### Linting
130130

app/.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

app/README.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# React + TypeScript + Vite
2+
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4+
5+
Currently, two official plugins are available:
6+
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
10+
## Expanding the ESLint configuration
11+
12+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13+
14+
- Configure the top-level `parserOptions` property like this:
15+
16+
```js
17+
export default tseslint.config({
18+
languageOptions: {
19+
// other options...
20+
parserOptions: {
21+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
22+
tsconfigRootDir: import.meta.dirname,
23+
},
24+
},
25+
})
26+
```
27+
28+
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29+
- Optionally add `...tseslint.configs.stylisticTypeChecked`
30+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
31+
32+
```js
33+
// eslint.config.js
34+
import react from 'eslint-plugin-react'
35+
36+
export default tseslint.config({
37+
// Set the react version
38+
settings: { react: { version: '18.3' } },
39+
plugins: {
40+
// Add the react plugin
41+
react,
42+
},
43+
rules: {
44+
// other rules...
45+
// Enable its recommended rules
46+
...react.configs.recommended.rules,
47+
...react.configs['jsx-runtime'].rules,
48+
},
49+
})
50+
```

app/eslint.config.js

+39
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 reactHooks from "eslint-plugin-react-hooks";
4+
import reactRefresh from "eslint-plugin-react-refresh";
5+
import tseslint from "typescript-eslint";
6+
import react from "eslint-plugin-react";
7+
8+
export default tseslint.config(
9+
{ ignores: ["dist"] },
10+
{
11+
extends: [
12+
js.configs.recommended,
13+
...tseslint.configs.strictTypeChecked,
14+
...tseslint.configs.stylisticTypeChecked,
15+
],
16+
files: ["**/*.{ts,tsx}"],
17+
languageOptions: {
18+
ecmaVersion: 2020,
19+
globals: globals.browser,
20+
parserOptions: {
21+
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
22+
tsconfigRootDir: import.meta.dirname,
23+
},
24+
},
25+
settings: { react: { version: "18.3" } },
26+
plugins: {
27+
react: react,
28+
"react-hooks": reactHooks,
29+
"react-refresh": reactRefresh,
30+
},
31+
rules: {
32+
...reactHooks.configs.recommended.rules,
33+
"react-refresh/only-export-components": [
34+
"warn",
35+
{ allowConstantExport: true },
36+
],
37+
},
38+
},
39+
);

app/index.html

+13
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="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React + TS</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)