FormidableLabs / nextjs-sanity-fe

NextJS Demo site with Sanity CMS
https://nextjs-sanity.formidable.dev/
29 stars 6 forks source link

Feature/UI lib #206

Closed nlkluth closed 10 months ago

nlkluth commented 10 months ago

What

Creates ui library for sharing components

Why

This project is being upgraded to allow developers to quickly spin up an E-commerce frontend with prebuilt components, so that they can focus their efforts on evaluating partner tools and technology

TODO

Future tasks to follow in subsequent PRs

vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nextjs-sanity-fe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2023 9:31pm
nlkluth commented 10 months ago

Looking into CI errors 👀

carloskelly13 commented 10 months ago

This looks great, but I see a couple issues currently with getting the UI library to build (and get consumed in the main app). I wonder if we should look at using tsup or perhaps Vite for building and creating a first-class library with ESM output. An example here on Nuka → https://github.com/FormidableLabs/nuka-carousel/blob/main/packages/nuka/tsup.config.ts

Additionally we can then specify in the package.json of the ui library which outputs to use when imported

https://github.com/FormidableLabs/nuka-carousel/blob/main/packages/nuka/package.json#L5-L7

Finally when consumed, we can reference it using a * in the main app (https://github.com/FormidableLabs/nuka-carousel/blob/main/website/package.json#L24) then import as normal and we get the correct types and such: https://github.com/FormidableLabs/nuka-carousel/blob/main/website/src/components/demos.tsx#L2

nlkluth commented 10 months ago

@carloskelly13 Thanks for that info. I was definitely unsure how to get to that step so I appreciate it! I'll look into this 👍

nlkluth commented 10 months ago

Build worked 🎉 However, looking into UI regression 👀 Edit: fixed