@appium/support 7.0.5 → 7.0.6

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 (114) hide show
  1. package/LICENSE +201 -0
  2. package/build/lib/console.d.ts +42 -88
  3. package/build/lib/console.d.ts.map +1 -1
  4. package/build/lib/console.js +20 -80
  5. package/build/lib/console.js.map +1 -1
  6. package/build/lib/doctor.d.ts +6 -18
  7. package/build/lib/doctor.d.ts.map +1 -1
  8. package/build/lib/doctor.js +0 -15
  9. package/build/lib/doctor.js.map +1 -1
  10. package/build/lib/env.d.ts +14 -20
  11. package/build/lib/env.d.ts.map +1 -1
  12. package/build/lib/env.js +13 -50
  13. package/build/lib/env.js.map +1 -1
  14. package/build/lib/fs.d.ts +109 -148
  15. package/build/lib/fs.d.ts.map +1 -1
  16. package/build/lib/fs.js +88 -188
  17. package/build/lib/fs.js.map +1 -1
  18. package/build/lib/image-util.d.ts +7 -6
  19. package/build/lib/image-util.d.ts.map +1 -1
  20. package/build/lib/image-util.js +9 -6
  21. package/build/lib/image-util.js.map +1 -1
  22. package/build/lib/index.d.ts +19 -17
  23. package/build/lib/index.d.ts.map +1 -1
  24. package/build/lib/logger.d.ts +1 -1
  25. package/build/lib/logger.d.ts.map +1 -1
  26. package/build/lib/logger.js +1 -1
  27. package/build/lib/logger.js.map +1 -1
  28. package/build/lib/logging.d.ts +7 -15
  29. package/build/lib/logging.d.ts.map +1 -1
  30. package/build/lib/logging.js +36 -62
  31. package/build/lib/logging.js.map +1 -1
  32. package/build/lib/mjpeg.d.ts +19 -56
  33. package/build/lib/mjpeg.d.ts.map +1 -1
  34. package/build/lib/mjpeg.js +53 -76
  35. package/build/lib/mjpeg.js.map +1 -1
  36. package/build/lib/mkdirp.d.ts +4 -1
  37. package/build/lib/mkdirp.d.ts.map +1 -1
  38. package/build/lib/mkdirp.js +1 -2
  39. package/build/lib/mkdirp.js.map +1 -1
  40. package/build/lib/net.d.ts +52 -90
  41. package/build/lib/net.d.ts.map +1 -1
  42. package/build/lib/net.js +104 -193
  43. package/build/lib/net.js.map +1 -1
  44. package/build/lib/node.d.ts +16 -17
  45. package/build/lib/node.d.ts.map +1 -1
  46. package/build/lib/node.js +106 -111
  47. package/build/lib/node.js.map +1 -1
  48. package/build/lib/npm.d.ts +65 -86
  49. package/build/lib/npm.d.ts.map +1 -1
  50. package/build/lib/npm.js +59 -117
  51. package/build/lib/npm.js.map +1 -1
  52. package/build/lib/plist.d.ts +36 -29
  53. package/build/lib/plist.d.ts.map +1 -1
  54. package/build/lib/plist.js +62 -59
  55. package/build/lib/plist.js.map +1 -1
  56. package/build/lib/process.d.ts +19 -2
  57. package/build/lib/process.d.ts.map +1 -1
  58. package/build/lib/process.js +24 -7
  59. package/build/lib/process.js.map +1 -1
  60. package/build/lib/system.d.ts +41 -6
  61. package/build/lib/system.d.ts.map +1 -1
  62. package/build/lib/system.js +46 -11
  63. package/build/lib/system.js.map +1 -1
  64. package/build/lib/tempdir.d.ts +26 -49
  65. package/build/lib/tempdir.d.ts.map +1 -1
  66. package/build/lib/tempdir.js +41 -73
  67. package/build/lib/tempdir.js.map +1 -1
  68. package/build/lib/timing.d.ts +28 -22
  69. package/build/lib/timing.d.ts.map +1 -1
  70. package/build/lib/timing.js +16 -17
  71. package/build/lib/timing.js.map +1 -1
  72. package/build/lib/util.d.ts +164 -181
  73. package/build/lib/util.d.ts.map +1 -1
  74. package/build/lib/util.js +193 -247
  75. package/build/lib/util.js.map +1 -1
  76. package/build/lib/zip.d.ts +81 -139
  77. package/build/lib/zip.d.ts.map +1 -1
  78. package/build/lib/zip.js +210 -258
  79. package/build/lib/zip.js.map +1 -1
  80. package/lib/console.ts +139 -0
  81. package/lib/{doctor.js → doctor.ts} +6 -20
  82. package/lib/{env.js → env.ts} +31 -59
  83. package/lib/fs.ts +453 -0
  84. package/lib/image-util.ts +40 -0
  85. package/lib/index.ts +1 -0
  86. package/lib/{logger.js → logger.ts} +1 -1
  87. package/lib/logging.ts +157 -0
  88. package/lib/mjpeg.ts +186 -0
  89. package/lib/{mkdirp.js → mkdirp.ts} +2 -2
  90. package/lib/net.ts +305 -0
  91. package/lib/{node.js → node.ts} +134 -133
  92. package/lib/npm.ts +291 -0
  93. package/lib/plist.ts +187 -0
  94. package/lib/process.ts +62 -0
  95. package/lib/system.ts +95 -0
  96. package/lib/tempdir.ts +115 -0
  97. package/lib/{timing.js → timing.ts} +28 -33
  98. package/lib/util.ts +561 -0
  99. package/lib/{zip.js → zip.ts} +341 -296
  100. package/package.json +20 -22
  101. package/tsconfig.json +3 -5
  102. package/index.js +0 -1
  103. package/lib/console.js +0 -173
  104. package/lib/fs.js +0 -496
  105. package/lib/image-util.js +0 -32
  106. package/lib/logging.js +0 -145
  107. package/lib/mjpeg.js +0 -207
  108. package/lib/net.js +0 -336
  109. package/lib/npm.js +0 -310
  110. package/lib/plist.js +0 -182
  111. package/lib/process.js +0 -46
  112. package/lib/system.js +0 -48
  113. package/lib/tempdir.js +0 -131
  114. package/lib/util.js +0 -584
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appium/support",
3
- "version": "7.0.5",
3
+ "version": "7.0.6",
4
4
  "description": "Support libs used across Appium packages",
