appium 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +7 -13
  2. package/build/lib/appium.js +62 -12
  3. package/build/lib/appium.js.map +1 -1
  4. package/build/lib/cli/driver-command.d.ts +2 -0
  5. package/build/lib/cli/driver-command.d.ts.map +1 -1
  6. package/build/lib/cli/driver-command.js +2 -0
  7. package/build/lib/cli/driver-command.js.map +1 -1
  8. package/build/lib/cli/extension-command.d.ts +0 -4
  9. package/build/lib/cli/extension-command.d.ts.map +1 -1
  10. package/build/lib/cli/extension-command.js +22 -8
  11. package/build/lib/cli/extension-command.js.map +1 -1
  12. package/build/lib/cli/plugin-command.d.ts +2 -0
  13. package/build/lib/cli/plugin-command.d.ts.map +1 -1
  14. package/build/lib/cli/plugin-command.js +2 -0
  15. package/build/lib/cli/plugin-command.js.map +1 -1
  16. package/build/lib/cli/utils.d.ts +15 -0
  17. package/build/lib/cli/utils.d.ts.map +1 -1
  18. package/build/lib/cli/utils.js +15 -0
  19. package/build/lib/cli/utils.js.map +1 -1
  20. package/build/lib/extension/driver-config.js +16 -11
  21. package/build/lib/extension/driver-config.js.map +1 -1
  22. package/build/lib/extension/extension-config.js +23 -20
  23. package/build/lib/extension/extension-config.js.map +1 -1
  24. package/build/lib/extension/manifest.js +106 -120
  25. package/build/lib/extension/manifest.js.map +1 -1
  26. package/build/lib/extension/plugin-config.js +11 -11
  27. package/build/lib/extension/plugin-config.js.map +1 -1
  28. package/build/lib/schema/arg-spec.js +47 -0
  29. package/build/lib/schema/arg-spec.js.map +1 -1
  30. package/build/lib/schema/schema.js +92 -93
  31. package/build/lib/schema/schema.js.map +1 -1
  32. package/lib/cli/driver-command.js +2 -0
  33. package/lib/cli/extension-command.js +7 -8
  34. package/lib/cli/plugin-command.js +2 -0
  35. package/lib/cli/utils.js +17 -0
  36. package/package.json +10 -10
@@ -927,33 +927,33 @@ class ExtensionCliCommand {
927
927
  this.log.ok(`${scriptName} successfully ran`.green);
928
928
  return {output: output.getBuff()};
929
929
  } catch (err) {
930
- this.log.error(`Encountered an error when running '${scriptName}': ${err.message}`.red);
931
- return {error: err.message, output: output.getBuff()};
930
+ const message = `Encountered an error when running '${scriptName}': ${err.message}`;
931
+ throw this._createFatalError(message);
932
932
  }
933
933
  }
934
934
 
