feat(deploy): inline README into playground metadata#36
Merged
UtkarshBhardwaj007 merged 1 commit intomainfrom Apr 20, 2026
Merged
feat(deploy): inline README into playground metadata#36UtkarshBhardwaj007 merged 1 commit intomainfrom
UtkarshBhardwaj007 merged 1 commit intomainfrom
Conversation
`dot deploy --playground` now reads README.md from the project root and
inlines it into the metadata JSON so published apps render a readme on
their playground detail page. Previously only { repository } was
written, so every app showed "No readme provided."
- Adds readReadme() helper with a 20 KB cap and tagged-union return
({ ok, oversized, missing }).
- Uses readdirSync + case-insensitive regex for discovery so casing
variations (README.md / readme.md / Readme.md) resolve uniformly on
case-sensitive filesystems (Linux CI).
- Oversized READMEs are dropped silently from the payload; the confirm
stage surfaces a warning Callout with actual vs. allowed size before
the user presses Enter. Missing READMEs are a silent no-op.
- Exposes readReadme / README_CAP_BYTES / ReadmeStatus on the deploy
SDK surface so the TUI layer can prompt without duplicating IO.
No contract change needed — the registry already stores a metadata_uri
pointer, and the reader side (AppDetailPanel) already renders
metadata.readme via marked + DOMPurify.
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 --playgroundnow readsREADME.mdfrom the project root and inlines it into the playground metadata JSON. Previously only{ repository }was written, so every published app showed "No readme provided." on its detail page."readme will not be uploaded"with actual vs. allowed size) before the user presses Enter to deploy.README.mdat their root.metadata_uripointer, and the reader side (playground-appAppDetailPanel) already rendersmetadata.readmeviamarked+DOMPurify— it was half-built; this PR completes the writer side.Implementation notes
readReadme(cwd, capBytes?)helper insrc/utils/deploy/playground.tsreturns a tagged union{ kind: "ok" | "oversized" | "missing" }. UsesreaddirSync+ case-insensitive regex so casing variants (README.md/readme.md/Readme.md) resolve uniformly on case-sensitive filesystems (Linux CI).publishToPlaygroundconsumes the helper; only inlines onkind === "ok".DeployScreen.ConfirmStageruns the same helper once (memoized) and renders the warning Callout only forkind === "oversized". Deploy utils stay free of React/Ink imports per the SDK/WebContainer boundary documented inCLAUDE.md.readReadme,README_CAP_BYTES, andReadmeStatusare re-exported fromsrc/utils/deploy/index.tsso the TUI layer consumes the same helper rather than duplicating IO.Follow-up (out of scope)
The
playground-app's in-browser publish form (App.tsx:483-489) also omitsreadmefrom the metadata it builds. Separate repo, separate PR — flagged for later.Test plan
readReadme: ok / oversized / missing / custom cap / lowercasereadme.md/ titlecasedReadme.md(6 cases).publishToPlayground: README inlined when under cap; omitted when oversized. Existing tests updated to pass explicit tmpdirs so they don't accidentally pick up the CLI's own README.pnpm vitest run— 203/203 passing.pnpm exec tsc --noEmit— clean.pnpm exec biome checkon touched files — clean..changeset/inline-readme-in-playground-metadata.md(minor bump, user-voiced).dot deploy --playgroundagainst a repo with a normal-sizedREADME.mdand confirm the playground detail page shows it rendered.