{"id":19382654,"url":"https://github.com/sinamfe/sina-meta-serialize","last_synced_at":"2025-04-23T20:32:25.043Z","repository":{"id":86621468,"uuid":"180102648","full_name":"SinaMFE/sina-meta-serialize","owner":"SinaMFE","description":"A tool to serialize meta data of ts classes in compiling stage.","archived":false,"fork":false,"pushed_at":"2019-12-24T07:07:26.000Z","size":121,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-02T20:11:16.492Z","etag":null,"topics":["compile","design","meta-data","serialization","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/SinaMFE.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":"2019-04-08T08:19:55.000Z","updated_at":"2021-09-23T09:14:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"56e0b49a-8ce5-4f42-af9e-c1eba5c49122","html_url":"https://github.com/SinaMFE/sina-meta-serialize","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SinaMFE%2Fsina-meta-serialize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SinaMFE%2Fsina-meta-serialize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SinaMFE%2Fsina-meta-serialize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SinaMFE%2Fsina-meta-serialize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SinaMFE","download_url":"https://codeload.github.com/SinaMFE/sina-meta-serialize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250509839,"owners_count":21442508,"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":["compile","design","meta-data","serialization","typescript"],"created_at":"2024-11-10T09:22:37.975Z","updated_at":"2025-04-23T20:32:25.037Z","avatar_url":"https://github.com/SinaMFE.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sina-meta-serialize\nA tool to serilize classes in vue files and can be used for designer. All processes are in compiling stage.\n\n## Usage\nTo serialize dozens of vue files:\n```javascript\nconst {\n  customSerializeVueFiles,\n} = require(\"sina-meta-serialize\");\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nconst glob = require(\"glob\");\n\nconst config: CustomSerializerConfig = {\n  serializeDecoratorNameList: [\"Component\", \"Prop\", \"Inject\", \"Design\"],\n  entryDecoratorFilters: [\"Component\"],\n  withSinaFormatTransformer: true\n};\n\nfunction main() {\n  const output = customSerializeVueFiles([\"./src/index.vue\", \"./src/card.vue\"], config);\n  fs.writeFileSync(\"classes.json\", JSON.stringify(output, undefined, 2));\n}\n\nmain()\n```\n\nOr you can just pass a directory to a export function `customSerializeVueByDirectory`:\n```javascript\nconst { customSerializeVueByDirectory } = require(\"sina-meta-serialize\");\nconst fs = require(\"fs\");\nconst path = require(\"path\")\nconst config = {\n  serializeDecoratorNameList: [\n    \"SComponent\",\n    \"Design\",\n    \"dataType\"\n  ],\n  entryDecoratorFilters: [\"SComponent\"],\n  withSinaFormatTransformer: true\n};\n\nmain();\n\nasync function main() {\n  const output = await customSerializeVueByDirectory(path.join(__dirname, \"./src\"), config);\n  fs.writeFileSync(\"./result.json\", JSON.stringify(output, undefined, 2));\n}\n```\n\n## Interface\n\n**customSerializeVueByDirectory**`(path, config)`accept a directory path and process all vue files in it. Parameter `path` is the location of target directory. Parameter `config` is some configuration to specify serialization functions.\n\n`config` includes:\n\n- **serializeDecoratorNameList**: Accept a string array to specify decorators which should be serialized. \n\n- **entryDecoratorFilters**: Accept a string array to define decorators which entry class should be decorated by. Only classes with those decorators will be serialized.\n\n- **withSinaFormatTransformer**: Accept a boolean. If this is `true` then the output will be transformed into format sina desire. Otherwise it will be normal format.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinamfe%2Fsina-meta-serialize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinamfe%2Fsina-meta-serialize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinamfe%2Fsina-meta-serialize/lists"}