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
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
0e0ac84
to
3dce433
Compare
* @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 |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
3dce433
to
6a8b791
Compare
This enables automatic command docs for plugins:
@appium/typedoc-plugin-appium
to do so