8000 feat: types generator command by loks0n · Pull Request #784 · appwrite/sdk-generator · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

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

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

Copy link
@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 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

@ChiragAgg5k ChiragAgg5k requested review from Copilot and abnegate May 31, 2025 12:58
Copy link
@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}) => {

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ChiragAgg5k ChiragAgg5k requested a review from stnguyen90 June 3, 2025 04:43
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
0