0.1.2 • Published 4 years ago
@emmar/catalyst-cli v0.1.2
Catalyst CLI
A cli for catalyst entity generation.
Quick Start
# install the package as a dev dependency
npm install --save-dev @emmar/catalyst-cli
Add npm script to package.json file
...
scripts: {
"catalyst": "catalyst"
}
...
# execute the init command
# this will create a catalyst folder at the root of your project
# the folder will contain a config file and boilerplate for entity additions
npm run catalyst init
# to add an entity - execute the add command
npm run catalyst add {{entityName}}
Boilerplate
The init command will create a /catalyst/boilerplate directory at the base of your project. Create directories under the boilerplate directory - the underlying files will be copied to your project during the add command execution. ONLY the directories listed under the pathParts configuration value will be copied.
Example:
|-- package.json
|-- catalyst
|-- catalyst-cli.config.json
|-- boilerplate
|-- model
|-- sample.ts
|-- service
|-- example.ts
Configuration
Config file is read from catalyst/catalyst-cli.config.json
Key | Description |
---|---|
modelTemplateFileName | Template file name of the Model Class |
pathParts | Key = source folder name (catalyst/{folder name}) and array of path parts points to destination folder. |
fileNameCasing | String casing to use for file names |
classNameCasing | String casing to use for class names |
propertyCasing | String casing to use for class properties |
Casing
Name | Example |
---|---|
snake | string_snake_case |
kebab | string-kebab-case |
camel | stringCamelCase |
pascal | StringPascalCase |
upper | STRINGUPPERCASE |
lower | stringlowercase |