Skip to content

Commit 4d2cf3b

Browse files
committed
init
0 parents  commit 4d2cf3b

62 files changed

Lines changed: 19669 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
check:
14+
name: Check
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '20'
24+
25+
- name: Install pnpm
26+
uses: pnpm/action-setup@v4
27+
with:
28+
version: 9
29+
30+
- name: Install frontend dependencies
31+
working-directory: axum-sql-viewer/frontend
32+
run: pnpm install --frozen-lockfile
33+
34+
- name: Build frontend
35+
working-directory: axum-sql-viewer/frontend
36+
run: pnpm build
37+
38+
- name: Setup Rust
39+
uses: dtolnay/rust-toolchain@stable
40+
with:
41+
components: rustfmt, clippy
42+
43+
- name: Cache cargo registry
44+
uses: actions/cache@v4
45+
with:
46+
path: |
47+
~/.cargo/registry
48+
~/.cargo/git
49+
target
50+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
51+
52+
- name: Check formatting
53+
run: cargo fmt --all -- --check
54+
55+
- name: Clippy
56+
run: cargo clippy --all-targets --all-features -- -D warnings
57+
58+
- name: Build
59+
run: cargo build --all-targets
60+
61+
- name: Run tests
62+
run: cargo test --all-targets
63+
64+
frontend-lint:
65+
name: Frontend Lint
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Checkout repository
69+
uses: actions/checkout@v4
70+
71+
- name: Setup Node.js
72+
uses: actions/setup-node@v4
73+
with:
74+
node-version: '20'
75+
76+
- name: Install pnpm
77+
uses: pnpm/action-setup@v4
78+
with:
79+
version: 9
80+
81+
- name: Install dependencies
82+
working-directory: axum-sql-viewer/frontend
83+
run: pnpm install --frozen-lockfile
84+
85+
- name: Type check
86+
working-directory: axum-sql-viewer/frontend
87+
run: pnpm tsc --noEmit
88+
89+
- name: Lint
90+
working-directory: axum-sql-viewer/frontend
91+
run: pnpm lint

.github/workflows/publish.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Publish to crates.io
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
dry_run:
10+
description: 'Dry run (do not actually publish)'
11+
required: false
12+
default: 'true'
13+
type: boolean
14+
15+
env:
16+
CARGO_TERM_COLOR: always
17+
18+
jobs:
19+
publish:
20+
name: Publish
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '20'
30+
31+
- name: Install pnpm
32+
uses: pnpm/action-setup@v4
33+
with:
34+
version: 9
35+
36+
- name: Install frontend dependencies
37+
working-directory: axum-sql-viewer/frontend
38+
run: pnpm install --frozen-lockfile
39+
40+
- name: Build frontend
41+
working-directory: axum-sql-viewer/frontend
42+
run: pnpm build
43+
44+
- name: Setup Rust
45+
uses: dtolnay/rust-toolchain@stable
46+
47+
- name: Cache cargo registry
48+
uses: actions/cache@v4
49+
with:
50+
path: |
51+
~/.cargo/registry
52+
~/.cargo/git
53+
target
54+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
55+
56+
- name: Verify build
57+
run: cargo build --release -p axum-sql-viewer
58+
59+
- name: Run tests
60+
run: cargo test --release -p axum-sql-viewer
61+
62+
- name: Dry run publish
63+
if: github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true'
64+
run: cargo publish --dry-run -p axum-sql-viewer --allow-dirty
65+
66+
- name: Publish to crates.io
67+
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'false')
68+
env:
69+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
70+
run: cargo publish -p axum-sql-viewer --allow-dirty

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
target
2+
node_modules
3+
example-server/data

.vscode/settings.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"restoreTerminals.terminals": [
3+
{
4+
"splitTerminals": [
5+
{
6+
"name": "frontend dev server",
7+
"commands": ["cd axum-sql-viewer/frontend", "pnpm dev"]
8+
}
9+
]
10+
},
11+
{
12+
"splitTerminals": [
13+
{
14+
"name": "claude",
15+
"commands": ["claude"]
16+
},
17+
{
18+
"name": "example server",
19+
"commands": ["cd example-server", "cargo run"]
20+
}
21+
]
22+
}
23+
]
24+
}

CLAUDE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Development
2+
3+
## Frontend Development Server
4+
5+
For development, use the running dev server at http://localhost:5174/
6+
7+
This provides hot module replacement for faster iteration on frontend changes. Do NOT run `pnpm build` during development - the dev server automatically reloads when files change.
8+
9+
## Backend Server
10+
11+
The example server runs at http://127.0.0.1:3000/
12+
13+
- Health check: http://127.0.0.1:3000/api/health
14+
- SQL Viewer: http://127.0.0.1:3000/sql-viewer
15+
16+
## Code Style
17+
18+
- Use React 19 class-based PureComponents
19+
- No abbreviations in code (use `ascending` not `asc`, etc.)
20+
- Use react-window VariableSizeList for virtualized scrolling

0 commit comments

Comments
 (0)