Remove stories.json files from repo and gitignore them

Created on 26 August 2024, 5 months ago
Updated 10 September 2024, 4 months ago

Problem/Motivation

Storybook works by reading stories.json files and rendering the components. The json files can be autogenerated by the Storybook contrib module via a drush command. When the file compiles, the base url of the server you are running the project on gets pulled into the http request. This means that if those json files are used on a version of the site with a different base url, storybook won't work. However, the only way the json files get updated is when there is a change detected in the stories.twig file from which it is generated.

Steps to reproduce

Spin up the drupal.org site using a different base url, or with custom port configuration, fire up storybook, and observe the fetch errors.

Proposed resolution

Remove the stories.json files from the codebase and git ignore them.
Since compiling the stories files is already part of the `install-storybook` composer script, the the files will get correctly written wrt to the base url that the project is being served from.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States spicy.werewolf

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024