beachball
Advanced tools
Comparing version 1.13.3 to 1.13.4
@@ -5,3 +5,17 @@ { | ||
{ | ||
"date": "Wed, 25 Sep 2019 20:49:40 GMT", | ||
"date": "Wed, 25 Sep 2019 21:40:45 GMT", | ||
"tag": "beachball_v1.13.4", | ||
"version": "1.13.4", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "Add option to specify a defaultNpmTag on a per package basis", | ||
"author": "acoates@microsoft.com", | ||
"commit": "e5a188e542554b22ca01a8b5ecb979dccf44095a" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Wed, 25 Sep 2019 20:49:49 GMT", | ||
"tag": "beachball_v1.13.3", | ||
@@ -8,0 +22,0 @@ "version": "1.13.3", |
# Change Log - beachball | ||
This log was last generated on Wed, 25 Sep 2019 20:49:40 GMT and should not be manually modified. | ||
This log was last generated on Wed, 25 Sep 2019 21:40:45 GMT and should not be manually modified. | ||
## 1.13.4 | ||
Wed, 25 Sep 2019 21:40:45 GMT | ||
### Patches | ||
- Add option to specify a defaultNpmTag on a per package basis (acoates@microsoft.com) | ||
## 1.13.3 | ||
Wed, 25 Sep 2019 20:49:40 GMT | ||
Wed, 25 Sep 2019 20:49:49 GMT | ||
@@ -8,0 +14,0 @@ ### Patches |
@@ -44,3 +44,50 @@ "use strict"; | ||
}); | ||
it('publish with no tag publishes latest', () => { | ||
const publishResult = packageManager_1.packagePublish(package_1.testPackageInfo, registry.getUrl(), '', undefined, ''); | ||
expect(publishResult.success).toBeTruthy(); | ||
const showResult = packageManager_1.npm(['--registry', registry.getUrl(), 'show', package_1.testPackageInfo.name, '--json']); | ||
expect(showResult.success).toBeTruthy(); | ||
const show = JSON.parse(showResult.stdout); | ||
expect(show.name).toEqual(package_1.testPackageInfo.name); | ||
expect(show['dist-tags']['latest']).toEqual(package_1.testPackageInfo.version); | ||
expect(show.versions.length).toEqual(1); | ||
expect(show.versions[0]).toEqual(package_1.testPackageInfo.version); | ||
}); | ||
it('publish package with defaultNpmTag publishes as defaultNpmTag', () => { | ||
const testPackageInfoWithDefaultNpmTag = Object.assign({}, package_1.testPackageInfo, { defaultNpmTag: package_1.testTag }); | ||
const publishResult = packageManager_1.packagePublish(testPackageInfoWithDefaultNpmTag, registry.getUrl(), '', undefined, ''); | ||
expect(publishResult.success).toBeTruthy(); | ||
const showResult = packageManager_1.npm([ | ||
'--registry', | ||
registry.getUrl(), | ||
'show', | ||
testPackageInfoWithDefaultNpmTag.name, | ||
'--json', | ||
]); | ||
expect(showResult.success).toBeTruthy(); | ||
const show = JSON.parse(showResult.stdout); | ||
expect(show.name).toEqual(testPackageInfoWithDefaultNpmTag.name); | ||
expect(show['dist-tags'][package_1.testTag]).toEqual(testPackageInfoWithDefaultNpmTag.version); | ||
expect(show.versions.length).toEqual(1); | ||
expect(show.versions[0]).toEqual(testPackageInfoWithDefaultNpmTag.version); | ||
}); | ||
it('publish with specified tag overrides defaultNpmTag', () => { | ||
const testPackageInfoWithDefaultNpmTag = Object.assign({}, package_1.testPackageInfo, { defaultNpmTag: 'thisShouldNotBeUsed' }); | ||
const publishResult = packageManager_1.packagePublish(testPackageInfoWithDefaultNpmTag, registry.getUrl(), '', package_1.testTag, ''); | ||
expect(publishResult.success).toBeTruthy(); | ||
const showResult = packageManager_1.npm([ | ||
'--registry', | ||
registry.getUrl(), | ||
'show', | ||
testPackageInfoWithDefaultNpmTag.name, | ||
'--json', | ||
]); | ||
expect(showResult.success).toBeTruthy(); | ||
const show = JSON.parse(showResult.stdout); | ||
expect(show.name).toEqual(testPackageInfoWithDefaultNpmTag.name); | ||
expect(show['dist-tags'][package_1.testTag]).toEqual(testPackageInfoWithDefaultNpmTag.version); | ||
expect(show.versions.length).toEqual(1); | ||
expect(show.versions[0]).toEqual(testPackageInfoWithDefaultNpmTag.version); | ||
}); | ||
}); | ||
}); |
@@ -51,3 +51,3 @@ "use strict"; | ||
registry: args.registry || 'https://registry.npmjs.org/', | ||
tag: args.tag || 'latest', | ||
tag: args.tag, | ||
token: args.token || '', | ||
@@ -54,0 +54,0 @@ yes: args.yes === true || false, |
@@ -28,2 +28,3 @@ "use strict"; | ||
packageJsonPath: tmpPackageFile, | ||
defaultNpmTag: 'latest', | ||
version: testPackage.version, | ||
@@ -30,0 +31,0 @@ disallowedChangeTypes: [], |
@@ -12,2 +12,3 @@ export interface PackageInfo { | ||
disallowedChangeTypes: string[]; | ||
defaultNpmTag: string; | ||
private: boolean; | ||
@@ -14,0 +15,0 @@ } |
@@ -25,2 +25,3 @@ "use strict"; | ||
: [], | ||
defaultNpmTag: packageJson.beachball && packageJson.beachball.defaultNpmTag ? packageJson.beachball.defaultNpmTag : 'latest', | ||
private: packageJson.private !== undefined ? packageJson.private : false, | ||
@@ -27,0 +28,0 @@ }; |
@@ -9,3 +9,3 @@ import { PackageInfo } from './bump'; | ||
}; | ||
export declare function packagePublish(packageInfo: PackageInfo, registry: string, token: string, tag: string, access: string): { | ||
export declare function packagePublish(packageInfo: PackageInfo, registry: string, token: string, tag: string | undefined, access: string): { | ||
stderr: string; | ||
@@ -12,0 +12,0 @@ stdout: string; |
@@ -30,3 +30,3 @@ "use strict"; | ||
const packagePath = path_1.default.dirname(packageInfo.packageJsonPath); | ||
const args = ['publish', '--registry', registry, '--tag', tag]; | ||
const args = ['publish', '--registry', registry, '--tag', tag || packageInfo.defaultNpmTag]; | ||
if (token) { | ||
@@ -33,0 +33,0 @@ const shorthand = registry.substring(registry.indexOf('//')); |
@@ -172,3 +172,3 @@ "use strict"; | ||
// Adds a special dist-tag based tag in git | ||
if (tag !== 'latest') { | ||
if (tag && tag !== 'latest') { | ||
createTag(tag, cwd); | ||
@@ -175,0 +175,0 @@ } |
{ | ||
"name": "beachball", | ||
"version": "1.13.3", | ||
"version": "1.13.4", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
@@ -43,3 +43,59 @@ import { Registry } from '../fixtures/registry'; | ||
}); | ||
it('publish with no tag publishes latest', () => { | ||
const publishResult = packagePublish(testPackageInfo, registry.getUrl(), '', undefined, ''); | ||
expect(publishResult.success).toBeTruthy(); | ||
const showResult = npm(['--registry', registry.getUrl(), 'show', testPackageInfo.name, '--json']); | ||
expect(showResult.success).toBeTruthy(); | ||
const show = JSON.parse(showResult.stdout); | ||
expect(show.name).toEqual(testPackageInfo.name); | ||
expect(show['dist-tags']['latest']).toEqual(testPackageInfo.version); | ||
expect(show.versions.length).toEqual(1); | ||
expect(show.versions[0]).toEqual(testPackageInfo.version); | ||
}); | ||
it('publish package with defaultNpmTag publishes as defaultNpmTag', () => { | ||
const testPackageInfoWithDefaultNpmTag = { ...testPackageInfo, defaultNpmTag: testTag }; | ||
const publishResult = packagePublish(testPackageInfoWithDefaultNpmTag, registry.getUrl(), '', undefined, ''); | ||
expect(publishResult.success).toBeTruthy(); | ||
const showResult = npm([ | ||
'--registry', | ||
registry.getUrl(), | ||
'show', | ||
testPackageInfoWithDefaultNpmTag.name, | ||
'--json', | ||
]); | ||
expect(showResult.success).toBeTruthy(); | ||
const show = JSON.parse(showResult.stdout); | ||
expect(show.name).toEqual(testPackageInfoWithDefaultNpmTag.name); | ||
expect(show['dist-tags'][testTag]).toEqual(testPackageInfoWithDefaultNpmTag.version); | ||
expect(show.versions.length).toEqual(1); | ||
expect(show.versions[0]).toEqual(testPackageInfoWithDefaultNpmTag.version); | ||
}); | ||
it('publish with specified tag overrides defaultNpmTag', () => { | ||
const testPackageInfoWithDefaultNpmTag = { ...testPackageInfo, defaultNpmTag: 'thisShouldNotBeUsed' }; | ||
const publishResult = packagePublish(testPackageInfoWithDefaultNpmTag, registry.getUrl(), '', testTag, ''); | ||
expect(publishResult.success).toBeTruthy(); | ||
const showResult = npm([ | ||
'--registry', | ||
registry.getUrl(), | ||
'show', | ||
testPackageInfoWithDefaultNpmTag.name, | ||
'--json', | ||
]); | ||
expect(showResult.success).toBeTruthy(); | ||
const show = JSON.parse(showResult.stdout); | ||
expect(show.name).toEqual(testPackageInfoWithDefaultNpmTag.name); | ||
expect(show['dist-tags'][testTag]).toEqual(testPackageInfoWithDefaultNpmTag.version); | ||
expect(show.versions.length).toEqual(1); | ||
expect(show.versions[0]).toEqual(testPackageInfoWithDefaultNpmTag.version); | ||
}); | ||
}); | ||
}); |
@@ -49,3 +49,3 @@ import { bump } from './bump'; | ||
registry: args.registry || 'https://registry.npmjs.org/', | ||
tag: args.tag || 'latest', | ||
tag: args.tag, | ||
token: args.token || '', | ||
@@ -52,0 +52,0 @@ yes: args.yes === true || false, |
@@ -22,2 +22,3 @@ import fs from 'fs'; | ||
packageJsonPath: tmpPackageFile, | ||
defaultNpmTag: 'latest', | ||
version: testPackage.version, | ||
@@ -24,0 +25,0 @@ disallowedChangeTypes: [], |
@@ -13,2 +13,3 @@ import { findPackageRoot, findGitRoot } from './paths'; | ||
disallowedChangeTypes: string[]; | ||
defaultNpmTag: string; | ||
private: boolean; | ||
@@ -18,2 +19,3 @@ } | ||
interface BeachBallPackageConfig { | ||
defaultNpmTag?: string; | ||
disallowedChangeTypes?: string[]; | ||
@@ -48,2 +50,4 @@ } | ||
: [], | ||
defaultNpmTag: | ||
packageJson.beachball && packageJson.beachball.defaultNpmTag ? packageJson.beachball.defaultNpmTag : 'latest', | ||
private: packageJson.private !== undefined ? packageJson.private : false, | ||
@@ -50,0 +54,0 @@ }; |
@@ -26,5 +26,5 @@ import { PackageInfo } from './bump'; | ||
export function packagePublish(packageInfo: PackageInfo, registry: string, token: string, tag: string, access: string) { | ||
export function packagePublish(packageInfo: PackageInfo, registry: string, token: string, tag: string | undefined, access: string) { | ||
const packagePath = path.dirname(packageInfo.packageJsonPath); | ||
const args = ['publish', '--registry', registry, '--tag', tag]; | ||
const args = ['publish', '--registry', registry, '--tag', tag || packageInfo.defaultNpmTag]; | ||
@@ -31,0 +31,0 @@ if (token) { |
@@ -181,3 +181,3 @@ import { bump, BumpInfo } from './bump'; | ||
// Adds a special dist-tag based tag in git | ||
if (tag !== 'latest') { | ||
if (tag && tag !== 'latest') { | ||
createTag(tag, cwd); | ||
@@ -184,0 +184,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
171727
4149