This change makes Lerna execute E2E tests across two cores. Some of the slower E2E suites (`appium`, `support`, `opencv` and `base-driver`) also run in parallel via Mocha's `--parallel` flag.
In Appium, the main culprit was `cli.e2e.spec.js`, which I split into four files: `args` (argument handling), `cli-driver` (`driver` command), `cli-plugin` (`plugin` command) and `local` (behavior when Appium is a dependency). This should run faster (in theory) since Mocha runs tests in parallel _per file_ and will expand to the available cores.
CI has limited cores, so this won't really help there--but it will speed up local development. When running tests locally, you may see various delays, as Mocha buffers the output of a single test file.
This is a continuation of the work I did in #17252.
Fixes dependency on `@appium/fake-plugin` in the monorepo root, which was resulting in `npm` emitting some errors during various operations (e.g., `npm list`). This is not needed b/c this module is in the list of workspaces.
This pulls in some recommended settings from `@tsconfig/node14` (a proper TS target configuration for Node.js v14; ours wasn't _wrong_ per se, but this is better) and allows us more flexible use of `ts-node`. Use of this module is recommended by `ts-node` (which we need to run tests).
`ts-node`'s behavior changes _depending on the directory in which it's run_--and this can cause some really nonsensical bugs--so the changes here ensure that it will act the same regardless of if you're running tests from a package directory or the monorepo root.
Also:
- Ensure various `clean` scripts don't fail if they've been run before `build`
- Enable `strict` mode in `@appium/types` cause we can
- Fix a type issue found in `@appium/support`; this does not appear to have been a traditional bug but rather a type disagreement surfaced by the new config
# Conflicts:
# package-lock.json
# packages/typedoc-plugin-appium/tsconfig.json
- `@appium/gulp-plugins` does not use `tsc` and continues to use...whatever it uses.
- `@appium/doctor` now has generated declarations, though I didn't bother to do anything with the types
- rewrote swaths of build scripts:
- removed the `fix` and `lint` scripts from each workspace (package) since I don't think they get used and they are of limited value
- for tests and autoinstallation of extensions, added `ts-node` for on-the-fly compilation
- workspaces _can_ define their own `build` and `clean` scripts (both should be required if either is used). these do not currently get run when running `npm run dev`, but they do occur on a bare `npm install` from the monorepo root or a `npm run reinstall`.
- `npm run rebuild` does a fresh rebuild, but does not clean any `node_modules` dirs nor does it reinstall anything.
- removed `prepublishOnly` since `preversion` does the same thing
- `npm test` now runs `build`/`lint` in parallel
- postinstall script of `appium` ("autoinstall") script now must call `npm run build` if in a fresh dev environment. this is because a) lifecycle scripts of packages run before lifecycle scripts in the monorepo root, and b) `postinstall` runs before `prepare`. so there's really no way around it; even using `ts-node` fails because other modules depend on `@appium/support/index.js` which expects the pkg to be built.
Closes#17746Closes#17807
This adds [commitlint](https://npm.im/@commitlint/cli) to the project which validates commit messages against the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec via a preset.
Removed the [pre-commit](https://npm.im/pre-commit) package as it has not been updated in six (6) years; replaced with [husky](https://typicode.github.io/husky/) which is widely-used and full-featured.
Customized commitlint so that it will allow commit messages lines of arbitrary length; this is set to 100 by default, but is not in the specification. If someone has a good reason that we _shouldn't_ disable that rule, please say something!
Closes#17844
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.