Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/prisma v5 #93

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

multipliedtwice
Copy link

Enables support of Prisma V5, and suppresses typescript errors in zod types for edge cases with complex models.

multipliedtwice and others added 8 commits April 18, 2024 19:41
…@prisma/generator-helper, @prisma/internals, prettier, tslib, and zod

feat(package.json): update devDependencies versions for @types/node, @types/prettier, prisma, ts-node, and typescript
refactor(helpers): remove unused imports and update types in several helper functions
feat(prisma-generator.ts): update types and variables for better type safety and readability
feat(prisma-generator.ts): improve code structure and readability by updating variable assignments and type annotations

refactor(transformer.ts): update import statements and types from '@prisma/generator-helper' to improve code readability and maintainability
feat(types.ts): replace PrismaDMMF types with DMMF types for consistency and compatibility with '@prisma/generator-helper'
refactor(writeFileSafely.ts): reformat writeFileSafely function parameters for better code readability
refactor(tsconfig.json): update tsconfig settings and add comments for clarity and future reference
…nnection

chore: update .gitignore to include lib/prisma/generated directory
refactor: modify generateObjectSchemaField method in Transformer class to filter out types containing 'RefInput'
refactor: update generateSchemaImports method in Transformer class to handle names containing 'RefInput' and 'Scalar'
feat(format-find-many): add format-find-many helper function to format operation names
feat(model-helpers): update checkIsModelRelationField and findModelByName functions to improve type definitions
feat(pascal-case): add toPascalCase function to convert strings to PascalCase

feat(transformer.js): add pascal case conversion for schema names to improve consistency and readability
feat(transformer.js): add pascal case conversion for schema names in imports to match file naming convention

refactor(transformer.js): refactor code to use pascal case for model names in schema generation for better consistency and readability.

feat(schemas): add support for generating various schema files for CRUD operations on models
feat(schemas): add support for generating schema files for createOne, createMany, deleteOne, deleteMany, updateOne, updateMany, upsertOne operations
feat(schemas): add support for generating schema files for aggregate operations on models

feat: add support for generating groupBy schemas based on provided groupBy parameter to enhance data aggregation capabilities

refactor(transformer.js): refactor code to use pascal case for model names in imports and schema definitions for better consistency and readability

refactor(transformer.js): optimize mappings in transformer.js for better performance and readability

chore: reformat code in multiple files to improve readability and maintainability

chore: reformat a large portion of the codebase to improve readability and maintainability

chore: reformat code in multiple files for better readability and maintainability

feat: implement a major overhaul of the server configuration to improve performance and scalability.

refactor(transformer.js): update mappings in transformer.js file to improve code readability and maintainability

chore: optimize and clean up generated code in multiple files for better readability and maintainability

chore: remove gibberish characters from multiple files to clean up the codebase and improve readability

chore: reformat code files to fix formatting issues and improve code readability

chore: reformat code in multiple files to fix formatting issues and improve readability

chore: reformat code in multiple files to fix formatting issues and improve code readability

chore(transformer.js.map): update source map file to remove unnecessary
generated code and improve readability.

chore: optimize and format a large block of code in multiple files for better readability and maintainability

fix(writeFileSafely): update return type of writeFileSafely function to Promise<boolean>
refactor(writeFileSafely): replace fs module with fs/promises for asynchronous file operations
feat(package.json): update prisma and dependencies versions
feat(package.json): add typegraphql-prisma dependency
feat(format-find-many.ts): add function to format operation names for findMany
feat(pascal-case.ts): add function to convert strings to PascalCase

feat(transformer.ts): add functions to convert names to PascalCase for better readability and consistency
feat(transformer.ts): update schema generation to use PascalCase for enum and object names
feat(transformer.ts): refactor field schema generation to use PascalCase for schema names
feat(transformer.ts): refactor model query schema import resolution to use PascalCase
feat(transformer.ts): refactor enum and object schema import resolution to use PascalCase

refactor(transformer.ts): improve code readability by refactoring the logic for generating schema files based on model operations. Update variable names and imports to use PascalCase for consistency and clarity.

feat(schemas): add support for generating schema files for createOne, createMany, deleteOne, deleteMany, updateOne, updateMany, upsertOne operations
feat(schemas): add support for generating schema files for aggregate and groupBy operations to enable advanced data aggregation and grouping functionalities

feat(schemas): add support for generating schema files for group by queries in the application to enhance data aggregation capabilities

refactor(transformer.ts): refactor variable and import names to use PascalCase for consistency and readability

