Common front-end components for Web using the Tesseract design system, written for React. https://make.modal.sh/tesseract/web/react/common
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

23 lines
721 B

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