@nonsoo/prisma-mermaid 0.1.0 → 0.1.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Prisma to Mermaid Generator
2
2
 
3
- Generate Mermaid class diagrams and Mermaid ERD diagrams directly from your Prisma schema. This package exposes a Prisma generator that runs during `prisma generate` as well as two programmatic helpers -- generateMermaidClass and generateMermaidERD.
3
+ Generate Mermaid class diagrams and Mermaid ERD diagrams directly from your Prisma schema. This package exposes a Prisma generator that runs during `prisma generate` as well as two helpers functions -- generateMermaidClass and generateMermaidERD.
4
4
 
5
5
  ## Installation
6
6
 
@@ -10,7 +10,7 @@ npm i --save-dev @nonsoo/prisma-mermaid @mermaid-js/mermaid-cli
10
10
 
11
11
  ## Usage (Prisma Generator)
12
12
 
13
- Add the following generator to your prisma schema
13
+ Add the following generator to your prisma schema and run `npx prisma generate` in your terminal.
14
14
 
15
15
  ```prisma
16
16
  generator diagram {
@@ -20,9 +20,17 @@ generator diagram {
20
20
  }
21
21
  ```
22
22
 
23
- `format` Options
23
+ Once Mermaid files `.mmd` are generated you can use the mermaid cli to render the file as an SVG, PNG, embed it in Markdown, etc.
24
24
 
25
- | Value | Description |
25
+ Run the the following command to generate SVG
26
+
27
+ ```bash
28
+ npx mmdc -i <path/input-file>.mmd -o <path/output-file>.svg
29
+ ```
30
+
31
+ ### Format options
32
+
33
+ | Format Value | Description |
26
34
  | ------------- | --------------------------------- |
27
35
  | mermaid-erd | Generates a Mermaid ERD diagram |
28
36
  | mermaid-class | Generates a Mermaid class diagram |
@@ -56,10 +64,10 @@ await generateMermaidERD({
56
64
  });
57
65
  ```
58
66
 
59
- ## Philosophy
67
+ ## Purpose
60
68
 
61
69
  Documentation should evolve alongside the code it describes. Diagrams-as-code tools such as Mermaid make it easier for teams to maintain clear, accurate diagrams as their systems grow and change. However, creating these diagrams manually — especially for database schemas — still introduces friction and the risk of diagrams falling out of sync with the system.
62
70
 
63
- Prisma already provides a single source of truth for your data model through the Prisma schema. Therefore, by generating diagrams directly from this schema, we can ensure documentation stays automatically aligned with the current state of the database models.
71
+ Prisma already provides a single source of truth for your data model through the Prisma schema. Therefore, by generating diagrams directly from the schema, we can ensure documentation stays automatically aligned with the current state of the database models.
64
72
 
65
- This library bridges that gap. It transforms your Prisma schema into Mermaid-powered ERD or class diagrams, combining code generation with diagrams-as-code. Once generated, these diagrams can be used to create Markdown files, SVGs, PDFs, or any other Mermaid-supported output — always consistent, always up to date.
73
+ This library bridges that gap. It transforms your Prisma schema into a Mermaid ERD or class diagrams, combining code generation with diagrams-as-code. Once generated, these diagrams can be used to create Markdown files, SVGs, PDFs, or any other Mermaid-supported output — always consistent, always up to date.
@@ -1727,7 +1727,7 @@ var prismaGenerators = /* @__PURE__ */ new Map([
1727
1727
  // package.json
1728
1728
  var package_default = {
1729
1729
  name: "@nonsoo/prisma-mermaid",
1730
- version: "0.1.0",
1730
+ version: "0.1.2",
1731
1731
  description: "A Prisma generator that generates Mermaid Class or ER diagrams from your Prisma schema.",
1732
1732
  main: "build/index.js",
1733
1733
  bin: {
@@ -1737,9 +1737,6 @@ var package_default = {
1737
1737
  files: [
1738
1738
  "build"
1739
1739
  ],
1740
- publishConfig: {
1741
- access: "public"
1742
- },
1743
1740
  scripts: {
1744
1741
  build: "tsup",
1745
1742
  lint: "eslint .",
@@ -1792,7 +1789,6 @@ var package_default = {
1792
1789
  vitest: "^4.0.10"
1793
1790
  },
1794
1791
  peerDependencies: {
1795
- prisma: "^6.10.0 || ^7.0.0",
1796
1792
  "@prisma/client": "^6.0.0 || ^7.0.0"
1797
1793
  },
1798
1794
  dependencies: {
@@ -1732,7 +1732,7 @@ var prismaGenerators = /* @__PURE__ */ new Map([
1732
1732
  // package.json
1733
1733
  var package_default = {
1734
1734
  name: "@nonsoo/prisma-mermaid",
1735
- version: "0.1.0",
1735
+ version: "0.1.2",
1736
1736
  description: "A Prisma generator that generates Mermaid Class or ER diagrams from your Prisma schema.",
1737
1737
  main: "build/index.js",
1738
1738
  bin: {
@@ -1742,9 +1742,6 @@ var package_default = {
1742
1742
  files: [
1743
1743
  "build"
1744
1744
  ],
1745
- publishConfig: {
1746
- access: "public"
1747
- },
1748
1745
  scripts: {
1749
1746
  build: "tsup",
1750
1747
  lint: "eslint .",
@@ -1797,7 +1794,6 @@ var package_default = {
1797
1794
  vitest: "^4.0.10"
1798
1795
  },
1799
1796
  peerDependencies: {
1800
- prisma: "^6.10.0 || ^7.0.0",
1801
1797
  "@prisma/client": "^6.0.0 || ^7.0.0"
1802
1798
  },
1803
1799
  dependencies: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nonsoo/prisma-mermaid",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "A Prisma generator that generates Mermaid Class or ER diagrams from your Prisma schema.",
5
5
  "main": "build/index.js",
6
6
  "bin": {
@@ -10,9 +10,6 @@
10
10
  "files": [
11
11
  "build"
12
12
  ],
13
- "publishConfig": {
14
- "access": "public"
15
- },
16
13
  "scripts": {
17
14
  "build": "tsup",
18
15
  "lint": "eslint .",
@@ -65,7 +62,6 @@
65
62
  "vitest": "^4.0.10"
66
63
  },
67
64
  "peerDependencies": {
68
- "prisma": "^6.10.0 || ^7.0.0",
69
65
  "@prisma/client": "^6.0.0 || ^7.0.0"
70
66
  },
71
67
  "dependencies": {