5
5
  "keywords": [
6
6
  "automation",
@@ -23,58 +23,56 @@
23
23
  },
24
24
  "license": "Apache-2.0",
25
25
  "author": "https://github.com/appium",
26
+ "main": "./build/lib/index.js",
26
27
  "types": "./build/lib/index.d.ts",
27
28
  "directories": {
28
29
  "lib": "lib"
29
30
  },
30
31
  "files": [
31
- "index.js",
32
32
  "lib",
33
- "build",
34
- "tsconfig.json",
35
- "!build/tsconfig.tsbuildinfo",
36
- "!build/test"
33
+ "build/lib",
34
+ "tsconfig.json"
37
35
  ],
38
36
  "scripts": {
39
37
  "test": "npm run test:unit",
40
- "test:e2e": "mocha --exit --timeout 20s --slow 10s \"./test/e2e/**/*.spec.js\"",
41
- "test:smoke": "node ./index.js",
42
- "test:unit": "mocha \"./test/unit/**/*.spec.js\""
38
+ "test:e2e": "mocha --exit --timeout 20s --slow 10s \"./test/e2e/**/*.spec.ts\"",
39
+ "test:smoke": "node ./build/lib/index.js",
40
+ "test:unit": "mocha \"./test/unit/**/*.spec.ts\""
43
41
  },
