Add dot build + dot deploy with two signer modes and playground publish#19
Merged
UtkarshBhardwaj007 merged 1 commit intomainfrom Apr 17, 2026
Merged
Add dot build + dot deploy with two signer modes and playground publish#19UtkarshBhardwaj007 merged 1 commit intomainfrom
UtkarshBhardwaj007 merged 1 commit intomainfrom
Conversation
Introduces `dot build` and a fully-rewritten `dot deploy` plus the supporting infrastructure (config module, process-guard, signer-mode matrix, signing proxy, availability preflight, CAR-upload wrapper, playground registry publisher, Ink TUI). Key behaviours -------------- * `dot build` auto-detects the package manager (pnpm/yarn/bun/npm from the lockfile) and runs the `build` script, falling back to vite/next/tsc when no script is defined. * `dot deploy` prompts for signer (dev/phone), build dir, domain, and publish-to-playground, or runs fully headless when all four flags are passed. After inputs resolve, the TUI announces exactly how many phone approvals will be needed and what each is for. * Dev mode uploads + DotNS use bulletin-deploy's default pool mnemonic (0 phone taps for the heavy work). Phone mode signs DotNS with the user's session signer (3 taps). Playground publish is always signed by the user so `registry.publish`'s `env::caller()` records them as the app owner. * Domain availability is checked before build: `classifyName` catches Reserved names; `checkOwnership(label, ss58ToH160(user))` correctly identifies "owned by you → update" vs "owned by someone else → taken". Defense in depth ---------------- * SIGINT/SIGTERM/SIGHUP + unhandledRejection handlers run cleanup and force-exit within 3 s. * `unref`'d hard-exit timer fires if a stray WebSocket keeps the event loop alive after the main flow returns. * 4 GB RSS watchdog aborts on runaway growth. `DOT_MEMORY_TRACE=1` streams per-sample memory stats. * `BULLETIN_DEPLOY_TELEMETRY=0` forced at CLI entry (Sentry off by default). * Bun compiled-binary stdin warm-up listener (required for Ink `useInput`). Non-obvious choices ------------------- * `bulletin-deploy` pinned to `0.6.9-rc.6`; the `latest` dist-tag still points at 0.6.8 which has a WS heartbeat bug. Don't revert to `latest`. * `jsMerkle: true` intentionally NOT passed to `bulletin-deploy` — the pure-JS merkleizer produces CARs missing their DAG-PB structural blocks (verified against a real deployed CAR). Kubo binary path is used instead; `dot init` installs `ipfs`. * Playground metadata upload uses a dedicated Bulletin client with a 300 s WS heartbeat, not the shared `getConnection()` (which uses polkadot-api's 40 s default and tears down mid-tx). * `DeployLogParser` deliberately emits events ONLY for phase banners and `[N/M]` chunk progress — catch-all `info` events were a measurable contributor to 20+ GB heap pressure during long deploys. Ships with 122 tests across 15 files covering the orchestrator event flow, build detection, availability, playground publish, signing proxy, progress parser, and the summary view. All gated by `tsc --noEmit` + `biome format`.
Contributor
|
Dev build ready — try this branch: |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dot buildcommand — auto-detects pnpm/yarn/bun/npm from the lockfile and runs thebuildscript (or falls back to vite/next/tsc when no script is defined).dot deploycommand — interactive 4-prompt TUI (signer / buildDir / domain / publish) with two signer modes, or fully headless when all flags are passed.How to try
How it works at a glance
--signer dev--playground)--signer phone--playground)The playground publish is always signed by the user so the registry records
env::caller()as the app owner — this is what drives the Playground "my apps" view.Commands for reviewers to test
Setup (once)
dot buildExpected: detects the package manager from the lockfile, runs
<pm> run build, streams output to stdout, exits non-zero on failure.dot deploy— interactive (TUI)# From a project dir that has a build output (e.g. vite's dist/) dot deployWalk through: pick a signer (Dev by default), accept
distas build dir, enter a domain, choose whether to publish to Playground. The TUI shows a summary card with exactly how many phone approvals will be requested. Press Enter to proceed.Partial flags (each supplied flag skips its corresponding prompt):
dot deploy— fully headless (all four prompts bypassed)Re-deploy / update
Reserved domain (should block)
Dev signer with an explicit SURI
Environment flag (mainnet guard)
Cancellation behaviour
ps aux | grep dotafterward should show no lingeringdotprocess.Memory diagnostics
If RSS ever exceeds 4 GB the watchdog aborts with a clear error rather than letting the OS swap. A typical healthy deploy sits at 1–1.5 GB peak.
dot deploy --help— flag reference--signer <dev|phone>--domain <name>.dot). Skips the domain prompt.--buildDir <path>dist). Skips the buildDir prompt.--playground--suri <suri>//Alice) — useful for CI.--env <testnet|mainnet>testnetis supported today.--dir <path>Passing all four of
--signer,--domain,--buildDir,--playgroundruns non-interactively.Test plan
dot buildin a Vite project — producesdist/, streams outputdot build --dir ...with an absolute pathdot deployinteractive — full TUI walkthrough in dev mode without playground (0 phone taps)dot deploy --playgroundinteractive — dev mode, 1 phone tap for registry.publishdot deploy --signer phone --playground— 4 phone taps, correct labels on phone ("Reserve domain", "Finalize domain", "Link content", "Publish to Playground registry")polkadot) → availability aborts with a clear reasonps aux)dot deploy --env mainnet→ errors cleanly ("not yet supported")DOT_MEMORY_TRACE=1 dot deploy 2>mem.log→ log shows bounded growthojasvi-aloo.dotor whatever you deployed)--playgroundused)Non-obvious invariants (documented in CLAUDE.md)
bulletin-deploypinned to0.6.9-rc.6. Thelatestnpm tag points at 0.6.8 which has a WS heartbeat bug. Do NOT revert.jsMerkle: trueis deliberately NOT set — bulletin-deploy's pure-JS merkleizer produces CARs with DAG-PB structural blocks missing (verified empirically; Polkadot Desktop would serve 404). We rely on the Kubo binary path;dot initinstallsipfs.DeployLogParseremits events ONLY for phase banners and[N/M]chunk progress. Everything else returns null.src/utils/deploy/*+src/utils/build/*are React/Ink-free so RevX can consume them from a WebContainer.