Skip to content

Fix: CI migration coverage, stale docs, ui-demo gaps, cn() duplication#1259

Merged
ogazboiz merged 4 commits into
LabsCrypt:mainfrom
MethelyDev:main
Jun 27, 2026
Merged

Fix: CI migration coverage, stale docs, ui-demo gaps, cn() duplication#1259
ogazboiz merged 4 commits into
LabsCrypt:mainfrom
MethelyDev:main

Conversation

@MethelyDev

Copy link
Copy Markdown

Summary

Four independent issues addressed in separate commits on this branch:

closes #1252
closes #1245
closes #1246
closes#1248

[CI] Add migration-from-scratch CI job (#1252)

The migration-check job already had a Postgres service and ran migrate:up, but was missing:

  • A migrate:down → migrate:up cycle to catch irreversible migrations and ordering collisions (the duplicate timestamp prefixes noted in the issue would surface here)
  • Path-based triggering so the job only fires on PRs that touch backend/migrations/** or backend/package.json, while always running on pushes to main

Changes:

  • .github/workflows/ci.yml — add a migration-paths job using dorny/paths-filter@v3; make migration-check depend on it with an if guard; extend the job with a full down-loop then a second migrate:up run

[Docs] Rewrite stale frontend/README.md (#1245)

Every section of the README described planned features as if they hadn't shipped. Updated to reflect the actual codebase:

  • Tech Stack — add Zustand, React Query, @stellar/freighter-api, next-intl, Sentry, Framer Motion, Recharts; remove never-integrated Stellar Wallet Kit
  • Available Scripts — add test, test:watch, test:e2e, typecheck, format, audit:a11y; correct lint description (prettier --check, not ESLint)
  • State Management — document the six Zustand stores instead of planned Context API
  • Wallet Integration — document @stellar/freighter-api usage instead of the planned kit
  • Component Library — document all 22 ui/ components with prop tables
  • Routing — replace the stale / and /404 table with the full /[locale]/* route list
  • Project Structure — remove non-existent tailwind.config.ts; document Tailwind 4's CSS-first @import "tailwindcss" + @theme token approach in globals.css
  • Testing — document Jest unit tests and Playwright e2e specs as already shipped

Changes: frontend/README.md

[Docs] Extend ui-demo gallery and gate route from production (#1246)

The ui-demo route only showcased 4 of 22 components and silently shipped to production under every locale.

  • Production gatenotFound() called at the top of the page when NODE_ENV === "production"; the route returns 404 in all production builds
  • Extended coverage — gallery now covers 10 components: Button, Input, Card, Modal (existing) + Skeleton (all 4 variants), EmptyState, StatusIndicator, LoanStatusBadge, Tooltip, PaginationControls, CopyButton, ThemeToggle

Changes: frontend/src/app/[locale]/ui-demo/page.tsx

[Frontend] Remove duplicate cn() helpers in ui/ components (#1248)

Button.tsx, Card.tsx, and EmptyState.tsx each copy-pasted an identical local cn(clsx+twMerge) function instead of importing the shared helper already used by Input.tsx and Modal.tsx.

  • Removed local cn function and the unused clsx / twMerge imports from all three files
  • Added import { cn } from "@/app/utils/cn" to each

Changes: frontend/src/app/components/ui/Button.tsx, Card.tsx, EmptyState.tsx


Test plan

  • CI: open a PR that modifies a file in backend/migrations/ and verify the migration-check job runs; open one that does not and verify it is skipped
  • CI: confirm migration-check passes the full up → down → up cycle on the 34 existing migrations
  • Frontend: run npm run typecheck in frontend/ — should pass with no new errors
  • Frontend: visit /en/ui-demo in development — should render all sections including Skeleton, EmptyState, etc.
  • Frontend: build for production (npm run build) and confirm /en/ui-demo returns 404
  • Frontend: run npm test — existing unit tests should still pass (cn() change is behaviour-preserving)
  • Docs: verify README scripts section matches package.json scripts

Files changed

.github/workflows/ci.yml
frontend/README.md
frontend/src/app/[locale]/ui-demo/page.tsx
frontend/src/app/components/ui/Button.tsx
frontend/src/app/components/ui/Card.tsx
frontend/src/app/components/ui/EmptyState.tsx

Add a migration-paths job using dorny/paths-filter so migration-check
only triggers on PRs that touch backend/migrations/ or backend/package.json
(always runs on pushes to main). Add migrate:down loop and second migrate:up
to catch irreversible migrations and ordering bugs before they reach staging.
…, EmptyState

Button.tsx, Card.tsx and EmptyState.tsx each defined an identical local
cn(clsx+twMerge) function. Replace all three with import { cn } from
'@/app/utils/cn', the shared source of truth already used by Input and Modal.
Remove the now-unused clsx and twMerge imports from each file.
…rom production

Add notFound() guard so the /[locale]/ui-demo route returns 404 in production
builds. Extend the gallery from 4 components (Button, Input, Card, Modal) to
10, adding Skeleton (Skeleton/SkeletonText/SkeletonCard/SkeletonRow), EmptyState,
StatusIndicator, LoanStatusBadge, Tooltip, PaginationControls, CopyButton and
ThemeToggle. Add a SectionHeading helper to reduce repetition.
Update every stale section to match the actual codebase:

- Tech Stack: add Zustand, React Query, freighter-api, next-intl, Sentry,
  Framer Motion, Recharts; remove Stellar Wallet Kit (never integrated)
- Available Scripts: add test, test:watch, test:e2e, typecheck, format,
  audit:a11y; correct lint description (prettier --check, not ESLint)
- State Management: document six Zustand stores instead of planned Context API
- Wallet Integration: document @stellar/freighter-api instead of planned kit
- Component Library: document all 22 ui/ components with props and descriptions
- Routing: replace /,/404 with the real /[locale]/* route table
- Project Structure: remove non-existent tailwind.config.ts; document
  Tailwind 4 CSS-first setup via globals.css @import and @theme tokens
- Testing: document Jest unit tests and Playwright e2e specs as shipped
@ogazboiz ogazboiz merged commit 7166886 into LabsCrypt:main Jun 27, 2026
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment