Skip to content
This repository has been archived by the owner on May 3, 2023. It is now read-only.

[Question] Generate UML diagram from ts file #44

Open
adarshaacharya opened this issue Oct 25, 2021 · 2 comments
Open

[Question] Generate UML diagram from ts file #44

adarshaacharya opened this issue Oct 25, 2021 · 2 comments

Comments

@adarshaacharya
Copy link

Since typeorm supports .ts file for configuring ORM, is it possible to generate the ER diagram from that file too.. or just json file is supported.

@ianstokesrees-gamma
Copy link

But I just came across typeorm/typeorm#7427 which suggests the entire ormconfig.* system is being modified (perhaps deprecated?) so that may impact how this tool works.

@julien-sugg
Copy link

julien-sugg commented Apr 20, 2022

Hi,

typeorm-uml leverages typeorm. Thus, as long as typeorm supports those formats, I believe this library should too.

I am currently using typeorm-uml exclusively using ormconfig.ts files. Hence, it should also work on your end.

The easiest/minimalistic way to set this up is as follows:

  1. Install ts-node if not already leveraged in your project (any alternative to ts-node may also work)
yarn add ts-node --dev
  1. Edit your package.json to create some scripts to easily generate the diagram
"scripts": {
  "typeorm-uml": "node --require ts-node/register node_modules/typeorm-uml/bin/run"
  "database:diagram": "yarn typeorm-uml <yourOptions> <path/to/ormconfig.ts>"
}
  1. Generate your diagram:
yarn database:diagram

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants