Skip to content

feat(diff): move ::diff out of comark-annotate into its own package, comark-diff - #73

Merged
vitehub-bot[bot] merged 21 commits into
mainfrom
feat/comark-diff
Oct 21, 2026
Merged

vitehub-bot[bot] merged 21 commits into
mainfrom
feat/comark-diff

Conversation

@onmax

@onmax onmax commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

::diff moves out of comark-annotate into a new package, comark-diff. It's unreleased (it ships in v0.3.0, #22), so nothing breaks for anyone.

The diff shares nothing with screenshots: no marks, zoom, or carousel. Keeping it in annotate meant installing zoom and carousel to get a diff, and nobody looking for a diff block looks in a package called "annotate". comark-code was the other option, but it decorates any pre in Vue, React, Svelte, and HTML, while a diff is one HTML-only block that reads two fences into a table.

What moved

  • New package: packages/diff, with the same behavior, messages, and tests.
    • src/read.ts holds readDiff, the line and word LCS, the prop checks, and the block naming.
    • src/html.ts is the renderer, with no script.
    • Like github-callouts, it bundles only comark-zoom/theme and has no runtime dependencies.
  • Class prefix: ca-diff/ca-* became cd/cd-*. --ca-red, --ca-green, and --ca-code-font became --cd-red, --cd-green, and --cd-font.
  • comark-annotate: loses the block, its styles, its README section, and its skill text.
  • A diff inside a note: annotate no longer reports it. comark-diff checks a diff wherever it sits.
  • lint-comark: loads comark-diff/html as an optional peer.
  • Docs:
    • a diff section with index, getting started, and syntax pages;
    • the playground and docs build register the plugin;
    • the review recipe lists it in its setup;
    • the e2e contrast test moved to e2e/diff.e2e.ts.

Before releasing

Stacked on #80

This PR now targets test/workspace and merges after #77, #78, #79, and #80. A merge of that stack moved comark-diff onto the new layout:

  • its pages are in packages/diff/docs/, with its rail group, icon, and blurb in the overview's frontmatter;
  • its slug is in packageOrder, and its plugin in docs/plugins.ts;
  • it builds with the shared definePackage();
  • its cd prefix is in AGENTS.md's list;
  • its LICENSE credits Lucide's icons rather than callout icons.

pnpm build, node docs/build.ts, vp check, pnpm run doctor, and vp test pass (313 tests). test/workspace.test.ts checks every one of those registrations.

Checked

  • pnpm ready passes:
    • format, build with publint for every package, vp check, and 214 tests;
    • Vite Doctor, after replacing a Record annotation the strict preset flagged.
    • The 2 lint warnings in e2e/annotate.e2e.ts are also on main.
  • The docs site builds. Its examples fail the build on any issue, including the new-file example.
  • playwright test e2e/diff.e2e.ts e2e/docs.e2e.ts: 6 passed.
  • The diff on /diff/, light and dark, renders the same as before the move.

🤖 Generated with Claude Code

@vitehub-bot

vitehub-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

Session

Updated the branch with main because main changed README.md, packages/charts/package.json, test/workspace.test.ts after its checks ran; waiting for checks on the new head.

Session

Updated the branch with main because main changed README.md, packages/charts/package.json, test/workspace.test.ts after its checks ran; waiting for checks on the new head.

Session

Updated the branch with main because main changed README.md, packages/charts/package.json, test/workspace.test.ts after its checks ran; waiting for checks on the new head.

Session

Updated the branch with main because main changed README.md, packages/charts/package.json, test/workspace.test.ts after its checks ran; waiting for checks on the new head.

Session

Updated the branch with main because main changed README.md, packages/charts/package.json, test/workspace.test.ts after its checks ran; waiting for checks on the new head.

Session

Updated the branch with main because main changed README.md, packages/charts/package.json, test/workspace.test.ts after its checks ran; waiting for checks on the new head.

Session

Updated the branch with main because main changed README.md, packages/charts/package.json, test/workspace.test.ts after its checks ran; waiting for checks on the new head.

Session

