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

automatic command doc gen for plugins #18029

Merged
merged 5 commits into from Jan 10, 2023
Merged

Conversation

boneskull
Copy link
Contributor

This enables automatic command docs for plugins:

  • Adds logic to @appium/typedoc-plugin-appium to do so
  • Configures monorepo to consider plugin entry points

@boneskull boneskull self-assigned this Jan 10, 2023
@boneskull boneskull added Enhancement feature Documentation related to writing, reading, or generating documentation labels Jan 10, 2023
@boneskull boneskull requested a review from jlipps January 10, 2023 01:04
* @param {string} script - the string representing the driver script to run
* @param {string} [scriptType='webdriverio'] - the name of the driver script
* library (currently only webdriverio is supported)
* @param {number} [timeoutMs=3600000] - timeout for the script process
*
* @returns {Object} - a JSONifiable object representing the return value of
* @returns {Promise<any>} - a JSONifiable object representing the return value of
Copy link
Contributor Author

@boneskull boneskull Jan 10, 2023

Choose a reason for hiding this comment

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

Note that an invalid return type (non-Promise<T>) prevents documentation from getting generated for a command, so we need to be careful about it. No error will be generated by TS even though it's an async function (which must return a Promise<T>). TS (and thus TypeDoc) "believe" the function returns whatever is in @returns.

Copy link
Member

Choose a reason for hiding this comment

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

yep good to know. i'm sure this was my type mistake

Copy link
Member

@jlipps jlipps left a comment

Choose a reason for hiding this comment

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

LGTM!

* @param {string} script - the string representing the driver script to run
* @param {string} [scriptType='webdriverio'] - the name of the driver script
* library (currently only webdriverio is supported)
* @param {number} [timeoutMs=3600000] - timeout for the script process
*
* @returns {Object} - a JSONifiable object representing the return value of
* @returns {Promise<any>} - a JSONifiable object representing the return value of
Copy link
Member

Choose a reason for hiding this comment

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

yep good to know. i'm sure this was my type mistake

maybe some day we will even use this!
Most of this "just works", but the additional parameters to a plugin command need special handling.  To do that, we have to understand what is a plugin and what is not.

Note that this is incompatible with the "mixin" pattern as found in `BaseDriver` and `FakeDriver`. In other words, a _Plugin_ should not use mixin classes.  I would not recommend mixin classes going forward due to its complexity and opacity.
Also enables type checks in `execute-driver-plugins` and exports types where we weren't before
@boneskull boneskull changed the base branch from boneskull/cmd-docs-3p to master January 10, 2023 17:33
@boneskull boneskull merged commit 697b442 into master Jan 10, 2023
@boneskull boneskull deleted the boneskull/typedoc-plugin branch February 28, 2023 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation related to writing, reading, or generating documentation Enhancement feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants