Commit Graph

10160 Commits

Author SHA1 Message Date
Jonathan Lipps 388df9d30b docs(appium): include all reference output in docs build 2023-01-26 13:24:05 -08:00
ian zhang d43de6fdc6 docs(appium): #18104 Update build-drivers with zh-lang (#18108)
* #18104
Update build-drivers with zh-lang

* #18104
Update as upstream commit
2023-01-26 10:16:13 -08:00
Jonathan Lipps 1cd2a7df99 docs(appium): add plugin development guide 2023-01-25 12:21:18 -08:00
Kazuaki Matsuo 0f95213398 fix: add missing ' in an error message (#18105) 2023-01-25 11:28:36 -08:00
renovate[bot] 644f300cd8 fix(types): update dependency @types/express to v4.17.16 2023-01-24 10:56:47 +00:00
Christopher Hiller c5451e4d82 fix(base-driver,driver-test-support,support): update types for axios@1.2.3 2023-01-23 18:24:25 -08:00
renovate[bot] 20c176bae7 fix(support): update dependency axios to v1.2.3 2023-01-23 18:24:25 -08:00
renovate[bot] 444b9886a2 fix(execute-driver-plugin): update dependency webdriverio to v7.30.0 2023-01-23 18:24:08 -08:00
Christopher Hiller c8ff39a02e chore: do not publish tsconfig.tsbuildinfo
apparently the "files" prop does not take into account what the ".npmignore" file says, so these were still getting published.

hopefully this will fix it.
2023-01-23 16:39:36 -08:00
Christopher Hiller 4734673ac9 chore(execute-driver-plugin,support,types): use named tuples
The "old" way of defining tuples is `[T, U]`, but I think TS 4.7 introduced "named" tuples, which at least provides a little bit of context to consumers, e.g., `[foo: T, bar: U]`.  Since a tuple is just a fixed-length array, the names aren't actually used in code, but are surfaced in type information and error messages regardless.

Also:

- Fixed bad param name in definition of `SessionHandler`
- Used a semantically-correct type for `StopScreenRecordOptions.formFields`
2023-01-23 16:39:06 -08:00
Christopher Hiller 1e0d32b6fd Update packages/types/lib/driver.ts
Co-authored-by: Kazuaki Matsuo <fly.49.89.over@gmail.com>
2023-01-23 13:46:45 -08:00
Christopher Hiller 06c78d83c3 chore(typedoc-plugin-appium): just cleanup 2023-01-23 13:46:45 -08:00
Christopher Hiller 9b8e9a1a36 fix(typedoc-plugin-appium): fix cloneComment() and add a test 2023-01-23 13:46:45 -08:00
Christopher Hiller c8297088bf feat(typedoc-plugin-appium): display examples in command documentation
Contains significant changes to comment derivation.

Given a command method in an external driver, these changes cause the plugin to search a) the method itself, b) the method's signature (which may come from `BaseDriver` or even `DriverCore`), the method map, and the `ExternalDriver` interface for comments (in that order).  It picks the first "summary" / "description" found, but otherwise it will _merge_ any and all block tags found, given the same precedence.  So if, for example, a `@see` tag exists in cmd method `ExternalDriver.foo()` but not in `MyDriver.foo()`, the plugin will find that `@see` tag and put it into the data to be rendered by the theme for the command associated with `MyDriver.foo()`.

This also works with `@example`, with a change: the examples side-step the usual rendering (by `typedoc-plugin-markdown`'s theme; this is due to tight coupling and complexing necessary in overriding the default behavior by simply adding an overriding template or partial), and are rendered per-language (since it's likely/expected that each method will have examples in several languages).  The language of the example is detected via the _fenced code block_ as used in the example.  In markdown, we're currently using some headers to split examples up, but we also render a token as an HTML comment which can be used on the `mkdocs` side of things to detect the example and perform further post-processing (e.g. as a set of tabs).

If a command has examples, the examples will be surrounded by (in addition to headers for each language) this token pair:

```html
<!-- BEGIN:EXAMPLES -->
...
<!-- END:EXAMPLES -->
```

Each language's fenced code block is surrounded by the following token pair _within_ the above pair:

```html
<!-- BEGIN:EXAMPLE lang=$lang -->
...
<!-- END:EXAMPLE -->
```

...where `$lang` is the _proper name_ for a language, e.g., `JavaScript` or `Ruby`.  The fenced code blocks themselves remain unchanged and will contain the "identifier" for the language, e.g., `js` or `javascript` or `rb` or `ruby` (i.e. they are _not_ normalized).

