prisma-effect-kysely 1.1.0 → 1.2.0
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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.2.0] - 2025-10-08
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Updated peer dependency to support Kysely ^0.28.0 (0.28.x versions)
|
|
12
|
+
- Updated dev dependency to Kysely 0.28.7 for testing
|
|
13
|
+
- No breaking changes to generated code or exported API
|
|
14
|
+
|
|
15
|
+
### Technical Details
|
|
16
|
+
- All Kysely imports are type-only (`ColumnType`, `Generated`, `Selectable`, `Insertable`, `Updateable`)
|
|
17
|
+
- No runtime Kysely code usage ensures compatibility across versions
|
|
18
|
+
- Comprehensive test suite validates compatibility with Kysely 0.28.x
|
|
19
|
+
|
|
20
|
+
[1.2.0]: https://github.com/samuelho-dev/prisma-effect-kysely/compare/v1.1.0...v1.2.0
|
|
21
|
+
|
|
8
22
|
## [1.0.2] - 2025-10-03
|
|
9
23
|
|
|
10
24
|
### Note
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for a single Unsupported field
|
|
3
|
+
*/
|
|
4
|
+
export interface UnsupportedFieldConfig {
|
|
5
|
+
effectType: string;
|
|
6
|
+
dbType: string;
|
|
7
|
+
dbName: string;
|
|
8
|
+
required: boolean;
|
|
9
|
+
comment?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Full configuration structure
|
|
13
|
+
*/
|
|
14
|
+
export interface UnsupportedConfig {
|
|
15
|
+
models: Record<string, Record<string, UnsupportedFieldConfig>>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Load unsupported fields configuration from JSON file
|
|
19
|
+
* Looks for prisma/unsupported-fields.json relative to schema location
|
|
20
|
+
*/
|
|
21
|
+
export declare function loadUnsupportedConfig(schemaPath: string): UnsupportedConfig | null;
|
|
22
|
+
/**
|
|
23
|
+
* Get unsupported fields for a specific model
|
|
24
|
+
*/
|
|
25
|
+
export declare function getUnsupportedFields(config: UnsupportedConfig | null, modelName: string): Record<string, UnsupportedFieldConfig>;
|
|
26
|
+
//# sourceMappingURL=unsupported-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unsupported-config.d.ts","sourceRoot":"","sources":["../../src/utils/unsupported-config.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC,CAAC;CAChE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAiBlF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,iBAAiB,GAAG,IAAI,EAChC,SAAS,EAAE,MAAM,GAChB,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAGxC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadUnsupportedConfig = loadUnsupportedConfig;
|
|
4
|
+
exports.getUnsupportedFields = getUnsupportedFields;
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
/**
|
|
8
|
+
* Load unsupported fields configuration from JSON file
|
|
9
|
+
* Looks for prisma/unsupported-fields.json relative to schema location
|
|
10
|
+
*/
|
|
11
|
+
function loadUnsupportedConfig(schemaPath) {
|
|
12
|
+
try {
|
|
13
|
+
// Assume schema is in prisma/schema/ directory
|
|
14
|
+
// Config should be in prisma/unsupported-fields.json
|
|
15
|
+
const schemaDir = (0, path_1.dirname)((0, path_1.dirname)(schemaPath)); // Go up to prisma/
|
|
16
|
+
const configPath = (0, path_1.join)(schemaDir, 'unsupported-fields.json');
|
|
17
|
+
if (!(0, fs_1.existsSync)(configPath)) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const content = (0, fs_1.readFileSync)(configPath, 'utf-8');
|
|
21
|
+
return JSON.parse(content);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
console.warn(`⚠️ Failed to load unsupported-fields.json: ${error}`);
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get unsupported fields for a specific model
|
|
30
|
+
*/
|
|
31
|
+
function getUnsupportedFields(config, modelName) {
|
|
32
|
+
if (!config)
|
|
33
|
+
return {};
|
|
34
|
+
return config.models[modelName] || {};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=unsupported-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unsupported-config.js","sourceRoot":"","sources":["../../src/utils/unsupported-config.ts"],"names":[],"mappings":";;AAyBA,sDAiBC;AAKD,oDAMC;AArDD,2BAA8C;AAC9C,+BAAqC;AAoBrC;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,UAAkB;IACtD,IAAI,CAAC;QACH,+CAA+C;QAC/C,qDAAqD;QACrD,MAAM,SAAS,GAAG,IAAA,cAAO,EAAC,IAAA,cAAO,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,mBAAmB;QACnE,MAAM,UAAU,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;QAE9D,IAAI,CAAC,IAAA,eAAU,EAAC,UAAU,CAAC,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,OAAO,GAAG,IAAA,iBAAY,EAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAsB,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,+CAA+C,KAAK,EAAE,CAAC,CAAC;QACrE,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAClC,MAAgC,EAChC,SAAiB;IAEjB,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;AACxC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prisma-effect-kysely",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Prisma generator that creates Effect Schema types from Prisma schema compatible with Kysely",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Samuel Ho",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"prettier": "^3.4.2"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"kysely": "^0.
|
|
64
|
+
"kysely": "^0.28.0"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
67
67
|
"kysely": {
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@types/jest": "^29.5.14",
|
|
74
74
|
"@types/node": "^22.10.5",
|
|
75
75
|
"jest": "^29.7.0",
|
|
76
|
-
"kysely": "^0.
|
|
76
|
+
"kysely": "^0.28.7",
|
|
77
77
|
"prisma": "^6.16.3",
|
|
78
78
|
"ts-jest": "^29.2.5",
|
|
79
79
|
"ts-node": "^10.9.2",
|