Skip to main content

Contributing

When a consumer app (tokenops-app, tokenops-api, etc.) depends on @tokenops/sdk during active SDK development, there are two ways to reference the local copy from the consumer's package.json.

"@tokenops/sdk": "link:../tokenops-sdk"

pnpm creates a symlink into node_modules/@tokenops/sdk that points directly at the SDK's dist/ directory. After pnpm build in the SDK repo, the consumer picks up the rebuilt output immediately — no reinstall required.

Use link: during active SDK development where you're iterating quickly.

:::caution Transitive dep gotcha link: bypasses pnpm's content-addressed dedup for the symlinked package. If the SDK and the consumer both declare viem as a dependency but at different exact versions, Node may load two copies of viem. This causes hard-to-diagnose failures (e.g. instanceof checks silently failing across module boundaries).

Fix: align the consumer's viem version to the SDK's exact version pin. Check the SDK's package.json and match it in the consumer:

// consumer package.json
"viem": "2.48.0" // must match @tokenops/sdk's devDependency pin exactly

Run pnpm install in the consumer after changing the version. :::

file: — hermetic, snapshot install

"@tokenops/sdk": "file:../tokenops-sdk"

pnpm hard-copies the SDK's current state into its content-addressed store at install time. The consumer gets a stable, reproducible snapshot — good for CI and one-off integration tests.

The downside: rebuilding the SDK does not update the consumer's copy. You must run pnpm install --force in the consumer after every SDK rebuild.

Use file: in CI or when testing a specific SDK version without picking up ongoing changes.

Summary

link:file:
Picks up SDK rebuildsyes (immediate)no (requires --force reinstall)
Transitive dep dedupbypassednormal pnpm dedup
viem version alignment neededyesno
Recommended foractive SDK devCI, snapshot testing

Workflow for active development

  1. In the consumer repo, set "@tokenops/sdk": "link:../tokenops-sdk" and align viem versions.
  2. Run pnpm install in the consumer.
  3. In the SDK repo, run pnpm build whenever you want the consumer to pick up changes.
  4. No reinstall needed in the consumer — the symlink always resolves to the latest dist/.