Skip to content

feat: add --add-ons option in sv create #333

@hyunbinseo

Description

@hyunbinseo

It is currently impossible to include add-ons without interactive user input.

pnpm dlx sv create --template minimal --types ts --no-install ts

# ┌  Welcome to the Svelte CLI! (v0.6.5)
#
# ◆  Project created
#
# ◆  What would you like to add to your project? (use arrow keys / space bar)
# │  ◻ prettier (formatter - https://prettier.io)
# │  ◻ eslint
# │  ◻ vitest
# │  ◻ playwright
# │  ◻ tailwindcss
# │  ◻ drizzle
# │  ◻ lucia
# │  ◻ mdsvex
# │  ◻ paraglide
# │  ◻ storybook
#

create-svelte provided API, so the following was possible:

/** @param {'checkjs' | 'typescript'} type */
const generateOptions = (type) =>
  /** @type {const} */ ({
    types: type,
    name: `svelte-kit-${type}`,
    template: 'skeleton', // or 'default' or 'skeletonlib'
    prettier: true,
    eslint: true,
    playwright: false,
    vitest: false,
  });

https://github.com/hyunbinseo/svelte-kit-templates/blob/v6.4.0/index.js#L4-L14

Workaround

pnpm dlx sv create --template minimal --types ts --no-install --no-add-ons ts
pnpm dlx sv add --no-install --cwd ts eslint prettier

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions