8000 [3.6] Restore chalk by pluma · Pull Request #14566 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

[3.6] Restore chalk #14566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ v3.6.16 (XXXX-XX-XX)

- accepts: 1.3.5 -> 1.3.7
- ansi_up: 4.0.3 -> 5.0.1
- chalk: 1.1.3 -> 4.1.1
- content-type: (added) -> 1.0.4
- error-stack-parser: 2.0.2 -> 2.0.6
- highlight.js: 9.15.6 -> 10.7.3
Expand Down
55 changes: 23 additions & 32 deletions js/common/modules/@arangodb/mocha-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
// //////////////////////////////////////////////////////////////////////////////

const Module = require('module');
const chalk = require('chalk');
const runTests = require('@arangodb/mocha').run;
const indent = require('@arangodb/util').indentation;
const COLORS = require('internal').COLORS;

const $_MODULE_CONTEXT = Symbol.for('@arangodb/module.context');

Expand All @@ -50,18 +50,14 @@ module.exports = function (files, returnJson, grep) {
function logStats (stats) {
print(`${
stats.failures
? chalk.red('[FAIL]')
: chalk.green('[PASS]')
? `${COLORS.COLOR_RED}[FAIL]${COLORS.COLOR_RESET}`
: `${COLORS.COLOR_GREEN}[PASS]${COLORS.COLOR_RESET}`
} Completed ${
chalk.bold(stats.tests)
} tests in ${
chalk.bold(stats.duration + 'ms')
} (${
chalk.green(stats.passes)
}|${
chalk.red(stats.failures)
}|${
chalk.cyan(stats.pending)
COLORS.COLOR_BOLD_WHITE}${stats.tests}${COLORS.COLOR_RESET} tests in ${
COLORS.COLOR_BOLD_WHITE}${stats.duration + 'ms'}${COLORS.COLOR_RESET} (${
COLORS.COLOR_GREEN}${stats.passes}${COLORS.COLOR_RESET}|${
COLORS.COLOR_RED}${stats.failures}${COLORS.COLOR_RESET}|${
COLORS.COLOR_CYAN}${stats.pending}${COLORS.COLOR_RESET
})`);
}

Expand All @@ -70,32 +66,27 @@ function logSuite (suite, indentLevel) {
indentLevel = 0;
}
if (suite.title) {
print(
indent(indentLevel - 1) +
chalk.bold(suite.title)
);
print(`${indent(indentLevel - 1)}${
COLORS.COLOR_BOLD_WHITE}${suite.title}${COLORS.COLOR_RESET
}`);
}
for (let test of suite.tests) {
if (test.result === 'pass') {
print(
indent(indentLevel) +
chalk.green('[PASS] ' + test.title)
);
print(`${indent(indentLevel)}${
COLORS.COLOR_GREEN}[PASS] ${test.title}${COLORS.COLOR_RESET
}`);
} else if (test.result === 'pending') {
print(
indent(indentLevel) +
chalk.cyan('[SKIP] ' + test.title)
);
print(`${indent(indentLevel)}${
COLORS.COLOR_CYAN}[SKIP] ${test.title}${COLORS.COLOR_RESET
}`);
} else {
print(
indent(indentLevel) +
chalk.red('[' + test.result.toUpperCase() + '] ' + test.title)
);
print(`${indent(indentLevel)}${
COLORS.COLOR_RED}[${test.result.toUpperCase()}] ${test.title}${COLORS.COLOR_RESET
}`);
for (let line of test.err.stack.split(/\n/)) {
print(
indent(indentLevel + 1) +
chalk.red(line)
);
print(`${indent(indentLevel + 1)}${
COLORS.COLOR_RED}${line}${COLORS.COLOR_RESET
}`);
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions js/common/modules/@arangodb/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@

const _ = require('lodash');
const fs = require('fs');
const Chalk = require('chalk').Instance;
const chalk = new Chalk({level: 2});
const dedent = require('dedent');
const internal = require('internal');
const codeFrame = require('babel-code-frame');
Expand Down Expand Up @@ -111,7 +109,11 @@ exports.codeFrame = function (e, basePath, withColor = internal.COLOR_OUTPUT) {
const location = `@ ${
basePath ? ctx.fileName.slice(basePath.length + 1) : ctx.fileName
}:${ctx.lineNumber}:${ctx.columnNumber}\n`;
return (withColor ? chalk.grey(location) : location) + frame;
return (
withColor
? `${internal.COLORS.COLOR_BRIGHT}${location}${internal.COLORS.COLOR_RESET}`
: location
) + frame;
}
} catch (e) {}
return null;
Expand Down
1 change: 0 additions & 1 deletion js/node/node_modules/.bin/ansi-html

This file was deleted.

1 change: 0 additions & 1 deletion js/node/node_modules/.bin/eslint

This file was deleted.

1 change: 0 additions & 1 deletion js/node/node_modules/.bin/js-yaml

This file was deleted.

1 change: 0 additions & 1 deletion js/node/node_modules/.bin/semver

This file was deleted.

158 changes: 47 additions & 111 deletions js/node/node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions js/node/node_modules/ansi-html/.npmignore

This file was deleted.

Empty file.
28 changes: 0 additions & 28 deletions js/node/node_modules/ansi_up/examples/browser.html

This file was deleted.

16 changes: 0 additions & 16 deletions js/node/node_modules/ansi_up/examples/browser_amd.html

This file was deleted.

4 changes: 0 additions & 4 deletions js/node/node_modules/ansi_up/examples/jquery-1.7.2.min.js

This file was deleted.

14 changes: 0 additions & 14 deletions js/node/node_modules/ansi_up/examples/main.js

This file was deleted.

Loading
0