Skip to content

Release: Prerelease 9.0.0-alpha.20 #31124

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

Merged
merged 53 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1975609
Update migration documentation to reflect the removal of `@storybook/…
ndelangen Mar 31, 2025
dabad55
Merge branch 'next' into norbert/migration-addon-essentials
ndelangen Mar 31, 2025
ce38b8c
Update MIGRATION.md
ndelangen Mar 31, 2025
c507747
Docs: Remove Webpack 5 frameworks
jonniebigodes Apr 2, 2025
de28a55
Merge branch 'next' into docs_removes_webpack_frameworks
jonniebigodes Apr 2, 2025
e54dc57
Save from Controls: Replace rendererPackage with frameworkPackage
valentinpalkovic Apr 14, 2025
e276ecb
Update telejson
valentinpalkovic Apr 14, 2025
74962f2
Replace outdated MDX VSCode setting with a new one
b0g3r Apr 14, 2025
04263a9
Update prompt message in consolidatedImports to clarify glob pattern …
ndelangen Apr 15, 2025
a19f262
Merge pull request #31118 from storybookjs/norbert/explain-project-ro…
ndelangen Apr 15, 2025
c604a36
Docs: Add troubleshooting steps
valentinpalkovic Apr 15, 2025
28130a7
Merge pull request #31129 from storybookjs/valentin/add-faq-section-r…
valentinpalkovic Apr 15, 2025
1a50651
Merge pull request #31114 from storybookjs/valentin/fix-save-from-con…
valentinpalkovic Apr 15, 2025
f3932de
Merge pull request #31115 from storybookjs/valentin/update-telejson
valentinpalkovic Apr 15, 2025
37b5101
Refactor: Update panel IDs in vitest addon to use new constants
ndelangen Apr 15, 2025
a502ffa
Enhance supported frameworks in Vitest: Added new Storybook framework…
ndelangen Apr 15, 2025
aa6da0e
Core: Add highlight as public API
valentinpalkovic Apr 15, 2025
d64746f
Fix: Update package filtering logic in transformPackageJson to exclud…
ndelangen Apr 15, 2025
a470a32
Interactions: Rename component test panel
valentinpalkovic Apr 15, 2025
eaa3a58
Merge pull request #31134 from storybookjs/valentin/fix-export-condit…
valentinpalkovic Apr 15, 2025
f53bdb7
Update consolidated-imports.ts
ndelangen Apr 15, 2025
b1cd3ee
Merge branch 'next' into norbert/fix-31120
ndelangen Apr 15, 2025
d06d766
Merge branch 'next' into patch-1
jonniebigodes Apr 15, 2025
1137866
Merge pull request #31116 from b0g3r/patch-1
jonniebigodes Apr 15, 2025
c999b31
Merge pull request #31130 from storybookjs/valentin/rename-component-…
shilman Apr 15, 2025
fcabfef
Merge pull request #31135 from storybookjs/norbert/fix-31120
ndelangen Apr 16, 2025
3ada2f8
rename local tests -> interactions
yannbf Apr 16, 2025
9ed21aa
Refactor addon-a11y-addon-test: Remove unused renderer import and sim…
ndelangen Apr 16, 2025
05ed923
Refactor addon-a11y-addon-test: Remove unused renderer import to stre…
ndelangen Apr 16, 2025
b6a711a
Update error message URL in vitest setup-file to use COMPONENT_TESTIN…
ndelangen Apr 16, 2025
90df588
Merge branch 'next' into norbert/fix-31126
ndelangen Apr 16, 2025
c33ffd1
Docs: Fix migration.md
valentinpalkovic Apr 16, 2025
f88559d
Merge pull request #31142 from storybookjs/valentin/fix-migration-md
valentinpalkovic Apr 16, 2025
7a8b889
Update error message URL in vitest setup-file test to reflect new int…
ndelangen Apr 16, 2025
975fe5a
Merge branch 'next' into norbert/fix-31126
ndelangen Apr 16, 2025
aa1f1be
Merge pull request #31133 from storybookjs/norbert/fix-31122
ndelangen Apr 16, 2025
da08065
Apply suggestions from code review
yannbf Apr 16, 2025
0e576d9
Dependencies: Update dependencies
valentinpalkovic Apr 16, 2025
438f9f4
Sandboxes: Rename experimental-nextjs-vite sandboxes
valentinpalkovic Apr 16, 2025
587832b
Fix: Import React in manager.tsx for proper JSX support
ndelangen Apr 16, 2025
45fe6c0
Merge pull request #31143 from storybookjs/valentin/update-dependencies
valentinpalkovic Apr 16, 2025
bd3157f
Merge pull request #31144 from storybookjs/valentin/rename-experiment…
valentinpalkovic Apr 16, 2025
650cfcf
Merge pull request #31132 from storybookjs/norbert/fix-31126
ndelangen Apr 16, 2025
8aca78d
Merge pull request #31043 from storybookjs/docs_removes_webpack_frame…
valentinpalkovic Apr 16, 2025
8bb4dad
Merge branch 'next' into norbert/migration-addon-essentials
ndelangen Apr 16, 2025
dd5008a
fix test
yannbf Apr 16, 2025
135f2a0
Merge branch 'yann/rename-local-tests' of github.com:storybookjs/stor…
yannbf Apr 16, 2025
fd5928f
Merge pull request #30995 from storybookjs/norbert/migration-addon-es…
ndelangen Apr 16, 2025
4783012
Update code/addons/vitest/src/components/TestProviderRender.tsx
yannbf Apr 16, 2025
1e17cca
Revert "Update code/addons/vitest/src/components/TestProviderRender.tsx"
kylegach Apr 16, 2025
e7b654d
Merge branch 'next' into yann/rename-local-tests
kylegach Apr 16, 2025
4c56c76
Merge pull request #31141 from storybookjs/yann/rename-local-tests
yannbf Apr 16, 2025
620caf9
Write changelog for 9.0.0-alpha.20 [skip ci]
storybook-bot Apr 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 9.0.0-alpha.20

- Addon Docs: Update telejson - [#31115](https://github.com/storybookjs/storybook/pull/31115), thanks @valentinpalkovic!
- AddonVitest: Use framework package, not renderer - [#31133](https://github.com/storybookjs/storybook/pull/31133), thanks @ndelangen!
- Automigration: Fix consolidated-imports with sub-paths - [#31135](https://github.com/storybookjs/storybook/pull/31135), thanks @ndelangen!
- Core: Add highlight as public API - [#31134](https://github.com/storybookjs/storybook/pull/31134), thanks @valentinpalkovic!
- Core: Rename local tests to interactions - [#31141](https://github.com/storybookjs/storybook/pull/31141), thanks @yannbf!
- Dependencies: Update dependencies - [#31143](https://github.com/storybookjs/storybook/pull/31143), thanks @valentinpalkovic!
- Interactions: Rename component test panel - [#31130](https://github.com/storybookjs/storybook/pull/31130), thanks @valentinpalkovic!
- Migration: Improve glob question text - [#31118](https://github.com/storybookjs/storybook/pull/31118), thanks @ndelangen!
- Refactor: Update panel IDs in vitest addon to use new constants - [#31132](https://github.com/storybookjs/storybook/pull/31132), thanks @ndelangen!
- Save from Controls: Replace rendererPackage with frameworkPackage - [#31114](https://github.com/storybookjs/storybook/pull/31114), thanks @valentinpalkovic!

## 9.0.0-alpha.19

- CLI: Fix framework for preview imports - [#31101](https://github.com/storybookjs/storybook/pull/31101), thanks @valentinpalkovic!
Expand Down
763 changes: 525 additions & 238 deletions MIGRATION.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion code/addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"react-dom": "^18.2.0",
"rehype-external-links": "^3.0.0",
"rehype-slug": "^6.0.0",
"telejson": "^7.2.0",
"telejson": "8.0.0",
"tocbot": "^4.20.1",
"typescript": "^5.7.3",
"vite": "^6.2.5"
Expand Down
22 changes: 11 additions & 11 deletions code/addons/vitest/src/components/TestProviderRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { addons } from 'storybook/manager-api';
import type { API } from 'storybook/manager-api';
import { styled } from 'storybook/theming';

import { A11Y_ADDON_ID, A11Y_PANEL_ID, PANEL_ID } from '../constants';
import { A11Y_ADDON_ID, A11Y_PANEL_ID, COMPONENT_TESTING_PANEL_ID } from '../constants';
import type { StoreState } from '../types';
import type { StatusValueToStoryIds } from '../use-test-provider-state';
import { Description } from './Description';
Expand Down Expand Up @@ -124,7 +124,7 @@ export const TestProviderRender: FC<TestProviderRenderProps> = ({
ComponentProps<typeof TestStatusIcon>['status'],
string,
] = fatalError
? ['critical', 'Local tests crashed']
? ['critical', 'Component tests crashed']
: componentTestStatusValueToStoryIds['status-value:error'].length > 0
? ['negative', 'Component tests failed']
: isRunning
Expand All @@ -137,7 +137,7 @@ export const TestProviderRender: FC<TestProviderRenderProps> = ({
ComponentProps<typeof TestStatusIcon>['status'],
string,
] = fatalError
? ['critical', 'Local tests crashed']
? ['critical', 'Component tests crashed']
: a11yStatusValueToStoryIds['status-value:error'].length > 0
? ['negative', 'Accessibility tests failed']
: a11yStatusValueToStoryIds['status-value:warning'].length > 0
Expand All @@ -153,7 +153,7 @@ export const TestProviderRender: FC<TestProviderRenderProps> = ({
<Heading>
<Info>
{entry ? (
<Title id="testing-module-title">Run local tests</Title>
<Title id="testing-module-title">Run component tests</Title>
) : (
<Title
id="testing-module-title"
Expand All @@ -164,12 +164,12 @@ export const TestProviderRender: FC<TestProviderRenderProps> = ({
}
>
{currentRun.unhandledErrors.length === 1
? 'Local tests completed with an error'
? 'Component tests completed with an error'
: currentRun.unhandledErrors.length > 1
? 'Local tests completed with errors'
? 'Component tests completed with errors'
: fatalError
? 'Local tests didn’t complete'
: 'Run local tests'}
? 'Component tests didn’t complete'
: 'Run component tests'}
</Title>
)}
<Description
Expand Down Expand Up @@ -264,7 +264,7 @@ export const TestProviderRender: FC<TestProviderRenderProps> = ({
<Row>
<ListItem
as="label"
title="Component tests"
title="Interactions"
icon={entry ? null : <Checkbox type="checkbox" checked disabled />}
/>
<WithTooltip
Expand All @@ -282,7 +282,7 @@ export const TestProviderRender: FC<TestProviderRenderProps> = ({
onClick={() => {
openPanel({
api,
panelId: PANEL_ID,
panelId: COMPONENT_TESTING_PANEL_ID,
entryId:
componentTestStatusValueToStoryIds['status-value:error'][0] ??
componentTestStatusValueToStoryIds['status-value:warning'][0] ??
Expand Down Expand Up @@ -336,7 +336,7 @@ export const TestProviderRender: FC<TestProviderRenderProps> = ({
: currentRun.coverageSummary
? 'View coverage report'
: fatalError
? 'Local tests crashed'
? 'Component tests crashed'
: 'Run tests to calculate coverage'
}
/>
Expand Down
17 changes: 11 additions & 6 deletions code/addons/vitest/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ import type { StoreOptions } from 'storybook/internal/types';

import type { StoreState } from './types';

export { PANEL_ID as COMPONENT_TESTING_PANEL_ID } from '../../../core/src/component-testing/constants';
export {
PANEL_ID as A11Y_PANEL_ID,
ADDON_ID as A11Y_ADDON_ID,
} from '../../../addons/a11y/src/constants';

export const ADDON_ID = 'storybook/test';
export const TEST_PROVIDER_ID = `${ADDON_ID}/test-provider`;
export const PANEL_ID = `${ADDON_ID}/panel`;
export const STORYBOOK_ADDON_TEST_CHANNEL = 'STORYBOOK_ADDON_TEST_CHANNEL';

export const A11Y_ADDON_ID = 'storybook/a11y';
export const A11Y_PANEL_ID = `${A11Y_ADDON_ID}/panel`;

export const TUTORIAL_VIDEO_LINK = 'https://youtu.be/Waht9qq7AoA';
export const DOCUMENTATION_LINK = 'writing-tests/test-addon';
export const DOCUMENTATION_FATAL_ERROR_LINK = `${DOCUMENTATION_LINK}#what-happens-if-vitest-itself-has-an-error`;
Expand All @@ -19,11 +21,14 @@ export const COVERAGE_DIRECTORY = 'coverage';
export const SUPPORTED_FRAMEWORKS = [
'@storybook/nextjs',
'@storybook/nextjs-vite',
'@storybook/react-vite',
'@storybook/svelte-vite',
'@storybook/vue3-vite',
'@storybook/html-vite',
'@storybook/web-components-vite',
'@storybook/sveltekit',
];

