libnpmexec 10.0.0-pre.1 → 10.1.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/lib/index.js +9 -3
- package/package.json +5 -4
package/lib/index.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const { dirname, resolve } = require('node:path')
|
|
4
|
+
const crypto = require('node:crypto')
|
|
3
5
|
const { mkdir } = require('node:fs/promises')
|
|
4
6
|
const Arborist = require('@npmcli/arborist')
|
|
5
7
|
const ciInfo = require('ci-info')
|
|
6
|
-
const crypto = require('node:crypto')
|
|
7
8
|
const { log, input } = require('proc-log')
|
|
8
9
|
const npa = require('npm-package-arg')
|
|
9
10
|
const pacote = require('pacote')
|
|
10
11
|
const { read } = require('read')
|
|
11
12
|
const semver = require('semver')
|
|
13
|
+
const PackageJson = require('@npmcli/package-json')
|
|
12
14
|
const { fileExists, localFileExists } = require('./file-exists.js')
|
|
13
15
|
const getBinFromManifest = require('./get-bin-from-manifest.js')
|
|
14
16
|
const noTTY = require('./no-tty.js')
|
|
15
17
|
const runScript = require('./run-script.js')
|
|
16
18
|
const isWindows = require('./is-windows.js')
|
|
17
|
-
const { dirname, resolve } = require('node:path')
|
|
18
19
|
|
|
19
20
|
const binPaths = []
|
|
20
21
|
|
|
@@ -37,6 +38,7 @@ const missingFromTree = async ({ spec, tree, flatOptions, isNpxTree, shallow })
|
|
|
37
38
|
// - In local or global mode go with anything in the tree that matches
|
|
38
39
|
// - If looking in the npx cache check if a newer version is available
|
|
39
40
|
const npxByNameOnly = isNpxTree && spec.name === spec.raw
|
|
41
|
+
// If they gave a range and not a tag we still need to check if it's outdated.
|
|
40
42
|
if (spec.registry && spec.type !== 'tag' && !npxByNameOnly) {
|
|
41
43
|
// registry spec that is not a specific tag.
|
|
42
44
|
const nodesBySpec = tree.inventory.query('packageName', spec.name)
|
|
@@ -53,7 +55,8 @@ const missingFromTree = async ({ spec, tree, flatOptions, isNpxTree, shallow })
|
|
|
53
55
|
return { node }
|
|
54
56
|
}
|
|
55
57
|
// package requested by version range, only remaining registry type
|
|
56
|
-
|
|
58
|
+
// the npx tree shouldn't be ok w/ an outdated version
|
|
59
|
+
if (!isNpxTree && semver.satisfies(node.package.version, spec.rawSpec)) {
|
|
57
60
|
return { node }
|
|
58
61
|
}
|
|
59
62
|
}
|
|
@@ -293,6 +296,9 @@ const exec = async (opts) => {
|
|
|
293
296
|
})
|
|
294
297
|
}
|
|
295
298
|
binPaths.push(resolve(installDir, 'node_modules/.bin'))
|
|
299
|
+
const pkgJson = await PackageJson.load(installDir)
|
|
300
|
+
pkgJson.update({ _npx: { packages } })
|
|
301
|
+
await pkgJson.save()
|
|
296
302
|
}
|
|
297
303
|
|
|
298
304
|
return await run()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libnpmexec",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"bin/",
|
|
6
6
|
"lib/"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@npmcli/eslint-config": "^5.0.1",
|
|
54
54
|
"@npmcli/mock-registry": "^1.0.0",
|
|
55
|
-
"@npmcli/template-oss": "4.23.
|
|
55
|
+
"@npmcli/template-oss": "4.23.6",
|
|
56
56
|
"bin-links": "^5.0.0",
|
|
57
57
|
"chalk": "^5.2.0",
|
|
58
58
|
"just-extend": "^6.2.0",
|
|
@@ -60,7 +60,8 @@
|
|
|
60
60
|
"tap": "^16.3.8"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@npmcli/arborist": "^9.0.
|
|
63
|
+
"@npmcli/arborist": "^9.0.1",
|
|
64
|
+
"@npmcli/package-json": "^6.1.1",
|
|
64
65
|
"@npmcli/run-script": "^9.0.1",
|
|
65
66
|
"ci-info": "^4.0.0",
|
|
66
67
|
"npm-package-arg": "^12.0.0",
|
|
@@ -73,7 +74,7 @@
|
|
|
73
74
|
},
|
|
74
75
|
"templateOSS": {
|
|
75
76
|
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
76
|
-
"version": "4.23.
|
|
77
|
+
"version": "4.23.6",
|
|
77
78
|
"content": "../../scripts/template-oss/index.js"
|
|
78
79
|
}
|
|
79
80
|
}
|