Skip to content

Commit

Permalink
Merge pull request #29800 from storybookjs/version-non-patch-from-8.5…
Browse files Browse the repository at this point in the history
….0-alpha.16

Release: Prerelease 8.5.0-alpha.17
  • Loading branch information
yannbf authored Dec 4, 2024
2 parents e1b5e29 + 5094868 commit 25c35e1
Show file tree
Hide file tree
Showing 62 changed files with 604 additions and 195 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 8.5.0-alpha.17

- CLI: Fix new-frameworks automigration - [#29804](https://github.com/storybookjs/storybook/pull/29804), thanks @yannbf!
- ReactVite: Add `@storybook/test` as optional peer dependency - [#29754](https://github.com/storybookjs/storybook/pull/29754), thanks @yannbf!
- Vite: Fix preview runtime import - [#29802](https://github.com/storybookjs/storybook/pull/29802), thanks @yannbf!

## 8.5.0-alpha.16

- Core: Avoid getting stuck in locked state - [#29768](https://github.com/storybookjs/storybook/pull/29768), thanks @ghengeveld!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export async function generateModernIframeScriptCode(options: Options, projectRo
* @todo Inline variable and remove `noinspection`
*/
const code = `
import { setup } from '@storybook/core/preview/runtime';
import { setup } from 'storybook/internal/preview/runtime';
import '${SB_VIRTUAL_FILES.VIRTUAL_ADDON_SETUP_FILE}';
setup();
Expand Down
2 changes: 2 additions & 0 deletions code/core/src/common/utils/get-storybook-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export const frameworkPackages: Record<string, SupportedFrameworks> = {
'@storybook/svelte-webpack5': 'svelte-webpack5',
'@storybook/sveltekit': 'sveltekit',
'@storybook/vue3-vite': 'vue3-vite',
'@storybook/experimental-nextjs-vite': 'experimental-nextjs-vite',
'@storybook/react-native-web-vite': 'react-native-web-vite',
'@storybook/vue3-webpack5': 'vue3-webpack5',
'@storybook/web-components-vite': 'web-components-vite',
'@storybook/web-components-webpack5': 'web-components-webpack5',
Expand Down
6 changes: 6 additions & 0 deletions code/frameworks/react-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,17 @@
"vite": "^4.0.0"
},
"peerDependencies": {
"@storybook/test": "workspace:*",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"storybook": "workspace:^",
"vite": "^4.0.0 || ^5.0.0 || ^6.0.0"
},
"peerDependenciesMeta": {
"@storybook/test": {
"optional": true
}
},
"engines": {
"node": ">=18.0.0"
},
Expand Down
3 changes: 2 additions & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,5 +293,6 @@
"Dependency Upgrades"
]
]
}
},
"deferredNextVersion": "8.5.0-alpha.17"
}
4 changes: 4 additions & 0 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7146,10 +7146,14 @@ __metadata:
typescript: "npm:^5.3.2"
vite: "npm:^4.0.0"
peerDependencies:
"@storybook/test": "workspace:*"
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
storybook: "workspace:^"
vite: ^4.0.0 || ^5.0.0 || ^6.0.0
peerDependenciesMeta:
"@storybook/test":
optional: true
languageName: unknown
linkType: soft

Expand Down
1 change: 0 additions & 1 deletion docs/_snippets/angular-add-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ const config: StorybookConfig = {

export default config;
```

20 changes: 10 additions & 10 deletions docs/_snippets/angular-project-compodoc-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"-e",
"json",
"-d",
"." // Add this line to introspect the relevant files starting from the root directory of your project.
".", // Add this line to introspect the relevant files starting from the root directory of your project.
],
"port": 6006
}
"port": 6006,
},
},
"build-storybook": {
"builder": "@storybook/angular:build-storybook",
Expand All @@ -36,13 +36,13 @@
"-e",
"json",
"-d",
"." // Add this line to introspect the relevant files starting from the root directory of your project.
".", // Add this line to introspect the relevant files starting from the root directory of your project.
],
"outputDir": "storybook-static"
}
}
}
}
}
"outputDir": "storybook-static",
},
},
},
},
},
}
```
1 change: 0 additions & 1 deletion docs/_snippets/before-each-in-meta-mock-date.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,3 @@ export const Default: Story = {
},
};
```

