ScandiPWA CLI
A utility for accelerating development with Scandi
Example – with one command, create a component template in src/component/HugeTitle:
scandipwa create component HugeTitleA VSC plugin for Scandi CLI is also available!
Installation
Install the npm package globally:
npm i -g scandipwa-cliUsage
The CLI must be run from the the Scandi theme directory or a subdirectory.
Global options:
--helpto get usage help--versionto print version number and exit
create component
Creates a new Scandi component
Syntax:
create component [--container] [--redux] <name>Options:
--container/-ccreates a container file for the component--redux/-rconnects the component to the Redux store with theconnectHOCnameis the name of the component to be created
Examples:
create route
Creates a new Scandi route
Syntax:
Options:
--container/-ccreates a container file for the route--redux/-rconnects the route to the Redux store with theconnectHOCnameis the name of the route to be created
Example:
create store
Creates a new Scandi Redux store
Syntax:
Options:
--dispatcher-type/-ddetermines what type of dispatcher file will be created.no(default) - does not create a dispatcherregular- creates a simple helper class for dispatching actionsquery- creates a dispatcher thatextends QueryDispatcher
nameis the name of the store to be created
Example:
create query
Creates a new Scandi query helper for querying with GraphQL
Syntax:
name is the name of the query to be created
Example:
deploy
Deploys your app to the cloud
Syntax:
Example
extension install
Installs a Scandi extension
Syntax:
Options:
--no-enablewill install the extension without enabling it--local/-l: use a local module frompackages/<name>--use/-u: use a local module from the specified<path>--version/-vspecifies the extension version to usesave-dev/-D: install the package as a devDependencynameis the name of the extension to install
extension create
Creates a new scandi extension
Syntax:
Options:
--no-enablewill create and install the extension without enabling itnamespecifies the name of the new extension
override component
Overrides a Scandi component. Will interactively ask for which parts to override.
Syntax:
Options:
--styles/-S:Not specified (default): will prompt interactively
keep: don't override stylesextend: adjust existing stylesoverride: completely replace existing styles
--source-module/-s: Path to the module to override the component from--target-module/-t: Path to the module to generate the component innameis the name of the component to be overridden
Example:
override route
Overrides a Scandi route
Syntax:
Options:
--styles/-S:Not specified (default): will prompt interactively
keep: don't override stylesextend: adjust existing stylesoverride: completely replace existing styles
--source-module/-s: Path to the module to override the route from--target-module/-t: Path to the module to generate the route innameis the name of the route to be overridden
override store
Overrides a Scandi Redux store
Syntax:
Options:
--source-module/-s: Path to the module to override the store from--target-module/-t: Path to the module to generate the store innameis the name of the store to be overridden
override query
Overrides a Scandi query helper
Syntax:
Options:
--source-module/-s: Path to the module to override the query from--target-module/-t: Path to the module to generate the query innameis the name of the query to be overridden
Last updated