Commit Graph

1306 Commits

Author SHA1 Message Date
Christopher Hiller 591d15bc5e chore: publish
- appium@2.0.0-beta.61
 - @appium/docutils@0.3.4
 - @appium/images-plugin@2.0.10
 - @appium/opencv@2.0.10
 - @appium/typedoc-plugin-appium@0.6.0
2023-04-05 14:56:49 -07:00
Christopher Hiller b808dc866d feat(typedoc-plugin-appium): enable comment derivation via reflection types
In the case of `appium-xcuitest-driver`, each command (or execute) method is declared like so:

```ts
import {someMixin} from './some-mixins';

class XCUITestDriver {
  foo = someMixin.foo;
}
```

The docstring exists on `someMixin.foo`, but not on the `foo` prop of an `XCUITestDriver` instance.

This change makes `@appium/typedoc-plugin-appium` dig into such references and derive the comments.
2023-04-05 14:53:56 -07:00
Christopher Hiller bb11d1cfe9 fix(opencv): fix a type error causing typedoc problems 2023-04-04 14:02:50 -07:00
Christopher Hiller 11c6aaae41 chore: publish
- appium@2.0.0-beta.60
 - @appium/docutils@0.3.3
 - @appium/typedoc-plugin-appium@0.5.4
2023-04-04 11:52:51 -07:00
Christopher Hiller 822206be20 fix(typedoc-plugin-appium): allow ts v5 as peer dep 2023-04-04 11:51:16 -07:00
Christopher Hiller a11a6ede33 chore: publish
- appium@2.0.0-beta.59
 - @appium/base-driver@9.3.5
 - @appium/base-plugin@2.2.5
 - @appium/doctor@2.0.11
 - @appium/docutils@0.3.2
 - @appium/driver-test-support@0.4.3
 - @appium/eslint-config-appium-ts@0.3.1
 - @appium/eslint-config-appium@8.0.3
 - @appium/execute-driver-plugin@3.0.10
 - @appium/fake-driver@5.2.3
 - @appium/fake-plugin@3.1.9
 - @appium/images-plugin@2.0.9
 - @appium/opencv@2.0.9
 - @appium/plugin-test-support@0.3.11
 - @appium/support@3.1.9
 - @appium/test-support@3.0.11
 - @appium/typedoc-plugin-appium@0.5.3
 - @appium/types@0.10.3
 - @appium/universal-xml-plugin@1.0.8
