refactor(project create): migrate human output to markdown rendering system#341
Merged
refactor(project create): migrate human output to markdown rendering system#341
Conversation
…system Replace ad-hoc stdout.write() + writeKeyValue() calls in project create with the markdown-first rendering pipeline used by all other detail views (issue view, project view, org view, event view). Changes: - Add formatProjectCreated() to src/lib/formatters/human.ts using mdKvTable(), escapeMarkdownInline(), safeCodeSpan(), and renderMarkdown() - Refactor create.ts human output to a single formatProjectCreated() call - Migrate notes (slug divergence, auto-created team, auto-selected team) to markdown blockquotes - Remove writeKeyValue() from output.ts (project create was its only consumer) - Update test assertions: slug divergence note now uses backtick code spans instead of single quotes TTY output gets Unicode box-drawing tables, styled headings, and terminal hyperlinks. Plain/piped output emits clean CommonMark.
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Trace
Other
Bug Fixes 🐛Api
Formatters
Setup
Upgrade
Other
Documentation 📚
Internal Changes 🔧Api
Other
🤖 This preview updates automatically when you update the PR. |
Contributor
Codecov Results 📊✅ 2681 passed | Total: 2681 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 3107 uncovered lines. Files with missing lines (3)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 82.62% 82.64% +0.02%
==========================================
Files 127 127 —
Lines 17883 17895 +12
Branches 0 0 —
==========================================
+ Hits 14775 14788 +13
- Misses 3108 3107 -1
- Partials 0 0 —Generated by Codecov Action |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
…ated The old code used `project.platform || platform` where `platform` was the user's CLI argument. The migration lost this fallback by hardcoding "unknown". Add `requestedPlatform` field to `ProjectCreatedResult` and use it as fallback when the API response has no platform set.
5 tasks
This was referenced Mar 6, 2026
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.
Migrate
project createfrom ad-hocstdout.write()+writeKeyValue()formatting to the markdown-first rendering pipeline used by all other detail/view commands.Changes
New
formatProjectCreated()inhuman.ts— Builds CommonMark usingmdKvTable(),escapeMarkdownInline(),safeCodeSpan(), andrenderMarkdown(). Notes (slug divergence, auto-created/auto-selected team) use markdown blockquotes. Tip footer uses italic text.Simplified
create.tsoutput path — Replaced ~30 lines of multi-write output with a singleformatProjectCreated()call. JSON output and error handling unchanged.Removed
writeKeyValue()fromoutput.ts— Dead code;project createwas its only consumer.Updated test assertions — Slug divergence note now uses backtick code spans instead of single quotes. All 32 tests pass.
Output
TTY — Unicode box-drawing tables, styled headings, terminal hyperlinks:
Plain/piped — Clean CommonMark (same as all other commands).