### Enable Recompilation for Docs/Specs Source: https://github.com/curiosum-dev/contexted/blob/main/README.md Configuration to enable recompilation of context BEAM files, which is necessary for accessing docs and specs in auto-delegated functions. This is an opt-in feature that extends compilation time. ```elixir config :contexted, app: :your_app_name, # replace 'your_app_name' with your real app name enable_recompilation: true ``` -------------------------------- ### Run Credo for Code Analysis Source: https://github.com/curiosum-dev/contexted/blob/main/CONTRIBUTING.md Execute Credo to analyze the code for style and quality issues. Ensure the test environment is set. ```bash MIX_ENV=test mix credo ``` -------------------------------- ### Accessing Delegated Functions Source: https://github.com/curiosum-dev/contexted/blob/main/README.md Demonstrates how to call a function from a delegated context through the main context module. ```elixir App.Account.find_user(1) ``` -------------------------------- ### Define Available Contexts for Tracing Source: https://github.com/curiosum-dev/contexted/blob/main/README.md Configure the `contexted` application with a list of your project's context modules. This configuration is used by `Contexted.Tracer` to monitor cross-references. ```elixir config :contexted, contexts: [ # list of context modules goes here, for instance: # [App.Account, App.Subscription, App.Blog] ] ``` -------------------------------- ### Delegate Context Functions Source: https://github.com/curiosum-dev/contexted/blob/main/README.md Splits a large context into smaller subcontexts using delegate_all. This allows treating the main context module as the API for the outside world. ```elixir defmodule App.Account.Users do def get_user(id) do ... end end defmodule App.Account.UserTokens do def get_user_token(id) do ... end end defmodule App.Account.Admins do def get_admin(id) do ... end end defmodule App.Account do import Contexted.Delegator delegate_all App.Account.Users delegate_all App.Account.UserTokens delegate_all App.Account.Admins end ``` -------------------------------- ### Configure Contexted as a Compiler Source: https://github.com/curiosum-dev/contexted/blob/main/README.md To enable context tracing, add `:contexted` to the list of compilers in your project's `mix.exs` file. This ensures that context cross-references are checked during compilation. ```elixir def project do [ ... compilers: [:contexted] ++ Mix.compilers(), ... ] end ``` -------------------------------- ### Add Contexted Dependency to mix.exs Source: https://github.com/curiosum-dev/contexted/blob/main/README.md Add the contexted library to your project's dependencies in the mix.exs file. After adding, run `mix deps.get` to fetch the dependency. ```elixir defp deps do [ {:contexted, "~> 0.3.4"} ] end ``` -------------------------------- ### Generated CRUD Functions Info Source: https://github.com/curiosum-dev/contexted/blob/main/README.md Lists the functions generated by the Contexted.CRUD macro for a user schema. These include create, read, update, and delete operations. ```elixir iex> App.Accounts.Users.__info__(:functions) [ change_user: 1, change_user: 2, create_user: 0, create_user: 1, create_user!: 0, create_user!: 1, delete_user: 1, delete_user!: 1, get_user: 1, get_user!: 1, list_users: 0, update_user: 1, update_user: 2, update_user!: 1, update_user!: 2 ] ``` -------------------------------- ### Generate CRUD Operations Source: https://github.com/curiosum-dev/contexted/blob/main/README.md Automatically generates common CRUD functions for a given schema and repository. This reduces boilerplate code for repetitive operations. ```elixir defmodule App.Account.Users do use Contexted.CRUD, repo: App.Repo, schema: App.Accounts.User end ``` -------------------------------- ### Exclude Paths from Context Cross-Reference Checks Source: https://github.com/curiosum-dev/contexted/blob/main/README.md Configure `exclude_paths` within the `contexted` application settings to specify directories or files that should be ignored during context cross-reference checks. This is useful for managing project structure or specific testing directories. ```elixir config :contexted, exclude_paths: ["app/test"] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.