Skip to content

feat: consume @tangle-network/ui via re-export bridge; ship 0.15.0#36

Merged
drewstone merged 9 commits intomainfrom
tin/consume-ui-package
May 6, 2026
Merged

feat: consume @tangle-network/ui via re-export bridge; ship 0.15.0#36
drewstone merged 9 commits intomainfrom
tin/consume-ui-package

Conversation

@AtelyPham
Copy link
Copy Markdown
Contributor

Closes #34. Implements the consumption side of the brand-network UI extraction (parent epic: tangle-network/brand#3).

What

@tangle-network/sandbox-ui@0.15.0 adds @tangle-network/ui@^1.0.1 as a peer dependency, deletes ~104 source files that were moved to ui in Phase B, and replaces them with one-line re-export shims. Public exports stay byte-equivalent to 0.14.0: every name still resolves; types forward transitively.

Single source of truth: every moved file lives in only one place — @tangle-network/ui. The shims contain re-export statements only, no logic duplication.

Commit-by-commit

# Commit Scope
1 chore(deps): add @tangle-network/ui peer; bump @tangle-network/brand to ^0.3.0 package.json only
2 refactor: replace moved subpaths with @tangle-network/ui re-export shims Delete 104 moved files + 27 stories; create 14 shim files; rewrite root src/index.ts; rebind 41 deep imports across stay-behind code
3 chore(deps): drop deps now provided transitively via @tangle-network/ui Remove CVA, markdown stack, pdf, syntax highlighter, turndown, pierre/trees, tiptap, hocuspocus, yjs from dependencies / peerDependenciesMeta
4 test: add re-export identity smoke; wire PR validation CI re-export-identity.test.ts + test:bridge script + .github/workflows/ci.yml
5 chore: bump version 0.15.0; update CHANGELOG Version bump + CHANGELOG entry
6 chore(deps): bump @tangle-network/ui to ^1.0.1; exclude __tests__ from tsc Pulls in ThemeToggle / useTheme exposed in tangle-network/brand#13; tsconfig fix for self-package-name resolution
7 fix(shims): use named re-exports so bundled subpaths actually forward esbuild collapses export * from <external> to a side-effect import; replaced each shim with explicit named re-exports

Notes

  • Originally targeted 0.14.0 per plan; that tag already shipped via the terminal-perf PR (feat(terminal): low-latency WebSocket transport + GPU rendering #35) before this branch landed, so the version bump moved to 0.15.0.
  • Restored src/primitives/logo.tsx as stay-behind: sandbox-ui's Logo (variant "sandbox", iconOnly prop, "Tangle Sandbox" suffix) is genuinely different from brand's generic Logo — moving it to brand was a bulk-import false positive. The primitives shim re-exports everything from @tangle-network/ui/primitives except Logo / TangleKnot / LogoProps; those come from ./logo.
  • Deleted src/workspace/artifact-pane.tsx: byte-identical with brand/packages/ui/src/primitives/artifact-pane.tsx (true SSOT violation that the plan's path-only audit missed). workspace/index.ts now re-exports ArtifactPane from @tangle-network/ui/primitives.
  • Two brand-side micro-PRs were filed during implementation to unblock the consumer:

Test plan

  • pnpm typecheck — clean.
  • pnpm build — all 18 entries built. Bridged subpath bundles are tiny (e.g. dist/chat.js is a thin re-export).
  • pnpm test — 19 test files, 232 tests pass (13 of which are the new bridge identity assertions: Button, ChatMessage, RunGroup, OpenUIArtifactRenderer, FileTree, TiptapEditor, Markdown, GitHubLoginButton, cn, useAutoScroll, useSdkSession, activeSessionsAtom, CommandPreview — each verified to be === between @tangle-network/sandbox-ui/<subpath> and @tangle-network/ui/<subpath>).
  • Smoke pnpm storybook (sandbox-coupled stories only — workspace + dashboard).
  • Manually verify in a heaviest-consumer (e.g. agent-dev-container/products/sandbox/web) via local link.
  • Verify post-merge: release.yml publishes @tangle-network/sandbox-ui@0.15.0 to npm + GitHub Packages.

Related

AtelyPham added 8 commits May 6, 2026 20:42
…m tsc

@tangle-network/ui@1.0.1 exposes ThemeToggle and useTheme on the
primitives subpath, which the root re-export shim depends on.

The bridge test imports via self-package-name (e.g.
@tangle-network/sandbox-ui/primitives) so it can run against the built
dist/ artifacts. tsc resolves '.' through the package's own exports
map and reports TS2209 ("project root is ambiguous") because both
src/ and dist/ are candidate roots. Excluding src/__tests__/** keeps
plain typecheck clean while vitest (test:bridge / pnpm test) still
builds first and runs the test against dist/.
esbuild collapses `export *` from external packages to a side-effect
import, so consumers of @tangle-network/sandbox-ui/<subpath> were
getting `undefined` for every named symbol. Replace each shim with
explicit named re-exports of the @tangle-network/ui surface (mirroring
the dist barrel). The bridge identity test now exercises 13 subpaths
end-to-end against built dist/.

Also re-add transitive deps that ui's optional editor/files/markdown
subpaths pull at runtime (tiptap, hocuspocus, yjs, @pierre/trees,
markdown stack, react-pdf, turndown, @nanostores/react) as
devDependencies — they are not used by sandbox-ui's stay-behind src/
but the bridge test imports through subpaths that need them resolvable.
The previously-removed peerDependenciesMeta entries stay dropped:
those concerns live in @tangle-network/ui now.
@AtelyPham AtelyPham self-assigned this May 6, 2026
@tangletools
Copy link
Copy Markdown

tangletools commented May 6, 2026

⚠️ Review Failed — 980ecdf8

All review passes errored. No verdict published. Push a new commit to trigger a re-review.

tangletools · 2026-05-06T17:14:40Z

Match release.yml — pnpm/action-setup needs an explicit version
when there is no packageManager field in package.json.
@AtelyPham AtelyPham requested a review from tangletools May 6, 2026 17:02
@drewstone drewstone merged commit f68ba8b into main May 6, 2026
1 check passed
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.

Phase C: Consume @tangle-network/ui via re-export bridge; ship 0.14.0

3 participants