Skip to content

feat(core): introduce side-effect-free core entrypoint#412

Open
gustavovalverde wants to merge 1 commit intozama-ai:mainfrom
gustavovalverde:phase1/core-entrypoint
Open

feat(core): introduce side-effect-free core entrypoint#412
gustavovalverde wants to merge 1 commit intozama-ai:mainfrom
gustavovalverde:phase1/core-entrypoint

Conversation

@gustavovalverde
Copy link

@gustavovalverde gustavovalverde commented Feb 19, 2026

Problem

Some consumers need lightweight utility APIs (for example KmsEIP712) without triggering WASM/native bootstrap at module import time.

Today, those APIs are effectively reachable through ./node / ./web entrypoints, which pull initialization paths and transitive WASM/native dependencies. In browser-targeted bundlers, this can cause resolution failures (fs/native paths) or unstable build behavior.

Why This Is Needed

This is currently impacting downstream tooling such as fhevm-mocks:

  • fhevm-mocks needs relayer-sdk EIP-712 helpers for mock flows.
  • Importing them through @zama-fhe/relayer-sdk/node couples the import to heavy runtime dependencies.
  • As a workaround, downstream code could vendor copies of helper logic, but this introduces maintenance/drift risk.

A dedicated side-effect-free core surface allows downstream packages to depend on official relayer-sdk utilities without vendoring and without pulling bootstrap dependencies.

Additional context (downstream integration symptom):

Downstream follow-up using this ./core entrypoint:

What This PR Does

  • Adds a dedicated ./core entrypoint for side-effect-free utility imports.
  • Wires build + publish outputs for ./core (rollup + API extractor + package exports/files).
  • Adds a regression test to ensure importing ./core does not load WASM bootstrap modules and still exposes expected KmsEIP712 behavior.

Scope / Non-goals

  • No behavioral changes to existing ./node, ./web, or ./bundle entrypoints.
  • No downstream migration in this PR; this is the foundational first step.

Validation

  • npx jest --colors --coverage=false src/core.test.ts

Introduce a dedicated `./core` export that exposes utility APIs without triggering WASM bootstrap imports at module load time.

This is phase 1 of the modular package architecture and includes build/export wiring plus a regression test to keep the boundary stable.
@cla-bot
Copy link

cla-bot bot commented Feb 19, 2026

Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @gustavovalverde on file. In order for us to review and merge your code, please sign:

  • For individual contribution: our CLA
  • for Bounty submission, if you are an individual: our T&C
  • for Bounty submission, if you are a company: our T&C
    to get yourself added.

If you already signed one of this document, just wait to be added to the bot config.

@gustavovalverde gustavovalverde changed the title feat(core): introduce side-effect-free core entrypoint (phase 1) feat(core): introduce side-effect-free core entrypoint Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant