feat: CLI support
Hey came across this project on daily.dev and thought it was pretty cool!
For the past few months I have been working on a project called jsrepo. It makes distributing your components from the CLI really nice for project owners and users.
This PR integrates jsrepo into stunning-ui to allow you to distribute your (beautiful) components from the CLI.
You can demo the CLI using my fork:
# initialize stunning-ui
jsrepo init github/ieedan/stunning-ui/tree/jsrepo
jsrepo add # add components from list
jsrepo add composables/useConfetti # add individual component
# add fully qualified
jsrepo add github/ieedan/stunning-ui/tree/jsrepo/composables/useConfetti
You can also preview the registry through the jsrepo website here
With this implementation components would be served directly from github but you could also set it up where the registry is built to the public folder as a static asset and served via the stunning-ui website something like:
jsrepo init https://stunningui.design/r
jsrepo automatically figures out the dependencies of each of your components and ensures that they are included in the registry so that you don't accidentally break your users. All of this is done with the jsrepo build command. This command outputs the jsrepo-manifest.json file which allows the CLI to locate the components and their dependencies.
I added a script in the package.json so that you can build the registry with:
pnpm build:registry
This way you can automatically build your registry when you make changes by setting up a github action. Here's an example of what that looks like: https://jsrepo.dev/docs/git-providers/github#CI%20/%20CD
Thanks for taking a look!
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| stunning-ui | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Mar 6, 2025 8:09pm |
Deploy Preview for stunning-ui ready!
| Name | Link |
|---|---|
| Latest commit | f1259480badb39e9d4c53eb4e1991f2877aaaec1 |
| Latest deploy log | https://app.netlify.com/sites/stunning-ui/deploys/67ca00ba6eab0e000809527e |
| Deploy Preview | https://deploy-preview-7--stunning-ui.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Thanks, @ieedan! I'll look into it.