Updated the branch with main because main changed README.md, packages/charts/package.json, test/workspace.test.ts after its checks ran; waiting for checks on the new head.

Session

Updated the branch with main because main changed README.md, packages/charts/package.json, test/workspace.test.ts after its checks ran; waiting for checks on the new head.

Session

Updated the branch with main because main changed README.md, packages/charts/package.json, test/workspace.test.ts after its checks ran; waiting for checks on the new head.

@pkg-pr-new

pkg-pr-new Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/onmax/comark-plugins/comark-annotate@73

comark-carousel

pnpm add https://pkg.pr.new/onmax/comark-plugins/comark-carousel@73

comark-charts

pnpm add https://pkg.pr.new/onmax/comark-plugins/comark-charts@73

comark-chips

pnpm add https://pkg.pr.new/onmax/comark-plugins/comark-chips@73

comark-code

pnpm add https://pkg.pr.new/onmax/comark-plugins/comark-code@73

comark-diff

pnpm add https://pkg.pr.new/onmax/comark-plugins/comark-diff@73

comark-embed

pnpm add https://pkg.pr.new/onmax/comark-plugins/comark-embed@73

comark-github

pnpm add https://pkg.pr.new/onmax/comark-plugins/comark-github@73

comark-icon

pnpm add https://pkg.pr.new/onmax/comark-plugins/comark-icon@73

comark-include

pnpm add https://pkg.pr.new/onmax/comark-plugins/comark-include@73

comark-linter

pnpm add https://pkg.pr.new/onmax/comark-plugins/comark-linter@73

comark-tabs

pnpm add https://pkg.pr.new/onmax/comark-plugins/comark-tabs@73

comark-zoom

pnpm add https://pkg.pr.new/onmax/comark-plugins/comark-zoom@73

commit: d66aa40

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ d66aa40 2026-10-21T22:09:49.339Z Visit the dashboard ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 2cc3bc4 2026-10-21T19:27:25.158Z Visit the dashboard ↗
  • Build: Failed ❌

View logs ↗
421a2c5 2026-10-21T18:38:49.083Z View logs ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 12a12cc 2026-10-21T18:10:37.007Z Visit the dashboard ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 3bc142b 2026-10-21T17:54:17.434Z Visit the dashboard ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 48ef66d 2026-10-21T14:33:42.109Z Visit the dashboard ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 5b52c45 2026-10-21T14:13:41.487Z Visit the dashboard ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 52e9f21 2026-10-21T13:54:25.852Z Visit the dashboard ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 7aa095b 2026-10-21T13:37:53.377Z Visit the dashboard ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ e29f347 2026-10-21T13:25:14.986Z Visit the dashboard ↗

View all previews: View all previews ↗

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The package-specific publication path can fail from a clean checkout because the new package's build depends on comark-zoom artifacts that this prepack command does not create.

Reviewed changes

  • Package extraction — Reviewed the new comark-diff parser, HTML renderer, styles, package metadata, tests, docs, e2e coverage, and removal of ::diff from comark-annotate.
  • Integration — Reviewed registration in the docs/playground and automatic plugin/component discovery in lint-comark.
  • Behavior — Traced the shared parse/render validation path, nested diff traversal, line/word diff generation, Shiki handling, and new .cd styling.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-5.6-sol | 𝕏

Comment thread packages/diff/package.json Outdated

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The prior package publication issue remains unresolved: comark-diff's prepack still builds only itself even though its build imports the comark-zoom/theme workspace export. A clean package-specific pack can therefore fail before comark-zoom has generated dist/theme.mjs.

Reviewed changes

  • Docs build conflict resolution — Updated the docs icon name and restored the diff package navigation entry and blurb after the merge conflict.

⚠️ Package publication still depends on an unbuilt workspace artifact

comark-diff remains unable to guarantee its standalone prepack path from a clean checkout because packages/diff/package.json runs only its own build, while packages/diff/src/styles.ts imports comark-zoom/theme and that export resolves to a generated file. The existing review thread at packages/diff/package.json:40 contains the affected sites and required outcome; build the prerequisite as part of this package's publication path before merging.

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-5.6-sol | 𝕏

