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.
 
 
 
 

25 lines
742 B

  1. #!/usr/bin/env node
  2. const docgen = require('react-docgen-typescript')
  3. const path = require('path')
  4. const fs = require('fs')
  5. const componentsPath = path.resolve(__dirname, '..', '..', 'react-common', 'src', 'components')
  6. fs.readdir(componentsPath, (err, dir) => {
  7. const trueFilePaths = dir.map(d => path.resolve(__dirname, '..', '..', 'react-common', 'src', 'components', d, `${d}.tsx`))
  8. const docs = docgen.parse(
  9. trueFilePaths,
  10. {
  11. shouldExtractLiteralValuesFromEnum: true,
  12. shouldRemoveUndefinedFromOptional: true,
  13. propFilter: {
  14. skipPropsWithName: ['key', 'ref'],
  15. },
  16. }
  17. )
  18. fs.writeFile(path.resolve(__dirname, '..', 'src', 'docgen.json'), JSON.stringify(docs, null, 2), (err) => {
  19. })
  20. })