prisma-effect-kysely 1.5.2 → 1.5.4
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 +36 -0
- package/dist/effect/enum.d.ts.map +1 -1
- package/dist/effect/enum.js +6 -4
- package/dist/effect/enum.js.map +1 -1
- package/dist/generator/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,42 @@ 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.5.4] - 2025-10-12
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **Enum naming convention improved**:
|
|
13
|
+
- Enum declarations preserve original Prisma schema names (e.g., `export enum ACTIVE_STATUS`)
|
|
14
|
+
- Schema wrappers use PascalCase for idiomatic TypeScript (e.g., `ActiveStatusSchema`)
|
|
15
|
+
- Type aliases use PascalCase (e.g., `ActiveStatusType`)
|
|
16
|
+
- **Usage**: Access enum values with original name: `ACTIVE_STATUS.ACTIVE`, validate with PascalCase schema: `ActiveStatusSchema`
|
|
17
|
+
|
|
18
|
+
### Example
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// Generated from: enum ACTIVE_STATUS { ACTIVE, INACTIVE }
|
|
22
|
+
export enum ACTIVE_STATUS {
|
|
23
|
+
ACTIVE = "ACTIVE",
|
|
24
|
+
INACTIVE = "INACTIVE"
|
|
25
|
+
}
|
|
26
|
+
export const ActiveStatusSchema = Schema.Enums(ACTIVE_STATUS);
|
|
27
|
+
export type ActiveStatusType = Schema.Schema.Type<typeof ActiveStatusSchema>;
|
|
28
|
+
|
|
29
|
+
// Usage:
|
|
30
|
+
const status = ACTIVE_STATUS.ACTIVE; // Direct enum access
|
|
31
|
+
Schema.decodeSync(ActiveStatusSchema)(input); // Validation
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## [1.5.3] - 2025-10-12
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- **BREAKING**: Enum names now preserve original Prisma schema naming instead of converting to PascalCase
|
|
39
|
+
- If your enum is `UserRole` in Prisma, it stays `UserRole` in generated code
|
|
40
|
+
- If your enum is `user_role` in Prisma, it stays `user_role` (no longer converted to `UserRole`)
|
|
41
|
+
- This ensures generated TypeScript enums match your Prisma schema exactly
|
|
42
|
+
- **Migration**: If you were relying on automatic PascalCase conversion, you'll need to update your enum references
|
|
43
|
+
|
|
8
44
|
## [1.5.2] - 2025-10-12
|
|
9
45
|
|
|
10
46
|
### Added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../src/effect/enum.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAKrD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../src/effect/enum.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAKrD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,UAyB7D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,IAAI,CAAC,aAAa,EAAE,UAMrE"}
|
package/dist/effect/enum.js
CHANGED
|
@@ -16,10 +16,12 @@ const codegen_1 = require("../utils/codegen");
|
|
|
16
16
|
* - Type alias for convenience
|
|
17
17
|
*/
|
|
18
18
|
function generateEnumSchema(enumDef) {
|
|
19
|
-
//
|
|
20
|
-
const enumName =
|
|
21
|
-
|
|
22
|
-
const
|
|
19
|
+
// Preserve original enum name for the enum itself
|
|
20
|
+
const enumName = enumDef.name;
|
|
21
|
+
// Use PascalCase for Schema and Type exports
|
|
22
|
+
const pascalName = (0, naming_1.toPascalCase)(enumDef.name);
|
|
23
|
+
const schemaName = `${pascalName}Schema`;
|
|
24
|
+
const typeName = `${pascalName}Type`;
|
|
23
25
|
// Generate native TypeScript enum members (Tests 1-2)
|
|
24
26
|
const enumMembers = enumDef.values
|
|
25
27
|
.map((v) => {
|
package/dist/effect/enum.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../src/effect/enum.ts"],"names":[],"mappings":";;AAeA,
|
|
1
|
+
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../src/effect/enum.ts"],"names":[],"mappings":";;AAeA,gDAyBC;AAKD,8CAMC;AAlDD,yCAAoD;AACpD,4CAA+C;AAC/C,8CAAsD;AAEtD;;;;;;;;;GASG;AACH,SAAgB,kBAAkB,CAAC,OAA2B;IAC5D,kDAAkD;IAClD,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAC9B,6CAA6C;IAC7C,MAAM,UAAU,GAAG,IAAA,qBAAY,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,MAAM,UAAU,GAAG,GAAG,UAAU,QAAQ,CAAC;IACzC,MAAM,QAAQ,GAAG,GAAG,UAAU,MAAM,CAAC;IAErC,sDAAsD;IACtD,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM;SAC/B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACT,MAAM,KAAK,GAAG,IAAA,yBAAkB,EAAC,CAAC,CAAC,CAAC;QACpC,OAAO,KAAK,CAAC,CAAC,IAAI,OAAO,KAAK,GAAG,CAAC;IACpC,CAAC,CAAC;SACD,IAAI,CAAC,KAAK,CAAC,CAAC;IAEf,6DAA6D;IAC7D,+CAA+C;IAC/C,OAAO,eAAe,QAAQ;EAC9B,WAAW;;;eAGE,UAAU,mBAAmB,QAAQ;;cAEtC,QAAQ,gCAAgC,UAAU,IAAI,CAAC;AACrE,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAAC,KAAoC;IACpE,MAAM,MAAM,GAAG,IAAA,4BAAkB,GAAE,CAAC;IACpC,MAAM,OAAO,GAAG,kCAAkC,CAAC;IACnD,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAE/D,OAAO,GAAG,MAAM,OAAO,OAAO,OAAO,WAAW,EAAE,CAAC;AACrD,CAAC"}
|
package/dist/generator/index.js
CHANGED
|
@@ -22,7 +22,7 @@ const orchestrator_1 = require("./orchestrator");
|
|
|
22
22
|
__exportStar(require("../kysely/helpers"), exports);
|
|
23
23
|
exports.generator = (0, generator_helper_1.generatorHandler)({
|
|
24
24
|
onManifest: () => ({
|
|
25
|
-
version: '1.5.
|
|
25
|
+
version: '1.5.4',
|
|
26
26
|
defaultOutput: './generated',
|
|
27
27
|
prettyName: 'Prisma Effect Kysely Generator',
|
|
28
28
|
}),
|