Skip to content

fix(cli): detect TypeScript SDK in devDependencies - #1889

Merged
ChiragAgg5k merged 4 commits into
mainfrom
fix/cli-types-dev-dependencies-10131
Sep 8, 2026
Merged

fix(cli): detect TypeScript SDK in devDependencies#1889
ChiragAgg5k merged 4 commits into
mainfrom
fix/cli-types-dev-dependencies-10131

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Sep 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Check devDependencies when no supported SDK is found in dependencies when generating TypeScript types.
  • Preserve runtime-dependency priority, existing SDK preference order, and Deno/default fallbacks.
  • Add 25 CLI conformance cases covering missing/null sections, normal/development dependencies, precedence, and nested monorepo output.

Fixes appwrite/appwrite#10131

Testing

  • Regenerated CLI; generated source is gofmt-clean and matches the source template.
  • Generated CLI: go mod tidy, go build ./..., go vet ./..., go test ./... pass.
  • Rector, Twig lint, PHPCS pass with committed Composer lock dependencies.
  • Generation suite after merging current main: 85 tests, 1130 assertions, 4 expected enum skips.
  • The same 25-case offline CLI harness fails before the fix on node-appwrite in devDependencies and passes after it.
  • Generated types at packages/appwrite-types/src compile with actual appwrite@27.0.0/node-appwrite@29.0.0 and TypeScript@7.0.2, for both dependency sections (strict: true, skipLibCheck: false). Before the fix, Node dev-only produces TS2307; after it, compilation passes.

CI formatting follow-up

The live spec exposed a baseline empty-header formatting issue in OAuth2 services. Meanwhile, merged PR #1888 fixed response-media fallback on main and eliminated the empty-header case. Merged main and reverted the redundant formatter follow-up, keeping this PR's final diff limited to the original three CLI files.

After merging main, clean generation and format:check pass for all three previously failing targets: Web client, Web console, and React Native client. Generated files were not formatted in place.

Validation limitations

The original CLI head 7696365 passed remote Tests / CLIGo126 and the CLI generation/build job (CI run). On the updated head a3aae9a, both CI and Validation pass, including all three previously failing SDK targets. All reported PR checks pass; Greptile confidence is 5/5.

Local Docker CLI e2e evidence remains inconclusive: the repository's global mockapi Compose identity collided with another worktree's concurrent test run, and cleanup removed the other worktree's replacement mock container. No further Docker operations were performed after escalation. The remote CLI test pass supplies independent verification for the original CLI fix; the passing offline regression and compilation checks above are also independent of the local Docker incident.

A genuine Terminal screenshot was attempted but macOS screencapture could not create the window image; no screenshot is attached.

@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extends TypeScript type generation to detect supported Appwrite SDK packages in devDependencies when none are available in runtime dependencies.

  • Preserves runtime-dependency priority and the existing supported-package preference order.
  • Retains malformed-manifest, Deno, and default fallback behavior.
  • Adds 25 native CLI conformance cases covering dependency-section edge cases, precedence, fallbacks, and nested monorepo output.

Confidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, or repository-rule violations remain.

The implementation preserves dependency precedence and fallback behavior while directly testing the meaningful manifest and monorepo cases introduced by the change.

Important Files Changed

Filename Overview
templates/cli/internal/typegen/language.go Adds ordered fallback from runtime dependencies to development dependencies when selecting the TypeScript SDK import.
tests/e2e/languages/cli/main.go Adds comprehensive offline conformance coverage for SDK dependency detection and generated declaration output.
tests/e2e/CLIGo126Test.php Extends the native CLI expected output contract with the new dependency-detection conformance marker.

Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

@ChiragAgg5k
ChiragAgg5k merged commit 33e214b into main Sep 8, 2026
59 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/cli-types-dev-dependencies-10131 branch September 8, 2026 13:31
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.

🐛 Bug Report: Unable to generate types: Cannot read properties of undefined (reading 'node-appwrite')

1 participant