WORK-148
ID:WORK-148Status:done

Add edge-safe entry points to package.json exports

Wire up new package entry points in runes/plan/package.json for the extracted edge-safe modules: ./diff, ./filter, ./relationships, ./cards. Verify that each entry point can be imported without triggering Node.js API resolution.

Priority:highComplexity:simpleSource:SPEC-040

Acceptance Criteria

  • runes/plan/package.json exports map includes "./diff" pointing to ./dist/diff.js with types at ./dist/diff.d.ts
  • runes/plan/package.json exports map includes "./filter" pointing to ./dist/filter.js with types at ./dist/filter.d.ts
  • runes/plan/package.json exports map includes "./relationships" pointing to ./dist/relationships.js with types at ./dist/relationships.d.ts
  • runes/plan/package.json exports map includes "./cards" pointing to ./dist/cards.js with types at ./dist/cards.d.ts
  • Existing entry points (., ./scanner, ./cli-plugin) are unchanged
  • Each new entry point's module graph contains zero imports from node:fs, node:path, or node:child_process (verified by a build-time or test-time check)
  • Package builds successfully with tsc
  • All existing tests pass

Approach

  1. Add the four new export entries to the "exports" field in runes/plan/package.json, matching the pattern used by existing entries (both "types" and "default" conditions).
  2. After the package builds, verify edge-safety by statically analyzing the import graph of each new entry point. A simple approach: for each entry point, recursively follow imports and assert none resolve to node:* modules. This can be a test or a build script check.
  3. Run the full test suite to confirm no regressions.

Dependencies

References

Resolution

Completed: 2026-04-14

Branch: claude/edge-runtime-refactor-HOg8v

What was done

  • Added four new entry points to runes/plan/package.json exports map: ./diff, ./filter, ./relationships, ./cards
  • Each entry specifies both types (.d.ts) and default (.js) conditions
  • Verified all four entry points have zero Node.js imports via grep audit
  • Full monorepo build succeeds; all 321 plan tests pass

Notes

  • Existing entry points (., ./scanner, ./cli-plugin) are completely unchanged
  • Edge consumers can now: import { diffAttributes } from '@refrakt-md/plan/diff'

History

  1. 888d791
    statusreadydone
    • ☑ `runes/plan/package.json` exports map includes `"./diff"` pointing to `./dist/diff.js` with types at `./dist/diff.d.ts`
    • ☑ `runes/plan/package.json` exports map includes `"./filter"` pointing to `./dist/filter.js` with types at `./dist/filter.d.ts`
    • ☑ `runes/plan/package.json` exports map includes `"./relationships"` pointing to `./dist/relationships.js` with types at `./dist/relationships.d.ts`
    • +5 more criteria
  2. 7340389
    Created (ready, high, simple, SPEC-040, plan, architecture, edge-runtime)