CSS Modulesの型を生成する
CSS Modulesを型安全にする仕組み
zenn.dev

【React / TypeScript】CSS modulesの型を生成する
zenn.dev

npmでReactコンポーネントパッケージを作る
https://muhammad-f-huda.medium.com/publish-your-react-component-to-npm-49a1c2671e22
GitHub - TimMikeladze/typescript-react-package-starter: 📦 Develop & publish Typescript or React packages with ease. PostCSS, Vitest, Biome & Storybook support out of the box. Integrates with Github releases and automatically publishes to NPM. Code is built using tsup.
📦 Develop & publish Typescript or React packages with ease. PostCSS, Vitest, Biome & Storybook support out of the box. Integrates with Github releases and automatically publishes to NPM. Co...
github.com
tsupでReactのクライアントコンポーネントをビルドする場合
npmパッケージで "use client" をつけたクライアントコンポーネントを公開する時、tsupでビルドする場合に設定を工夫しないとコンポーネントから "use client" の記述が消えてしまう場合がある。この時パッケージの利用側では使えずにエラーになってしまう。
Build react package for use in nextjs 13 · Issue #835 · egoist/tsup
I tried create a package with ui components for use in Nextjs 13 web app, but I can't build components with "use client" in the beginning of code, like that: "use client" import * as AspectRatioPri...
github.com
Kuma UI はどのように React Server Components をサポートしているのか
zenn.dev

esm, cjsのファイルを同じ階層に置いてしまうとエラーになる
ESM packages need to be imported
上記のエラーが発生する。まだ整理できていないが、dist/esm、dist/cjsと分けることで解決している。