Conversation
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.28-pr.199.7452a77Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.28-pr.199.7452a77"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.28-pr.199.7452a77"
}
}
Preview published to npm registry — try new features instantly! |
|
Posting inline comments on PR #199... |
Code reviewFound 1 issue that needs attention: Issue: Incorrect command in generated file commentsFiles affected:
Problem: However, the correct command is: Why this matters: Suggested fix: Review scope: Checked for bugs and CLAUDE.md compliance. |
|
Gap i see - the "Task" returned from the sdk doesn't not have the predefined fields like "is_sample", "id", "created_by".... |
Note
Description
This PR adds a new
base44 types generatecommand that generates TypeScript declaration files for Base44 projects. The command reads entities, functions, and agents from the project configuration and creates a type-safebase44/.types/types.d.tsfile with interfaces for entity schemas and registries for all resources, enabling autocomplete and type safety when using the @base44/sdk in TypeScript projects.Related Issue
Depends on base44/javascript-sdk#117
Type of Change
Changes Made
base44 typesparent command withgeneratesubcommand (hidden from help menu)src/core/types/module with:generator.ts: Entity-to-TypeScript interface conversion usingjson-schema-to-typescriptupdate-project.ts: Automatic tsconfig.json updates to include generated typesjson-schema-to-typescript: Converts JSON Schema to TypeScript interfacescommon-tags: Template string formatting for clean code generation@types/json-schema,@types/common-tags)tsconfig.jsonupdates to includebase44/.types/*.d.tsin the include arraytests/cli/types_generate.spec.tswith fixturesTYPES_OUTPUT_SUBDIRandTYPES_FILENAMEtosrc/core/consts.tsgetTypesOutputPath()helper tosrc/core/config.tsTypeGenerationErrorto error hierarchy insrc/core/errors.tssrc/cli/program.ts.gitignorefiles to exclude generated.types/directorybinary,file,regex) from entity schemaTesting
bun test)Checklist
Additional Notes
The generated types file augments the
@base44/sdkmodule with TypeScript interfaces for entity schemas and registries for functions and agents. Entity names are converted to PascalCase for interface names (e.g.,user_profile→UserProfile). The generator handles empty projects gracefully by generating a placeholder file with helpful comments.Command usage:
base44 types generate # Generates base44/.types/types.d.tsThe command automatically updates
tsconfig.jsonto include the generated types if the file exists. The types command is currently hidden from the help menu while the feature is being finalized.Module Structure (to be documented in CLAUDE.md):
🤖 Generated by Claude | 2026-02-05 15:45 UTC