next-app-boilerplate/plopfile.js

32 lines
766 B
JavaScript
Raw Permalink Normal View History

2022-04-11 18:28:07 +02:00
module.exports = (
/** @type {import('plop').NodePlopAPI} */
plop
) =>
2022-04-11 18:28:07 +02:00
plop.setGenerator('component', {
description: 'Generate a component',
prompts: [
{
type: 'input',
name: 'name',
message: "What's the component's name ?"
},
{
type: 'input',
name: 'folder',
message: "What's the folder's name ?"
2022-04-11 18:28:07 +02:00
}
],
actions: [
{
type: 'add',
path: 'components/{{folder}}/{{properCase name}}/{{properCase name}}.tsx',
templateFile: 'generators/Component/Component.tsx.hbs'
2022-04-11 18:28:07 +02:00
},
{
type: 'add',
path: 'components/{{folder}}/{{properCase name}}/index.ts',
templateFile: 'generators/Component/index.ts.hbs'
2022-04-11 18:28:07 +02:00
}
]
})