Sample code shouldn't live in the src directory. You can see here since it ends up in dist that this code gets installed by package consumers.
I see two reasonable solutions:
Use a monorepo structure using Typescript project references and npm workspaces - kind of overkill for this project and the simplicity of a single package repo is nice.
Create a separate repo for an example and link to it.
Sample code shouldn't live in the
src
directory. You can see here since it ends up indist
that this code gets installed by package consumers.I see two reasonable solutions: