<aside> ✅ A utility for accelerating development with ScandiPWA
</aside>
Example – With one command, create a component template in src/component/HugeTitle
directory:
scandipwa create component HugeTitle
Install the npm package globally:
npm i -g scandipwa-cli
<aside> ➡️ A VSC plugin for Scandi CLI is also available!
</aside>
The CLI must be run from the ScandiPWA theme directory or a subdirectory.
Global options:
-help
to get usage help-version
to print version number and exitCreates a new ScandiPWA component.
Syntax:
scandipwa create component [--container] [--redux] [--typescript] <name>
Options:
--container
/c
creates a container file for the component--redux
/r
connects the component to the Redux store with the connect
HOC-typescript
Should the component be created as a TypeScript filename
is the name of the component to be createdExamples:
scandipwa create component HugeTitle
Output:
# Output:
NOTE!
The following files have been created:
src/component/HugeTitle/HugeTitle.component.js
src/component/HugeTitle/HugeTitle.style.scss
src/component/HugeTitle/index.js
scandipwa create component --container SpecialHeader
# Output:
NOTE!
The following files have been created:
src/component/SpecialHeader/SpecialHeader.component.js
src/component/SpecialHeader/SpecialHeader.style.scss
src/component/SpecialHeader/index.js
src/component/SpecialHeader/SpecialHeader.container.js
Creates a new ScandiPWA route
<aside>
✅ This will just create the route component in the src/route
directory. To implement it you must follow the tutorial to implement a new ScandiPWA route.
</aside>
Syntax:
scandipwa create route [--container] [--redux] [--typescript] <name>
Options:
--container
/c
creates a container file for the route component-redux
/r
connects the route to the Redux store with the connect
HOC--typescript
Should the component be created as a TypeScript filename
is the name of the route to be createdExample:
scandipwa create route MyLandingPage
Output:
# Output:
NOTE!
The following files have been created:
src/route/MyLandingPage/MyLandingPage.component.js
src/route/MyLandingPage/MyLandingPage.style.scss
src/route/MyLandingPage/index.js
Creates a new ScandiPWA Redux store
Syntax:
scandipwa create store [--dispatcher-type=<"no"|"regular"|"query">] [--typescript] <name>
Options:
--dispatcher-type
/d
determines 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 that extends QueryDispatcher
--typescript
Should the store be created with TypeScript filesname
is the name of the store to be createdExample:
scandipwa create store ---dispatcher-type=query UserPreferences
Output:
# Output:
NOTE!
The following files have been created:
src/store/UserPreferences/UserPreferences.action.js
src/store/UserPreferences/UserPreferences.dispatcher.js
src/store/UserPreferences/UserPreferences.reducer.js
Creates a new ScandiPWA query helper for querying with GraphQL.
Syntax:
scandipwa create query [--typescript] <name>
name
is the name of the query to be created--typescript
Should the query be created as a TypeScript fileExample:
scandipwa create query Weather
Output:
# Output:
NOTE!
The following files have been created:
src/query/Weather.query.js
Deploys your app to the cloud
Syntax:
scandipwa deploy
Example
scandipwa deploy
yarn run v1.22.5
$ scandipwa-scripts build
Creating an optimized production build...
Build completed in 186.317s
Compiled successfully.
[...]
Done in 189.38s.
Build files compressed successfully.
Code upload result: OK. Code: 200
Build archive successfully removed.
Congrats, your code will be deployed in a few minutes! You can access it here: <https://master.d16zgbgmy9fzgx.amplifyapp.com/>
Creates a new scandiPWA extension
Syntax:
scandipwa extension create [--no-enable] <name>
Options:
-no-enable
will create and install the extension without enabling itname
specifies the name of the new extensionInstalls a ScandiPWA extension
Syntax:
scandipwa extension install [--no-enable] [--local] [--use=<path>] [--version=<required-version>] [--save-dev] <name>
Options:
-no-enable
will install the extension without enabling it-local
/l
: use a local module from packages/<name>
-use
/u
: use a local module from the specified <path>
-version
/v
specifies the extension version to usesave-dev
/D
: install the package as a devDependencyname
is the name of the extension to installOverrides a ScandiPWA component. Will interactively ask for which parts to override.
Syntax:
scandipwa override component [--styles=<"extend"|"override"|"keep">] [--source-module=<module>] [--target-module=<module>] <name>
Options:
-styles
/S
:
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 inname
is the name of the component to be overriddenExample:
scandipwa override component Header
? Choose things to extend in Header.component.js Header
? What would you like to do with styles? Extend
? Choose things to extend in Header.config.js
? Choose things to extend in Header.container.js
NOTE!
The following files have been created:
src/component/Header/Header.override.style.scss
src/component/Header/Header.component.js
Overrides a ScandiPWA route
Syntax:
scandipwa override route [--styles=<"extend"|"override"|"keep">] [--source-module=<module>] [--target-module=<module>] <name>
Options:
-styles
/S
:-source-module
/s
: Path to the module to override the route from-target-module
/t
: Path to the module to generate the route inname
is the name of the route to be overriddenOverrides a ScandiPWA Redux store
Syntax:
scandipwa override store [--source-module=<module>] [--target-module=<module>] <name>
Options:
-source-module
/s
: Path to the module to override the store from-target-module
/t
: Path to the module to generate the store inname
is the name of the store to be overriddenOverrides a ScandiPWA query helper
Syntax:
scandipwa override query [--source-module=<module>] [--target-module=<module>] <name>
Options:
-source-module
/s
: Path to the module to override the query from-target-module
/t
: Path to the module to generate the query inname
is the name of the query to be overridden