Skip to content

Emdash plugin v0 1 - #40

Open
diogoascarneiro wants to merge 6 commits into
mainfrom
emdash-plugin-v0_1
Open

Emdash plugin v0 1#40
diogoascarneiro wants to merge 6 commits into
mainfrom
emdash-plugin-v0_1

Conversation

@diogoascarneiro

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds @cloudflare/polystella-emdash, a native EmDash 0.36.x integration and PolyStella’s sixth independently versioned public package.

  • Adds separate server and React admin entrypoints.
  • Validates deployment-defined collection, field, locale, model, catalog, and Workers AI policy at startup.
  • Adds project settings that let administrators narrow the deployment allowlist.
  • Adds an editor panel for translating selected saved string, text, and Portable Text fields.
  • Rereads content server-side through content:read, preserves tokens and Portable Text structure, and updates through EmDash’s normal API using _rev.
  • Adds catalog generation, editing, per-key overrides, status inspection, deterministic JSON export, and opt-in runtime overrides.
  • Adds route authorization, input and prompt limits, sanitized provider failures, and safe storage handling.
  • Adds 31 focused tests plus package, CI, clean-consumer, documentation, proposal, implementation, and reviewer guidance.
  • Documents current EmDash limitations and drafts upstream issues for missing panel visibility, schema access, and editor-state APIs.

This is a trusted configuration-installed native plugin. It runs in-process; EmDash capabilities limit provided ctx.* services but are not a sandbox.

Known EmDash limitations are handled conservatively: translation uses the latest saved entry, deployment allowlists remain authoritative, stale writes return 409, and unsafe bulk conditional override clearing is not exposed.

Closes #

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Documentation
  • Tests
  • CI / tooling
  • Chore

PolyStella invariants touched

  • None
  • Cache key formula
  • Translation batching / segment grouping
  • Apply-before-PUT cache write order
  • Local cache index isolation
  • Runtime bridge timing
  • URL-rewrite idempotence
  • Provider permanent vs retriable errors
  • R2 key / local path separator handling

Checklist

  • I have read CONTRIBUTING.md
  • I have added or updated tests, or this change does not need tests
  • I have added a changeset, or this change does not affect the published package
  • I have updated docs, or this change does not affect public behavior
  • pnpm test passes, or I have explained why it was not run
  • pnpm typecheck passes, or I have explained why it was not run
  • Docs checks/builds pass if docs or public APIs changed

AI-generated code disclosure

  • This PR includes AI-generated code - model/tool: OpenCode (GPT-5.6 Sol)

Screenshots / logs / test output

  • pnpm test: 1,344 tests passed.
  • Focused EmDash package suite: 31 tests passed.
  • pnpm typecheck: all six public packages built and passed strict typechecking.
  • pnpm check:packages: all six packages and public exports passed clean-consumer checks.
  • pnpm check:baseline: passed.
  • pnpm format:check: passed.
  • pnpm audit:prod: passed.
  • git diff --check: passed.
  • Reviewer guide: Prettier passed and 62 local links and line ranges were validated.
  • Independent implementation and documentation reviews found no remaining actionable issues.
  • Manual EmDash staging deployment and documentation-site build were not run.

…nt versioning group

Add `@cloudflare/polystella-emdash` package for native EmDash integration with deployment policy validation, plugin declarations, settings, override storage, and deterministic catalog reconciliation helpers. Update all documentation, workflows, and examples to reference six packages instead of five. Add EmDash to independent versioning group alongside core, adapters, and providers. Update CI to verify EmDash build artifacts. Update PR
…in UI, and route handlers

Add content-editor panel for translating saved entry fields, catalog page for managing temporary UI-string overrides with runtime toggle and deterministic JSON export, and settings page for enabling deployment-allowlisted collections. Add private routes for content translation, catalog CRUD, override export, and settings persistence. Add Workers AI binding translator dependency. Export admin UI from `@cloudflare/polystella-emdash/admin` subpath.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 4, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

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

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
polystella-docs 371215f Commit Preview URL

Branch Preview URL
Sep 04 2026, 03:03 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 4, 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: Failed ❌

View logs ↗
371215f 2026-09-04T15:02:56.877Z View logs ↗
  • Build: Failed ❌

View logs ↗
dc17cc8 2026-09-04T13:44:36.418Z View logs ↗
  • Build: Failed ❌

View logs ↗
c7abe13 2026-09-04T10:16:31.950Z View logs ↗

@github-actions github-actions Bot added review/needs-review No maintainer review yet area/docs Documentation area/github GitHub workflows and repo management labels Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Scope check

This PR changes 6,451 lines across 38 files. PolyStella is maintained by a small team, so smaller focused PRs are more likely to be reviewed.

If this scope is intentional, no action is required.

@github-actions github-actions Bot added the size/XL 500+ changed lines label Sep 4, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

@cloudflare/polystella-adapters

npm i https://pkg.pr.new/cloudflare/polystella/@cloudflare/polystella-adapters@371215f

@cloudflare/polystella-astro

npm i https://pkg.pr.new/cloudflare/polystella/@cloudflare/polystella-astro@371215f

@cloudflare/polystella-cli

npm i https://pkg.pr.new/cloudflare/polystella/@cloudflare/polystella-cli@371215f

@cloudflare/polystella-core

npm i https://pkg.pr.new/cloudflare/polystella/@cloudflare/polystella-core@371215f

@cloudflare/polystella-emdash

npm i https://pkg.pr.new/cloudflare/polystella/@cloudflare/polystella-emdash@371215f

@cloudflare/polystella

npm i https://pkg.pr.new/cloudflare/polystella/@cloudflare/polystella@371215f

@cloudflare/polystella-providers

npm i https://pkg.pr.new/cloudflare/polystella/@cloudflare/polystella-providers@371215f

commit: 371215f

…LI host, and update all references

Extract `check-ui`, `sync-ui`, and `translate-ui` command handlers from `packages/astro/src/cli/` and `packages/astro/src/i18n/` into new `@cloudflare/polystella-cli` package. Add `packages/cli/src/run-command.ts` dispatcher, config loader, glossary loader, drift detection, sync logic, and translate-ui orchestration. Add `packages/emdash/dist/cli.js` executable hosting the same commands. Update
@github-actions github-actions Bot added area/cli CLI area/i18n UI strings and locale catalogs area/translation Translation pipeline and providers labels Sep 4, 2026
…th EmDash overrides

Add `polystellaEmdashAstro()` integration that registers virtual module `polystella:catalog`, middleware for `Astro.locals.t` and `Astro.locals.lhref`, and 60-second cached overlay of enabled EmDash overrides on bundled dictionaries. Export `@cloudflare/polystella-emdash/astro` and `@cloudflare/polystella-emdash/client` ambient types. Add `packages/emdash/src/astro.ts` integration factory, `packages/emdash/src/runtime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli CLI area/docs Documentation area/github GitHub workflows and repo management area/i18n UI strings and locale catalogs area/translation Translation pipeline and providers review/needs-review No maintainer review yet size/XL 500+ changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant