|
|
@@ -67,6 +67,22 @@ describe('release families', () => {
|
|
|
])
|
|
|
})
|
|
|
|
|
|
+ it.each(['0.0.2-alpha.1', '0.0.2-canary.1', '0.0.2-rc.1'])(
|
|
|
+ 'accepts the explicit dsh prerelease version %s',
|
|
|
+ (version) => {
|
|
|
+ const root = mkdtempSync(join(tmpdir(), 'dsh-release-prerelease-'))
|
|
|
+ roots.push(root)
|
|
|
+ write(join(root, 'package.json'), '{"version":"0.0.1"}\n')
|
|
|
+
|
|
|
+ const dsh = releaseFamily('dsh')
|
|
|
+ const published = member('packages/core/published', '@deepseek-ai/dsh-published')
|
|
|
+ const plan = planShared(dsh, root, [published], version)
|
|
|
+
|
|
|
+ expect(plan.version).toBe(version)
|
|
|
+ expect(plan.planned[1]?.tag).toBe(`dsh-v${version}`)
|
|
|
+ },
|
|
|
+ )
|
|
|
+
|
|
|
it('names one tag for the whole dsh family and one per vendored package', () => {
|
|
|
const dsh = releaseFamily('dsh')
|
|
|
const vendor = releaseFamily('vendor')
|
|
|
@@ -81,6 +97,18 @@ describe('release families', () => {
|
|
|
expect(vendor.tagFor({ ...cordis, version: '4.0.0-rc.7' })).toBe('vendor-cordis-v4.0.0-rc.7')
|
|
|
})
|
|
|
|
|
|
+ it('assigns alpha and canary dist-tags only to dsh releases', () => {
|
|
|
+ const dsh = releaseFamily('dsh')
|
|
|
+ const vendor = releaseFamily('vendor')
|
|
|
+
|
|
|
+ expect(dsh.distTagForVersion('0.0.2-alpha.1')).toBe('alpha')
|
|
|
+ expect(dsh.distTagForVersion('0.0.2-canary.1')).toBe('canary')
|
|
|
+ expect(dsh.distTagForVersion('0.0.2-rc.1')).toBe('next')
|
|
|
+ expect(dsh.distTagForVersion('0.0.2')).toBeUndefined()
|
|
|
+ expect(vendor.distTagForVersion('4.0.1-alpha.1')).toBe('next')
|
|
|
+ expect(vendor.distTagForVersion('4.0.1-canary.1')).toBe('next')
|
|
|
+ })
|
|
|
+
|
|
|
it('rejects a family whose members disagree on the shared version', () => {
|
|
|
const dsh = releaseFamily('dsh')
|
|
|
const members = [member('apps/cli', '@deepseek-ai/dsh'), { ...member('apps/web', '@deepseek-ai/dsh-web-frontend'), version: '0.0.2' }]
|
|
|
@@ -277,6 +305,12 @@ describe('vendored version baseline', () => {
|
|
|
})
|
|
|
|
|
|
describe('version precedence', () => {
|
|
|
+ it('orders alpha, canary, and release-candidate versions by semver precedence', () => {
|
|
|
+ expect(compareVersions('4.0.1-alpha.1', '4.0.1-canary.1')).toBeLessThan(0)
|
|
|
+ expect(compareVersions('4.0.1-canary.1', '4.0.1-rc.1')).toBeLessThan(0)
|
|
|
+ expect(compareVersions('4.0.1-rc.1', '4.0.1')).toBeLessThan(0)
|
|
|
+ })
|
|
|
+
|
|
|
it('ranks a release above the prerelease it follows', () => {
|
|
|
// git --sort=v:refname disagrees, placing 4.0.1-rc.1 above 4.0.1, which is
|
|
|
// why the newest published version is chosen here rather than by git.
|