beachball
Advanced tools
Comparing version 1.11.0 to 1.11.1
@@ -5,3 +5,17 @@ { | ||
{ | ||
"date": "Fri, 26 Jul 2019 17:59:55 GMT", | ||
"date": "Wed, 31 Jul 2019 21:59:54 GMT", | ||
"tag": "beachball_v1.11.1", | ||
"version": "1.11.1", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "default branch name should be master", | ||
"author": "kchau@microsoft.com", | ||
"commit": "edb36e3f8744bc6e6d5400280d2dad31b8e8db17" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Fri, 26 Jul 2019 18:00:02 GMT", | ||
"tag": "beachball_v1.11.0", | ||
@@ -8,0 +22,0 @@ "version": "1.11.0", |
# Change Log - beachball | ||
This log was last generated on Fri, 26 Jul 2019 17:59:55 GMT and should not be manually modified. | ||
This log was last generated on Wed, 31 Jul 2019 21:59:54 GMT and should not be manually modified. | ||
## 1.11.1 | ||
Wed, 31 Jul 2019 21:59:54 GMT | ||
### Patches | ||
- default branch name should be master (kchau@microsoft.com) | ||
## 1.11.0 | ||
Fri, 26 Jul 2019 17:59:55 GMT | ||
Fri, 26 Jul 2019 18:00:02 GMT | ||
@@ -8,0 +15,0 @@ ### Minor changes |
@@ -23,2 +23,3 @@ "use strict"; | ||
let args = yargs_parser_1.default(argv, { | ||
string: ['branch', 'tag', 'message', 'package'], | ||
alias: { | ||
@@ -39,10 +40,8 @@ branch: ['b'], | ||
} | ||
if (args.branch && !validation_1.isValidTargetBranch(args.branch)) { | ||
console.error(`Target branch needs to be a valid remote branch (e.g. origin/master): ${args.branch}`); | ||
process.exit(1); | ||
} | ||
const defaultCommand = 'change'; | ||
const cwd = paths_1.findGitRoot(process.cwd()) || process.cwd(); | ||
const branch = args.branch && args.branch.indexOf('/') > -1 ? args.branch : git_1.getDefaultRemoteBranch(args.branch, cwd); | ||
console.log(`Target branch is "${branch}"`); | ||
const options = { | ||
branch: args.branch || git_1.getDefaultRemoteMaster(cwd), | ||
branch, | ||
command: args._.length === 0 ? defaultCommand : args._[0], | ||
@@ -49,0 +48,0 @@ message: args.message || '', |
@@ -24,4 +24,5 @@ export declare function git(args: string[], options?: { | ||
}; | ||
export declare function getDefaultRemoteMaster(cwd: string): string; | ||
export declare function getDefaultRemoteBranch(branch: string | undefined, cwd: string): string; | ||
export declare function getDefaultRemote(cwd: string): string; | ||
export declare function listAllTrackedFiles(cwd: string): string[]; | ||
//# sourceMappingURL=git.d.ts.map |
@@ -221,3 +221,8 @@ "use strict"; | ||
} | ||
function getDefaultRemoteMaster(cwd) { | ||
function getDefaultRemoteBranch(branch = 'master', cwd) { | ||
const defaultRemote = getDefaultRemote(cwd); | ||
return `${defaultRemote}/${branch}`; | ||
} | ||
exports.getDefaultRemoteBranch = getDefaultRemoteBranch; | ||
function getDefaultRemote(cwd) { | ||
let packageJson; | ||
@@ -250,11 +255,10 @@ try { | ||
if (remote) { | ||
console.log(`Found a matching remote URL from package.json named "${remote}/master"`); | ||
return `${remote}/master`; | ||
return remote; | ||
} | ||
} | ||
} | ||
console.log(`Defaults to "origin/master"`); | ||
return 'origin/master'; | ||
console.log(`Defaults to "origin"`); | ||
return 'origin'; | ||
} | ||
exports.getDefaultRemoteMaster = getDefaultRemoteMaster; | ||
exports.getDefaultRemote = getDefaultRemote; | ||
function listAllTrackedFiles(cwd) { | ||
@@ -261,0 +265,0 @@ const results = git(['ls-tree', '-r', '--name-only', '--full-tree', 'HEAD'], { cwd }); |
export declare function isChangeFileNeeded(branch: string, cwd: string): boolean; | ||
export declare function isGitAvailable(cwd: string): string | false | null; | ||
export declare function isValidTargetBranch(branch?: string): boolean; | ||
export declare function isValidPackageName(pkg: string, cwd: string): boolean; | ||
export declare function isValidChangeType(changeType: string): boolean; | ||
//# sourceMappingURL=validation.d.ts.map |
@@ -19,9 +19,2 @@ "use strict"; | ||
exports.isGitAvailable = isGitAvailable; | ||
function isValidTargetBranch(branch) { | ||
if (branch) { | ||
return branch.indexOf('/') > -1; | ||
} | ||
return false; | ||
} | ||
exports.isValidTargetBranch = isValidTargetBranch; | ||
function isValidPackageName(pkg, cwd) { | ||
@@ -28,0 +21,0 @@ const packages = monorepo_1.getAllPackages(cwd); |
{ | ||
"name": "beachball", | ||
"version": "1.11.0", | ||
"version": "1.11.1", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
import { bump } from './bump'; | ||
import { CliOptions } from './CliOptions'; | ||
import { findGitRoot } from './paths'; | ||
import { getUncommittedChanges, getDefaultRemoteMaster } from './git'; | ||
import { | ||
isChangeFileNeeded as checkChangeFileNeeded, | ||
isGitAvailable, | ||
isValidTargetBranch, | ||
isValidPackageName, | ||
isValidChangeType | ||
} from './validation'; | ||
import { getUncommittedChanges, getDefaultRemoteBranch } from './git'; | ||
import { isChangeFileNeeded as checkChangeFileNeeded, isGitAvailable, isValidPackageName, isValidChangeType } from './validation'; | ||
import { promptForChange, writeChangeFiles } from './changefile'; | ||
@@ -18,2 +12,3 @@ import { publish } from './publish'; | ||
let args = parser(argv, { | ||
string: ['branch', 'tag', 'message', 'package'], | ||
alias: { | ||
@@ -36,11 +31,10 @@ branch: ['b'], | ||
if (args.branch && !isValidTargetBranch(args.branch)) { | ||
console.error(`Target branch needs to be a valid remote branch (e.g. origin/master): ${args.branch}`); | ||
process.exit(1); | ||
} | ||
const defaultCommand = 'change'; | ||
const cwd = findGitRoot(process.cwd()) || process.cwd(); | ||
const branch = args.branch && args.branch.indexOf('/') > -1 ? args.branch : getDefaultRemoteBranch(args.branch, cwd); | ||
console.log(`Target branch is "${branch}"`); | ||
const options: CliOptions = { | ||
branch: args.branch || getDefaultRemoteMaster(cwd), | ||
branch, | ||
command: args._.length === 0 ? defaultCommand : args._[0], | ||
@@ -47,0 +41,0 @@ message: args.message || '', |
@@ -246,3 +246,8 @@ import { spawnSync } from 'child_process'; | ||
export function getDefaultRemoteMaster(cwd: string) { | ||
export function getDefaultRemoteBranch(branch: string = 'master', cwd: string) { | ||
const defaultRemote = getDefaultRemote(cwd); | ||
return `${defaultRemote}/${branch}`; | ||
} | ||
export function getDefaultRemote(cwd: string) { | ||
let packageJson: any; | ||
@@ -281,4 +286,3 @@ | ||
if (remote) { | ||
console.log(`Found a matching remote URL from package.json named "${remote}/master"`); | ||
return `${remote}/master`; | ||
return remote; | ||
} | ||
@@ -288,4 +292,4 @@ } | ||
console.log(`Defaults to "origin/master"`); | ||
return 'origin/master'; | ||
console.log(`Defaults to "origin"`); | ||
return 'origin'; | ||
} | ||
@@ -292,0 +296,0 @@ |
@@ -19,10 +19,2 @@ import { findGitRoot } from './paths'; | ||
export function isValidTargetBranch(branch?: string) { | ||
if (branch) { | ||
return branch.indexOf('/') > -1; | ||
} | ||
return false; | ||
} | ||
export function isValidPackageName(pkg: string, cwd: string) { | ||
@@ -29,0 +21,0 @@ const packages = getAllPackages(cwd); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
109424