|
123456789101112131415161718192021222324252627282930 |
- const testName = require('./plop/helpers/testName.js')
- module.exports = plop => {
- plop.setGenerator('component', {
- description: 'Creates a component.',
- prompts: [
- {
- name: 'name',
- message: 'Enter the component name.',
- validate: name => {
- if (name.trim().length < 1) {
- return 'Name is required.'
- }
- return true
- },
- },
- {
- name: 'description',
- message: 'Describe your component.',
- },
- ],
- actions: [
- {
- type: 'addMany',
- templateFiles: 'plop/templates/component/*',
- base: 'plop/templates/component',
- destination: 'lib/components/{{pascalCase name}}',
- },
- ],
- })
- }
|