{"_id":"@albertigroup/docusaurus-plugin-db-schema","_rev":"3-a343fc8b9d130b5c245deecc40fd35dd","name":"@albertigroup/docusaurus-plugin-db-schema","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@albertigroup/docusaurus-plugin-db-schema","version":"1.0.0","keywords":["database","erd","docusaurus","docusaurus-plugin"],"author":{"name":"Alberti Group"},"license":"MIT","_id":"@albertigroup/docusaurus-plugin-db-schema@1.0.0","maintainers":[{"name":"davide.alberti","email":"dough-versed.6g@icloud.com"}],"homepage":"https://gitlab.com/albertigroup/docusaurus-plugin-db-schema#readme","bugs":{"url":"https://gitlab.com/albertigroup/docusaurus-plugin-db-schema/issues"},"dist":{"shasum":"48d5c5e84f1d275d98a7561a63bf866063bfef7d","tarball":"https://registry.npmjs.org/@albertigroup/docusaurus-plugin-db-schema/-/docusaurus-plugin-db-schema-1.0.0.tgz","fileCount":45,"integrity":"sha512-ko6tFNn4YX5vh4kbTE5JDfVi2m4sEPmkNQiEgzbGY0QGZHi3KQ7zkjxBG5VIs2axIkEBTBm6vWzlQneka+4wkg==","signatures":[{"sig":"MEYCIQCkST/Qkwnnkp3y+Pi4Apfp8RPlB6mWggm72aSuL3rmxQIhALI5/48Jxqu6dRcsAsGCJZ4EGvoMsmNIYgXZ92txpa9l","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":204620},"main":"dist/index.js","types":"dist/types.d.ts","gitHead":"e0febf2d888313d1d1b34424c587519ccf522a2c","scripts":{"build":"tsc && cp src/theme/style.css dist/theme/style.css","watch":"tsc -w"},"_npmUser":{"name":"davide.alberti","email":"dough-versed.6g@icloud.com"},"repository":{"url":"git+https://gitlab.com/albertigroup/docusaurus-plugin-db-schema.git","type":"git"},"_npmVersion":"10.8.2","description":"Bring your database objects inside Docusaurus","directories":{},"_nodeVersion":"20.18.0","dependencies":{"clsx":"^2.1.1","glob":"^13.0.6","webpack":"^5.106.2","fast-glob":"^3.3.3","gray-matter":"^4.0.3","@xyflow/react":"^12.10.2","@docusaurus/plugin-content-docs":"^3.10.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.4","devDependencies":{"typescript":"^6.0.3","@types/node":"^25.6.0","@types/react":"^18.3.28","@docusaurus/types":"^3.10.1","@docusaurus/theme-classic":"^3.10.1","@docusaurus/module-type-aliases":"3.10.1"},"peerDependencies":{"@docusaurus/core":"^3.10.1"},"_npmOperationalInternal":{"tmp":"tmp/docusaurus-plugin-db-schema_1.0.0_1779182289554_0.23288422180634427","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@albertigroup/docusaurus-plugin-db-schema","version":"1.1.0","keywords":["database","erd","docusaurus","docusaurus-plugin"],"author":{"name":"Alberti Group"},"license":"MIT","_id":"@albertigroup/docusaurus-plugin-db-schema@1.1.0","maintainers":[{"name":"davide.alberti","email":"dough-versed.6g@icloud.com"}],"homepage":"https://gitlab.com/albertigroup/docusaurus-plugin-db-schema#readme","bugs":{"url":"https://gitlab.com/albertigroup/docusaurus-plugin-db-schema/issues"},"dist":{"shasum":"20d9e8960d9404b216bf1c68c3c626ce46dd0180","tarball":"https://registry.npmjs.org/@albertigroup/docusaurus-plugin-db-schema/-/docusaurus-plugin-db-schema-1.1.0.tgz","fileCount":41,"integrity":"sha512-q/R/LP/SA+cTKvKfm/UnYkXYih6iDuANFCQe9iKgOkhyTUNAfWHYbEWHGmbl+7lEm7FPPSKWo6KYMfb+S5zGvg==","signatures":[{"sig":"MEQCIAPthJEVViNwV0dyq+C5ptREYz48nkNzzNsSBxmlfC1rAiAkxmAYtOzcr2/WGdws5xexW+DxlOFw6y79U4bongohyQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@albertigroup%2fdocusaurus-plugin-db-schema@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":148137},"main":"dist/index.js","types":"dist/types.d.ts","gitHead":"0103c9efc18df8809f07b84231fb017e8c753eca","scripts":{"build":"tsc && cp src/theme/style.css dist/theme/style.css","watch":"tsc -w"},"_npmUser":{"name":"GitLab CI/CD","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"gitlab","oidcConfigId":"oidc:ce7c4daf-51e5-4371-b79d-ff6ddb82bd74"}},"repository":{"url":"git+https://gitlab.com/albertigroup/docusaurus-plugin-db-schema.git","type":"git"},"_npmVersion":"11.14.1","description":"Bring your database objects inside Docusaurus","directories":{},"_nodeVersion":"24.15.0","dependencies":{"clsx":"^2.1.1","glob":"^13.0.6","webpack":"^5.106.2","gray-matter":"^4.0.3","@xyflow/react":"^12.10.2","@docusaurus/plugin-content-docs":"^3.10.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.4","devDependencies":{"typescript":"^6.0.3","@types/node":"^25.6.0","@types/react":"^18.3.28","@docusaurus/types":"^3.10.1","@docusaurus/theme-classic":"^3.10.1","@docusaurus/module-type-aliases":"3.10.1"},"peerDependencies":{"@docusaurus/core":"^3.10.1"},"_npmOperationalInternal":{"tmp":"tmp/docusaurus-plugin-db-schema_1.1.0_1779260054678_0.8417448891475021","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@albertigroup/docusaurus-plugin-db-schema","version":"1.1.1","description":"Bring your database objects inside Docusaurus","main":"dist/index.js","scripts":{"build":"tsc && cp src/theme/style.css dist/theme/style.css","watch":"tsc -w"},"license":"MIT","packageManager":"pnpm@10.33.4","dependencies":{"@docusaurus/plugin-content-docs":"^3.10.1","@xyflow/react":"^12.10.2","clsx":"^2.1.1","glob":"^13.0.6","gray-matter":"^4.0.3","webpack":"^5.106.2"},"peerDependencies":{"@docusaurus/core":"^3.10.1"},"devDependencies":{"@docusaurus/module-type-aliases":"3.10.1","@docusaurus/theme-classic":"^3.10.1","@docusaurus/types":"^3.10.1","@types/node":"^25.6.0","@types/react":"^18.3.28","typescript":"^6.0.3"},"repository":{"type":"git","url":"git+https://gitlab.com/albertigroup/docusaurus-plugin-db-schema.git"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"keywords":["database","erd","docusaurus","docusaurus-plugin"],"author":{"name":"Alberti Group"},"types":"dist/types.d.ts","gitHead":"2e58896b77cbdf74419876ee99971a6f7fdc0aa9","_id":"@albertigroup/docusaurus-plugin-db-schema@1.1.1","bugs":{"url":"https://gitlab.com/albertigroup/docusaurus-plugin-db-schema/issues"},"homepage":"https://gitlab.com/albertigroup/docusaurus-plugin-db-schema#readme","_nodeVersion":"24.15.0","_npmVersion":"11.14.1","dist":{"integrity":"sha512-DwmApsqdt11aaJ+eeNf6shyvtZ3VnQK730ugdkZieMZJKDj3qwAho7YN75LuxxDYbUDuI0NYgxbtSdXFyswX1g==","shasum":"7eae7e25d7d27e3f55f7bd341637095776a72529","tarball":"https://registry.npmjs.org/@albertigroup/docusaurus-plugin-db-schema/-/docusaurus-plugin-db-schema-1.1.1.tgz","fileCount":41,"unpackedSize":148137,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@albertigroup%2fdocusaurus-plugin-db-schema@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCpCpZah/kzO2tf88Qu/qkwUJkr2Oona6+UwpSLXDVragIgQEheuDAMKqHHqeXxkIoya7d5ufY0hY+SCpXGkxoxo64="}]},"_npmUser":{"name":"GitLab CI/CD","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"gitlab","oidcConfigId":"oidc:ce7c4daf-51e5-4371-b79d-ff6ddb82bd74"}},"directories":{},"maintainers":[{"name":"davide.alberti","email":"dough-versed.6g@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/docusaurus-plugin-db-schema_1.1.1_1779260340316_0.19376644099925944"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-19T09:18:09.468Z","modified":"2026-05-20T06:59:00.740Z","1.0.0":"2026-05-19T09:18:09.716Z","1.1.0":"2026-05-20T06:54:14.819Z","1.1.1":"2026-05-20T06:59:00.459Z"},"bugs":{"url":"https://gitlab.com/albertigroup/docusaurus-plugin-db-schema/issues"},"author":{"name":"Alberti Group"},"license":"MIT","homepage":"https://gitlab.com/albertigroup/docusaurus-plugin-db-schema#readme","keywords":["database","erd","docusaurus","docusaurus-plugin"],"repository":{"type":"git","url":"git+https://gitlab.com/albertigroup/docusaurus-plugin-db-schema.git"},"description":"Bring your database objects inside Docusaurus","maintainers":[{"name":"davide.alberti","email":"dough-versed.6g@icloud.com"}],"readme":"# docusaurus-plugin-dbschema\n\nA Docusaurus plugin that renders interactive database schema documentation from JSON definitions, powered by [`@xyflow/react`](https://reactflow.dev/).\n\nProvides a set of theme components to visualize tables, views, functions, procedures, triggers, enums, domains, and sequences — both as a browsable object list and as an interactive ERD diagram.\n\n---\n\n## Installation\n\n```bash\nnpm install docusaurus-plugin-dbschema\n# or\npnpm add docusaurus-plugin-dbschema\n```\n\n---\n\n## Configuration\n\nRegister the plugin in your `docusaurus.config.ts`:\n\n```ts\nimport type { DocusaurusConfig } from '@docusaurus/types';\n\nconst config: DocusaurusConfig = {\n  plugins: [\n    [\n      'docusaurus-plugin-dbschema',\n      {\n        routeBasePath: '/',\n      },\n    ],\n  ],\n};\n\nexport default config;\n```\n\n### `routeBasePath`\n\nThe base path corresponds to the **folder** where your schema `.mdx` files live inside `docs/`, not to the files themselves.\n\n| Files location | `routeBasePath` |\n|----------------|-----------------|\n| `docs/db/...` | `/` |\n| `docs/example/db/...` | `/example` |\n\n---\n\n## Schema data files\n\nSchema definitions are JSON files that you place anywhere accessible to your Docusaurus site (e.g. `schemas/schema/schema.json`). The exact structure may evolve — refer to the provided examples for the current format.\n\n---\n\n## Usage\n\n### Object list page\n\n`DbSchemaObjects` renders a browsable list of all schema entities and acts as the index page for your schema documentation.\n\n```mdx\nimport DbSchemaObjects from '@theme/DbSchemaObjects';\nimport schema from '@site/schemas/schema/schema.json';\n\n<DbSchemaObjects schema={schema} />\n```\n\n---\n\n### Detail components\n\nEach object type has a dedicated detail component. Import the schema JSON and pass the name of the specific entity you want to display.\n\n```mdx\nimport DbSchemaTableDetail from '@theme/DbSchemaTableDetail';\nimport schema from '@site/schemas/schema/example.json';\n\n<DbSchemaTableDetail schema={schema} name=\"athlete\" />\n```\n\nAvailable components:\n\n| Component | Renders |\n|-----------|---------|\n| `@theme/DbSchemaTableDetail` | Table columns, types, constraints, and foreign keys |\n| `@theme/DbSchemaViewDetail` | View definition and columns |\n| `@theme/DbSchemaFunctionDetail` | Function signature, parameters, return type, and DDL |\n| `@theme/DbSchemaProcedureDetail` | Procedure signature, parameters, and DDL |\n| `@theme/DbSchemaTriggerDetail` | Trigger event, timing, table, and linked function |\n| `@theme/DbSchemaEnumDetail` | Enum values |\n| `@theme/DbSchemaDomainDetail` | Domain base type, nullability, and check constraint |\n| `@theme/DbSchemaSequenceDetail` | Sequence parameters and ownership |\n| `@theme/DbSchema` | Interactive ERD diagram (pannable, zoomable) |\n\n---\n\n### Frontmatter\n\nFor `DbSchemaObjects` to generate correct internal links to each detail page, every `.mdx` file that renders a detail component must declare two frontmatter fields:\n\n```mdx\n---\ndbschema:\n  type: tables\n  name: athlete\n---\n\nimport DbSchemaTableDetail from '@theme/DbSchemaTableDetail';\nimport schema from '@site/schemas/example/example.json';\n\n<DbSchemaTableDetail schema={schema} name=\"athlete\" />\n```\n\n`type` must match the JSON collection key for that entity (`tables`, `views`, `functions`, `procedures`, `triggers`, `enums`, `domains`, `sequences`). `name` must exactly match the entity name in the JSON.\n\n---\n\n### ERD diagram\n\n```mdx\nimport DbSchema from '@theme/DbSchema';\nimport schema from '@site/schemas/example/example.json';\n\n<DbSchema schema={schema} />\n```\n\nThe diagram renders all tables and their relationships as an interactive canvas. It is wrapped in `BrowserOnly` and does not produce static HTML output.\n\n---\n\n## Type color customization\n\nColumn type badges are rendered with a default style. Any type name — including custom or user-defined types — can be styled by defining CSS variables in your custom stylesheet:\n\n```css\n:root {\n  --dbschema-col-type-uuid-background-color: #e8f4ff;\n  --dbschema-col-type-uuid-color: #1a5fa8;\n  --dbschema-col-type-uuid-border-color: #bad4f5;\n\n  --dbschema-col-type-jsonb-background-color: #fff7e6;\n  --dbschema-col-type-jsonb-color: #7a4a00;\n  --dbschema-col-type-jsonb-border-color: #f5d08a;\n}\n```\n\nThe variable name pattern is:\n\n```css\n--dbschema-col-type-{type-name}-background-color\n--dbschema-col-type-{type-name}-color\n--dbschema-col-type-{type-name}-border-color\n```\n\n`{type-name}` is the type string as it appears in the JSON, lowercased. Types without explicit variables fall back to the default badge style. All three variables must be defined together for consistent rendering.\n\n---\n\n## License\n\nMIT © [Alberti Group](https://albertigroup.it)","readmeFilename":"README.md"}