Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/modernizing/modeling
Modeling 是一个基于代码的领域模型生成工具,支持 Java、Cpp、TypeScript、Golang 等语言。Modeling is a tools to analysis different languages by Ctags
https://github.com/modernizing/modeling
ctags model-driven-development modeling
Last synced: 16 days ago
JSON representation
Modeling 是一个基于代码的领域模型生成工具,支持 Java、Cpp、TypeScript、Golang 等语言。Modeling is a tools to analysis different languages by Ctags
- Host: GitHub
- URL: https://github.com/modernizing/modeling
- Owner: modernizing
- License: other
- Created: 2021-05-02T06:27:41.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-16T00:57:32.000Z (over 2 years ago)
- Last Synced: 2024-04-10T04:51:16.822Z (7 months ago)
- Topics: ctags, model-driven-development, modeling
- Language: Rust
- Homepage: https://inherd.org/modeling/
- Size: 407 KB
- Stars: 19
- Watchers: 6
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-modernization - Modeling
README
# Modeling
[![crates.io](https://img.shields.io/crates/v/modeling.svg)](https://crates.io/crates/modeling)
[![docs.rs](https://docs.rs/modeling/badge.svg)](https://docs.rs/modeling/)
[![license](https://img.shields.io/crates/l/modeling)](https://github.com/inherd/modeling/blob/master/LICENSE)> Modeling is a tools to analysis different languages by Ctags
process:
1. analysis `ctags`
- generate to opt
- call `ctags` with opt
- analysis `ctags` logs by regex
2. generate results
3. visual result with `visualing` (optional)language support:
- [x] Java
- [x] C#
- [x] Cpp
- [x] TypeScript
- [x] Golang
- [x] Rust
- ... others by ctags## Usage
- modeling, generate model from source code.
- concepting, generate concepts from source code.
- visualing, visualization the uml.```bash
Modeling 0.6.2USAGE:
modeling [FLAGS] [OPTIONS]FLAGS:
-b, --by-modules multiple modules
-d, --debug output debug information
-f, --field-only only load field in methods
-h, --help Prints help information
--inline-id-suffix if class's prop end with Id and class in list, will replace `int` type to `xxClass`
-m, --merge merge for same method name
-V, --version Prints version information
--without-impl-suffix if class's prop start with `IRepository` will become `Repository`
--without-parent without class inheritanceOPTIONS:
-g, --grep by grep regex rules: for example: `.*Service` [default: ]
-i, --input input dir [default: .]
-o, --output-type support: puml, mermaid, graphviz with json [default: puml]
-p, --packages ... filter by packages, like: `com.phodal.modeling`
-s, --suffixes ... filter by suffixes, like: `java` for .java file
--without-suffix remove specify suffix by text, for example `DemoDto` with be `Demo` [default: ]
```### sample: Grep with MVC
```bash
modeling --input=/youpath/ --field-only --without-parent --grep ".*Service|.*Controller|.*Repository"
```### sample: with Graphviz and Visualization
with `--output-type=graphviz`
```bash
modeling --input=/youpath --field-only -o graphviz --without-impl-suffix
```### sample: puml to Image
convert to image: `plantuml modeling.puml modeling.svg -tsvg`
### with Visualization
PS: need to set `--output-type graphviz`, in order to generate `output.json` file
```bash
modeling -i youpath -o graphviz
visualing
```## Library
```
cargo install modeling
modeling .
```#### Library
```rust
use modeling::{by_dir};
use modeling::render::PlantUmlRender;let classes = by_dir("src/");
let puml = PlantUmlRender::render(&classes);
```output sample:
```puml
@startumlclass Animal {
+ string name
+ string constructor()
+move()
}class Horse extends Animal {
+move()
}class Snake extends Animal {
+move()
}@enduml
```License
---ctags analysis based on [https://github.com/dalance/ptags](https://github.com/dalance/ptags) with MIT, see in [src](plugins/coco_struct_analysis/src)
ctags parser rewrite from Golang's [https://github.com/ruben2020/tags2uml](https://github.com/ruben2020/tags2uml) with Apache License.
@ 2020~2021 This code is distributed under the MIT license. See `LICENSE` in this directory.