fix: Switch colors package to a non-compomised repository
MODIFY
package.json
package.json
"@babel/preset-env": "7.16.4",
"@babel/register": "7.16.0",
"@babel/runtime": "7.16.3",
+ "@dabh/colors": "1.4.0",
"@types/argparse": "2.0.10",
"@types/bluebird": "3.5.36",
"@types/chai": "4.3.0",
"chai": "4.3.4",
"chai-as-promised": "7.1.1",
"chai-webdriverio-async": "2.6.0",
- "colors": "1.4.0",
"eslint": "7.32.0",
"eslint-find-rules": "4.0.0",
"eslint-plugin-import": "2.25.3",

MODIFY
packages/appium/test/utils-specs.js
packages/appium/test/utils-specs.js
@@ -4,7 +4,7 @@ import {
} from '../lib/utils';
import { BASE_CAPS, W3C_CAPS } from './helpers';
import _ from 'lodash';
-import { stripColors } from 'colors';
+import { stripColors } from '@dabh/colors';
import sinon from 'sinon';
import logger from '../lib/logger';

MODIFY
packages/base-driver/lib/express/express-logging.js
packages/base-driver/lib/express/express-logging.js
import _ from 'lodash';
-import 'colors';
+import '@dabh/colors';
import morgan from 'morgan';
import log from './logger';
import { MAX_LOG_BODY_LENGTH } from '../constants';

MODIFY
packages/base-driver/package.json
packages/base-driver/package.json
"dependencies": {
"@appium/support": "file:../support",
"@babel/runtime": "7.16.3",
+ "@dabh/colors": "1.4.0",
"async-lock": "1.3.0",
"asyncbox": "2.9.2",
"axios": "0.24.0",
"bluebird": "3.7.2",
"body-parser": "1.19.0",
- "colors": "1.4.0",
"es6-error": "4.1.1",
"express": "4.17.1",
"http-status-codes": "2.1.4",

MODIFY
packages/doctor/lib/android.js
packages/doctor/lib/android.js
@@ -3,7 +3,7 @@ import { ok, nok, okOptional, nokOptional, resolveExecutablePath } from './utils
import { system, fs } from '@appium/support';
import path from 'path';
import EnvVarAndPathCheck from './env';
-import 'colors';
+import '@dabh/colors';
import { getAndroidBinaryPath, getSdkRootFromEnv } from 'appium-adb';
import log from './logger';

MODIFY
packages/doctor/lib/dev.js
packages/doctor/lib/dev.js
@@ -2,7 +2,7 @@ import { DoctorCheck } from './doctor';
import { ok, nok, resolveExecutablePath } from './utils';
import { fs, system } from '@appium/support';
import path from 'path';
-import 'colors';
+import '@dabh/colors';
let checks = [];

MODIFY
packages/doctor/lib/doctor.js
packages/doctor/lib/doctor.js
-import 'colors';
+import '@dabh/colors';
import _ from 'lodash';
import log from './logger';
import { fs } from '@appium/support';

MODIFY
packages/doctor/lib/env.js
packages/doctor/lib/env.js
import { fs } from '@appium/support';
import { DoctorCheck } from './doctor';
import { ok, nok } from './utils';
-import 'colors';
+import '@dabh/colors';
// Check env variables
class EnvVarAndPathCheck extends DoctorCheck {

MODIFY
packages/doctor/lib/general.js
packages/doctor/lib/general.js
@@ -4,7 +4,7 @@ import { DoctorCheck } from './doctor';
import NodeDetector from './node-detector';
import { util } from '@appium/support';
import { EOL } from 'os';
-import 'colors';
+import '@dabh/colors';
let checks = [];

MODIFY
packages/doctor/lib/ios.js
packages/doctor/lib/ios.js
@@ -5,7 +5,7 @@ import { DoctorCheck, FixSkippedError } from './doctor';
import log from './logger';
import { fixIt } from './prompt';
import EnvVarAndPathCheck from './env';
-import 'colors';
+import '@dabh/colors';
let checks = [];
let fixes = {};

MODIFY
packages/doctor/package.json
packages/doctor/package.json
"dependencies": {
"@appium/support": "file:../support",
"@babel/runtime": "7.16.3",
+ "@dabh/colors": "1.4.0",
"appium-adb": "8.17.0",
"bluebird": "3.7.2",
- "colors": "1.4.0",
"inquirer": "8.2.0",
"lodash": "4.17.21",
"source-map-support": "0.5.21",

MODIFY
packages/test-support/test/log-utils-specs.js
packages/test-support/test/log-utils-specs.js
import { stubLog } from '../lib';
import log from '../lib/logger';
import sinon from 'sinon';
-import 'colors';
-
-
+import '@dabh/colors';
describe('log-utils', function () {

fix: Switch colors package to a non-compomised repository (#16317)