Skip to content

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

Merged
aduth merged 1 commit intomasterfrom
update/autodoc-core-data
Apr 26, 2019
Merged

Core Data: Add docgen auto-documentation for actions, selectors#15200
aduth merged 1 commit intomasterfrom
update/autodoc-core-data

Conversation

@aduth
Copy link
Copy Markdown
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
Copy Markdown
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 [Tool] Docgen /packages/docgen [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants