-
Notifications
You must be signed in to change notification settings - Fork 182
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
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
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 <[email protected]>
javascript:
