pnpm 6.32.2 → 6.32.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/README.md +3 -0
- package/dist/node_modules/.modules.yaml +1 -1
- package/dist/node_modules/.pnpm/lock.yaml +26 -21
- package/dist/node_modules/debug/package.json +1 -1
- package/dist/node_modules/debug/src/common.js +1 -1
- package/dist/node_modules/gauge/lib/index.js +1 -2
- package/dist/node_modules/gauge/package.json +13 -12
- package/dist/node_modules/graceful-fs/LICENSE +1 -1
- package/dist/node_modules/graceful-fs/graceful-fs.js +23 -4
- package/dist/node_modules/graceful-fs/package.json +1 -1
- package/dist/node_modules/graceful-fs/polyfills.js +35 -28
- package/dist/node_modules/semver/bin/semver.js +17 -8
- package/dist/node_modules/semver/classes/comparator.js +3 -2
- package/dist/node_modules/semver/classes/index.js +1 -1
- package/dist/node_modules/semver/classes/range.js +31 -22
- package/dist/node_modules/semver/functions/cmp.js +8 -4
- package/dist/node_modules/semver/functions/coerce.js +3 -2
- package/dist/node_modules/semver/functions/parse.js +1 -1
- package/dist/node_modules/semver/internal/constants.js +2 -2
- package/dist/node_modules/semver/internal/identifiers.js +1 -1
- package/dist/node_modules/semver/internal/parse-options.js +3 -3
- package/dist/node_modules/semver/internal/re.js +3 -3
- package/dist/node_modules/semver/node_modules/lru-cache/LICENSE +15 -0
- package/dist/node_modules/semver/node_modules/lru-cache/index.js +798 -0
- package/dist/node_modules/semver/node_modules/lru-cache/package.json +44 -0
- package/dist/node_modules/semver/package.json +46 -13
- package/dist/node_modules/semver/ranges/min-version.js +2 -1
- package/dist/node_modules/semver/ranges/outside.js +1 -1
- package/dist/node_modules/semver/ranges/simplify.js +15 -12
- package/dist/node_modules/semver/ranges/subset.js +53 -31
- package/dist/pnpm.cjs +1010 -1051
- package/package.json +15 -15
- package/dist/node_modules/gauge/lib/demo.js +0 -45
package/README.md
CHANGED
|
@@ -41,6 +41,9 @@ To quote the [Rush](https://rushjs.io/) team:
|
|
|
41
41
|
<td align="center" valign="middle">
|
|
42
42
|
<a href="https://leniolabs.com" target="_blank"><img src="https://raw.githubusercontent.com/pnpm/pnpm.github.io/main/static/img/users/leniolabs.jpg" width="80"></a>
|
|
43
43
|
</td>
|
|
44
|
+
<td align="center" valign="middle">
|
|
45
|
+
<a href="https://vercel.com" target="_blank"><img src="https://raw.githubusercontent.com/pnpm/pnpm.github.io/main/static/img/users/vercel.svg" width="180"></a>
|
|
46
|
+
</td>
|
|
44
47
|
</tr>
|
|
45
48
|
</tbody>
|
|
46
49
|
</table>
|
|
@@ -17,7 +17,7 @@ packages:
|
|
|
17
17
|
resolution: {integrity: sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==}
|
|
18
18
|
dependencies:
|
|
19
19
|
'@gar/promisify': 1.1.3
|
|
20
|
-
semver: 7.3.
|
|
20
|
+
semver: 7.3.6
|
|
21
21
|
dev: false
|
|
22
22
|
optional: true
|
|
23
23
|
|
|
@@ -45,7 +45,7 @@ packages:
|
|
|
45
45
|
resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
|
|
46
46
|
engines: {node: '>= 6.0.0'}
|
|
47
47
|
dependencies:
|
|
48
|
-
debug: 4.3.
|
|
48
|
+
debug: 4.3.4
|
|
49
49
|
transitivePeerDependencies:
|
|
50
50
|
- supports-color
|
|
51
51
|
dev: false
|
|
@@ -55,7 +55,7 @@ packages:
|
|
|
55
55
|
resolution: {integrity: sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==}
|
|
56
56
|
engines: {node: '>= 8.0.0'}
|
|
57
57
|
dependencies:
|
|
58
|
-
debug: 4.3.
|
|
58
|
+
debug: 4.3.4
|
|
59
59
|
depd: 1.1.2
|
|
60
60
|
humanize-ms: 1.2.1
|
|
61
61
|
transitivePeerDependencies:
|
|
@@ -158,8 +158,8 @@ packages:
|
|
|
158
158
|
dev: false
|
|
159
159
|
optional: true
|
|
160
160
|
|
|
161
|
-
/debug/4.3.
|
|
162
|
-
resolution: {integrity: sha512
|
|
161
|
+
/debug/4.3.4:
|
|
162
|
+
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
|
|
163
163
|
engines: {node: '>=6.0'}
|
|
164
164
|
peerDependencies:
|
|
165
165
|
supports-color: '*'
|
|
@@ -219,11 +219,10 @@ packages:
|
|
|
219
219
|
dev: false
|
|
220
220
|
optional: true
|
|
221
221
|
|
|
222
|
-
/gauge/4.0.
|
|
223
|
-
resolution: {integrity: sha512-
|
|
224
|
-
engines: {node: ^12.13.0 || ^14.15.0 || >=16}
|
|
222
|
+
/gauge/4.0.4:
|
|
223
|
+
resolution: {integrity: sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==}
|
|
224
|
+
engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
|
|
225
225
|
dependencies:
|
|
226
|
-
ansi-regex: 5.0.1
|
|
227
226
|
aproba: 2.0.0
|
|
228
227
|
color-support: 1.1.3
|
|
229
228
|
console-control-strings: 1.1.0
|
|
@@ -247,8 +246,8 @@ packages:
|
|
|
247
246
|
dev: false
|
|
248
247
|
optional: true
|
|
249
248
|
|
|
250
|
-
/graceful-fs/4.2.
|
|
251
|
-
resolution: {integrity: sha512-
|
|
249
|
+
/graceful-fs/4.2.10:
|
|
250
|
+
resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==}
|
|
252
251
|
dev: false
|
|
253
252
|
optional: true
|
|
254
253
|
|
|
@@ -268,7 +267,7 @@ packages:
|
|
|
268
267
|
dependencies:
|
|
269
268
|
'@tootallnate/once': 1.1.2
|
|
270
269
|
agent-base: 6.0.2
|
|
271
|
-
debug: 4.3.
|
|
270
|
+
debug: 4.3.4
|
|
272
271
|
transitivePeerDependencies:
|
|
273
272
|
- supports-color
|
|
274
273
|
dev: false
|
|
@@ -279,7 +278,7 @@ packages:
|
|
|
279
278
|
engines: {node: '>= 6'}
|
|
280
279
|
dependencies:
|
|
281
280
|
agent-base: 6.0.2
|
|
282
|
-
debug: 4.3.
|
|
281
|
+
debug: 4.3.4
|
|
283
282
|
transitivePeerDependencies:
|
|
284
283
|
- supports-color
|
|
285
284
|
dev: false
|
|
@@ -359,6 +358,12 @@ packages:
|
|
|
359
358
|
dev: false
|
|
360
359
|
optional: true
|
|
361
360
|
|
|
361
|
+
/lru-cache/7.7.3:
|
|
362
|
+
resolution: {integrity: sha512-WY9wjJNQt9+PZilnLbuFKM+SwDull9+6IAguOrarOMoOHTcJ9GnXSO11+Gw6c7xtDkBkthR57OZMtZKYr+1CEw==}
|
|
363
|
+
engines: {node: '>=12'}
|
|
364
|
+
dev: false
|
|
365
|
+
optional: true
|
|
366
|
+
|
|
362
367
|
/make-fetch-happen/9.1.0:
|
|
363
368
|
resolution: {integrity: sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==}
|
|
364
369
|
engines: {node: '>= 10'}
|
|
@@ -483,12 +488,12 @@ packages:
|
|
|
483
488
|
dependencies:
|
|
484
489
|
env-paths: 2.2.1
|
|
485
490
|
glob: 7.2.0
|
|
486
|
-
graceful-fs: 4.2.
|
|
491
|
+
graceful-fs: 4.2.10
|
|
487
492
|
make-fetch-happen: 9.1.0
|
|
488
493
|
nopt: 5.0.0
|
|
489
494
|
npmlog: 6.0.1
|
|
490
495
|
rimraf: 3.0.2
|
|
491
|
-
semver: 7.3.
|
|
496
|
+
semver: 7.3.6
|
|
492
497
|
tar: 6.1.11
|
|
493
498
|
which: 2.0.2
|
|
494
499
|
transitivePeerDependencies:
|
|
@@ -511,7 +516,7 @@ packages:
|
|
|
511
516
|
dependencies:
|
|
512
517
|
are-we-there-yet: 3.0.0
|
|
513
518
|
console-control-strings: 1.1.0
|
|
514
|
-
gauge: 4.0.
|
|
519
|
+
gauge: 4.0.4
|
|
515
520
|
set-blocking: 2.0.0
|
|
516
521
|
dev: false
|
|
517
522
|
optional: true
|
|
@@ -585,12 +590,12 @@ packages:
|
|
|
585
590
|
dev: false
|
|
586
591
|
optional: true
|
|
587
592
|
|
|
588
|
-
/semver/7.3.
|
|
589
|
-
resolution: {integrity: sha512-
|
|
590
|
-
engines: {node:
|
|
593
|
+
/semver/7.3.6:
|
|
594
|
+
resolution: {integrity: sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==}
|
|
595
|
+
engines: {node: ^10.0.0 || ^12.0.0 || ^14.0.0 || >=16.0.0}
|
|
591
596
|
hasBin: true
|
|
592
597
|
dependencies:
|
|
593
|
-
lru-cache:
|
|
598
|
+
lru-cache: 7.7.3
|
|
594
599
|
dev: false
|
|
595
600
|
optional: true
|
|
596
601
|
|
|
@@ -615,7 +620,7 @@ packages:
|
|
|
615
620
|
engines: {node: '>= 10'}
|
|
616
621
|
dependencies:
|
|
617
622
|
agent-base: 6.0.2
|
|
618
|
-
debug: 4.3.
|
|
623
|
+
debug: 4.3.4
|
|
619
624
|
socks: 2.6.2
|
|
620
625
|
transitivePeerDependencies:
|
|
621
626
|
- supports-color
|
|
@@ -179,7 +179,7 @@ function setup(env) {
|
|
|
179
179
|
namespaces = split[i].replace(/\*/g, '.*?');
|
|
180
180
|
|
|
181
181
|
if (namespaces[0] === '-') {
|
|
182
|
-
createDebug.skips.push(new RegExp('^' + namespaces.
|
|
182
|
+
createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
|
|
183
183
|
} else {
|
|
184
184
|
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
|
185
185
|
}
|
|
@@ -91,8 +91,7 @@ Gauge.prototype._computeTheme = function (theme) {
|
|
|
91
91
|
if (typeof theme === 'string') {
|
|
92
92
|
theme = this._themes.getTheme(theme)
|
|
93
93
|
} else if (
|
|
94
|
-
theme
|
|
95
|
-
(Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null)
|
|
94
|
+
Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null
|
|
96
95
|
) {
|
|
97
96
|
var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode
|
|
98
97
|
var useColor = theme.hasColor == null ? hasColor : theme.hasColor
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gauge",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "A terminal based horizontal gauge",
|
|
5
5
|
"main": "lib",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "tap",
|
|
8
|
-
"lint": "eslint
|
|
9
|
-
"postlint": "
|
|
8
|
+
"lint": "eslint \"**/*.js\"",
|
|
9
|
+
"postlint": "template-oss-check",
|
|
10
10
|
"lintfix": "npm run lint -- --fix",
|
|
11
11
|
"preversion": "npm test",
|
|
12
12
|
"postversion": "npm publish",
|
|
13
13
|
"prepublishOnly": "git push origin --follow-tags",
|
|
14
14
|
"snap": "tap",
|
|
15
15
|
"posttest": "npm run lint",
|
|
16
|
-
"template-
|
|
16
|
+
"template-oss-apply": "template-oss-apply --force"
|
|
17
17
|
},
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "https://github.com/npm/gauge"
|
|
20
|
+
"url": "https://github.com/npm/gauge.git"
|
|
21
21
|
},
|
|
22
22
|
"keywords": [
|
|
23
23
|
"progressbar",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/npm/gauge",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"ansi-regex": "^5.0.1",
|
|
35
34
|
"aproba": "^1.0.3 || ^2.0.0",
|
|
36
35
|
"color-support": "^1.1.3",
|
|
37
36
|
"console-control-strings": "^1.1.0",
|
|
@@ -42,16 +41,17 @@
|
|
|
42
41
|
"wide-align": "^1.1.5"
|
|
43
42
|
},
|
|
44
43
|
"devDependencies": {
|
|
45
|
-
"@npmcli/
|
|
44
|
+
"@npmcli/eslint-config": "^3.0.1",
|
|
45
|
+
"@npmcli/template-oss": "3.2.0",
|
|
46
46
|
"readable-stream": "^3.6.0",
|
|
47
|
-
"tap": "^
|
|
47
|
+
"tap": "^16.0.1"
|
|
48
48
|
},
|
|
49
49
|
"files": [
|
|
50
|
-
"bin",
|
|
51
|
-
"lib"
|
|
50
|
+
"bin/",
|
|
51
|
+
"lib/"
|
|
52
52
|
],
|
|
53
53
|
"engines": {
|
|
54
|
-
"node": "^12.13.0 || ^14.15.0 || >=16"
|
|
54
|
+
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
|
|
55
55
|
},
|
|
56
56
|
"tap": {
|
|
57
57
|
"branches": 79,
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"lines": 90
|
|
61
61
|
},
|
|
62
62
|
"templateOSS": {
|
|
63
|
-
"
|
|
63
|
+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
64
|
+
"version": "3.2.0"
|
|
64
65
|
}
|
|
65
66
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The ISC License
|
|
2
2
|
|
|
3
|
-
Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors
|
|
3
|
+
Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors
|
|
4
4
|
|
|
5
5
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
6
|
purpose with or without fee is hereby granted, provided that the above
|
|
@@ -191,16 +191,35 @@ function patch (fs) {
|
|
|
191
191
|
|
|
192
192
|
var fs$readdir = fs.readdir
|
|
193
193
|
fs.readdir = readdir
|
|
194
|
+
var noReaddirOptionVersions = /^v[0-5]\./
|
|
194
195
|
function readdir (path, options, cb) {
|
|
195
196
|
if (typeof options === 'function')
|
|
196
197
|
cb = options, options = null
|
|
197
198
|
|
|
199
|
+
var go$readdir = noReaddirOptionVersions.test(process.version)
|
|
200
|
+
? function go$readdir (path, options, cb, startTime) {
|
|
201
|
+
return fs$readdir(path, fs$readdirCallback(
|
|
202
|
+
path, options, cb, startTime
|
|
203
|
+
))
|
|
204
|
+
}
|
|
205
|
+
: function go$readdir (path, options, cb, startTime) {
|
|
206
|
+
return fs$readdir(path, options, fs$readdirCallback(
|
|
207
|
+
path, options, cb, startTime
|
|
208
|
+
))
|
|
209
|
+
}
|
|
210
|
+
|
|
198
211
|
return go$readdir(path, options, cb)
|
|
199
212
|
|
|
200
|
-
function
|
|
201
|
-
return
|
|
213
|
+
function fs$readdirCallback (path, options, cb, startTime) {
|
|
214
|
+
return function (err, files) {
|
|
202
215
|
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
|
|
203
|
-
enqueue([
|
|
216
|
+
enqueue([
|
|
217
|
+
go$readdir,
|
|
218
|
+
[path, options, cb],
|
|
219
|
+
err,
|
|
220
|
+
startTime || Date.now(),
|
|
221
|
+
Date.now()
|
|
222
|
+
])
|
|
204
223
|
else {
|
|
205
224
|
if (files && files.sort)
|
|
206
225
|
files.sort()
|
|
@@ -208,7 +227,7 @@ function patch (fs) {
|
|
|
208
227
|
if (typeof cb === 'function')
|
|
209
228
|
cb.call(this, err, files)
|
|
210
229
|
}
|
|
211
|
-
}
|
|
230
|
+
}
|
|
212
231
|
}
|
|
213
232
|
}
|
|
214
233
|
|
|
@@ -71,13 +71,13 @@ function patch (fs) {
|
|
|
71
71
|
fs.lstatSync = statFixSync(fs.lstatSync)
|
|
72
72
|
|
|
73
73
|
// if lchmod/lchown do not exist, then make them no-ops
|
|
74
|
-
if (!fs.lchmod) {
|
|
74
|
+
if (fs.chmod && !fs.lchmod) {
|
|
75
75
|
fs.lchmod = function (path, mode, cb) {
|
|
76
76
|
if (cb) process.nextTick(cb)
|
|
77
77
|
}
|
|
78
78
|
fs.lchmodSync = function () {}
|
|
79
79
|
}
|
|
80
|
-
if (!fs.lchown) {
|
|
80
|
+
if (fs.chown && !fs.lchown) {
|
|
81
81
|
fs.lchown = function (path, uid, gid, cb) {
|
|
82
82
|
if (cb) process.nextTick(cb)
|
|
83
83
|
}
|
|
@@ -94,32 +94,38 @@ function patch (fs) {
|
|
|
94
94
|
// CPU to a busy looping process, which can cause the program causing the lock
|
|
95
95
|
// contention to be starved of CPU by node, so the contention doesn't resolve.
|
|
96
96
|
if (platform === "win32") {
|
|
97
|
-
fs.rename =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
backoff
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
97
|
+
fs.rename = typeof fs.rename !== 'function' ? fs.rename
|
|
98
|
+
: (function (fs$rename) {
|
|
99
|
+
function rename (from, to, cb) {
|
|
100
|
+
var start = Date.now()
|
|
101
|
+
var backoff = 0;
|
|
102
|
+
fs$rename(from, to, function CB (er) {
|
|
103
|
+
if (er
|
|
104
|
+
&& (er.code === "EACCES" || er.code === "EPERM")
|
|
105
|
+
&& Date.now() - start < 60000) {
|
|
106
|
+
setTimeout(function() {
|
|
107
|
+
fs.stat(to, function (stater, st) {
|
|
108
|
+
if (stater && stater.code === "ENOENT")
|
|
109
|
+
fs$rename(from, to, CB);
|
|
110
|
+
else
|
|
111
|
+
cb(er)
|
|
112
|
+
})
|
|
113
|
+
}, backoff)
|
|
114
|
+
if (backoff < 100)
|
|
115
|
+
backoff += 10;
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (cb) cb(er)
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)
|
|
122
|
+
return rename
|
|
123
|
+
})(fs.rename)
|
|
119
124
|
}
|
|
120
125
|
|
|
121
126
|
// if read() returns EAGAIN, then just try it again.
|
|
122
|
-
fs.read =
|
|
127
|
+
fs.read = typeof fs.read !== 'function' ? fs.read
|
|
128
|
+
: (function (fs$read) {
|
|
123
129
|
function read (fd, buffer, offset, length, position, callback_) {
|
|
124
130
|
var callback
|
|
125
131
|
if (callback_ && typeof callback_ === 'function') {
|
|
@@ -140,7 +146,8 @@ function patch (fs) {
|
|
|
140
146
|
return read
|
|
141
147
|
})(fs.read)
|
|
142
148
|
|
|
143
|
-
fs.readSync =
|
|
149
|
+
fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync
|
|
150
|
+
: (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
|
|
144
151
|
var eagCounter = 0
|
|
145
152
|
while (true) {
|
|
146
153
|
try {
|
|
@@ -199,7 +206,7 @@ function patch (fs) {
|
|
|
199
206
|
}
|
|
200
207
|
|
|
201
208
|
function patchLutimes (fs) {
|
|
202
|
-
if (constants.hasOwnProperty("O_SYMLINK")) {
|
|
209
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
|
|
203
210
|
fs.lutimes = function (path, at, mt, cb) {
|
|
204
211
|
fs.open(path, constants.O_SYMLINK, function (er, fd) {
|
|
205
212
|
if (er) {
|
|
@@ -233,7 +240,7 @@ function patch (fs) {
|
|
|
233
240
|
return ret
|
|
234
241
|
}
|
|
235
242
|
|
|
236
|
-
} else {
|
|
243
|
+
} else if (fs.futimes) {
|
|
237
244
|
fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
|
|
238
245
|
fs.lutimesSync = function () {}
|
|
239
246
|
}
|
|
@@ -27,10 +27,12 @@ const semver = require('../')
|
|
|
27
27
|
|
|
28
28
|
let reverse = false
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
let options = {}
|
|
31
31
|
|
|
32
32
|
const main = () => {
|
|
33
|
-
if (!argv.length)
|
|
33
|
+
if (!argv.length) {
|
|
34
|
+
return help()
|
|
35
|
+
}
|
|
34
36
|
while (argv.length) {
|
|
35
37
|
let a = argv.shift()
|
|
36
38
|
const indexOfEqualSign = a.indexOf('=')
|
|
@@ -85,26 +87,31 @@ const main = () => {
|
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
89
|
|
|
88
|
-
|
|
90
|
+
options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl }
|
|
89
91
|
|
|
90
92
|
versions = versions.map((v) => {
|
|
91
93
|
return coerce ? (semver.coerce(v, options) || { version: v }).version : v
|
|
92
94
|
}).filter((v) => {
|
|
93
95
|
return semver.valid(v)
|
|
94
96
|
})
|
|
95
|
-
if (!versions.length)
|
|
96
|
-
|
|
97
|
+
if (!versions.length) {
|
|
98
|
+
return fail()
|
|
99
|
+
}
|
|
100
|
+
if (inc && (versions.length !== 1 || range.length)) {
|
|
101
|
+
return failInc()
|
|
102
|
+
}
|
|
97
103
|
|
|
98
104
|
for (let i = 0, l = range.length; i < l; i++) {
|
|
99
105
|
versions = versions.filter((v) => {
|
|
100
106
|
return semver.satisfies(v, range[i], options)
|
|
101
107
|
})
|
|
102
|
-
if (!versions.length)
|
|
108
|
+
if (!versions.length) {
|
|
109
|
+
return fail()
|
|
110
|
+
}
|
|
103
111
|
}
|
|
104
112
|
return success(versions)
|
|
105
113
|
}
|
|
106
114
|
|
|
107
|
-
|
|
108
115
|
const failInc = () => {
|
|
109
116
|
console.error('--inc can only be used on a single version with no range')
|
|
110
117
|
fail()
|
|
@@ -120,7 +127,9 @@ const success = () => {
|
|
|
120
127
|
return semver.clean(v, options)
|
|
121
128
|
}).map((v) => {
|
|
122
129
|
return inc ? semver.inc(v, inc, options, identifier) : v
|
|
123
|
-
}).forEach((v, i, _) => {
|
|
130
|
+
}).forEach((v, i, _) => {
|
|
131
|
+
console.log(v)
|
|
132
|
+
})
|
|
124
133
|
}
|
|
125
134
|
|
|
126
135
|
const help = () => console.log(
|
|
@@ -4,6 +4,7 @@ class Comparator {
|
|
|
4
4
|
static get ANY () {
|
|
5
5
|
return ANY
|
|
6
6
|
}
|
|
7
|
+
|
|
7
8
|
constructor (comp, options) {
|
|
8
9
|
options = parseOptions(options)
|
|
9
10
|
|
|
@@ -80,7 +81,7 @@ class Comparator {
|
|
|
80
81
|
if (!options || typeof options !== 'object') {
|
|
81
82
|
options = {
|
|
82
83
|
loose: !!options,
|
|
83
|
-
includePrerelease: false
|
|
84
|
+
includePrerelease: false,
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
|
|
@@ -128,7 +129,7 @@ class Comparator {
|
|
|
128
129
|
module.exports = Comparator
|
|
129
130
|
|
|
130
131
|
const parseOptions = require('../internal/parse-options')
|
|
131
|
-
const {re, t} = require('../internal/re')
|
|
132
|
+
const { re, t } = require('../internal/re')
|
|
132
133
|
const cmp = require('../functions/cmp')
|
|
133
134
|
const debug = require('../internal/debug')
|
|
134
135
|
const SemVer = require('./semver')
|
|
@@ -29,9 +29,9 @@ class Range {
|
|
|
29
29
|
// First, split based on boolean or ||
|
|
30
30
|
this.raw = range
|
|
31
31
|
this.set = range
|
|
32
|
-
.split(
|
|
32
|
+
.split('||')
|
|
33
33
|
// map the range to a 2d array of comparators
|
|
34
|
-
.map(
|
|
34
|
+
.map(r => this.parseRange(r.trim()))
|
|
35
35
|
// throw out any comparator lists that are empty
|
|
36
36
|
// this generally means that it was not a valid range, which is allowed
|
|
37
37
|
// in loose mode, but will still throw if the WHOLE range is invalid.
|
|
@@ -46,9 +46,9 @@ class Range {
|
|
|
46
46
|
// keep the first one, in case they're all null sets
|
|
47
47
|
const first = this.set[0]
|
|
48
48
|
this.set = this.set.filter(c => !isNullSet(c[0]))
|
|
49
|
-
if (this.set.length === 0)
|
|
49
|
+
if (this.set.length === 0) {
|
|
50
50
|
this.set = [first]
|
|
51
|
-
else if (this.set.length > 1) {
|
|
51
|
+
} else if (this.set.length > 1) {
|
|
52
52
|
// if we have any that are *, then the range is just *
|
|
53
53
|
for (const c of this.set) {
|
|
54
54
|
if (c.length === 1 && isAny(c[0])) {
|
|
@@ -84,8 +84,9 @@ class Range {
|
|
|
84
84
|
const memoOpts = Object.keys(this.options).join(',')
|
|
85
85
|
const memoKey = `parseRange:${memoOpts}:${range}`
|
|
86
86
|
const cached = cache.get(memoKey)
|
|
87
|
-
if (cached)
|
|
87
|
+
if (cached) {
|
|
88
88
|
return cached
|
|
89
|
+
}
|
|
89
90
|
|
|
90
91
|
const loose = this.options.loose
|
|
91
92
|
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
|
@@ -94,7 +95,7 @@ class Range {
|
|
|
94
95
|
debug('hyphen replace', range)
|
|
95
96
|
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
|
96
97
|
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
|
|
97
|
-
debug('comparator trim', range
|
|
98
|
+
debug('comparator trim', range)
|
|
98
99
|
|
|
99
100
|
// `~ 1.2.3` => `~1.2.3`
|
|
100
101
|
range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
|
|
@@ -108,30 +109,37 @@ class Range {
|
|
|
108
109
|
// At this point, the range is completely trimmed and
|
|
109
110
|
// ready to be split into comparators.
|
|
110
111
|
|
|
111
|
-
|
|
112
|
-
const rangeList = range
|
|
112
|
+
let rangeList = range
|
|
113
113
|
.split(' ')
|
|
114
114
|
.map(comp => parseComparator(comp, this.options))
|
|
115
115
|
.join(' ')
|
|
116
116
|
.split(/\s+/)
|
|
117
117
|
// >=0.0.0 is equivalent to *
|
|
118
118
|
.map(comp => replaceGTE0(comp, this.options))
|
|
119
|
+
|
|
120
|
+
if (loose) {
|
|
119
121
|
// in loose mode, throw out any that are not valid comparators
|
|
120
|
-
.filter(
|
|
121
|
-
|
|
122
|
+
rangeList = rangeList.filter(comp => {
|
|
123
|
+
debug('loose invalid filter', comp, this.options)
|
|
124
|
+
return !!comp.match(re[t.COMPARATORLOOSE])
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
debug('range list', rangeList)
|
|
122
128
|
|
|
123
129
|
// if any comparators are the null set, then replace with JUST null set
|
|
124
130
|
// if more than one comparator, remove any * comparators
|
|
125
131
|
// also, don't include the same comparator more than once
|
|
126
|
-
const l = rangeList.length
|
|
127
132
|
const rangeMap = new Map()
|
|
128
|
-
|
|
129
|
-
|
|
133
|
+
const comparators = rangeList.map(comp => new Comparator(comp, this.options))
|
|
134
|
+
for (const comp of comparators) {
|
|
135
|
+
if (isNullSet(comp)) {
|
|
130
136
|
return [comp]
|
|
137
|
+
}
|
|
131
138
|
rangeMap.set(comp.value, comp)
|
|
132
139
|
}
|
|
133
|
-
if (rangeMap.size > 1 && rangeMap.has(''))
|
|
140
|
+
if (rangeMap.size > 1 && rangeMap.has('')) {
|
|
134
141
|
rangeMap.delete('')
|
|
142
|
+
}
|
|
135
143
|
|
|
136
144
|
const result = [...rangeMap.values()]
|
|
137
145
|
cache.set(memoKey, result)
|
|
@@ -196,7 +204,7 @@ const {
|
|
|
196
204
|
t,
|
|
197
205
|
comparatorTrimReplace,
|
|
198
206
|
tildeTrimReplace,
|
|
199
|
-
caretTrimReplace
|
|
207
|
+
caretTrimReplace,
|
|
200
208
|
} = require('../internal/re')
|
|
201
209
|
|
|
202
210
|
const isNullSet = c => c.value === '<0.0.0-0'
|
|
@@ -245,8 +253,8 @@ const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
|
|
|
245
253
|
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
|
|
246
254
|
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
|
|
247
255
|
const replaceTildes = (comp, options) =>
|
|
248
|
-
comp.trim().split(/\s+/).map((
|
|
249
|
-
return replaceTilde(
|
|
256
|
+
comp.trim().split(/\s+/).map((c) => {
|
|
257
|
+
return replaceTilde(c, options)
|
|
250
258
|
}).join(' ')
|
|
251
259
|
|
|
252
260
|
const replaceTilde = (comp, options) => {
|
|
@@ -284,8 +292,8 @@ const replaceTilde = (comp, options) => {
|
|
|
284
292
|
// ^1.2.3 --> >=1.2.3 <2.0.0-0
|
|
285
293
|
// ^1.2.0 --> >=1.2.0 <2.0.0-0
|
|
286
294
|
const replaceCarets = (comp, options) =>
|
|
287
|
-
comp.trim().split(/\s+/).map((
|
|
288
|
-
return replaceCaret(
|
|
295
|
+
comp.trim().split(/\s+/).map((c) => {
|
|
296
|
+
return replaceCaret(c, options)
|
|
289
297
|
}).join(' ')
|
|
290
298
|
|
|
291
299
|
const replaceCaret = (comp, options) => {
|
|
@@ -343,8 +351,8 @@ const replaceCaret = (comp, options) => {
|
|
|
343
351
|
|
|
344
352
|
const replaceXRanges = (comp, options) => {
|
|
345
353
|
debug('replaceXRanges', comp, options)
|
|
346
|
-
return comp.split(/\s+/).map((
|
|
347
|
-
return replaceXRange(
|
|
354
|
+
return comp.split(/\s+/).map((c) => {
|
|
355
|
+
return replaceXRange(c, options)
|
|
348
356
|
}).join(' ')
|
|
349
357
|
}
|
|
350
358
|
|
|
@@ -405,8 +413,9 @@ const replaceXRange = (comp, options) => {
|
|
|
405
413
|
}
|
|
406
414
|
}
|
|
407
415
|
|
|
408
|
-
if (gtlt === '<')
|
|
416
|
+
if (gtlt === '<') {
|
|
409
417
|
pr = '-0'
|
|
418
|
+
}
|
|
410
419
|
|
|
411
420
|
ret = `${gtlt + M}.${m}.${p}${pr}`
|
|
412
421
|
} else if (xm) {
|