Common front-end components for Web using the Tesseract design system, written for React. https://make.modal.sh/tesseract/web/react/common
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

docgen 1.0 KiB

1234567891011121314151617181920212223242526272829303132
  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: (prop) => {
  14. if (prop.declarations !== undefined && prop.declarations.length > 0) {
  15. const hasPropAdditionalDescription = prop.declarations.find((declaration) => {
  16. return !declaration.fileName.includes("node_modules");
  17. });
  18. return Boolean(hasPropAdditionalDescription);
  19. }
  20. return true;
  21. },
  22. }
  23. )
  24. fs.writeFile(path.resolve(__dirname, '..', 'src', 'docgen.json'), JSON.stringify(docs, null, 2), (err) => {
  25. })
  26. })