3.0.9 • Published 8 months ago

gvegas-cfc v3.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

CLI-программа для быстрой генерации компонентов (или любых других файлов)

Умеет генерировать файлы любых расширений.

npm:

npm install --save-dev gvegas-cfc

yarn:

yarn add -D gvegas-cfc

Папка с шаблонами:

Создайте в корне проекта папку с любым удобным для вас названием. Например, создадим родительскую папку templates.

В папке templates создадим две папки с шаблонами: PageComponent и UIComponent.

Структура директорий должна получится следующей:

<rootdir>
│
├── templates
│   ├── PageComponent
│   └── UIComponent

Далее заполним папки шаблонов:

<rootdir>
│
├── templates
│   │
│   ├── PageComponent
│   │   ├── UI
│   │   │   ├── Template.async.tsx
│   │   │   ├── Template.stories.tsx
│   │   │   └── Template.tsx
│   │   └── index.ts
│   │
│   └── UIComponent
│       ├── UI
│       │   ├── Template.module.scss
│       │   ├── Template.stories.tsx
│       │   ├── Template.test.tsx
│       │   └── Template.tsx
│       └── index.ts
│

Скрипт для создания файлов

"create:ui": "npx gvegas-cfc create -t ./templates/UITemplate -o ./output UITest" Скрипт принимает 3 аргумента:

  • -t | --template. Название шаблона (Название папки шаблона, например UIComponent).
  • -o | --output Путь, куда должны сгенерироваться файлы.
  • Название сгенерированного файла

Запускаем:

npx gvegas-cfc create -t ./templates/UITemplate -o ./output UITest

Но проще будет добавить scripts в package.json:

{
...
    "scripts": {
        "create:ui": "npx gvegas-cfc create -t ./templates/UITemplate -o ./output"
    },
...
}

После этого мы можем запустить:

npm:

npm run create:ui UITest

или

yarn:

yarn create:ui UITest

Настройка gvegas-cfc завершена!

3.0.9

8 months ago

3.0.3

8 months ago

3.0.2

8 months ago

3.0.1

8 months ago

3.0.8

8 months ago

3.0.7

8 months ago

3.0.5

8 months ago

0.0.23

11 months ago

0.0.22

12 months ago

0.0.21

12 months ago

0.0.20

12 months ago

0.0.19

12 months ago

0.0.18

12 months ago

0.0.17

12 months ago

0.0.16

12 months ago

0.0.15

12 months ago

0.0.14

12 months ago

0.0.13

12 months ago

0.0.12

12 months ago

0.0.11

12 months ago

0.0.10

12 months ago

0.0.9

12 months ago

0.0.8

12 months ago

0.0.7

12 months ago

0.0.6

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago