Skip to content

Commit

Permalink
Simplifying upgrade message format
Browse files Browse the repository at this point in the history
- Remove 'to' particle from update messages
- Adjusted spacing in version comparison output
- Update tests to match the spacing

Before:
▲  astro can be updated to v1.0.0 → v2.0.0

After:
▲  astro can be updated  v1.0.0 → v2.0.0
  • Loading branch information
gnify committed Dec 15, 2024
1 parent 2e71a3e commit da9b3b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/upgrade/src/actions/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function install(
const majors: PackageInfo[] = [];
for (const packageInfo of toInstall) {
const word = ctx.dryRun ? 'can' : 'will';
await upgrade(packageInfo, `${word} be updated to`);
await upgrade(packageInfo, `${word} be updated`);
if (packageInfo.isMajor) {
majors.push(packageInfo);
}
Expand Down
10 changes: 5 additions & 5 deletions packages/upgrade/test/install.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('install', () => {
],
};
await install(context);
assert.equal(fixture.hasMessage('▲ astro can be updated v1.0.0 → v2.0.0'), true);
assert.equal(fixture.hasMessage('▲ astro can be updated v1.0.0 → v2.0.0'), true);
assert.equal(prompted, true);
assert.equal(exitCode, 0);
assert.equal(fixture.hasMessage('check Be sure to follow the CHANGELOG.'), false);
Expand Down Expand Up @@ -111,7 +111,7 @@ describe('install', () => {
],
};
await install(context);
assert.equal(fixture.hasMessage('▲ astro can be updated v1.0.0 → v2.0.0'), true);
assert.equal(fixture.hasMessage('▲ astro can be updated v1.0.0 → v2.0.0'), true);
assert.equal(prompted, true);
assert.equal(exitCode, undefined);
assert.equal(fixture.hasMessage('check Be sure to follow the CHANGELOG.'), true);
Expand Down Expand Up @@ -149,8 +149,8 @@ describe('install', () => {
],
};
await install(context);
assert.equal(fixture.hasMessage('▲ a can be updated v1.0.0 → v2.0.0'), true);
assert.equal(fixture.hasMessage('▲ b can be updated v6.0.0 → v7.0.0'), true);
assert.equal(fixture.hasMessage('▲ a can be updated v1.0.0 → v2.0.0'), true);
assert.equal(fixture.hasMessage('▲ b can be updated v6.0.0 → v7.0.0'), true);
assert.equal(prompted, true);
assert.equal(exitCode, undefined);
const [changelog, a, b] = fixture.messages().slice(-5);
Expand Down Expand Up @@ -201,7 +201,7 @@ describe('install', () => {
assert.equal(fixture.hasMessage('◼ current is up to date on v1.0.0'), true);
assert.equal(fixture.hasMessage('● patch can be updated v1.0.0 → v1.0.1'), true);
assert.equal(fixture.hasMessage('● minor can be updated v1.0.0 → v1.2.0'), true);
assert.equal(fixture.hasMessage('▲ major can be updated v1.0.0 → v3.0.0'), true);
assert.equal(fixture.hasMessage('▲ major can be updated v1.0.0 → v3.0.0'), true);
assert.equal(prompted, true);
assert.equal(exitCode, undefined);
assert.equal(fixture.hasMessage('check Be sure to follow the CHANGELOG.'), true);
Expand Down

0 comments on commit da9b3b2

Please sign in to comment.