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
feat(appium): generate declaration files #16597
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Mar 16, 2022
boneskull
force-pushed
the
boneskull/types-4
branch
from
March 18, 2022 21:11
93c04f1
to
640643c
Compare
boneskull
force-pushed
the
boneskull/types-3
branch
2 times, most recently
from
March 18, 2022 22:13
1f75e4b
to
d0a294b
Compare
boneskull
force-pushed
the
boneskull/types-4
branch
from
March 18, 2022 22:13
640643c
to
3406b81
Compare
boneskull
force-pushed
the
boneskull/types-3
branch
from
March 18, 2022 22:26
d0a294b
to
1a841a7
Compare
boneskull
force-pushed
the
boneskull/types-4
branch
from
March 18, 2022 22:26
3406b81
to
2cc6c98
Compare
boneskull
force-pushed
the
boneskull/types-3
branch
from
March 18, 2022 22:31
1a841a7
to
200d9e3
Compare
boneskull
force-pushed
the
boneskull/types-4
branch
from
March 18, 2022 22:31
2cc6c98
to
039c479
Compare
boneskull
force-pushed
the
boneskull/types-3
branch
from
March 18, 2022 22:33
200d9e3
to
2c5a26f
Compare
boneskull
force-pushed
the
boneskull/types-4
branch
from
March 18, 2022 22:33
039c479
to
9dde1d9
Compare
boneskull
force-pushed
the
boneskull/types-3
branch
from
March 18, 2022 22:40
2c5a26f
to
93e21a5
Compare
boneskull
force-pushed
the
boneskull/types-4
branch
from
March 18, 2022 22:40
9dde1d9
to
dd5bf10
Compare
boneskull
force-pushed
the
boneskull/types-3
branch
from
March 22, 2022 21:02
93e21a5
to
a70fa45
Compare
boneskull
force-pushed
the
boneskull/types-4
branch
from
March 22, 2022 21:02
dd5bf10
to
9fb849f
Compare
jlipps
reviewed
Mar 22, 2022
boneskull
force-pushed
the
boneskull/types-3
branch
from
March 22, 2022 23:59
a70fa45
to
1108dd9
Compare
boneskull
force-pushed
the
boneskull/types-4
branch
from
March 22, 2022 23:59
9fb849f
to
ab32850
Compare
this is failing b/c I changed something I thought was safe to change, but it wasn't. |
boneskull
force-pushed
the
boneskull/types-4
branch
3 times, most recently
from
March 23, 2022 00:41
5290ffc
to
db83065
Compare
jlipps
approved these changes
Mar 23, 2022
boneskull
force-pushed
the
boneskull/types-3
branch
from
March 24, 2022 22:31
1108dd9
to
b837214
Compare
boneskull
force-pushed
the
boneskull/types-4
branch
from
March 24, 2022 22:31
69d7a47
to
2ea2848
Compare
boneskull
added a commit
that referenced
this pull request
Mar 25, 2022
* feat(appium): generate declaration files Configure TS to generate declaration files for `appium` package. Most of these changes are just types getting added or changed via docstrings; in other places, typechecking has caught problems and I had to refactor code to address them. - Removed `// @ts-check` pragma from all files in `lib/`, since now `checkJs: true` is in `tsconfig.json`. It needs to stay in place elsewhere (I think) because only sources in `lib` have declarations generated. - The `install`, `uninstall`, `update` and `run` functions in the base `ExtensionCommand` class were renamed and prefixed with a `_`; TS does not allow overridden functions with differing signatures. It no longer exports a default. - Removed `type` prop of options for `DriverCommand` and `PluginCommand` constructors, respectively (this value is derived from the `ExtensionConfig` `config` parameter instead) - `AppiumDriver` now extends `DriverCore` instead of `BaseDriver`, since some of its function signatures differ from `BaseDriver`'s. - Small refactor of `deleteSession` to make typechecker happy. - `executeCommand` now calls to `BaseDriver` directly if `isUmbrellaCmd` is truthy. This is one place where inheritance just kind of breaks, since `BaseDriver#executeCommand` returns something entirely different than `AppiumDriver#executeCommand` would otherwise. - Removed `--delete-dir-on-start` from build command, since it may blast generated declarations. - Reorganize declarations in `types/`; moved some of them out of `@typedef`s. `types.d.ts` becomes `index.d.ts` - Note that this contains the declarations for `PluginClass` and `DriverClass`, which correspond to the types of extension "main" classes. This differs from the interfaces provided in `@appium/types` (e.g., `Driver`, `ExternalDriver`) in that these aren't just objects; they are classes with constructors and static members. I may end up moving some of this stuff into `@appium/types`, but I'm not sure how useful it will be. Will see when I add types to `@appium/fake-driver`. * chore(appium): remove transpile directives this was ostensibly for gulp-babel * chore(appium): remove redundant type declaration * fix(appium): avoid potential unhandled rejections - make types more readable * chore(appium): fix capabilities types - move `scripts/generate*` elsewhere - add reference to `@appium/types` in `tsconfig.json` * chore(appium): review updates for legibility
This was referenced Jun 15, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Configure TS to generate declaration files for
appium
package.Most of these changes are just types getting added or changed via docstrings; in other places, typechecking has caught problems and I had to refactor code to address them.
// @ts-check
pragma from all files inlib/
, since nowcheckJs: true
is intsconfig.json
. It needs to stay in place elsewhere (I think) because only sources inlib
have declarations generated.install
,uninstall
,update
andrun
functions in the baseExtensionCommand
class were renamed and prefixed with a_
; TS does not allow overridden functions with differing signatures. It no longer exports a default.type
prop of options forDriverCommand
andPluginCommand
constructors, respectively (this value is derived from theExtensionConfig
config
parameter instead)AppiumDriver
now extendsDriverCore
instead ofBaseDriver
, since some of its function signatures differ fromBaseDriver
's.deleteSession
to make typechecker happy.executeCommand
now calls toBaseDriver
directly ifisUmbrellaCmd
is truthy. This is one place where inheritance just kind of breaks, sinceBaseDriver#executeCommand
returns something entirely different thanAppiumDriver#executeCommand
would otherwise.--delete-dir-on-start
from build command, since it may blast generated declarations.