prisma-effect-kysely 1.9.1 → 1.10.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,70 @@ 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.9.2] - 2025-10-17
9
+
10
+ ### Fixed
11
+
12
+ #### Dependency Configuration
13
+ - **Fixed Effect as peer dependency** to prevent version conflicts and follow best practices
14
+ - **Problem**: `effect` was listed as a regular dependency, causing potential version conflicts in user projects
15
+ - **Solution**: Moved `effect` to `peerDependencies` (required, not optional)
16
+ - **Rationale**:
17
+ - Generated code imports from `effect` package
18
+ - Runtime helpers (`src/kysely/helpers.ts`) export Effect schemas
19
+ - Users need Effect in their projects anyway
20
+ - Follows same pattern as `zod-prisma-types` (Zod as peer dependency)
21
+ - **Impact**: Users must explicitly install `effect` in their projects (most already have it)
22
+
23
+ ### Removed
24
+
25
+ #### Unused Dependencies
26
+ - **Removed `@prisma/client` and `@prisma/dmmf`** from dependencies
27
+ - **Analysis**: Code analysis revealed these packages are never imported in the codebase
28
+ - **Impact**: Smaller package size, cleaner dependency tree
29
+
30
+ ### Changed
31
+
32
+ #### Package Structure
33
+ **Before:**
34
+ ```json
35
+ "dependencies": {
36
+ "@prisma/client": "6.16.3",
37
+ "@prisma/dmmf": "^6.17.0",
38
+ "@prisma/generator-helper": "^6.17.0",
39
+ "effect": "^3.18.4",
40
+ "prettier": "^3.6.2"
41
+ }
42
+ ```
43
+
44
+ **After:**
45
+ ```json
46
+ "dependencies": {
47
+ "@prisma/generator-helper": "^6.17.0",
48
+ "prettier": "^3.6.2"
49
+ },
50
+ "peerDependencies": {
51
+ "effect": "^3.18.4",
52
+ "kysely": "^0.28.0"
53
+ }
54
+ ```
55
+
56
+ ### Migration Guide
57
+
58
+ **For New Users:**
59
+ - Install Effect explicitly: `npm install effect` or `pnpm install effect`
60
+
61
+ **For Existing Users:**
62
+ - If you already have `effect` installed: No action needed
63
+ - If you don't have `effect`: Run `npm install effect` or `pnpm install effect`
64
+ - npm 7+ will automatically install peer dependencies
65
+
66
+ **Benefits:**
67
+ - ✅ Prevents Effect version conflicts between your project and the generator
68
+ - ✅ You control which Effect version to use
69
+ - ✅ Smaller package size (removed unused dependencies)
70
+ - ✅ Follows industry best practices for library dependencies
71
+
8
72
  ## [1.9.1] - 2025-10-17
9
73
 
10
74
  ### Fixed
@@ -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.9.1",
3
+ "version": "1.10.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",
@@ -47,20 +47,6 @@
47
47
  "node": ">=18.0.0",
48
48
  "pnpm": ">=8.0.0"
49
49
  },
50
- "packageManager": "pnpm@10.0.0",
51
- "scripts": {
52
- "build": "tsc -p tsconfig.lib.json",
53
- "prepare": "husky",
54
- "test": "jest",
55
- "test:watch": "jest --watch",
56
- "test:coverage": "jest --coverage",
57
- "typecheck": "tsc --noEmit -p tsconfig.lib.json",
58
- "lint": "eslint .",
59
- "lint:fix": "eslint . --fix",
60
- "format": "prettier --write .",
61
- "format:check": "prettier --check .",
62
- "prepublishOnly": "npm run lint && npm run typecheck && npm run test && npm run build"
63
- },
64
50
  "lint-staged": {
65
51
  "*.ts": [
66
52
  "eslint --fix",
@@ -68,14 +54,12 @@
68
54
  ]
69
55
  },
70
56
  "dependencies": {
71
- "@prisma/client": "6.16.3",
72
- "@prisma/dmmf": "^6.17.0",
73
- "@prisma/generator-helper": "^6.17.0",
74
- "effect": "^3.18.4",
57
+ "@prisma/generator-helper": "^7.0.0",
75
58
  "prettier": "^3.6.2"
76
59
  },
77
60
  "peerDependencies": {
78
- "kysely": "^0.28.0"
61
+ "effect": "^3.19.6",
62
+ "kysely": "^0.28.8"
79
63
  },
80
64
  "peerDependenciesMeta": {
81
65
  "kysely": {
@@ -83,24 +67,36 @@
83
67
  }
84
68
  },
85
69
  "devDependencies": {
86
- "@eslint/js": "^9.37.0",
87
- "@prisma/internals": "^6.17.0",
88
- "@types/jest": "^29.5.14",
89
- "@types/node": "^22.18.8",
90
- "@typescript-eslint/eslint-plugin": "^8.46.0",
91
- "@typescript-eslint/parser": "^8.46.0",
92
- "eslint": "^9.37.0",
70
+ "@eslint/js": "^9.39.1",
71
+ "@prisma/internals": "^7.0.0",
72
+ "@types/jest": "^30.0.0",
73
+ "@types/node": "^24.10.1",
74
+ "@typescript-eslint/eslint-plugin": "^8.47.0",
75
+ "@typescript-eslint/parser": "^8.47.0",
76
+ "effect": "^3.19.6",
77
+ "eslint": "^9.39.1",
93
78
  "eslint-import-resolver-typescript": "^4.4.4",
94
79
  "eslint-plugin-import": "^2.32.0",
95
- "eslint-plugin-jest": "^29.0.1",
80
+ "eslint-plugin-jest": "^29.2.0",
96
81
  "husky": "^9.1.7",
97
- "jest": "^29.7.0",
98
- "kysely": "^0.28.7",
99
- "lint-staged": "^16.2.4",
100
- "prisma": "^6.17.0",
101
- "ts-jest": "^29.4.4",
82
+ "jest": "^30.2.0",
83
+ "kysely": "^0.28.8",
84
+ "lint-staged": "^16.2.7",
85
+ "prisma": "^6.19.0",
86
+ "ts-jest": "^29.4.5",
102
87
  "ts-node": "^10.9.2",
103
88
  "typescript": "^5.9.3",
104
- "typescript-eslint": "^8.46.0"
89
+ "typescript-eslint": "^8.47.0"
90
+ },
91
+ "scripts": {
92
+ "build": "tsc -p tsconfig.lib.json",
93
+ "test": "jest",
94
+ "test:watch": "jest --watch",
95
+ "test:coverage": "jest --coverage",
96
+ "typecheck": "tsc --noEmit -p tsconfig.lib.json",
97
+ "lint": "eslint .",
98
+ "lint:fix": "eslint . --fix",
99
+ "format": "prettier --write .",
100
+ "format:check": "prettier --check ."
105
101
  }
106
- }
102
+ }