Common front-end components for Web using the Tesseract design system, written for React. https://make.modal.sh/tesseract/web/react/common
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

36 lines
971 B

  1. module.exports = plop => {
  2. plop.setGenerator('component', {
  3. description: 'Creates a component.',
  4. prompts: [
  5. {
  6. name: 'name',
  7. message: 'Enter the component name.',
  8. validate: name => {
  9. if (name.trim().length < 1) {
  10. return 'Name is required.'
  11. }
  12. return true
  13. },
  14. },
  15. {
  16. name: 'description',
  17. message: 'Describe your component.',
  18. },
  19. ],
  20. actions: [
  21. {
  22. type: 'addMany',
  23. templateFiles: 'plop/templates/react-common/component/*',
  24. base: 'plop/templates/react-common/component',
  25. destination: 'packages/react-common/src/components/{{pascalCase name}}',
  26. },
  27. {
  28. type: 'addMany',
  29. templateFiles: 'plop/templates/react-common-docs/component/*',
  30. base: 'plop/templates/react-common-docs/component',
  31. destination: 'packages/react-common-docs/src/pages/components',
  32. },
  33. ],
  34. })
  35. }