Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change snapshot timestamp position to render before of the custom tag #859

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tiny-roses-kiss.md
@@ -0,0 +1,5 @@
---
"@changesets/assemble-release-plan": minor
---

Change snapshot timestamp position to render before of the custom tag
2 changes: 1 addition & 1 deletion packages/assemble-release-plan/src/index.test.ts
Expand Up @@ -54,7 +54,7 @@ describe("assemble-release-plan", () => {
);

expect(releases.length).toBe(1);
expect(/0\.0\.0-foo-\d{14}/.test(releases[0].newVersion)).toBeTruthy();
expect(/0\.0\.0-\d{14}-foo/.test(releases[0].newVersion)).toBeTruthy();
});

it("should assemble release plan with multiple packages", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/assemble-release-plan/src/index.ts
Expand Up @@ -40,7 +40,7 @@ function getSnapshotSuffix(snapshot?: string | boolean): string | undefined {

if (typeof snapshot === "string") tag = `-${snapshot}`;

return `${tag}-${dateAndTime}`;
return `-${dateAndTime}${tag}`;
}

function getNewVersion(
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/src/commands/version/version.test.ts
Expand Up @@ -644,14 +644,14 @@ describe("snapshot release", () => {
expect(getPkgJSON("pkg-a", spy.mock.calls)).toEqual(
expect.objectContaining({
name: "pkg-a",
version: expect.stringContaining("0.0.0-experimental-")
version: expect.stringMatching(/0\.0\.0-\d+-experimental/)
})
);

expect(getPkgJSON("pkg-b", spy.mock.calls)).toEqual(
expect.objectContaining({
name: "pkg-b",
version: expect.stringContaining("0.0.0-experimental-")
version: expect.stringMatching(/0\.0\.0-\d+-experimental/)
})
);
});
Expand Down Expand Up @@ -786,14 +786,14 @@ describe("snapshot release", () => {
expect(getPkgJSON("pkg-a", spy.mock.calls)).toEqual(
expect.objectContaining({
name: "pkg-a",
version: expect.stringContaining("1.1.0-experimental-")
version: expect.stringMatching(/1\.1\.0-\d+-experimental/)
})
);

expect(getPkgJSON("pkg-b", spy.mock.calls)).toEqual(
expect.objectContaining({
name: "pkg-b",
version: expect.stringContaining("1.0.1-experimental-")
version: expect.stringMatching(/1\.0\.1-\d+-experimental/)
})
);
});
Expand Down