You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SDK: export a public TOON decoder (sdk/testing) so extension tests can parse host-rendered output without deep imports or a duplicated @toon-format/toon pin #1462
Extension packages render through the host, so TOON is their default output, and their acceptance tests need to assert on what the host actually printed. The public SDK (@unbrained/pm-cli/sdk, /sdk/testing, /sdk/core, …) exposes no TOON decoder: there is no decodeToon, parseToon or equivalent. Authors fall back to one of three bad options:
Deep-importing internals: import { decodeToonItemContent } from "@unbrained/pm-cli/dist/core/item/toon-decode.js". This sits outside the exports map and can break on any release.
Adding @toon-format/toon as a devDependency pinned to whatever pm-cli uses internally (4.1.1 today). That duplicates the pin, and any skew means the test parser disagrees with the host renderer.
Proposal
Export decodeToon(text) (and ideally encodeToon(value)) from @unbrained/pm-cli/sdk/testing, or from /sdk, backed by exactly the TOON implementation the host renders with.
In the authoring docs, recommend asserting host output as decodeToon(stdout) rather than by string matching.
Optional: createExtensionTestHarness gives a run(...) result exposing .parsed for both --json and TOON output.
That makes extension tests independent of quoting and whitespace changes in the renderer, and removes a reason to reach into dist/.
Activity
unbraind commentedon Oct 13, 2026
Tracked and implemented in pm-gh1462, with full regression and installed-package evidence in PR #1459.