Skip to content

fix(ui): fix typescript errors so the lib can be typechecked - #7905

Merged
shoom3301 merged 1 commit into
cowprotocol:developfrom
tenderdeve:fix/7828-ui-font-declarations
Jul 27, 2026
Merged

shoom3301 merged 1 commit into
cowprotocol:developfrom
tenderdeve:fix/7828-ui-font-declarations

Conversation

@tenderdeve

@tenderdeve tenderdeve commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Part of #7828 — scoped to the ui lib (one lib per PR, as the issue suggests).

tsc -p libs/ui/tsconfig.lib.json failed with 25 TS2307 errors, all from the .woff2 font imports in src/fonts.ts having no module declaration. (skipLibCheck doesn't help here — the fonts are bare module specifiers, not third-party .d.ts.)

  • Add ambient *.woff/*.woff2 declarations in libs/ui/src/declarations.d.ts, matching the pattern already used in apps/explorer and apps/widget-configurator.
  • Add a typecheck target to libs/ui/project.json (same as cowswap-frontend) so the lib is covered going forward.

nx typecheck ui now passes cleanly. Happy to follow up with the remaining libs in separate PRs.

Summary by CodeRabbit

  • Improvements
    • Added automated type checking for the UI library to help catch issues earlier.
    • Improved support for importing WOFF and WOFF2 font files, enabling more reliable custom font usage.

The ui lib failed to compile because the .woff2 font imports in fonts.ts had no
module declaration (TS2307). Add ambient *.woff/*.woff2 declarations (matching
the explorer and widget-configurator apps) and wire up a typecheck target so the
lib is covered by CI.

Part of cowprotocol#7828.
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

@tenderdeve is attempting to deploy a commit to the cow-dev Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3f30f17e-3727-42f3-96fb-02e821e2f74b

📥 Commits

Reviewing files that changed from the base of the PR and between 37e9cff and 3880100.

📒 Files selected for processing (2)
  • libs/ui/project.json
  • libs/ui/src/declarations.d.ts

Walkthrough

The UI library gains an Nx typecheck target and ambient declarations for .woff and .woff2 font imports.

Changes

UI TypeScript support

Layer / File(s) Summary
Typecheck target and font declarations
libs/ui/project.json, libs/ui/src/declarations.d.ts
Adds a no-emit TypeScript check using the library configuration and permits WOFF and WOFF2 font asset imports.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

A bunny checks the types with care,
While fonts hop lightly through the air.
WOFF and WOFF2 join the queue,
No emitted files, just checks anew.
Tiny changes, tidy and bright—
The UI compiles just right!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is useful, but it doesn't follow the template: it lacks explicit Summary, To Test, and Background sections with checklist items. Add the required Summary, To Test, and Background sections, including concrete verification steps and the issue reference in template format.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main fix: resolving TypeScript errors so the ui library can be typechecked.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kernelwhisperer
kernelwhisperer requested a review from a team July 27, 2026 08:04
@shoom3301
shoom3301 merged commit d801907 into cowprotocol:develop Jul 27, 2026
4 of 10 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants