libnpmexec 3.0.3 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -35,7 +35,6 @@ await libexec({
35
35
  - `color`: Output should use color? **Boolean**, defaults to `false`
36
36
  - `localBin`: Location to the `node_modules/.bin` folder of the local project to start scanning for bin files **String**, defaults to `./node_modules/.bin`. **libexec** will walk up the directory structure looking for `node_modules/.bin` folders in parent folders that might satisfy the current `arg` and will use that bin if found.
37
37
  - `locationMsg`: Overrides "at location" message when entering interactive mode **String**
38
- - `log`: Sets an optional logger **Object**, defaults to `proc-log` module usage.
39
38
  - `globalBin`: Location to the global space bin folder, same as: `$(npm bin -g)` **String**, defaults to empty string.
40
39
  - `output`: A function to print output to **Function**
41
40
  - `packages`: A list of packages to be used (possibly fetch from the registry) **Array<String>**, defaults to `[]`
package/lib/index.js CHANGED
@@ -4,7 +4,8 @@ const read = promisify(require('read'))
4
4
 
5
5
  const Arborist = require('@npmcli/arborist')
6
6
  const ciDetect = require('@npmcli/ci-detect')
7
- const logger = require('proc-log')
7
+ const log = require('proc-log')
8
+ const npmlog = require('npmlog')
8
9
  const mkdirp = require('mkdirp-infer-owner')
9
10
  const npa = require('npm-package-arg')
10
11
  const pacote = require('pacote')
@@ -39,7 +40,6 @@ const exec = async (opts) => {
39
40
  yes = undefined,
40
41
  ...flatOptions
41
42
  } = opts
42
- const log = flatOptions.log || logger
43
43
 
44
44
  // dereferences values because we manipulate it later
45
45
  const packages = [..._packages]
@@ -50,7 +50,6 @@ const exec = async (opts) => {
50
50
  color,
51
51
  flatOptions,
52
52
  locationMsg,
53
- log,
54
53
  output,
55
54
  path,
56
55
  pathArr,
@@ -169,9 +168,7 @@ const exec = async (opts) => {
169
168
  const prompt = `Need to install the following packages:\n${
170
169
  addList
171
170
  }Ok to proceed? `
172
- if (typeof log.clearProgress === 'function') {
173
- log.clearProgress()
174
- }
171
+ npmlog.clearProgress()
175
172
  const confirm = await read({ prompt, default: 'y' })
176
173
  if (confirm.trim().toLowerCase().charAt(0) !== 'y') {
177
174
  throw new Error('canceled')
package/lib/run-script.js CHANGED
@@ -4,6 +4,8 @@ const chalk = require('chalk')
4
4
  const ciDetect = require('@npmcli/ci-detect')
5
5
  const runScript = require('@npmcli/run-script')
6
6
  const readPackageJson = require('read-package-json-fast')
7
+ const npmlog = require('npmlog')
8
+ const log = require('proc-log')
7
9
  const noTTY = require('./no-tty.js')
8
10
 
9
11
  const nocolor = {
@@ -18,7 +20,6 @@ const run = async ({
18
20
  color,
19
21
  flatOptions,
20
22
  locationMsg,
21
- log,
22
23
  output = () => {},
23
24
  path,
24
25
  pathArr,
@@ -41,9 +42,7 @@ const run = async ({
41
42
  },
42
43
  }
43
44
 
44
- if (log && log.disableProgress) {
45
- log.disableProgress()
46
- }
45
+ npmlog.disableProgress()
47
46
 
48
47
  try {
49
48
  if (script === scriptShell) {
@@ -80,9 +79,7 @@ const run = async ({
80
79
  stdio: 'inherit',
81
80
  })
82
81
  } finally {
83
- if (log && log.enableProgress) {
84
- log.enableProgress()
85
- }
82
+ npmlog.enableProgress()
86
83
  }
87
84
  }
88
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libnpmexec",
3
- "version": "3.0.3",
3
+ "version": "4.0.0",
4
4
  "files": [
5
5
  "bin",
6
6
  "lib"
@@ -50,14 +50,15 @@
50
50
  "tap": "^15.0.6"
51
51
  },
52
52
  "dependencies": {
53
- "@npmcli/arborist": "^4.0.0",
54
- "@npmcli/ci-detect": "^1.3.0",
55
- "@npmcli/run-script": "^2.0.0",
53
+ "@npmcli/arborist": "^5.0.0",
54
+ "@npmcli/ci-detect": "^2.0.0",
55
+ "@npmcli/run-script": "^3.0.0",
56
56
  "chalk": "^4.1.0",
57
57
  "mkdirp-infer-owner": "^2.0.0",
58
- "npm-package-arg": "^8.1.2",
59
- "pacote": "^12.0.0",
60
- "proc-log": "^1.0.0",
58
+ "npm-package-arg": "^9.0.0",
59
+ "npmlog": "^6.0.1",
60
+ "pacote": "^13.0.2",
61
+ "proc-log": "^2.0.0",
61
62
  "read": "^1.0.7",
62
63
  "read-package-json-fast": "^2.0.2",
63
64
  "walk-up-path": "^1.0.0"