Skip to content

chore: support emdash ^0.21.0 (v0.12.0)#1

Merged
jdevalk merged 2 commits into
mainfrom
chore/emdash-0.21-compat
Jun 18, 2026
Merged

chore: support emdash ^0.21.0 (v0.12.0)#1
jdevalk merged 2 commits into
mainfrom
chore/emdash-0.21-compat

Conversation

@jdevalk

@jdevalk jdevalk commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Summary

Updates the plugin to work with the latest EmDash release (0.21.0, previously pinned to ^0.6.0).

The jump is large on paper, but the plugin API this plugin depends on is unchanged across the range:

  • Hookspage:metadata, content:afterPublish, content:afterUnpublish all still exist in 0.21.0's plugin-types.d.mts.
  • Capabilitiesread:content, page:inject, network:fetch are all still valid.

No source logic changes were required.

Changes

  • peerDependencies.emdash: ^0.6.0^0.21.0
  • Regenerate package-lock.json and pnpm-lock.yaml (both were stale at 0.6.0)
  • Bump package version + internal src/index.ts version strings to 0.12.0
  • Add CHANGELOG entry

Verification

Against emdash@0.21.0:

  • npm run typecheck — clean
  • npm test — all 69 tests passing

🤖 Generated with Claude Code

jdevalk and others added 2 commits June 18, 2026 15:06
Bump the emdash peer dependency from ^0.6.0 to ^0.21.0 to track the
current EmDash release. The plugin's hooks (page:metadata,
content:afterPublish, content:afterUnpublish) and capabilities
(read:content, page:inject, network:fetch) are unchanged across the
range, so no source changes were needed.

- peerDependencies.emdash: ^0.6.0 -> ^0.21.0
- regenerate package-lock.json and pnpm-lock.yaml (both stale at 0.6.0)
- bump package version + internal src/index.ts version strings to 0.12.0
- add CHANGELOG entry

Verified against emdash@0.21.0: typecheck clean, all 69 tests passing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adopt two hooks added in emdash 0.21.0:

- content:afterSave -> handleIndexNowPublished. Pings IndexNow whenever
  published content is saved, closing the gap where edits to an already-
  published page never notified search engines (afterPublish only fires
  on the draft->published transition). afterPublish and afterSave both
  route through this handler; a per-URL 60s debounce collapses the
  duplicate they fire at the publish moment and absorbs autosave bursts.
- content:afterDelete -> handleIndexNowDelete. Pings the dead URL on a
  permanent delete so engines recrawl and see the 404/410. The delete
  event carries only { id, collection } (no slug), so published saves
  cache an id->url mapping in KV that the delete handler resolves and
  clears. Trashing stays on the afterUnpublish path.

Extracted submitUrlToIndexNow from handleIndexNowTransition (now only
afterUnpublish). Added 9 tests; README + CHANGELOG updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jdevalk jdevalk merged commit c6cc96f into main Jun 18, 2026
3 checks passed
@jdevalk jdevalk deleted the chore/emdash-0.21-compat branch June 18, 2026 13:36
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