I have an Asrto + React portfolio site. One of the pages on my site is a GPT chat app built with React, styled with Tailwind, using the Vercel AI-SDK under the hood. I want to separate this from my portfolio app and the best way I have found is to make an integration, but I have not seen any integrations that rely on other integrations and that export a component.
The chat app portion consists of my ChatUI components, exported as a single combined component, and an api route in pages/api/chat.ts
-
How do I handle it's required integrations? Do I rely on the host projects, or is there a way for my integration to add them if not available in a host project, and use them from the host project if they are available?
-
Does this also mean that my integration will have to come after react and tailwind if the host projects already contains them? What if the host project wants to add them after already adding my integration?
-
How do I build/bundle my integration? I am using this template https://github.com/morinokami/astro-integration-template which includes TSUP, is this what I use to build, instead of
astro build? -
The ChatUI uses shadcn components so Radix and several others as dependencies and it contains its own css variables and tailwind config, how is this handled in a project that may already have it's own TW config and CSS? I guess the CSS the integration uses will be bundled with it and there won't be any conflicts?
-
How do I handle the plethora of dependencies the integration needs? Some will be in most astro projects, while others are less likely to be. I'd like to avoid duplication if possible, and use the host projects deps when available, while still being able to work in a project without any of the integrations required dependencies.
Any help would be seriously appreciated, there are very few resources for building integrations and I haven't found any examples that export tailwind styled react components with lots of dependencies!
