diff --git a/README.md b/README.md index 33d2de7..eb794d4 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,10 @@ [![Tests](https://github.com/joydip007x/Prisma-MultiSchema/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/joydip007x/Prisma-MultiSchema/actions/workflows/tests.yml) [![NPM](https://img.shields.io/github/languages/code-size/joydip007x/Prisma-MultiSchema?label=size)](https://github.com/joydip007x/Prisma-MultiSchema) [![Snyk](https://github.com/joydip007x/Prisma-MultiSchema/actions/workflows/snyk.yml/badge.svg?branch=main)](https://github.com/joydip007x/Prisma-MultiSchema/actions/workflows/snyk.yml) -

- - + + +

# Prisma: MultiSchema [![NPM](https://badgen.net/npm/types/prisma-multischema)](https://www.npmjs.com/package/prisma-multischema) @@ -17,211 +17,17 @@ For Multiple files inter-relation you can import schemas , to manage the relati Built using TypeScript to for ES Module and CommonJS (CJS), to Unify Multiple Structured Schemas of [Prisma-ORM](https://www.prisma.io/) -
- - -### Installation - -

- +# Installation ``` npm i prisma-multischema ``` ``` yarn add prisma-multischema ``` - > **Note** Using **VS Code** ? Install Recommended VsCode Extensions from [Dependencies (optional)](https://github.com/joydip007x/Prisma-MultiSchema#dependencies-optional) -

-
- -
- - -### Usage - -

- -- #### How to Use Tutorial : ๐Ÿ“š[MediumBlog](https://medium.com/@joydip007x/how-to-use-multiple-schema-in-prisma-40cc6b6f8d9c) || โœจ[YT Link](https://youtu.be/4GOuJLvGVko) -- Place all your schemas in `ProjectRoot/prisma/subschemas` Folder.
-Like this : - ```st - project_root - โ”œโ”€โ”€โ”€node_modules - โ”œโ”€โ”€โ”€prisma - โ”‚ โ”œโ”€โ”€โ”€subschemas <<<-----Place all your Schemas here - โ”‚ โ”‚ โ”œโ”€โ”€โ”€type - โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€user.types.prisma - โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€bookmark.types.prisma - โ”‚ โ”‚ โ””โ”€โ”€โ”€user - โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€userData.prisma - โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€validity.prisma - โ”‚ โ”‚ โ”œโ”€โ”€โ”€anything-you-want.prisma - โ”‚ โ”‚ โ”œโ”€โ”€โ”€base.prisma - | | โ””โ”€โ”€โ”€... - โ”‚ โ””โ”€โ”€โ”€schema.prisma <-- will be Auto-Generated - โ”œโ”€โ”€โ”€src - โ”‚ โ””โ”€โ”€โ”€... - โ”œโ”€โ”€โ”€package.json - โ”‚ - โ””โ”€โ”€โ”€.gitignore - ``` - >For Clearer View : [Image](https://i.ibb.co/JnyRhxT/oie-eg-Dr9-Y4ksb-NU.png) - - -- Run in Terminal - ```bash - npx prisma-multischema - ``` - -

-
- -
- - -### Project Demonstration - -

- -working example is available below - -- JavaScript : [Prisma-MultiSchema-JS-Example](https://github.com/joydip007x/Prisma-MultiSchema-JS-Example) -- TypeScript : [Prisma-MultiSchema-TS-Example](https://github.com/joydip007x/Prisma-MultiSchema-TS-Example) -

-
-
- - -### Example - -

- -Let's go with two schemas User and Bookmark on different files ,where the relation is - -- A User can have many bookmarks -- Each bookmark has an userId field - ->base.prisma [ root/prisma/subschemas/base.prisma ] -```prisma -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "mongodb" - url = env("PRISMA_DATABASE_URL") -} -``` ->user.prisma [ root/prisma/subschemas/User/user.prisma ] -```Prisma -import { Bookmark } from "..\Bookmark\bookmark" -model User { - - id String @id @default(auto()) @map("_id") @db.ObjectId - email String @unique - - Bookmark Bookmark[] -} -//MongoDB model IDs in prisma -must have a @map("_id") -//https://www.prisma.io/docs/concepts/components/prisma-schema -``` ->bookmark.prisma [ root/prisma/subschemas/Bookmark/bookmark.prisma ] -```Prisma -import { User } from "..\User\user" -model Bookmark { - - id String @id @db.ObjectId @default(auto()) @map("_id") - title String - - user User @relation(fields: [userId], references: [id]) - userId String @db.ObjectId -} -``` ->Generated schema.prisma [root/prisma/schema.prisma]
-> after Running `npx prisma-multischema` -```Prisma -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "mongodb" - url = env("PRISMA_DATABASE_URL") -} - -model User { - id String @id @default(auto()) @map("_id") @db.ObjectId - email String @unique - Bookmark Bookmark[] -} - -model Bookmark { - id String @id @default(auto()) @map("_id") @db.ObjectId - title String - user User @relation(fields: [userId], references: [id]) - userId String @db.ObjectId -} -``` ->https://www.prisma.io/docs -

-
- -
- - -### Additional - -

- -- prisma schema files starting with header `//#exclude` will be excluded in final schema -- Executing `npx prisma-multischema` will - - Automatically run : `npx prisma generate` -
So, You don't need to update `@prisma/client` manually, each time the schema updates - - Automatically run : `npx prisma format` -
because, Everyone likes clean code - -- Add `npx prisma-multischema` command as a prefix to your start script in package.json. - ```json - { - "name": "my-app", - "version": "1.0.0", - "scripts": { - "unify": "npx prisma-multischema", - "start": "npm run unify && node index.js", - ... - } - } - ``` -
Now it will run & regenerate Main Schema everytime the project starts. -

-
-
- - -### Dependencies (optional) - -

- -To use prisma import feature : (if you are using VS code, its better to use these)
-
-- Install [prisma-import](https://marketplace.visualstudio.com/items?itemName=ajmnz.prisma-import) Extension (for VS code) -- Disable Official [prisma](https://marketplace.visualstudio.com/items?itemName=Prisma.prisma) Extension (for VS code) +--- ->These are Optional Dependencies, If you can maintain multiple *.prisma schemas without TYPO ,you can ignore these. -

-
-
- - -### To-do's - -

- -- Add Support for keeping prisma's in different folder and aggregate them ( like `root/src/auth/auth.prisma `) +# [Documentation](https://github.com/joydip007x/Prisma-MultiSchema#readme) : [![NPM]( https://img.shields.io/badge/Github-joydip007x%2Fprisma--multischema-blue)](https://github.com/joydip007x/Prisma-MultiSchema#readme) -- Add Command Flags -- ~~Handle/Remove `" Error validating datasource db: "` Warning~~ Fixed - -

-
-#### Authors - [@joydip007x](https://www.github.com/joydip007x) +## Authors - [@joydip007x](https://www.github.com/joydip007x) diff --git a/bin/run b/bin/run index 288aa81..30fc7d9 100644 --- a/bin/run +++ b/bin/run @@ -9,17 +9,14 @@ function sleep(ms){ async function commands(){ await prismaUnifier(); - await sleep(300); - console.log("โฒ","\x1b[33m","Wait ! Running: ","\x1b[1m","npx prisma generate","\x1b[0m"); - const gen= exec('npx prisma generate') - const p=setTimeout(()=>{ - exec('npx prisma format') - console.log(' Run:',"\x1b[1m","\x1b[34m","npx prisma studio","\x1b[0m","to inspect your database"); - console.log(" โœ… Generated","\x1b[32m","Prisma Client ","\x1b[0m","Reference: https://pris.ly/d/client "); - console.log(" Start Using :"," import { PrismaClient } from '@prisma/client'\n", - " const prisma = new PrismaClient()"); + console.log("โฒ","\x1b[33m","Wait ! Running: ","\x1b[1m","npx prisma generate & npx prisma format","\x1b[0m"); + exec('npx prisma generate') + exec('npx prisma format') + console.log(' Run:',"\x1b[1m","\x1b[34m","npx prisma studio","\x1b[0m","to inspect your database"); + console.log(" โœ… Generated","\x1b[32m","Prisma Client ","\x1b[0m","Reference: https://pris.ly/d/client "); + console.log("\x1b[32m","Leave a starโญ:","\x1b[0m","https://github.com/joydip007x/Prisma-MultiSchema",". It helps a lot. ",); - },700); + } commands(); diff --git a/package-lock.json b/package-lock.json index af73e5e..de57988 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,24 +1,22 @@ { "name": "prisma-multischema", - "version": "1.1.0", + "version": "1.1.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "prisma-multischema", - "version": "1.0.0", + "version": "1.1.0", "license": "MIT", "bin": { - "007x": "src/generate.js" + "prisma-multischema": "bin/run" }, "devDependencies": { "@types/chai": "^4.3.5", "@types/mocha": "^9.1.1", - "@types/node": "^20.2.1", + "@types/node": "^20.8.4", "chai": "^4.3.7", - "markdown-notes-tree": "^1.12.0", "mocha": "^10.2.0", - "prisma": "^4.14.1", "ts-node": "^10.9.1", "typescript": "^4.7.4" } @@ -60,13 +58,6 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/@prisma/engines": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.14.1.tgz", - "integrity": "sha512-APqFddPVHYmWNKqc+5J5SqrLFfOghKOLZxobmguDUacxOwdEutLsbXPVhNnpFDmuQWQFbXmrTTPoRrrF6B1MWA==", - "dev": true, - "hasInstallScript": true - }, "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -97,15 +88,6 @@ "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==", "dev": true }, - "node_modules/@types/mdast": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.11.tgz", - "integrity": "sha512-Y/uImid8aAwrEA24/1tcRZwpxX3pIFTSilcNDKSPn+Y2iDywSEachzRuvgAYYLR3wpGXAsMbv5lvKLDZLeYPAw==", - "dev": true, - "dependencies": { - "@types/unist": "*" - } - }, "node_modules/@types/mocha": { "version": "9.1.1", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", @@ -113,16 +95,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.1.tgz", - "integrity": "sha512-DqJociPbZP1lbZ5SQPk4oag6W7AyaGMO6gSfRwq3PWl4PXTwJpRQJhDq4W0kzrg3w6tJ1SwlvGZ5uKFHY13LIg==", - "dev": true - }, - "node_modules/@types/unist": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", - "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==", - "dev": true + "version": "20.8.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.4.tgz", + "integrity": "sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==", + "dev": true, + "dependencies": { + "undici-types": "~5.25.1" + } }, "node_modules/acorn": { "version": "8.8.2", @@ -300,36 +279,6 @@ "node": ">=8" } }, - "node_modules/character-entities": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", - "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/character-entities-legacy": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", - "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/character-reference-invalid": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", - "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -478,19 +427,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -528,37 +464,6 @@ "flat": "cli.js" } }, - "node_modules/front-matter": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/front-matter/-/front-matter-4.0.2.tgz", - "integrity": "sha512-I8ZuJ/qG92NWX8i5x1Y8qyj3vizhXS31OxjKDu3LKP+7/qBgfIKValiZIEwoVoJKUHlhWtYrktkxV1XsX+pPlg==", - "dev": true, - "dependencies": { - "js-yaml": "^3.13.1" - } - }, - "node_modules/front-matter/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/front-matter/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -685,30 +590,6 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "node_modules/is-alphabetical": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", - "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/is-alphanumerical": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", - "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", - "dev": true, - "dependencies": { - "is-alphabetical": "^1.0.0", - "is-decimal": "^1.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -721,16 +602,6 @@ "node": ">=8" } }, - "node_modules/is-decimal": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", - "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -761,16 +632,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-hexadecimal": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", - "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -835,16 +696,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/longest-streak": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.4.tgz", - "integrity": "sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/loupe": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", @@ -860,109 +711,6 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, - "node_modules/markdown-notes-tree": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/markdown-notes-tree/-/markdown-notes-tree-1.12.0.tgz", - "integrity": "sha512-5PjiV81WtfvukQE2mQ3NctPJnceiRoldxq8PQwsiyzo9lv57dQZDjCZxICFBSj09+/nkoK+4EGQIHQUC/UXKig==", - "dev": true, - "dependencies": { - "front-matter": "^4.0.2", - "mdast-util-from-markdown": "^0.8.5", - "mdast-util-to-markdown": "^0.6.5", - "minimatch": "^3.0.4", - "minimist": "^1.2.5" - }, - "bin": { - "markdown-notes-tree": "cli.js" - } - }, - "node_modules/markdown-notes-tree/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/markdown-notes-tree/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/mdast-util-from-markdown": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz", - "integrity": "sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==", - "dev": true, - "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^2.0.0", - "micromark": "~2.11.0", - "parse-entities": "^2.0.0", - "unist-util-stringify-position": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-to-markdown": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.5.tgz", - "integrity": "sha512-XeV9sDE7ZlOQvs45C9UKMtfTcctcaj/pGwH8YLbMHoMOXNNCn2LsqVQOqrF1+/NU8lKDAqozme9SCXWyo9oAcQ==", - "dev": true, - "dependencies": { - "@types/unist": "^2.0.0", - "longest-streak": "^2.0.0", - "mdast-util-to-string": "^2.0.0", - "parse-entities": "^2.0.0", - "repeat-string": "^1.0.0", - "zwitch": "^1.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-to-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz", - "integrity": "sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark": { - "version": "2.11.4", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.4.tgz", - "integrity": "sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "debug": "^4.0.0", - "parse-entities": "^2.0.0" - } - }, "node_modules/minimatch": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", @@ -975,15 +723,6 @@ "node": ">=10" } }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/mocha": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", @@ -1090,24 +829,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/parse-entities": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", - "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", - "dev": true, - "dependencies": { - "character-entities": "^1.0.0", - "character-entities-legacy": "^1.0.0", - "character-reference-invalid": "^1.0.0", - "is-alphanumerical": "^1.0.0", - "is-decimal": "^1.0.0", - "is-hexadecimal": "^1.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -1147,23 +868,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/prisma": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/prisma/-/prisma-4.14.1.tgz", - "integrity": "sha512-z6hxzTMYqT9SIKlzD08dhzsLUpxjFKKsLpp5/kBDnSqiOjtUyyl/dC5tzxLcOa3jkEHQ8+RpB/fE3w8bgNP51g==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "@prisma/engines": "4.14.1" - }, - "bin": { - "prisma": "build/index.js", - "prisma2": "build/index.js" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -1185,15 +889,6 @@ "node": ">=8.10.0" } }, - "node_modules/repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -1218,12 +913,6 @@ "randombytes": "^2.1.0" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -1363,18 +1052,11 @@ "node": ">=4.2.0" } }, - "node_modules/unist-util-stringify-position": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", - "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", - "dev": true, - "dependencies": { - "@types/unist": "^2.0.2" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } + "node_modules/undici-types": { + "version": "5.25.3", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", + "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==", + "dev": true }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", @@ -1515,16 +1197,6 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/zwitch": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz", - "integrity": "sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } } }, "dependencies": { @@ -1559,12 +1231,6 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "@prisma/engines": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.14.1.tgz", - "integrity": "sha512-APqFddPVHYmWNKqc+5J5SqrLFfOghKOLZxobmguDUacxOwdEutLsbXPVhNnpFDmuQWQFbXmrTTPoRrrF6B1MWA==", - "dev": true - }, "@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -1595,15 +1261,6 @@ "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==", "dev": true }, - "@types/mdast": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.11.tgz", - "integrity": "sha512-Y/uImid8aAwrEA24/1tcRZwpxX3pIFTSilcNDKSPn+Y2iDywSEachzRuvgAYYLR3wpGXAsMbv5lvKLDZLeYPAw==", - "dev": true, - "requires": { - "@types/unist": "*" - } - }, "@types/mocha": { "version": "9.1.1", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", @@ -1611,16 +1268,13 @@ "dev": true }, "@types/node": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.1.tgz", - "integrity": "sha512-DqJociPbZP1lbZ5SQPk4oag6W7AyaGMO6gSfRwq3PWl4PXTwJpRQJhDq4W0kzrg3w6tJ1SwlvGZ5uKFHY13LIg==", - "dev": true - }, - "@types/unist": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", - "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==", - "dev": true + "version": "20.8.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.4.tgz", + "integrity": "sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==", + "dev": true, + "requires": { + "undici-types": "~5.25.1" + } }, "acorn": { "version": "8.8.2", @@ -1755,24 +1409,6 @@ } } }, - "character-entities": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", - "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", - "dev": true - }, - "character-entities-legacy": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", - "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==", - "dev": true - }, - "character-reference-invalid": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", - "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", - "dev": true - }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -1883,12 +1519,6 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -1914,36 +1544,6 @@ "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true }, - "front-matter": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/front-matter/-/front-matter-4.0.2.tgz", - "integrity": "sha512-I8ZuJ/qG92NWX8i5x1Y8qyj3vizhXS31OxjKDu3LKP+7/qBgfIKValiZIEwoVoJKUHlhWtYrktkxV1XsX+pPlg==", - "dev": true, - "requires": { - "js-yaml": "^3.13.1" - }, - "dependencies": { - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - } - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2041,22 +1641,6 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "is-alphabetical": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", - "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", - "dev": true - }, - "is-alphanumerical": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", - "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", - "dev": true, - "requires": { - "is-alphabetical": "^1.0.0", - "is-decimal": "^1.0.0" - } - }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -2066,12 +1650,6 @@ "binary-extensions": "^2.0.0" } }, - "is-decimal": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", - "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", - "dev": true - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -2093,12 +1671,6 @@ "is-extglob": "^2.1.1" } }, - "is-hexadecimal": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", - "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", - "dev": true - }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -2139,12 +1711,6 @@ "is-unicode-supported": "^0.1.0" } }, - "longest-streak": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.4.tgz", - "integrity": "sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==", - "dev": true - }, "loupe": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", @@ -2160,83 +1726,6 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, - "markdown-notes-tree": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/markdown-notes-tree/-/markdown-notes-tree-1.12.0.tgz", - "integrity": "sha512-5PjiV81WtfvukQE2mQ3NctPJnceiRoldxq8PQwsiyzo9lv57dQZDjCZxICFBSj09+/nkoK+4EGQIHQUC/UXKig==", - "dev": true, - "requires": { - "front-matter": "^4.0.2", - "mdast-util-from-markdown": "^0.8.5", - "mdast-util-to-markdown": "^0.6.5", - "minimatch": "^3.0.4", - "minimist": "^1.2.5" - }, - "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - }, - "mdast-util-from-markdown": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz", - "integrity": "sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==", - "dev": true, - "requires": { - "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^2.0.0", - "micromark": "~2.11.0", - "parse-entities": "^2.0.0", - "unist-util-stringify-position": "^2.0.0" - } - }, - "mdast-util-to-markdown": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.5.tgz", - "integrity": "sha512-XeV9sDE7ZlOQvs45C9UKMtfTcctcaj/pGwH8YLbMHoMOXNNCn2LsqVQOqrF1+/NU8lKDAqozme9SCXWyo9oAcQ==", - "dev": true, - "requires": { - "@types/unist": "^2.0.0", - "longest-streak": "^2.0.0", - "mdast-util-to-string": "^2.0.0", - "parse-entities": "^2.0.0", - "repeat-string": "^1.0.0", - "zwitch": "^1.0.0" - } - }, - "mdast-util-to-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz", - "integrity": "sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==", - "dev": true - }, - "micromark": { - "version": "2.11.4", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.4.tgz", - "integrity": "sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==", - "dev": true, - "requires": { - "debug": "^4.0.0", - "parse-entities": "^2.0.0" - } - }, "minimatch": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", @@ -2246,12 +1735,6 @@ "brace-expansion": "^2.0.1" } }, - "minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true - }, "mocha": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", @@ -2326,20 +1809,6 @@ "p-limit": "^3.0.2" } }, - "parse-entities": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", - "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", - "dev": true, - "requires": { - "character-entities": "^1.0.0", - "character-entities-legacy": "^1.0.0", - "character-reference-invalid": "^1.0.0", - "is-alphanumerical": "^1.0.0", - "is-decimal": "^1.0.0", - "is-hexadecimal": "^1.0.0" - } - }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -2364,15 +1833,6 @@ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, - "prisma": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/prisma/-/prisma-4.14.1.tgz", - "integrity": "sha512-z6hxzTMYqT9SIKlzD08dhzsLUpxjFKKsLpp5/kBDnSqiOjtUyyl/dC5tzxLcOa3jkEHQ8+RpB/fE3w8bgNP51g==", - "dev": true, - "requires": { - "@prisma/engines": "4.14.1" - } - }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -2391,12 +1851,6 @@ "picomatch": "^2.2.1" } }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", - "dev": true - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -2418,12 +1872,6 @@ "randombytes": "^2.1.0" } }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true - }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -2509,14 +1957,11 @@ "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, - "unist-util-stringify-position": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", - "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", - "dev": true, - "requires": { - "@types/unist": "^2.0.2" - } + "undici-types": { + "version": "5.25.3", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", + "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==", + "dev": true }, "v8-compile-cache-lib": { "version": "3.0.1", @@ -2617,12 +2062,6 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true - }, - "zwitch": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz", - "integrity": "sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==", - "dev": true } } } diff --git a/package.json b/package.json index 1098be5..9b1dced 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prisma-multischema", - "version": "1.1.0", + "version": "1.1.4", "description": "Prisma Multiple Schema Support with Structure & Add imports to your Prisma schemas", "exports": { ".": { @@ -28,11 +28,9 @@ "clean": "npm run clean:win || npm run clean:lin", "clean:win": "node -e \"if (process.platform === 'win32') process.exit(1)\" || if exist lib rmdir /s /q \"lib\" ", "clean:lin": "node -e \"if (process.platform !== 'win32') process.exit(1)\" || rm -rf ./lib", - "build": "npm run clean && npm run build:esm && npm run build:cjs", "build:esm": "tsc -p ./configs/tsconfig.esm.json && npm run mv:win && npm run mv:lin ", "build:cjs": "tsc -p ./configs/tsconfig.cjs.json", - "mv:win": "node -e \"if (process.platform === 'win32') process.exit(1)\" || move \"lib\\esm\\index.js\" \"lib\\esm\\index.mjs\" ", "mv:lin": "node -e \"if (process.platform !== 'win32') process.exit(1)\" || mv lib/esm/index.js lib/esm/index.mjs", "test": "mocha", @@ -51,9 +49,16 @@ "url": "https://github.com/joydip007x/Prisma-MultiSchema.git" }, "keywords": [ - "Prisma Schema Multiple","Prisma Schema Aggregator","Multi-schema support", - "prisma","prisma-import","prisma-multischema","prisma Multischema", - "prisma-subschema","prisma","Prisma Multiple Schema" + "Prisma Schema Multiple", + "Prisma Schema Aggregator", + "Multi-schema support", + "prisma", + "prisma-import", + "prisma-multischema", + "prisma Multischema", + "prisma-subschema", + "prisma", + "Prisma Multiple Schema" ], "author": "Joydip007x", "license": "MIT", @@ -64,7 +69,7 @@ "devDependencies": { "@types/chai": "^4.3.5", "@types/mocha": "^9.1.1", - "@types/node": "^20.2.1", + "@types/node": "^20.8.4", "chai": "^4.3.7", "mocha": "^10.2.0", "ts-node": "^10.9.1", diff --git a/prisma/schema.prisma b/prisma/schema.prisma index f2b8865..e817b08 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -1,3 +1,4 @@ + generator client { provider = "prisma-client-js" // } diff --git a/prisma/subschemas/base.prisma b/prisma/subschemas/base.prisma index 3861b3e..90069b9 100644 --- a/prisma/subschemas/base.prisma +++ b/prisma/subschemas/base.prisma @@ -1,7 +1,18 @@ -generator client { -provider = "prisma-client-js" // -} -datasource db { -provider = "mongodb" //tell me -url = env("PRISMA_DATABASE_URL") //yoyoyo -} +//////////////////////////////////////////////////////////////////////////////////////// +///// Auto Commented Out by ๐Ÿ…ฟ๐Ÿ†๐Ÿ…ธ๐Ÿ†‚๐Ÿ…ผ๐Ÿ…ฐ-๐Ÿ…ผ๐Ÿ†„๐Ÿ…ป๐Ÿ†ƒ๐Ÿ…ธ๐Ÿ†‚๐Ÿ…ฒ๐Ÿ…ท๐Ÿ…ด๐Ÿ…ผ๐Ÿ…ฐ //////// +///// Detected : Datasource and Generator Client //////// +///// You can change this files content is commented or Uncommented Stage. //////// +///// It will take effect after you run npx prisma-multischema //////// +///// Feel free to change Datasource/ Database URL / Provider / Binary Targets //////// +///// DO NOT EDIT in this comment box //////// +///// CHANGE ONLY BELOW THIS LINE. //////// +///////////////////////////////////////////////////////////////////////////////////////// + +// +//generator client { +//provider = "prisma-client-js" // +//} +//datasource db { +//provider = "mongodb" //tell me +//url = env("PRISMA_DATABASE_URL") //yoyoyo +//} diff --git a/src/logger.ts b/src/logger.ts index 659c735..a74b4f0 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -4,14 +4,14 @@ import {colorLogs} from './utility/colorLogs' export const generatedComment= `//////////////////////////////////////////////////////////////////////////////////////// -///// ๐€๐ฎ๐ญ๐จ-๐œ๐จ๐ฆ๐ฆ๐ž๐ง๐ญ๐ž๐ ๐จ๐ฎ๐ญ ๐›๐ฒ ๐Ÿ…ฟ๐Ÿ†๐Ÿ…ธ๐Ÿ†‚๐Ÿ…ผ๐Ÿ…ฐ-๐Ÿ…ผ๐Ÿ†„๐Ÿ…ป๐Ÿ†ƒ๐Ÿ…ธ๐Ÿ†‚๐Ÿ…ฒ๐Ÿ…ท๐Ÿ…ด๐Ÿ…ผ๐Ÿ…ฐ ///// -///// ๐ƒ๐ž๐ญ๐ž๐œ๐ญ๐ž๐:๐๐š๐ญ๐š๐ฌ๐จ๐ฎ๐ซ๐œ๐ž ๐š๐ง๐ ๐ ๐ž๐ง๐ž๐ซ๐š๐ญ๐จ๐ซ ๐œ๐ฅ๐ข๐ž๐ง๐ญ. ///// -///// ๐˜๐จ๐ฎ ๐œ๐š๐ง ๐œ๐ก๐š๐ง๐ ๐ž ๐ญ๐ก๐ข๐ฌ ๐Ÿ๐ข๐ฅ๐ž๐ฌ ๐œ๐จ๐ง๐ญ๐ž๐ง๐ญ ๐ข๐ง ๐œ๐จ๐ฆ๐ฆ๐ž๐ง๐ญ๐ž๐/๐ฎ๐ง๐œ๐จ๐ฆ๐ฆ๐ž๐ง๐ญ๐ž๐ ๐ฌ๐ญ๐š๐ ๐ž,๐๐จ๐ญ๐ก ๐ฐ๐š๐ฒ ///// -///// ๐ˆ๐ญ ๐ฐ๐ข๐ฅ๐ฅ ๐ญ๐š๐ค๐ž ๐ž๐Ÿ๐Ÿ๐ž๐œ๐ญ ๐ข๐Ÿ ๐ฒ๐จ๐ฎ ๐ซ๐ฎ๐ง ๐ง๐ฉ๐ฑ ๐ฉ๐ซ๐ข๐ฌ๐ฆ๐š-๐ฆ๐ฎ๐ฅ๐ญ๐ข๐ฌ๐œ๐ก๐ž๐ฆ๐š ///// -///// ๐…๐ž๐ž๐ฅ ๐Ÿ๐ซ๐ž๐ž ๐ญ๐จ ๐œ๐ก๐š๐ง๐ ๐ž ๐๐š๐ญ๐š๐ฌ๐จ๐ฎ๐ซ๐œ๐ž/๐๐š๐ญ๐š๐›๐š๐ฌ๐ž๐”๐‘๐‹/๐ฉ๐ซ๐จ๐ฏ๐ข๐๐ž๐ซ ///// -///// โ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰ก ๐ƒ๐Ž๐๐“ ๐‚๐‡๐€๐๐†๐„ ๐€๐๐˜๐“๐‡๐ˆ๐๐† ๐ˆ๐ ๐“๐‡๐ˆ๐’ ๐‚๐Ž๐Œ๐Œ๐„๐๐“ ๐๐Ž๐— โ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰ก///// -///// โ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰ก โ–ผโ–ณโ–ผโ–ณ ๐™ฒ๐™ท๐™ฐ๐™ฝ๐™ถ๐™ด ๐Ž๐๐‹๐˜ ๐™ฑ๐™ด๐™ป๐™พ๐š† ๐šƒ๐™ท๐™ธ๐š‚ ๐™ป๐™ธ๐™ฝ๐™ด โ–ผโ–ณโ–ผโ–ณ โ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰กโ‰ก///// -////////////////////////////////////////////////////////////////////////////////////// +///// Auto Commented Out by ๐Ÿ…ฟ๐Ÿ†๐Ÿ…ธ๐Ÿ†‚๐Ÿ…ผ๐Ÿ…ฐ-๐Ÿ…ผ๐Ÿ†„๐Ÿ…ป๐Ÿ†ƒ๐Ÿ…ธ๐Ÿ†‚๐Ÿ…ฒ๐Ÿ…ท๐Ÿ…ด๐Ÿ…ผ๐Ÿ…ฐ //////// +///// Detected : Datasource and Generator Client //////// +///// You can change this files content is commented or Uncommented Stage. //////// +///// It will take effect after you run npx prisma-multischema //////// +///// Feel free to change Datasource/ Database URL / Provider / Binary Targets //////// +///// DO NOT EDIT in this comment box //////// +///// CHANGE ONLY BELOW THIS LINE. //////// +///////////////////////////////////////////////////////////////////////////////////////// \n` diff --git a/src/prismaUnify.ts b/src/prismaUnify.ts index 25a448d..b6f0adf 100644 --- a/src/prismaUnify.ts +++ b/src/prismaUnify.ts @@ -5,6 +5,7 @@ import { colorLogs } from './utility/colorLogs'; import { errorLogs } from './logger'; import { exit } from 'node:process'; import { getAllFiles, processSubschemas } from './processor'; +import { checkJSON } from './utility/JSON'; function getAppRootDir () { return process.cwd(); } @@ -12,6 +13,10 @@ export var appRoot=getAppRootDir(); export var allSchemaFolder='/prisma/subschemas'; export var subschemasPath=path.join(appRoot,allSchemaFolder); + +function genSubschemasPath(){ + +} /** * @author | joydip007x * @desc This is an Utility script that will generate schema.prisma in '/prisma ' @@ -21,7 +26,10 @@ export var subschemasPath=path.join(appRoot,allSchemaFolder); There should not be any '*.prisma' files in '/prisma/' folder except 'schema.prisma' */ export async function prismaUnifier( test_mocha : number =0 ){ - + + //checkJSON(); + //genSubschemasPath(); + const mainSchemaPrismaPath=path.join( appRoot + '/prisma/schema.prisma'); diff --git a/src/processor.ts b/src/processor.ts index 5bc90c6..b454790 100644 --- a/src/processor.ts +++ b/src/processor.ts @@ -19,7 +19,7 @@ const regExp=new RegExp(matchString); * prisma accepts schema.prisma from 'src/prisma/schema.prisma' file. * @Change if you know to handle */ -export const getAllFiles = function(dirPath: fs.PathLike, arrayOfFiles: string[] ) { +export const getAllFiles = function(dirPath: fs.PathLike, arrayOfFiles: any ) { try { const files = fs.readdirSync(dirPath) @@ -85,7 +85,9 @@ export const getAllFiles = function(dirPath: fs.PathLike, arrayOfFiles: string[] } break; case 1: - if( line!='\n' && line!="" && generatedComment.search(line)!=-1 ){ } + if( line.search('binaryTargets')==-1 && line!='\n' && line!="" && generatedComment.search(line)!=-1 ){ + /// When find Generated Comment from Base.prisma ignore line processing + } else if( regExp.test(line) ){ let startInd=0; diff --git a/src/utility/JSON.ts b/src/utility/JSON.ts new file mode 100644 index 0000000..6434631 --- /dev/null +++ b/src/utility/JSON.ts @@ -0,0 +1,36 @@ +import * as fs from 'fs' +import * as path from 'path' + +export const checkJSON = function (){ + + const packageJsonPath = path.join(process.cwd(), 'package.json'); + fs.readFile(packageJsonPath, 'utf8', (err, data) => { + if (err) {console.error('Error reading package.json:', err);return;} + let packageJson; + try { + packageJson = JSON.parse(data); + } catch (parseError) { + console.error('Error parsing package.json:', parseError); + return; + } + if (!packageJson['prisma-multischema']) + packageJson['prisma-multischema'] = jsonToAdd['prisma-multischema']; + + fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8', (writeErr) => { + if (writeErr) { + console.error('Error writing package.json:', writeErr); + } else { + console.log('package.json updated successfully.'); + } + }); + }); + +} + +const jsonToAdd = { + "prisma-multischema": { + "input": [], + "output": "/prisma/schema.prisma" + } + }; + \ No newline at end of file diff --git a/tests/expectedSchema b/tests/expectedSchema index f2b8865..e817b08 100644 --- a/tests/expectedSchema +++ b/tests/expectedSchema @@ -1,3 +1,4 @@ + generator client { provider = "prisma-client-js" // }