Skip to content

fix(hir): #925 — unimplemented-API errors point at the supported replacement - #935

Merged
proggeramlug merged 1 commit into
mainfrom
worktree-agent-a615d53716758b16f
May 17, 2026
Merged

proggeramlug merged 1 commit into
mainfrom
worktree-agent-a615d53716758b16f

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • 7 new unit tests in lower::unimpl_hints::tests covering the lookup matrix (pass).
  • Manual end-to-end verification: compile /tmp/test_925_crypto_hmac.ts, /tmp/test_925_require_jose.ts, and a require("crypto") fixture; confirm each error message carries the trailing hint sentence.
  • cargo build --release -p perry-hir -p perry clean.
  • cargo fmt clean.
  • No conflict markers left in Cargo.toml / CLAUDE.md / Cargo.lock after rebase onto current main.

For two error shapes that the user spends 15 minutes diagnosing:

1. `crypto.hmacSha256(data, key)` now points at
   `crypto.createHmac("sha256", key).update(data).digest("hex")`.
2. `require("jose")` distinguishes "in stdlib, swap to ESM" from
   "not in stdlib at all — static import compiles but every call is
   undefined at runtime" (vs. `require("crypto")`).

New `crates/perry-hir/src/lower/unimpl_hints.rs` keys (module, prop)
and require-specs to a narrow hint table; the three existing #463
emission sites and the #668 `require()` rejection append the hint when
one is available. Generic "see `perry --print-api-manifest`" message
still fires for everything not on the explicit list. 7 unit tests
cover the lookup matrix.
@proggeramlug
proggeramlug merged commit aed185b into main May 17, 2026
7 of 9 checks passed
@proggeramlug
proggeramlug deleted the worktree-agent-a615d53716758b16f branch May 17, 2026 16:17
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