44
42
  "dependencies": {
45
- "@appium/logger": "^2.0.4",
46
- "@appium/tsconfig": "^1.1.1",
47
- "@appium/types": "^1.2.0",
43
+ "@appium/logger": "^2.0.5",
44
+ "@appium/tsconfig": "^1.1.2",
45
+ "@appium/types": "^1.2.1",
48
46
  "@colors/colors": "1.6.0",
49
47
  "archiver": "7.0.1",
50
- "axios": "1.13.3",
48
+ "asyncbox": "6.1.0",
49
+ "axios": "1.13.6",
51
50
  "base64-stream": "1.0.0",
52
51
  "bluebird": "3.7.2",
53
52
  "bplist-creator": "0.1.1",
54
53
  "bplist-parser": "0.3.2",
55
54
  "form-data": "4.0.5",
56
55
  "get-stream": "9.0.1",
57
- "glob": "13.0.0",
56
+ "glob": "13.0.6",
58
57
  "jsftp": "2.1.3",
59
58
  "klaw": "4.1.0",
60
59
  "lockfile": "1.0.4",
61
60
  "lodash": "4.17.23",
62
61
  "log-symbols": "7.0.1",
63
- "moment": "2.30.1",
64
62
  "ncp": "2.0.0",
65
- "package-directory": "8.1.0",
63
+ "package-directory": "8.2.0",
66
64
  "plist": "3.1.0",
67
65
  "pluralize": "8.0.0",
68
- "read-pkg": "10.0.0",
66
+ "read-pkg": "10.1.0",
69
67
  "resolve-from": "5.0.0",
70
68
  "sanitize-filename": "1.6.3",
71
- "semver": "7.7.3",
69
+ "semver": "7.7.4",
72
70
  "shell-quote": "1.8.3",
73
71
  "supports-color": "10.2.2",
74
- "teen_process": "4.0.8",
75
- "type-fest": "5.4.1",
72
+ "teen_process": "4.0.10",
73
+ "type-fest": "5.4.4",
76
74
  "uuid": "13.0.0",
77
- "which": "6.0.0",
75
+ "which": "6.0.1",
78
76
  "yauzl": "3.2.0"
79
77
  },
80
78
  "optionalDependencies": {
@@ -87,5 +85,5 @@
87
85
  "publishConfig": {
88
86
  "access": "public"
89
87
  },
90
- "gitHead": "f7b20335eab4022e5cbbb627ec86866a994444f8"
88
+ "gitHead": "980a121804ae006db879fb6860f627ac36174c15"
91
89
  }
package/tsconfig.json CHANGED
@@ -2,11 +2,9 @@
2
2
  "extends": "@appium/tsconfig/tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "outDir": "build",
5
- "paths": {
6
- "@appium/types": ["../types"]
7
- },
8
- "checkJs": true
5
+ "paths": {"@appium/types": ["../types"]},
6
+ "types": ["mocha", "chai", "chai-as-promised", "node"]
9
7
  },
10
- "include": ["lib"],
8
+ "include": ["lib", "test"],
11
9
  "references": [{"path": "../types"}]
12
10
  }
