update-versions 6.0.14 → 6.0.16
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/cli.js +26 -26
- package/package.json +6 -6
package/cli.js
CHANGED
|
@@ -42,7 +42,7 @@ const cli = meow(
|
|
|
42
42
|
`,
|
|
43
43
|
{
|
|
44
44
|
importMeta: import.meta,
|
|
45
|
-
}
|
|
45
|
+
},
|
|
46
46
|
);
|
|
47
47
|
updateNotifier({ pkg }).notify();
|
|
48
48
|
|
|
@@ -101,7 +101,7 @@ if (cli.flags) {
|
|
|
101
101
|
let online = await isOnline();
|
|
102
102
|
if (!online) {
|
|
103
103
|
console.error(
|
|
104
|
-
`\n${messagePrefix}${`\u001b[${31}m${"Please check your internet connection."}\u001b[${39}m`}\n
|
|
104
|
+
`\n${messagePrefix}${`\u001b[${31}m${"Please check your internet connection."}\u001b[${39}m`}\n`,
|
|
105
105
|
);
|
|
106
106
|
process.exit(1);
|
|
107
107
|
}
|
|
@@ -111,7 +111,7 @@ if (cli.flags) {
|
|
|
111
111
|
newConfig = JSON.parse(readFileSync(confLocation, "utf8"));
|
|
112
112
|
} catch (err) {
|
|
113
113
|
console.log(
|
|
114
|
-
`\n${messagePrefix}${`\u001b[${90}m${"No config found, moving on."}\u001b[${39}m`}\n
|
|
114
|
+
`\n${messagePrefix}${`\u001b[${90}m${"No config found, moving on."}\u001b[${39}m`}\n`,
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -135,7 +135,7 @@ if (cli.flags) {
|
|
|
135
135
|
})
|
|
136
136
|
.catch((err) => {
|
|
137
137
|
log(
|
|
138
|
-
`${messagePrefix}${`\u001b[${31}m${`Couldn't read and parse the package.json at "${currentPath}": (${err})`}\u001b[${39}m`}
|
|
138
|
+
`${messagePrefix}${`\u001b[${31}m${`Couldn't read and parse the package.json at "${currentPath}": (${err})`}\u001b[${39}m`}`,
|
|
139
139
|
);
|
|
140
140
|
return mapReceived;
|
|
141
141
|
}),
|
|
@@ -145,8 +145,8 @@ if (cli.flags) {
|
|
|
145
145
|
pathsByName: {},
|
|
146
146
|
contentsObj: {},
|
|
147
147
|
contentsStr: {},
|
|
148
|
-
}
|
|
149
|
-
)
|
|
148
|
+
},
|
|
149
|
+
),
|
|
150
150
|
);
|
|
151
151
|
|
|
152
152
|
let allProgressPromise = PProgress.all(
|
|
@@ -165,7 +165,7 @@ if (cli.flags) {
|
|
|
165
165
|
).concat(
|
|
166
166
|
isPlainObject(parsedContents.devDependencies)
|
|
167
167
|
? Object.keys(parsedContents.devDependencies)
|
|
168
|
-
: []
|
|
168
|
+
: [],
|
|
169
169
|
);
|
|
170
170
|
|
|
171
171
|
//
|
|
@@ -209,7 +209,7 @@ if (cli.flags) {
|
|
|
209
209
|
.then((pkg1) => {
|
|
210
210
|
if (pkg1.version === null) {
|
|
211
211
|
throw new Error(
|
|
212
|
-
`${messagePrefix}${singleDepName} version from npm came as null, CLI will exit now, nothing was written
|
|
212
|
+
`${messagePrefix}${singleDepName} version from npm came as null, CLI will exit now, nothing was written.`,
|
|
213
213
|
);
|
|
214
214
|
} else {
|
|
215
215
|
compiledDepNameVersionPairs[singleDepName] = pkg1.version;
|
|
@@ -226,7 +226,7 @@ if (cli.flags) {
|
|
|
226
226
|
// no response from npm
|
|
227
227
|
compiledDepNameVersionPairs[singleDepName] = null;
|
|
228
228
|
}
|
|
229
|
-
})
|
|
229
|
+
}),
|
|
230
230
|
);
|
|
231
231
|
allProgressPromise2.onProgress((val) => {
|
|
232
232
|
// console.log(
|
|
@@ -277,12 +277,12 @@ if (cli.flags) {
|
|
|
277
277
|
return false;
|
|
278
278
|
}
|
|
279
279
|
return true;
|
|
280
|
-
}
|
|
280
|
+
},
|
|
281
281
|
);
|
|
282
282
|
parsedContents.lect.various.devDependencies = newVal;
|
|
283
283
|
finalContents = del(
|
|
284
284
|
finalContents,
|
|
285
|
-
`lect.various.devDependencies.${foundIdx}
|
|
285
|
+
`lect.various.devDependencies.${foundIdx}`,
|
|
286
286
|
);
|
|
287
287
|
}
|
|
288
288
|
|
|
@@ -302,13 +302,13 @@ if (cli.flags) {
|
|
|
302
302
|
finalContents = set(
|
|
303
303
|
finalContents,
|
|
304
304
|
`dependencies.${singleDepName}`,
|
|
305
|
-
newConfig.pin[singleDepName]
|
|
305
|
+
newConfig.pin[singleDepName],
|
|
306
306
|
);
|
|
307
307
|
amended = true;
|
|
308
308
|
if (
|
|
309
309
|
!Object.prototype.hasOwnProperty.call(
|
|
310
310
|
updatedPackages,
|
|
311
|
-
singleDepName
|
|
311
|
+
singleDepName,
|
|
312
312
|
)
|
|
313
313
|
) {
|
|
314
314
|
updatedPackages[singleDepName] = newConfig.pin[singleDepName];
|
|
@@ -326,13 +326,13 @@ if (cli.flags) {
|
|
|
326
326
|
finalContents = set(
|
|
327
327
|
finalContents,
|
|
328
328
|
`dependencies.${singleDepName}`,
|
|
329
|
-
`${workspacePrefix}^${compiledDepNameVersionPairs[singleDepName]}
|
|
329
|
+
`${workspacePrefix}^${compiledDepNameVersionPairs[singleDepName]}`,
|
|
330
330
|
);
|
|
331
331
|
amended = true;
|
|
332
332
|
if (
|
|
333
333
|
!Object.prototype.hasOwnProperty.call(
|
|
334
334
|
updatedPackages,
|
|
335
|
-
singleDepName
|
|
335
|
+
singleDepName,
|
|
336
336
|
)
|
|
337
337
|
) {
|
|
338
338
|
updatedPackages[singleDepName] =
|
|
@@ -374,7 +374,7 @@ if (cli.flags) {
|
|
|
374
374
|
// 1. delete devdep entry on JSON string
|
|
375
375
|
finalContents = del(
|
|
376
376
|
finalContents,
|
|
377
|
-
`devDependencies.${depName}
|
|
377
|
+
`devDependencies.${depName}`,
|
|
378
378
|
);
|
|
379
379
|
// 2. delete the devdep from parsedContents.devDependencies
|
|
380
380
|
// key array which will be used to traverse in the loop later
|
|
@@ -398,13 +398,13 @@ if (cli.flags) {
|
|
|
398
398
|
finalContents = set(
|
|
399
399
|
finalContents,
|
|
400
400
|
`dependencies.${singleDepName}`,
|
|
401
|
-
newConfig.pin[singleDepName]
|
|
401
|
+
newConfig.pin[singleDepName],
|
|
402
402
|
);
|
|
403
403
|
amended = true;
|
|
404
404
|
if (
|
|
405
405
|
!Object.prototype.hasOwnProperty.call(
|
|
406
406
|
updatedPackages,
|
|
407
|
-
singleDepName
|
|
407
|
+
singleDepName,
|
|
408
408
|
)
|
|
409
409
|
) {
|
|
410
410
|
updatedPackages[singleDepName] = newConfig.pin[singleDepName];
|
|
@@ -422,7 +422,7 @@ if (cli.flags) {
|
|
|
422
422
|
finalContents = set(
|
|
423
423
|
finalContents,
|
|
424
424
|
`devDependencies.${singleDepName}`,
|
|
425
|
-
`${workspacePrefix}^${compiledDepNameVersionPairs[singleDepName]}
|
|
425
|
+
`${workspacePrefix}^${compiledDepNameVersionPairs[singleDepName]}`,
|
|
426
426
|
);
|
|
427
427
|
amended = true;
|
|
428
428
|
|
|
@@ -430,7 +430,7 @@ if (cli.flags) {
|
|
|
430
430
|
if (
|
|
431
431
|
!Object.prototype.hasOwnProperty.call(
|
|
432
432
|
updatedPackages,
|
|
433
|
-
singleDepName
|
|
433
|
+
singleDepName,
|
|
434
434
|
)
|
|
435
435
|
) {
|
|
436
436
|
updatedPackages[
|
|
@@ -440,7 +440,7 @@ if (cli.flags) {
|
|
|
440
440
|
}
|
|
441
441
|
|
|
442
442
|
progress(
|
|
443
|
-
0.75 + 0.24 * ((totalDeps.length - len2 + y) / totalDeps.length)
|
|
443
|
+
0.75 + 0.24 * ((totalDeps.length - len2 + y) / totalDeps.length),
|
|
444
444
|
);
|
|
445
445
|
}
|
|
446
446
|
}
|
|
@@ -457,12 +457,12 @@ if (cli.flags) {
|
|
|
457
457
|
await write(oneOfPaths, finalContents);
|
|
458
458
|
} catch (e) {
|
|
459
459
|
console.error(
|
|
460
|
-
`${messagePrefix}error happened when writing package.json:\n${e}
|
|
460
|
+
`${messagePrefix}error happened when writing package.json:\n${e}`,
|
|
461
461
|
);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
})
|
|
465
|
-
)
|
|
464
|
+
}),
|
|
465
|
+
),
|
|
466
466
|
);
|
|
467
467
|
|
|
468
468
|
allProgressPromise.onProgress((val) =>
|
|
@@ -477,8 +477,8 @@ if (cli.flags) {
|
|
|
477
477
|
Object.keys(updatedPackages).length
|
|
478
478
|
? `updated:\n${printUpdated()}`
|
|
479
479
|
: "done"
|
|
480
|
-
}
|
|
481
|
-
)
|
|
480
|
+
}`,
|
|
481
|
+
),
|
|
482
482
|
);
|
|
483
483
|
diff.pipe(process.stdout);
|
|
484
484
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "update-versions",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.16",
|
|
4
4
|
"description": "Like npm-check-updates but supports Lerna monorepos and enforces strict semver values",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"perf": "exit 0",
|
|
54
54
|
"prep": "echo 'ready'",
|
|
55
55
|
"prettier": "prettier",
|
|
56
|
-
"prettier:format": "npm run prettier -- --write '**/*.{js,md}' --no-error-on-unmatched-pattern --
|
|
56
|
+
"prettier:format": "npm run prettier -- --write '**/*.{js,md}' --no-error-on-unmatched-pattern --log-level 'silent'",
|
|
57
57
|
"pretest": "exit 0",
|
|
58
58
|
"test": "c8 npm run unit && npm run lint",
|
|
59
59
|
"unit": "uvu test"
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"ansi-diff-stream": "^1.2.1",
|
|
79
|
-
"codsen-utils": "^1.
|
|
80
|
-
"edit-package-json": "^0.8.
|
|
81
|
-
"globby": "^13.
|
|
79
|
+
"codsen-utils": "^1.6.1",
|
|
80
|
+
"edit-package-json": "^0.8.15",
|
|
81
|
+
"globby": "^13.2.2",
|
|
82
82
|
"is-online": "^10.0.0",
|
|
83
83
|
"log-update": "^5.0.1",
|
|
84
84
|
"meow": "^12.0.1",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"p-map": "^6.0.0",
|
|
87
87
|
"p-progress": "^0.6.0",
|
|
88
88
|
"p-reduce": "^3.0.0",
|
|
89
|
-
"pacote": "^15.
|
|
89
|
+
"pacote": "^15.2.0",
|
|
90
90
|
"update-notifier": "^6.0.2",
|
|
91
91
|
"write-file-atomic": "^5.0.1"
|
|
92
92
|
},
|