@vitehub-bot

vitehub-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Fixed Pullfrog’s P1 publication-path finding: comark-diff prepack now builds comark-zoom before building comark-diff, ensuring comark-zoom/theme exists from a clean checkout.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Reviewed the commits since the prior Pullfrog review, focusing on the package publication path and the docs conflict resolution.

  • Fixed package publication — Updated comark-diff's prepack script to build comark-zoom before the diff package, resolving the previously reported clean-checkout failure.
  • Restored docs integration — Preserved the diff navigation entry and file-diff icon after the docs merge conflict.

The package-specific pnpm --filter comark-diff pack --dry-run path now builds both packages and produces a publint-clean tarball. Broader pnpm commands remain limited by this environment's read-only .git/config during the automatic prepare step.

Pullfrog  | View workflow run | Using gpt-5.6-sol | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one documentation consistency suggestion is inline.

Reviewed changes — Reviewed the commits since the prior Pullfrog review, focusing on the linter documentation conflict resolution and confirming the earlier package publication fix remains valid.

  • Updated linter documentation — Added comark-diff to the installed package list and adjusted the linter README and getting-started content.
  • Revalidated package publication — Confirmed comark-diff's prepack builds comark-zoom first and that the package-specific dry run produces a publint-clean tarball.

Note: 1 inline comment(s) dropped because they did not anchor to lines inside the PR diff:

  • packages/lint/README.md:2157 (RIGHT) — line 2157 (RIGHT) is not inside a diff hunk

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-5.6-sol | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one documentation consistency suggestion is inline.

Reviewed changes — Reviewed the commits since the prior Pullfrog review, focusing on the docs merge resolution and confirming the package publication fix remains intact.

  • Restored annotate examples — Reconciled the annotate components examples and kept the ::diff documentation in its new package context.
  • Updated linter integration docs — Added comark-diff to the installed package list and preserved the linter's automatic plugin discovery configuration.
  • Revalidated package publication — Confirmed the comark-diff prepack path builds comark-zoom before the diff package.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-5.6-sol | 𝕏

Comment thread packages/lint/README.md Outdated

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Reviewed the commits since the prior Pullfrog review, focusing on the final linter README correction and confirming the package publication and docs conflict fixes remain valid.

  • Closed the README code span — Fixed the defineConfig({ plugins, components }) Markdown span so the remainder of packages/lint/README.md renders normally.
  • Preserved package publication — Confirmed comark-diff still builds comark-zoom before its own package in the prepack path.
  • Preserved docs and linter integration — Confirmed the diff docs registration and automatic linter package discovery remain intact.

Pullfrog  | View workflow run | Using gpt-5.6-sol | 𝕏

@vitehub-bot

vitehub-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Reproduced the required publish failure: pkg-pr-new publish './packages/*' reaches the service, which returns HTTP 404 There is no workflow defined for <token>. The exact base commit passes the same Continuous Releases workflow, and the local comark-diff prepack/pack path succeeds; no repository change can repair this external service failure.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The new contextmenu forwarding can break host cancellation of annotated screenshot menus because it replaces the trusted event with an independent synthetic event.

Reviewed changes — Reviewed the changes since the prior Pullfrog review, focusing on the merge-main delta and its playground, documentation, e2e, and annotated-image runtime updates.

  • Added playground controls — Added Markdown/config copy controls, preset reset confirmation, and stale hash-load protection.
  • Updated playground presentation — Adjusted the generated playground markup and responsive styling, and clarified the fictional code example.
  • Hardened e2e timing — Waited for the screenshot image to decode before measuring annotation geometry and added coverage for reset and copy behavior.
  • Changed screenshot menu forwarding — Replaced the earlier eager synthetic notification with contextmenu forwarding to the prepared overlay.

Note: 1 inline comment(s) dropped because they did not anchor to lines inside the PR diff:

  • packages/annotate/src/client.ts:570 (RIGHT) — file not in PR diff

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-5.6-sol | 𝕏

@vitehub-bot

