Files
ui/pkg/data/tsconfig.cjs.json
zooqueenandHanzo Dev 45c32228ce ui: a barrel that costs a framework is a barrel nobody can import
Four surface migrations measured the same wall this week and each one wrote its
own copy rather than climb it. The wall is packaging, not components.

`export { ThemeToggleNext }` in the product barrel was a STATIC edge to
@hanzogui/next-theme, whose provider imports `next/script`. One line put Next in
the graph of every Vite, Express and Tauri host — the hosts this layer promises
to run on. It has its own subpath now; `<ThemeToggle />` still reaches it by
dynamic import and still degrades when next-theme is absent, and dist.test.ts
asserts BOTH, because a test that only asserted the absence would pass just as
well on a deleted feature. `next` becomes an optional peer: next-theme requires
it and nothing here admitted that.

`@hanzo/ui/product/pure` is the rules with none of the layer — pages(), masked(),
displayName(), tone(), orgScope, filterOptions, resolveBrand. Every module it
re-exports imports nothing and none is stamped 'use client', because a stamped
module is a client REFERENCE on React's server layer and calling pages() through
one in a server component throws instead of paging. The components import the
same modules, so there is one definition rather than a testable copy of a shipped
one. Proven by `require()` in a CHILD node process: under vitest, vite's
transform is already installed and the test would prove nothing.

`./product/*` and `./primitives/*` open deep imports. `@hanzo/ui/css` is
substitute() — jsdom does not resolve var(), so every consumer trying to assert
the contrast of a rung compared a colour to a function call. With no vars map
that is exact, not approximate: jsdom mounts no design sheet, so the fallback IS
what a browser computes. It is not part of ./core, which is ESM-only because
@hanzo/design publishes no require condition — and a jest consumer is precisely
the caller that needs this.

@hanzo/data pointed its exports at src/index.ts and shipped raw TSX. Every
consumer transpiled it, and `require('@hanzo/data')` could not load at all, which
is one of the two edges that break `require('@hanzo/ui')`. It emits dist/ now, in
both formats, from the SAME postbuild.mjs — parameterised rather than copied,
since a second copy is a second place to get the barrel rule wrong.

The utility classes carry `hz-`. This sheet claimed `.row`, `.skeleton`, `.fade`,
`.mono`, `.drag` and `.tnum` at the document level, in a package an app imports
once at its root; an app with its own `.row` got no warning, it got whichever
rule the cascade preferred, from a stylesheet it never opened. The bare selectors
stay as aliases for one minor version and are REMOVED IN 8.1.0.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-05 01:52:50 -07:00

16 lines
515 B
JSON

{
"extends": "./tsconfig.build.json",
"compilerOptions": {
// `moduleResolution` is stated here rather than inherited, for the same
// reason it is stated in @hanzo/ui's copy: under TypeScript 5 a `bundler`
// resolution inherited into a `commonjs` module target is a hard TS5095
// error and the build emits nothing at all.
"module": "commonjs",
"moduleResolution": "node",
"outDir": "./dist-cjs",
"declaration": false,
"declarationMap": false,
"sourceMap": false
}
}