feat(core): forward portableTextBlocks and fieldWidgets for standard/sandboxed plugins#1484
Open
swissky wants to merge 1 commit into
Open
feat(core): forward portableTextBlocks and fieldWidgets for standard/sandboxed plugins#1484swissky wants to merge 1 commit into
swissky wants to merge 1 commit into
Conversation
…sandboxed plugins Standard- and sandboxed-format plugins could declare adminPages and adminWidgets, but their declarative portableTextBlocks and fieldWidgets were dropped in adaptSandboxEntry, so only native-format plugins surfaced them. The admin editor already reads both from the manifest (slash-menu entries + Block Kit forms), so the data simply never arrived for non-native plugins. Forward them like the existing admin config: - adaptSandboxEntry copies descriptor.portableTextBlocks / fieldWidgets onto admin - PluginDescriptor and SandboxedPluginEntry carry the fields - the in-process and codegen plugin builders pass them through - the sandboxed-entry and marketplace manifest loops emit them The site-side render component (componentsEntry) remains native-only. Resolves the pre-existing TODO in the sandboxed-plugin manifest loop.
🦋 Changeset detectedLatest commit: 9a59417 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
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 |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
Contributor
Overlapping PRsThis PR modifies files that are also changed by other open PRs:
This may cause merge conflicts or duplicated work. A maintainer will coordinate. |
18 tasks
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.
What does this PR do?
Standard- and sandboxed-format plugins can declare
portableTextBlocksandfieldWidgets, butadaptSandboxEntryonly copiedadminPages/adminWidgetsonto the resolvedadminconfig — so those two declarative fields were silently dropped for every non-native plugin. The admin editor already reads them from the manifest (slash-menu entries + Block Kit forms), so the data simply never arrived: a non-native plugin could never contribute a custom Portable Text block or field widget.This forwards both fields the same way
adminPages/adminWidgetsalready flow:plugins/adapt-sandbox-entry.ts— copydescriptor.portableTextBlocks/fieldWidgetsontoadmin.astro/integration/runtime.ts—PluginDescriptorcarries the two fields (typed via the existingPortableTextBlockConfig/FieldWidgetConfig).astro/integration/virtual-modules.ts— the in-processadaptSandboxEntry(...)call and the sandboxed-entry codegen pass them through.emdash-runtime.ts—SandboxedPluginEntryand the marketplace manifest cache carry them; the threeadaptSandboxEntrycall sites forward them; the sandboxed-entry and marketplace manifest loops emit them (this also resolves the pre-existingTODOin the sandboxed-plugin loop).The site-side render component (
componentsEntry) stays native-only — out of scope here.Closes #1483
Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runmessages.pochanges except in translation PRs — a workflow extracts catalogs on merge tomain.AI-generated code disclosure
Screenshots / test output
```
$ pnpm --filter emdash typecheck # tsgo --noEmit — clean
$ pnpm --filter emdash exec vitest run tests/unit/plugins/adapt-sandbox-entry.test.ts
Test Files 1 passed (1)
Tests 28 passed (28) # +3 new: portable text blocks, field widgets, omitted-config
```
oxlint + prettier --check clean on the changed files. No admin UI strings were added (i18n N/A).