@pronix/ttcodegen
v2.0.3
Published
codegen for effector services
Readme

ttcodegen
Cli for creating file structures based on templates
Installation
npm i -g @pronix/ttcodegenUsing:
1. Create ttcodegen.json configuration file
{
"templatesDirectoryPath": "./templates",
"arguments": [],
"options": [
{
"name": "component",
"option": "-C",
"description": "Create react component"
},
{
"name": "service",
"option": "-S",
"description": "Create effector service"
}
]
}
2. Create template files in directory with any option name
"./ttc/templates/service/{{name}}Service.container.tsx.hbs"
import React from 'react';
import { {{ name }}Service } from './{{ name }}Service.models';
const { inputs, outputs } = {{ name }}Service;
export const {{ cfl name }}Container = () => {
return <></>;
};
3. Run ttc
$ ttc -S ./src/services createTask
📂 ./src/services/applyTask/
+ 📄 applyTaskService.types.ts
+ 📄 applyTaskService.models.ts
+ 📄 applyTaskService.container.tsx
+ 📄 applyTaskService.api.ts
+ 📄 index.ts