{"id":16701412,"url":"https://github.com/ferd/alias_transform","last_synced_at":"2025-04-10T04:11:18.291Z","repository":{"id":141683266,"uuid":"299963066","full_name":"ferd/alias_transform","owner":"ferd","description":"A parse transform to introduce module aliasing into Erlang code","archived":false,"fork":false,"pushed_at":"2020-09-30T16:16:29.000Z","size":6,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-24T05:27:03.308Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ferd.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-09-30T15:21:25.000Z","updated_at":"2023-09-21T12:56:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"6ad8b694-1d2c-42d1-87b4-1b763eccdb6e","html_url":"https://github.com/ferd/alias_transform","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferd%2Falias_transform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferd%2Falias_transform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferd%2Falias_transform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferd%2Falias_transform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ferd","download_url":"https://codeload.github.com/ferd/alias_transform/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154990,"owners_count":21056543,"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-10-12T18:43:57.668Z","updated_at":"2025-04-10T04:11:18.283Z","avatar_url":"https://github.com/ferd.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"alias_transform\n=====\n\nA demo library that introduces module aliasing attributes into an Erlang code base.\n\nImport it in your project by declaring a build-time dependency in `rebar.config`:\n\n```erlang\n{deps, [\n    {alias_transform,\n        {git, \"https://github.com/ferd/alias_transform.git\", {branch, \"main\"}}}\n}.\n```\n\nYou can then configure the parse transform to run against all your modules:\n\n```erlang\n{erl_opts, [\n    {parse_transform, alias_transform}\n]}.\n```\n\nThere is no need to declare the library as a run-time dependency since it\noperates entirely at compile-time.  Inside any Erlang module, you can declare\nand use aliases such as:\n\n```erlang\n-module(whatever).\n\n%%      Original Module Name                         Short Alias\n-alias({thrift_foo_namespace_bar_module_baz_service, service}).\n\nf() -\u003e\n    %% The call is automatically substituted here:\n    fun service:call/0,\n    %% and also in:\n    service:call().\n```\n\n## Limitations\n\nCurrently, this does not handle cases such as `apply(M, F, Args)`,\n`spawn(M, F, Args)`, or module names passed as process or table names,\nand so on.\n\nIt wouldn't necessarily be super hard to cover the direct literal cases,\nbut it would fail when indirect assingment using variables takes place.\n\nSimilarly, remote types of the form `M:T(...)` are currently not expanded.\n\nThis is more of a proof of concept than a serious attempt.\n\n## Development\n\nThere's a minimal test suite in `test/`. You can execute it by calling `rebar3 ct`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferd%2Falias_transform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fferd%2Falias_transform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferd%2Falias_transform/lists"}