mirror of
https://github.com/theoludwig/kysely-typegen.git
synced 2026-05-22 16:23:25 +02:00
e9adb364e0
To prepare for additional dialects and keep the default entry tiny,
`KyselyTypegenPostgresDialect` is now exported from a dedicated
`kysely-typegen/postgres` subpath instead of the package root.
The `KyselyTypegenDialect` base class is also reworked to support
dialects where enums are declared per-column rather
than as a named top-level type. The abstract `getEnumsMap()` method
is replaced by an optional `introspectEnums()` hook returning both
`named` and `inline` enums.
BREAKING CHANGE: `KyselyTypegenPostgresDialect` is no longer exported
from `kysely-typegen`. Import it from `kysely-typegen/postgres`.
Before:
```ts
import { KyselyTypegenPostgresDialect } from "kysely-typegen"
```
After:
```ts
import { KyselyTypegenPostgresDialect } from "kysely-typegen/postgres"
```
BREAKING CHANGE: custom dialects extending `KyselyTypegenDialect`
must replace `protected getEnumsMap()` with `protected introspectEnums()`,
which returns `{ named, inline }` instead of a flat `Map<string, string[]>`.
Before:
```ts
protected async getEnumsMap(): Promise<Map<string, string[]>> {
return new Map([["Role", ["admin", "member"]]])
}
```
After:
```ts
protected override async introspectEnums(): Promise<IntrospectedEnums> {
return {
named: [{ name: "Role", values: ["admin", "member"] }],
inline: new Map(),
}
}
```
63 lines
1.5 KiB
JSON
63 lines
1.5 KiB
JSON
{
|
|
"name": "kysely-typegen",
|
|
"version": "0.0.0-development",
|
|
"description": "Generate Kysely type definitions from your database.",
|
|
"keywords": [
|
|
"kysely"
|
|
],
|
|
"homepage": "https://github.com/theoludwig/kysely-typegen#readme",
|
|
"bugs": {
|
|
"url": "https://github.com/theoludwig/kysely-typegen/issues"
|
|
},
|
|
"license": "MIT",
|
|
"author": "Théo LUDWIG <contact@theoludwig.fr>",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/theoludwig/kysely-typegen.git"
|
|
},
|
|
"files": [
|
|
"dist"
|
|
],
|
|
"type": "module",
|
|
"types": "./dist/index.d.mts",
|
|
"exports": {
|
|
".": "./dist/index.mjs",
|
|
"./postgres": "./dist/postgres.mjs",
|
|
"./package.json": "./package.json"
|
|
},
|
|
"publishConfig": {
|
|
"access": "public",
|
|
"provenance": true
|
|
},
|
|
"scripts": {
|
|
"lint:typescript": "tsc --noEmit",
|
|
"lint:oxlint": "oxlint .",
|
|
"lint:oxfmt": "oxfmt . --check",
|
|
"oxfmt": "oxfmt .",
|
|
"test": "node --test",
|
|
"build": "tsdown",
|
|
"release": "semantic-release"
|
|
},
|
|
"devDependencies": {
|
|
"@testcontainers/postgresql": "12.0.0",
|
|
"@types/node": "25.9.1",
|
|
"@types/pg": "8.20.0",
|
|
"kysely": "0.29.2",
|
|
"kysely-postgres-js": "3.0.0",
|
|
"oxfmt": "0.51.0",
|
|
"oxlint": "1.66.0",
|
|
"oxlint-tsgolint": "0.23.0",
|
|
"pg": "8.21.0",
|
|
"postgres": "3.4.9",
|
|
"semantic-release": "25.0.3",
|
|
"tsdown": "0.22.0",
|
|
"typescript": "6.0.3"
|
|
},
|
|
"peerDependencies": {
|
|
"kysely": ">=0.29.0"
|
|
},
|
|
"engines": {
|
|
"node": ">=24.0.0"
|
|
}
|
|
}
|