Skip to content

Force dev version dependencies to use dev version as well #7286

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .chronus/changes/dummy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
changeKind: internal
packages:
- "@typespec/http"
- "@typespec/streams"
- "@typespec/compiler"
- "@typespec/openapi3"
- "@typespec/openapi"
- "@typespec/http-server-js"
---

Testing new dev range
8 changes: 8 additions & 0 deletions .chronus/changes/try-no-dev-2025-4-8-17-24-10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@typespec/internal-build-utils"
---

Prerelease only allows other prerelease
5 changes: 1 addition & 4 deletions packages/internal-build-utils/src/prerelease.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,7 @@ export function getPrereleaseVersionRange(manifest: BumpManifest, prereleaseTag:
throw new Error(`Invalid semver version ${manifest.nextVersion}`);
}

if (parsedOldVersion.major > 0 && parsedOldVersion.major === parsedNextVersion.major) {
return `^${manifest.oldVersion}`;
}
return `^${manifest.oldVersion} || >=${manifest.nextVersion}-${prereleaseTag} <${manifest.nextVersion}`;
return `>=${manifest.nextVersion}-${prereleaseTag} <${manifest.nextVersion}`;
}

function getDevVersion(version: string, changeCount: number) {
Expand Down
8 changes: 4 additions & 4 deletions packages/internal-build-utils/test/prerelease.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ describe("getPrereleaseVersionRange", () => {
{
currentVersion: "0.1.0",
preReleaseTag: "dev",
expectedRange: "^0.1.0 || >=0.2.0-dev <0.2.0",
expectedRange: ">=0.2.0-dev <0.2.0",
},
{
currentVersion: "0.1.0-alpha.0",
preReleaseTag: "dev",
expectedRange: "^0.1.0-alpha.0 || >=0.1.0-alpha.1-dev <0.1.0-alpha.1",
expectedRange: ">=0.1.0-alpha.1-dev <0.1.0-alpha.1",
},
{
currentVersion: "1.0.0-rc.0",
preReleaseTag: "dev",
expectedRange: "^1.0.0-rc.0",
expectedRange: ">=1.0.0-rc.1-dev <1.0.0-rc.1",
},
{
currentVersion: "1.1.0",
preReleaseTag: "dev",
expectedRange: "^1.1.0",
expectedRange: ">=1.2.0-dev <1.2.0",
},
])(
"limits range to major version ($currentVersion)",
Expand Down
Loading