Commit Graph

9508 Commits

Author SHA1 Message Date
Christopher Hiller cf680e15b5 chore(): stop streaming lerna output
this will make test output easier to read
2022-11-29 13:01:55 -08:00
Christopher Hiller 13df5c74e0 feat(appium): implement schema migrations
This adds a module `lib/extension/manifest-migrations` which contains functions that migrate `extension.yaml` files to new versions.

- constant `CONFIG_SCHEMA_REV` renamed to `CURRENT_SCHEMA_REV` and moved into `constants` module
- removes references to removed `PluginRecord` and `DriverRecord` types
- `ExtensionFields` is now `ExtInstallReceipt`
- renamed private fields in `Manifest`; see L365-385 for logic changes
- updated test code
2022-11-29 13:01:55 -08:00
Christopher Hiller 10d1438af7 fix(appium): store path to installed extension
This uses the new v3 version of the manifest schema to add an `installPath` property to every extension in `extensions.yaml`.  This fixes an issue where extensions may not be able to be _instantiated_ within an extension dev environment.
2022-11-29 13:01:55 -08:00
Christopher Hiller 209236023d feat(types): add declarations for versioned manifest files and their types
Contains information on how to increment the schema revision
2022-11-29 13:01:55 -08:00
Christopher Hiller 14d6cb1600 chore(support): return installation path from npm.installPackage() in addition to package.json
This is a breaking change if someone is actually using the `npm` module out of `@appium/support`.  Personally, I'm gonna go with "no"

