{"id":13583417,"url":"https://github.com/jupe/puml2code","last_synced_at":"2025-04-04T12:09:19.061Z","repository":{"id":39500194,"uuid":"173682873","full_name":"jupe/puml2code","owner":"jupe","description":"PlantUML code generator","archived":false,"fork":false,"pushed_at":"2025-03-28T03:37:19.000Z","size":633,"stargazers_count":112,"open_issues_count":48,"forks_count":23,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T11:11:12.370Z","etag":null,"topics":["code-generator","es6","plantuml","puml","python"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jupe.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":"2019-03-04T06:00:43.000Z","updated_at":"2025-03-04T05:21:39.000Z","dependencies_parsed_at":"2023-11-30T16:29:20.466Z","dependency_job_id":"14cc2364-1ec8-4384-93f6-822068f2765f","html_url":"https://github.com/jupe/puml2code","commit_stats":{"total_commits":55,"total_committers":6,"mean_commits":9.166666666666666,"dds":0.7090909090909091,"last_synced_commit":"08a1f51ba8939a897fbc25d615927d557dac9154"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jupe%2Fpuml2code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jupe%2Fpuml2code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jupe%2Fpuml2code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jupe%2Fpuml2code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jupe","download_url":"https://codeload.github.com/jupe/puml2code/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174453,"owners_count":20896078,"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":["code-generator","es6","plantuml","puml","python"],"created_at":"2024-08-01T15:03:28.048Z","updated_at":"2025-04-04T12:09:19.030Z","avatar_url":"https://github.com/jupe.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/puml2code.svg)](https://badge.fury.io/js/puml2code)\n[![CircleCI](https://circleci.com/gh/jupe/puml2code/tree/master.svg?style=svg)](https://circleci.com/gh/jupe/puml2code/tree/master)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![License badge](https://img.shields.io/badge/license-MIT-blue.svg)](https://img.shields.io) \n\n\n## PlantUML code generator (puml2code)\n\na command line utility that convert Plantuml -text file that represent class UML diagram to source code.\npuml parser based on [plantuml-code-generator](https://github.com/bafolts/plantuml-code-generator) but is rewritten with es6.\n\n### Installation\n\nGlobal installation brings `puml2code` command to PATH\n```bash\n$ npm i -g puml2code\n```\n\nDevelopment installation\n```bash\n$ git clone https://github.com/jupe/puml2code.git\n$ npm i\n$ bin/puml2code -h\n```\n\nRunning tests\n```bash\n$ npm test\n```\n\n\n### Supported output languages\n* [CoffeeScript](test/data/car.coffeescript.coffee) (coffeescript)\n* [C#](test/data/car.csharp.cs) (csharp)\n* [C++](test/data/car.cpp.cpp) (cpp)\n* [ECMAScript5](test/data/car.ecmascript5.js) (ecmascript5)\n* [ECMAScript6](test/data/car.ecmascript6.js) (ecmascript6) [default]\n* [Java](test/data/car.java.java) (java)\n* [PHP](test/data/car.php.php) (php)\n* [python](test/data/car.python.ts) (python)\n* [Ruby](test/data/car.ruby.rb) (ruby)\n* [TypeScript](test/data/car.typescript.ts) (typescript)\n\n\n### Supported features\n* output: file per class/console\n* template engine: [handlebars](http://handlebarsjs.com)\n* puml parser engine: [pegjs](http://pegjs.org)\n\nFeatures supported per output language:\n\n|Language|supported|docs|deps imports|\n|--------|---------|---------|-------|\n|Coffeescript|✓|||\n|C#|✓|||\n|C++|✓|✓||\n|ECMAScript5|✓|||\n|ECMAScript6|✓|✓|✓|\n|Java|✓|||\n|PHP|✓|||\n|Python|✓|✓||\n|Ruby|✓|||\n|TypeScript|✓|||\n\nFeature explanations:\n\n\n|feature|notes|\n|-------|----|\n|supported|at least source code can be generated|\n|docs|Documentation comments, eg python: docstring|\n|deps imports|Try to detect dependencies and import them top of source files|\n\n\n**NOTE:**\n\nparser and code templates are not perfect. There is planty of cases that is not yet covered or supported. Basic scenarious should work.\n\n### Problems?\n\n* If `puml2code` causes error like:\n    ```\n    Error: line: 21 column: 3: SyntaxError: Expected \"'\", \"--\", \"..\", \"__\", \"abstract \", \n    \"class \", \"hide empty members\", \"interface \", \"namespace \", \"note \", \"skinparam\", \"title \",\n    [ \\t], [#], [+], [A-Za-z_], [\\-], [\\n], [\\r\\n], [^ ,\\n\\r\\t(){}], or [}] but \"{\" found.\n    ```\n    it's most probably because [PEG.js based grammar](src/parser/plantuml.pegjs) does not have support \n    for plantuml format you have in input file. \n    \n    **What should I do?**\n    \n    Please [raise ticket](https://github.com/jupe/puml2code/issues/new?template=grammar.md) with example plantuml file that does not work\n\n* generated source code does not look like you expected\n    \n    **What should I do?**\n    \n    Please [raise ticket](https://github.com/jupe/puml2code/issues/new?template=output.md) with example plantuml file and generated source\n    code with some description how it should look like.\n\n\n**NOTE** If you are able to create PR that solves your issue it would be even more wellcome.\n\n### Usage\n\n```\n$ puml2code -h\nUsage: puml2code [options]\n\nOptions:\n  -V, --version       output the version number\n  -i, --input [file]  input .puml file, or \"stdin\"\n  -l, --lang [lang]   Optional output source code language (default: \"ecmascript6\")\n  -o, --out [path]    Output path. When not given output is printed to console.\n  -h, --help          output usage information\n\nSupported languages: coffeescript, csharp, ecmascript5, ecmascript6, java, php, python, ruby, typescript\n\nExamples:\n  $ puml2code -i input.puml -l ecmascript6\n  $ puml2code -h\nUse DEBUG=puml2code env variable to get traces. Example:\n  $ DEBUG=puml2code puml2code -i input.puml\n```\n\ne.g.\n```\n$ puml2code -i myfile.puml\n\nScheduler.js:\n// native modules\n// 3rd party modules\n// application modules\nconst Queue = require('./Queue');\nconst Resources = require('./Resources');\n\n\n/**\n * Class Scheduler\n */\nclass Scheduler {\n    /**\n     * TBD\n     */\n    constructor(queue, resources) {\n        this._queue = query;\n        this._resoures = resources;\n    }\n\n    /**\n     * @param {Queue} queue TBD\n     */\n    _test(queue) {\n        // TBD\n    }\n\n    /**\n     * @param {Queue} queue TBD\n     */\n    __protected(queue) {\n        // TBD\n    }\n}\n```\nSee more output examples [here](examples)\n\n## Tool logic\n![logi](logic.png)\n\n\n### LICENSE:\n[MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjupe%2Fpuml2code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjupe%2Fpuml2code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjupe%2Fpuml2code/lists"}