Conversation
3a85821 to
8e211b4
Compare
src/... imports in the published type declarations
|
@greptileai review Generated by Claude Code |
|
|
Replies to the Greptile findings (both non-blocking):
Generated by Claude Code |
Comments Outside DiffThese findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.
|
Bare `src/...` specifiers were emitted unchanged into the `.d.ts` files, so consuming projects couldn't resolve them and the affected types became `any`. Replace them with relative imports and drop `baseUrl` from the tsconfig so they can't creep back in. With the types resolving, the scope callbacks in the module config rejected the application's own scope class under `strictFunctionTypes`. Make `BrevoModuleConfig` generic over the scope type so `BrevoModule.register()` infers it from `emailCampaigns.Scope`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PJLvtQHLoB2B8Qsfxvo9Pw
8e211b4 to
b57f429
Compare
Some brevo-api sources imported internal types via bare
src/...specifiers. They only resolved inside the package (throughbaseUrl) and were emitted unchanged into the published.d.tsfiles. Consuming projects can't resolve them, so these types silently becameany, for instanceEmailCampaignScopeInterfaceand large parts of theBrevoModule.register()config. The imports are now relative, andbaseUrlis gone so that baresrc/...imports fail to compile.Once the types resolve, the scope callbacks in the config reject the application's own scope class under
strictFunctionTypes:(scope: EmailCampaignContentScope) => ...isn't assignable to(scope: Record<string, any>) => .... To fix this,BrevoModuleConfigis now generic over the scope type, andBrevoModule.register()infers it fromemailCampaigns.Scope. This waybrevo.resolveConfigandemailCampaigns.frontendcan be typed with the application's scope class without casts:The type parameter has a default, so existing references to
BrevoModuleConfigkeep working. Projects whose config was only accepted because it was typed asanymay now get type errors.Session: https://claude.ai/code/session_01PJLvtQHLoB2B8Qsfxvo9Pw