Skip to content

Commit 10e1e0e

Browse files
authored
fix(server): make callable extension type augmentation work in published builds (#1755)
## Problem `import '@orpc/server/extensions/callable'` works at runtime, but in the published package `.callable()` fails type-checking: ``` Property 'callable' does not exist on type 'DecoratedProcedure<...>' ``` ## Root cause The source augments `declare module '../procedure-decorated'`, which declaration bundling rewrites to `declare module "../index"`. That extensionless path resolves to `dist/index.d.ts`, while consumers get their types from `dist/index.d.mts` via the exports map — so the augmentation merges into a module the consumer never uses. The monorepo never sees this because dev exports point at `src`. ## Fix Augment `declare module '@orpc/server'` instead, matching every other extension in the repo (next, effect, openapi). The bare specifier survives bundling and resolves to the same entry the consumer imports. ## Verification - `pnpm test` and `pnpm type:check` pass - The built `dist` works
1 parent 21251bb commit 10e1e0e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/server/src/extensions/callable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { ProcedureClient, ProcedureClientOptions } from '../procedure-clien
77
import { createProcedureClient } from '../procedure-client'
88
import { DecoratedProcedure } from '../procedure-decorated'
99

10-
declare module '../procedure-decorated' {
10+
declare module '@orpc/server' {
1111
interface DecoratedProcedure<
1212
TInitialContext extends Context,
1313
TInjectedContext extends Context,

0 commit comments

Comments
 (0)