Skip to content

Commit

Permalink
Chalk (#789)
Browse files Browse the repository at this point in the history
* remove chalk

* change log

* merge main fix conflict

* package-json and package-lock.json
  • Loading branch information
astridx committed Jan 20, 2022
1 parent 4294d6d commit 6b57f36
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Features and improvements

* Remove node package chalk from devDependencies (#789).
- *...Add new stuff here...*

### 🐞 Bug fixes
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
"benchmark": "^2.1.4",
"browserify": "^17.0.0",
"canvas": "^2.9.0",
"chalk": "^4.1.2",
"chokidar": "^3.0.2",
"cssnano": "^5.0.8",
"d3": "^4.12.0",
Expand Down
27 changes: 13 additions & 14 deletions test/integration/lib/harness.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import fs from 'fs';
import glob from 'glob';
import shuffleSeed from 'shuffle-seed';
import d3 from 'd3';
import colors from 'chalk';
import template from 'lodash.template';
import createServer from './server';
import {fileURLToPath} from 'url';
Expand Down Expand Up @@ -49,20 +48,20 @@ export default function (directory, implementation, options, run) {
}

if (implementation === 'native' && process.env.BUILDTYPE !== 'Debug' && test.id.match(/^debug\//)) {
console.log(colors.gray(`* skipped ${test.id}`));
console.log(`* skipped ${test.id}`);
return false;
}

if (/^skip/.test(test.ignored)) {
console.log(colors.gray(`* skipped ${test.id} (${test.ignored})`));
console.log(`* skipped ${test.id} (${test.ignored})`);
return false;
}

return true;
});

if (options.shuffle) {
console.log(colors.white(`* shuffle seed: `) + colors.bold(`${options.seed}`));
console.log(`* shuffle seed: ${options.seed}`);
sequence = shuffle(sequence, options.seed);
}

Expand All @@ -86,23 +85,23 @@ export default function (directory, implementation, options, run) {
if (test.ignored && !test.ok) {
test.color = '#9E9E9E';
test.status = 'ignored failed';
console.log(colors.white(`* ignore ${test.id} (${test.ignored})`));
console.log(`* ignore ${test.id} (${test.ignored})`);
} else if (test.ignored) {
test.color = '#E8A408';
test.status = 'ignored passed';
console.log(colors.yellow(`* ignore ${test.id} (${test.ignored})`));
console.log(`* ignore ${test.id} (${test.ignored})`);
} else if (test.error) {
test.color = 'red';
test.status = 'errored';
console.log(colors.red(`* errored ${test.id}`));
console.log(`* errored ${test.id}`);
} else if (!test.ok) {
test.color = 'red';
test.status = 'failed';
console.log(colors.red(`* failed ${test.id}`));
console.log(`* failed ${test.id}`);
} else {
test.color = 'green';
test.status = 'passed';
console.log(colors.green(`* passed ${test.id}`));
console.log(`* passed ${test.id}`);
}

callback(null, test);
Expand Down Expand Up @@ -149,27 +148,27 @@ export default function (directory, implementation, options, run) {
const totalCount = passedCount + ignorePassCount + ignoreCount + failedCount + erroredCount;

if (passedCount > 0) {
console.log(colors.green('%d passed (%s%)'),
console.log(`%d passed (%s%)`,
passedCount, (100 * passedCount / totalCount).toFixed(1));
}

if (ignorePassCount > 0) {
console.log(colors.yellow('%d passed but were ignored (%s%)'),
console.log(`%d passed but were ignored (%s%)`,
ignorePassCount, (100 * ignorePassCount / totalCount).toFixed(1));
}

if (ignoreCount > 0) {
console.log(colors.white('%d ignored (%s%)'),
console.log(`%d ignored (%s%)`,
ignoreCount, (100 * ignoreCount / totalCount).toFixed(1));
}

if (failedCount > 0) {
console.log(colors.red('%d failed (%s%)'),
console.log(`%d failed (%s%)`,
failedCount, (100 * failedCount / totalCount).toFixed(1));
}

if (erroredCount > 0) {
console.log(colors.red('%d errored (%s%)'),
console.log(`%d errored (%s%)`,
erroredCount, (100 * erroredCount / totalCount).toFixed(1));
}

Expand Down
5 changes: 2 additions & 3 deletions test/integration/lib/localize-urls.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import path, {dirname} from 'path';
import fs from 'fs';
import colors from 'chalk';
import {fileURLToPath} from 'url';
import {createRequire} from 'module';

Expand Down Expand Up @@ -28,14 +27,14 @@ export default function localizeURLs(style, port) {
styleJSON = fs.readFileSync(path.join(__dirname, '..', relativePath));
}
} catch (error) {
console.log(colors.blue(`* ${error}`));
console.log(`* ${error}`);
return;
}

try {
styleJSON = JSON.parse(styleJSON);
} catch (error) {
console.log(colors.blue(`* Error while parsing ${op[1]}: ${error}`));
console.log(`* Error while parsing ${op[1]}: ${error}`);
return;
}

Expand Down

0 comments on commit 6b57f36

Please sign in to comment.