Skip to content

fix(harness): render tasty:styles with the Tasty copy the setups configure - #462

Merged
tenphi merged 3 commits into
mainfrom
claude/scope-gpookh
Nov 13, 2026
Merged

tenphi merged 3 commits into
mainfrom
claude/scope-gpookh

Conversation

@tenphi

@tenphi tenphi commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Why

tasty:styles always rendered with its own copy of Tasty. That breaks in two real setups:

  • A monorepo. harnesspm keeps one version of each harness per repository, but each package can install its own Tasty and its own config.
  • An app next to a UI library with its own Tasty. Cube Cloud, for example, runs next to UI Kit, which pins Tasty exactly.

In both cases a --setup module configures another copy of Tasty, so the CSS lacks part of the config. The agent saw only symptoms ("2cw" … not a Tasty or CSS unit, Recipe "panel" not found) and nothing named the cause.

What changes

Before After
Which Tasty renders the tool's own copy the copy the --setup modules configure; with no setup, the copy the current package imports
--setup @pkg/path resolved from the project root resolved from the current folder up, so each monorepo package finds its own install
Setups that configure two copies silent a warning that names both versions and paths, says which setup went where, and says the app runs both copies too
A setup that changes nothing silent if another setup changed something its own warning
Output tasty.version tasty.version and path; each setup lists the copy it configured

Tokens are left out of the per-copy check, because Tasty shares them between copies through globalThis.

Verification

  • pnpm typecheck, pnpm lint, pnpm format:check, pnpm knip, pnpm check:harness, pnpm test:node (2,330 tests).
  • src/harness.test.ts, 4 new CLI tests on a temp app with a second copy of Tasty (this build, renamed 0.0.0-copy):
    • it renders with the app's own copy;
    • a package path in --setup resolves from the current folder, and both setups merge;
    • two copies produce a warning that names both, and the app's copy wins;
    • a setup that changes nothing gets a warning.
  • Seen in a Cube Cloud–like app before this change: on Tasty 3.18.0, next to UI Kit's 3.19.0, --setup Root.js --setup ./src/cloud-setup.mjs silently lost the app's config. On Tasty 3.19.0 the two configs merged as at runtime.

Generated by Claude Code

Apps on Tasty get an always-on style rule, an index of the docs of the
installed version (docs/llms.txt), and the tasty:styles tool, which prints
the CSS a styles object produces after --setup modules load the app's
configure(), and warns about values that stayed unresolved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gr8S7Ed6WF7j8cpXBKzCuV
…igure

In a monorepo, or next to a UI library with its own Tasty, a --setup
module can configure another copy of @tenphi/tasty than the tool's own.
The tool now renders with the copy the setups configure, resolves package
paths in --setup from the current folder, warns when the setups configure
two copies and names both, and warns about a setup that changes nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gr8S7Ed6WF7j8cpXBKzCuV
@github-actions

Copy link
Copy Markdown
Contributor

📦 Snapshot release

Published 0.0.0-snapshot.8f23e50.

pnpm add @tenphi/[email protected]

@tenphi
tenphi merged commit 60ce0c0 into main Nov 13, 2026
7 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 13, 2026

This branch was successfully deployed

1 active deployment
release — 2584b9e8 Deployed Nov 13, 2026 by tenphi via Build & snapshot release #1258
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants