Skip to content

Commit

Permalink
feat: use proc-log instead of process.emit and drop support for log
Browse files Browse the repository at this point in the history
… property (#41)

BREAKING CHANGE: this drops support for the `log` property and all logs
are now emitted on the process object via `proc-log`.
  • Loading branch information
lukekarrys committed Feb 16, 2022
1 parent ca9ccde commit 70fc3c4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 27 deletions.
21 changes: 0 additions & 21 deletions lib/proc-log.js

This file was deleted.

3 changes: 1 addition & 2 deletions lib/spawn.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const spawn = require('@npmcli/promise-spawn')
const promiseRetry = require('promise-retry')
const log = require('proc-log')
const makeError = require('./make-error.js')
const whichGit = require('./which.js')
const makeOpts = require('./opts.js')
const procLog = require('./proc-log.js')

module.exports = (gitArgs, opts = {}) => {
const gitPath = whichGit(opts)
Expand All @@ -17,7 +17,6 @@ module.exports = (gitArgs, opts = {}) => {
? gitArgs
: ['--no-replace-objects', ...gitArgs]

const log = opts.log || procLog
let retry = opts.retry
if (retry === null || retry === undefined) {
retry = {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"lru-cache": "^7.3.1",
"mkdirp": "^1.0.4",
"npm-pick-manifest": "^7.0.0",
"proc-log": "^2.0.0",
"promise-inflight": "^1.0.1",
"promise-retry": "^2.0.1",
"semver": "^7.3.5",
Expand Down
4 changes: 0 additions & 4 deletions test/spawn.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const spawn = require('../lib/spawn.js')
const procLog = require('../lib/proc-log.js')
const errors = require('../lib/errors.js')

const t = require('tap')
Expand Down Expand Up @@ -81,7 +80,6 @@ process.exit(1)
cwd: repo,
git: process.execPath,
allowReplace: true,
log: procLog,
...(retryOptions[n]),
}), er).then(() => {
t.same(logs, [
Expand Down Expand Up @@ -121,7 +119,6 @@ process.exit(1)
cwd: repo,
git: process.execPath,
allowReplace: true,
log: procLog,
}), er)
t.end()
})
Expand All @@ -146,7 +143,6 @@ process.exit(1)
cwd: repo,
git: process.execPath,
allowReplace: true,
log: procLog,
}), er)
t.end()
})

0 comments on commit 70fc3c4

Please sign in to comment.