935
935
  try {
936
936
  await new B((resolve, reject) => {
937
937
  this._runUnbuffered(moduleRoot, scriptPath, extraArgs)
938
- .on('error', (err) => {
938
+ .once('error', (err) => {
939
939
  // generally this is of the "I can't find the script" variety.
940
940
  // this is a developer bug: the extension is pointing to a script that is not where the
941
941
  // developer said it would be (in `appium.scripts` of the extension's `package.json`)
942
942
  reject(err);
943
943
  })
944
- .on('close', (code) => {
944
+ .once('close', (code) => {
945
945
  if (code === 0) {
946
946
  resolve();
947
947
  } else {
948
- reject(new Error(`Script "${scriptName}" exited with code ${code}`));
948
+ reject(new Error(`Script exited with code ${code}`));
949
949
  }
950
950
  });
951
951
  });
952
952
  this.log.ok(`${scriptName} successfully ran`.green);
953
953
  return {};
954
954
  } catch (err) {
955
- this.log.error(`Encountered an error when running '${scriptName}': ${err.message}`.red);
956
- return {error: err.message};
955
+ const message = `Encountered an error when running '${scriptName}': ${err.message}`;
956
+ throw this._createFatalError(message);
957
957
  }
958
958
  }
959
959
  }
@@ -1079,7 +1079,6 @@ export {ExtensionCliCommand as ExtensionCommand};
1079
1079
  * Return value of {@linkcode ExtensionCliCommand._run}
1080
1080
  *
1081
1081
  * @typedef RunOutput
1082
- * @property {string} [error] - error message if script ran unsuccessfully, otherwise undefined
1083
1082
  * @property {string[]} [output] - script output if `bufferOutput` was `true` in {@linkcode RunOptions}
1084
1083
  */
1085
1084
 
@@ -52,9 +52,11 @@ export default class PluginCliCommand extends ExtensionCliCommand {
52
52
  }
53
53
 
54
54
  /**
55
+ * Run a script from a plugin
55
56
  *
56
57
  * @param {PluginRunOptions} opts
57
58
  * @returns {Promise<import('./extension-command').RunOutput>}
59
+ * @throws {Error} if the script fails to run
58
60
  */
59
61
  async run({plugin, scriptName, extraArgs}) {
60
62
  return await super._run({
package/lib/cli/utils.js CHANGED
@@ -59,12 +59,29 @@ export class RingBuffer {
59
59
  this.size = size;
60
60
  this.buffer = [];
61
61
  }
62
+
63
+ /**
64
+ * Get the current buffer contents
65
+ *
66
+ * @returns {any[]}
67
+ */
62
68
  getBuff() {
63
69
  return this.buffer;
64
70
  }
71
+
72
+ /**
73
+ * Remove the oldest item from the buffer
74
+ *
75
+ * @returns {void}
76
+ */
65
77
  dequeue() {
66
78
  this.buffer.shift();
67
79
  }
80
+ /**
81
+ * Add an item to the buffer
82
+ *
83
+ * @param {any} item
84
+ */
68
85
  enqueue(item) {
69
86
  if (this.buffer.length >= this.size) {
70
87
  this.dequeue();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Automation for Apps.",
5
5
  "keywords": [
6
6
  "automation",
@@ -60,13 +60,13 @@
60
60
  "test:unit": "mocha \"./test/unit/**/*.spec.js\""
61
61
  },
62
62
  "dependencies": {
63
- "@appium/base-driver": "^10.0.0",
64
- "@appium/base-plugin": "^3.0.0",
65
- "@appium/docutils": "^2.0.0",
66
- "@appium/logger": "^2.0.0",
63
+ "@appium/base-driver": "^10.0.1",
64
+ "@appium/base-plugin": "^3.0.2",
65
+ "@appium/docutils": "^2.1.0",
66
+ "@appium/logger": "^2.0.1",
67
67
  "@appium/schema": "^1.0.0",
68
- "@appium/support": "^7.0.0",
69
- "@appium/types": "^1.0.0",
68
+ "@appium/support": "^7.0.1",
69
+ "@appium/types": "^1.0.1",
70
70
  "@sidvind/better-ajv-errors": "4.0.0",
71
71
  "ajv": "8.17.1",
72
72
  "ajv-formats": "3.0.1",
@@ -77,13 +77,13 @@
77
77
  "bluebird": "3.7.2",
78
78
  "lilconfig": "3.1.3",
79
79
  "lodash": "4.17.21",
80
- "lru-cache": "11.1.0",
80
+ "lru-cache": "11.2.1",
81
81
  "ora": "5.4.1",
82
82
  "package-changed": "3.0.0",
83
83
  "resolve-from": "5.0.0",
84
84
  "semver": "7.7.2",
85
85
  "source-map-support": "0.5.21",
86
- "teen_process": "3.0.0",
86
+ "teen_process": "3.0.1",
87
87
  "type-fest": "4.41.0",
88
88
  "winston": "3.17.0",
89
89
  "wrap-ansi": "7.0.0",
@@ -97,5 +97,5 @@
97
97
  "publishConfig": {
98
98
  "access": "public"
99
99
  },
100
- "gitHead": "284da50353921343fa5a7f82574e64ce0c146db7"
100
+ "gitHead": "606e4c1f58fa68d96c04be4313ccab86ccd48361"
101
101
  }