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

Mix task to "eject" components #47

Open
mplatts opened this issue Jun 8, 2022 · 4 comments
Open

Mix task to "eject" components #47

mplatts opened this issue Jun 8, 2022 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@mplatts
Copy link
Contributor

mplatts commented Jun 8, 2022

Sometimes you want to use a component as a starting point and modify it heavily.

Example: I want to modify the <.card> component.

mix petal_components:eject card

And it generates a copy of the card component into my live folder.

@mplatts mplatts added enhancement New feature or request help wanted Extra attention is needed labels Jun 8, 2022
@mplatts
Copy link
Contributor Author

mplatts commented Jun 8, 2022

I'll implement it in the coming months - but if someone wants to contribute just comment here and go for it

@mohammedzeglam-pg
Copy link
Contributor

I'll implement it in the coming months - but if someone wants to contribute just comment here and go for it

maybe use @callback so user could override what he want from component and keep all helpers.

@mohammedzeglam-pg
Copy link
Contributor

defmodule Ex do
  @callback h(item) :: item when item: var

  def h(x), do: IO.inspect(x)
end
defmodule E do
  @behaviour Ex
  def h(x), do: IO.inspect(x)
end
E.h("go")
Ex.h("sas")

@mplatts
Copy link
Contributor Author

mplatts commented Oct 28, 2022

Hey, yeah if you can get this working that'd be great. maybe do it for one component and see if it's viable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants