Skip to content

feat: Allow dependsOn to pass default add-on options if the user doesn't specify them #1219

Description

@AdrianGonz97

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:

sv add @shadcn-svelte

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions