feat(deploy): add --manifest for machine-readable deploy output#47
Open
shawntabrizi wants to merge 1 commit intomainfrom
Open
feat(deploy): add --manifest for machine-readable deploy output#47shawntabrizi wants to merge 1 commit intomainfrom
shawntabrizi wants to merge 1 commit intomainfrom
Conversation
`dot deploy --contracts` already knows the deployed contract addresses at
the end of the run — `DeployOutcome.contracts` is populated by the
contracts phase — but the info never crossed the process boundary. The
TUI's final screen silently dropped the addresses, and there was no
machine-readable output at all, so downstream tooling had to re-query
the chain for Revive.Instantiated events just to rebuild what the CLI
already had.
Add `--manifest <path>` that writes a versioned JSON file on success:
{
"version": 1,
"fullDomain": "my-app.dot",
"appUrl": "https://my-app.dot.li",
"appCid": "bafy...",
"ipfsCid": "bafy...",
"metadataCid": "bafy...",
"contracts": [{ "name": "ProofOfExistence", "address": "0x..." }]
}
Also surface the deployed contracts in the human-readable output path of
both the TUI and the headless summary — previously hidden in both.
Manifest serialisation lives in src/utils/deploy/manifest.ts so the SDK
consumers (WebContainer / RevX) can format their own manifests without
going through the CLI process boundary. React/Ink-free per the
deploy-SDK invariant.
Contributor
|
Dev build ready — try this branch: |
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 deploy --manifest <path>— writes a versioned JSON manifest on success with domain, app URL, CIDs, and deployed contract addressessrc/utils/deploy/manifest.ts(React/Ink-free per the SDK invariant) + 6 testsWhy
dot deploy --contractsdeploys contracts to Asset Hub and the orchestrator already knows their addresses —DeployOutcome.contracts: Array<{ name; address }>is populated bymaybeRunContractsinrun.ts. But nothing crossed the process boundary:FinalResultcomponent only rendered URL / domain / appCid / ipfsCid / metadataCid.printFinalResultprinted the same set; no contracts line.Downstream tooling (template generators, CIs that wire contract addresses into a frontend build) had two bad options:
Revive.Instantiatedevents from the deployer's address and disambiguate by code hash — requires re-deriving what the CLI already had.Every comparable Solidity deploy tool writes a deployment manifest as a standard part of its flow:
hardhat-deploywritesdeployments/<network>/<name>.json, Hardhat Ignition writesignition/deployments/<id>/deployed_addresses.json, Foundry writesbroadcast/<Script>.s.sol/<chainId>/run-latest.json. Ignition is the closest precedent — also a CLI, also has to expose state across a process boundary — and its manifest shape is what this PR models on.Manifest shape
{ "version": 1, "fullDomain": "my-app.dot", "appUrl": "https://my-app.dot.li", "appCid": "bafy…", "ipfsCid": "bafy…", "metadataCid": "bafy…", "contracts": [{ "name": "ProofOfExistence", "address": "0x…" }] }ipfsCidandmetadataCidare omitted (notnull) when absent, so schema consumers can rely oninchecks. Versioned so future shape changes are non-breaking additions or get aversion: 2bump.Error behaviour
If the manifest write fails (e.g. unwritable path), we log a warning to stderr but do not fail the deploy — the on-chain work is done by the time we write, so blowing up the exit code would mislead CI into retrying a deploy that actually succeeded.
Changes
src/utils/deploy/manifest.tsDeployManifesttype,buildManifest,writeManifest. Stays React/Ink-free per the deploy-SDK invariant.src/utils/deploy/manifest.test.tssrc/commands/deploy/index.ts--manifestoption; both dispatch branches (runHeadless+runInteractive) now returnDeployOutcomeso the write happens in one place, identically, regardless of how the user invokeddot deploy.printFinalResultalso now prints the deployed contracts.src/commands/deploy/DeployScreen.tsxFinalResultnow lists{ name: address }rows for each deployed contract.README.md--manifestwith the format..changeset/deploy-manifest-output.mdminorchangeset.Test plan
pnpm format:checkcleannpx tsc --noEmitcleanpnpm test— 353 passed (up from 347; +6 for manifest)pnpm build—bun build --compileproduces./dist/dotdot deploy --signer dev --domain test-xx --buildDir dist --manifest /tmp/deploy.jsonin a hardhat project, verify/tmp/deploy.jsoncontains the two deployed contracts