vitehub-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Pullfrog: P1 finding verified in packages/annotate/src/client.ts, but the contextmenu forwarding code is byte-for-byte unchanged from main and outside this PR’s diff; I’m leaving it for a dedicated annotate fix rather than widening PR #73.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Reviewed the merge-main delta since the prior Pullfrog review, with the full PR diff as context.

  • Merged chips integration — Added comark-chips to the docs builder and playground alongside comark-diff, while keeping chips disabled for the site's own links and enabled for examples.
  • Preserved linter discovery — Kept comark-diff/html in optional peer dependency metadata and automatic package loading; the explicit linter fixture remains intentionally scoped to annotate components.
  • Preserved diff extraction fixes — Confirmed the package publication prerequisite, linter README correction, docs registration, and .cd styling remain intact.

Pullfrog  | View workflow run | Using gpt-5.6-sol | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Reviewed the commits since the prior Pullfrog review, focusing on the comark-github rename merge and its integration with the docs site, playground, linter discovery, and workspace metadata.

  • Resolved GitHub integration conflicts — Updated the docs builder and playground to register callouts, references, and the raw HTML plugin from comark-github, with the matching component map.
  • Preserved linter discovery — Kept comark-diff discovery intact while mapping the renamed GitHub package's named callouts export to the linter's plugin slot and retaining optional dependency metadata.
  • Validated package publication — Confirmed comark-diff's package-specific dry run still builds comark-zoom first and produces a publint-clean tarball.

The focused package tests could not start because pnpm's automatic prepare step cannot lock the read-only .git/config in this environment.

Pullfrog  | View workflow run | Using gpt-5.6-sol | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The merge-main delta leaves the new package's published Comark peer contract on the pre-upgrade 0.7.x range, so this PR cannot be installed cleanly with the workspace's current Comark 0.8.x release.

Reviewed changes — Reviewed the merge-main commits since the prior Pullfrog review, with the full PR diff as context, focusing on the Comark 0.8 migration and its effects on the extracted comark-diff package, code rendering, linting, and existing annotate behavior.

  • Upgraded Comark dependencies — Raised the workspace catalog and existing package peer ranges to Comark 0.8.x, and adapted code-block attribute handling and linter token scanning to the new parser.
  • Preserved diff integration — Confirmed the extracted parser, HTML renderer, package publication prerequisite, docs registration, and linter auto-discovery remain present after the merge.
  • Retained runtime changes — Rechecked the annotate context-menu overlay behavior and the security-plugin test adjustment carried through the merge.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-5.6-sol | 𝕏

Comment thread packages/diff/package.json Outdated
onmax added 2 commits October 21, 2026 21:09
…everywhere, lint ::embed, give chips its own class, and correct four LICENSE files

docs/pages/code.md came back in a merge and hid docs/pages/code/index.md, so /code/ rendered the old single page; build.ts now refuses both. The lint docs called the command and config file comark-lint, but the bin is lint-comark. The linter didn't load comark-embed, so ::embed read as an unknown component. comark-chips used .cch, which comark-charts already uses, so a page with both gave chips a chart's margin, padding, and border; chips is now .cp, and AGENTS.md lists each package's prefix. charts, chips, and icon ship no Lucide icons, and embed's aren't callout icons.
onmax added 5 commits October 21, 2026 21:22
…rowser script script.ts like zoom's

Each package's tsdown.config.ts calls definePackage() or defineComponentsPackage() from the root tsdown.shared.ts instead of repeating the format, publint, Svelte copy, and style.css plugin.
…ke VueUse

docs/pages/<pkg>/ moves to packages/<pkg>/docs/, and the overview's frontmatter gives the package's rail group, icon, blurb, and credits, so build.ts keeps only the order. files: ["dist"] keeps the pages out of npm. docs/pages keeps the landing page, guides, recipes, and comparisons. The build refuses pages left in docs/pages/<pkg> by a branch from before the move, and a package docs folder with no place in the rail. The rendered site is unchanged.
… to be

