Fix type problems

This commit is contained in:
Tom Coleman 2023-01-03 08:14:33 +11:00
parent f637508fd2
commit d2a6b08abd

View File

@ -35,7 +35,7 @@ export const autodocsTrue: Fix<AutodocsTrueFrameworkRunOptions> = {
const docs = main.getFieldValue(['docs']); const docs = main.getFieldValue(['docs']);
const docsPageToAutodocsMapping = { const docsPageToAutodocsMapping = {
true: 'tag', true: 'tag' as const,
automatic: true, automatic: true,
false: false, false: false,
}; };
@ -53,9 +53,7 @@ export const autodocsTrue: Fix<AutodocsTrueFrameworkRunOptions> = {
}, },
prompt({ value }) { prompt({ value }) {
const autodocsFormatted = chalk.cyan( const autodocsFormatted = chalk.cyan(`docs: { autodocs: ${JSON.stringify(value ?? true)} }`);
`docs: { autodocs: ${JSON.stringify(value ?? true)} }`
);
if (value) { if (value) {
return dedent` return dedent`
@ -84,7 +82,7 @@ export const autodocsTrue: Fix<AutodocsTrueFrameworkRunOptions> = {
we defaulted to having a autodocs for every story, in 7.x you need to opt in per-component. we defaulted to having a autodocs for every story, in 7.x you need to opt in per-component.
However, we can set the \`docs.autodocs\` to true to approximate the old behaviour: However, we can set the \`docs.autodocs\` to true to approximate the old behaviour:
${AutodocsTrueFormatted} ${autodocsFormatted}
More info: ${chalk.yellow( More info: ${chalk.yellow(
'https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#autodocs' 'https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#autodocs'