package/index.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('./build/lib');
package/lib/console.js DELETED
@@ -1,173 +0,0 @@
1
- import _ from 'lodash';
2
- import {createSupportsColor} from 'supports-color';
3
- import {Console as NodeConsole} from 'node:console';
4
- import '@colors/colors';
5
- import symbols from 'log-symbols';
6
- import {Writable} from 'node:stream';
7
-
8
- /**
9
- * Stream to nowhere. Used when we want to disable any output other than JSON output.
10
- */
11
- class NullWritable extends Writable {
12
- // eslint-disable-next-line promise/prefer-await-to-callbacks
13
- _write(chunk, encoding, callback) {
14
- setImmediate(callback);
15
- }
16
- }
17
-
18
- /**
19
- * A particular console/logging class for Appium's CLI.
20
- *
21
- * - By default, uses some fancy symbols
22
- * - Writes to `STDERR`, generally.
23
- * - In "JSON mode", `STDERR` is squelched. Use {@linkcode Console.json} to write the JSON.
24
- *
25
- * DO NOT extend this to do anything other than what it already does. Download a library or something.
26
- */
27
- export class CliConsole {
28
- /**
29
- * Internal console
30
- * @type {globalThis.Console}
31
- */
32
- #console;
33
-
34
- /**
35
- * Whether or not to use fancy symbols when logging.
36
- * @type {boolean}
37
- *
38
- */
39
- #useSymbols;
40
-
41
- /**
42
- * Whether or not to use color.
43
- */
44
- #useColor;
45
-
46
- /**
47
- * @type {Record<keyof typeof symbols,keyof Extract<import('@colors/colors').Color, 'string'>>}
48
- */
49
- static symbolToColor = {
50
- success: 'green',
51
- info: 'cyan',
52
- warning: 'yellow',
53
- error: 'red',
54
- };
55
-
56
- /**
57
- *
58
- * @param {ConsoleOpts} opts
59
- */
60
- constructor({jsonMode = false, useSymbols = true, useColor} = {}) {
61
- this.#console = new NodeConsole(process.stdout, jsonMode ? new NullWritable() : process.stderr);
62
- this.#useSymbols = Boolean(useSymbols);
63
- this.#useColor = Boolean(useColor ?? createSupportsColor(process.stderr));
64
- }
65
-
66
- /**
67
- * Wraps a message string in breathtaking fanciness
68
- *
69
- * Returns `undefined` if `msg` is `undefined`.
70
- * @param {string} [msg] - Message to decorate, if anything
71
- * @param {keyof typeof CliConsole['symbolToColor']} [symbol] - Symbol to use
72
- * @returns {string|undefined}
73
- */
74
- decorate(msg, symbol) {
75
- if (_.isString(msg)) {
76
- let newMsg = /** @type {string} */ (msg);
77
- if (_.isString(symbol) && this.#useSymbols) {
78
- newMsg = `${symbols[symbol]} ${newMsg}`;
79
- if (this.#useColor) {
80
- newMsg = newMsg[CliConsole.symbolToColor[symbol]];
81
- }
82
- }
83
- return newMsg;
84
- }
85
- return msg;
86
- }
87
-
88
- /**
89
- * Writes to `STDOUT`. Must be stringifyable.
90
- *
91
- * You probably don't want to call this more than once before exiting (since that will output invalid JSON).
92
- * @param {import('type-fest').JsonValue} value
93
- */
94
- json(value) {
95
- this.#console.log(JSON.stringify(value));
96
- }
97
-
98
- /**
99
- * General logging function.
100
- * @param {string} [message]
101
- * @param {...any} args
102
- */
103
- log(message, ...args) {
104
- this.#console.error(message, ...args);
105
- }
106
-
107
- /**
108
- * A "success" message
109
- * @param {string} [message]
110
- * @param {...any} args
111
- */
112
- ok(message, ...args) {
113
- this.#console.error(this.decorate(message, 'success'), ...args);
114
- }
115
-
116
- /**
117
- * Alias for {@linkcode Console.log}
118
- * @param {string} [message]
119
- * @param {...any} args
120
- */
121
- debug(message, ...args) {
122
- this.log(message, ...args);
123
- }
124
-
125
- /**
126
- * Wraps {@link console.dir}
127
- * @param {any} item
128
- * @param {import('util').InspectOptions} [opts]
129
- */
130
- dump(item, opts) {
131
- this.#console.dir(item, opts);
132
- }
133
-
134
- /**
135
- * An "info" message
136
- * @param {string} [message]
137
- * @param {...any} args
138
- */
139
- info(message, ...args) {
140
- this.log(this.decorate(message, 'info'), ...args);
141
- }
142
-
143
- /**
144
- * A "warning" message
145
- * @param {string} [message]
146
- * @param {...any} args
147
- */
148
- warn(message, ...args) {
149
- this.log(this.decorate(message, 'warning'), ...args);
150
- }
151
-
152
- /**
153
- * An "error" message
154
- * @param {string} [message]
155
- * @param {...any} args
156
- */
157
- error(message, ...args) {
158
- this.log(this.decorate(message, 'error'), ...args);
159
- }
160
- }
161
-
162
- /**
163
- * Options for {@linkcode CliConsole}.
164
- *
165
- * @typedef ConsoleOpts
166
- * @property {boolean} [jsonMode] - If _truthy_, suppress all output except JSON (use {@linkcode CliConsole#json}), which writes to `STDOUT`.
167
- * @property {boolean} [useSymbols] - If _falsy_, do not use fancy symbols.
168
- * @property {boolean} [useColor] - If _falsy_, do not use color output. If _truthy_, forces color output. By default, checks terminal/TTY for support via pkg `supports-color`. Ignored if `useSymbols` is `false`.
169
- * @see https://npm.im/supports-color
170
- */
171
-
172
- export const console = new CliConsole();
173
- export {symbols};