View Source Igniter.Libs.Phoenix (igniter v0.4.0)
Codemods & utilities for working with Phoenix
Summary
Functions
Adds a pipeline to a Phoenix router.
Adds a scope to a Phoenix router.
Appends code to a Phoenix router pipeline.
Appends to a phoenix router scope.
Returns true
if the module is a Phoenix controller
Gets the list of endpoints that use a given router
Returns true
if the module is a Phoenix HTML module
Lists all routers found in the project.
Moves to the use statement in a module that matches use TheirWebModule, :router
Selects a router to be used in a later step. If only one router is found, it will be selected automatically.
Returns the web module name for the current app
Returns the web module name for the current app
Generates a module name that lives in the Web directory of the current app.
Generates a module name that lives in the Web directory of the current app.
Functions
Adds a pipeline to a Phoenix router.
Options
:router
- The router module to append to. Will be looked up if not provided.:arg2
- The second argument to the scope macro. Must be a value (typically a module).
Adds a scope to a Phoenix router.
Options
:router
- The router module to append to. Will be looked up if not provided.:arg2
- The second argument to the scope macro. Must be a value (typically a module).
Appends code to a Phoenix router pipeline.
Options
:router
- The router module to append to. Will be looked up if not provided.
Appends to a phoenix router scope.
Relatively limited currently only exact matches of a top level route, second argument, and pipelines.
Options
:router
- The router module to append to. Will be looked up if not provided.:arg2
- The second argument to the scope macro. Must be a value (typically a module).:with_pipelines
- A list of pipelines that the pipeline must be using to be considered a match.
Returns true
if the module is a Phoenix controller
Gets the list of endpoints that use a given router
Returns true
if the module is a Phoenix HTML module
Lists all routers found in the project.
@spec move_to_router_use(Igniter.t(), Sourceror.Zipper.t()) :: :error | {:ok, Sourceror.Zipper.t()}
Moves to the use statement in a module that matches use TheirWebModule, :router
select_router(igniter, label \\ "Which router should be modified?")
View SourceSelects a router to be used in a later step. If only one router is found, it will be selected automatically.
If no routers exist, {igniter, nil}
is returned.
If multiple routes are found, the user is prompted to select one of them.
Returns the web module name for the current app
@spec web_module_name() :: module()
Returns the web module name for the current app
Generates a module name that lives in the Web directory of the current app.
Generates a module name that lives in the Web directory of the current app.