While authoring the sv community add-on for shadcn-svelte, I found myself wishing to pass predefined default options to add-on dependencies.
For example, rather than just defining an add-on dependency like this:
// ...
setup: ({ dependsOn }) => {
dependsOn("tailwindcss");
},
we could have something that allows default options:
// ...
setup: ({ dependsOn }) => {
dependsOn("tailwindcss", { plugins: [] });
},
so if the users calls the add-on without adding the dependency like so:
then the interactive prompt won't appear for them for tailwindcss.
Of course, if they do specify the dependency:
sv add @shadcn-svelte tailwindcss
then the prompt for tailwindcss's options will appear like normal. Likewise, if the add-on just does dependsOn("tailwindcss"), then the prompt for options will also appear.
While authoring the sv community add-on for
shadcn-svelte, I found myself wishing to pass predefined default options to add-on dependencies.For example, rather than just defining an add-on dependency like this:
we could have something that allows default options:
so if the users calls the add-on without adding the dependency like so:
then the interactive prompt won't appear for them for
tailwindcss.Of course, if they do specify the dependency:
then the prompt for
tailwindcss's options will appear like normal. Likewise, if the add-on just doesdependsOn("tailwindcss"), then the prompt for options will also appear.