Also:

- changed the type of `KnownMethods` to be a `Map<string, CommandMethodDeclarationReflection>`, as the value of the `comment` prop is better derived via `deriveComments()`. This changes `findAsyncMethodsInReflection()` as well
- memoized `AppiumPluginLogger.createChildLogger()` to avoid creating identical loggers
- renamed `ProjectCommands.empty` => `ProjectCommands.isEmpty`
- `CommandReflection`'s `constructor` now expects a `log` parameter
- Hopefully easier-to-understand verbose logging
2023-01-23 13:46:45 -08:00
Christopher Hiller f27c44f4f7 docs(types): add examples for getStatus (route "/status")
for tests, but we can adapt this for publication
2023-01-23 13:46:45 -08:00
Christopher Hiller 63b7135713 docs(base-driver): hide a comment for testing 2023-01-23 13:46:45 -08:00
Christopher Hiller c9f247ad03 chore(appium): do not attempt automatic install of extensions in dev env
It sucks to run the "autoinstall extensions" script in CI or the monorepo due to the order in which lifecycle scripts are executed: the `postinstall` script of `appium` will always run _before_ the `prepare` script in the monorepo root.  This completely disables the behavior if Appium has not yet been built.
2023-01-23 12:56:16 -08:00
Christopher Hiller f1e0a46712 chore: publish
- appium@2.0.0-beta.53
 - @appium/base-driver@9.3.0
 - @appium/base-plugin@2.2.0
 - @appium/doctor@2.0.6
 - @appium/docutils@0.1.6
 - @appium/driver-test-support@0.3.6
 - @appium/fake-driver@5.1.4
 - @appium/fake-plugin@3.1.4
 - @appium/plugin-test-support@0.3.6
 - @appium/support@3.1.4
 - @appium/test-support@3.0.6
 - @appium/typedoc-plugin-appium@0.3.4
 - @appium/types@0.9.0
@appium/base-driver@9.3.0 @appium/base-plugin@2.2.0 @appium/doctor@2.0.6 @appium/docutils@0.1.6 @appium/driver-test-support@0.3.6 @appium/fake-driver@5.1.4 @appium/fake-plugin@3.1.4 @appium/plugin-test-support@0.3.6 @appium/support@3.1.4 @appium/test-support@3.0.6 @appium/typedoc-plugin-appium@0.3.4 @appium/types@0.9.0 appium@2.0.0-beta.53
2023-01-23 12:49:31 -08:00
Jonathan Lipps 8295e3f956 chore(types): commit auto-generated lint update 2023-01-23 12:32:42 -08:00
renovate[bot] 254f82402e chore(deps): update dependency json-schema-to-typescript to v11.0.3 2023-01-21 11:06:46 +00:00
renovate[bot] 6c4ba8caa5 fix(types): update dependency type-fest to v3.5.3 2023-01-21 02:08:38 +00:00
Christopher Hiller 12245ae98c chore(ci): add job to disallow merges of PRs
...if it has the "On Hold" label
2023-01-20 15:01:06 -08:00
Christopher Hiller 96eb4d7b3f chore(types): remove @wdio/types
Due to problems where multiple versions of `@wdio/types` can be installed in the dep tree of external modules, and the fact we are not using most of the types we pull in, it makes sense to remove this module.

The "standard" W3C caps have been pulled out of `@wdio/types`.  We do not need any webdriverio or vendor-specific cap types.  Those only make sense when consuming wdio itself and/or writing client-side code.

This will also make it easier to upgrade `webdriverio`; it too depends on `@wdio/types`.

Note: there were several Appium-specific caps in `@wdio/types` that I did not recognize.  Perhaps these were driver-specific and not accurately labeled as such.  Driver-specific caps belong in drivers.
2023-01-20 14:57:24 -08:00
Jonathan Lipps 11015b8871 test(appium): add e2e tests for plugin use of executeMethod(Map) 2023-01-20 14:21:08 -08:00
Christopher Hiller de6e83d196 chore(appium,types): rename cli command types
`PluginCommand` and `DriverCommand` both conflicted with `PluginCommand` and `DriverCommand` in `@appium/types`.  The former are string literals representing CLI args; the latter represent methods on plugin and driver classes.

