const widget = (plop) => { plop.setGenerator('widget', { description: 'Создает слайс в виджете', prompts: [ { type: 'input', name: 'name', message: 'Название слайса?', }, ], actions: (data) => { data.layerName = 'widgets'; return [ { type: 'add', path: '../src/widgets/{{name}}/ui/{{name}}.tsx', templateFile: './templates/component/component.hbs', }, { type: 'add', path: '../src/widgets/{{name}}/ui/{{name}}.module.scss', templateFile: './templates/component/component.style.hbs', }, { type: 'add', path: '../src/widgets/{{name}}/ui/{{name}}.stories.tsx', templateFile: './templates/component/component.stories.hbs', }, { type: 'add', path: '../src/widgets/{{name}}/index.ts', templateFile: './templates/layers/rootIndex/rootIndex.hbs', }, ]; }, }); }; module.exports = widget;