Skip to content
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

Remove chalk #14505

Merged
merged 3 commits into from
Jul 16, 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
  •  
  •  
  •  
27 changes: 0 additions & 27 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ devel

- 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 Expand Up @@ -395,32 +394,6 @@ devel
* Fixed ES-881: ensure that LDAP options for async, referrals and restart set
the off value correctly. Otherwise, this can result in an "operations error".

* Updated JavaScript dependencies, including breaking changes to non-public
modules. Note that this removes underscore, which was previously listed as a
public module in ArangoDB 2. We recommend always bundling your own copy of
third-party modules, even ones listed as public.

- 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.2
- http-errors: 1.7.2 -> 1.8.0
- iconv-lite: 0.4.24 -> 0.6.2
- js-yaml: 3.13.1 -> 3.14.1
- lodash: 4.17.13 -> 4.17.21
- marked: 0.6.2 -> removed
- media-typer: 0.3.0 -> removed
- mime-types: 2.1.22 -> 2.1.30
- netmask: 1.0.6 -> 2.0.2
- qs: 6.7.0 -> 6.10.1
- range-parser: 1.2.0 -> 1.2.1
- semver: 6.0.0 -> 7.3.5
- timezone: 1.0.22 -> 1.0.23
- type-is: 1.6.16 -> 1.6.18
- underscore: 1.9.1 -> removed

* Fixed DEVSUP-764 (SEARCH-7): inconsistent BM25 scoring for LEVENSHTEIN_MATCH
function.

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}`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what our equivalent of bright black (i.e. grey) is but I assume this is it?

: 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.

Loading