Added plan for merging Koenig packages into the monorepo - #29156
Added plan for merging Koenig packages into the monorepo#29156kevinansfield wants to merge 3 commits into
Conversation
- documents the proposed migration of all 13 Koenig packages into koenig/* with full git history (git filter-repo + merge commit) - production and local dev stop depending on npm-published Koenig packages: workspace links for dev/CI, component tarballs in the Ghost archive for releases - npm publishing continues for external consumers only, automated as part of the Ghost release (tag) lane rather than per main-merge - published for team review before any migration work starts
|
Bugbot is not enabled for this team, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run-many -t lint -p ghost-monorepo |
✅ Succeeded | <1s | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-07-08 08:42:13 UTC
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis pull request adds 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f625831214
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| | File | Packages | | ||
| |------|----------| | ||
| | `ghost/core/package.json` | kg-card-factory, kg-clean-basic-html, kg-converters, kg-default-cards, kg-default-nodes, kg-html-to-lexical, kg-lexical-html-renderer, kg-markdown-html-renderer | |
There was a problem hiding this comment.
Pack transitive Koenig packages in the archive
Following this ghost/core dependency list leaves packages such as kg-utils and kg-default-transforms only as transitive Koenig dependencies, but ghost/core/scripts/pack.js only repacks file: refs found in the deployed root pkg.dependencies. Those transitive workspace:~ deps will be rewritten by pnpm pack to semver ranges and fetched from npm during ghost install --archive, so the plan does not satisfy the stated zero-registry/zero-skew production requirement unless every Koenig package needed at runtime is made a root dependency or the pack step is made recursive.
Useful? React with 👍 / 👎.
| **Root `package.json`:** keep `dev:lexical` as-is (it already points at the | ||
| built editor assets); optionally add `dev:koenig` → | ||
| `pnpm nx run @tryghost/koenig-lexical:dev` for standalone editor dev with | ||
| EDITOR_URL pointing at the Vite dev server. Check the docker-compose dev | ||
| setup (`ghost-monorepo:docker:dev`) mounts `koenig/` like it does `apps/`. |
There was a problem hiding this comment.
Copy Koenig manifests into the dev image
After Step 4 changes ghost/core to use workspace:* Koenig dependencies, the dev Docker build needs the Koenig package manifests before pnpm install: I checked docker/ghost-dev/Dockerfile, and it currently copies only the root plus ghost/core, ghost/i18n, and ghost/parse-email-address package.json files, while compose.dev.yaml mounts only those Ghost subtrees at runtime. Only checking the compose mount here misses the Dockerfile update, so a fresh pnpm dev image will fail to resolve the new workspace dependencies instead of satisfying the local-dev requirement.
Useful? React with 👍 / 👎.
| - **Path filters:** confirm the `shared`/`e2e`/`any-code` path filters in | ||
| `job_setup` treat `koenig/**` as code (Nx-affected does the per-project | ||
| work, but the workflow-level filters gate whole lanes like run_e2e). |
There was a problem hiding this comment.
Gate core server tests on Koenig changes
The path-filter checklist should include the core filter as well: in .github/workflows/ci.yml, job_acceptance-tests and job_legacy-tests run only when changed_core == true, and that filter currently matches ghost/** rather than future koenig/** paths. Since ghost/core will directly depend on the Koenig renderers/converters, a server-affecting change under koenig/ could skip Ghost integration/e2e/legacy suites unless the plan updates that gate or moves it to Nx affected.
Useful? React with 👍 / 👎.
| - **Changed-only detection via git, not Nx-affected:** checkout with | ||
| `fetch-depth: 0`, find the previous release tag with | ||
| `git describe --tags --abbrev=0 --match 'v*' ${GITHUB_REF_NAME}^`, and for | ||
| each koenig package publish only if | ||
| `git diff --quiet $PREV $GITHUB_REF_NAME -- koenig/<pkg>/` reports changes. |
There was a problem hiding this comment.
Publish Koenig packages for shared dependency changes
Selecting npm publishes only with git diff ... -- koenig/<pkg>/ misses changes outside the package directory that still alter what gets published, especially the catalog-normalized dependencies the plan introduces in pnpm-workspace.yaml. For example, a Lexical or React catalog bump would change the dependency version that pnpm publish writes into Koenig package manifests, but no package would be selected, leaving external npm consumers on the old dependency line while Ghost's workspace build uses the new one.
Useful? React with 👍 / 👎.
- Playwright CI matrix selection uses an nx 'playwright' tag instead of directory globs, per review - MS core fonts install dropped: the visual-regression assertions it supported no longer exist in koenig-lexical's suite
|
Bugbot is not enabled for this team, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
The first full CI run showed caret-position assertions depend on Arial font metrics (not just the removed screenshot assertions), and firefox video card tests need system codecs via playwright install-deps.

Summary
This PR adds a plan document (docs/koenig-monorepo-merge-plan.md) proposing the migration of all 13 Koenig packages from
TryGhost/Koeniginto this repo underkoenig/*, with full git history preserved. No migration work happens in this PR — it's the plan itself, published for review.It supersedes an unmerged July 2025 attempt, which predated the Yarn→pnpm switch, the Nx-affected CI restructure, and the
pnpm deploy-based release packaging. Everything in the doc was re-verified against both repos as of 2026-07-07.Key points for reviewers
Git migration
git filter-repo --path packages/ --path-rename packages/:koenig/— only package history is imported, so there are no root-file conflicts to resolve. Commit-message issue refs get rewritten toTryGhost/Koenig#N, and the ~2k lerna tags are stripped.Dependency model
ghost/core,ghost/admin,apps/admin,apps/posts,apps/admin-x-settings,apps/admin-x-framework) switch toworkspace:*; Koenig inter-package deps useworkspace:~so published artifacts tolerate the auto-computed patch digit.pnpm deploy --config.inject-workspace-packages=trueinghost/core/scripts/pack.jsships them as component tarballs inside the Ghost archive, same as@tryghost/i18ntoday — version skew between Ghost and the editor becomes structurally impossible.CI
test:unit,test:acceptance) and flow through the Nx-affected machinery; koenig-lexical's Playwright suite joinsjob_apps_acceptance-tests(needs the MS core fonts install added there).Publishing
yarn shipto an automatedpublish_koenig_packagesjob in the release (tag) lane, gated onpublish_ghostsucceeding. Only packages changed since the previous release tag are published, with the patch number computed from npm (same model as public apps). Aworkflow_dispatchescape hatch covers urgent out-of-band publishes.Main risk called out
catalogMode: strictnormalization are the least predictable part; the first fullpnpm install+ build + test run is the real smoke test.Full details, current dependency graph, step-by-step process, and a verification checklist are in the doc.