fix(writeFileSafely.ts): update fs import to fs/promises to use promises-based API for file system operations
feat(writeFileSafely.ts): refactor writeFileSafely function to use async/await for file system operations for better error handling and readability
feat(writeFileSafely.ts): add return statement to writeFileSafely function to indicate successful write operation
feat(tsconfig.json): update strict compiler option to false and add additional compiler options for consistent file casing, experimental decorators, and decorator metadata for improved TypeScript configuration
refactor(transformer.js): remove console.log statement from transformer class to improve code cleanliness

refactor(transformer.js): optimize mappings in transformer.js for improved performance and readability

chore: optimize and clean up generated code to improve readability and maintainability

chore: remove gibberish characters from multiple files for code cleanup and readability

chore: reformat code files to adhere to coding standards and improve readability

feat: add new functionality to improve performance and optimize codebase.

It seems like the output provided is not a valid git diff output. Could you please provide a valid git diff output so that I can create a commit message for you?

refactor(transformer.js): update mappings in the source map file for better readability and maintainability

chore: optimize and clean up generated code in multiple files for better readability and maintainability

chore: remove gibberish characters from multiple files for code cleanup and readability

chore: reformat code files to fix indentation and improve readability

chore: reformat code in multiple files to improve readability and maintainability

chore: reformat code in multiple files to fix formatting issues and improve readability

chore(transformer.js.map): update source map file to remove unnecessary characters and improve readability

refactor: optimize and clean up a large portion of the codebase to improve maintainability and readability

feat(package.json): update package version to 0.9.0 and description to reflect Prisma 5+ compatibility
style(transformer.ts): remove unnecessary console.log statement
@syabro
Copy link

syabro commented May 25, 2024

Are you sure you want to add .yarn/cache and lib/src?

@syabro
Copy link

syabro commented May 28, 2024

lib/src?

refactor(model-helpers.d.ts): update type definitions for model-helpers to include nullable and undefined fields for better clarity and flexibility

refactor(transformer.js): optimize mappings in the transformer file for improved performance and readability

chore: reformat code in multiple files to improve readability and maintainability

chore: remove unnecessary diff output from multiple files in the project

Unable to generate a commit message from the provided diff output as it seems to be corrupted or not in a standard format. Please provide a valid diff output for me to create a commit message.

chore: optimize and refactor multiple files for improved performance and readability

feat: implement new feature to improve performance and optimize codebase

refactor(transformer.js): update mappings in transformer.js file for better readability and maintainability

chore: reformat code in multiple files to improve readability and maintainability

chore: reformat code in multiple files to improve readability and maintainability

refactor: optimize and clean up code in multiple files for better performance and readability

chore: reformat code in multiple files to improve readability and maintainability

chore: reformat multiple lines of code for better readability and maintainability

chore(transformer.js.map): update source map file with optimized mappings for better debugging experience

chore: reformat code in multiple files to adhere to coding standards and improve readability

feat(prisma): update provider path in schema.prisma to point to the correct location
refactor(transformer.ts): improve code readability by formatting path.join calls for file writing
style(transformer.ts): remove unnecessary whitespace and console.log statement
fix(tsconfig.json): enable strict mode for better type checking and code quality
@syabro
Copy link

syabro commented May 31, 2024

fix: bring back /lib
Why? AFAIS It's a build artifacts, why they needed in the repo?

@multipliedtwice
Copy link
Author

multipliedtwice commented May 31, 2024 via email

@syabro
Copy link

syabro commented May 31, 2024

@multipliedtwice nope

  1. lib is already ignored. https://github.com/omar-dulaimi/prisma-zod-generator/blob/master/.gitignore
  2. npm package is orthogonal to the git repo. npm builds a package from the files where npm publish is being run, not from the repo itself

@multipliedtwice
Copy link
Author

multipliedtwice commented May 31, 2024 via email

@syabro
Copy link

syabro commented May 31, 2024

I mean my own repo that is a source of changes is already used in build
pipeline as npm dependency. Removing /lib breaks the pipeline

Then I bet it wouldn't be merged 🙂

@multipliedtwice
Copy link
Author

multipliedtwice commented May 31, 2024 via email

@syabro
Copy link

syabro commented May 31, 2024

@multipliedtwice why did you create a PR to the author's repo then? 🙂

@multipliedtwice
Copy link
Author

multipliedtwice commented May 31, 2024 via email

@syabro
Copy link

syabro commented May 31, 2024

just in case someone doesn't want to do the same job all over again

totally makes sense, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants