Skip to content

Merge Koenig monorepo into Ghost#26554

Draft
kevinansfield wants to merge 5267 commits intomainfrom
merge-koenig-repo
Draft

Merge Koenig monorepo into Ghost#26554
kevinansfield wants to merge 5267 commits intomainfrom
merge-koenig-repo

Conversation

@kevinansfield
Copy link
Member

Summary

Consolidates the TryGhost/Koenig editor monorepo into Ghost under a top-level koenig/ directory. All 17 packages are moved with full git history preservedgit log, git blame, and git bisect work correctly for all Koenig files at their new paths.

What's included

  • Git history merge — Koenig history rewritten with git filter-repo so paths match their final koenig/* locations, then merged with --allow-unrelated-histories. All 5,260 Koenig commits are ancestors of this branch.
  • Workspace integrationkoenig/* added to root package.json workspaces. All @tryghost/kg-* and @tryghost/koenig-lexical deps converted from pinned npm versions to "*" for workspace resolution (14 package.json files updated).
  • CI — New job_koenig_tests in ci.yml with font installation, Playwright caching, and Nx test execution. Added to job_required_tests gate. Path filter for koenig/** changes.
  • Publishing — New publish-koenig.yml workflow + publish-koenig.js script (checks npm registry, builds via Nx, publishes new versions). Replaces Lerna-based flow. Interactive ship-koenig.js for version bumping.
  • Demokoenig-demo.yml deploys koenig-lexical demo to GitHub Pages (replaces Koenig repo's pages.yml).

Packages moved (17)

html-to-mobiledoc, kg-card-factory, kg-clean-basic-html, kg-converters, kg-default-atoms, kg-default-cards, kg-default-nodes, kg-default-transforms, kg-html-to-lexical, kg-lexical-html-renderer, kg-markdown-html-renderer, kg-mobiledoc-html-renderer, kg-parser-plugins, kg-simplemde, kg-unsplash-selector, kg-utils, koenig-lexical

Follow-up items

  • Update GitHub Pages CNAME/DNS for koenig-lexical demo
  • Configure npm OIDC/provenance secrets for publish-koenig.yml
  • Archive TryGhost/Koenig repo with redirect notice
  • Update Renovate config to stop tracking Koenig packages as external deps
  • Run yarn install and verify workspace symlinks resolve correctly
  • Verify yarn nx run-many -t build and yarn nx run-many -t test pass

Test plan

  • git log -- koenig/koenig-lexical/package.json shows full Koenig history (1,100+ commits)
  • git blame koenig/kg-utils/package.json shows original authors/dates
  • yarn install resolves all Koenig packages from workspace (not npm)
  • yarn nx run-many -t build succeeds for all packages
  • yarn nx run-many -t test --projects='@tryghost/kg-*,@tryghost/koenig-*' passes
  • CI job_koenig_tests runs and passes
  • node .github/scripts/publish-koenig.js --dry-run reports all packages as already published

🤖 Generated with Claude Code

renovate bot and others added 30 commits June 18, 2025 09:56
no issue

- card was related to an abandoned alpha feature in Ghost that Koenig no longer needs to support
 - @tryghost/html-to-mobiledoc@3.2.7
 - @tryghost/kg-clean-basic-html@4.2.6
 - @tryghost/kg-converters@1.1.6
 - @tryghost/kg-default-cards@10.1.4
 - @tryghost/kg-default-nodes@1.5.0
 - @tryghost/kg-default-transforms@1.2.22
 - @tryghost/kg-html-to-lexical@1.2.22
 - @tryghost/kg-lexical-html-renderer@1.3.22
 - @tryghost/kg-parser-plugins@4.2.6
 - @tryghost/kg-unsplash-selector@0.3.5
 - @tryghost/koenig-lexical@1.7.0
no issue

- node renderers are now expected to be passed in as options when renderering
- this removes a lot of unused code in our editor build and moves card render output into the consumer which makes more sense and removes a need to constantly bump all of the the editor packages as desired render output changes
- node renderers for Ghost now live at https://github.com/TryGhost/Ghost/tree/main/ghost/core/core/server/services/koenig/node-renderers
- updated `kg-lexical-html-renderer` card rendering tests to account for cards no longer having default render functions
 - @tryghost/html-to-mobiledoc@3.2.8
 - @tryghost/kg-card-factory@5.1.2
 - @tryghost/kg-clean-basic-html@4.2.7
 - @tryghost/kg-converters@1.1.7
 - @tryghost/kg-default-atoms@5.1.1
 - @tryghost/kg-default-cards@10.1.5
 - @tryghost/kg-default-nodes@2.0.0
 - @tryghost/kg-default-transforms@1.2.23
 - @tryghost/kg-html-to-lexical@1.2.23
 - @tryghost/kg-lexical-html-renderer@1.3.23
 - @tryghost/kg-markdown-html-renderer@7.1.3
 - @tryghost/kg-mobiledoc-html-renderer@7.1.3
 - @tryghost/kg-parser-plugins@4.2.7
 - @tryghost/kg-utils@1.0.32
 - @tryghost/koenig-lexical@1.7.1
This reverts commit 16faf18.

- Lexical calls `exportDOM` on nodes when performing cut/copy operations in order to place a HTML representation on the clipboard. Without the default node renderers being present this errors which completely breaks copy/paste
- reverting for now to get back to a working version whilst we look into a solution that still allows renderers to exist in the consuming app
no issue

- we've had to revert the full removal of default renderers but we still need Ghost to be able to render using it's own provided custom renderers
- removed `emailCustomization` flag gating of the custom renderer code because Ghost no longer has that flag in place since going GA
 - @tryghost/kg-default-nodes@2.0.1
 - @tryghost/kg-default-transforms@1.2.24
 - @tryghost/kg-html-to-lexical@1.2.24
 - @tryghost/kg-lexical-html-renderer@1.3.24
 - @tryghost/kg-unsplash-selector@0.3.6
 - @tryghost/koenig-lexical@1.7.2
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
9larsons and others added 27 commits February 12, 2026 15:17
no ref

Changes to require-status-checks have conflicted with our yarn ship script. The tags have been pushed and the push to main is not working.
ref 8727aad

Renovate was able to merge a commit with a stale lock file. We use --frozen-lockfile elsewhere for the integrity check and it seems like we should use it here as well.
ref 0973109

The kg-simplemde package is a fork of NextStepWebs/simplemde-markdown-editor. When it was added to this monorepo, the original repository URLs were preserved.

With the recent migration to CI-based publishing (0973109), npm provenance verification is now enabled. This verifies that the repository.url in package.json matches the GitHub repository the package is published from. This would otherwise fail on the provenance check and prevent publishing of kg-simplemde and koenig-lexical.

Updated homepage, bugs, and repository URLs to point to TryGhost/Koenig while preserving the original author attribution.
 - @tryghost/kg-markdown-html-renderer@7.1.11
 - @tryghost/kg-mobiledoc-html-renderer@7.1.11
 - @tryghost/kg-simplemde@3.0.10
 - @tryghost/kg-unsplash-selector@0.3.15
 - @tryghost/kg-utils@1.0.39
 - @tryghost/koenig-lexical@1.7.12
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
ref https://linear.app/ghost/issue/NY-1044/
- expanded list of available nodes and plugin compatibility with a new EMAIL_EDITOR_NODES set
- added plugins to exports for use outside of Koenig in the composable editor
 - @tryghost/kg-unsplash-selector@0.3.16
 - @tryghost/koenig-lexical@1.7.13
Merge all 17 Koenig editor packages into the Ghost monorepo under
the koenig/ top-level directory. History has been rewritten using
git filter-repo so that file paths match their final locations,
preserving full git log/blame history for all Koenig files.

Koenig root-level config files (lerna.json, .github/workflows/,
renovate.json, etc.) are excluded — Ghost's root config takes over.

Packages: html-to-mobiledoc, kg-card-factory, kg-clean-basic-html,
kg-converters, kg-default-atoms, kg-default-cards, kg-default-nodes,
kg-default-transforms, kg-html-to-lexical, kg-lexical-html-renderer,
kg-markdown-html-renderer, kg-mobiledoc-html-renderer, kg-parser-plugins,
kg-simplemde, kg-unsplash-selector, kg-utils, koenig-lexical
- Add koenig/* to workspaces array in root package.json
- Add koenig node_modules to CI dependency cache paths
- Add dev:koenig convenience script
- Add ship:koenig and publish:koenig script stubs
Replace all pinned npm version references to @tryghost/kg-*,
@tryghost/koenig-lexical, and @tryghost/html-to-mobiledoc
with "*" for Yarn workspace resolution.

Updated 4 Ghost consumer packages and 10 Koenig internal
cross-references to resolve from the local workspace instead
of the npm registry.
- publish-koenig.js: Checks npm registry for each koenig package,
  builds and publishes any with new versions. Supports --dry-run.
- ship-koenig.js: Interactive version bumper that detects changed
  packages, prompts for bump type, and creates a release commit.
- publish-koenig.yml: GitHub Actions workflow triggered by version
  bump commits or manual dispatch. Uses OIDC for npm auth.

Replaces Lerna-based publish workflow from the Koenig repo.
- Add koenig path filter group to detect changes in koenig/**
- Add changed_koenig output to job_setup
- Add new-package detection for koenig/**/package.json
- Add job_koenig_tests with font installation, Playwright caching,
  and full test suite execution via Nx
