Skip to content

Add missing "./escrow" subpath export to package.json's exports map #100

Description

@meshackyaro

Description

README.md's own "Basic Usage" Quick Start example does import { createEscrow } from '@trustflow/sdk/escrow';. But package.json's "exports" field only declares a single "." condition (types/import/require all pointing at dist/index.*) — there is no "./escrow" entry. Under Node's package-exports resolution, any subpath not explicitly listed is unresolvable, so the documented example fails with ERR_PACKAGE_PATH_NOT_EXPORTED for real consumers of the published package.

Component

SDK

Difficulty

🟢 Easy

Tasks

  • Decide whether createEscrow should just be part of the root export (simplest, since src/index.ts already re-exports the ./escrow barrel) or whether a genuine ./escrow subpath build target should be added via tsup.config.ts
  • If keeping root-only exports, fix the README example instead (tracked in a companion documentation issue) and don't add the subpath
  • If adding the subpath, wire it into tsup.config.ts's entry and package.json's exports map with matching types/import/require conditions
  • Verify the chosen import path actually resolves from a built node_modules install, not just from source

Acceptance Criteria

  • Every import path shown in README.md and examples/ actually resolves against the published package's exports map
  • A CI or test step verifies the built package's subpath resolution

Estimated Time

<1 day

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions