Add better logging and fix command index
Signed-off-by: Zack Griesinger <zack.griesinger@c2fo.com>
This commit is contained in:
@@ -214,7 +214,7 @@ export function registerCommands(program: CommanderStatic) {
|
||||
|
||||
program
|
||||
.command('versions:bump')
|
||||
.option('--prefix', 'Override glob for matching packages to upgrade')
|
||||
.option('--prefix <glob>', 'Override glob for matching packages to upgrade')
|
||||
.description('Bump Backstage packages to the latest versions')
|
||||
.action(lazy(() => import('./versions/bump').then(m => m.default)));
|
||||
|
||||
|
||||
@@ -129,6 +129,7 @@ describe('bump', () => {
|
||||
await bump({ prefix: null } as Command);
|
||||
});
|
||||
expect(logs.filter(Boolean)).toEqual([
|
||||
'Using default prefix glob @backstage/*',
|
||||
'Checking for updates of @backstage/theme',
|
||||
'Checking for updates of @backstage/core',
|
||||
'Checking for updates of @backstage/core-api',
|
||||
@@ -254,6 +255,7 @@ describe('bump', () => {
|
||||
await bump({ prefix: '@{backstage,backstage-extra}/*' } as any);
|
||||
});
|
||||
expect(logs.filter(Boolean)).toEqual([
|
||||
'Using custom prefix glob @{backstage,backstage-extra}/*',
|
||||
'Checking for updates of @backstage/theme',
|
||||
'Checking for updates of @backstage-extra/custom-two',
|
||||
'Checking for updates of @backstage-extra/custom',
|
||||
@@ -350,6 +352,7 @@ describe('bump', () => {
|
||||
await bump({ prefix: null } as any);
|
||||
});
|
||||
expect(logs.filter(Boolean)).toEqual([
|
||||
'Using default prefix glob @backstage/*',
|
||||
'Checking for updates of @backstage/theme',
|
||||
'Checking for updates of @backstage/core',
|
||||
'Package info not found, ignoring package @backstage/theme',
|
||||
|
||||
@@ -38,6 +38,8 @@ const DEP_TYPES = [
|
||||
'optionalDependencies',
|
||||
];
|
||||
|
||||
const DEFAULT_PREFIX_GLOB = '@backstage/*';
|
||||
|
||||
type PkgVersionInfo = {
|
||||
range: string;
|
||||
target: string;
|
||||
@@ -51,7 +53,10 @@ export default async (cmd: Command) => {
|
||||
let prefix = cmd.prefix;
|
||||
|
||||
if (!prefix) {
|
||||
prefix = '@backstage/*';
|
||||
console.log(`Using default prefix glob ${DEFAULT_PREFIX_GLOB}`);
|
||||
prefix = DEFAULT_PREFIX_GLOB;
|
||||
} else {
|
||||
console.log(`Using custom prefix glob ${prefix}`);
|
||||
}
|
||||
|
||||
const findTargetVersion = createVersionFinder();
|
||||
|
||||
Reference in New Issue
Block a user