chore: support emdash ^0.21.0 (v0.12.0)#1
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
page:metadata,content:afterPublish,content:afterUnpublishall still exist in0.21.0'splugin-types.d.mts.read:content,page:inject,network:fetchare all still valid.No source logic changes were required.
Changes
peerDependencies.emdash:^0.6.0→^0.21.0package-lock.jsonandpnpm-lock.yaml(both were stale at0.6.0)src/index.tsversion strings to0.12.0Verification
Against
emdash@0.21.0:npm run typecheck— cleannpm test— all 69 tests passing🤖 Generated with Claude Code