Skip to content

Published types: TransactionBuilder.d.ts imports DeferredRedeemer, which stripInternal removes #554

Description

@loveaihq

Summary

The type declarations published in 0.5.14 don't type-check; the sources are unchanged on main at 714a6da.

  • dist/sdk/builders/TransactionBuilder.d.ts imports DeferredRedeemer from ./RedeemerBuilder.js, but RedeemerBuilder.d.ts doesn't export it.
  • In RedeemerBuilder.ts, DeferredRedeemer is marked /** @internal */, and packages/evolution/tsconfig.build.json sets "stripInternal": true. The declaration is removed, while the import in TransactionBuilder.ts (line 87) stays.

Reproduce

package.json: "@evolution-sdk/evolution": "0.5.14", "typescript": "5.9.3"

tsconfig.json:

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "strict": true,
    "noEmit": true,
    "skipLibCheck": false
  },
  "include": ["index.ts"]
}

index.ts:

import * as Evolution from "@evolution-sdk/evolution"

export const sdk = Evolution

Then run npx tsc -p .

Expected

No errors.

Actual

node_modules/@evolution-sdk/evolution/dist/sdk/builders/TransactionBuilder.d.ts(54,15): error TS2305: Module '"./RedeemerBuilder.js"' has no exported member 'DeferredRedeemer'.

Notes

  • It is the only such error. Type-checking all 222 .d.ts files in dist reports just this one.
  • With skipLibCheck: true the build passes, but silently. The unresolved import becomes any, so DeferredRedeemerData["deferred"] is any for consumers. DeferredRedeemerData is documented as public (@since 2.0.0, @category state), and TxBuilderState.deferredRedeemers uses it.
  • Restoring four declarations fixes it. I restored the four @internal type declarations from RedeemerBuilder.ts (StaticRedeemer, SelfRedeemer, BatchRedeemer and DeferredRedeemer) into the published RedeemerBuilder.d.ts. Both the consumer above and all 222 files then type-check, and deferred is typed again. toDeferredRedeemer can stay internal. So dropping @internal from those four types is enough, unless DeferredRedeemerData isn't meant to be public after all.
  • CI could catch this kind of break. A consumer compiled with skipLibCheck: false would do it.

Investigated with AI assistance (Claude Code); the reproduction above was run with TypeScript 5.9.3 against 0.5.14.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions