Skip to content

fix: type generation templates to include relative path and strict flag #1112

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 13 commits into
base: master
Choose a base branch
from

Conversation

ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Jul 20, 2025

What does this PR do?

  • Type Generation fixes:
    • Fix comments to display user-relative paths instead of absolute paths
    • Fix generation of types of relationships by using relatedCollection's name instead of $id
    • Add --strict flag to comments when types are generated in strict mode

Test Plan

Have you read the Contributing Guidelines on issues?

yes.

@ChiragAgg5k ChiragAgg5k requested a review from Copilot July 20, 2025 12:32
Copilot

This comment was marked as outdated.

@ChiragAgg5k ChiragAgg5k requested a review from Copilot July 22, 2025 06:23
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

This PR improves the Appwrite CLI type generation system by fixing path handling and relationship type generation. The changes enhance the user experience by displaying relative paths instead of absolute paths in generated comments and fixing relationship type resolution to use collection names instead of IDs.

  • Replaces absolute paths with relative command paths in generated type files
  • Fixes relationship type generation to use collection names instead of $id
  • Adds --strict flag information to regeneration commands

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
templates/cli/lib/type-generation/languages/typescript.js.twig Updates getType method signature and fixes relationship type resolution
templates/cli/lib/type-generation/languages/swift.js.twig Similar updates for Swift language support
templates/cli/lib/type-generation/languages/php.js.twig PHP language template updates with relationship fixes
templates/cli/lib/type-generation/languages/kotlin.js.twig Kotlin template improvements
templates/cli/lib/type-generation/languages/javascript.js.twig JavaScript template modifications
templates/cli/lib/type-generation/languages/java.js.twig Java language template updates
templates/cli/lib/type-generation/languages/dart.js.twig Dart template fixes and improvements
templates/cli/lib/commands/types.js.twig Command handler updates to pass collections parameter

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.

2 participants