Skip to content

CLI DX: preview auto-deploys to Anvil when manifest is not deployed#21

Merged
snissn merged 1 commit into
masterfrom
feat/cli-dx-autofix
Feb 5, 2026
Merged

CLI DX: preview auto-deploys to Anvil when manifest is not deployed#21
snissn merged 1 commit into
masterfrom
feat/cli-dx-autofix

Conversation

@snissn

@snissn snissn commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Problem

Even with the improved th dev flow, users still commonly reach for th preview directly. If the build manifest still has the placeholder deploymentEntrypointAddress = 0x0, the UI shows “Not deployed” and users don’t know what to do next.

Change

th preview now detects this case and automatically deploys to Anvil (chainId 31337) before serving the UI:

  • Reads <buildDir>/manifest.json
  • If primary deployment address is 0x0 and chainId is Anvil:
    • ensures Anvil is running (starts it if needed)
    • runs the same deploy logic as th deploy (updates + republishes manifest into ui-site/)
    • then serves the site

Safety

  • Auto-deploy is limited to Anvil (local dev) by default.
  • Can be disabled via th preview --no-deploy.
  • Anvil auto-start can be disabled via --no-start-anvil.

How to test

  1. pnpm th build apps/example/job-board.schema.json --out artifacts/job-board
  2. pnpm th preview artifacts/job-board
    • expected: it deploys automatically and the UI loads without the “Not deployed” state.

@snissn snissn merged commit 84d7b3a into master Feb 5, 2026
1 check passed
@snissn snissn deleted the feat/cli-dx-autofix branch February 5, 2026 09:43
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