-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
WIP: jsrepo v3 proposal v3 #720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
seems pretty nice, I think we can go with it. The only problem is, with this approach, I still have to manage two different files for component data, which will easily go out of sync if I'm not careful (Information.js and jsrepo.config.ts) |
Ahh I didn't see this. We could also just delete this now :) Just need to move that info into the jsrepo.config before I do. |
|
It's also worth mentioning that it seems like a lot of the meta data from that file is being left out of the registry currently so I can make that work as well. |
|
Okay now everything will instead be based off of Information.js and you just need to make sure that stays up to date. It looks like it's missing a few components atm. |
|
I don't think it's missing anything, I keep that one updated with every addition/deletion, it should be the single source of truth for what's in the library |
|
It looks like all that's missing right now is rolling gallery |
|
Yeah no, that one was completely deleted from the library, should not exist anymore |
|
Oh perfect then :) |
I hope you might like this one better, I think it strikes a good balance between minimizing the config needed and the magic while also maximizing the configurability.
This proposal rotates around a function in the config file called
defineComponent. This function takes in thetitle,category, anddescriptionand defines the files necessary for each variant.For example:
We define all our items with
defineComponentin theitemsarray and then we can build the registry with:jsrepo build # watch mode jsrepo build --watchWe use the
@jsrepo/shadcnpackage to adapt the jsrepo build output to something that the shadcn CLI can understand using the output exported from the package:We set
dirtopublic/rto tell jsrepo to output the registry underpublic/r.I also added 2 new commands to the
package.jsonthat will do the work of the other commands before:registry:build- Builds the registryregistry:dev- Builds the registry in watch modeUsers
shadcnCLI usersjsrepousersjsrepousers will have a few options for how to add components:TODO:
make-define-component-code.tsregistry.jsonjsreposection of the docs