{"id":22164730,"url":"https://github.com/axelson/exsync_lib","last_synced_at":"2025-03-24T16:12:34.908Z","repository":{"id":265538293,"uuid":"860789473","full_name":"axelson/exsync_lib","owner":"axelson","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-21T07:12:46.000Z","size":65,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T13:16:09.325Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axelson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-21T07:07:00.000Z","updated_at":"2024-09-23T01:42:36.000Z","dependencies_parsed_at":"2024-11-29T20:46:28.136Z","dependency_job_id":null,"html_url":"https://github.com/axelson/exsync_lib","commit_stats":null,"previous_names":["axelson/exsync_lib"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelson%2Fexsync_lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelson%2Fexsync_lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelson%2Fexsync_lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelson%2Fexsync_lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axelson","download_url":"https://codeload.github.com/axelson/exsync_lib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245304872,"owners_count":20593626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T05:09:47.283Z","updated_at":"2025-03-24T16:12:34.885Z","avatar_url":"https://github.com/axelson.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExSyncLib\n\nExSyncLib is a version of [exsync](https://github.com/falood/exsync/) that can be used as a library and is more configurable. If you want to reload code when it is updated and take granular actions then this might be a good fit.\n\n## Current Status\n\nExSyncLib is partially finished, it might be workable but it is not documented and I don't currently have plans to support it or finish it.\n\n## TODO\n\nTODO:\n- [ ] Move mixfile parsing code from NervesLiveReload to ExSyncLib\n- [ ] Correctly handle default src_extensions\n- [ ] Pass in build_path and use `MIX_BUILD_PATH` to not stomp on the user's compiled code\n  - Or should it be `MIX_BUILD_ROOT`?\n  - [ ] This will involve modifying the beam_dirs to match\n- [ ] Run `mix compile` once before the beam watcher starts up\n  - This will save the beam watcher from not being able to watch directories because they don't yet exist\n  \nThoughts:\n- Maybe this should be a behavior, that you have to pass an implementing module\n  to in order to start the supervision tree\n\n## System Support\n\nExSyncLib deps on [FileSystem](https://github.com/falood/file_system)\n\n## Usage\n\n1. Create a new application:\n\n```bash\nmix new my_app\n```\n\n2. Add exsync_lib to your `mix.exs` dependencies:\n\n```elixir\ndef deps do\n  [\n    {:exsync_lib, \"~\u003e 0.2\", only: :dev},\n  ]\nend\n```\n\nOptionally add this snippet to your `.iex.exs` (in the root of your project) or your `~/.iex.exs`:\n```\nif Code.ensure_loaded?(ExSyncLib) \u0026\u0026 function_exported?(ExSyncLib, :register_group_leader, 0) do\n  ExSyncLib.register_group_leader()\nend\n```\n\nThis will prevent the ExSyncLib logs from overwriting your IEx prompt.\nAlternatively you can always just run `ExSyncLib.register_group_leader()` in your\nIEx prompt.\n\n## Usage for umbrella project\n\n1. Create an umbrella project\n\n```bash\nmix new my_umbrella_app --umbrella\n```\n\n2. Add exsync_lib to your `mix.exs` dependencies:\n\n```elixir\ndef deps do\n  [\n    {:exsync_lib, \"~\u003e 0.2\", only: :dev},\n  ]\nend\n```\n\n3. start your umbrella project with `exsync_lib` task\n\n```bash\niex -S mix exsync_lib\n```\n\n## Config\n\nAll configuration for this library is handled via the application environment.\n\n`:addition_dirs` - Additional directories to monitor\n\nFor example, to monitor the `priv` directory, add this to your `config.exs`:\n\n```elixir\nconfig :exsync_lib, addition_dirs: [\"/priv\"]\n```\n\n`:extensions` - List of file extensions to watch for changes. Defaults to: `[\".erl\", \".hrl\", \".ex\", \".eex\"]`\n\n`:extra_extensions` - List of additional extensions to watch for changes (cannot be used with `:extensions`)\n\nFor example, to watch `.js` and `.css` files add this to your `config.exs`:\n\n```elixir\nconfig :exsync_lib, extra_extensions: [\".js\", \".css\"]\n```\n\n`:logging_enabled` - Set to false to disable logging (default true)\n\n`:reload_callback` - A callback [MFA](https://codereviewvideos.com/blog/what-is-mfa-in-elixir/) that is called when a set of files are done reloading. Can be used to implement your own special handling to react to file reloads.\n\n`:reload_timeout` - Amount of time to wait in milliseconds before triggering the `:reload_callback`. Defaults to 150ms.\n\nFor example, to call `MyApp.MyModule.handle_reload()` add this to your `config.exs`:\n\n```elixir\nconfig :exsync_lib,\n  reload_timeout: 75,\n  reload_callback: {MyApp.MyModule, :handle_reload, []}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelson%2Fexsync_lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxelson%2Fexsync_lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelson%2Fexsync_lib/lists"}