ci: build @dtpr/ui + api/schema before typecheck in deploy workflows#268
ci: build @dtpr/ui + api/schema before typecheck in deploy workflows#268helpful-places-it merged 1 commit intomainfrom
Conversation
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 SummaryThis PR fixes Confidence Score: 5/5Safe 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.
|
| 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
Reviews (1): Last reviewed commit: "ci: build @dtpr/ui + api/schema before t..." | Re-trigger Greptile
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
dtpr-docs | 5b88924 | Apr 17 2026, 02:05 PM |
Summary
API deployfailed on the PR feat(ui): @dtpr/ui component library + MCP render_datachain tool #267 merge commit withTS2307errors:@dtpr/ui/html,@dtpr/ui/core,@dtpr/api/schema, and@dtpr/api/validatorwere unresolvable.exportsmap todist/files (Vite library mode for@dtpr/ui, tsup for@dtpr/api's schema/validator). When the deploy workflow runstsc --noEmitstraight after install, nodist/exists yet, so every subpath import blows up.api-test.yamlalready runsbuild:schemaand@dtpr/ui buildbefore typecheck (api-test.yaml:31-34). The two deploy workflows just need the same prebuild steps.Changes
.github/workflows/api-deploy.yaml: runpnpm --filter ./api build:schemaandpnpm --filter @dtpr/ui buildbeforetypecheck..github/workflows/api-preview-deploy.yaml: same prebuild, so label-gated preview deploys can't regress the same way.Test plan
TS2307locally by runningpnpm --filter ./api typecheckagainst a clean install.pnpm --filter ./api build:schema && pnpm --filter @dtpr/ui build && pnpm --filter ./api typecheckpasses.pnpm --filter ./api testpasses after the prebuild.API deploymust go green on merge (the actual prod deploy will then run, which also needs the secrets to be intact).🤖 Generated with Claude Code