tover v1.5.2
tover
CLI for tover-template: An opinionated but flexible project boilerplate.
Usage
# Install tover globally
% npm i tover -g
# Install tover as a dev dependency of your project
% npm i tover -D
New project
# Create a new ts react project in the current directory
% tover <project name>
# or, if not installed globally
% npx tover <project name>
Tasks
Tover has the following built-in tasks:
tover --start
tover --build
tover --clean
tover --lint
tover --generate
These tasks are mapped to your package.json scripts when the project is created. You can use the commands directly or as follows.
# Run dev environment
% npm start
# Create a distribution build if linter passed
% npm run build
# Clean node_modules, distribution directory and compiled code
% npm run clean
# Run eslint/prettier
% npm run lint
# Generate an app component, see 'Generate code'
% npm run generate <name> <type>
Generate code
Creating new components can be a tedious task. Therefor a code generation script is included in this boilerplate. Just run the following command:
% npm run generate <name> <type> <options>
Where name
is your component name, and type
can be "element"
(default), "screen"
or "template"
. (See Existing source code)
You can pass --sfc
as an option to create a function component instead.
This script will create a component
, styles
and index
file with related types and exports.
% npm run generate Button
# creates an element module called "Button"
% npm run generate Image element --sfc
# creates an element module called "Image" with a "Stateless Functional" React component
% npm run generate Login screen
# creates a screen module called "Login"
% npm run generate NewsFeedItem template
# creates a template module called "NewsFeedItem"
Code templates can be edited in _tools/environment/code-templates
.
For more information about the existing template source code and more, see tover-template readme.
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago