Skip to content

Commit 2e2a22e

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

22 files changed

Lines changed: 3323 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

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
};

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+
```

tools/trace-ui/components.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/index.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"iconLibrary": "lucide",
14+
"aliases": {
15+
"components": "@/components",
16+
"utils": "@/lib/utils",
17+
"ui": "@/components/ui",
18+
"lib": "@/lib",
19+
"hooks": "@/hooks"
20+
},
21+
"registries": {}
22+
}

tools/trace-ui/eslint.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import js from "@eslint/js";
2+
import eslintConfigPrettierFlat from "eslint-config-prettier/flat";
3+
import reactHooks from "eslint-plugin-react-hooks";
4+
import reactRefresh from "eslint-plugin-react-refresh";
5+
import { defineConfig, globalIgnores } from "eslint/config";
6+
import globals from "globals";
7+
import tseslint from "typescript-eslint";
8+
9+
export default defineConfig([
10+
globalIgnores(["dist"]),
11+
{
12+
files: ["**/*.{ts,tsx}"],
13+
extends: [
14+
js.configs.recommended,
15+
tseslint.configs.recommended,
16+
reactHooks.configs.flat["recommended-latest"],
17+
reactRefresh.configs.vite,
18+
eslintConfigPrettierFlat,
19+
],
20+
languageOptions: {
21+
ecmaVersion: 2020,
22+
globals: globals.browser,
23+
},
24+
},
25+
]);

0 commit comments

Comments
 (0)