1.2.0 • Published 4 years ago

generator-svalter v1.2.0

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
4 years ago

generator-svalter NPM version Build Status Dependency Status

Generator to help you create and manage svelte/sapper application

Features

  • Generate a boilerplate project for svelte, sapper or a component library
  • Generate routes (sapper only), components, models, services and (svelte) actions

Supported "templates"

  • Svelte : (javascript || typescript) && (css || scss)
  • Sapper : (javascript || typescript) && (css || scss)
  • Component library : (javascript || typescript) && (css || scss)

Installation

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

Usage notes :

Each option is optional. If the generator needs more data, you will be prompted a question.

Project generation

mkdir your-project
cd your-project
yo svalter [project_name] [options...]

svalter-gif

Available options

OptionDescription
--svelteCreates a svelte project. (Skips the project type question)
--sapperCreates a sapper project. (Skips the project type question)
--libraryCreates a component library project (Skips the project type question)
--css-reset=\Adds a css reset in your project. name can be any of : none, meyer_reset, normalize, sanitize (Skips the css reset question)
--style-separationComponents' styles will be put in a different file for each component
--no-style-separationComponents' styles will be put in the same file as the markup
--script-separationComponents' scripts will be put in a different file for each component
--no-script-separationComponents' scripts will be put in the same file as the markup
--typescript or --tsAdds TypeScript support to your project
--no-typescript or --no-tsDoes not add TypeScript support to your project
--sass or --scssAdds SASS support to your project
--no-sass or --no-scssDoes not add SASS support to your project

Component generation

#in a svalter project
yo svalter:component [component-name] [options...]

Available options

OptionDescription
--folder=pathPut the component in a specific folder (which will be under /src/components)

Route generation

#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]

Available options

OptionDescription
--json-api or --apiCreate a json api script in this generated route
--page-component or --pageCreate a page component in this generated route
--page-layout or --layoutCreate a page layout in this route
--pattern=some_patternAvailable patterns: none, numbers, characters, uuid, date, time, datetime. Many patterns can be specified (separated by ; ) for each path variable that doesn't currently exist

Service generation

#in a svalter project
yo svalter:service [service-name] [options...]

Available options

OptionDescription
--folder=pathPut the service in a specific folder (which will be under /src/scripts/services)

Model generation

#in a svalter project
yo svalter:model [model-name] [options...]

Available options

OptionDescription
--folder=pathPut the model in a specific folder (which will be under /src/scripts/models)

Action generation

#in a svalter project
yo svalter:action [action-name] [options...]

Available options

OptionDescription
--folder=pathPut the action in a specific folder (which will be under /src/scripts/actions)

Considered features

Recipes generation
i18n addition

License

Apache-2.0 © Nokorbis

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.9.0

4 years ago

0.8.0

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.5.2

4 years ago

0.5.0

4 years ago

0.5.1

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.2

4 years ago

0.2.0

4 years ago

0.1.2

4 years ago

0.1.0

4 years ago