{"id":23239424,"url":"https://github.com/r32/macro-aux","last_synced_at":"2026-03-20T01:03:12.956Z","repository":{"id":78669617,"uuid":"534515416","full_name":"R32/macro-aux","owner":"R32","description":"A collection of haxe macro utilities.","archived":false,"fork":false,"pushed_at":"2024-06-11T06:10:39.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T22:13:33.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haxe","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/R32.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-09-09T05:49:37.000Z","updated_at":"2024-06-17T09:49:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc848fe9-a6aa-4a1a-befb-25ed1e787e3d","html_url":"https://github.com/R32/macro-aux","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/R32/macro-aux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R32%2Fmacro-aux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R32%2Fmacro-aux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R32%2Fmacro-aux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R32%2Fmacro-aux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/R32","download_url":"https://codeload.github.com/R32/macro-aux/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R32%2Fmacro-aux/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28561858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T03:31:16.861Z","status":"ssl_error","status_checked_at":"2026-01-19T03:31:15.069Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-19T04:28:08.933Z","updated_at":"2026-01-19T05:32:47.120Z","avatar_url":"https://github.com/R32.png","language":"Haxe","funding_links":[],"categories":[],"sub_categories":[],"readme":"macro aux\r\n------\r\n\r\nA collection of haxe macro auxiliaries\r\n\r\n### GitVersion\r\n\r\nRetrieves the git hash string from current directory.\r\n\r\n```haxe\r\nvar version = maux.GitVersion.get(true);\r\n\r\n// js output:\r\nvar version = \"master@b3bc166\";\r\n```\r\n\r\n### BitFields\r\n\r\nA simple bit fileds build tool.\r\n\r\n```haxe\r\n#if !macro\r\n@:build(maux.BitFields.build())\r\n#end\r\nabstract RGB(Int) {\r\n\r\n\tvar b : _8; // low bits\r\n\tvar g : _8;\r\n\tvar r : _8; // high bits\r\n\r\n\t// The macro will automatically generate additional \"name_offset\", \"name_mask\" fields\r\n\tinline function new( r : Int, g : Int, b : Int ) {\r\n\t\tthis = r \u003c\u003c r_offset | g \u003c\u003c g_offset | b \u003c\u003c b_offset;\r\n\t}\r\n}\r\n// ...\r\nvar rgb = new RGB(0x60, 0x70, 0x80);\r\nassert(rgb.r == 0x60);  // getter\r\nrgb.r = 0xFF;           // setter\r\nassert(rgb.r == 0xFF);\r\n```\r\n\r\n### ModuleLevel\r\n\r\nIt's used to strip the module-level prefix of the field, to generate cleaner JavaScript code.\r\n\r\nMain.hx :\r\n\r\n```haxe\r\nfunction foo() {\r\n\ttrace(\"hello world!\");\r\n}\r\nfunction main() {\r\n\tfoo();\r\n}\r\n```\r\n\r\nbuild.hxml :\r\n\r\n```bash\r\n-main Main\r\n-lib macro-aux\r\n--macro maux.ModuleLevel.strip()\r\n--js main.js\r\n```\r\n\r\nGenerated main.js :\r\n\r\n```js\r\nfunction foo() {\r\n\tconsole.log(\"src/Main.hx:2:\",\"hello world!\");\r\n}\r\nfunction main() {\r\n\tfoo();\r\n}\r\nmain();\r\n```\r\n\r\n### CStruct\r\n\r\nIt's used to construct a raw data block similar to the C language.\r\n\r\n[CStruct](maux/CStruct.hx)\r\n\r\n### ES\r\n\r\n[Some utility functions for Javascript](maux/ES.hx)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr32%2Fmacro-aux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr32%2Fmacro-aux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr32%2Fmacro-aux/lists"}