Skip to content

Commit dee43fd

Browse files
committed
feat: initial trace-ui
1 parent 38e838c commit dee43fd

24 files changed

Lines changed: 3351 additions & 1 deletion

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "Duron",
33
"image": "mcr.microsoft.com/devcontainers/python:2-3",
44
"features": {
5+
"ghcr.io/devcontainers/features/node:1": {},
56
"ghcr.io/devcontainers-extra/features/nox:2": {},
67
"ghcr.io/devcontainers-extra/features/uv:1": {}
78
},
@@ -13,7 +14,7 @@
1314
"python.terminal.activateEnvInCurrentTerminal": true,
1415
"python.defaultInterpreterPath": ".venv/bin/python"
1516
},
16-
"extensions": []
17+
"extensions": ["ms-python.python", "svelte.svelte-vscode"]
1718
}
1819
}
1920
}

.github/dependabot.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ updates:
55
schedule:
66
interval: "weekly"
77

8+
- package-ecosystem: "npm"
9+
directory: "/tools/trace-ui"
10+
schedule:
11+
interval: "weekly"
12+
813
- package-ecosystem: "github-actions"
914
directory: "/"
1015
schedule:

.github/workflows/ci.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,28 @@ jobs:
3838
run: uv run mypy
3939
- name: Run basedpyright
4040
run: uv run basedpyright
41+
42+
trace-ui:
43+
runs-on: ubuntu-latest
44+
defaults:
45+
run:
46+
working-directory: tools/trace-ui
47+
48+
steps:
49+
- uses: actions/checkout@v5
50+
- name: Install pnpm
51+
uses: pnpm/action-setup@v4
52+
with:
53+
package_json_file: "tools/trace-ui/package.json"
54+
- name: Set up Node.js
55+
uses: actions/setup-node@v5
56+
with:
57+
node-version: latest
58+
cache: "pnpm"
59+
cache-dependency-path: "tools/trace-ui/pnpm-lock.yaml"
60+
- name: Install dependencies
61+
run: pnpm install --frozen-lockfile
62+
- name: Run lint
63+
run: pnpm run lint
64+
- name: Run build
65+
run: pnpm run build

.github/workflows/docs.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- main
77
paths:
88
- "docs/**"
9+
- "tools/trace-ui/**"
910
- mkdocs.yaml
1011
workflow_dispatch:
1112

@@ -32,6 +33,31 @@ jobs:
3233
run: uv sync --group docs
3334
- name: Build static files
3435
run: uv run mkdocs build
36+
37+
# Build trace-ui
38+
- name: Install pnpm
39+
uses: pnpm/action-setup@v4
40+
with:
41+
package_json_file: "tools/trace-ui/package.json"
42+
- name: Set up Node.js
43+
uses: actions/setup-node@v5
44+
with:
45+
node-version: latest
46+
cache: "pnpm"
47+
cache-dependency-path: "tools/trace-ui/pnpm-lock.yaml"
48+
- name: Install trace-ui dependencies
49+
working-directory: tools/trace-ui
50+
run: pnpm install --frozen-lockfile
51+
- name: Build trace-ui
52+
working-directory: tools/trace-ui
53+
run: pnpm run build
54+
55+
# Copy trace-ui build to docs site subdirectory
56+
- name: Copy trace-ui to docs
57+
run: |
58+
mkdir -p site/trace-ui
59+
cp -r tools/trace-ui/dist/* site/trace-ui/
60+
3561
- name: Upload static files as artifact
3662
id: deployment
3763
uses: actions/upload-pages-artifact@v4

flake.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
devShells = {
3838
default = pkgs.mkShell {
3939
buildInputs = with pkgs; [
40+
pnpm
41+
nodejs
4042
(python3.withPackages (
4143
p: with p; [
4244
nox
@@ -57,6 +59,11 @@
5759
ruff-format.enable = true;
5860
prettier.enable = true;
5961
};
62+
settings.formatter = {
63+
prettier = {
64+
excludes = [ "tools/trace-ui/**" ];
65+
};
66+
};
6067
};
6168
};
6269
};

mkdocs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ repo_name: "brian14708/duron"
55
nav:
66
- index.md
77
- reference.md
8+
- Trace UI: https://brian14708.github.io/duron/trace-ui/
89

910
theme:
1011
name: material

tools/trace-ui/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

tools/trace-ui/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/pnpm-lock.yaml

tools/trace-ui/.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"plugins": [
3+
"@trivago/prettier-plugin-sort-imports",
4+
"prettier-plugin-tailwindcss"
5+
],
6+
"importOrder": ["^[./]"],
7+
"importOrderSeparation": true,
8+
"importOrderSortSpecifiers": true
9+
}

tools/trace-ui/README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
10+
## React Compiler
11+
12+
The React Compiler is enabled on this template. See [this documentation](https://react.dev/learn/react-compiler) for more information.
13+
14+
Note: This will impact Vite dev & build performances.
15+
16+
## Expanding the ESLint configuration
17+
18+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
19+
20+
```js
21+
export default defineConfig([
22+
globalIgnores(["dist"]),
23+
{
24+
files: ["**/*.{ts,tsx}"],
25+
extends: [
26+
// Other configs...
27+
28+
// Remove tseslint.configs.recommended and replace with this
29+
tseslint.configs.recommendedTypeChecked,
30+
// Alternatively, use this for stricter rules
31+
tseslint.configs.strictTypeChecked,
32+
// Optionally, add this for stylistic rules
33+
tseslint.configs.stylisticTypeChecked,
34+
35+
// Other configs...
36+
],
37+
languageOptions: {
38+
parserOptions: {
39+
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
40+
tsconfigRootDir: import.meta.dirname,
41+
},
42+
// other options...
43+
},
44+
},
45+
]);
46+
```
47+
48+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
49+
50+
```js
51+
// eslint.config.js
52+
import reactDom from "eslint-plugin-react-dom";
53+
import reactX from "eslint-plugin-react-x";
54+
55+
export default defineConfig([
56+
globalIgnores(["dist"]),
57+
{
58+
files: ["**/*.{ts,tsx}"],
59+
extends: [
60+
// Other configs...
61+
// Enable lint rules for React
62+
reactX.configs["recommended-typescript"],
63+
// Enable lint rules for React DOM
64+
reactDom.configs.recommended,
65+
],
66+
languageOptions: {
67+
parserOptions: {
68+
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
69+
tsconfigRootDir: import.meta.dirname,
70+
},
71+
// other options...
72+
},
73+
},
74+
]);
75+
```

0 commit comments

Comments
 (0)