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

Core Data: Add docgen auto-documentation for actions, selectors #15200

Merged
merged 1 commit into from
Apr 26, 2019

Conversation

aduth
Copy link
Member

@aduth aduth commented Apr 25, 2019

This pull request seeks to update the docgen auto-documentation script to generate documentation for actions and selectors of the @wordpress/core-data module.

Implementation notes:

I could see this being iterated upon toward:

Testing Instructions:

Verify there are no local changes after running npm run docs:build in this branch.

Copy link
Member

@oandregal oandregal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is beautiful!

@aduth aduth merged commit fe43fd7 into master Apr 26, 2019
@aduth aduth deleted the update/autodoc-core-data branch April 26, 2019 13:18
@youknowriad youknowriad added this to the 5.6 (Gutenberg) milestone May 13, 2019
oandregal pushed a commit that referenced this pull request May 16, 2019
This PR does two things:

- Fixes #15626 and #15680 by making the script synchronous. In #15200 we missed the fact that to fill tokens within the same file we need to execute docgen synchronously, otherwise, the last token process will overwrite the first.

- Updates our espree dependency to 4.0.0. When error reporting was back, we uncovered that introducing short Fragment syntax in #15120 caused docgen to fail. The reason is that the espree version we used didn't support that. This fixes it by upgrading it to one that does. A couple of restrictions:

    - espree uses acorn-jsx to power JSX parsing.
    - acorn-jsx@4.1.0 added support for JSX fragment short syntax (patched in 4.1.1).
    - espree@4.0.0 added acorn-jsx@4.1.1. We should use this at a minimum.
    - espree@4.1.0 added acorn@6 and acorn-jsx@5 for parsing. This caused an error I couldn't identify the source.
    - espree@5.0.0 removed support for the attachComment. We use this for collocating the JSDoc comment with the proper export statement. Without this, we can't migrate to espree@5.0.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Core data /packages/core-data [Package] Docgen /packages/docgen [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants