Skip to content

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

Merged
merged 47 commits into from
Jun 10, 2025
Merged

feat: types generator command #784

merged 47 commits into from
Jun 10, 2025

Conversation

loks0n
Copy link
Member

@loks0n loks0n commented Mar 8, 2024

kotlin typescript dart
Image 1 Image 2 Image 3
java php swift
Image 4 Image 5 Image 6

javascript:
Screenshot 2025-05-30 at 7 06 26 PM

@loks0n loks0n changed the base branch from 1.5.x to master March 8, 2024 13:46
@lohanidamodar
Copy link
Member

@loks0n can you also check this and let's make sure we can bring these together
#663

@ZachHandley
Copy link

@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

@ChiragAgg5k ChiragAgg5k requested review from Copilot and abnegate May 31, 2025 12:58
Copy link
Contributor

@Copilot Copilot AI left a 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 (with package.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}) => {

@ChiragAgg5k ChiragAgg5k requested a review from stnguyen90 June 3, 2025 04:43
@abnegate abnegate merged commit e9a324e into master Jun 10, 2025
37 checks passed
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.

6 participants