encore
encore copied to clipboard
Client Generator Creates Invalid TS Namespaces from Kebab-Case Directories
Issue
The Encore TypeScript client generator (encore gen client) creates invalid TypeScript namespace names when service directories contain hyphens. While the service name is correctly defined in encore.service.ts using PascalCase (e.g., ProviderModels), the generated client code incorrectly uses the directory name's kebab-case format for the namespace name.
Example
Given:
- Service directory:
api/my-service/ - Service definition in
encore.service.ts:new Service('MyService') - File
api/my-service/constants.ts, contains an exported "MyEnum" enum
The generated client creates an invalid namespace:
my-service.MyEnum
Environment
- Encore Version: v1.46.4
- Generated Client Type: TypeScript
- OS: OSX Sequoia 15.3.1