`@appium/schema` is a package which was extracted from `appium`. It _only_ contains the schema. The impetus here was to avoid cyclical dependencies, since `appium` depends on `@appium/types`, and `@appium/types` depends on the schema. This package breaks the cycle.
The `scripts/generate-schema-json.js` (which converts the compiled JS schema file into JSON) has moved into this package, and the generated JSON file is now under version control. This is because the `generate-schema-types.js` script (previously `generate-schema-declarations`) depends on it, and `@appium/types` depends on the generated types. The generated types are _also_ under version control. I do not expect the schema to change often, so I believe the tradeoff to be worth it.
## @appium/schema
`lib/appium-config-schema.js` is the "single source of truth" for the schema.
## appium
- Removed schema source
- Removed namespaces from internal types because they suck (see change to `types/index.d.ts`)
- Removed unused `continuation-local-storage`
- Add dep for `@appium/schema`
- Added a TS project dependency on `@appium/schema`
## @appium/types
- The "sources" have moved from `src` to `lib` for consistency.
- `lib/appium-config.ts` (the generated types) are now under version control.
- `lib/schema/` has been removed (it previously held the JSON schema artifact)
- `scripts/generate-schema-declarations.js` becomes `scripts/generate-schema-types.js`
- Updated scripts in `package.json`
- Added dep for `@appium/schema`
- Added a TS project dependency on `@appium/schema`
## Other
- Reorganize root `tsconfig.json`; add `schema` reference; remove unused `noEmit: true`
- Sort root `package.json`
- Remove schema JSON and schema declarations scripts, since those are now both handled in their respective packages
- Remove `lint-staged` config for schema file, since it didn't work right anyway (still need to do something about this, but probably doesn't need to be in a precommit hook)
- Remove stuff from `.gitignore`
Closes#16674
the problem here was the existence of the empty `package.json`. it should exist, because if it doesn't, then `npm` may end up using a `package.json` in a parent directory. but it can't be _empty_, because subsequent `npm install`s will essentially remove any package that it's currently not installing! `npm` likes to "fix" `node_modules`, which is undesirable here.
to avoid this, the behavior has changed to persisting the dependency version to `package.json`. behavior differs if we're using a local `APPIUM_HOME` or the default one. with the default, we have more control, and choose to use `--save-dev --save-exact --no-package-lock --global-style` which gives us what we need. if `APPIUM_HOME` is a local package, all we can do is `--save-dev` (since it's _likely_ that an extension will be a dev dependency). in the future, we may choose to actually determine _what kind_ of dependency `appium` is and tell `npm` to use the same one. not sure if that's needed, though.
further, in the case of a local appium dep (local `APPIUM_HOME`), updating `package.json` should cause the package hash (used by the thing that syncs `extensions.yaml` with installed packages) to update as well, so we're doing that.
modified the logic in `ExtensionCommand` to treat `--source=local` to pass the `installSpec` thru verbatim.
also fixed `BuildInfo` type to reflect reality and use `@types/teen_process`. fixed some other broken types in `test` (files in `test` are not checked by typescript yet; we'll need a separate `tsconfig.json` for this, since we do not want to emit declarations)
'npm link' is weird and we do not need to use it. `npm install /path/to/some/module` will create a symbolic link, but it _won't_ create a global link. it otherwise behaves similarly to `npm install`.
- also updated to use `@types/teen_process`
- fixed some weird types in `util.getLockFileGuard()`
This will be run before publish, and will copy the root `LICENSE` file to all packages, so that they appear in the published tarballs.
`packages/*/LICENSE` are ignored by Git, since they are redundant with the root `LICENSE` file.