Skip to content

Commit 15e8071

Browse files
committed
docs: note that new public exports need an explicit root re-export
Document the rollup-plugin-dts nested-barrel declaration-drop quirk that this PR's NavigationItem/NavigationNavbar fix addresses, so future maintainers adding custom exports know to add an explicit re-export in src/index.tsx and verify against the built dist/index.d.ts. Signed-off-by: marblom007 <[email protected]>
1 parent 85e0733 commit 15e8071

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎AGENTS.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ Keep that peer list in step with the enforced set in the test above. Use the
6666
Known live instance: [#1735](https://github.com/layer5io/sistent/issues/1735) (`date-fns` in
6767
`src/custom/UniversalFilter.tsx`).
6868

69+
## New public exports need an explicit root re-export
70+
71+
`rollup-plugin-dts` (used by tsup for the declaration bundle) silently drops symbols that reach
72+
the root barrel only through a nested `export * from './custom'` (or `./base`, etc.) - the runtime
73+
export in `dist/index.*js` survives, but the declaration is missing from `dist/index.d.ts`, so
74+
`import { Foo, type FooProps } from '@sistent/sistent'` fails type-checking downstream. When you add
75+
a new public component or type in a `src/<domain>/` subtree, also add an explicit
76+
`export { Foo, type FooProps } from './<domain>/Foo';` to `src/index.tsx` (see the documented block
77+
of examples there, e.g. `FeedbackButton`, `NavigationItem`). Verify by building and grepping
78+
`dist/index.d.ts` for the symbol - a green `jest`/lint run will not catch this.
79+
6980
## Repo state that looks broken but is pre-existing
7081

7182
`prettier --check` fails on ~82 files and `tsc --noEmit` reports errors across `src/` (including

0 commit comments

Comments
 (0)