From 27a0235a06580ee3f8df097e6d04cba71446bc34 Mon Sep 17 00:00:00 2001 From: Spacelord Date: Sat, 6 May 2023 20:48:58 +0200 Subject: [PATCH] Added Prisma (DBML) Documentation Generator. --- package-lock.json | 284 +++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + prisma/schema.prisma | 9 ++ 3 files changed, 294 insertions(+) diff --git a/package-lock.json b/package-lock.json index 8e1a84e..93e94a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,6 +29,7 @@ "@types/signale": "^1.4.4", "eslint": "^8.39.0", "eslint-config-prettier": "^8.8.0", + "prisma-dbml-generator": "^0.10.0", "prisma-docs-generator": "^0.7.0", "typescript": "^5.0.4" } @@ -3986,6 +3987,289 @@ "node": ">=14.17" } }, + "node_modules/prisma-dbml-generator": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/prisma-dbml-generator/-/prisma-dbml-generator-0.10.0.tgz", + "integrity": "sha512-5lguDOHGIBhKlWnWUTPTN/swZnDt9FyKQFP6VSgR2Y9Nb0YpyxbvnGZg+lvbUvNzWraqGy/DBODB5KqqhRimbQ==", + "dev": true, + "dependencies": { + "@prisma/generator-helper": "4.6.1", + "@prisma/internals": "4.6.1" + }, + "bin": { + "prisma-dbml-generator": "dist/generator.js" + } + }, + "node_modules/prisma-dbml-generator/node_modules/@prisma/debug": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-4.6.1.tgz", + "integrity": "sha512-BezDvSenTgQDQ6WA3TdTDGcrt0Oh4vmpZtmSOYm1KaSZiSVIL2xT0P9TFM3vtOa4wn7sn/003PyTSxyHS3mShg==", + "dev": true, + "dependencies": { + "@types/debug": "4.1.7", + "debug": "4.3.4", + "strip-ansi": "6.0.1" + } + }, + "node_modules/prisma-dbml-generator/node_modules/@prisma/engine-core": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@prisma/engine-core/-/engine-core-4.6.1.tgz", + "integrity": "sha512-JtvdEy9GeGU/xeTYOq3SEN4DiAytHoQty/4pJTZ5vNoGMnu7XF1ToprOCPzyT5oSgm3oQQuwpXMVaebJegwA4Q==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.1.0", + "@opentelemetry/sdk-trace-base": "^1.4.0", + "@prisma/debug": "4.6.1", + "@prisma/engines": "4.6.1", + "@prisma/generator-helper": "4.6.1", + "@prisma/get-platform": "4.6.1", + "chalk": "4.1.2", + "execa": "5.1.1", + "get-stream": "6.0.1", + "indent-string": "4.0.0", + "new-github-issue-url": "0.2.1", + "p-retry": "4.6.2", + "strip-ansi": "6.0.1", + "undici": "5.11.0" + } + }, + "node_modules/prisma-dbml-generator/node_modules/@prisma/engines": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.6.1.tgz", + "integrity": "sha512-3u2/XxvxB+Q7cMXHnKU0CpBiUK1QWqpgiBv28YDo1zOIJE3FCF8DI2vrp6vuwjGt5h0JGXDSvmSf4D4maVjJdw==", + "dev": true, + "hasInstallScript": true + }, + "node_modules/prisma-dbml-generator/node_modules/@prisma/fetch-engine": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-4.6.1.tgz", + "integrity": "sha512-0Nggqzd6J630wO65i5LjyYxarHSZL3mlN04j98Eff5tzhymwv6A8QEMMwuIJY3B5mQ+3ns3q6zZsJ3Ef063RUA==", + "dev": true, + "dependencies": { + "@prisma/debug": "4.6.1", + "@prisma/get-platform": "4.6.1", + "chalk": "4.1.2", + "execa": "5.1.1", + "find-cache-dir": "3.3.2", + "hasha": "5.2.2", + "http-proxy-agent": "5.0.0", + "https-proxy-agent": "5.0.1", + "make-dir": "3.1.0", + "node-fetch": "2.6.7", + "p-filter": "2.1.0", + "p-map": "4.0.0", + "p-retry": "4.6.2", + "progress": "2.0.3", + "rimraf": "3.0.2", + "temp-dir": "2.0.0", + "tempy": "1.0.1" + } + }, + "node_modules/prisma-dbml-generator/node_modules/@prisma/generator-helper": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@prisma/generator-helper/-/generator-helper-4.6.1.tgz", + "integrity": "sha512-70XBmqDhmpe8H35ttOJOgyg1OpppO/uelILB1SIwjeSI7PHHdU2+Y/+LkpnifkCEpSZKIhxEIPbHx17m2neAsA==", + "dev": true, + "dependencies": { + "@prisma/debug": "4.6.1", + "@types/cross-spawn": "6.0.2", + "chalk": "4.1.2", + "cross-spawn": "7.0.3" + } + }, + "node_modules/prisma-dbml-generator/node_modules/@prisma/get-platform": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-4.6.1.tgz", + "integrity": "sha512-JBlzN53Q00bTfk3mPxeprAx8LLN7bmEwTGZ3fFjbCKZACsHtbDaaqtIkqXwk0tv1jJ3jLYZfcq7NlvdOPyJhGw==", + "dev": true, + "dependencies": { + "@prisma/debug": "4.6.1" + } + }, + "node_modules/prisma-dbml-generator/node_modules/@prisma/internals": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@prisma/internals/-/internals-4.6.1.tgz", + "integrity": "sha512-oPE01UMMY5W9PAr+uP0MaHO4o7SD3b7dVqaEuZsj6NRN7jtoKujQXp+zo74BAeqjLJyCiHXhTIReuO9NExiZtg==", + "dev": true, + "dependencies": { + "@prisma/debug": "4.6.1", + "@prisma/engine-core": "4.6.1", + "@prisma/engines": "4.6.1", + "@prisma/fetch-engine": "4.6.1", + "@prisma/generator-helper": "4.6.1", + "@prisma/get-platform": "4.6.1", + "@prisma/prisma-fmt-wasm": "4.6.1-3.694eea289a8462c80264df36757e4fdc129b1b32", + "archiver": "5.3.1", + "arg": "5.0.2", + "chalk": "4.1.2", + "checkpoint-client": "1.1.21", + "cli-truncate": "2.1.0", + "dotenv": "16.0.3", + "escape-string-regexp": "4.0.0", + "execa": "5.1.1", + "find-up": "5.0.0", + "fp-ts": "2.13.1", + "fs-extra": "10.1.0", + "fs-jetpack": "5.1.0", + "global-dirs": "3.0.0", + "globby": "11.1.0", + "has-yarn": "2.1.0", + "is-windows": "^1.0.2", + "is-wsl": "^2.2.0", + "make-dir": "3.1.0", + "new-github-issue-url": "0.2.1", + "node-fetch": "2.6.7", + "open": "7", + "ora": "5.4.1", + "p-map": "4.0.0", + "prompts": "2.4.2", + "read-pkg-up": "7.0.1", + "replace-string": "3.1.0", + "resolve": "1.22.1", + "rimraf": "3.0.2", + "string-width": "4.2.3", + "strip-ansi": "6.0.1", + "strip-indent": "3.0.0", + "temp-dir": "2.0.0", + "temp-write": "4.0.0", + "tempy": "1.0.1", + "terminal-link": "2.1.1", + "tmp": "0.2.1", + "ts-pattern": "^4.0.1" + } + }, + "node_modules/prisma-dbml-generator/node_modules/@prisma/prisma-fmt-wasm": { + "version": "4.6.1-3.694eea289a8462c80264df36757e4fdc129b1b32", + "resolved": "https://registry.npmjs.org/@prisma/prisma-fmt-wasm/-/prisma-fmt-wasm-4.6.1-3.694eea289a8462c80264df36757e4fdc129b1b32.tgz", + "integrity": "sha512-hT+YRaH5NTZDYhLhSKMUdtY+i8sKkjjFwiDYhy6688G+H8oFklIwPNeApKH8Jw5bbtuH6onIzo1oivapOFJryg==", + "dev": true + }, + "node_modules/prisma-dbml-generator/node_modules/checkpoint-client": { + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/checkpoint-client/-/checkpoint-client-1.1.21.tgz", + "integrity": "sha512-bcrcnJncn6uGhj06IIsWvUBPyJWK1ZezDbLCJ//IQEYXkUobhGvOOBlHe9K5x0ZMkAZGinPB4T+lTUmFz/acWQ==", + "dev": true, + "dependencies": { + "ci-info": "3.3.0", + "env-paths": "2.2.1", + "fast-write-atomic": "0.2.1", + "make-dir": "3.1.0", + "ms": "2.1.3", + "node-fetch": "2.6.7", + "uuid": "8.3.2" + } + }, + "node_modules/prisma-dbml-generator/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/prisma-dbml-generator/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/prisma-dbml-generator/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/prisma-dbml-generator/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/prisma-dbml-generator/node_modules/global-dirs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", + "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", + "dev": true, + "dependencies": { + "ini": "2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/prisma-dbml-generator/node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/prisma-dbml-generator/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/prisma-dbml-generator/node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/prisma-dbml-generator/node_modules/undici": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.11.0.tgz", + "integrity": "sha512-oWjWJHzFet0Ow4YZBkyiJwiK5vWqEYoH7BINzJAJOLedZ++JpAlCbUktW2GQ2DS2FpKmxD/JMtWUUWl1BtghGw==", + "dev": true, + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=12.18" + } + }, "node_modules/prisma-docs-generator": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/prisma-docs-generator/-/prisma-docs-generator-0.7.0.tgz", diff --git a/package.json b/package.json index 9feb1bc..51510ae 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@types/signale": "^1.4.4", "eslint": "^8.39.0", "eslint-config-prettier": "^8.8.0", + "prisma-dbml-generator": "^0.10.0", "prisma-docs-generator": "^0.7.0", "typescript": "^5.0.4" } diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 21d36a4..825d9f6 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -16,6 +16,15 @@ generator docs { output = "../docs" } +// https://github.com/notiz-dev/prisma-dbml-generator +// Viewer: https://dbdiagram.io/d +generator dbml { + provider = "prisma-dbml-generator" + output = "../docs" + outputName = "schema.dbml" + projectName = "AssetFlow" +} + enum Status { normal borrowed