export const SUPPORTED_RENDERERS = ['@storybook/react', '@storybook/svelte', '@storybook/vue3'];

export const storeOptions = {
id: ADDON_ID,
initialState: {
Expand Down
6 changes: 3 additions & 3 deletions code/addons/vitest/src/manager.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';

import { type Addon_TestProviderType, Addon_TypesEnum } from 'storybook/internal/types';
import { Addon_TypesEnum } from 'storybook/internal/types';

import {
a11yStatusStore,
Expand All @@ -13,7 +13,7 @@ import { addons } from 'storybook/manager-api';
import { GlobalErrorContext, GlobalErrorModal } from './components/GlobalErrorModal';
import { SidebarContextMenu } from './components/SidebarContextMenu';
import { TestProviderRender } from './components/TestProviderRender';
import { A11Y_PANEL_ID, ADDON_ID, PANEL_ID, TEST_PROVIDER_ID } from './constants';
import { A11Y_PANEL_ID, ADDON_ID, COMPONENT_TESTING_PANEL_ID, TEST_PROVIDER_ID } from './constants';
import { useTestProvider } from './use-test-provider-state';

addons.register(ADDON_ID, (api) => {
Expand All @@ -24,7 +24,7 @@ addons.register(ADDON_ID, (api) => {
api.togglePanel(true);
};
componentTestStatusStore.onSelect(() => {
openPanel(PANEL_ID);
openPanel(COMPONENT_TESTING_PANEL_ID);
});
a11yStatusStore.onSelect(() => {
openPanel(A11Y_PANEL_ID);
Expand Down
6 changes: 2 additions & 4 deletions code/addons/vitest/src/postinstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { coerce, satisfies } from 'semver';
import { dedent } from 'ts-dedent';

import { type PostinstallOptions } from '../../../lib/cli-storybook/src/add';
import { SUPPORTED_FRAMEWORKS, SUPPORTED_RENDERERS } from './constants';
import { SUPPORTED_FRAMEWORKS } from './constants';
import { printError, printInfo, printSuccess, printWarning, step } from './postinstall-logger';
import { loadTemplate, updateConfigFile, updateWorkspaceFile } from './updateVitestFile';
import { getAddonNames } from './utils';
Expand Down Expand Up @@ -112,9 +112,7 @@ export default async function postInstall(options: PostinstallOptions) {
? info.frameworkPackageName === '@storybook/nextjs'
? '@storybook/nextjs-vite'
: info.frameworkPackageName
: info.rendererPackageName && SUPPORTED_RENDERERS.includes(info.rendererPackageName)
? info.rendererPackageName
: null;
: null;

const isRendererSupported = !!annotationsImport;

Expand Down
2 changes: 1 addition & 1 deletion code/addons/vitest/src/vitest-plugin/setup-file.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('modifyErrorMessage', () => {

expect(task.result?.errors?.[0].message).toMatchInlineSnapshot(`
"
Click to debug the error directly in Storybook: http://localhost:6006/?path=/story/my-story&addonPanel=storybook/test/panel
Click to debug the error directly in Storybook: http://localhost:6006/?path=/story/my-story&addonPanel=storybook/interactions/panel

Original error message"
`);
Expand Down
4 changes: 3 additions & 1 deletion code/addons/vitest/src/vitest-plugin/setup-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import type { RunnerTask } from 'vitest';

import { Channel } from 'storybook/internal/channels';

import { COMPONENT_TESTING_PANEL_ID } from '../constants';

declare global {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - The module is augmented elsewhere but we need to duplicate it to avoid issues in no-link mode.
Expand All @@ -30,7 +32,7 @@ export const modifyErrorMessage = ({ task }: { task: Task }) => {
) {
const currentError = task.result.errors[0];
const storybookUrl = import.meta.env.__STORYBOOK_URL__;
const storyUrl = `${storybookUrl}/?path=/story/${meta.storyId}&addonPanel=storybook/test/panel`;
const storyUrl = `${storybookUrl}/?path=/story/${meta.storyId}&addonPanel=${COMPONENT_TESTING_PANEL_ID}`;
currentError.message = `\n\x1B[34mClick to debug the error directly in Storybook: ${storyUrl}\x1B[39m\n\n${currentError.message}`;
}
};
Expand Down
10 changes: 9 additions & 1 deletion code/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@
"import": "./dist/highlight/index.js",
"require": "./dist/highlight/index.cjs"
},
"./highlight": {
"types": "./dist/highlight/index.d.ts",
"import": "./dist/highlight/index.js",
"require": "./dist/highlight/index.cjs"
},
"./internal/highlight/preview": {
"types": "./dist/highlight/preview.d.ts",
"import": "./dist/highlight/preview.js",
Expand Down Expand Up @@ -464,6 +469,9 @@
"internal/highlight": [
"./dist/highlight/index.d.ts"
],
"highlight": [
"./dist/highlight/index.d.ts"
],
"internal/highlight/preview": [
"./dist/highlight/preview.d.ts"
],
Expand Down Expand Up @@ -760,7 +768,7 @@
"store2": "^2.14.2",
"strip-ansi": "^7.1.0",
"strip-json-comments": "^5.0.1",
"telejson": "8.0.0--canary.106.377d63b.0",
"telejson": "8.0.0",
"tiny-invariant": "^1.3.1",
"tinyspy": "^3.0.2",
"ts-dedent": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion code/core/scripts/entries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const getEntries = (cwd: string) => {
define('src/outline/index.ts', ['browser', 'node'], true, ['react'], [], [], true),
define('src/outline/preview.ts', ['browser', 'node'], true, ['react'], [], [], true),

define('src/highlight/index.ts', ['browser', 'node'], true, ['react'], [], [], false),
define('src/highlight/index.ts', ['browser', 'node'], true, ['react'], [], [], true),
define('src/highlight/preview.ts', ['browser', 'node'], true, ['react'], [], [], true),

define('src/actions/index.ts', ['browser', 'node'], true, ['react'], [], [], true),
Expand Down
4 changes: 2 additions & 2 deletions code/core/src/component-testing/components/EmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ export const Empty = () => {
return (
<div>
<EmptyTabContent
title="Component testing"
title="Interactions"
description={
<>
Component tests allow you to verify the functional aspects of UIs. Write a play function
Interactions allow you to verify the functional aspects of UIs. Write a play function
for your story and you&apos;ll see it run here.
</>
}
Expand Down
4 changes: 3 additions & 1 deletion code/core/src/component-testing/components/Interaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ export const Interaction = ({
<RowLabel aria-label="Render step" call={call} disabled>
{call.status === CallStates.ERROR ? (
<StatusIcon status={CallStates.ERROR} />
) : call.status === CallStates.ACTIVE ? (
<StatusIcon status={CallStates.ACTIVE} />
) : (
<RenderIcon />
)}
Expand All @@ -240,7 +242,7 @@ export const Interaction = ({
<WithTooltip
trigger="hover"
hasChrome={false}
tooltip={<Note note="Render is the first step of all component tests" />}
tooltip={<Note note="Render is the first step of all interactions" />}
>
<RenderLockIcon />
</WithTooltip>
Expand Down
2 changes: 1 addition & 1 deletion code/core/src/component-testing/components/PanelTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function PanelTitle() {

return (
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
<span>Component tests</span>
<span>Interactions</span>
{interactionsCount && !isErrored && !hasException ? (
<Badge compact status={selectedPanel === PANEL_ID ? 'active' : 'neutral'}>
{interactionsCount}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const TestDiscrepancyMessage = ({ browserTestStatus }: TestDiscrepancyMes

return (
<Wrapper>
This component test passed in {passed}, but the tests failed in {failed}.{' '}
This interaction test passed in {passed}, but the tests failed in {failed}.{' '}
<Link href={docsUrl} target="_blank" withArrow>
Learn what could cause this
</Link>
Expand Down
2 changes: 1 addition & 1 deletion code/core/src/component-testing/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const ADDON_ID = 'storybook/component-tests';
export const ADDON_ID = 'storybook/interactions';
export const PANEL_ID = `${ADDON_ID}/panel`;

export const DOCUMENTATION_LINK = 'writing-tests/test-addon';
Expand Down
40 changes: 39 additions & 1 deletion code/core/src/core-server/utils/get-new-story-file.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,45 @@ describe('get-new-story-file', () => {

expect(exportedStoryName).toBe('Default');
expect(storyFileContent).toMatchInlineSnapshot(`
"import type { Meta, StoryObj } from '@storybook/react';
"import type { Meta, StoryObj } from '@storybook/nextjs';

import { Page } from './Page';

const meta = {
component: Page,
} satisfies Meta<typeof Page>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {};"
`);
expect(storyFilePath).toBe(join(__dirname, 'src', 'components', 'Page.stories.tsx'));
});

it('should create a new story file (TypeScript) with a framework package using the pnp workaround', async () => {
const { exportedStoryName, storyFileContent, storyFilePath } = await getNewStoryFile(
{
componentFilePath: 'src/components/Page.tsx',
componentExportName: 'Page',
componentIsDefaultExport: false,
componentExportCount: 1,
},
{
presets: {
apply: (val: string) => {
if (val === 'framework') {
return Promise.resolve('path/to/@storybook/react-vite');
}
},
},
} as any
);

expect(exportedStoryName).toBe('Default');
expect(storyFileContent).toMatchInlineSnapshot(`
"import type { Meta, StoryObj } from '@storybook/react-vite';

import { Page } from './Page';

Expand Down
10 changes: 4 additions & 6 deletions code/core/src/core-server/utils/get-new-story-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { readFile } from 'node:fs/promises';
import { basename, dirname, extname, join } from 'node:path';

import {
extractProperFrameworkName,
extractProperRendererNameFromFramework,
findConfigFile,
getFrameworkName,
Expand Down Expand Up @@ -30,10 +31,7 @@ export async function getNewStoryFile(
const cwd = getProjectRoot();

const frameworkPackageName = await getFrameworkName(options);
const rendererName = await extractProperRendererNameFromFramework(frameworkPackageName);
const rendererPackage = Object.entries(rendererPackages).find(
([, value]) => value === rendererName
)?.[0];
const sanitizedFrameworkPackageName = extractProperFrameworkName(frameworkPackageName);

const base = basename(componentFilePath);
const extension = extname(componentFilePath);
Expand Down Expand Up @@ -67,12 +65,12 @@ export async function getNewStoryFile(
});
} else {
storyFileContent =
isTypescript && rendererPackage
isTypescript && frameworkPackageName
? await getTypeScriptTemplateForNewStoryFile({
basenameWithoutExtension,
componentExportName,
componentIsDefaultExport,
rendererPackage,
frameworkPackage: sanitizedFrameworkPackageName,
exportedStoryName,
})
: await getJavaScriptTemplateForNewStoryFile({
Expand Down
Loading
Loading