- Include job_koenig_tests in job_required_tests gate
Deploys the koenig-lexical demo to GitHub Pages when koenig/
packages change on main. Replaces the pages.yml workflow from
the standalone Koenig repo.
@github-actions github-actions bot added the migration [pull request] Includes migration for review label Feb 24, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch merge-koenig-repo

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

It looks like this PR contains a migration 👀
Here's the checklist for reviewing migrations:

General requirements

  • ⚠️ Tested performance on staging database servers, as performance on local machines is not comparable to a production environment
  • Satisfies idempotency requirement (both up() and down())
  • Does not reference models
  • Filename is in the correct format (and correctly ordered)
  • Targets the next minor version
  • All code paths have appropriate log messages
  • Uses the correct utils
  • Contains a minimal changeset
  • Does not mix DDL/DML operations
  • Tested in MySQL and SQLite

Schema changes

  • Both schema change and related migration have been implemented
  • For index changes: has been performance tested for large tables
  • For new tables/columns: fields use the appropriate predefined field lengths
  • For new tables/columns: field names follow the appropriate conventions
  • Does not drop a non-alpha table outside of a major version

Data changes

  • Mass updates/inserts are batched appropriately
  • Does not loop over large tables/datasets
  • Defends against missing or invalid data
  • For settings updates: follows the appropriate guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

migration [pull request] Includes migration for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants