Skip to content

Commit

Permalink
fix(version): improve default git publish message, closes #185
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Jun 6, 2022
1 parent cd4bb6a commit 735fbe6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Expand Up @@ -188,7 +188,7 @@ index SHA..SHA 100644
`;

exports[`VersionCommand independent mode versions changed packages: commit 1`] = `
"Publish
"chore: Publish new release
- package-1@1.0.1
- package-2@2.1.0
Expand Down
Expand Up @@ -39,7 +39,7 @@ packages/package-5/package.json"
`;

exports[`--conventional-commits independent should graduate prerelease version bumps and generate CHANGELOG 1`] = `
"Publish
"chore: Publish new release
- package-1@1.0.1
- package-2@2.1.0
Expand All @@ -62,7 +62,7 @@ packages/package-5/package.json"
`;

exports[`--conventional-commits independent should guess prerelease version bumps and generate CHANGELOG 1`] = `
"Publish
"chore: Publish new release
- package-1@1.0.1-alpha.0
- package-2@2.1.0-alpha.0
Expand All @@ -85,7 +85,7 @@ packages/package-5/package.json"
`;

exports[`--conventional-commits independent should use conventional-commits utility to guess version bump and generate CHANGELOG 1`] = `
"Publish
"chore: Publish new release
- package-1@1.0.1
- package-2@2.1.0
Expand Down
Expand Up @@ -180,7 +180,7 @@ test("independent version prerelease does not bump on every unrelated change", a

const first = await getCommitMessage(cwd);
expect(first).toMatchInlineSnapshot(`
Publish
chore: Publish new release
- pkg-a@1.0.1
- pkg-b@1.0.0-bumps.2
Expand All @@ -195,7 +195,7 @@ Publish

const second = await getCommitMessage(cwd);
expect(second).toMatchInlineSnapshot(`
Publish
chore: Publish new release
- pkg-a@1.0.2
`);
Expand Down Expand Up @@ -242,7 +242,7 @@ test("independent version prerelease respects --no-private", async () => {

const changedFiles = await showCommit(cwd, "--name-only");
expect(changedFiles).toMatchInlineSnapshot(`
Publish
chore: Publish new release
- pkg-1@1.0.1-alpha.0
Expand Down
2 changes: 1 addition & 1 deletion packages/version/src/version-command.ts
Expand Up @@ -717,7 +717,7 @@ export class VersionCommand extends Command<VersionCommandOption> {

async gitCommitAndTagVersionForUpdates() {
const tags = this.packagesToVersion.map((pkg) => `${pkg.name}@${this.updatesVersions?.get(pkg.name)}`);
const subject = this.options.message || 'Publish';
const subject = this.options.message || 'chore: Publish new release';
const message = tags.reduce((msg, tag) => `${msg}${os.EOL} - ${tag}`, `${subject}${os.EOL}`);

await gitCommit(message, this.gitOpts, this.execOpts, this.options.gitDryRun);
Expand Down

0 comments on commit 735fbe6

Please sign in to comment.