This renames the former to make it clear it's CLI-specific
2023-01-20 14:21:08 -08:00
Christopher Hiller b8b7aae060 chore(types): tweak Plugin a little bit more
- `onUnexpectedShutdown` will always receive an `ExternalDriver` in a `Plugin`
- `handle` is actually a "known" `PluginCommand`
2023-01-20 14:21:08 -08:00
Christopher Hiller 9cd228247a chore: update MethodMap/ExecuteMethodMap to support plugins 2023-01-20 14:21:08 -08:00
Jonathan Lipps 84abed920a feat(base-plugin): add ability for plugins to implement execute methods 2023-01-20 14:21:08 -08:00
Christopher Hiller a96d952a06 chore(ci): add doc build to ci 2023-01-20 10:31:46 -08:00
renovate[bot] 854c5ec946 fix(support): update dependency @types/glob to v8.0.1 2023-01-20 16:23:41 +00:00
renovate[bot] 6726f6ddb5 chore(docutils): update dependency mkdocs-material to v9.0.6 2023-01-20 12:42:33 +00:00
Christopher Hiller 108c1abae0 chore(typedoc-plugin-appium): disable sorting
Sorting is handled by typedoc and it supersedes whatever we do with it.  The correct way to implement a custom sort would be...something else.  YAGNI for now
2023-01-19 14:31:43 -08:00
Christopher Hiller ec48c9cea7 fix(typedoc-plugin-appium): non-appium theme should not cause a fatal error
This was preventing tests from running
2023-01-19 14:31:43 -08:00
Christopher Hiller 4cb9bec7a0 chore(typedoc-plugin-appium): remove cruft 2023-01-19 14:31:43 -08:00
Christopher Hiller 92a45be902 chore(typedoc-plugin-appium): reorganize the tests
many of these were actually E2E tests (and slow)
2023-01-19 14:31:43 -08:00
Christopher Hiller a8365391dc chore(fake-driver): annihilate loathsome mixin classes
I did here what I did to `appium-xcuitest-driver`, which was to assign the command methods to the class as fields.  Easier this way.
2023-01-19 14:31:43 -08:00
Christopher Hiller 18772f4f0d fix(docs): fix filename of basedriver commands
I'm unsure about a) where the filename I just changed came from, and b) if we have control over the filename, and c) if so, how much control.

But anyway: it seems to generate a file named `appium_base_driver-1._appium_base_driver.md`.
2023-01-17 11:33:12 -08:00
Christopher Hiller d0e1cb2f65 fix(typedoc-plugin-appium): reduce severity of "missing method" error
This is either a bug in the plugin or a bug in `@appium/base-driver` (tbd).  But it was causing `typedoc` to fail with a fatal error, and we don't want that to happen (yet).  This change punts on the problem to get the docs build working
2023-01-17 11:33:12 -08:00
Christopher Hiller ed1edab209 fix(typedoc-plugin-appium): fix keywords for typedoc plugin autodetection 2023-01-17 11:33:12 -08:00
Christopher Hiller 52560a41b3 chore(scripts): fix typo in sync-pkgs script
The typo caused the `keywords` field in `packages/typedoc-plugin-appium/package.json` to be overwritten.  Because of this, the `keywords` field lost the magic keyword that `typedoc` uses to automatically detect a plugin.  Thus, `@appium/typedoc-plugin-appium` could not be found, and its specific options caused `typedoc` to fail.
2023-01-17 11:33:12 -08:00
renovate[bot] f76a5a71c9 fix(doctor): update dependency appium-adb to v9.10.24 2023-01-17 15:08:06 +00:00
renovate[bot] 8b15e2ca3a chore(deps): update dependency eslint-plugin-import to v2.27.5 2023-01-17 12:02:35 +00:00
renovate[bot] d7b35ab28b fix(support): update dependency glob to v8.1.0 2023-01-16 12:46:32 +00:00
renovate[bot] 54fdcea08a chore(deps): update dependency eslint to v8.32.0 2023-01-15 21:09:46 +00:00
renovate[bot] 64fd8ce940 fix(types): update dependency type-fest to v3.5.2 2023-01-15 17:22:46 +00:00
renovate[bot] 34081b44c8 fix(doctor): update dependency appium-adb to v9.10.23 2023-01-15 14:12:40 +00:00
renovate[bot] 12afa8934a chore(docutils): update dependency mkdocs-material to v9.0.5 2023-01-15 10:27:54 +00:00
renovate[bot] 3b213d40e7 fix(doctor): update dependency appium-adb to v9.10.22 2023-01-14 13:52:57 +00:00
renovate[bot] 8466cf6fcb chore(deps): update dependency prettier to v2.8.3 2023-01-14 11:00:36 +00:00
renovate[bot] 5c2168fb09 chore(deps): update dependency lerna to v6.4.1 2023-01-14 00:51:50 +00:00