@appium/support 7.0.4 → 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.
- package/build/lib/console.d.ts +42 -88
- package/build/lib/console.d.ts.map +1 -1
- package/build/lib/console.js +25 -85
- package/build/lib/console.js.map +1 -1
- package/build/lib/doctor.d.ts +6 -18
- package/build/lib/doctor.d.ts.map +1 -1
- package/build/lib/doctor.js +0 -15
- package/build/lib/doctor.js.map +1 -1
- package/build/lib/env.d.ts +14 -20
- package/build/lib/env.d.ts.map +1 -1
- package/build/lib/env.js +24 -61
- package/build/lib/env.js.map +1 -1
- package/build/lib/fs.d.ts +109 -148
- package/build/lib/fs.d.ts.map +1 -1
- package/build/lib/fs.js +130 -230
- package/build/lib/fs.js.map +1 -1
- package/build/lib/image-util.d.ts +7 -6
- package/build/lib/image-util.d.ts.map +1 -1
- package/build/lib/image-util.js +9 -6
- package/build/lib/image-util.js.map +1 -1
- package/build/lib/index.d.ts +19 -17
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/logger.d.ts +1 -1
- package/build/lib/logger.d.ts.map +1 -1
- package/build/lib/logger.js +1 -1
- package/build/lib/logger.js.map +1 -1
- package/build/lib/logging.d.ts +7 -15
- package/build/lib/logging.d.ts.map +1 -1
- package/build/lib/logging.js +36 -62
- package/build/lib/logging.js.map +1 -1
- package/build/lib/mjpeg.d.ts +19 -56
- package/build/lib/mjpeg.d.ts.map +1 -1
- package/build/lib/mjpeg.js +55 -78
- package/build/lib/mjpeg.js.map +1 -1
- package/build/lib/mkdirp.d.ts +4 -1
- package/build/lib/mkdirp.d.ts.map +1 -1
- package/build/lib/mkdirp.js +1 -2
- package/build/lib/mkdirp.js.map +1 -1
- package/build/lib/net.d.ts +52 -90
- package/build/lib/net.d.ts.map +1 -1
- package/build/lib/net.js +104 -193
- package/build/lib/net.js.map +1 -1
- package/build/lib/node.d.ts +16 -17
- package/build/lib/node.d.ts.map +1 -1
- package/build/lib/node.js +115 -120
- package/build/lib/node.js.map +1 -1
- package/build/lib/npm.d.ts +65 -86
- package/build/lib/npm.d.ts.map +1 -1
- package/build/lib/npm.js +64 -122
- package/build/lib/npm.js.map +1 -1
- package/build/lib/plist.d.ts +36 -29
- package/build/lib/plist.d.ts.map +1 -1
- package/build/lib/plist.js +62 -59
- package/build/lib/plist.js.map +1 -1
- package/build/lib/process.d.ts +19 -2
- package/build/lib/process.d.ts.map +1 -1
- package/build/lib/process.js +24 -7
- package/build/lib/process.js.map +1 -1
- package/build/lib/system.d.ts +41 -6
- package/build/lib/system.d.ts.map +1 -1
- package/build/lib/system.js +49 -14
- package/build/lib/system.js.map +1 -1
- package/build/lib/tempdir.d.ts +26 -49
- package/build/lib/tempdir.d.ts.map +1 -1
- package/build/lib/tempdir.js +46 -78
- package/build/lib/tempdir.js.map +1 -1
- package/build/lib/timing.d.ts +28 -22
- package/build/lib/timing.d.ts.map +1 -1
- package/build/lib/timing.js +16 -17
- package/build/lib/timing.js.map +1 -1
- package/build/lib/util.d.ts +164 -181
- package/build/lib/util.d.ts.map +1 -1
- package/build/lib/util.js +198 -253
- package/build/lib/util.js.map +1 -1
- package/build/lib/zip.d.ts +81 -139
- package/build/lib/zip.d.ts.map +1 -1
- package/build/lib/zip.js +235 -283
- package/build/lib/zip.js.map +1 -1
- package/lib/console.ts +139 -0
- package/lib/{doctor.js → doctor.ts} +6 -20
- package/lib/{env.js → env.ts} +34 -62
- package/lib/fs.ts +453 -0
- package/lib/image-util.ts +40 -0
- package/lib/index.ts +1 -0
- package/lib/{logger.js → logger.ts} +1 -1
- package/lib/logging.ts +157 -0
- package/lib/mjpeg.ts +186 -0
- package/lib/{mkdirp.js → mkdirp.ts} +2 -2
- package/lib/net.ts +305 -0
- package/lib/{node.js → node.ts} +136 -135
- package/lib/npm.ts +291 -0
- package/lib/plist.ts +187 -0
- package/lib/process.ts +62 -0
- package/lib/system.ts +95 -0
- package/lib/tempdir.ts +115 -0
- package/lib/{timing.js → timing.ts} +28 -33
- package/lib/util.ts +561 -0
- package/lib/{zip.js → zip.ts} +344 -299
- package/package.json +24 -26
- package/tsconfig.json +3 -5
- package/index.js +0 -1
- package/lib/console.js +0 -173
- package/lib/fs.js +0 -496
- package/lib/image-util.js +0 -32
- package/lib/logging.js +0 -145
- package/lib/mjpeg.js +0 -207
- package/lib/net.js +0 -336
- package/lib/npm.js +0 -310
- package/lib/plist.js +0 -182
- package/lib/process.js +0 -46
- package/lib/system.js +0 -48
- package/lib/tempdir.js +0 -131
- package/lib/util.js +0 -585
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appium/support",
|
|
3
|
-
"version": "7.0.
|
|
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"
|
|
33
|
+
"build/lib",
|
|
34
|
+
"tsconfig.json"
|
|
36
35
|
],
|
|
37
36
|
"scripts": {
|
|
38
37
|
"test": "npm run test:unit",
|
|
39
|
-
"test:e2e": "mocha --exit --timeout 20s --slow 10s \"./test/e2e/**/*.spec.
|
|
40
|
-
"test:smoke": "node ./index.js",
|
|
41
|
-
"test:unit": "mocha \"./test/unit/**/*.spec.
|
|
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\""
|
|
42
41
|
},
|
|
43
42
|
"dependencies": {
|
|
44
|
-
"@appium/logger": "^2.0.
|
|
45
|
-
"@appium/tsconfig": "^1.1.
|
|
46
|
-
"@appium/types": "^1.1
|
|
43
|
+
"@appium/logger": "^2.0.5",
|
|
44
|
+
"@appium/tsconfig": "^1.1.2",
|
|
45
|
+
"@appium/types": "^1.2.1",
|
|
47
46
|
"@colors/colors": "1.6.0",
|
|
48
47
|
"archiver": "7.0.1",
|
|
49
|
-
"
|
|
48
|
+
"asyncbox": "6.1.0",
|
|
49
|
+
"axios": "1.13.6",
|
|
50
50
|
"base64-stream": "1.0.0",
|
|
51
51
|
"bluebird": "3.7.2",
|
|
52
52
|
"bplist-creator": "0.1.1",
|
|
53
53
|
"bplist-parser": "0.3.2",
|
|
54
54
|
"form-data": "4.0.5",
|
|
55
|
-
"get-stream": "
|
|
56
|
-
"glob": "13.0.
|
|
55
|
+
"get-stream": "9.0.1",
|
|
56
|
+
"glob": "13.0.6",
|
|
57
57
|
"jsftp": "2.1.3",
|
|
58
58
|
"klaw": "4.1.0",
|
|
59
59
|
"lockfile": "1.0.4",
|
|
60
|
-
"lodash": "4.17.
|
|
61
|
-
"log-symbols": "
|
|
62
|
-
"moment": "2.30.1",
|
|
60
|
+
"lodash": "4.17.23",
|
|
61
|
+
"log-symbols": "7.0.1",
|
|
63
62
|
"ncp": "2.0.0",
|
|
64
|
-
"
|
|
63
|
+
"package-directory": "8.2.0",
|
|
65
64
|
"plist": "3.1.0",
|
|
66
65
|
"pluralize": "8.0.0",
|
|
67
|
-
"read-pkg": "
|
|
66
|
+
"read-pkg": "10.1.0",
|
|
68
67
|
"resolve-from": "5.0.0",
|
|
69
68
|
"sanitize-filename": "1.6.3",
|
|
70
|
-
"semver": "7.7.
|
|
69
|
+
"semver": "7.7.4",
|
|
71
70
|
"shell-quote": "1.8.3",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"type-fest": "5.3.0",
|
|
71
|
+
"supports-color": "10.2.2",
|
|
72
|
+
"teen_process": "4.0.10",
|
|
73
|
+
"type-fest": "5.4.4",
|
|
76
74
|
"uuid": "13.0.0",
|
|
77
|
-
"which": "6.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": "
|
|
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
|
-
|
|
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 {supportsColor} from 'supports-color';
|
|
3
|
-
import {Console as NodeConsole} from 'console';
|
|
4
|
-
import '@colors/colors';
|
|
5
|
-
import symbols from 'log-symbols';
|
|
6
|
-
import {Writable} from '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 ?? supportsColor(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};
|