The signature of `installPackage()` has changed from returning a parsed `package.json` to returning an `NpmInstallReceipt` object, which contains parsed `package.json` prop `pkg` and `string` prop `installPath`.
2022-11-29 13:01:55 -08:00
Kazuaki Matsuo c4124a5ebf docs(appium): update caps example to follow Suggested capabilities (#17840) 2022-11-29 12:39:32 -08:00
renovate[bot] ebcc1d2150 fix(test-support): update dependency sinon to v15 2022-11-29 12:18:45 -08:00
renovate[bot] 8fd1893f03 chore(): update dependency lerna to v6 2022-11-29 12:18:28 -08:00
Christopher Hiller b59af041d3 chore(ci): this re-enables the "deploy" workflow
Branch needed to be updated
2022-11-29 12:13:59 -08:00
renovate[bot] 32557f4bca fix(opencv): update definitelytyped 2022-11-29 10:32:09 +00:00
Christopher Hiller 96e30ad537 fix(types): generate constraints via babel
Because `@appium/base-driver` needs `BASE_DRIVER_CAP_CONSTRAINTS`, we need to build on `prepare`. But we cannot build on `prepare` if the file this var is in needs to be built via `tsc`, because the TS project is built as a whole.  The `prepare` scripts of each package run _before_ the `prepare` script of the monorepo, so the file simply won't be available.

Anyway, that file is now a `.js` file and is compiled via `babel` like the other packages.

Also tweaked `reinstall`/`clean:packages` scripts

# Conflicts:
#	packages/types/lib/index.ts
2022-11-28 17:14:40 -08:00
Christopher Hiller 86a84018f0 chore(ci): always display lifecycle script output
also upgrade `bahmutov/npm-install`
2022-11-28 17:14:40 -08:00
Christopher Hiller 153e736626 chore(appium): add types for cli subcommands
This PR modifies the `Args` type to understand extension subcommands (e.g., `driver install`).

Now the `Args` object that gets passed around will know if the args are for running the server or an extension command, and if the latter, which subcommand and what extra options that subcommand supports (e.g., `driver list --show-installed`)

Further, the `main()` export from `main.js` now uses a conditional type based on the command to know if it will resolve with an `AppiumServer` or `void`.  Previously, this was just a union type; now it is smarter and easier to use.
2022-11-28 17:14:40 -08:00
Kazuaki Matsuo 0cbcf3c7c6 docs: Add the link to the migration guide (#17829) 2022-11-28 12:37:38 -08:00
renovate[bot] 33aef07d24 fix(types): update dependency type-fest to v3.3.0 2022-11-28 15:47:38 +00:00
renovate[bot] 02ad17bce6 fix(gulp-plugins): update dependency @babel/core to v7.20.5 2022-11-28 15:07:05 +00:00
renovate[bot] b0d6adc855 chore(): update dependency lint-staged to v13.0.4 2022-11-25 12:37:50 +00:00
renovate[bot] edb325131b fix(execute-driver-plugin): update dependency webdriverio to v7.27.0 2022-11-24 11:10:20 +00:00
renovate[bot] 8c5d154b95 fix(driver-test-support): update dependency @types/lodash to v4.14.190 2022-11-24 10:26:45 +00:00
renovate[bot] b80b88bd9c fix(support): update dependency axios to v1.2.0 2022-11-23 15:34:11 +00:00
renovate[bot] 9519833f0e chore(): update dependency prettier to v2.8.0 2022-11-23 14:48:31 +00:00
renovate[bot] 2d5281165b chore(): update dependency typedoc to v0.23.21 2022-11-23 13:59:30 +00:00
Kazuaki Matsuo b761bfdd86 chore(doctor): suggest users to use the full path instead of LOCALAPPDATA on Win (#17631)
* add LOCALAPPDATA

* tweak error message

* Update packages/doctor/lib/env.js

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>

* add system.isWindows()

* fix review

* fix lint

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>
2022-11-23 01:41:25 -08:00
renovate[bot] e054f58c50 fix(gulp-plugins): update dependency eslint to v8.28.0 2022-11-23 02:11:53 +00:00
renovate[bot] 0ca2bdecf2 fix(gulp-plugins): update definitelytyped 2022-11-23 01:33:21 +00:00
Christopher Hiller 3772c90448 fix(appium): address ajv version mismatches 2022-11-22 14:32:10 -08:00
Christopher Hiller b5be1fe93b feat(appium,support): use npm link for local installs
npm may have changed its behavior around installation of packages at local paths, but `npm install /path/to/thing` no longer seems to create a symlink.

the `installPackage()` method in `@appium/support`'s `npm` module now accepts an `installType` option.  if the value is `local` an `npm link` will be performed; otherwise an `npm install` will be performed.

- (appium) reverted some changes I made to a test in `driver.e2e.spec.js`
- `installViaNpm` now wants an `installType` option.  this is required
- removed a redundant script
2022-11-22 14:32:10 -08:00
Christopher Hiller e66dbb55cb fix(appium,types): cliArgs is never undefined 2022-11-22 14:32:10 -08:00
Christopher Hiller 9aca66c538 chore(appium): try to fix driver e2e test 2022-11-22 14:32:10 -08:00
Christopher Hiller 1e00faf1a4 fix(base-driver): ensure caps is defined 2022-11-22 14:32:10 -08:00
Christopher Hiller f006fb71d5 chore(dependencies): upgrade to asyncbox v2.9.4 2022-11-22 14:32:10 -08:00
Christopher Hiller 3cd79509f8 fix(base-plugin): do not define a new method 2022-11-22 14:32:10 -08:00
Christopher Hiller e5eefbf9aa chore(): only ignore root "output" folder
this is currently unused, but we have an `output` folder now which should be under vcs
2022-11-22 14:32:10 -08:00
Christopher Hiller 1df7465450 chore(fake-driver): use "mixin" style class composition; many type fixes 2022-11-22 14:32:10 -08:00
Christopher Hiller 91333ec013 chore(): update typedoc, add typedoc-plugin-markdown 2022-11-22 14:32:10 -08:00
Christopher Hiller 9d9e1f875c fix(): apparently I had removed appium from the base tsconfig? 2022-11-22 14:32:10 -08:00
Christopher Hiller 3ac9641430 chore(): eslint should ignore .tsx files 2022-11-22 14:32:10 -08:00
Christopher Hiller 4ea426749a fix(driver-test-support): add missing type-fest dep 2022-11-22 14:32:10 -08:00
Christopher Hiller 226cd018b4 fix(basedriver,types): fix type problems
These arose when attempting to generate docs

- Errors now all have optional params in constructors; normalized param name
- Validate `METHOD_MAP` against an actual `MethodMap`
- Set `cliArgs = {}` as default in `server()`
- Rename `SessionCommands` to `ISessionCommands`
- The "context" in `IFindCommands` is now a generic of any type
- Made various props in `ExternalDriver` optional; `ExternalDriver` now accepts generic `Constraints`
- `proxyCommand` accepts a generic return value
- Removed unnecessary second generic type param from `DriverClass`
2022-11-22 14:32:10 -08:00
Christopher Hiller 0b8addb233 chore(): update vscode debug profiles 2022-11-22 14:32:10 -08:00
Christopher Hiller 84381c5019 chore(driver-test-support,plugin-test-support): generate external source maps in build 2022-11-22 14:32:10 -08:00
Christopher Hiller 2462e3b485 chore(types): address some shortcomings of method maps and constraints
This change:

1. Makes both `MethodMap` and `ExecuteMethodMap` considered "read only".  This is not _entirely_ true, as there's a bit of code that munges `ExecuteMethodDef` objects, but it's good enough for usage.
2. They both now accept a generic `D`, which is by default `Driver`.  Since a `Plugin` can also use `newMethodMap`, there's a conditional type here to add everything from `ExternalDriver` only if it's a `Driver`.  This generic allows proper validation of the map itself (command names must exist!)
3. `Constraints` is now also considered `Readonly`, since it is, in practice.
4. `executeMethodMap` is now actually optional
5. Renamed `Method` to `MethodDef` for consistency

looks like some formatting happened too
2022-11-22 14:32:10 -08:00
Christopher Hiller f715bb4fd8 chore(base-driver,base-plugin,execute-driver-plugin,fake-driver,fake-plugin,images-plugin): update some types for typedoc 2022-11-22 14:32:10 -08:00
Christopher Hiller 4746080e54 feat(): experimental support for typedoc generation
Run `npm run typedoc` to generate docs in `typedoc-docs` dir.

I thought I'd take a few mins and set this up.  It was _mostly_ straightforward, except:

1. Figuring out the "entry point" for each package was difficult until I realized `.js` entry points are assumed to be compiled, and thus require a `sourceMappingUrl` reference. IMO this is probably a bug in TypeDoc
2. The `sourceMappingUrl` must reference an external sourcemap file; not an inline source map.  If it's an inline source map, the system tries to `fs.open` a large data-url.
3. The babel config does not control whether external sourcemaps are created; `@babel/cli` does. So I needed to change those.
4. Practically speaking, I don't see any drawback to external sourcemaps _yet_
5. TypeDoc has poor support for cross-package type references in monorepos, and I had to add a plugin which implements a workaround
6. Per some suggestions in the docs, I modified the order of references in the root `tsconfig.json` to start with "the biggest one first"

I didn't modify any types or docstrings anywhere.
2022-11-22 14:32:10 -08:00
Jonathan Lipps 3cd722c4b6 wip: add some demos of docstrings to trigger auto command docs gen 2022-11-22 14:32:10 -08:00
renovate[bot] 2a445addff fix(types): update webdriverio monorepo to v7.26.0 2022-11-22 13:34:05 -08:00
renovate[bot] 852f133052 chore(): update dependency midnight-smoker to v1.2.2 2022-11-22 13:32:42 -08:00
renovate[bot] 7fd2428816 chore(): update dependency rewiremock to v3.14.4 2022-11-21 13:03:35 -08:00
renovate[bot] 5a794ce1b6 fix(appium): update dependency ajv to v8.11.2 2022-11-21 12:28:23 -08:00
Kazuaki Matsuo 70d4601b18 docs(appium): address installing a version of a driver (#17799)
* docs(appium): address installing a version of a driver

* Update migrating-1-to-2.md

* add bash in some places
2022-11-21 11:22:13 -08:00