Skip to content

Commit

Permalink
Replace external debug dependency with node:util.debug
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Apr 27, 2022
1 parent bd45e52 commit e7748a8
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -312,7 +312,7 @@ In release-it v15, anonymous metrics have been removed from the codebase and no

- With `release-it --verbose` (or `-V`), release-it prints the output of every user-defined [hook](#hooks).
- With `release-it -VV`, release-it also prints the output of every internal command.
- Use `DEBUG=release-it:* release-it [...]` to print configuration and more error details.
- Use `NODE_DEBUG=release-it:* release-it [...]` to print configuration and more error details.

Use `verbose: 2` in a configuration file to have the equivalent of `-VV` on the command line.

Expand Down
4 changes: 2 additions & 2 deletions docs/plugins.md
Expand Up @@ -334,8 +334,8 @@ this.exec('git log', { options: { write: false } });

#### this.debug() → void

Insert `this.debug(...)` statements to log interesting details when `DEBUG=release-it:* release-it ...` is used. The
output is namespaced automatically (e.g. `release-it:foo My log output`).
Insert `this.debug(...)` statements to log interesting details when `NODE_DEBUG=release-it:* release-it ...` is used.
The output is namespaced automatically (e.g. `release-it:foo My log output`).

#### this.log() → void

Expand Down
4 changes: 2 additions & 2 deletions lib/config.js
@@ -1,11 +1,11 @@
import util from 'node:util';
import { cosmiconfigSync } from 'cosmiconfig';
import parseToml from '@iarna/toml/parse-string.js';
import _ from 'lodash';
import isCI from 'is-ci';
import _debug from 'debug';
import { readJSON, getSystemInfo } from './util.js';

const debug = _debug('release-it:config');
const debug = util.debug('release-it:config');
const defaultConfig = readJSON(new URL('../config/release-it.json', import.meta.url));

const searchPlaces = [
Expand Down
2 changes: 1 addition & 1 deletion lib/plugin/Plugin.js
@@ -1,4 +1,4 @@
import debug from 'debug';
import { debug } from 'node:util';
import _ from 'lodash';

class Plugin {
Expand Down
4 changes: 2 additions & 2 deletions lib/plugin/factory.js
@@ -1,15 +1,15 @@
import url from 'node:url';
import path from 'node:path';
import util from 'node:util';
import { createRequire } from 'node:module';
import _ from 'lodash';
import _debug from 'debug';
import Version from './version/Version.js';
import Git from './git/Git.js';
import GitLab from './gitlab/GitLab.js';
import GitHub from './github/GitHub.js';
import npm from './npm/npm.js';

const debug = _debug('release-it:plugins');
const debug = util.debug('release-it:plugins');

const pluginNames = ['npm', 'git', 'github', 'gitlab', 'version'];

Expand Down
4 changes: 2 additions & 2 deletions lib/shell.js
@@ -1,9 +1,9 @@
import util from 'node:util';
import sh from 'shelljs';
import { execa } from 'execa';
import _debug from 'debug';
import { format } from './util.js';

const debug = _debug('release-it:shell');
const debug = util.debug('release-it:shell');

sh.config.silent = !debug.enabled;

Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -63,7 +63,6 @@
"async-retry": "1.3.3",
"chalk": "5.0.1",
"cosmiconfig": "7.0.1",
"debug": "4.3.4",
"execa": "6.1.0",
"form-data": "4.0.0",
"git-url-parse": "11.6.0",
Expand Down
4 changes: 2 additions & 2 deletions test/stub/shell.js
@@ -1,7 +1,7 @@
import _debug from 'debug';
import util from 'node:util';
import Shell from '../../lib/shell.js';

const debug = _debug('release-it:shell-stub');
const debug = util.debug('release-it:shell-stub');

class ShellStub extends Shell {
exec(command) {
Expand Down

0 comments on commit e7748a8

Please sign in to comment.