Skip to content

Commit

Permalink
small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Feb 28, 2024
1 parent 5b25644 commit d52adbb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Expand Up @@ -151,7 +151,7 @@ describe('getIncompatiblePackagesSummary', () => {
Please consider updating your packages or contacting the maintainers for compatibility details.
For more on Storybook 8 compatibility, see the linked Github issue:
For more on Storybook 8 compatibility, see the linked GitHub issue:
https://github.com/storybookjs/storybook/issues/26031"
`);
});
Expand Down
6 changes: 3 additions & 3 deletions code/lib/cli/src/doctor/getIncompatibleStorybookPackages.ts
Expand Up @@ -45,7 +45,7 @@ export const checkPackageCompatibility = async (dependency: string, context: Con
...dependencies,
...peerDependencies,
})
.filter(([dep]) => Object.keys(storybookCorePackages).includes(dep))
.filter(([dep]) => storybookCorePackages[dep as keyof typeof storybookCorePackages])
.find(([, version]) => {
// prevent issues with "tag" based versions e.g. "latest" or "next" instead of actual numbers
return (
Expand All @@ -55,7 +55,7 @@ export const checkPackageCompatibility = async (dependency: string, context: Con
);
});

const isCorePackage = Object.keys(storybookCorePackages).includes(name);
const isCorePackage = storybookCorePackages[name as keyof typeof storybookCorePackages];

let availableUpdate;

Expand Down Expand Up @@ -126,7 +126,7 @@ export const getIncompatiblePackagesSummary = (
summaryMessage.push(
'\n',
'Please consider updating your packages or contacting the maintainers for compatibility details.',
'For more on Storybook 8 compatibility, see the linked Github issue:',
'For more on Storybook 8 compatibility, see the linked GitHub issue:',
chalk.yellow('https://github.com/storybookjs/storybook/issues/26031')
);
}
Expand Down
12 changes: 8 additions & 4 deletions code/lib/cli/src/doctor/index.ts
Expand Up @@ -145,17 +145,21 @@ export const doctor = async ({
? 'npx storybook@next doctor'
: 'npx storybook@latest doctor';

logger.info(
`👉 You can always recheck the health of your project by running:\n${chalk.cyan(doctorCommand)}`
);
const commandMessage = `You can always recheck the health of your project by running:\n${chalk.cyan(
doctorCommand
)}`;
logger.info();

if (foundIssues) {
logger.info(commandMessage);
logger.info();

logger.info(`Full logs are available in ${chalk.cyan(LOG_FILE_PATH)}`);

await move(TEMP_LOG_FILE_PATH, join(process.cwd(), LOG_FILE_NAME), { overwrite: true });
} else {
logger.info('🥳 Your Storybook project looks good!');
logger.info(`🥳 Your Storybook project looks good!`);
logger.info(commandMessage);
await remove(TEMP_LOG_FILE_PATH);
}
logger.info();
Expand Down

0 comments on commit d52adbb

Please sign in to comment.