Closed
Description
Thanks a lot for making Dash -- we have found it very useful for building dashboards.
We ran into an issue migrating to the new dash-generate-components
utility.
In dash-bootstrap-components, we keep the components in src/components
. Besides components files, this also includes a few unit test files called, e.g. src/components/__tests__/DropdownMenu.test.js
. When we run dash-generate-components ./src/components <output>
, these test files also get picked up. This leads to a traceback in the build logs:
Error with path src/components/__tests__/DropdownMenu.test.jsError: No suitable component definition found.
Error: No suitable component definition found.
at parse (/project/pascal/dash-bootstrap-components/node_modules/react-docgen/dist/parse.js:84:9)
at Object.defaultParse [as parse] (/project/pascal/dash-bootstrap-components/node_modules/react-docgen/dist/main.js:66:30)
at parseFile (/opt/anaconda/envs/Python3/lib/python3.6/site-packages/dash/extract-meta.js:64:51)
at dirs.forEach.filename (/opt/anaconda/envs/Python3/lib/python3.6/site-packages/dash/extract-meta.js:84:17)
at Array.forEach (<anonymous>)
at collectMetadataRecursively (/opt/anaconda/envs/Python3/lib/python3.6/site-packages/dash/extract-meta.js:79:14)
at dirs.forEach.filename (/opt/anaconda/envs/Python3/lib/python3.6/site-packages/dash/extract-meta.js:82:17)
at Array.forEach (<anonymous>)
at collectMetadataRecursively (/opt/anaconda/envs/Python3/lib/python3.6/site-packages/dash/extract-meta.js:79:14)
at componentPaths.forEach.componentPath (/opt/anaconda/envs/Python3/lib/python3.6/site-packages/dash/extract-meta.js:15:5)
While the error is, of course, legitimate, it would be nice to be able to suppress these tracebacks. I can see three routes:
- do nothing -- after all, this doesn't stop us from building
metadata.json
, it just makes it slightly more confusing. - in
dash/extract-meta.js
, we could explicitly blacklist__tests__
directories in the same way that files that don't end injsx?
are black-listed. AFAICT, the__tests__
directory structure is the default with jest. react-docgen ignoresnode_modules
,__tests__
and__mocks__
by default, so there is definitely a precedent. - add a
--ignore
argument todash-generate-components
that allows passing file globs to be excluded.
Very happy to submit a PR if you decide on what the best course of action is.
Metadata
Assignees
Labels
No labels
Activity
Issue 485 - Slider `className` / external styling regression (plotly#486