Generator to help you create and manage svelte/sapper application
First, install Yeoman and generator-svalter using npm (we assume you have pre-installed node.js).
npm install -g yo
npm install -g generator-svalter
Each option is optional. If the generator needs more data, you will be prompted a question.
mkdir your-project
cd your-project
yo svalter [project_name] [options...]
Option | Description |
---|---|
--svelte | Creates a svelte project. (Skips the project type question) |
--sapper | Creates a sapper project. (Skips the project type question) |
--library | Creates a component library project (Skips the project type question) |
--css-reset=<name> | Adds a css reset in your project. name can be any of : none, meyer_reset, normalize, sanitize (Skips the css reset question) |
--style-separation | Components' styles will be put in a different file for each component |
--no-style-separation | Components' styles will be put in the same file as the markup |
--script-separation | Components' scripts will be put in a different file for each component |
--no-script-separation | Components' scripts will be put in the same file as the markup |
--typescript or --ts | Adds TypeScript support to your project |
--no-typescript or --no-ts | Does not add TypeScript support to your project |
--sass or --scss | Adds SASS support to your project |
--no-sass or --no-scss | Does not add SASS support to your project |
#in a svalter project
yo svalter:component [component-name] [options...]
Option | Description |
---|---|
--folder=path | Put the component in a specific folder (which will be under /src/components) |
#in a svalter project
yo svalter:route [route] [options...]
If your route's name starts with [ and ends with ], you will be prompted to choose a predefined pattern to help you.
If you have existing routes containing path variables with patterns, you can skip the pattern, and the generator will still find the right route for you.
Example:
If a route "/a/[b(some-pattern)]/" exists, to generate a new [c] route, you can type :
yo svalter:route a/[b]/[c]
Option | Description |
---|---|
--json-api or --api | Create a json api script in this generated route |
--page-component or --page | Create a page component in this generated route |
--page-layout or --layout | Create a page layout in this route |
--pattern=some_pattern | Available patterns: none, numbers, characters, uuid, date, time, datetime. Many patterns can be specified (separated by ; ) for each path variable that doesn't currently exist |
#in a svalter project
yo svalter:service [service-name] [options...]
Option | Description |
---|---|
--folder=path | Put the service in a specific folder (which will be under /src/scripts/services) |
#in a svalter project
yo svalter:model [model-name] [options...]
Option | Description |
---|---|
--folder=path | Put the model in a specific folder (which will be under /src/scripts/models) |
#in a svalter project
yo svalter:action [action-name] [options...]
Option | Description |
---|---|
--folder=path | Put the action in a specific folder (which will be under /src/scripts/actions) |
Recipes generation
i18n addition
Apache-2.0 © Nokorbis