Skip to content

fix(adapters): add writeback/types subpaths and default export condition#21

Merged
khaliqgant merged 1 commit intomainfrom
fix/adapter-writeback-subpaths
Apr 17, 2026
Merged

fix(adapters): add writeback/types subpaths and default export condition#21
khaliqgant merged 1 commit intomainfrom
fix/adapter-writeback-subpaths

Conversation

@kjgbot
Copy link
Copy Markdown
Contributor

@kjgbot kjgbot commented Apr 17, 2026

Summary

  • Add ./writeback subpath to @relayfile/adapter-notion and @relayfile/adapter-github
  • Add ./types subpath to @relayfile/adapter-notion
  • Add \"default\" condition to every exports entry (notion, github, slack, linear)

Why

@relayfile/adapter-notion and @relayfile/adapter-github only exposed bare-root imports and their exports maps only declared the import condition. Downstream consumers running under CJS-style resolvers — in particular tsx --test used by the cloud integration tests — hit ERR_PACKAGE_PATH_NOT_EXPORTED on @relayfile/adapter-github and had to reach into node_modules/.../dist/writeback.js via fragile relative paths:

// workaround we are removing
import { GitHubWritebackHandler } from "../../../../node_modules/@relayfile/adapter-github/dist/writeback.js";

With this change, the cloud writeback bridge can use clean package-root / subpath imports:

import { GitHubWritebackHandler } from "@relayfile/adapter-github/writeback";
import {
  DEFAULT_NOTION_API_VERSION,
  resolveWritebackRequest,
  type NotionWritebackRequest,
} from "@relayfile/adapter-notion";

Test plan

  • npm run build clean for notion, github, slack, linear
  • npm test -w @relayfile/adapter-notion — 18/18 pass
  • npm test -w @relayfile/adapter-github — 167/167 pass
  • npm test -w @relayfile/adapter-slack — 8/8 pass
  • npm test -w @relayfile/adapter-linear — 13/13 pass
  • require.resolve('@relayfile/adapter-notion/writeback')dist/writeback.js
  • require.resolve('@relayfile/adapter-notion/types')dist/types.js
  • require.resolve('@relayfile/adapter-github/writeback')dist/writeback.js

🤖 Generated with Claude Code

@relayfile/adapter-notion and @relayfile/adapter-github only exposed
bare-root imports, and their exports maps only declared the `import`
condition. Downstream consumers running under CJS-style resolvers
(notably `tsx --test` used by cloud integration tests) hit
ERR_PACKAGE_PATH_NOT_EXPORTED on `@relayfile/adapter-github` and had to
reach into `node_modules/.../dist/writeback.js` via relative paths.

- Add `./writeback` subpath to adapter-notion and adapter-github so
  consumers can import writeback helpers without deep relative paths.
- Add `./types` subpath to adapter-notion so `NotionWritebackRequest`
  and `DEFAULT_NOTION_API_VERSION` are reachable via a stable path.
- Add `"default"` condition to every exports entry across notion,
  github, slack, and linear so resolvers without the `import`
  condition (tsx CJS, older bundlers) match the same ESM `.js` file.

Builds and tests remain green for all four adapters.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@khaliqgant khaliqgant merged commit 551d4c9 into main Apr 17, 2026
1 check passed
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.

2 participants