beachball
Advanced tools
Comparing version 1.11.5 to 1.11.6
@@ -5,3 +5,17 @@ { | ||
{ | ||
"date": "Sat, 03 Aug 2019 04:05:26 GMT", | ||
"date": "Wed, 07 Aug 2019 00:23:34 GMT", | ||
"tag": "beachball_v1.11.6", | ||
"version": "1.11.6", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "adds a fetch before diff changes, more info from when change files are needed", | ||
"author": "kchau@microsoft.com", | ||
"commit": "a84a82e8c6b57286d56c84e9b6cc8f6e5908f7db" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Sat, 03 Aug 2019 04:05:33 GMT", | ||
"tag": "beachball_v1.11.5", | ||
@@ -8,0 +22,0 @@ "version": "1.11.5", |
# Change Log - beachball | ||
This log was last generated on Sat, 03 Aug 2019 04:05:26 GMT and should not be manually modified. | ||
This log was last generated on Wed, 07 Aug 2019 00:23:34 GMT and should not be manually modified. | ||
## 1.11.6 | ||
Wed, 07 Aug 2019 00:23:34 GMT | ||
### Patches | ||
- adds a fetch before diff changes, more info from when change files are needed (kchau@microsoft.com) | ||
## 1.11.5 | ||
Sat, 03 Aug 2019 04:05:26 GMT | ||
Sat, 03 Aug 2019 04:05:33 GMT | ||
@@ -8,0 +15,0 @@ ### Patches |
@@ -28,4 +28,4 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { branch, path: cwd, package: specificPackage } = options; | ||
const changedPackages = specificPackage ? [specificPackage] : getChangedPackages_1.getChangedPackages(branch, cwd); | ||
const { branch, path: cwd, package: specificPackage, fetch } = options; | ||
const changedPackages = specificPackage ? [specificPackage] : getChangedPackages_1.getChangedPackages(branch, cwd, fetch); | ||
const recentMessages = git_1.getRecentCommitMessages(branch, cwd) || []; | ||
@@ -32,0 +32,0 @@ const packageChangeInfo = {}; |
@@ -57,3 +57,4 @@ "use strict"; | ||
changehint: args.changehint || 'Run "beachball change" to create a change file', | ||
type: args.type || null | ||
type: args.type || null, | ||
fetch: args.fetch !== false | ||
}; | ||
@@ -72,3 +73,3 @@ (() => __awaiter(this, void 0, void 0, function* () { | ||
} | ||
const isChangeNeeded = validation_1.isChangeFileNeeded(options.branch, options.path); | ||
const isChangeNeeded = validation_1.isChangeFileNeeded(options.branch, options.path, options.fetch); | ||
if (isChangeNeeded && options.command !== 'change') { | ||
@@ -75,0 +76,0 @@ console.error('ERROR: Change files are needed!'); |
@@ -11,2 +11,3 @@ export interface CliOptions { | ||
publish: boolean; | ||
fetch: boolean; | ||
yes: boolean; | ||
@@ -13,0 +14,0 @@ access: 'public' | 'restricted'; |
@@ -5,3 +5,3 @@ /** | ||
*/ | ||
export declare function getChangedPackages(branch: string, cwd: string): string[]; | ||
export declare function getChangedPackages(branch: string, cwd: string, fetch: boolean): string[]; | ||
//# sourceMappingURL=getChangedPackages.d.ts.map |
@@ -41,4 +41,8 @@ "use strict"; | ||
*/ | ||
function getChangedPackages(branch, cwd) { | ||
function getChangedPackages(branch, cwd, fetch) { | ||
const changePath = paths_1.getChangePath(cwd); | ||
if (fetch) { | ||
console.log('fetching latest from remotes'); | ||
git_1.fetchAll(cwd); | ||
} | ||
const changedPackages = getAllChangedPackages(branch, cwd); | ||
@@ -45,0 +49,0 @@ const changeFileResult = git_1.git(['ls-tree', '-r', '--name-only', '--full-tree', branch, 'change'], { cwd }); |
@@ -22,2 +22,3 @@ /** | ||
export declare function getUncommittedChanges(cwd: string): string[] | undefined; | ||
export declare function fetchAll(cwd: string): void; | ||
export declare function getChanges(branch: string, cwd: string): string[] | undefined; | ||
@@ -24,0 +25,0 @@ export declare function getRecentCommitMessages(branch: string, cwd: string): string[] | undefined; |
@@ -67,2 +67,10 @@ "use strict"; | ||
exports.getUncommittedChanges = getUncommittedChanges; | ||
function fetchAll(cwd) { | ||
const results = git(['fetch', '-a'], { cwd }); | ||
if (!results.success) { | ||
console.error('Cannot fetch all remotes'); | ||
throw new Error('Cannot fetch'); | ||
} | ||
} | ||
exports.fetchAll = fetchAll; | ||
function getChanges(branch, cwd) { | ||
@@ -69,0 +77,0 @@ try { |
@@ -1,2 +0,2 @@ | ||
export declare function isChangeFileNeeded(branch: string, cwd: string): boolean; | ||
export declare function isChangeFileNeeded(branch: string, cwd: string, fetch: boolean): boolean; | ||
export declare function isGitAvailable(cwd: string): string | false | null; | ||
@@ -3,0 +3,0 @@ export declare function isValidPackageName(pkg: string, cwd: string): boolean; |
@@ -7,5 +7,8 @@ "use strict"; | ||
const monorepo_1 = require("./monorepo"); | ||
function isChangeFileNeeded(branch, cwd) { | ||
function isChangeFileNeeded(branch, cwd, fetch) { | ||
console.log(`Checking for changes against "${branch}"`); | ||
const changedPackages = getChangedPackages_1.getChangedPackages(branch, cwd); | ||
const changedPackages = getChangedPackages_1.getChangedPackages(branch, cwd, fetch); | ||
if (changedPackages.length > 0) { | ||
console.log(`Found changes in the following packages: [${changedPackages.join(', ')}]`); | ||
} | ||
return changedPackages.length > 0; | ||
@@ -12,0 +15,0 @@ } |
{ | ||
"name": "beachball", | ||
"version": "1.11.5", | ||
"version": "1.11.6", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -17,5 +17,5 @@ import { ChangeInfo, ChangeType } from './ChangeInfo'; | ||
export async function promptForChange(options: CliOptions) { | ||
const { branch, path: cwd, package: specificPackage } = options; | ||
const { branch, path: cwd, package: specificPackage, fetch } = options; | ||
const changedPackages = specificPackage ? [specificPackage] : getChangedPackages(branch, cwd); | ||
const changedPackages = specificPackage ? [specificPackage] : getChangedPackages(branch, cwd, fetch); | ||
const recentMessages = getRecentCommitMessages(branch, cwd) || []; | ||
@@ -22,0 +22,0 @@ const packageChangeInfo: { [pkgname: string]: ChangeInfo } = {}; |
@@ -50,3 +50,4 @@ import { bump } from './bump'; | ||
changehint: args.changehint || 'Run "beachball change" to create a change file', | ||
type: args.type || null | ||
type: args.type || null, | ||
fetch: args.fetch !== false | ||
}; | ||
@@ -70,3 +71,3 @@ | ||
const isChangeNeeded = checkChangeFileNeeded(options.branch, options.path); | ||
const isChangeNeeded = checkChangeFileNeeded(options.branch, options.path, options.fetch); | ||
@@ -73,0 +74,0 @@ if (isChangeNeeded && options.command !== 'change') { |
@@ -11,2 +11,3 @@ export interface CliOptions { | ||
publish: boolean; | ||
fetch: boolean; | ||
yes: boolean; | ||
@@ -13,0 +14,0 @@ access: 'public' | 'restricted'; |
import { ChangeInfo } from './ChangeInfo'; | ||
import { findPackageRoot, getChangePath } from './paths'; | ||
import { getChanges, git } from './git'; | ||
import { getChanges, git, fetchAll } from './git'; | ||
import fs from 'fs'; | ||
@@ -42,4 +42,10 @@ import path from 'path'; | ||
*/ | ||
export function getChangedPackages(branch: string, cwd: string) { | ||
export function getChangedPackages(branch: string, cwd: string, fetch: boolean) { | ||
const changePath = getChangePath(cwd); | ||
if (fetch) { | ||
console.log('fetching latest from remotes'); | ||
fetchAll(cwd); | ||
} | ||
const changedPackages = getAllChangedPackages(branch, cwd); | ||
@@ -46,0 +52,0 @@ |
@@ -68,2 +68,10 @@ import { spawnSync } from 'child_process'; | ||
export function fetchAll(cwd: string) { | ||
const results = git(['fetch', '-a'], { cwd }); | ||
if (!results.success) { | ||
console.error('Cannot fetch all remotes'); | ||
throw new Error('Cannot fetch'); | ||
} | ||
} | ||
export function getChanges(branch: string, cwd: string) { | ||
@@ -70,0 +78,0 @@ try { |
@@ -6,6 +6,11 @@ import { findGitRoot } from './paths'; | ||
export function isChangeFileNeeded(branch: string, cwd: string) { | ||
export function isChangeFileNeeded(branch: string, cwd: string, fetch: boolean) { | ||
console.log(`Checking for changes against "${branch}"`); | ||
const changedPackages = getChangedPackages(branch, cwd); | ||
const changedPackages = getChangedPackages(branch, cwd, fetch); | ||
if (changedPackages.length > 0) { | ||
console.log(`Found changes in the following packages: [${changedPackages.join(', ')}]`); | ||
} | ||
return changedPackages.length > 0; | ||
@@ -12,0 +17,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
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
116497
2820
5