@astrojs/upgrade 0.4.2 → 0.4.3
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/dist/index.js +4 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -330,12 +330,13 @@ var info = async (prefix, text2, version = "") => {
|
|
|
330
330
|
}
|
|
331
331
|
};
|
|
332
332
|
var upgrade = async (packageInfo, text2) => {
|
|
333
|
-
const { name, isMajor = false, targetVersion } = packageInfo;
|
|
333
|
+
const { name, isMajor = false, targetVersion, currentVersion } = packageInfo;
|
|
334
334
|
const bg = isMajor ? (v) => color.bgYellow(color.black(` ${v} `)) : color.green;
|
|
335
335
|
const style = isMajor ? color.yellow : color.green;
|
|
336
336
|
const symbol = isMajor ? "\u25B2" : "\u25CF";
|
|
337
|
+
const fromVersion = currentVersion.replace(/^\D+/, "");
|
|
337
338
|
const toVersion = targetVersion.replace(/^\D+/, "");
|
|
338
|
-
const version = `v${toVersion}`;
|
|
339
|
+
const version = `from v${fromVersion} to v${toVersion}`;
|
|
339
340
|
const length = 12 + name.length + text2.length + version.length;
|
|
340
341
|
if (length > stdout.columns) {
|
|
341
342
|
log(`${" ".repeat(5)} ${style(symbol)} ${name}`);
|
|
@@ -455,7 +456,7 @@ async function install(ctx) {
|
|
|
455
456
|
const majors = [];
|
|
456
457
|
for (const packageInfo of toInstall) {
|
|
457
458
|
const word = ctx.dryRun ? "can" : "will";
|
|
458
|
-
await upgrade(packageInfo, `${word} be updated
|
|
459
|
+
await upgrade(packageInfo, `${word} be updated`);
|
|
459
460
|
if (packageInfo.isMajor) {
|
|
460
461
|
majors.push(packageInfo);
|
|
461
462
|
}
|