Scripts
Treats provides treats
CLI to easily manage your Treats project. There's several commands that could be used with treats
:
clean
- Clean build resultsgenerate <template>
- Generate codes based on templatedocumentation <command>
- To interact with documentation generator API.start
- To Start development server.build
- To build Treats bundle.test
- Ran unit tests with Jest.
Clean
Used to clean several directories that Treats build: dist/
, public/
& stats/
.
treats clean
Options:
--version Show version number [boolean]
--debug Debug mode [boolean]
--help Show help [boolean]
Generate
Used to generate codes based on template
treats generate <template>
Options:
--version Show version number [boolean]
--help Show help [boolean]
--debug Debug mode [boolean]
<template>
can be either:
component
- Generates React component boilerplates.redux
- Generates Redux boilerplates (action creator, reducer, thunks, etc).test
- Generates Jest test boilerplates.helper
- Generates Treats helper object boilerplates.middleware
- Generates Treats middleware object boilerplates.- Your own template directory
Documentation
Used to interact with documentation generator API
treats documentation <command>
Options:
--version Show version number [boolean]
--debug Debug mode [boolean]
--help Show help [boolean]
--directory Specify which directory to build documentation
--target Target for current operation
<command>
can be either:
build
- To build documentationlint
- Lint documentationexport
- To export documentation (use--target
, currently onlyphriction
available as target).
Start
Used to start local development server
treats start
Options:
--version Show version number [boolean]
--debug Debug mode
--help Show help [boolean]
--port Specify port to run treats server
--wdsport Specify port to run Webpack Dev Server
--env Specify which environment to build (process.env.NODE_ENV)
Build
Used to build distribution bundle.
treats build
Options:
--version Show version number [boolean]
--debug Debug mode
--help Show help [boolean]
--env Specify which environment to build (process.env.NODE_ENV)
--analyze Display bundle analyzer map to see which bundle is the biggest :)
--target Specify build target (client|server)
Test
Used to ran unit tests with Jest.
treats test
Options:
--debug Debug mode
--help Show help
All other Jest CLI Options