Commit Graph

17 Commits

Author SHA1 Message Date
Jonathan Lipps
71641f1761 chore: configure monorepo for appium3 (#20790)
* chore(appium): configure lerna/appium to publish appium 3 beta

* chore(appium)!: bump required node engine to latest
2024-12-16 12:37:23 -08:00
Jonathan Lipps
e6da6b8dbc chore: remove erroneous extra level in lerna config 2023-10-18 13:24:10 -07:00
renovate[bot]
641da6ddd5 chore(deps): update dependency lerna to v7 (#19019)
* chore(deps): update dependency lerna to v7

* update lerna config

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Mykola Mokhnach <mokhnach@gmail.com>
2023-08-25 18:33:44 +02:00
Christopher Hiller
e35bc50454 chore: use conventionalcommit changelog
This changes the changelog preset from "angular" to "conventional-changelog-conventionalcommits" which should be more appropriate for our workflow.
2023-04-11 16:55:04 -07:00
Christopher Hiller
00dbd28190 chore: add a "release" script
This script executes `lerna publish`.  The Lerna config has been changed so that the `publish` command uses a message of `chore: publish`.
2023-04-05 14:55:16 -07:00
Jonathan Lipps
14fc2d2b24 chore: don't use nx with lerna because of nx cache issues or something 2022-12-13 15:49:17 -08:00
Christopher Hiller
3eba685e25 chore(deps): upgrade sync-monorepo-packages to v1.0.0
This also means we can remove `packages` from `lerna.json`
2022-12-01 16:38:18 -08:00
Christopher Hiller
3b1156eb22 chore(): fix lerna config for v6 2022-11-29 15:32:46 -08:00
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
26dc2ff6a4 chore(): remove lerna & script cruft 2022-10-31 16:02:20 -07:00
Christopher Hiller
868517b6f4 chore: remove gulp from appium package (#16459)
This change removes `gulp` and replaces it with plain ol' `babel` and `mocha`.

## `appium`

- No gulp.
- `test/` has been re-organized.  All test files now end in the extension `.spec.js`, which is a recognized convention and understood by editors/IDEs.  The tests are further split into `unit` and `e2e` subdirs.  This makes working with both `babel` and `mocha` easier.
- The tests are _not_ run against the transpiled code; code is now transpiled on-the-fly via `@babel/register`. This only affects `appium`.
- `commands-yml/validator.js` moved to `scripts/parse-yml-commands.js`. It has been rewritten as a CJS module.  `commands-yml/` should not contain `.js` files.
- `test/setup.js` is a new test harness specific to Appium, which loads & configures `@babel/register`.  Eventually, the contents of this file can be moved into the root monorepo's `test/setup.js`, but the rest of the packages do not need `@babel/register`, so we avoid the overhead.

## `@appium/gulp-plugins`

- Unfortunately, due to the new `npm test` strategy (see below), we cannot use the `nyan` reporter.  Or rather, we _can_, but will not see the animation.  So the reporter is now set to default to `spec`.
- Modified tests so they didn't overwrite the actual `build` dir with transpiled fixtures, which is what was happening. This was causing failures depending on the transpile/test order.

## All Packages

- All packages now have their own `build`, `test`, `test:e2e` and `dev` (just build + watch mode) npm scripts. This makes running a complete build easier, since each package can now provide its own appropriate command.  This is _mostly_ just `gulp once` (where `gulp` was used before), except for `appium`, where `@babel/cli` is used directly.
- This is what happens when `npm test` is run from the monorepo (in order):
    1. All packages are built (in parallel) by running `npm run build` in each folder (via `lerna`). See `pretest`
    2. All code is linted directly via `eslint`.
    3. All _unit tests_ are run w/ `npm test` in each folder, having assumed transpilation already occurred (if necessary).
- `npm run e2e-test` runs the `npm run test:e2e` in each folder. No transpilation occurs! Careful.
- All scripts are expected to live in `packages/*/scripts`, and this directory enforces CJS via ESLint.  `postinstall.js` moved, as well as `check-npm-pack-files.js`. `generate-schema-declarations.mjs` moved from the root `scripts/` dir into `packages/appium/scripts/`; it's now CJS instead of ESM.
- I had profiled running various things with `lerna run --parallel`, but it turns out this is not faster.  I'm not sure why, but I think it may have something to do with streaming STDOUT/STDERR, or potentially the overhead of running child processes outweighs the time it takes to actually run tests and builds.
- The behavior of `lerna run` now mimicks `lerna exec`, which was "run stuff in serial, streaming the output". The default behavior of `lerna run` is "run stuff in parallel, buffering the output".  Buffered output sucks, and streaming the output from all tasks at once creates chaos.  To override this behavior, you'll see `--parallel --concurrency=8 --prefix` for tasks that can truly be parallelized, like transpilation.  The number 8 is the "maximum", and CI usually won't have more than 2 cores available anyway.
- When run in CI, Mocha runs with `--forbid-only`, which will fail if there's an `.only()` somewhere in the tests. Further, it forces color output.

## Etc.

- Updated Wallaby config, `.gitignore`, `.eslintignore`.
- Sorted `package.json` files
- Removed `watch` and `coverage` scripts which were broken anyway.

chore(appium): fix schema json path issues

- the path to the JSON schema is now correct: `lib/appium-config-schema.json`
- add `log-symbols` to devdeps for niceness. this is already a transitive dep
2022-03-09 14:50:45 -08:00
Christopher Hiller
d201d64b49 fix: use relative package references
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`.
2021-11-18 12:08:50 -08:00
Jonathan Lipps
2fb08bbd7f chore: set lerna release type to github 2021-08-16 15:48:00 -07:00
Christopher Hiller
39b8fd5476 chore: update lerna config to automatically push tags & create a GH release 2021-08-13 12:40:17 -07:00
Christopher Hiller
4def2e926a chore: configure lerna for publishing
1. Uses `sync-monorepo-packages` to keep `README.md` and `packages/appium/README.md` in sync.  Since `README` gets published to npm but _also_ shows in the GitHub repo, both places need a `README`. In lieu of a custom `README`, we can just sync it for now.  This is called via a `preversion` script.
1. Various fields are synced in `package.json`.  This does not include dependencies—but those _in common_ should probably be kept in sync as well.
1. Lerna uses conventional commits and Git tags to figure out what to do.  It should automatically determine what needs releasing and what version it should be released as.
1. Tags have been pushed to the repo for Lerna to use.  In the case where the changesets are functionally identical to the latest code in the old repositories, the version number has been retained, and the tag is of the format `[@scope/]<package-name>@<version>`.  In the case where the old repos had _unreleased_ changesets, I’ve tagged with a new patch release and adopted the `-rc.0` suffix.  So if we were at v5.5.0 in `appium-gulp-plugins`, `@appium/gulp-plugins` is tagged as `@appium/gulp-plugins@5.5.1-rc.0`.  I have not modified the version in `package.json`.
 1. As with adopting any new release/publishing strategy, we should be meticulous about what we’re doing until we’re comfortable with how it works.  Lerna supports dry runs; we should use them.
1. Documentation on usage will arrive in next changes to this PR.
2021-05-24 15:16:15 -07:00
Christopher Hiller
127589fd4d chore: add @appium/eslint-config-appium to the monorepo
this pkg is unique in that it does not use `gulp`, so for now we tell lerna to always ignore it when running `lerna exec` across packages.  it has no tests, but it's marginally useful to lint the `index.js`, so we'll do that (see `lint` script in root `package.json`).

the canonical way to handle plugin deps in a sharable config is to use `peerDependencies`, so it now uses `peerDependencies` instead of `dependencies`.  these peer deps are installed by the dependencies of `@appium-gulp-plugins`.  see [docs](https://eslint.org/docs/developer-guide/shareable-configs#publishing-a-shareable-config)

our root `.eslintrc` depends upon `@appium/eslint-config-appium` (which is not an unusual situation).  to pull this off in a monorepo, a cheat is to `file:` schema in the dependency specifier of the root `package.json`.

also tweaked `lerna.json` to _always_ run `bootstrap` with the `--no-ci` flag.  lerna will attempt to use `npm ci` if `CI` env var is present, but for that to work, we must have `package-lock.json` under version control.
2021-05-17 14:17:44 -07:00
Christopher Hiller
a945cfcde0 chore: create appium monorepo; closes #14441
This PR supersedes PR #14562.

This is my first attempt at making this repo a monorepo and moving appium-proper into `packages/appium`.

I had tried to make this work with npm's "workspaces", but it seems lifecycle scripts don't run as you'd expect them to upon install.  Instead, I'm using Lerna, which provides more features for monorepos.

Changes include:

- The root `package.json` is now a package named `appium-monorepo`, which is `private`.  The monorepo should not be published.
- All dev dependencies remain in the root `package.json`.
- `gulpfile.js` _moved_ into `packages/appium/gulpfile.js`, but this should be **temporary**--`appium-gulp-plugins` makes certain assumptions which a monorepo violates, and I was unable to get it working without patching `appium-gulp-plugins`.
- Most of the `package.json` `scripts` moved into `packages/appium/package.json` due to the above.  This too should be considered **temporary**.
- Adds a root `postinstall` lifecycle script which calls `lerna bootstrap` to install/link packages.  I don't see a `package-lock.json` in `packages/appium/`; this needs investigating.
- Adds a root `test` lifecycle script which executes `npm run test` in all packages.  The tests do not pass, but I don't know if this is my fault.
- The `clean` script will purge all `node_modules` folders in each package, as well.
- I removed `scripts/release*.sh`, since it seems they would fail anyway--`lerna` should be used for releases instead
- The shrinkwrap-related stuff is untested.
- Renamed `tags` prop in `packages/appium/package.json` to `keywords`.  I don't know if `tags` is supported.
2021-05-17 14:17:39 -07:00