1 change: 0 additions & 1 deletion docs/_snippets/button-story-argtypes-with-subcategories.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,3 @@ const meta: Meta = {

export default meta;
```

1 change: 0 additions & 1 deletion docs/_snippets/checkbox-story-grouped.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,3 @@ const meta: Meta = {

export default meta;
```

3 changes: 3 additions & 0 deletions docs/_snippets/checkbox-story.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- prettier-ignore -->
```mdx filename="Checkbox.mdx" renderer="common" language="mdx"
import { Canvas, Meta } from '@storybook/blocks';

Expand All @@ -14,6 +15,7 @@ Use checkboxes to select one or more options from a list of choices.
<Canvas of={CheckboxStories.Unchecked} />
```

<!-- prettier-ignore -->
```mdx filename="Checkbox.mdx" renderer="svelte" language="mdx" tabTitle="Svelte CSF"
import { Canvas, Meta } from '@storybook/blocks';

Expand All @@ -30,6 +32,7 @@ Use checkboxes to select one or more options from a list of choices.
<Canvas of={CheckboxStories.Unchecked} />
```

<!-- prettier-ignore -->
```mdx filename="Checkbox.mdx" renderer="svelte" language="mdx" tabTitle="CSF"
import { Canvas, Meta } from '@storybook/blocks';

Expand Down
1 change: 0 additions & 1 deletion docs/_snippets/chromatic-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ pnpm add --save-dev chromatic
```shell renderer="common" language="js" packageManager="yarn"
yarn add --dev chromatic
```

1 change: 0 additions & 1 deletion docs/_snippets/component-story-custom-args-icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ const Template: Story = (args) => {
};
};
```

1 change: 1 addition & 0 deletions docs/_snippets/csf-3-example-title.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- prettier-ignore -->
```mdx filename="src/components/Button/Button.mdx" renderer="common" language="mdx"
import { Meta, Story } from '@storybook/blocks';

Expand Down
7 changes: 3 additions & 4 deletions docs/_snippets/custom-docs-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ export function CustomDocumentationComponent() {
}
```

```md renderer="common" language="mdx"
{/* Custom-MDX-Documentation.mdx */}

<!-- prettier-ignore -->
```mdx filename="Custom-MDX-Documentation.mdx" renderer="common" language="mdx"
# Replacing DocsPage with custom `MDX` content

This file is a documentation-only `MDX`file to customize Storybook's [DocsPage](https://storybook.js.org/docs/writing-docs/docs-page#replacing-docspage).
Expand Down Expand Up @@ -76,6 +75,7 @@ If you didn't include the title in the story's default export, use this approach

<Story id="your-directory-button--small" />
```

```ts filename="CustomDocumentationComponent.ts|tsx" renderer="common" language="ts" tabTitle="ts-component"
export const CustomDocumentationComponent: React.FC = () => {
return (
Expand All @@ -89,4 +89,3 @@ export const CustomDocumentationComponent: React.FC = () => {
);
};
```

33 changes: 24 additions & 9 deletions docs/_snippets/decorator-parameterized-in-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@ export default {
case 'page':
return (
// Your page layout is probably a little more complex than this ;)
<div className="page-layout"><Story /></div>
<div className="page-layout">
<Story />
</div>
);
case 'page-mobile':
return (
<div className="page-mobile-layout"><Story /></div>
<div className="page-mobile-layout">
<Story />
</div>
);
default:
// In the default case, don't apply a layout
Expand All @@ -68,11 +72,15 @@ const preview: Preview = {
case 'page':
return (
// Your page layout is probably a little more complex than this ;)
<div className="page-layout"><Story /></div>
<div className="page-layout">
<Story />
</div>
);
case 'page-mobile':
return (
<div className="page-mobile-layout"><Story /></div>
<div className="page-mobile-layout">
<Story />
</div>
);
default:
// In the default case, don't apply a layout
Expand All @@ -96,11 +104,15 @@ export default {
case 'page':
return (
// Your page layout is probably a little more complex than this ;)
<div className="page-layout"><Story /></div>
<div className="page-layout">
<Story />
</div>
);
case 'page-mobile':
return (
<div className="page-mobile-layout"><Story /></div>
<div className="page-mobile-layout">
<Story />
</div>
);
default:
// In the default case, don't apply a layout
Expand All @@ -124,11 +136,15 @@ const preview: Preview = {
case 'page':
return (
// Your page layout is probably a little more complex than this ;)
<div className="page-layout"><Story /></div>
<div className="page-layout">
<Story />
</div>
);
case 'page-mobile':
return (
<div className="page-mobile-layout"><Story /></div>
<div className="page-mobile-layout">
<Story />
</div>
);
default:
// In the default case, don't apply a layout
Expand Down Expand Up @@ -188,4 +204,3 @@ const preview: Preview = {

export default preview;
```

18 changes: 9 additions & 9 deletions docs/_snippets/individual-snapshot-tests-portable-stories.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ const compose = (entry) => {
return composeStories(entry);
} catch (e) {
throw new Error(
`There was an issue composing stories for the module: ${JSON.stringify(entry)}, ${e}`
`There was an issue composing stories for the module: ${JSON.stringify(entry)}, ${e}`,
);
}
};

function getAllStoryFiles() {
// Place the glob you want to match your stories files
const storyFiles = glob.sync(
path.join(__dirname, 'stories/**/*.{stories,story}.{js,jsx,mjs,ts,tsx}')
path.join(__dirname, 'stories/**/*.{stories,story}.{js,jsx,mjs,ts,tsx}'),
);

return storyFiles.map((filePath) => {
Expand All @@ -45,7 +45,7 @@ describe('Stories Snapshots', () => {

if (stories.length <= 0) {
throw new Error(
`No stories found for this module: ${title}. Make sure there is at least one valid story for this module.`
`No stories found for this module: ${title}. Make sure there is at least one valid story for this module.`,
);
}

Expand Down Expand Up @@ -157,7 +157,7 @@ const compose = (entry) => {
return composeStories(entry);
} catch (error) {
throw new Error(
`There was an issue composing stories for the module: ${JSON.stringify(entry)}, ${error}`
`There was an issue composing stories for the module: ${JSON.stringify(entry)}, ${error}`,
);
}
};
Expand All @@ -166,7 +166,7 @@ function getAllStoryFiles() {
const storyFiles = Object.entries(
import.meta.glob('./stories/**/*.(stories|story).@(js|jsx|mjs|ts|tsx)', {
eager: true,
})
}),
);

return storyFiles.map(([filePath, storyFile]) => {
Expand All @@ -185,7 +185,7 @@ describe('Stories Snapshots', () => {

if (stories.length <= 0) {
throw new Error(
`No stories found for this module: ${title}. Make sure there is at least one valid story for this module.`
`No stories found for this module: ${title}. Make sure there is at least one valid story for this module.`,
);
}

Expand Down Expand Up @@ -226,7 +226,7 @@ const compose = (entry: StoryFile): ReturnType<typeof composeStories<StoryFile>>
return composeStories(entry);
} catch (e) {
throw new Error(
`There was an issue composing stories for the module: ${JSON.stringify(entry)}, ${e}`
`There was an issue composing stories for the module: ${JSON.stringify(entry)}, ${e}`,
);
}
};
Expand All @@ -236,7 +236,7 @@ function getAllStoryFiles() {
const storyFiles = Object.entries(
import.meta.glob<StoryFile>('./stories/**/*.(stories|story).@(js|jsx|mjs|ts|tsx)', {
eager: true,
})
}),
);

return storyFiles.map(([filePath, storyFile]) => {
Expand All @@ -256,7 +256,7 @@ describe('Stories Snapshots', () => {

if (stories.length <= 0) {
throw new Error(
`No stories found for this module: ${title}. Make sure there is at least one valid story for this module.`
`No stories found for this module: ${title}. Make sure there is at least one valid story for this module.`,
);
}

Expand Down
Loading

0 comments on commit 25c35e1

Please sign in to comment.