Skip to content

fix: build libs in CI job, remove noPropertyAccessFromIndexSignature#7355

Draft
Danziger wants to merge 1 commit into
mainfrom
hotfix/fix-publish-build-issue
Draft

fix: build libs in CI job, remove noPropertyAccessFromIndexSignature#7355
Danziger wants to merge 1 commit into
mainfrom
hotfix/fix-publish-build-issue

Conversation

@Danziger
Copy link
Copy Markdown
Contributor

Summary

CI job will now run typecheck on all projects, including libs, to avoid PRs checks from passing but a library publish step from failing shortly after.

Detailed list of changes:

Root scripts & Nx

  • package.jsontypecheck script is now nx run-many -t typecheck --all --parallel=4 so CI and local runs typecheck all projects with a typecheck target, not only the CowSwap app.
  • nx.jsondefaultBase is set at the root; sync.disabledTaskSyncGenerators includes @nx/js:typescript-sync to avoid conflicting auto-generated TS project sync.
  • tsconfig.json (repo root) — added to avoid nx cli errors when running some commands

Removed noPropertyAccessFromIndexSignature

Dropped from these tsconfig.json files so process.env.NODE_ENV and similar can use dot access without TS4111, without maintaining per-lib ProcessEnv augmentations (this is what broke the previous publish process run).

  • libs/abis/tsconfig.json
  • libs/hook-dapp-lib/tsconfig.json
  • libs/permit-utils/tsconfig.json
  • libs/ui-utils/tsconfig.json
  • libs/wallet-provider/tsconfig.json
  • libs/widget-lib/tsconfig.json

Explicit typecheck targets in project.json

Overrides use nx:run-commands with tsc --noEmit -p … (or a no-op where noted) so inference does not rely solely on tsc --build --emitDeclarationOnly in problematic graphs:

Project Notes
apps/cowswap-frontend tsc --noEmit -p apps/cowswap-frontend/tsconfig.app.json
apps/explorer tsc --noEmit -p apps/explorer/tsconfig.app.json
apps/widget-configurator tsc --noEmit -p apps/widget-configurator/tsconfig.app.json
apps/cowswap-frontend-e2e tsc --noEmit -p apps/cowswap-frontend-e2e/tsconfig.json
libs/ui tsc --noEmit -p libs/ui/tsconfig.lib.json
libs/tokens tsc --noEmit -p libs/tokens/tsconfig.lib.json
libs/snackbars tsc --noEmit -p libs/snackbars/tsconfig.lib.json
libs/multicall tsc --noEmit -p libs/multicall/tsconfig.lib.json (see viem/ox below)
libs/balances-and-allowances tsc --noEmit -p libs/balances-and-allowances/tsconfig.lib.json (same)
libs/wallet command: true — intentional placeholder until viem/ox upstream typing issues are addressed

Other libraries still use the Nx @nx/js inferred typecheck where appropriate (tsc --build --emitDeclarationOnly).

viem / ox and multicall-style libs

For libs/multicall and libs/balances-and-allowances, tsconfig.lib.json sets:

  • moduleResolution: "bundler" — resolves ox/viem through package exports to .d.ts, not node_modules .ts sources.
  • outDir: "../../dist/out-tsc" — declaration output (when emitted) goes under dist/, not next to src/.

Typecheck uses tsc --noEmit so declaration maps do not pull ox sources into the check.

outDir on library tsconfig.lib.json (declaration emit)

Libraries that enable declaration: true now set outDir: "../../dist/out-tsc" (or ../../dist/out-tsc/wallet for wallet) so tsc --build --emitDeclarationOnly does not write .d.ts beside src/. Touched libs include (non-exhaustive): abis, analytics, assets, balances-and-allowances, common-const, common-hooks, common-utils, core, ens, multicall, etc.

.gitignore (safety net)

Ignores accidental emit artifacts if someone runs tsc without the intended config:

  • libs/**/src/**/*.d.ts with !libs/wallet/src/types.d.ts
  • **/jest.config.d.ts
  • **/tsconfig*.tsbuildinfo

Shared ambient types

  • types/cow-protocol-ambient.d.tsdeclare module for @cowprotocol/assets/*, @cowprotocol/assets/fonts/* (nested font paths), *.svg, *.png.
  • libs/wallet/src/types.d.ts/// <reference path="../../../types/cow-protocol-ambient.d.ts" /> plus existing Window.ethereum / @metamask/jazzicon declarations.
  • libs/ui/tsconfig.lib.json — includes ../../types/cow-protocol-ambient.d.ts in files so libs/ui tsc --noEmit resolves font imports.

To Test

The CI job in Github should now run typecheck on all projects.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
explorer-dev Ready Ready Preview Apr 15, 2026 7:15pm
sdk-tools Ready Ready Preview Apr 15, 2026 7:15pm
swap-dev Ready Ready Preview Apr 15, 2026 7:15pm
widget-configurator Ready Ready Preview Apr 15, 2026 7:15pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
cosmos Ignored Ignored Apr 15, 2026 7:15pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: faada220-8c6f-4fe4-ab33-0213dd4eb25a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/fix-publish-build-issue

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 and usage tips.

@socket-security
Copy link
Copy Markdown

@Danziger Danziger marked this pull request as draft April 15, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant