Skip to content

fix(relay): publish resolvable runtime exports - #4741

Open
keithpk wants to merge 1 commit into
getpaseo:mainfrom
keithpk:fix/relay-exports-dist
Open

fix(relay): publish resolvable runtime exports#4741
keithpk wants to merge 1 commit into
getpaseo:mainfrom
keithpk:fix/relay-exports-dist

Conversation

@keithpk

@keithpk keithpk commented Sep 11, 2026

Copy link
Copy Markdown

Summary

Fixes #4730.

All runtime conditions in @getpaseo/relay's exports map now resolve to compiled JavaScript under dist/, which is included in the published package. This covers the root, ./e2ee, and ./cloudflare exports.

Regression test

Added packages/relay/src/package-exports.test.ts. It runs a real npm pack --dry-run, reads the artifact file list, and verifies that every node, import, and default export target is present.

Before the fix:

FAIL  packages/relay/src/package-exports.test.ts > published package exports > includes every runtime export target in the npm package
Expected: []
Received:
  src/index.ts
  src/index.ts
  src/e2ee.ts
  src/e2ee.ts
  src/cloudflare-adapter.ts
  src/cloudflare-adapter.ts
Test Files  1 failed (1)
Tests       1 failed (1)

After the fix:

$ npx vitest run packages/relay/src/package-exports.test.ts --bail=1
Test Files  1 passed (1)
Tests       1 passed (1)
Duration    1.00s

Packed-package QA

Packed the package, unpacked the tarball beneath a clean consumer's node_modules, and bundled a browser entry importing @getpaseo/relay/e2ee:

$ env npm_config_cache=/tmp/paseo-qa-4730/npm-cache npm pack ./packages/relay --pack-destination /tmp/paseo-qa-4730 --json --silent
"filename": "getpaseo-relay-0.8.0.tgz"
"entryCount": 17

$ node_modules/.bin/esbuild /tmp/paseo-qa-4730/consumer/index.js --bundle --platform=browser --external:base64-js --external:tweetnacl --external:ws --outfile=/tmp/paseo-qa-4730/consumer/bundle.js
../../../../tmp/paseo-qa-4730/consumer/bundle.js  3.0kb
Done in 2ms

$ rg -n 'generateKeyPair' /tmp/paseo-qa-4730/consumer/bundle.js
62:  function generateKeyPair() {
72:  console.log(generateKeyPair);

Consumer entry:

import { generateKeyPair } from "@getpaseo/relay/e2ee";

console.log(generateKeyPair);

Repository checks:

$ npm run typecheck
[all workspaces exit 0]

$ npm run lint
Found 0 warnings and 0 errors.
Finished in 561ms on 4183 files with 177 rules using 14 threads.

Platforms

Platform Tested Notes
macOS Yes Node 22.23.1, npm 10.9.8, esbuild packed-consumer bundle
Windows No Export map and artifact test are platform-independent
Linux No Export map and artifact test are platform-independent

@greptile-apps

greptile-apps Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR repairs the @getpaseo/relay package export map so every runtime condition resolves to compiled JavaScript included in the published artifact.

  • Redirects the root, ./e2ee, and ./cloudflare import and default conditions from unpublished TypeScript source to dist.
  • Adds an artifact-level regression test that performs a real npm dry-run pack and verifies every declared runtime export target is present.
  • Preserves the existing type declaration targets and Node runtime targets.

Confidence Score: 5/5

The PR appears safe to merge; the export targets now match the package’s published files and the regression test directly covers the original resolution failure.

No actionable failures remain: the compiled entries use the package’s ESM build configuration, npm packing rebuilds clean output, and all current runtime export conditions are checked against the resulting artifact.

Important Files Changed

Filename Overview
packages/relay/package.json Redirects all runtime export conditions to the package’s compiled ESM files under the published dist directory.
packages/relay/src/package-exports.test.ts Adds a deterministic packed-artifact regression test that rebuilds the relay package and verifies its runtime export targets are publishable.

Reviews (1): Last reviewed commit: "fix(relay): publish resolvable runtime e..." | Re-trigger Greptile

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.

bug: @getpaseo/relay exports map points import/default at unpublished src/*.ts, which breaks bundling @getpaseo/client in plugins

1 participant