Skip to content

fix(plugins): rename deprecated capabilities and read version from package.json#918

Merged
ascorbic merged 2 commits intomainfrom
fix/plugin-deprecated-capabilities
May 5, 2026
Merged

fix(plugins): rename deprecated capabilities and read version from package.json#918
ascorbic merged 2 commits intomainfrom
fix/plugin-deprecated-capabilities

Conversation

@ascorbic
Copy link
Copy Markdown
Collaborator

@ascorbic ascorbic commented May 5, 2026

What does this PR do?

Two cleanup changes to the built-in plugins under packages/plugins/ (plus the demos/cloudflare/plugins/sandbox-test manifest):

  1. Rename deprecated capability aliases. The plugin runtime accepts both the deprecated names (e.g. read:content, network:fetch:any) and the current ones (content:read, network:request:unrestricted) and silently normalizes deprecated → current, but the bundled built-in plugins were still declaring the deprecated names — which means warnings at bundle/validate and a hard fail at marketplace publish. All capabilities have been moved to current names. Comments, error messages, README snippets, and the atproto descriptor test that asserts on the capability list have been updated alongside.

  2. Read version from package.json instead of a hard-coded literal. webhook-notifier already did this; the rest of the plugins I touched in this branch had stale literals (e.g. atproto declared 0.1.0 in the descriptor while the package was at 0.1.2). They now import { version } from "../package.json" so the descriptor stays in sync with the published version.

The atproto plugin test now asserts descriptor.version === version (imported from package.json) instead of a hard-coded string, so the test moves with the package.

A patch-bump changeset is included for the four published plugins:
@emdash-cms/plugin-atproto, @emdash-cms/plugin-audit-log, @emdash-cms/plugin-forms, @emdash-cms/plugin-webhook-notifier. The three private plugins (api-test, marketplace-test, sandboxed-test) don't need bumps.

Closes #

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes (the 20 remaining diagnostics live in packages/contentful-to-portable-text/ and predate this branch)
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). Do not include messages.po changes except in translation PRs — a workflow extracts catalogs on merge to main.
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion: https://github.com/emdash-cms/emdash/discussions/...

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Claude Opus 4.7

Screenshots / test output

pnpm --filter @emdash-cms/plugin-atproto test — 67/67 tests pass.
pnpm --filter ... typecheck — clean across all six touched plugin packages.
pnpm --filter ... build — clean; the bundled dist/index.mjs for atproto inlines var version = "0.1.2";, confirming the package-json import bundles correctly.

…ckage.json

Renames the deprecated capability aliases (`read:content`, `write:content`,
`read:media`, `write:media`, `network:fetch`, `network:fetch:any`) used by the
built-in plugins to their current names. Plugin descriptors now read `version`
from each package's `package.json` instead of carrying a stale hard-coded
literal.
Copilot AI review requested due to automatic review settings May 5, 2026 06:12
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 5, 2026

🦋 Changeset detected

Latest commit: 9f58d54

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@emdash-cms/plugin-atproto Patch
@emdash-cms/plugin-audit-log Patch
@emdash-cms/plugin-forms Patch
@emdash-cms/plugin-webhook-notifier Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-demo-site Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 5, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-perf-coordinator 9f58d54 May 05 2026, 07:21 AM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 5, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-i18n 9f58d54 May 05 2026, 07:21 AM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 5, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
docs 9f58d54 May 05 2026, 07:22 AM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 5, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-cache 9f58d54 May 05 2026, 07:22 AM

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 5, 2026

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@918

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@918

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@918

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@918

emdash

npm i https://pkg.pr.new/emdash@918

create-emdash

npm i https://pkg.pr.new/create-emdash@918

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@918

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@918

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@918

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@918

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@918

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@918

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@918

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@918

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@918

commit: 9f58d54

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 5, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-playground 9f58d54 May 05 2026, 07:22 AM

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR cleans up built-in plugin manifests/descriptors by (1) updating declared capabilities from deprecated aliases to canonical names and (2) reading plugin version from each plugin package’s package.json to avoid drift between descriptor metadata and published package versions.

Changes:

  • Replaced deprecated capability aliases (e.g. read:content, network:fetch:any) with canonical capability names across built-in plugins and a Cloudflare demo manifest.
  • Updated multiple plugin descriptors to import version from package.json (and updated the atproto descriptor test accordingly).
  • Added a changeset to patch-bump the affected published plugins.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/plugins/webhook-notifier/src/sandbox-entry.ts Updates network capability wording in an error message.
packages/plugins/webhook-notifier/src/index.ts Uses package.json version and renames network capability to canonical name.
packages/plugins/sandboxed-test/src/sandbox-entry.ts Updates comments/error text to canonical content capability names.
packages/plugins/sandboxed-test/src/index.ts Uses package.json version and renames declared capabilities to canonical names.
packages/plugins/marketplace-test/src/index.ts Uses package.json version and renames declared capabilities to canonical names.
packages/plugins/marketplace-test/README.md Updates documented capability names to canonical names.
packages/plugins/forms/src/index.ts Uses package.json version and renames declared capabilities to canonical names.
packages/plugins/audit-log/src/index.ts Uses package.json version and renames declared content capability to canonical name.
packages/plugins/atproto/tests/plugin.test.ts Makes version assertion track package.json and updates expected capabilities.
packages/plugins/atproto/src/index.ts Uses package.json version and renames declared capabilities to canonical names.
packages/plugins/atproto/src/atproto.ts Updates network capability wording in an error message.
packages/plugins/api-test/src/index.ts Uses package.json version and renames declared capabilities + comments to canonical names.
demos/cloudflare/plugins/sandbox-test/manifest.json Renames declared capability to canonical name.
.changeset/plugins-rename-deprecated-capabilities.md Patch changeset for the published plugins affected by these cleanups.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

export function requireHttp(ctx: PluginContext) {
if (!ctx.http) {
throw new Error("AT Protocol plugin requires the network:fetch capability");
throw new Error("AT Protocol plugin requires the network:request capability");
function getFetchFn(ctx: PluginContext): FetchFn {
if (!ctx.http) {
throw new Error("Webhook notifier requires network:fetch capability");
throw new Error("Webhook notifier requires network:request capability");
format: "standard",
entrypoint: "@emdash-cms/plugin-webhook-notifier/sandbox",
capabilities: ["network:fetch:any"],
capabilities: ["network:request:unrestricted"],
format: "standard",
entrypoint: "@emdash-cms/plugin-audit-log/sandbox",
capabilities: ["read:content"],
capabilities: ["content:read"],
… validation

The publish endpoint's allow-list still only contained the deprecated capability
aliases, so manifests using the current names (e.g. `content:read`) were
rejected with 400. Adds the current names alongside the deprecated ones during
the transition window. The publish e2e test now reads the audit-log version
from `package.json` instead of hard-coding it.
@ascorbic ascorbic merged commit 1e0cb76 into main May 5, 2026
36 checks passed
@ascorbic ascorbic deleted the fix/plugin-deprecated-capabilities branch May 5, 2026 07:34
@emdashbot emdashbot Bot mentioned this pull request May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants