mirror of
https://github.com/appium/appium.git
synced 2026-10-23 00:59:18 +08:00
48f1d99087
The peer dependency value is stored in the `extensions.yaml` manifest for each extension as `appiumVersion` (if present). If the peer dependency is _not_ present, the user will be warned, but Appium will still try to load the extension (I have a feeling that most of the time, this will be fine). When warned, the user will receive information about available extension upgrades, if any. This required some refactors in the `lib/extension/` dir. Extension validation was previously a synchronous process, but because we now (potentially) display information to the user about upgrades (which is async), validation must also be async. This means that the `ExtensionConfig` constructor (and the constructors of its subclasses) cannot run validation. Validation must happen after the config object is instantiated, which is handled in `loadExtensions()` of `lib/extension/index.js`. The constructor signatures have changed accordingly. While extensions now soft-require a `peerDependencies.appium` field, in the monorepo, the value of this dependency is `file:../appium`. This is treated as a special case, and acts as if the dependency is just the current version of `appium` (as in its `package.json`). This is handled in `Manifest#addExtension()`. To further support this, `appium` now exports `@appium/base-driver` as `driver`, `@appium/base-plugin` as `plugin`, and `@appium/support` as `support`. `tsconfig.json` files have changed in these affected packages. In addition, a new reusable TS config file has been added for use with basic plugins. # Conflicts: # .eslintrc # packages/appium/lib/extension/extension-config.js # packages/appium/lib/extension/index.js # packages/appium/lib/extension/manifest.js # packages/appium/test/unit/extension/manifest.spec.js # packages/appium/test/unit/extension/mocks.js
54 lines
1.5 KiB
Plaintext
54 lines
1.5 KiB
Plaintext
{
|
|
"extends": "@appium/eslint-config-appium",
|
|
"overrides": [
|
|
{
|
|
"files": "packages/fake-driver/**/*",
|
|
"rules": {"require-await": "off"}
|
|
},
|
|
{"files": "packages/support/**/*", "globals": {"BigInt": "readonly"}},
|
|
{
|
|
"files": "packages/*/test/**/*",
|
|
"rules": {"func-names": "off"}
|
|
},
|
|
{
|
|
"files": ["packages/*/index.js", "packages/*/scripts/**/*.js", "test/*.js"],
|
|
"parserOptions": {
|
|
"sourceType": "script"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"packages/appium/support.js",
|
|
"packages/appium/driver.js",
|
|
"packages/appium/plugin.js"
|
|
],
|
|
"parserOptions": {
|
|
"sourceType": "script"
|
|
}
|
|
},
|
|
{
|
|
"files": "./packages/*/test/**/*.js",
|
|
"rules": {
|
|
"no-restricted-properties": [
|
|
"error",
|
|
{
|
|
"object": "sinon",
|
|
"property": "spy",
|
|
"message": "Use `sandbox = sinon.createSandbox()` and `sandbox.spy()` instead. Don't forget to call `sandbox.restore()` in `afterEach`"
|
|
},
|
|
{
|
|
"object": "sinon",
|
|
"property": "stub",
|
|
"message": "Use `sandbox = sinon.createSandbox()` and `sandbox.stub()` instead. Don't forget to call `sandbox.restore()` in `afterEach`"
|
|
},
|
|
{
|
|
"object": "sinon",
|
|
"property": "mock",
|
|
"message": "Use `sandbox = sinon.createSandbox()` and `sandbox.mock()` instead. Don't forget to call `sandbox.restore()` in `afterEach`"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|