Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docz-components): change item key and filename comparison #1176

Merged
merged 1 commit into from
Oct 15, 2019

Conversation

Kerumen
Copy link
Contributor

@Kerumen Kerumen commented Oct 15, 2019

Description

When we try to write a Docz for a package located elsewhere (in a monorepo for example), we face the "props-problem".

In doczrc.js, if we set docgenConfig.searchPath to the relative root of our components, in the stateProps every item key is relative:

{ key: '../../packages/components/src/Button/index.tsx', value: [] }

However, the __filemeta.filename will always be the dist/index.js file. To avoid that, I build my library with babel-plugin-export-metadata (cf #1173). The __filemeta.filename key is now resolved to:

{ filename: 'src/Button/index.tsx' }

With the comparison item.key === filename, it still doesn't match. I changed it to includes because it's more permissive. Also, it's not a regression because if item.key === filename it will still match.

@rakannimer rakannimer merged commit d8832bf into doczjs:master Oct 15, 2019
@Kerumen Kerumen deleted the filename-comparison branch October 17, 2019 08:58
@Kerumen
Copy link
Contributor Author

Kerumen commented Oct 21, 2019

Hello @rakannimer

Thanks for the merge. I upgraded to v2.0.0-rc.58 and it was not included in compiled file. Something was missing during the publish step?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants