Skip to content

ci: build @dtpr/ui + api/schema before typecheck in deploy workflows#268

Merged
helpful-places-it merged 1 commit intomainfrom
feat/fix-api-deploy
Apr 17, 2026
Merged

ci: build @dtpr/ui + api/schema before typecheck in deploy workflows#268
helpful-places-it merged 1 commit intomainfrom
feat/fix-api-deploy

Conversation

@pichot
Copy link
Copy Markdown
Member

@pichot pichot commented Apr 17, 2026

Summary

  • API deploy failed on the PR feat(ui): @dtpr/ui component library + MCP render_datachain tool #267 merge commit with TS2307 errors: @dtpr/ui/html, @dtpr/ui/core, @dtpr/api/schema, and @dtpr/api/validator were unresolvable.
  • Those subpaths resolve through each package's exports map to dist/ files (Vite library mode for @dtpr/ui, tsup for @dtpr/api's schema/validator). When the deploy workflow runs tsc --noEmit straight after install, no dist/ exists yet, so every subpath import blows up.
  • api-test.yaml already runs build:schema and @dtpr/ui build before typecheck (api-test.yaml:31-34). The two deploy workflows just need the same prebuild steps.

Changes

  • .github/workflows/api-deploy.yaml: run pnpm --filter ./api build:schema and pnpm --filter @dtpr/ui build before typecheck.
  • .github/workflows/api-preview-deploy.yaml: same prebuild, so label-gated preview deploys can't regress the same way.

Test plan

  • Reproduced TS2307 locally by running pnpm --filter ./api typecheck against a clean install.
  • Verified pnpm --filter ./api build:schema && pnpm --filter @dtpr/ui build && pnpm --filter ./api typecheck passes.
  • pnpm --filter ./api test passes after the prebuild.
  • CI: API deploy must go green on merge (the actual prod deploy will then run, which also needs the secrets to be intact).

🤖 Generated with Claude Code

The API deploy workflow runs `tsc --noEmit` to re-check the deploy
artifact, but @dtpr/ui and @dtpr/api's /schema and /validator subpaths
resolve through their package `exports` to dist/ files. With no dist/
present, TS2307 fires on every subpath import and the deploy fails.

Mirror the prebuild ordering already used by api-test.yaml in both the
production and preview deploy workflows.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 17, 2026

Greptile Summary

This PR fixes TS2307 import resolution failures in the two API deploy workflows by adding the same build:schema + @dtpr/ui build prebuild steps that already existed in api-test.yaml. The fix is minimal, well-documented, and consistent across both workflows.

Confidence Score: 5/5

Safe to merge — minimal, targeted CI fix with no logic changes and no new risk introduced.

All findings are P2 or lower; both deploy workflows now match the proven prebuild pattern already in api-test.yaml. The fix is well-documented and the PR description includes a local reproduction + verification.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/api-deploy.yaml Adds build:schema and @dtpr/ui build prebuild steps before typecheck/test, mirroring the pattern in api-test.yaml. No issues found.
.github/workflows/api-preview-deploy.yaml Same prebuild fix applied consistently; prebuild steps correctly precede the Resolve newest beta schema version step and the typecheck/test steps. No issues found.

Sequence Diagram

sequenceDiagram
    participant GH as GitHub Actions
    participant pnpm
    participant tsc as tsc --noEmit
    participant CF as Cloudflare

    GH->>pnpm: install --frozen-lockfile
    pnpm-->>GH: node_modules/ (no dist/)

    Note over GH,tsc: NEW: prebuild steps (fix for TS2307)
    GH->>pnpm: --filter ./api build:schema
    pnpm-->>GH: api/dist/ (schema + validator)
    GH->>pnpm: --filter @dtpr/ui build
    pnpm-->>GH: packages/ui/dist/

    GH->>tsc: --filter ./api typecheck
    tsc-->>GH: ✓ (subpath imports now resolve)
    GH->>pnpm: --filter ./api test
    pnpm-->>GH: ✓

    GH->>pnpm: schema:build $VERSION
    pnpm-->>GH: bundle artifact

    GH->>CF: wrangler deploy
    CF-->>GH: ✓ deployed
    GH->>CF: r2-upload.ts $VERSION
    CF-->>GH: ✓ uploaded
Loading

Reviews (1): Last reviewed commit: "ci: build @dtpr/ui + api/schema before t..." | Re-trigger Greptile

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
dtpr-docs 5b88924 Apr 17 2026, 02:05 PM

@helpful-places-it helpful-places-it merged commit 5e6e18b into main Apr 17, 2026
5 checks passed
@helpful-places-it helpful-places-it deleted the feat/fix-api-deploy branch April 17, 2026 14:14
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.

2 participants