prisma-generator-plantuml-erd 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +70 -0
- package/dist/generator.js +10 -2
- package/dist/generator.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [1.0.2](https://github.com/dbgso/prisma-generator-plantuml-erd/compare/v1.0.1...v1.0.2) (2022-11-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* package-lock.json ([#13](https://github.com/dbgso/prisma-generator-plantuml-erd/issues/13)) ([492c425](https://github.com/dbgso/prisma-generator-plantuml-erd/commit/492c42537594c54e5e704b8cf9463cb562ee7bb2))
|
|
7
|
+
|
|
8
|
+
## [1.0.1](https://github.com/dbgso/prisma-generator-plantuml-erd/compare/v1.0.0...v1.0.1) (2022-11-08)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* delete unnecessary code ([457fff9](https://github.com/dbgso/prisma-generator-plantuml-erd/commit/457fff95aff5ef058f36fc5ca32149931e5e9c42))
|
|
14
|
+
* output default value ([62641c3](https://github.com/dbgso/prisma-generator-plantuml-erd/commit/62641c3bcfaea875fea6f47e51a7bdd37536a0d7))
|
|
15
|
+
|
|
1
16
|
# 1.0.0 (2022-11-08)
|
|
2
17
|
|
|
3
18
|
|
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# prisma-generator-plantuml-erd
|
|
2
|
+
|
|
3
|
+
Prisma generator to create an ER Diagram for plantuml.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# usage
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm i -D prisma-generator-plantuml-erd
|
|
11
|
+
# or
|
|
12
|
+
yarn add -D prisma-generator-plantuml-erd
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Add to your schema.prisma
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
generator erd_plantuml {
|
|
19
|
+
provider = "prisma-generator-plantuml-erd"
|
|
20
|
+
output = "erd.puml"
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
# Versions
|
|
25
|
+
|
|
26
|
+
This generator only support prisma3.
|
|
27
|
+
If you use the version greater than 4, this plugin is not work.
|
|
28
|
+
|
|
29
|
+
# Options
|
|
30
|
+
|
|
31
|
+
## output
|
|
32
|
+
|
|
33
|
+
The path of generated plantuml file path.
|
|
34
|
+
The default value is './erd.puml'
|
|
35
|
+
|
|
36
|
+
## usePhysicalTableName
|
|
37
|
+
|
|
38
|
+
If this flag is true, physical table name is used for name of table on er diagram.
|
|
39
|
+
The default value is false;
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
model User {
|
|
44
|
+
id String @id
|
|
45
|
+
|
|
46
|
+
@map("users")
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If this flag is set to true, then "users" will be displayed on the diagram, otherwise "user" is displayed on the diagram.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## exportPerTables
|
|
54
|
+
|
|
55
|
+
If this flag is true, generate some tables
|
|
56
|
+
If this flag is true, it also generate some diargrams that based on each table.
|
|
57
|
+
The diagrams is rendered with only the tables that related with base table.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## Example
|
|
61
|
+
|
|
62
|
+
The example config is here.
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
output: "path/to/output.puml",
|
|
66
|
+
usePhysicalTableName: true,
|
|
67
|
+
lineLength: "---"
|
|
68
|
+
exportPerTables: true
|
|
69
|
+
```
|
|
70
|
+
|
package/dist/generator.js
CHANGED
|
@@ -13,12 +13,20 @@ const { version } = require('../package.json');
|
|
|
13
13
|
};
|
|
14
14
|
},
|
|
15
15
|
onGenerate: async (options) => {
|
|
16
|
-
|
|
16
|
+
const output = getOutput(options);
|
|
17
17
|
const generator = new plantuml_erd_1.PlantUmlErdGenerator({
|
|
18
|
-
output:
|
|
18
|
+
output: output,
|
|
19
19
|
...options.generator.config,
|
|
20
20
|
});
|
|
21
21
|
await generator.generate(options.dmmf);
|
|
22
22
|
},
|
|
23
23
|
});
|
|
24
|
+
function getOutput(options) {
|
|
25
|
+
if (options.generator.output) {
|
|
26
|
+
if (options.generator.output.fromEnvVar === null) {
|
|
27
|
+
return options.generator.output.value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
24
32
|
//# sourceMappingURL=generator.js.map
|
package/dist/generator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":";;AAAA,+DAA8E;AAC9E,2CAA6C;AAC7C,iDAAsD;AAEtD,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE/C,IAAA,mCAAgB,EAAC;IACf,UAAU;QACR,OAAO;YACL,OAAO;YACP,aAAa,EAAE,cAAc;YAC7B,UAAU,EAAE,0BAAc;SAC3B,CAAC;IACJ,CAAC;IACD,UAAU,EAAE,KAAK,EAAE,OAAyB,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":";;AAAA,+DAA8E;AAC9E,2CAA6C;AAC7C,iDAAsD;AAEtD,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE/C,IAAA,mCAAgB,EAAC;IACf,UAAU;QACR,OAAO;YACL,OAAO;YACP,aAAa,EAAE,cAAc;YAC7B,UAAU,EAAE,0BAAc;SAC3B,CAAC;IACJ,CAAC;IACD,UAAU,EAAE,KAAK,EAAE,OAAyB,EAAE,EAAE;QAC9C,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QAElC,MAAM,SAAS,GAAG,IAAI,mCAAoB,CAAC;YACzC,MAAM,EAAE,MAAM;YACd,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM;SAC5B,CAAC,CAAC;QACH,MAAM,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACF,CAAC,CAAC;AACH,SAAS,SAAS,CAAC,OAAyB;IAC1C,IAAI,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE;QAC5B,IAAI,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,KAAK,IAAI,EAAE;YAChD,OAAO,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC;SACvC;KACF;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prisma-generator-plantuml-erd",
|
|
3
3
|
"description": "Provide a description about your generator",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"main": "dist/generator.js",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"ts-jest": "^29.0.3",
|
|
42
42
|
"typescript": "4.6.2"
|
|
43
43
|
},
|
|
44
|
-
"homepage": "
|
|
44
|
+
"homepage": "https://github.com/dbgso/prisma-generator-plantuml-erd.git",
|
|
45
45
|
"repository": {
|
|
46
46
|
"type": "git",
|
|
47
47
|
"url": "https://github.com/dbgso/prisma-generator-plantuml-erd.git"
|