1.0.4 • Published 2 years ago
fsd-cli v1.0.4
FSD CLI
CLI for generating slices with segments by Feature-Sliced Design
Table of Contents
Install
npm:
npm install -g fsd-cliyarn:
yarn add fsd-cliUsage
Command structure
fsd [COMMAND] [FLAG] [VALUE]Subfolder generation available, example:
fsd generate --shared UI/base-componentCommands
Supports passing multiple options at the same time.
Examples
Generate widget
fsd g -w widget-nameGenerate page
fsd g -p page-nameGenerate feature
fsd g -f feature-nameGenerate entity
fsd g -e entity-nameGenerate module
fsd g -m module-nameGenerate component
fsd g -c component-nameDescription
The names of the slices are case-insensitive, all cases will be transformed into the case corresponding to the segment.
On the command example
fsd g -w placeholder| Segment | Filename |
|---|---|
| Public index | index.ts |
| Composable | usePlaceholder.ts |
| Component | Placeholder.vue |
| Types | placeholder.types.ts |
The postfix "page" will be automatically added to the pages if it is not present. If the segment exists in the slice, then the file will not be overwritten.
Supported Node version: >= v14