test/workspace.test.ts checks each package's shared manifest fields, prepack, tsdown preset, LICENSE, docs, README row, and, for one with a renderer, its place in the linter's peers and loaders and in the docs' plugins. charts gets the engines field the others have.
comark-diff's pages move to packages/diff/docs with its rail metadata in their frontmatter, and it builds with the shared tsdown preset, registers in docs/plugins.ts and packageOrder, and takes the cd prefix in AGENTS.md's list. Its LICENSE credits Lucide's icons rather than callout icons.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The previously reported peer dependency contract is still unresolved; the restructure delta itself introduces no additional issue.

Reviewed changes — Reviewed the restructure-stack commits since the prior Pullfrog review, with the complete PR diff as context, focusing on package layout, shared build configuration, docs/playground registration, and the extracted comark-diff integration.

  • Moved package documentation — Relocated package pages into per-package docs/ folders and preserved comark-diff's navigation metadata and examples.
  • Centralized plugin registration — Consolidated the docs and playground plugin/component lists while retaining comark-diff and linter auto-discovery.
  • Shared package builds — Switched the new package to the shared definePackage() configuration and retained its comark-zoom publication prerequisite.
  • Added workspace coverage — Added registration checks for the package locations and integration points required by the restructure.

⚠️ comark-diff still publishes incompatible Comark peer ranges

The extracted package still declares @comark/html and comark as ^0.7.0, while this branch's workspace and the package's own development dependencies use Comark 0.8.1. Consumers following the package's documented install path can receive an invalid peer dependency warning or installation failure against the current release.

Technical details
# Align the published peer contract with the Comark 0.8 migration

## Affected sites
- `packages/diff/package.json:48-49` — the published peers remain on `^0.7.0`.
- `pnpm-workspace.yaml:21-22` — the workspace catalog resolves `@comark/html` and `comark` from `^0.8.1`.

## Required outcome
- Publish `comark-diff` with peer ranges compatible with the Comark `0.8.x` release used by this workspace and regenerate the lockfile importer if required.

Note: 1 inline comment(s) dropped because they did not anchor to lines inside the PR diff:

  • packages/diff/package.json:1329 (RIGHT) — line 1329 (RIGHT) is not inside a diff hunk

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-5.6-sol | 𝕏

@vitehub-bot

vitehub-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Pullfrog: P1 peer-contract finding verified: comark-diff still publishes ^0.7.0 peers while the workspace and lockfile use Comark 0.8.1. The required manifest and lockfile repair is identified, but this pass is within the host-enforced push window, so no files or commit can be changed.

@vitehub-bot
vitehub-bot Bot changed the base branch from test/workspace to main October 21, 2026 21:59

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Reviewed the incremental delta since the prior Pullfrog review, including the workspace restructure range-diff and final Comark peer dependency correction.

  • Reconciled workspace layout — Preserved per-package docs discovery, shared tsdown builds, workspace registration checks, and the comark-diff package's docs, linter, and playground integration.
  • Aligned peer dependencies — Updated comark-diff to publish @comark/html and comark peer ranges compatible with the workspace's Comark 0.8.x release.
  • Retained diff behavior — Confirmed the extracted parser, renderer, styles, public registration, and lockfile importer remain coherent after the restructure and final fix.

Focused build and test commands were attempted but pnpm's automatic prepare step was blocked by the environment's read-only .git/config.

Pullfrog  | View workflow run | Using gpt-5.6-sol | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Reviewed the incremental delta since the prior Pullfrog review, with the full authoritative PR diff as context.

  • Merged current main — Reconciled the PR with the current main branch; the merge commit introduces no additional file changes relative to the PR head.
  • Preserved workspace registration — Confirmed comark-diff remains registered in the shared package checks, docs and playground plugin lists, linter auto-discovery, package metadata, and lockfile importer.
  • Retained publication contract — Confirmed the comark-zoom prepack prerequisite and Comark 0.8.x peer ranges remain intact.

Focused Vitest commands were attempted but were blocked by the environment's automatic prepare step: could not lock config file .git/config: Read-only file system.

Pullfrog  | View workflow run | Using gpt-5.6-sol | 𝕏

@vitehub-bot
vitehub-bot Bot merged commit cf11cdc into main Oct 21, 2026
9 checks 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.

1 participant