Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: Do not show a migration summary on sb init #22109

Merged
merged 1 commit into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 14 additions & 11 deletions code/lib/cli/src/automigrate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const automigrate = async ({
configDir: userSpecifiedConfigDir,
renderer: rendererPackage,
skipInstall,
hideMigrationSummary = false,
}: FixOptions = {}) => {
if (list) {
logAvailableMigrations();
Expand Down Expand Up @@ -100,17 +101,19 @@ export const automigrate = async ({
await remove(TEMP_LOG_FILE_PATH);
}

const packageManager = JsPackageManagerFactory.getPackageManager({ force: pkgMgr });
const installationMetadata = await packageManager.findInstallations([
'@storybook/*',
'storybook',
]);

logger.info();
logger.info(
getMigrationSummary({ fixResults, fixSummary, logFile: LOG_FILE_PATH, installationMetadata })
);
logger.info();
if (!hideMigrationSummary) {
const packageManager = JsPackageManagerFactory.getPackageManager({ force: pkgMgr });
const installationMetadata = await packageManager.findInstallations([
'@storybook/*',
'storybook',
]);

logger.info();
logger.info(
getMigrationSummary({ fixResults, fixSummary, logFile: LOG_FILE_PATH, installationMetadata })
);
logger.info();
}

cleanup();

Expand Down
1 change: 1 addition & 0 deletions code/lib/cli/src/automigrate/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface FixOptions {
configDir?: string;
renderer?: string;
skipInstall?: boolean;
hideMigrationSummary?: boolean;
}

export enum FixStatus {
Expand Down
1 change: 1 addition & 0 deletions code/lib/cli/src/initiate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ async function doInitiate(options: CommandOptions, pkg: PackageJson): Promise<vo
packageManager: pkgMgr,
fixes: initFixes,
configDir: installResult?.configDir,
hideMigrationSummary: true,
});
}

Expand Down