Commit Graph

10167 Commits

Author SHA1 Message Date
Christopher Hiller 1b70551055 fix(base-driver): remove needless static prop breaking the build 2023-03-02 15:01:13 -08:00
Christopher Hiller d262271b26 chore(appium): InnerDriver is actually an ExternalDriver
While `findMatchingDriver()` returns a `MatchedDriver`--which is a wrapper around `DriverClass`--the instance of `DriverClass`' constructor is a `Driver`.  But in the case of `AppiumDriver`, we know `InnerDriver` is actually an `ExternalDriver`; this is why we can assign to `server`, `serverHost`, etc.
2023-03-02 15:01:13 -08:00
Christopher Hiller 45b026de67 chore(base-plugin): better type handling in executeMethod 2023-03-02 15:01:13 -08:00
Christopher Hiller 843b797750 chore(driver-test-support): fix broken types in some e2e tests 2023-03-02 15:01:13 -08:00
Christopher Hiller b4c1403c22 fix(fake-driver): fix a broken type 2023-03-02 15:01:13 -08:00
Christopher Hiller e2aa3d3b32 fix(types): type fixes & improvements
moved method-map/execute-method-map-related stuff into its own file, and made the types more expressive.  changed some default parameters to hopefully avoid errors about conflicting constraints
2023-03-02 15:01:13 -08:00
Christopher Hiller b151e4c9bf chore: add dummy test script 2023-03-02 15:01:13 -08:00
Christopher Hiller 5684c4e286 fix(types): callback to implicitWaitForCondition accepts args 2023-03-02 15:01:13 -08:00
Christopher Hiller 189e39d03c fix(docutils): use material theme 2023-03-02 15:00:50 -08:00
renovate[bot] 694f9c6a63 chore(deps): update dependency @types/node to v18.14.4 2023-03-02 15:00:57 +00:00
Christopher Hiller f80f4cb2bc feat(docutils): allow "%s" as version number in commit msg arg 2023-03-01 16:32:00 -08:00
Mykola Mokhnach 908041c525 chore: Remove obsolete jpeg-js version override (#18278) 2023-03-01 22:43:21 +01:00
Christopher Hiller 18c0b4b230 chore(docutils): remove monkeypatching of typedoc 2023-03-01 13:19:39 -08:00
Mykola Mokhnach 4e2423d0f0 docs: Update install driver from github command 2023-03-01 20:36:02 +01:00
renovate[bot] ed1d3aae61 fix(images-plugin): update dependency lru-cache to v7.18.1 2023-03-01 17:36:54 +00:00
renovate[bot] d1d5ecef87 fix(images-plugin): update dependency lru-cache to v7.17.2 2023-03-01 12:30:17 +00:00
Kazuaki Matsuo b88f6e3e86 docs: update Copyright in LCIENSE
from JS foundation to openjs foundation
2023-02-28 13:30:25 -08:00
renovate[bot] 471a4b57e6 fix(types): update dependency type-fest to v3.6.1 2023-02-28 05:28:06 +00:00
Christopher Hiller feebf72eb4 chore(fake-driver): avoid public class field assignment
This changes the `fake-driver` implementation to use declaration merging instead of other alternatives to mixins.

History:

The original code simply assigned the mixin methods to `FakeDriver.prototype` after the `class` definition. In TS, this doesn't fly; you need to be explicit about what class members exist.

To get around this, we've tried multiple different approaches:

1. Use a "mixin pattern" as explained in the official TypeScript documentation, which involves _class factories_.  This is tedious and difficult to reason about; each mixin must be passed to the next in-line, and we must be explicit about the base class and which _previous_ mixins any given mixin expects.
2. Use public class fields (a recent addition to JS).  Basically, these do not work the way you want them to; if a subclass overrides a public field, a method in the superclass which refers to this public field _will use the field as defined in the superclass_--not the subclass. This is different than how methods and accessors work.  This inhibits use of inheritance.
3. Add a method _for each method in each mixin_ to the base class, which simply calls `Function.prototype.apply` on the mixin with the context as the base class' `this`.  This is too verbose.

There may be a better way to do this, but where we've landed is using _declaration merging_ in TypeScript.  It allows us to add (but not remove, and I'm not sure about "modify") properties to the "FakeDriver interface", which seems to be the implicit TS interface created by the `class` keyword.  Since the declaration merging syntax is not expressible in JavaScript, this requires a `.ts` file.  To avoid creating _n_ extra files, it was easier to just make the mixins `.ts` files (you may note that we can mix-and-match JS and TS in our projects at will).

