Commit Graph

5 Commits

Author SHA1 Message Date
Christopher Hiller f4c0b5b9b4 chore(appium,base-plugin,types): plugin name is derived from manifest
This PR changes the shape of plugin classes as well as how CLI args get assigned.

- The `pluginName` static property has been removed.  `name` is now assigned via the `BasePlugin` constructor, and is derived from the plugin name in the manifest.  This means that an implementor only needs to provide a `pluginName` in the manifest, and the data is not duplicated.  The value in this map (the plugin name) is used to instantiate the plugin, instead of passing static `pluginName` property into the constructor.
- CLI args are now passed in through the constructor instead of assigned to the plugin instance after the fact.

Implementation details:

`getActivePlugins()` and `getActiveDrivers()` now return a `Map` of an extension _class_ to an extension name.  The key is _not_ an instance, and is effectively a singleton, so we are not at risk of a memory leak.

This change does not otherwise affect drivers.
2022-05-20 14:08:52 -07:00
Christopher Hiller 2289b45272 fix(types,base-plugin): fix static prop types for plugins
This change modifies the type of `BasePlugin.newMethodMap`, adds a
parameter to the `MethodMap` type, and updates the base plugin TS
config for better incremental builds.
2022-05-12 14:06:55 -07:00
Christopher Hiller 5e96a6d2a7 feat(base-plugin): prepare for use by plugins
This adds the requisite TS setup for base-plugin
2022-05-12 12:32:57 -07:00
Christopher Hiller 133db5355f chore: reformat everything
this reformats all `.js`, `.ts`, and `.d.ts` files.
2022-05-09 19:09:50 -07:00
Christopher Hiller 5b54017054 chore: relocated plugins
- left some necessary config in packages/plugins-temp which will get removed after full integration

# Conflicts:
#	packages/appium-plugins/.github/workflows/main.yml
#	packages/appium-plugins/packages/base/package-lock.json
#	packages/appium-plugins/packages/base/package.json
#	packages/appium-plugins/packages/fake/package-lock.json
#	packages/appium-plugins/packages/images/package-lock.json
#	packages/appium-plugins/packages/images/package.json
#	packages/appium-plugins/packages/relaxed-caps/package-lock.json
#	packages/appium-plugins/packages/relaxed-caps/package.json
#	packages/appium-plugins/packages/universal-xml/package-lock.json
#	packages/fake-plugin/lib/logger.js
#	packages/fake-plugin/lib/scripts/fake-error.js
#	packages/fake-plugin/lib/scripts/fake-success.js
#	packages/fake-plugin/package.json
#	packages/universal-xml-plugin/package.json
2022-04-14 14:30:00 -07:00