Skip to content

Commit

Permalink
Note some TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Barone committed Sep 24, 2024
1 parent f4a422c commit d5d7c76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/generators/storybook/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def mount_previews
def update_storybook
# Main.js
insert_into_file ".storybook/main.js", "\n \"@storybook/server\",", after: "addons: ["
# TODO: Switch to YAML from JSON for stories (should be supported by Storybook)
gsub_file ".storybook/main.js", "*.stories.@(js|jsx|mjs|ts|tsx)", "*.stories.json"
gsub_file ".storybook/main.js", "@storybook/react-webpack5", "@storybook/server-webpack5"

Expand Down
1 change: 1 addition & 0 deletions lib/storybook/tasks/stories.rake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ namespace :storybook do
desc "Write CSF JSON stories for all Stories"
task stories: :environment do
stories_dir = "stories"
# TODO: Also needs to *remove* stale stories
Rails::Previews::Preview.all.map do |preview|
filename = Rails.root.join("#{stories_dir}/#{preview.preview_name}.stories.json")
stories_json = JSON.pretty_generate(preview.to_csf)
Expand Down

0 comments on commit d5d7c76

Please sign in to comment.