GeezerVison is showing github.com — RFC: Installing Add-ons in existing `create‑tsrouter‑app` apps · TanStack/cli · Discussion #65
RFC: Installing Add-ons in existing create‑tsrouter‑app apps
#65
Discussion options
-
Uh oh!
There was an error while loading. Please reload this page.
|
Currently, create‑tsrouter‑app supports installing add-ons during project creation. However, if you decide later that you need an additional add-on, you have no way via the CLI. This RFC suggests a way to install add-ons to apps TSR/TSS apps.
Like Shadcn but for add-ons
|
You must be logged in to vote
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
-
Uh oh!
There was an error while loading. Please reload this page.
|
My current thinking on this is:
- We'll create a
.cta.json file in the target directory that contains the current configuration.
- When the customer does
npx create-tsrouter-app@latest add clerk (clerk is just an example there) we would read the current configuration and merge in the new add-on, then update the code with the delta for the new add-on.
- We'd update the
.cta.json with the updated configuration.
As an additional option we could support something like:
npx create-tsrouter-app@latest add https://raw.github.com/clerk/setup/start.json
And it would read the add-on information from that URL. That would require a single JSON file. So I might also add npx create-tsrouter-app@latest init-add-on and npx create-tsrouter-app@latest compile-add-on to initialize an add-on project, and then compile an add-on into a single JSON file format for publication to S3/GitHub/etc.
The potential issues I see are around merging into an existing file. On that note we can try a 3-way merge similar to what git does. And if that has conflicts we can look for an AI API key and ask the AI to do the merge.
Caveats:
- This would not apply to projects created before
.cta.json
- This would not handle migrations from code-router to file-router or from solid to react or vice versa
|
You must be logged in to vote
0 replies