8000 Remove chalk (#14505) · arangodb/arangodb@9a13d96 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9a13d96

Browse files
authored
Remove chalk (#14505)
* Remove chalk * Add chalk back * Remove extra files
1 parent 506d802 commit 9a13d96

File tree

318 files changed

+595
-20480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

318 files changed

+595
-20480
lines changed

CHANGELOG

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ devel
4747

4848
- accepts: 1.3.5 -> 1.3.7
4949
- ansi_up: 4.0.3 -> 5.0.1
50-
- chalk: 1.1.3 -> 4.1.1
5150
- content-type: (added) -> 1.0.4
5251
- error-stack-parser: 2.0.2 -> 2.0.6
5352
- highlight.js: 9.15.6 -> 10.7.3
@@ -407,32 +406,6 @@ devel
407406
* Fixed ES-881: ensure that LDAP options for async, referrals and restart set
408407
the off value correctly. Otherwise, this can result in an "operations error".
409408

410-
* Updated JavaScript dependencies, including breaking changes to non-public
411-
modules. Note that this removes underscore, which was previously listed as a
412-
public module in ArangoDB 2. We recommend always bundling your own copy of
413-
third-party modules, even ones listed as public.
414-
415-
- accepts: 1.3.5 -> 1.3.7
416-
- ansi_up: 4.0.3 -> 5.0.1
417-
- chalk: 1.1.3 -> 4.1.1
418-
- content-type: (added) -> 1.0.4
419-
- error-stack-parser: 2.0.2 -> 2.0.6
420-
- highlight.js: 9.15.6 -> 10.7.2
421-
- http-errors: 1.7.2 -> 1.8.0
422-
- iconv-lite: 0.4.24 -> 0.6.2
423-
- js-yaml: 3.13.1 -> 3.14.1
424-
- lodash: 4.17.13 -> 4.17.21
425-
- marked: 0.6.2 -> removed
426-
- media-typer: 0.3.0 -> removed
427-
- mime-types: 2.1.22 -> 2.1.30
428-
- netmask: 1.0.6 -> 2.0.2
429-
- qs: 6.7.0 -> 6.10.1
430-
- range-parser: 1.2.0 -> 1.2.1
431-
- semver: 6.0.0 -> 7.3.5
432-
- timezone: 1.0.22 -> 1.0.23
433-
- type-is: 1.6.16 -> 1.6.18
434-
- underscore: 1.9.1 -> removed
435-
436409
* Fixed DEVSUP-764 (SEARCH-7): inconsistent BM25 scoring for LEVENSHTEIN_MATCH
437410
function.
438411

js/common/modules/@arangodb/mocha-runner.js

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
// //////////////////////////////////////////////////////////////////////////////
3030

3131
const Module = require('module');
32-
const chalk = require('chalk');
3332
const runTests = require('@arangodb/mocha').run;
3433
const indent = require('@arangodb/util').indentation;
34+
const COLORS = require('internal').COLORS;
3535

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

@@ -50,18 +50,14 @@ module.exports = function (files, returnJson, grep) {
5050
function logStats (stats) {
5151
print(`${
5252
stats.failures
53-
? chalk.red('[FAIL]')
54-
: chalk.green('[PASS]')
53+
? `${COLORS.COLOR_RED}[FAIL]${COLORS.COLOR_RESET}`
54+
: `${COLORS.COLOR_GREEN}[PASS]${COLORS.COLOR_RESET}`
5555
} Completed ${
56-
chalk.bold(stats.tests)
57-
} tests in ${
58-
chalk.bold(stats.duration + 'ms')
59-
} (${
60-
chalk.green(stats.passes)
61-
}|${
62-
chalk.red(stats.failures)
63-
}|${
64-
chalk.cyan(stats.pending)
56+
COLORS.COLOR_BOLD_WHITE}${stats.tests}${COLORS.COLOR_RESET} tests in ${
57+
COLORS.COLOR_BOLD_WHITE}${stats.duration + 'ms'}${COLORS.COLOR_RESET} (${
58+
COLORS.COLOR_GREEN}${stats.passes}${COLORS.COLOR_RESET}|${
59+
COLORS.COLOR_RED}${stats.failures}${COLORS.COLOR_RESET}|${
60+
COLORS.COLOR_CYAN}${stats.pending}${COLORS.COLOR_RESET
6561
})`);
6662
}
6763

@@ -70,32 +66,27 @@ function logSuite (suite, indentLevel) {
7066
indentLevel = 0;
7167
}
7268
if (suite.title) {
73-
print(
74-
indent(indentLevel - 1) +
75-
chalk.bold(suite.title)
76-
);
69+
print(`${indent(indentLevel - 1)}${
70+
COLORS.COLOR_BOLD_WHITE}${suite.title}${COLORS.COLOR_RESET
71+
}`);
7772< 10000 /td>
}
7873
for (let test of suite.tests) {
7974
if (test.result === 'pass') {
80-
print(
81-
indent(indentLevel) +
82-
chalk.green('[PASS] ' + test.title)
83-
);
75+
print(`${indent(indentLevel)}${
76+
COLORS.COLOR_GREEN}[PASS] ${test.title}${COLORS.COLOR_RESET
77+
}`);
8478
} else if (test.result === 'pending') {
85-
print(
86-
indent(indentLevel) +
87-
chalk.cyan('[SKIP] ' + test.title)
88-
);
79+
print(`${indent(indentLevel)}${
80+
COLORS.COLOR_CYAN}[SKIP] ${test.title}${COLORS.COLOR_RESET
81+
}`);
8982
} else {
90-
print(
91-
indent(indentLevel) +
92-
chalk.red('[' + test.result.toUpperCase() + '] ' + test.title)
93-
);
83+
print(`${indent(indentLevel)}${
84+
COLORS.COLOR_RED}[${test.result.toUpperCase()}] ${test.title}${COLORS.COLOR_RESET
85+
}`);
9486
for (let line of test.err.stack.split(/\n/)) {
95-
print(
96-
indent(indentLevel + 1) +
97-
chalk.red(line)
98-
);
87+
print(`${indent(indentLevel + 1)}${
88+
COLORS.COLOR_RED}${line}${COLORS.COLOR_RESET
89+
}`);
9990
}
10091
}
10192
}

js/common/modules/@arangodb/util.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828

2929
const _ = require('lodash');
3030
const fs = require('fs');
31-
const Chalk = require('chalk').Instance;
32-
const chalk = new Chalk({level: 2});
3331
const dedent = require('dedent');
3432
const internal = require('internal');
3533
const codeFrame = require('babel-code-frame');
@@ -111,7 +109,11 @@ exports.codeFrame = function (e, basePath, withColor = internal.COLOR_OUTPUT) {
111109
const location = `@ ${
112110
basePath ? ctx.fileName.slice(basePath.length + 1) : ctx.fileName
113111
}:${ctx.lineNumber}:${ctx.columnNumber}\n`;
114-
return (withColor ? chalk.grey(location) : location) + frame;
112+
return (
113+
withColor
114+
? `${internal.COLORS.COLOR_BRIGHT}${location}${internal.COLORS.COLOR_RESET}`
115+
: location
116+
) + frame;
115117
}
116118
} catch (e) {}
117119
return null;

js/node/node_modules/.bin/ansi-html

Lines changed: 0 additions & 1 deletion
This file was deleted.

js/node/node_modules/.bin/eslint

Lines changed: 0 additions & 1 deletion
This file was deleted.

js/node/node_modules/.bin/js-yaml

Lines changed: 0 additions & 1 deletion
This file was deleted.

js/node/node_modules/.bin/semver

Lines changed: 0 additions & 1 deletion
This file was deleted.

js/node/node_modules/.package-lock.json

Lines changed: 47 additions & 111 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/node/node_modules/ansi-html/.npmignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

js/node/node_modules/ansi_up/.notags

Whitespace-only changes.

js/node/node_modules/ansi_up/examples/browser.html

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0