{"id":13817072,"url":"https://github.com/as-pect/visitor-as","last_synced_at":"2025-06-21T15:05:09.056Z","repository":{"id":39797297,"uuid":"247856101","full_name":"as-pect/visitor-as","owner":"as-pect","description":"Visitor utilities for AssemblyScript compiler transforms","archived":false,"fork":false,"pushed_at":"2024-02-22T17:53:54.000Z","size":2103,"stargazers_count":39,"open_issues_count":6,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-09T13:21:36.059Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/as-pect.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-03-17T01:55:15.000Z","updated_at":"2025-03-01T20:40:43.000Z","dependencies_parsed_at":"2024-01-20T16:49:25.086Z","dependency_job_id":"4ef66ebe-ec6b-497d-af17-ff91ee727c84","html_url":"https://github.com/as-pect/visitor-as","commit_stats":{"total_commits":54,"total_committers":11,"mean_commits":4.909090909090909,"dds":0.5555555555555556,"last_synced_commit":"64b02ce5fef1405514451808cef6663e75bacc89"},"previous_names":["willemneal/visitor-as"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/as-pect/visitor-as","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/as-pect%2Fvisitor-as","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/as-pect%2Fvisitor-as/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/as-pect%2Fvisitor-as/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/as-pect%2Fvisitor-as/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/as-pect","download_url":"https://codeload.github.com/as-pect/visitor-as/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/as-pect%2Fvisitor-as/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260399658,"owners_count":23003218,"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-08-04T06:00:32.984Z","updated_at":"2025-06-21T15:05:04.042Z","avatar_url":"https://github.com/as-pect.png","language":"TypeScript","funding_links":[],"categories":["Packages"],"sub_categories":[],"readme":"# Visitor utilities for AssemblyScript Compiler transformers\n\n## Example\n\n### List Fields\n\nThe transformer:\n\n```ts\nimport {\n  ClassDeclaration,\n  FieldDeclaration,\n  MethodDeclaration,\n} from \"../../as\";\nimport { ClassDecorator, registerDecorator } from \"../decorator\";\nimport { getName } from \"../utils\";\n\nclass ListMembers extends ClassDecorator {\n  visitFieldDeclaration(node: FieldDeclaration): void {\n    if (!node.name) console.log(getName(node) + \"\\n\");\n    const name = getName(node);\n    const _type = getName(node.type!);\n    this.stdout.write(name + \": \" + _type + \"\\n\");\n  }\n\n  visitMethodDeclaration(node: MethodDeclaration): void {\n    const name = getName(node);\n    if (name == \"constructor\") {\n      return;\n    }\n    const sig = getName(node.signature);\n    this.stdout.write(name + \": \" + sig + \"\\n\");\n  }\n\n  visitClassDeclaration(node: ClassDeclaration): void {\n    this.visit(node.members);\n  }\n\n  get name(): string {\n    return \"list\";\n  }\n}\n\nexport = registerDecorator(new ListMembers());\n```\n\nassembly/foo.ts:\n```ts\n@list\nclass Foo {\n  a: u8;\n  b: bool;\n  i: i32;\n}\n```\n\nAnd then compile with `--transform` flag:\n\n```\nasc assembly/foo.ts --transform ./dist/examples/list --noEmit\n```\n\nWhich prints the following to the console:\n\n```\na: u8\nb: bool\ni: i32\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fas-pect%2Fvisitor-as","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fas-pect%2Fvisitor-as","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fas-pect%2Fvisitor-as/lists"}