Skip to content

Conversation

@ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Nov 10, 2025

This PR contains updates to the Command Line SDK for version 11.1.1.

Summary by CodeRabbit

  • Bug Fixes

    • Resolved enum naming conflicts in generated types across all supported languages by implementing collection-scoped enum naming conventions to prevent duplicates.
  • Chores

    • Updated CLI and SDK version to 11.1.1 in installer scripts, package configuration, and documentation.

@coderabbitai
Copy link

coderabbitai bot commented Nov 10, 2025

Walkthrough

This release updates the CLI version from 11.1.0 to 11.1.1 across package metadata, installation scripts, and documentation. The core change introduces collection-scoped enum naming in type generation for seven programming languages (C#, Dart, Java, Kotlin, PHP, Swift, TypeScript) by prefixing enum names with their parent collection name in PascalCase (e.g., MyTableMyEnum instead of MyEnum). This requires adding a collectionName parameter to the getType method and updating all enum declarations and template references accordingly. A minor wording adjustment updates a command description.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Areas requiring extra attention:

  • lib/type-generation/languages/csharp.js, dart.js, java.js, kotlin.js, php.js, swift.js, typescript.js: Verify that the collectionName parameter is consistently added to getType method signatures across all seven files and that all template invocations pass collection.name as the third argument
  • Enum naming pattern: Confirm that all enum declarations follow the new composite naming convention (<CollectionName><AttributeKey> in PascalCase) and that all type references in mappings, deserializers, and related type resolution use the updated names
  • Template consistency: Ensure all property declarations, constructor parameters, getters/setters, and deserialization logic across each language file correctly pass the collection context through getType calls
  • Version propagation: Verify version bump accuracy in CHANGELOG.md, README.md (3 locations), package.json, install.ps1, install.sh, lib/client.js, lib/parser.js, and scoop/appwrite.config.json

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: Command Line SDK update for version 11.1.1' accurately reflects the main objective of this pull request, which is a version bump to 11.1.1 across multiple files including package files, installation scripts, documentation, and most importantly, the type generation logic across all supported languages (C#, Dart, Java, Kotlin, PHP, Swift, TypeScript) to prefix enums with collection names to avoid duplicates.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9961632 and 91d46f0.

📒 Files selected for processing (16)
  • CHANGELOG.md (1 hunks)
  • README.md (2 hunks)
  • install.ps1 (1 hunks)
  • install.sh (1 hunks)
  • lib/client.js (1 hunks)
  • lib/commands/sites.js (1 hunks)
  • lib/parser.js (1 hunks)
  • lib/type-generation/languages/csharp.js (5 hunks)
  • lib/type-generation/languages/dart.js (4 hunks)
  • lib/type-generation/languages/java.js (4 hunks)
  • lib/type-generation/languages/kotlin.js (3 hunks)
  • lib/type-generation/languages/php.js (4 hunks)
  • lib/type-generation/languages/swift.js (6 hunks)
  • lib/type-generation/languages/typescript.js (4 hunks)
  • package.json (1 hunks)
  • scoop/appwrite.config.json (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
lib/type-generation/languages/dart.js (1)
lib/type-generation/attribute.js (1)
  • AttributeType (1-12)
lib/type-generation/languages/java.js (1)
lib/type-generation/attribute.js (1)
  • AttributeType (1-12)
lib/client.js (2)
lib/parser.js (1)
  • os (6-6)
lib/config.js (1)
  • os (1-1)
lib/type-generation/languages/kotlin.js (1)
lib/type-generation/attribute.js (1)
  • AttributeType (1-12)
lib/type-generation/languages/csharp.js (1)
lib/type-generation/attribute.js (1)
  • AttributeType (1-12)
lib/type-generation/languages/swift.js (1)
lib/type-generation/attribute.js (1)
  • AttributeType (1-12)
🔇 Additional comments (24)
lib/commands/sites.js (1)

1481-1481: Description clarification improves user guidance.

The change from "function's deployment" to "site's deployment" accurately reflects the command's purpose and reduces ambiguity for users. This is a helpful clarification for the CLI documentation.

README.md (1)

32-32: LGTM! Version references correctly updated.

The documentation accurately reflects the new CLI version 11.1.1 in the verification examples.

Also applies to: 63-63

package.json (1)

5-5: LGTM! Version bump applied correctly.

The package version is properly updated to 11.1.1, following semantic versioning for a patch release.

scoop/appwrite.config.json (1)

3-3: LGTM! Scoop configuration updated consistently.

The version and download URLs for both x64 and arm64 architectures are correctly updated to 11.1.1.

Also applies to: 9-9, 18-18

install.sh (1)

100-100: LGTM! Installation script version updated correctly.

The download version is properly set to 11.1.1, ensuring the installation script fetches the correct release.

lib/client.js (1)

19-20: LGTM! SDK version metadata updated correctly.

The SDK version header and user-agent string are properly updated to reflect version 11.1.1.

CHANGELOG.md (1)

3-6: LGTM! Changelog entry is clear and informative.

The 11.1.1 entry properly documents the enum naming fix with a concrete example, making it easy for users to understand the change.

install.ps1 (1)

16-17: LGTM! PowerShell installation script updated correctly.

Both x64 and arm64 download URLs are consistently updated to point to the 11.1.1 release.

lib/parser.js (1)

125-125: LGTM! Error reporting version updated correctly.

The version string in the error reporting flow is properly updated to 11.1.1, ensuring accurate metadata in bug reports.

lib/type-generation/languages/kotlin.js (1)

14-15: Unique enum naming confirmed.

Prefixing enums with the collection name avoids collisions and aligns with the template’s enum declaration.

lib/type-generation/languages/java.js (1)

14-15: Enum prefix matches template usage.

Including the collection name in the enum type keeps generated Java models consistent and prevents cross-collection name clashes.

lib/type-generation/languages/dart.js (1)

51-52: Enum type disambiguation looks good.

The collection-scoped enum name flows through constructors/fromMap/toMap, eliminating duplicate enum identifiers in Dart.

lib/type-generation/languages/typescript.js (1)

19-20: Namespacing enums per collection is correct.

Passing collection.name into getType keeps the generated TypeScript types in sync with the new enum declarations.

lib/type-generation/languages/php.js (1)

17-18: Scoped enum type works as intended.

Using the collection-prefixed enum name in PHP ensures properties, accessors, and enum declarations all stay aligned.

lib/type-generation/languages/swift.js (5)

6-15: LGTM! Collection-scoped enum naming implemented correctly.

The method signature now accepts collectionName and properly constructs enum types by prefixing the collection name. This aligns with the PR's objective of introducing collection-scoped enum naming.


54-63: LGTM! Enum declaration uses consistent naming.

The enum declaration correctly applies the collection-scoped naming pattern, matching the type construction in the getType method.


64-82: LGTM! Template calls consistently pass collection.name.

All getType invocations in property declarations and constructor parameters correctly pass collection.name, ensuring proper type resolution for collection-scoped enums.


84-94: LGTM! Decoder logic updated correctly.

Both required and optional decoding paths properly pass collection.name to getType, ensuring enums are decoded with the correct collection-scoped type names.


144-148: LGTM! Enum initialization uses correct collection-scoped name.

The from(map:) method correctly constructs enum values using the composite naming pattern. Note that the force unwrap (!) will crash if the map contains an invalid enum value, but this is existing behavior.

lib/type-generation/languages/csharp.js (5)

6-15: LGTM! Collection-scoped enum naming implemented correctly.

The method signature now accepts collectionName and constructs enum types by prefixing the collection name, consistent with the Swift implementation and PR objectives.


60-70: LGTM! Enum declaration correctly scoped.

The enum declaration properly applies collection-scoped naming, matching the type construction in the getType method.


71-88: LGTM! Class members use correct type resolution.

Property declarations and constructor parameters correctly pass collection.name to getType, ensuring proper type resolution for collection-scoped enums.


90-99: LGTM! Enum parsing updated for collection-scoped types.

Both array and single-value enum parsing correctly use Models.<CollectionName><EnumName> references, ensuring proper deserialization with the new naming convention.


124-125: LGTM! Consistent getType signature maintained.

The getType call correctly passes collection.name, maintaining signature consistency even for types that don't use the collection name.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@abnegate abnegate merged commit 20a6015 into master Nov 10, 2025
1 of 2 checks passed
@stnguyen90 stnguyen90 linked an issue Nov 14, 2025 that may be closed by this pull request
2 tasks
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.

Enum Type Generation Duplication for Same Name Column of Tables

3 participants