You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 in jsx? are black-listed. AFAICT, the __tests__ directory structure is the default with jest. react-docgen ignores node_modules, __tests__ and __mocks__ by default, so there is definitely a precedent.
add a --ignore argument to dash-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.
The text was updated successfully, but these errors were encountered:
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 rundash-generate-components ./src/components <output>
, these test files also get picked up. This leads to a traceback in the build logs:While the error is, of course, legitimate, it would be nice to be able to suppress these tracebacks. I can see three routes:
metadata.json
, it just makes it slightly more confusing.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.--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.
The text was updated successfully, but these errors were encountered: