Skip to content

Relax sv add requirements #1210

Description

@GauBen

Hi there!

I'm trying to create a sv add addon for https://github.com/ota-meshi/vite-plugin-svelte-md but it would make my life simpler if some requirements were relaxed:

  • The package being published as vite-plugin-svelte-md on npm, I would like npm i and sv add command to point to the same name, i.e. sv add vite-plugin-svelte-md

    Covered by npx sv create --template addon shouldn't require an organization #1101

  • Allow a non-empty dependencies record in package.json. I know that they won't be installed, but the ./sv entrypoint will be self-contained. The dependencies record is for the root entrypoint.

    Your add-on must have `sv` as a peer dependency and **no** `dependencies` in `package.json`:

    if (Object.keys(deps).length > 0) {
    throw new Error(
    `Invalid add-on package detected: '${specifier}'\nCommunity add-ons should not have any 'dependencies'. Use 'peerDependencies' for 'sv' and bundle everything else`
    );
    }

    Also, as @sveltejs/sv-utils is a dependency of sv, it should be possible not to bundle it as well

You can find my WIP here: ota-meshi/vite-plugin-svelte-md#157

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions