BeaconCMS/beacon

Beacon seeds not working on main branch

darkblueorange opened this issue · 3 comments

Hello

First of all thanks for this great initiative !

Small bug with example provided in seeds, creating an error:

iex(1)> Content.create_component!(%{\n
...(1)>   site: :solid_flow,
...(1)>   name: "sample_component",
...(1)>   body: """
...(1)>   <li>
...(1)>     <%%= @val %>
...(1)>   </li>
...(1)>   """
...(1)> })
** (RuntimeError) failed to create component: [body: {"invalid", [compilation_error: "expected attribute name\n  |\n1 | <li>\n2 |   <%%= @val %>\n  |     ^"]}]
    (beacon 0.1.0-dev) lib/beacon/content.ex:1501: Beacon.Content.create_component!/1
    iex:2: (file)

Actually all "%%" values trigger the same error.
When removing one % it works.

Keep up the awesome work!

Oh, and generator helper forgets a comma in application.ex

def start(_type, _args) do
   children = [
    ...
    ..., # <= here comma needed
    {Beacon, sites: [[site: :solid_flow, endpoint: SolidFlowBackWeb.Endpoint, data_source: SolidFlowBack.BeaconDataSource]]}
   ]
   opts = [strategy: :one_for_one, name: SolidFlowBack.Supervisor]
    Supervisor.start_link(children, opts)
end

hey @darkblueorange the seeds will be removed soon in favor of using the Live Admin to create all resources.

generator helper forgets a comma in application.ex

A PR to fix that is welcome :)

We're moving towards providing default components and layouts to bootstrap a site so the seeds will be removed.

Missing comma in application.ex has been fixed in main.