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

protocol consolidation in storybook files #429

Open
tcoopman opened this issue Feb 14, 2024 · 3 comments
Open

protocol consolidation in storybook files #429

tcoopman opened this issue Feb 14, 2024 · 3 comments

Comments

@tcoopman
Copy link

I have something like this in my storybook files:

  defmodule StoryBookCommand do
    @derive [Jason.Encoder]
    defstruct [:value]
  end

but the consolidation doesn't work because the storybook file is a script (I think that's the reason).
How should I solve this?

@cblavier
Copy link
Contributor

Hey Thomas, I have no idea as I don't use protocols very much.
What is the StorybookCommand module? a component? a story?

@tcoopman
Copy link
Author

I have a component that renders Commands. A Command takes a payload that has to be a struct that implements the Jason.Encoder.

In my storybook files, instead of depending on payloads from the production code, I wanted to create a custom payload: StorybookCommand.
The issue is that it seems that protocol consolidation doesn't run for exs files?

Maybe a solution for me could be to put the StorybookCommand module somewhere else. Are there ex files where I can put this module? Similar to test/support?

@cblavier
Copy link
Contributor

Hey Thomas, I was able to reproduce it, but have no idea how to fix it.
Is this still an issue? did you find your way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants