libnpmexec 5.0.3 → 5.0.5

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/lib/index.js CHANGED
@@ -4,7 +4,7 @@ const { mkdir } = require('fs/promises')
4
4
  const { promisify } = require('util')
5
5
 
6
6
  const Arborist = require('@npmcli/arborist')
7
- const ciDetect = require('@npmcli/ci-detect')
7
+ const ciInfo = require('ci-info')
8
8
  const crypto = require('crypto')
9
9
  const log = require('proc-log')
10
10
  const npa = require('npm-package-arg')
@@ -110,7 +110,7 @@ const exec = async (opts) => {
110
110
  return run()
111
111
  }
112
112
 
113
- const needPackageCommandSwap = (args.length > 0) && (packages.length === 0)
113
+ let needPackageCommandSwap = (args.length > 0) && (packages.length === 0)
114
114
  // If they asked for a command w/o specifying a package, see if there is a
115
115
  // bin that directly matches that name:
116
116
  // - in the local package itself
@@ -126,9 +126,11 @@ const exec = async (opts) => {
126
126
  if (localManifest?.bin?.[args[0]]) {
127
127
  // we have to install the local package into the npx cache so that its
128
128
  // bin links get set up
129
+ flatOptions.installLinks = false
130
+ // args[0] will exist when the package is installed
129
131
  packages.push(path)
130
132
  yes = true
131
- flatOptions.installLinks = false
133
+ needPackageCommandSwap = false
132
134
  } else {
133
135
  const dir = dirname(dirname(localBin))
134
136
  const localBinPath = await localFileExists(dir, args[0], '/')
@@ -242,7 +244,7 @@ const exec = async (opts) => {
242
244
  throw new Error('canceled')
243
245
  }
244
246
 
245
- if (noTTY() || ciDetect()) {
247
+ if (noTTY() || ciInfo.isCI) {
246
248
  log.warn('exec', `The following package${
247
249
  add.length === 1 ? ' was' : 's were'
248
250
  } not found and will be installed: ${
package/lib/run-script.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const chalk = require('chalk')
2
- const ciDetect = require('@npmcli/ci-detect')
2
+ const ciInfo = require('ci-info')
3
3
  const runScript = require('@npmcli/run-script')
4
4
  const readPackageJson = require('read-package-json-fast')
5
5
  const npmlog = require('npmlog')
@@ -44,10 +44,8 @@ const run = async ({
44
44
 
45
45
  try {
46
46
  if (script === scriptShell) {
47
- const isTTY = !noTTY()
48
-
49
- if (isTTY) {
50
- if (ciDetect()) {
47
+ if (!noTTY()) {
48
+ if (ciInfo.isCI) {
51
49
  return log.warn('exec', 'Interactive mode disabled in CI environment')
52
50
  }
53
51
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libnpmexec",
3
- "version": "5.0.3",
3
+ "version": "5.0.5",
4
4
  "files": [
5
5
  "bin/",
6
6
  "lib/"
@@ -51,17 +51,20 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@npmcli/eslint-config": "^4.0.0",
54
- "@npmcli/template-oss": "4.9.0",
54
+ "@npmcli/mock-registry": "^1.0.0",
55
+ "@npmcli/template-oss": "4.10.0",
55
56
  "bin-links": "^4.0.1",
57
+ "just-extend": "^6.1.1",
58
+ "just-safe-set": "^4.1.1",
56
59
  "minify-registry-metadata": "^2.2.0",
57
60
  "mkdirp": "^1.0.4",
58
61
  "tap": "^16.0.1"
59
62
  },
60
63
  "dependencies": {
61
- "@npmcli/arborist": "^6.1.2",
62
- "@npmcli/ci-detect": "^3.0.1",
64
+ "@npmcli/arborist": "^6.1.4",
63
65
  "@npmcli/run-script": "^6.0.0",
64
66
  "chalk": "^4.1.0",
67
+ "ci-info": "^3.6.1",
65
68
  "npm-package-arg": "^10.0.0",
66
69
  "npmlog": "^7.0.1",
67
70
  "pacote": "^15.0.2",
@@ -73,7 +76,7 @@
73
76
  },
74
77
  "templateOSS": {
75
78
  "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
76
- "version": "4.9.0",
79
+ "version": "4.10.0",
77
80
  "content": "../../scripts/template-oss/index.js"
78
81
  }
79
82
  }