This can happen if someone does something like `npm install --no-save appium`, _or_ if npm changes its shrinkwrap behavior for reasons that cause `appium` to be installed in `$APPIUM_HOME/node_modules` _(cough)_
Ref: #17073
this change uses --legacy-peer-deps for newer versions of npm to
avoid installation of appium when installing extensions in ~/.appium. this does not work if the extension contains a shrinkwrap with appium in it, though.
in that case, an extra copy of appium will always be installed.
it creates a symlink, e.g., ~/.appium/node_modules/appium to the currently-running appium, wherever that is. could not abuse NODE_PATH to do this.
this is rather naive and does not check that the symlink is actually the same as the running appium if it already exists. that might cause some weird problems with multiple installs of appium on the same machine, but if it does, we can fix them as they arise.
I think, perhaps, having `.ts` files hanging around so that we can make declarations out of them is bad news. I got this idea from wdio. Anyway, the TS alias `appium` (often used as `appium/types`) points to the `types` dir -- not the `build/types` dir. It can't point to that, because recursion. That means an import from `../lib/constants` imports from the _ESM_ `../lib/constants`, which apparently is not understandable by the compiler since there is no `.d.ts` flie living there (even if `constants.js` is typed via docstrings, which it is). I don't know. It was easier just to do this for now. At some point later I'll look at using plain `.d.ts` files for this sort of thing, since it seems like it should work.
When any package here is consumed as a library, the production deps installed alongside it _must_ also include depenencies related to type information. If these packages _aren't_ included, consumers will not have the requisite declarations installed and will get incomplete type information--at best--or worse; compilation errors.
Putting the onus on the consumer to install these requisite types is both user-hostile _and_ can result in the incorrect versions of type declarations being installed.
To that end, I've moved the various type declaration deps to production deps of the packages in which they are used. Sometimes this is multiple packages (in the case of, say, `@types/teen_process`). This results in many types being removed from the monorepo root. Those that remain are for _dev dependencies only_. If a packages uses, say, `ws`, but only in its tests, then the types can remain in the monorepo root along with the rest of the common dev deps.
I also saw an unused `supports-color` in `appium` and removed it.
This makes a small handful of fixes related to type consumption:
- `@appium/types` is now a direct dep of `appium`. Without this, types leveraging `@appium/types`--e.g., `BaseDriver`, which is based on a `Driver` interface defined in `@appium/types`--fail to be understood fully by a consumer (such as an extension). Extension authors would need to install `@appium/types` as their own dev dependency. This change makes addition of `@appium/types` unneeded when consuming types exposed by `appium`, `appium/driver`, `appium/support`, etc.
- At this time, consumers will still need to add `@appium/types` if they wish to directly reference types defined in here (such as `W3CCapabilities`).
- In manual testing of the exported types, I found two issues in `appium/lib/schema/arg-spec.js` and `appium/lib/schema/schema.js` which were relative type imports and only worked in the context of the monorepo. I fixed these.
- `@appium/types` previously re-exported types defined within `axios` (`HTTPMethod`); I just copied and pasted what we needed to avoid the production dependency on `axios`.
- `@types/express`, `@types/npmlog`, `type-fest` and `@wdio/types` were added as production deps to `@appium/types`, as these are needed. However, these are packages _only_ containing types, unlike `axios`. There's a lesson to be learned here, but I don't know what it is.
* #16817 2.0 Chinese mkdocs-zh.yml
Rebase the code for mkdocs-zh
* #16817 2.0 Chinese mkdocs-zh.yml
Change the folder from cn to zh as mkdocs required
* #16817 2.0 Chinese mkdocs-zh.yml
Change the relative link from en to zh
* #16817 2.0 Chinese mkdocs-zh.yml
Translate some titles to trigger the build
Because it’s now under VCS, we shouldn’t remove it when cleaning, since that will probably result in a dirty working copy.
changed the `reinstall` script to call `npm ci`, which a) expects `package-lock.json` to exist, and b) removes `node_modules` before it installs stuff.