All Projects → jupe → puml2code

jupe / puml2code

Licence: MIT license
PlantUML code generator

Programming Languages

javascript
184084 projects - #8 most used programming language
Handlebars
879 projects
PEG.js
56 projects
C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to puml2code

c4sharp
C4Sharp (C4S) is a .net library for building C4 Model diagrams.
Stars: ✭ 159 (+140.91%)
Mutual labels:  plantuml
nuxtswagger
Nuxt-TS-Swagger
Stars: ✭ 17 (-74.24%)
Mutual labels:  code-generator
plugins
Collection of builtin GNU TeXmacs plugins
Stars: ✭ 33 (-50%)
Mutual labels:  plantuml
abi-code-gen
Generic code generator from abi
Stars: ✭ 21 (-68.18%)
Mutual labels:  code-generator
plantuml2mysql
This utility parses PlantUML class diagram and generates SQL DDL for MySQL
Stars: ✭ 110 (+66.67%)
Mutual labels:  plantuml
ballcat
😸一个快速开发脚手架,快速搭建企业级后台管理系统,并提供多种便捷starter进行功能扩展。主要功能包括前后台用户分离,菜单权限,数据权限,定时任务,访问日志,操作日志,异常日志,统一异常处理,XSS过滤,SQL防注入,国际化 等多种功能
Stars: ✭ 947 (+1334.85%)
Mutual labels:  code-generator
C4-PlantumlSkin
This library provides skinning to create C4 diagrams using PlantUml
Stars: ✭ 74 (+12.12%)
Mutual labels:  plantuml
oag
Idiomatic Go (Golang) client package generation from OpenAPI documents
Stars: ✭ 51 (-22.73%)
Mutual labels:  code-generator
IPlantUML
A Python package which defines a PlantUML cell magic for IPython.
Stars: ✭ 85 (+28.79%)
Mutual labels:  plantuml
WebApiToTypeScript
A tool for code generating TypeScript endpoints for your ASP.NET Web API controllers
Stars: ✭ 26 (-60.61%)
Mutual labels:  code-generator
evon
Fast and versatile event dispatcher code generator for Golang
Stars: ✭ 15 (-77.27%)
Mutual labels:  code-generator
Figma-to-HTML
Figma to HTML/React and truly responsive
Stars: ✭ 27 (-59.09%)
Mutual labels:  code-generator
celerio
Celerio is a code generator tool for data-driven application.
Stars: ✭ 73 (+10.61%)
Mutual labels:  code-generator
jeecg
JEECG是一款基于代码生成器的J2EE快速开发平台,开源界“小普元”超越传统商业企业级开发平台。引领新的开发模式(Online Coding模式(自定义表单) - > 代码生成器模式 - > 手工MERGE智能开发), 可以帮助解决Java项目90%的重复工作,让开发更多关注业务逻辑。既能快速提高开发效率,帮助公司节省人力成本,同时又不失灵活性。具备:表单配置能力(无需编码)、移动配置能力、工作流配置能力、报表配置能力(支持移动端)、插件开发能力(可插拔)
Stars: ✭ 2,090 (+3066.67%)
Mutual labels:  code-generator
d2a
A translator Django into SQLAlchemy.
Stars: ✭ 23 (-65.15%)
Mutual labels:  code-generator
makeitpdf
A close-to-code documentation helper
Stars: ✭ 15 (-77.27%)
Mutual labels:  plantuml
regen
Easy C++ reflection and code generation
Stars: ✭ 29 (-56.06%)
Mutual labels:  code-generator
react-demo-tab-cli
⚡ Create React components demos in a zap
Stars: ✭ 47 (-28.79%)
Mutual labels:  code-generator
Generator-Forge-1.12.2
MCreator generator plugin for Minecraft Forge 1.12.2
Stars: ✭ 20 (-69.7%)
Mutual labels:  code-generator
ME
A DSL for macro expansion ,in order to help framework develop
Stars: ✭ 24 (-63.64%)
Mutual labels:  code-generator

npm version CircleCI JavaScript Style Guide License badge

PlantUML code generator (puml2code)

a command line utility that convert Plantuml -text file that represent class UML diagram to source code. puml parser based on plantuml-code-generator but is rewritten with es6.

Installation

Global installation brings puml2code command to PATH

$ npm i -g puml2code

Development installation

$ git clone https://github.com/jupe/puml2code.git
$ npm i
$ bin/puml2code -h

Running tests

$ npm test

Supported output languages

Supported features

  • output: file per class/console
  • template engine: handlebars
  • puml parser engine: pegjs

Features supported per output language:

Language supported docs deps imports
Coffeescript
C#
C++
ECMAScript5
ECMAScript6
Java
PHP
Python
Ruby
TypeScript

Feature explanations:

feature notes
supported at least source code can be generated
docs Documentation comments, eg python: docstring
deps imports Try to detect dependencies and import them top of source files

NOTE:

parser and code templates are not perfect. There is planty of cases that is not yet covered or supported. Basic scenarious should work.

Problems?

  • If puml2code causes error like:

    Error: line: 21 column: 3: SyntaxError: Expected "'", "--", "..", "__", "abstract ", 
    "class ", "hide empty members", "interface ", "namespace ", "note ", "skinparam", "title ",
    [ \t], [#], [+], [A-Za-z_], [\-], [\n], [\r\n], [^ ,\n\r\t(){}], or [}] but "{" found.
    

    it's most probably because PEG.js based grammar does not have support for plantuml format you have in input file.

    What should I do?

    Please raise ticket with example plantuml file that does not work

  • generated source code does not look like you expected

    What should I do?

    Please raise ticket with example plantuml file and generated source code with some description how it should look like.

NOTE If you are able to create PR that solves your issue it would be even more wellcome.

Usage

$ puml2code -h
Usage: puml2code [options]

Options:
  -V, --version       output the version number
  -i, --input [file]  input .puml file, or "stdin"
  -l, --lang [lang]   Optional output source code language (default: "ecmascript6")
  -o, --out [path]    Output path. When not given output is printed to console.
  -h, --help          output usage information

Supported languages: coffeescript, csharp, ecmascript5, ecmascript6, java, php, python, ruby, typescript

Examples:
  $ puml2code -i input.puml -l ecmascript6
  $ puml2code -h
Use DEBUG=puml2code env variable to get traces. Example:
  $ DEBUG=puml2code puml2code -i input.puml

e.g.

$ puml2code -i myfile.puml

Scheduler.js:
// native modules
// 3rd party modules
// application modules
const Queue = require('./Queue');
const Resources = require('./Resources');


/**
 * Class Scheduler
 */
class Scheduler {
    /**
     * TBD
     */
    constructor(queue, resources) {
        this._queue = query;
        this._resoures = resources;
    }

    /**
     * @param {Queue} queue TBD
     */
    _test(queue) {
        // TBD
    }

    /**
     * @param {Queue} queue TBD
     */
    __protected(queue) {
        // TBD
    }
}

See more output examples here

Tool logic

logi

LICENSE:

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].