Accrue.Install.Patches (accrue v0.3.0)

Copy Markdown View Source

Safe host-file patch builders and manual snippets for Accrue installs.

The router snippet intentionally creates a route-scoped raw-body parser pipeline for Accrue webhooks. It never generates a global Plug.Parsers body reader and never hand-writes raw admin LiveView routes.

pipeline :accrue_webhook_raw_body do
  plug Plug.Parsers,
    parsers: [:json],
    pass: ["*/*"],
    json_decoder: Jason,
    body_reader: {Accrue.Webhook.CachingBodyReader, :read_body, []},
    length: 1_000_000
end

scope "/webhooks" do
  pipe_through :accrue_webhook_raw_body
  accrue_webhook "/stripe", :stripe
end

Summary

Functions

Applies safe patches and returns changed/skipped/manual result tuples.

Returns structured patch plans for host router, auth config, test support, and Oban wiring.

Exact manual snippets for --manual, --dry-run, and ambiguous projects.

Functions

admin_snippet(opts)

apply(project, opts)

Applies safe patches and returns changed/skipped/manual result tuples.

auth_snippet(arg1)

build(project, opts)

Returns structured patch plans for host router, auth config, test support, and Oban wiring.

manual_snippets(project, opts)

Exact manual snippets for --manual, --dry-run, and ambiguous projects.

oban_snippet()

router_snippet(opts)

test_support_snippet()