Skip to content

Latest commit

 

History

History
63 lines (49 loc) · 1.23 KB

README.md

File metadata and controls

63 lines (49 loc) · 1.23 KB

ttcodegen

Cli for creating file structures based on templates

Installation

npm i -g @pronix/ttcodegen

Using:

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