Skip to content

Preserve inline CSF3 story parameters in full-source preset - #36661

Merged
Dmytro Kirpa (dmytrokirpa) merged 7 commits into
masterfrom
copilot/fix-babel-preset-storybook-full-source-issue
Sep 3, 2026
Merged

Preserve inline CSF3 story parameters in full-source preset#36661
Dmytro Kirpa (dmytrokirpa) merged 7 commits into
masterfrom
copilot/fix-babel-preset-storybook-full-source-issue

Conversation

Copilot AI commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

babel-preset-storybook-full-source treated CSF3 stories with inline parameters as missing parameters, then appended Story.parameters = {} before assigning fullSource. This dropped existing Storybook metadata such as docs.description.story.

  • Parameter detection

    • Detects inline parameters on CSF3 object story exports.
    • Handles TS-wrapped story initializers such as as and satisfies.
  • Regression coverage

    • Adds a typed CSF3 fixture matching the reported Meta / StoryObj pattern.
    • Updates existing CSF3 fixture expectations so inline parameters are preserved.
export const Default: Story = {
  render: () => <div>Example</div>,
  parameters: {
    docs: { description: { story: 'Description' } },
  },
};

// generated augmentation now preserves Default.parameters
Default.parameters.fullSource = '...';

Copilot AI and others added 2 commits August 31, 2026 15:59
Co-authored-by: dmytrokirpa <1492102+dmytrokirpa@users.noreply.github.com>
Co-authored-by: dmytrokirpa <1492102+dmytrokirpa@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix babel-preset-storybook-full-source overwriting CSF3 parameters Preserve inline CSF3 story parameters in full-source preset Aug 31, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot fix review comments

Co-authored-by: dmytrokirpa <1492102+dmytrokirpa@users.noreply.github.com>

Copilot AI commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Copilot fix review comments

Addressed in 4af77918: updated the Beachball comment wording and added StoryFn parameters regression coverage. Focused validation passed for test, format, type-check, lint, and secret scanning.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes parameter loss when augmenting typed CSF3 stories with fullSource.

Changes:

  • Detects inline story parameters through TypeScript wrappers.
  • Adds CSF2/CSF3 regression fixtures.
  • Adds a patch change file.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/fullsource.ts Detects inline parameters.
csf3-spread/output.js Preserves spread-story parameters.
csf3-render-and-args/output.js Preserves args-only parameters.
csf3-inline-parameters-typescript/code.tsx Adds typed CSF3 fixture.
csf3-inline-parameters-typescript/output.js Verifies preserved metadata.
csf3-inline-parameters-typescript/options.json Configures fixture output.
csf2-storyfn-parameters-typescript/code.tsx Adds typed CSF2 fixture.
csf2-storyfn-parameters-typescript/output.js Verifies CSF2 behavior.
csf2-storyfn-parameters-typescript/options.json Configures fixture output.
change/@fluentui-babel-preset-storybook-full-source-0d224dca-ee83-42af-95bf-9d09c643410b.json Records the patch release.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: dmytrokirpa <1492102+dmytrokirpa@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

📊 Bundle size report

✅ No changes found

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Pull request demo site: URL

@Hotell Martin Hochel (Hotell) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 cleanup suggestion otherwise LGTM

Co-authored-by: dmytrokirpa <1492102+dmytrokirpa@users.noreply.github.com>
@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) merged commit 5695ba9 into master Sep 3, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: babel-preset-storybook-full-source overwrites inline CSF3 story parameters

4 participants