Skip to content

Commit

Permalink
fix foxdriver patching
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Jun 29, 2020
1 parent 0b4529b commit f75cc45
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 50 deletions.
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
"productName": "Cypress",
"workspaces": {
"nohoist": [
"@benmalka/foxdriver"
"foxdriver"
]
},
"optionalDependencies": {
Expand Down
49 changes: 0 additions & 49 deletions packages/server/patches/@benmalka+foxdriver+0.4.0.patch

This file was deleted.

46 changes: 46 additions & 0 deletions packages/server/patches/foxdriver+0.1.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/node_modules/foxdriver/build/logger.js b/node_modules/foxdriver/build/logger.js
index 80e315d..c160f30 100644
--- a/node_modules/foxdriver/build/logger.js
+++ b/node_modules/foxdriver/build/logger.js
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
});
exports.default = Logger;

-var _npmlog = _interopRequireDefault(require("npmlog"));
+const debug = require('debug')('foxdriver')

var _package = _interopRequireDefault(require("../package.json"));

@@ -16,10 +16,6 @@ var _package = _interopRequireDefault(require("../package.json"));
*/
const NPM_LEVELS = ['silly', 'verbose', 'debug', 'info', 'http', 'warn', 'error', 'chrome', 'firefox'];

-_npmlog.default.addLevel('debug', 1000, {
- fg: 'blue',
- bg: 'black'
-}, 'dbug');

function Logger(component) {
const wrappedLogger = {};
@@ -30,10 +26,8 @@ function Logger(component) {

Object.defineProperty(wrappedLogger, 'level', {
get: () => {
- return _npmlog.default.level;
},
set: newValue => {
- _npmlog.default.level = newValue;
},
enumerable: true,
configurable: true
@@ -44,8 +38,8 @@ function Logger(component) {

for (let level of NPM_LEVELS) {
wrappedLogger[level] = (...args) => {
- if (!process.env.DEBUG) return;
- return _npmlog.default[level](prefix, ...args);
+ // @see https://github.com/cypress-io/cypress/issues/7723
+ debug(prefix, ...args)
};
}

0 comments on commit f75cc45

Please sign in to comment.