2023-04-03 12:55:58 -07:00
Christopher Hiller 296c29ad84 fix(types): make getContext & getContexts generic
These can now return `T` and `T[]`, respectively.  `T` defaults to `string`, but in `appium-xcuitest-driver`, `T` is either `string` or an object, depending on the settings.
2023-04-03 12:44:29 -07:00
Mykola Mokhnach 07f9d41bd2 chore(appium): Add base path to the server startup log line (#18437) 2023-04-03 21:06:57 +02:00
renovate[bot] d8b633406a fix(doctor): update dependency appium-adb to v9.11.0 2023-04-03 09:28:25 +00:00
renovate[bot] b9d339eaf3 fix(universal-xml-plugin): update dependency @xmldom/xmldom to v0.8.7 2023-03-31 13:23:31 +00:00
renovate[bot] 1ea309814a chore(docutils): update dependency mkdocs-material to v9.1.5 2023-03-31 11:52:55 +00:00
Christopher Hiller 19ff931bc0 chore(typedoc-plugin-appium): normalize some conversion log messages
These now contain more info about what exactly is being converted.
2023-03-30 16:58:36 -07:00
Christopher Hiller 9d2469fdf3 docs: enable typedoc generation for more workspaces
- Doc gen for:
    - `@appium/driver-test-support`
    - `@appium/opencv`
    - `@appium/plugin-test-support`
    - `@appium/test-support`

- Added a `dev:docs` script in the root monorepo. The file watcher does _not_ presently rebuild reference docs upon changes to sources (which is a limitation of `@appium/docutils`).
- Changed the `dev:docs:*` scripts in `appium` to use `appium-docs` (so it rebuilds reference docs at least once [because it runs typedoc!!])
2023-03-30 16:58:36 -07:00
Christopher Hiller 47a4ddd2a3 chore(types): deprecate Element.ELEMENT
- move `Element` into `util` since it isn't specific to action sequences
- add more docs for it
2023-03-30 16:57:41 -07:00
renovate[bot] 55805390b5 fix(types): update dependency type-fest to v3.7.2 2023-03-30 10:07:01 +00:00
renovate[bot] bbcaec9c05 fix(appium): update dependency package-changed to v3 2023-03-29 16:04:55 -07:00
Christopher Hiller d514ebdd7e chore: update gitHead for lerna screuwp 2023-03-28 13:12:00 -07:00
Christopher Hiller 8480a85ce2 chore: publish
- appium@2.0.0-beta.58
 - @appium/base-driver@9.3.4
 - @appium/base-plugin@2.2.4
 - @appium/doctor@2.0.10
 - @appium/docutils@0.3.1
 - @appium/driver-test-support@0.4.2
 - @appium/eslint-config-appium-ts@0.3.0
 - @appium/eslint-config-appium@8.0.2
 - @appium/execute-driver-plugin@3.0.9
 - @appium/fake-driver@5.2.2
 - @appium/fake-plugin@3.1.8
 - @appium/plugin-test-support@0.3.10
 - @appium/support@3.1.8
 - @appium/test-support@3.0.10
 - @appium/typedoc-plugin-appium@0.5.2
 - @appium/types@0.10.2
 - @appium/universal-xml-plugin@1.0.7
2023-03-28 13:10:45 -07:00
renovate[bot] 86eb495641 fix(driver-test-support): update definitelytyped 2023-03-28 08:00:49 +00:00
Christopher Hiller 5485f0b9cd fix(types): fix method map types
These types do not care about constraints, only the shape of the driver itself.
2023-03-27 17:07:51 -07:00
Christopher Hiller 4974403661 fix: backwards-compatible fixes for TS v5.x
These will be issues when we upgrade
2023-03-27 17:07:51 -07:00
Christopher Hiller deb631b456 fix(basedriver): convert main driver implementation to typescript
This seems to fix the bug in #18379.  There must be some sort of bug in TypeScript w/r/t `@implements` or maybe even it was not treating `@typedef` as a proper alias.  Perhaps it's user error--omitting optional type args in alias-style typedefs may end up making a new type entirely.  idk, but this was easier to deal with.

Closes #18379.
2023-03-27 17:07:51 -07:00
Christopher Hiller 238c489f3a chore(base-driver): add a failing type test 2023-03-27 17:07:51 -07:00
Christopher Hiller 3c9fa7ba73 fix(appium,types,base-driver,fake-driver,driver-test-support): normalize constraint defaults
Another handful of fixes.

- remove second "extra" parameter from `Capabilities`, `NSCapabilities` `W3CCapabilities`. we were not using it anywhere to my knowledge. it was an escape hatch anyway.
- never assign `BaseDriverCapConstraints` as the default constraints, because this is confusing as hell. instead, drivers should use the `*DriverCaps` types which automatically pulls the base constraints in. applied across several workspaces
- renamed `DeviceSettings` => `IDeviceSettings` because `DeviceSettings` is a class.
- the session ID param of `Core`'s `sessionExists()` is actually optional (per the implementation)
- allow some modicum of type narrowing at the class level around settings and values returned by `ISessionHandler`'s methods. also, not all values in the raw settings object are of the same type `T`, so fix that
- `server`, `serverHost`, `serverPort` and `serverPath` are not members of `Core` (using `AppiumDriver` as a litmus test--it interacts with `Driver` types but does not have these properties itself)
- changed a few types to interfaces where possible
- moved a lost comment
- further dumbed-down the logdef stuff
- `Driver.driverData` is _always_ defined, since `Core` makes it an empty array.
- `DriverOpts` no longer contains "partial" caps; this it not quite right as the caps are not assigned until a session is created, but there's a conflict between some props which are _both_ server args and defined in constraints.  anyway, this is what `initialOpts` is for
- fix some type disagreements in basedriver's "capabilities" module
2023-03-27 17:07:51 -07:00
Christopher Hiller e8e8252c52 chore(types): add type tests for Plugins 2023-03-27 14:23:25 -07:00
Christopher Hiller 50f1e69268 fixup 2023-03-27 14:23:25 -07:00
Christopher Hiller 0dcd5fa371 fix(base-driver,base-plugin,types): update PluginCommand and DriverCommand types
The first arg of `PluginCommand` is a `NextPluginCallback` which now returns `Promise<unknown>` instead of `Promise<void>`, which was incorrect.

We use `unknown` rather than `any` because it forces us to be explicit about the return value of `await next()` if we are to call it.

Added a type `DriverCommandToPluginCommand` which essentially converts a `DriverCommand` to a `PluginCommand`.  It's probably best used as a type guard or decorator, but it can "fill in the blanks" when overloading commands in a plugin.

Also normalized some of the `TArgs`/`TReturn` stuff.
2023-03-27 14:23:25 -07:00
Christopher Hiller 75cbb11d00 chore: rename ExtensionCommand classes due to naming conflict
mainly because a "command" is a thing in drivers/plugins, and these classes refer to something else completely unrelated.  renamed to `*CliCommand` to avoid confusion.
2023-03-27 14:23:25 -07:00
Christopher Hiller 020473afc4 fix(eslint-config-appium): disable import/no-unresolved for tsd tests
`tsd` has a apparently non-standard resolution algorithm
2023-03-27 12:44:47 -07:00
renovate[bot] bc860c733a fix(types): update dependency type-fest to v3.7.1 2023-03-27 08:31:03 +00:00
renovate[bot] d774a8428a fix(test-support): update dependency sinon to v15.0.3 2023-03-27 07:22:50 +00:00
renovate[bot] 7f061d2362 chore(docutils): update dependency mkdocs-material to v9.1.4 2023-03-25 11:08:46 +00:00
Christopher Hiller 0c52b50e65 fix(appium): remove longjohn
This removes `longjohn` and replaces it with a statement which increases the stack trace limit from the default (10) to 100.

I believe setting this overrides whatever was passed to the runtime `--stack-trace-limit` option.  If someone complains, we can try a different strategy.

Closes #18357
2023-03-24 12:22:33 -07:00
Erhan Alankuş 12f4ec404c docs(appium): grammar fix (#18359)
Co-authored-by: Kazuaki Matsuo <fly.49.89.over@gmail.com>
2023-03-23 23:21:19 -07:00
Erhan Alankuş 8aa39c117f docs(appium): update index.md (#18363)
Co-authored-by: Kazuaki Matsuo <fly.49.89.over@gmail.com>
2023-03-23 23:20:46 -07:00
Christopher Hiller 499bda4533 chore(types): make the lone JS file a TS file
also: remove unused imports
2023-03-23 12:15:51 -07:00
Christopher Hiller 9ef564f0be chore(types): move more utility types into util module 2023-03-23 12:15:51 -07:00
Christopher Hiller d303527c3d fix(base-driver): misc type fixes
- `PostProcessOptions` moved into `@appium/types`
- `shutdownUnexpectedly` cannot be marked `@protected` as anything used this way is inaccessible in mixins
- suppress a `@typescript-eslint` warning. this probably needs to happen in a few other files
2023-03-23 12:15:51 -07:00
Christopher Hiller 51a8f2fc34 fix(base-driver): fix timeout mixin to use proper context types 2023-03-23 12:15:51 -07:00
Christopher Hiller c56dc98d13 chore(base-driver): fix description of mixin function to refer to BaseDriver 2023-03-23 12:15:51 -07:00
Christopher Hiller 454f6a5d63 fix(support): fix a few type problems; use new HTTPHeaders type 2023-03-23 12:15:51 -07:00
Christopher Hiller 87408e529c chore(types): organize more types; remove some deprecated types
This change removes types for methods in `ExternalDriver` (or rather the interfaces that build it) that were marked `@deprecated` and  consumed by `appium-xcuitest-driver`.  I salvaged what I could from the descriptions in these docstrings, and have moved them into `appium-xcuitest-driver` (obviously not in this repo).

Also:

- created some new files to group types logically
- created a `HTTPHeaders` type
- created a type `ConfigureAppOptions` for `DriverHelpers.configureApp`, and a `PostProcessOptions` type within it.
- added a couple other types
- fixed some signatures to look more like reality
- modified the return value of `queryAppState()` to return `0|1|2|3|4` instead of `0|1|3|4` since `appium-xcuitest-driver` returns the former
- made the `LogDef` and related types even _more_ loose.  tbh these are very awkward to type properly; I cannot figure out a good way to narrowly type the `self` param to a log `getter`.
- noted which of the remaining `@deprecated` methods in `ExternalDriver` were _not_ in use by `appium-xcuitest-driver`, so I can later remove them once I've salvaged the docstrings to put into `appium-uiautomator2-driver`.
2023-03-23 12:15:51 -07:00
Christopher Hiller 24bec8ce81 chore: downgrade log message about manifest upgrade
Most users are not going to care or know what this is.
2023-03-23 11:56:05 -07:00
Christopher Hiller d9b47bc864 feat(appium): improvements to ext commands when running extension in development
This PR does a handful of things:

1. It adds a `--verbose` flag to `appium <driver|plugin> list` which just dumps a big object (via Node's `util.inspect()`), which contains the underlying manifest file data
2. It creates a new manifest schema revision where the "install type" can be `dev`. Added a migration.
3. Displays a warning if trying to uninstall an extension in dev mode
4. Displays `[installed (dev mode)]` instead of `[installed (npm)]` when running `appium <driver|plugin> list` w/o `--verbose` flag
5. Attempted to simplify the return type of `ExtensionCommand.list()`

Closes #18277
2023-03-23 11:56:05 -07:00
renovate[bot] 6912fa14f2 fix(types): update dependency type-fest to v3.7.0 2023-03-23 11:22:16 +00:00
Christopher Hiller 409192d063 fix(eslint-config-appium-ts): disable brace-style rule
In certain situations in `.ts` sources, class definition lines can get very long.  Prettier will split these into multiple lines, and add a final line with `{` at position 0.  This conflicts with the `brace-style` rule in ESLint.  I am not sure why the ESLint prettier config doesn't already handle this, but I am going to guess it's because that config doesn't work on `.ts` sources.
2023-03-22 16:25:22 -07:00
Christopher Hiller 309fe4c964 chore: lint everything 2023-03-22 16:25:22 -07:00
Christopher Hiller 34891f5657 fix(base-driver,types): fix websocket-related types on AppiumServer 2023-03-22 16:25:22 -07:00
Christopher Hiller 43df77f6b6 feat(eslint-config-appium-ts)!: enable for JS sources
BREAKING CHANGE: This makes `@appium/eslint-config-appium-ts` also apply to JS sources _and_ requires a new peer dependency (`eslint-import-resolver-typescript`). The `main` file is now a `.js` file.  The module is expected to _extend_ `@appium/eslint-config-appium`, not replace it; consumers needn't extend both in their ESLint config.

In the not-too-distant past, `@typescript-eslint/parser` was unable to understand docstrings in `.js` files. Evidently this is no longer true.

I've rewritten and heavily commented the configuration explaining the intent behind everything.
2023-03-22 16:25:22 -07:00
Christopher Hiller 78c6a0b991 chore: remove jsdoc vestiges 2023-03-22 11:59:20 -07:00