|
1234567891011121314151617181920212223242526272829303132333435 |
- 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/react-common/component/*',
- base: 'plop/templates/react-common/component',
- destination: 'packages/react-common/src/components/{{pascalCase name}}',
- },
- {
- type: 'addMany',
- templateFiles: 'plop/templates/react-common-docs/component/*',
- base: 'plop/templates/react-common-docs/component',
- destination: 'packages/react-common-docs/src/pages/components',
- },
- ],
- })
- }
|