Open willthomson opened 4 months ago
Root uses vite under the hood, so you can actually use import.meta.glob
to get all of the collections in your project. Something like:
const collectionModules = import.meta.glob('/collections/*.schema.ts', {eager: true});
const collectionSchemas = collectionModules.map((module) => module.default);
console.log(collectionSchemas);
In Registry, we're using collections, one per microsite. On each microsite, we show a 'more domains' dropdown. In order to maintain this list across all microsites automatically, it would be great to get a list of all collections.
This is related to https://github.com/blinkk/rootjs/issues/385, allowing access to the metadata to populate this dropdown.