Skip to content

Commit

Permalink
Noviny/before releasing (#318)
Browse files Browse the repository at this point in the history
* small fix

* don't write changelog ever if the release type is 'none'

* type checking fixed
  • Loading branch information
Noviny committed Apr 15, 2020
1 parent 011d57f commit 9cdfa36
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/young-moose-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@changesets/cli": patch
---

Typo fix in prerelease warning message
2 changes: 2 additions & 0 deletions packages/apply-release-plan/src/get-changelog-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export default async function generateMarkdown(
changelogFuncs: ChangelogFunctions,
changelogOpts: any
) {
if (release.type === "none") return null;

const releaseObj: ChangelogLines = {
major: [],
minor: [],
Expand Down
49 changes: 49 additions & 0 deletions packages/apply-release-plan/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,55 @@ describe("apply release plan", () => {
## 2.0.0`);
});
it("should not update the changelog if only devDeps changed", async () => {
let { changedFiles } = await testSetup(
"simple-dev-dep",
{
changesets: [
{
id: "quick-lions-devour",
summary: "Hey, let's have fun with testing!",
releases: [
{ name: "pkg-a", type: "none" },
{ name: "pkg-b", type: "minor" }
]
}
],
releases: [
{
name: "pkg-a",
type: "none",
oldVersion: "1.0.0",
newVersion: "1.0.0",
changesets: []
},
{
name: "pkg-b",
type: "minor",
oldVersion: "1.0.0",
newVersion: "1.1.0",
changesets: ["quick-lions-devour"]
}
],
preState: undefined
},
{
commit: false,
linked: [],
access: "restricted",
baseBranch: "master",
changelog: [
path.resolve(__dirname, "test-utils/simple-get-changelog-entry"),
null
]
}
);
let pkgAChangelogPath = changedFiles.find(a =>
a.endsWith("pkg-a/CHANGELOG.md")
);

expect(pkgAChangelogPath).toBeUndefined();
});

test("should list multi-line same-type summaries correctly", async () => {
const releasePlan = new FakeReleasePlan([
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/version/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default async function version(cwd: string, config: Config) {
warn(importantSeparator);
warn("You are in prerelease mode");
warn(
"If you meant to do a normal release you should revert these changes and run `changeset pre exits`"
"If you meant to do a normal release you should revert these changes and run `changeset pre exit`"
);
warn("You can then run `changeset version` again to do a normal release");
warn(importantEnd);
Expand Down

0 comments on commit 9cdfa36

Please sign in to comment.