Skip to content

Commit 69c4b17

Browse files
authored
ci: add lint/typecheck/build checks and fix lint errors (#22)
1 parent 21b2a34 commit 69c4b17

17 files changed

Lines changed: 230 additions & 151 deletions

.github/workflows/build.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ name: build
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [main]
76
paths:
87
- 'src/**'
98
- 'public/**'
109
- 'package.json'
1110
- 'bun.lock'
1211
- 'tsconfig.json'
1312
- 'panda.config.ts'
14-
- 'eslint.config.js'
13+
- 'biome.json'
1514
- 'Dockerfile'
1615
- 'fly.toml'
1716
- 'nginx.conf'
@@ -33,9 +32,6 @@ jobs:
3332
- name: Install dependencies
3433
run: bun install --frozen-lockfile
3534

36-
- name: Type check
37-
run: bun run typecheck
38-
3935
- name: Build
4036
run: bun run build
4137
env:

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ci-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
lint:
15+
name: Lint
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup Bun
21+
uses: oven-sh/setup-bun@v2
22+
with:
23+
bun-version: latest
24+
25+
- name: Install dependencies
26+
run: bun install --frozen-lockfile
27+
28+
- name: Run Biome lint
29+
run: bun run lint
30+
31+
typecheck:
32+
name: Type Check
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- name: Setup Bun
38+
uses: oven-sh/setup-bun@v2
39+
with:
40+
bun-version: latest
41+
42+
- name: Install dependencies
43+
run: bun install --frozen-lockfile
44+
45+
- name: Type check
46+
run: bun run typecheck
47+
48+
build:
49+
name: Build
50+
runs-on: ubuntu-latest
51+
needs: [typecheck]
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Setup Bun
56+
uses: oven-sh/setup-bun@v2
57+
with:
58+
bun-version: latest
59+
60+
- name: Install dependencies
61+
run: bun install --frozen-lockfile
62+
63+
- name: Build
64+
run: bun run build
65+
env:
66+
VITE_POSTGREST_URL: https://yaci-explorer-apis.fly.dev
67+
VITE_CHAIN_REST_ENDPOINT: https://api.republicai.io

.github/workflows/preview.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Disabled - requires FLY_API_TOKEN secret to be configured
2+
# To re-enable: remove 'if: false' from the preview job
3+
14
name: Preview Deployment
25

36
on:
@@ -23,6 +26,7 @@ env:
2326

2427
jobs:
2528
preview:
29+
if: false # Disabled until FLY_API_TOKEN is configured
2630
runs-on: ubuntu-latest
2731
steps:
2832
- uses: actions/checkout@v4

src/components/JsonViewer.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,18 @@ function JsonNode({ data, name, level = 0, isLast = true }: JsonNodeProps) {
7171

7272
return (
7373
<div>
74-
<div
75-
role="button"
76-
tabIndex={0}
74+
<button
75+
type="button"
7776
className={css({
7877
display: 'flex',
7978
gap: '2',
8079
py: '0.5',
8180
cursor: 'pointer',
8281
rounded: 'md',
82+
bg: 'transparent',
83+
border: 'none',
84+
w: 'full',
85+
textAlign: 'left',
8386
_hover: { bg: 'bg.muted/50' }
8487
})}
8588
style={{ paddingLeft: `${indent}px` }}
@@ -96,7 +99,7 @@ function JsonNode({ data, name, level = 0, isLast = true }: JsonNodeProps) {
9699
{isArray ? '[' : '{'}
97100
{!isExpanded && <span className={css({ fontSize: 'xs', color: 'fg.muted', ml: '1' })}>{preview}</span>}
98101
</span>
99-
</div>
102+
</button>
100103

101104
{isExpanded && (
102105
<>

src/components/MessageDetails.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ export function MessageDetails({ type, metadata, events }: MessageDetailsProps)
197197
const inputs = metadata.inputs || []
198198
const outputs = metadata.outputs || []
199199

200-
// Calculate total amounts
201-
const totalInputAmount = inputs.reduce((sum, input) => {
200+
// Calculate total amounts (currently unused, kept for potential display)
201+
const _totalInputAmount = inputs.reduce((sum, input) => {
202202
return sum + input.coins.reduce((coinSum, coin) => coinSum + BigInt(coin.amount), BigInt(0))
203203
}, BigInt(0))
204204

@@ -522,7 +522,7 @@ export function MessageDetails({ type, metadata, events }: MessageDetailsProps)
522522
// IBC Transfer
523523
if (type === '/ibc.applications.transfer.v1.MsgTransfer') {
524524
// Try to get actual sent amount from send_packet or transfer event
525-
const sendPacketAmount = getEventAttribute(events || [], 'send_packet', 'packet_data_hex')
525+
const _sendPacketAmount = getEventAttribute(events || [], 'send_packet', 'packet_data_hex')
526526
const transferAmountStr = getEventAttribute(events || [], 'transfer', 'amount')
527527
const transferAmounts = transferAmountStr ? parseMultiDenomAmount(transferAmountStr) : []
528528

@@ -570,7 +570,7 @@ export function MessageDetails({ type, metadata, events }: MessageDetailsProps)
570570
try {
571571
const decoded = atob(metadata.msg)
572572
decodedMsg = JSON.parse(decoded)
573-
} catch (e) {
573+
} catch {
574574
// Ignore decode errors
575575
}
576576
}

0 commit comments

Comments
 (0)