The `inspectObject()` function in `utils` was doing... stuff... to display both the default caps and non-default arguments. Arrays, in particular, wound up looking like objects. I found this objectionable; I hope there isn't a good reason it's this way.
- Remove `utils.inspectObject()` and replace it with `inspect()`, which delegates to Node.js' built-in `util.inspect()` function (which does a bang-up job of dumping objects, including color!)
- Remove the `parser` argument (and return value!) from various functions where it was used. e.g., `init()` in `main.js` was returning the `parser` instance, but now we don't need it, since it was only needed for `getNonDefaultServerArgs()`, which doesn't need it. `parser` was being passed through several functions this way.
- Add a dumb test for `utils.inspect()`
- Add another dumb test for `getNonDefaultServerArgs()`
- Add `@types/express` since it was missing.
- More types in various associated places; fix other types
- Consistent naming in impl of `getNonDefaultServerArgs()`
This PR adds the `appiumDeprecated` keyword which can be used to mark an argument as deprecated in the `--help` text.
In addition:
- fix a bug where `--help` would cause Appium to exit with a nonzero exit code (it would essentially `throw undefined`)
- remove unused `lib/cli/argparse-actions` and stuff that used it, since that stuff was also unused
- implement `appiumCliIgnore`, though it's not actually being used atm.
- extract helpers for running `appium` into `test/cli/cli-helpers.js`
BREAKING CHANGE:
ESLint expects configs or plugins which require other configs or plugins to have _peer dependencies_ of those things _and_ of ESLint itself. All deps have been changed to peer deps, and this module now requires the installation of the following _if_ using npm older than v7:
```
"@babel/core": "7.16.0",
"@babel/eslint-parser": "7.16.3",
"eslint": "7.32.0",
"eslint-plugin-import": "2.25.3",
"eslint-plugin-mocha": "9.0.0",
"eslint-plugin-promise": "5.1.1"
```
npm@7 will install these automatically if they do not exist.
BREAKING CHANGE:
Package-root `.js` files (typically `index.js`) are now (typically) cjs wrappers. These files needn't be transpiled, and in fact, doing so will create an invalid module because it will attempt to reference `build/whatever` but the resulting artifact would live in `build/index.js`. `build/index.js` will no longer exist.
This should (hopefully) fix the Lerna issues we've been encountering. With this change, the root monorepo lists all packages as dependencies and uses relative `file:` URLs to do so. This means `lerna bootstrap` is no longer necessary.
In addition, defaults to `--save-exact` in `npm install` and `lerna add`. Also installs peer dependencies of `@appium/eslint-config-appium`.