Helper module for resolving file paths that works both when:
- Running directly inside the mishka_chelekom library (development/testing)
- Installed as a dependency in a user's Phoenix project
Uses :code.priv_dir/1 for installed dependency, falls back to local paths for development.
Summary
Functions
Returns the path to a component config file in priv/components/.
Returns the path to a component documentation file in usage-rules/components/.
Checks if a file exists at the given path.
Returns the path to a JS hook documentation file in usage-rules/js/.
Returns the path to a library documentation file in usage-rules/docs/.
Returns the path to mix-tasks.md documentation.
Returns the package root directory for mishka_chelekom. This is where usage-rules/ folder is located.
Returns the priv directory path for mishka_chelekom. Works both in development and when installed as a dependency.
Reads a file, returning {:ok, content} or {:error, reason}.
Returns the path to usage-rules directory. Located at package root, not inside priv.
Returns the path to the user's config file in their project. This always uses File.cwd!() since it's in the user's project, not the library.
Functions
Returns the path to a component config file in priv/components/.
Returns the path to a component documentation file in usage-rules/components/.
Checks if a file exists at the given path.
Returns the path to a JS hook documentation file in usage-rules/js/.
Returns the path to a library documentation file in usage-rules/docs/.
Returns the path to mix-tasks.md documentation.
Returns the package root directory for mishka_chelekom. This is where usage-rules/ folder is located.
In development: returns File.cwd!() since we're working in the source tree As dependency: returns the deps path where usage-rules/ is located
Returns the priv directory path for mishka_chelekom. Works both in development and when installed as a dependency.
Reads a file, returning {:ok, content} or {:error, reason}.
Returns the path to usage-rules directory. Located at package root, not inside priv.
Returns the path to the user's config file in their project. This always uses File.cwd!() since it's in the user's project, not the library.