astrolicious / astro-theme-provider

Author themes for Astro like a normal project and export your work as an integration for others to use
https://astro-theme-provider.netlify.app/
The Unlicense
32 stars 2 forks source link

Migrating to `@inox-tools/inline-mod` #32

Open BryceRussell opened 7 months ago

BryceRussell commented 7 months ago

Currently, theme configurations have to be JSON serializable, migrating to @inox-tools/inline-mod could allow for more complicated theme configurations that include functions and more. @inox-tools/inline-mod could also greatly improve the internals for creating virtual modules that provide theme assets. This would require a major rework of the current implementation, but it could also provide a large improvement to the experience for theme authors and users.

Things to consider:

altsalt commented 6 months ago

Here's a direct link to the inline-mod package.

This definitely sounds aligned with the goals of ATP. I don't have enough experience with Vite to contribute meaningfully at the moment.

BryceRussell commented 6 months ago

Trying to generate a module from a parsed zod schema will throw errors because the references to the original values are lost. Is there a way around this so that the theme config can be validated and remain parsable for module generation?

I talked to Luiz about this, he mentioned looking into using a factory wrapper. Anything that can't be serialized by inlineMod/defineModule should be inside a factory wrapper