Skip to content
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

Server: Fix .stories.yml support #22906

Merged
merged 1 commit into from Jun 4, 2023
Merged

Conversation

shilman
Copy link
Member

@shilman shilman commented Jun 4, 2023

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
71 of 74 checks passed
@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
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 patch:yes Bugfix & documentation PR that need to be picked to main 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
1 participant