reactjs / reactjs/react-docgen
react-docgen generates platform specific structure
Open
Nobody has claimed this yet.
needs-discussion
- Dominant language
- TypeScript
- Stars
- 3.8k
- Forks
- 316
- Avg merge
- 5h 7m
- Merged PRs (30d)
- 4
Description
react-docgen --pretty -o lib/metadata.json src/components
On Windows produces:
{
"src\\components\\ExampleComponent.react.js": {
"description": "ExampleComponent is an example component.\r\nIt takes a single property, `label`, and\r\ndisplays it.",
"methods": [],
"props": {
"label": {
"type": {
"name": "string"
},
"required": true,
"description": "A label that will be printed when this component is rendered."
}
}
}
}
On Linux produces:
{
"src/components/ExampleComponent.react.js": {
"description": "ExampleComponent is an example component.\r\nIt takes a single property, `label`, and\r\ndisplays it.",
"methods": [],
"props": {
"label": {
"type": {
"name": "string"
},
"required": true,
"description": "A label that will be printed when this component is rendered."
}
}
}
}
This makes some scripts which use results of react-docgen for code generation fail. One example is plotly/dash component generator. Would you consider this is as a bug?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the react-docgen CLI invocation using src/components and lib/metadata.json, then trace where component paths are serialized. Compare the Windows and Linux examples and make the generated keys platform-independent; verify that both environments produce the same structure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100