Skip to content

Server: Fix .stories.yml support#22906

Merged
shilman merged 1 commit into
nextfrom
shilman/22896-server-add-yml
Jun 4, 2023
Merged

Server: Fix .stories.yml support#22906
shilman merged 1 commit into
nextfrom
shilman/22896-server-add-yml

Conversation

@shilman

@shilman shilman commented Jun 4, 2023

Copy link
Copy Markdown
Member

Closes #22896

What I did

Restore .yml support in @storybook/server:

  • Add .yml to indexer
  • Fix yaml-loader behavior for webpack (not sure what changed, but we need asJSON option now)
  • Remove inDevelopment flag from server sandbox to improve DX

Self-merging @ndelangen @tmeasday

How to test

In the internal/server-webpack5 sandbox:

  1. Update main.js to include .stories.yml files:
export default { stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(json|yml)'], ... }
  1. Add a file stories/button.stories.yml with the contents:
title: Example/ButtonYML
parameters:
  server:
    url: https://storybook-server-demo.netlify.app/api
    id: button
args:
  label: ButtonYML
stories:
  - { name: Primary, args: { primary: true } }
  1. View the new story in dev/prod modes

@shilman shilman added bug patch:yes Bugfix & documentation PR that need to be picked to main branch server labels Jun 4, 2023
@shilman shilman requested a review from a team as a code owner June 4, 2023 04:30
@shilman shilman self-assigned this Jun 4, 2023
@shilman shilman changed the title Server: Fix yaml file support Server: Fix .stories.yml support Jun 4, 2023
@shilman shilman merged commit f9a6c78 into next Jun 4, 2023
@shilman shilman deleted the shilman/22896-server-add-yml branch June 4, 2023 04:58
shilman added a commit that referenced this pull request Jun 4, 2023
@shilman shilman mentioned this pull request Jun 4, 2023
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jun 5, 2023
@ndelangen ndelangen removed the patch:yes Bugfix & documentation PR that need to be picked to main branch label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug patch:done Patch/release PRs already cherry-picked to main/release branch server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Storybook server needs an indexer for .stories.yml files

2 participants