-
Notifications
You must be signed in to change notification settings - Fork 185
Adding C# to CLI type generation #1135
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
base: master
Are you sure you want to change the base?
Conversation
Copilot answer:This pull request introduces support for generating C# types in the Appwrite CLI. The changes include adding a new language option ("cs") for type generation, implementing the logic for handling C# attributes and collections, and updating related files to integrate C# into the CLI workflow. Addition of C# Type Generation:
Integration with CLI Workflow:
File Configuration Updates:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds C# language support to the Appwrite CLI type generation functionality, enabling developers to generate C# classes from Appwrite database collections. The implementation supports C# 9.0 features and is designed to work with Unity projects.
- Adds complete C# type generation with support for all Appwrite attribute types including relationships, enums, and arrays
- Integrates C# as a new language option ("cs") in the CLI command interface
- Includes proper nullable reference types, JSON serialization attributes, and conversion methods
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
templates/cli/lib/type-generation/languages/csharp.js.twig | Implements the core C# code generation logic with type mapping, template rendering, and file naming |
templates/cli/lib/commands/types.js.twig | Adds C# language support to the CLI command with import and language selection |
src/SDK/Language/CLI.php | Registers the C# template file in the SDK file generation configuration |
Update C# type generation template to throw ArgumentNullException for missing required int, double, and boolean attributes instead of using default values. Also, corrects the type check from 'float' to 'double' for consistency.
Updated integer type mapping from int to long and refactored the From and ToMap methods for C# type generation. The changes improve handling of arrays, enums, relationships, and nullable types, resulting in more concise and robust code generation.
@Fellmonkey just out of curiosity, would you mind sharing your linkedin? i dont see one connected to your github account |
Hi, @ChiragAgg5k |
What does this PR do?
adding the C# language to CLI type generation
Supports generation for Unity, i.e. C# 9.0
Test Plan
config
result:
Library
Gnom
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
Yes