Skip to content

Chore/nvmrc precommit component guide home route coverage - #327

Merged
valoryyaa-byte merged 4 commits into
RWA-ToolKit:mainfrom
Tukura11:chore/nvmrc-precommit-component-guide-home-route-coverage
Aug 31, 2026
Merged

Chore/nvmrc precommit component guide home route coverage#327
valoryyaa-byte merged 4 commits into
RWA-ToolKit:mainfrom
Tukura11:chore/nvmrc-precommit-component-guide-home-route-coverage

Conversation

@Tukura11

Copy link
Copy Markdown
Contributor

Summary

Pins the Node version via .nvmrc and has CI read from it instead of a separately-hardcoded value, adds a typecheck/lint pre-commit hook so
contributors get the same feedback CI already enforces before pushing, writes a component-authoring guide documenting this codebase's real (not
idealized) pattern for handling loading/empty/error/success states and accessibility, and adds route-level test coverage for / including its
stats-read failure degradation path.

Changes

#242 — repo: pin the Node version via .nvmrc and use it in CI

  • .nvmrc added at repo root pinning Node 20, matching CI's hardcoded version
  • .github/workflows/web.yml updated to read node-version-file: '.nvmrc' instead of separate hardcoded value
  • package.json engines field already consistent (no changes needed)
  • README.md updated with Node version setup section and nvm use guidance

#243 — repo: add typecheck and lint as a pre-commit hook

  • husky and lint-staged added as dev dependencies
  • package.json prepare script added to install husky hooks on npm install
  • .husky/pre-commit hook created running npm run typecheck (whole codebase) then npx lint-staged (staged files only)
  • .lintstagedrc.json configured to lint staged *.{js,jsx,ts,tsx} files via next lint --fix
  • Pre-commit hook fails if either typecheck or lint fails; succeeds silently if both pass
  • README.md updated with pre-commit hook documentation and skip guidance

#240 — docs: add a component-authoring guide covering states and accessibility

  • docs/component-authoring.md created documenting this codebase's real, working pattern for the four-state lifecycle (loading, empty, error,
    success)
  • Guide includes concrete examples drawn from existing components (CardSkeletonGrid, Skeleton, ErrorState, EmptyState, TxProgress)
  • Accessibility section documents real conventions used: role="alert" with aria-live="assertive" for errors, role="status" with
    aria-live="polite" for loading/success, aria-label for icon-only buttons, semantic headings, navigation aria-label, and aria-current="page"
    for pagination
  • Includes contributor checklist for new/reviewed components
  • README.md linked to the guide under a new "Component Authoring" section

#244 — test: add route-level coverage for / (home route)

  • app/__tests__/page.test.tsx created with comprehensive coverage
  • Tests verify hero section, platform stats, featured assets, and "How it works" sections render correctly via role/accessible-name queries
  • Tests cover successful rendering of all three featured assets
  • Tests verify all four "How it works" steps and their descriptions render
  • Tests verify closing CTA section and its links
  • Tests confirm page degrades gracefully: even if PlatformStats fails, FeaturedAssets fails, or both fail, the static sections (hero, how-it-works,
    CTA) still render
  • Mocks follow existing pattern: jest.mock() on hooks and components; no shared contracts.ts mock utility added since existing tests mock at hook
    level

Notes

  • Code/docs-only delivery: no install/build/test/scripts run during implementation
  • Committer: Tukura11 (Admailo, fortuneappen@gmail.com)
  • All file changes scoped to allowed targets: .nvmrc (new), .github/workflows/web.yml, .husky/ (new), package.json (dev deps + scripts only),
    README.md, docs/ (new), and app/__tests__/page.test.tsx (new)
  • test: add route-level coverage for / #244 testing: real degradation behavior confirmed — when contract reads fail, components render ErrorState; page structure remains intact. No
    unhandled promise rejections found
  • docs: add a component-authoring guide covering states and accessibility #240 survey: confirmed existing codebase follows the documented four-state pattern consistently across components (AssetExplorer, PlatformStats,
    FeaturedAssets, TxProgress); no components found missing states that would require separate audit

Closes #242, Closes #243, Closes #240, Closes #244

@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@Tukura11 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@valoryyaa-byte
valoryyaa-byte merged commit df00770 into RWA-ToolKit:main Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants