-
Notifications
You must be signed in to change notification settings - Fork 181
feat: types generator command #784
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
…o feat-types-generator-command
…to feat-types-generator-command
@loks0n would you consider using ZOD for TypeScript over interfaces and such? If you're not familiar, it allows you to parse the data objects using it, thus keeping the communication between database and client typesafe if data is wrong |
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
Adds a new types
CLI command to generate typed models for various languages based on Appwrite collections.
- Introduces EJS dependency and templates to support TypeScript, PHP, Kotlin, Swift, Java, and Dart
- Implements command logic (
types.js
) and registers it in the CLI entrypoint - Updates PHP SDK generator to include the new type‐generation files
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.
Show a summary per file
File | Description |
---|---|
templates/cli/package.json.twig | Added ejs dependency |
templates/cli/lib/type-generation/languages/typescript.js.twig | New TypeScript generator |
templates/cli/lib/type-generation/languages/swift.js.twig | New Swift generator |
templates/cli/lib/type-generation/languages/php.js.twig | New PHP generator |
templates/cli/lib/type-generation/languages/language.js.twig | Base language metadata class |
templates/cli/lib/type-generation/languages/kotlin.js.twig | New Kotlin generator |
templates/cli/lib/type-generation/languages/java.js.twig | New Java generator |
templates/cli/lib/type-generation/languages/dart.js.twig | New Dart generator |
templates/cli/lib/commands/types.js.twig | Implements the types command |
templates/cli/index.js.twig | Registers types command in CLI |
src/SDK/Language/CLI.php | Produces type‐generation files in PHP SDK |
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
Adds a new types
command to the CLI that generates type definitions for Appwrite collections in multiple languages using EJS templates.
- Introduce EJS-based templates and attribute metadata for Kotlin, TypeScript, Dart, Java, PHP, Swift, JavaScript, and language-agnostic logic
- Register a new
types
command in the CLI (withpackage.json
dependency update) - Update SDK PHP generator to include the new type-generation files
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
templates/cli/package.json.twig | add ejs runtime dependency |
templates/cli/lib/type-generation/attribute.js.twig | define AttributeType enum |
templates/cli/lib/type-generation/languages/*.js.twig | add EJS templates per language |
templates/cli/lib/commands/types.js.twig | implement new types CLI command |
templates/cli/index.js.twig | wire types command into the CLI entry point |
src/SDK/Language/CLI.php | include new templates in SDK generation config |
Comments suppressed due to low confidence (1)
templates/cli/lib/commands/types.js.twig:61
- No tests have been added to cover the new
types
command flow. Consider adding unit or integration tests for directory creation, template rendering, and error cases.
const typesCommand = actionRunner(async (rawOutputDirectory, {language}) => {
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
javascript:
