Common front-end components for Web using the Tesseract design system, written for React. https://make.modal.sh/tesseract/web/react/common
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

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. })