Skip to content

chore: fix result types in generated appKitTypes.d.ts#195

Closed
pkosiec wants to merge 1 commit intomainfrom
pkosiec/fix-appkit-types-unknown
Closed

chore: fix result types in generated appKitTypes.d.ts#195
pkosiec wants to merge 1 commit intomainfrom
pkosiec/fix-appkit-types-unknown

Conversation

@pkosiec
Copy link
Member

@pkosiec pkosiec commented Mar 17, 2026

Summary

  • The type generator falls back to result: unknown when no warehouse is available during template generation (generate-app-templates.ts)
  • This causes TS build errors in AnalyticsPage.tsx which uses data.length and data[0].value
  • Adds a fixAppKitTypes() postProcess step that replaces result: unknown with correct types for known template queries (hello_world, mocked_sales)

This pull request was AI-assisted by Isaac.

When DATABRICKS_WAREHOUSE_ID is not set, `appkit generate-types` exits
early without writing the file. This leaves templates with analytics
queries missing appKitTypes.d.ts entirely, causing TS build errors.

Add a fixAppKitTypes() post-processing step that either patches
`result: unknown` in an existing file, or generates the file from
scratch by scanning SQL files and using known result types.

Co-authored-by: Isaac
@pkosiec pkosiec force-pushed the pkosiec/fix-appkit-types-unknown branch from bda650b to f0886be Compare March 17, 2026 19:28
@pkosiec pkosiec closed this Mar 18, 2026
@pkosiec pkosiec added the invalid This doesn't seem right label Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant