Skip to content

Commit

Permalink
Logging switch to chalk npm package & fix detecting eval
Browse files Browse the repository at this point in the history
Remove 2 unused imports in `tools/cordova/run-targets.js`
  • Loading branch information
StorytellerCZ committed Jul 20, 2021
1 parent 71776ea commit 2edb355
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 92 deletions.
5 changes: 5 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- `meteor show` now reports if a package is deprecated
- `reify` update to v0.22.0 which bring optimizations for imports, [read more](https://github.com/benjamn/reify/pull/246)
- Apollo skeleton now uses [Apollo server v3](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md#v300) - [migration guide](https://www.apollographql.com/docs/apollo-server/migration/)
- Upgraded `chalk` to v4.1.1

* `[email protected]`
- npm dependencies have been updated
Expand All @@ -15,6 +16,10 @@
- Updated dependencies
- `[email protected]`
- `[email protected]`

* `[email protected]`
- Switch from `cli-color` to `chalk` to have the same dependency as meteor-tool
- Fix detecting eval

#### Independent Releases

Expand Down
110 changes: 29 additions & 81 deletions packages/logging/.npm/package/npm-shrinkwrap.json

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

8 changes: 3 additions & 5 deletions packages/logging/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,14 @@ Log._getCallerDetails = () => {

const stack = getStack();

if (!stack) {
return {};
}
if (!stack) return {};

// looking for the first line outside the logging package (or an
// eval if we find that first)
let line;
const lines = stack.split('\n').slice(1);
for (line of lines) {
if (line.match(/^\s*at eval \(eval/)) {
if (line.match(/^\s*(at eval \(eval)|(eval:)/)) {
return {file: "eval"};
}

Expand Down Expand Up @@ -303,7 +301,7 @@ Log.format = (obj, options = {}) => {

const prettify = function (line, color) {
return (options.color && Meteor.isServer && color) ?
require('cli-color')[color](line) : line;
require('chalk')[color](line) : line;
};

return prettify(metaPrefix, platformColor(options.metaColor || META_COLOR)) +
Expand Down
4 changes: 2 additions & 2 deletions packages/logging/package.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Package.describe({
summary: 'Logging facility.',
version: '1.2.0'
version: '2.0.0'
});

Npm.depends({
'cli-color': '2.0.0'
'chalk': '4.1.1'
});

Npm.strip({
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev-bundle-tool-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var packageJson = {
// TODO: We should replace this with: https://github.com/jprichardson/node-kexec/pull/38
kexec: "https://github.com/meteor/node-kexec/tarball/f29f54037c7db6ad29e1781463b182e5929215a0",
"source-map": "0.7.3",
chalk: "0.5.1",
chalk: "4.1.1",
sqlite3: "5.0.2",
"http-proxy": "1.18.1",
"is-reachable": "3.1.0",
Expand Down
1 change: 0 additions & 1 deletion tools/console/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import { createInterface } from "readline";
import { format as utilFormat } from "util";
import { getRootProgress } from "../utils/buildmessage.js";
// XXX: Are we happy with chalk (and its sub-dependencies)?
import chalk from "chalk";
import { onExit as cleanupOnExit } from "../tool-env/cleanup.js";
import wordwrap from "wordwrap";
Expand Down
2 changes: 0 additions & 2 deletions tools/cordova/run-targets.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import _ from 'underscore';
import chalk from 'chalk';
import child_process from 'child_process';

import { loadIsopackage } from '../tool-env/isopackets.js';
import runLog from '../runners/run-log.js';
import { Console } from '../console/console.js';
import files from '../fs/files';
import { execFileSync, execFileAsync } from '../utils/processes';
Expand Down

0 comments on commit 2edb355

Please sign in to comment.