Skip to content

Commit

Permalink
update README.md with new flags
Browse files Browse the repository at this point in the history
  • Loading branch information
JReinhold committed Nov 23, 2023
1 parent b6fa7ef commit f4ccad2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
> The Svelte team has been very explicit about not adding CLI arguments to `create-svelte` for good reasons.
> See https://github.com/sveltejs/kit/pull/6117#issuecomment-1221323822
![upstream create-svelte version](https://img.shields.io/badge/upstream_create--svelte-2.0.0--next.180-brightgreen)

`create-svelte-with-args` is a simple wrapper around the [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte) package that allows you to specify the options as CLI arguments instead of using the interactive prompts.

This is useful if you want to automate the creation of SvelteKit projects, which can be pretty hard with interactive prompts.
Expand Down Expand Up @@ -36,19 +34,20 @@ The arguments match one to one with the upstream [programmatic `create-svelte` p
| `--eslint`, `-e` | Whether eslint should be included | `boolean` | `--eslint` or `--no-eslint` |
| `--playwright`, `-l` | Whether playwright should be included | `boolean` | `--playwright` or `--no-playwright` |
| `--vitest`, `-v` | Whether vitest should be included | `boolean` | `--vitest` or `--no-vitest` |
| `--svelte5`, `-5` | If Svelte 5 beta should be used | `boolean` | `--svelte5` or `--no-svelte5` |

### Examples

Create a default project called `my-new-app` that checks JS types with prettier but without eslint and playwright:

```bash
npm create svelte-with-args --name=my-new-app --template=default --types=checkjs --prettier --no-eslint --no-playwright
npm create svelte-with-args --name=my-new-app --template=default --types=checkjs --prettier --no-eslint --no-playwright --no-vitest --no-svelte5
```

Create a skeleton project without any type checking:

```bash
npm create svelte-with-args --name=my-new-app --template=skeleton --types=null --no-prettier --no-eslint --no-playwright
npm create svelte-with-args --name=my-new-app --template=skeleton --types=null --no-prettier --no-eslint --no-playwright --no-vitest --no-svelte5
```

### `--help`
Expand All @@ -70,20 +69,21 @@ Options:
-e, --eslint Whether eslint should be included [boolean] [required]
-l, --playwright Whether playwright should be included [boolean] [required]
-v, --vitest Whether vitest should be included [boolean] [required]
-5, --svelte5 If Svelte 5 beta should be used [boolean] [required]
--dry Whether to run in dry run mode, not creating any files
[boolean] [default: false]
Examples:
npm create svelte-with-args@latest Default app, checking JS types, with
--name=my-new-app --template=default Prettier, and no ESLint, Playwright
--types=checkjs --prettier --no-eslint or Vitest
--no-playwright --no-vitest
--no-playwright --no-vitest --no-svelte5
npm create svelte-with-args@latest Default app, installing in specified
--name=my-new-app directory
--directory=other-dir/my-app
--template=default --types=typescript
--no-prettier --no-eslint
--no-playwright --no-vitest
--no-playwright --no-vitest --no-svelte5
For more information, see https://github.com/storybookjs/create-svelte-with-args
```
Expand Down

0 comments on commit f4ccad2

Please sign in to comment.