The implementation of each mixin uses `Object.assign()` to put new methods on the prototype, which are previously defined in the merged declaration above.  Finally, a `satisfies` clause (which is a transient type-check; it does not change any types but it _will_ generate a compiler error) ensures the props being added to the prototype match what we've defined.

You'll also note that each method has a `this` parameter, which is not a "real" parameter--it's just an annotation for TS which tells the method what the  context is.  If we hate that, an alternative is to use `FakeDriver.prototype.method = <method>` instead of the `Object.assign` call.  This feels marginally more tedious, but I could go either way.
2023-02-27 14:15:11 -08:00
Christopher Hiller 0f196bad4a chore(types,base-driver): move/remove generics and constraints in Driver
These types were "wrong" in that it is exceedingly difficult to successfully implement `getLog()`, `getLogTypes()`, `supportLogTypes`, etc., in a third-party driver because you'd need to implement _all of it_ or _none of it_.  It's especially bad because it does this without prescribing where the logs should be stored (which is by design).  Oops.

This also moves some generics in the "find" mixins.  This may change again later, but it's unclear that any given driver must declare what a "context" is, and that there can only be one per driver.
2023-02-27 14:15:11 -08:00
renovate[bot] 431092dc87 fix(docutils): update dependency typedoc to v0.23.26 2023-02-27 20:25:05 +00:00
renovate[bot] 935c70683f chore(docutils): update dependency mkdocs-material to v9.0.15 2023-02-27 15:06:51 +00:00
renovate[bot] f8099dafa7 chore(deps): update dependency @types/node to v18.14.2 2023-02-27 10:31:03 +00:00
Kazuaki Matsuo 25c9728f07 docs: update readme (#18251)
* docs: update readme

* Update README.md
2023-02-26 17:24:49 -08:00
renovate[bot] ba6b312244 chore(deps): update dependency eslint to v8.35.0 2023-02-26 13:02:12 +00:00
renovate[bot] 188ed161e4 fix(support): update dependency jimp to v0.22.7 2023-02-25 09:50:30 +00:00
renovate[bot] 96898c87d5 fix(support): update dependency @types/glob to v8.1.0 2023-02-25 02:14:49 +00:00
Christopher Hiller 7b49356322 chore: publish
- appium@2.0.0-beta.56
 - @appium/base-driver@9.3.2
 - @appium/base-plugin@2.2.2
 - @appium/doctor@2.0.8
 - @appium/docutils@0.2.2
 - @appium/driver-test-support@0.4.0
 - @appium/execute-driver-plugin@3.0.7
 - @appium/fake-driver@5.2.0
 - @appium/fake-plugin@3.1.6
 - @appium/images-plugin@2.0.7
 - @appium/opencv@2.0.7
 - @appium/plugin-test-support@0.3.8
 - @appium/schema@0.2.5
 - @appium/support@3.1.6
 - @appium/test-support@3.0.8
 - @appium/typedoc-plugin-appium@0.5.0
 - @appium/types@0.10.0
 - @appium/universal-xml-plugin@1.0.6
@appium/base-driver@9.3.2 @appium/base-plugin@2.2.2 @appium/doctor@2.0.8 @appium/docutils@0.2.2 @appium/driver-test-support@0.4.0 @appium/execute-driver-plugin@3.0.7 @appium/fake-driver@5.2.0 @appium/fake-plugin@3.1.6 @appium/images-plugin@2.0.7 @appium/opencv@2.0.7 @appium/plugin-test-support@0.3.8 @appium/schema@0.2.5 @appium/support@3.1.6 @appium/test-support@3.0.8 @appium/typedoc-plugin-appium@0.5.0 @appium/types@0.10.0 @appium/universal-xml-plugin@1.0.6 appium@2.0.0-beta.56
2023-02-24 13:43:18 -08:00
renovate[bot] bfc3134968 chore(docutils): update dependency mkdocs-material to v9.0.14 2023-02-24 15:37:44 +00:00
renovate[bot] dbaf8d4cae chore(deps): update dependency @types/node to v18.14.1 2023-02-24 10:13:05 +00:00
renovate[bot] eb73be8303 fix(images-plugin): update dependency lru-cache to v7.17.0 2023-02-23 22:18:02 +00:00
renovate[bot] 998514fcce fix(support): update dependency jimp to v0.22.5 2023-02-23 19:21:23 +00:00
renovate[bot] 49f157d63e fix(support): update dependency axios to v1.3.4 2023-02-23 16:23:10 +00:00
renovate[bot] 43b115bb3d chore(deps): update dependency json-schema-to-typescript to v11.0.5 2023-02-23 09:44:48 +00:00
Christopher Hiller 56cf504a2b chore(appium): avoid public class field assignment
This changes `AppiumDriver` to avoid assignment to class properties, and changes the properties on `Schema` to be actually-private instead of pseudoprivate.
2023-02-22 13:40:55 -08:00
Christopher Hiller 2ebb16b077 chore(base-driver): avoid public class field assignment
this should avert potential future bugs when drivers attempt to override these properties
2023-02-22 13:40:55 -08:00
Christopher Hiller c321441451 chore(fake-plugin): avoid public class field assignment 2023-02-22 13:40:55 -08:00
Christopher Hiller 6be7488eef chore(universal-xml-plugin): remove dead code; typecheck all js sources 2023-02-22 13:40:55 -08:00
Christopher Hiller ab5b285714 feat(types): add orientation type; add optional ELEMENT prop of Element 2023-02-22 13:40:55 -08:00
Kazuaki Matsuo 8dc47ae922 docs: add more account in Project Committers (#18236)
* docs: add more
2023-02-22 13:24:20 -08:00
renovate[bot] 91831cf82d fix(support): update dependency @types/uuid to v9.0.1 2023-02-22 21:02:56 +00:00
renovate[bot] 4b10322b80 fix(images-plugin): update dependency lru-cache to v7.16.2 2023-02-22 17:43:23 +00:00
renovate[bot] 2602016eb3 fix(docutils): update dependency yargs to v17.7.1 2023-02-22 14:08:20 +00:00
renovate[bot] 1cb01a5e85 fix(base-driver): update dependency body-parser to v1.20.2 2023-02-22 11:20:27 +00:00
Kazuaki Matsuo e78448dc65 docs: update governance (#18222) 2023-02-21 12:04:52 -08:00
Christopher Hiller 34e0b70982 chore(typedoc-plugin-appium): add a fallback logger
due to the architecture of TypeDoc, it is not straightforward for a random module in a plugin to have access to the logger of the current `Application`.  This change abuses TypeDoc to enable logging for random modules.
2023-02-20 10:05:30 -08:00
Christopher Hiller ebe9477a3c feat(typedoc-plugin-appium): extract descriptions of return values from builtins
If a command is not documented with a `@returns` tag, but a builtin method _does_ have this tag (e.g., `ExternalDriver.createSession()`), then the plugin will use the tag from the builtin.

If a command _does_ have a `@returns` tag, but it provides no description, then the plugin will use the original `@returns` tag (which may have a type) and combine it with the content/description from the builtin (if any).

This requires further inspection of `SignatureReflection` data, which needed a new set of "comment finders", which prompted me to refactor the comment finders into their own files (because it was becoming unwieldy).  The call to `deriveComment` happens in the static `BaseCommandData.rewriteSignature()` method (whereas before it was just a straightforward clone operation).

- Fixed the block tag aggregation to prefer contentful over contentless tags in all cases.
- Modified the `@returns` tag of `FakeDriver.createSession()` for testing
- Moved some types around that were used outside of their sibling modules (e.g. `CommentSource` which used to be called `CommentSourceType`)
- pruned dead imports
2023-02-20 10:05:30 -08:00
Christopher Hiller 3b82c9f1a1 chore(docutils): smol type upgrade
`type-fest`@3.6.0 has a `TsConfigJson` type which no longer contains `unknown` (courtesy of yours truly), so we can use it directly instead of wrapping it in `Jsonify`.
2023-02-20 10:05:13 -08:00
renovate[bot] a9476a67ff chore(deps): update dependency json-schema-to-typescript to v11.0.4 2023-02-20 12:30:24 +00:00
renovate[bot] 24ad9f8741 chore(deps): update dependency @types/node to v18.14.0 2023-02-19 14:01:21 +00:00