Skip to content

feat(visual-editing): move visual editing plugin into the public repo - #156

Merged
ChiefCreator merged 4 commits into
mainfrom
claude/lucid-sagan-b6n14o
Oct 5, 2026
Merged

ChiefCreator merged 4 commits into
mainfrom
claude/lucid-sagan-b6n14o

Conversation

@dogfrogfog

@dogfrogfog dogfrogfog commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Moves the visual editing plugin from payload-plugins-private into this repo as @focus-reactive/payload-plugin-visual-editing (public npm access), following the payload-plugins-add-package skill. It also switches the apps and scaffolder in this repo, which already used the private @fr-private build, over to the workspace package.

New package: packages/payload-plugin-visual-editing

  • Copied from the private repo (source, 20 test files, README, CLAUDE.md). Renamed the scope @fr-private → @focus-reactive, including the admin import-map path in src/index.ts.
  • package.json follows the skill: version: 1.0.0, private: false, publishConfig.access: "public", repository.url: https://github.com/focusreactive/payload-plugins (no .git). Also adds author, keywords, bugs and homepage like the other packages. Dev deps are on Payload 3.90.1 / Next 16.3.6, matching main.
  • Tooling now matches the repo. ESLint and Prettier are replaced by Ultracite, and a check-types script (tsgo --noEmit) is added. The oxlint errors are fixed:
    • for…in on plain objects becomes Object.keys.
    • An unused recursive parameter is removed.
    • The empty-function defaults become noop.
    • Test import order and parameter names are fixed.
  • getElementById calls are kept, with lint-disable comments. Ultracite's auto-fix turns them into querySelector(`#${id}`), which breaks on ids that aren't valid CSS selectors (and caused a type error).
  • The private CHANGELOG is dropped because its links point to the private repo. semantic-release will start a new one.
  • The package CLAUDE.md no longer mentions a client project and describes public publishing.

Consumers

  • apps/cms and apps/multi-tenancy-demo now use @focus-reactive/payload-plugin-visual-editing via workspace:*. The imports and importMap.js are updated to match, and the multi-tenancy README no longer asks for NPM_TOKEN.
  • create-ideal-cms:
    • Removes the private-registry-token prompt, the stripPrivatePlugins transform and the .npmrc writer.
    • Pins visual editing to 1.0.0 in PLUGIN_VERSIONS and adds it to PRUNE_PATHS.
    • Always lists Visual Editing in the generated README.
  • The root .npmrc no longer has the @fr-private registry and token lines.
  • The root README and CLAUDE.md now list the plugin.

Verification

  • bun run test in the package: 20 files, 203 tests pass.
  • turbo run build --filter='./packages/*': 11/11 pass. After that, turbo run check-types: 7/7 pass.
    • Not checked: content-agent-demo, because its private payload-content-agent git dependency can't be installed in the environment I ran this in. This PR doesn't touch it.
  • bunx ultracite check on the whole repo: 0 errors.

After merging: release runbook

Merge with a merge commit (the repo's usual "Merge pull request" style), not a squash.

Expected: the Release run on the merge fails

The package has no git tag yet, so semantic-release will try to publish it as 1.0.0 on its own. That fails because the package doesn't exist on npm and has no Trusted Publisher. Nothing gets published for visual-editing, and that's fine. Check whether that run published create-ideal-cms. If it did, it pins @focus-reactive/payload-plugin-visual-editing@1.0.0, which only exists after step 2, so do step 2 right away.

A. Publish under the new name @focus-reactive/payload-plugin-visual-editing

  1. Log in to npm with an account that can publish to the @focus-reactive scope: npm whoami.
  2. Build and publish 1.0.0 by hand from the merged main:
    git checkout main && git pull
    bun install
    cd packages/payload-plugin-visual-editing
    bun run build && ls dist            # dist/ must exist
    npm publish --access public
  3. On npmjs.com, open the package → Settings → Publishing → Trusted Publishers. Add GitHub Actions with repo focusreactive/payload-plugins and workflow release.yml.
  4. Anchor semantic-release with a tag on the full SHA of the merge commit:
    git log --oneline -5                 # find "Merge pull request #156 …"
    git rev-parse <merge-short-sha>
    gh release create "@focus-reactive/payload-plugin-visual-editing@1.0.0" \
      --target <full-merge-sha> \
      --title "payload-plugin-visual-editing v1.0.0" \
      --notes "Initial public release (moved from @fr-private/payload-plugin-visual-editing)" \
      --repo focusreactive/payload-plugins
  5. Trigger the first automated release. Push a docs: commit that touches the package. Don't use chore:, and don't re-run the failed job, because that reports "0 packages released".
    # e.g. add a "Moved from @fr-private/payload-plugin-visual-editing" note to packages/payload-plugin-visual-editing/README.md
    git commit -am "docs(visual-editing): note the move from @fr-private"
    git push
  6. Check the result:
    • The Release workflow is green and publishes visual-editing 1.0.1, plus a create-ideal-cms minor if the merge run didn't already publish it.
    • npm view @focus-reactive/payload-plugin-visual-editing versions lists ["1.0.0", "1.0.1"].
    • npx create-ideal-cms installs cleanly with no registry token.

B. Deprecate the old @fr-private/payload-plugin-visual-editing

  1. Deprecate it rather than unpublishing, so existing installs keep working:
    npm deprecate "@fr-private/payload-plugin-visual-editing@*" \
      "Moved to @focus-reactive/payload-plugin-visual-editing (public). Swap the dependency and imports, then regenerate the Payload import map."
  2. Migrate each consumer:
    • Swap the dependency to @focus-reactive/payload-plugin-visual-editing@^1.0.1.
    • Replace the imports from ., /client and /admin.
    • Run payload generate:importmap. The plugin registers @focus-reactive/payload-plugin-visual-editing/admin#VisualEditingBridgeProvider, so a stale import map breaks the admin.
    • Remove the @fr-private lines from .npmrc and NPM_TOKEN from CI if nothing else needs them.
  3. In focusreactive/payload-plugins-private, delete packages/payload-plugin-visual-editing and point apps/dev at the public package, using a chore: commit so no release fires. Update that repo's CLAUDE.md structure list.
  4. Optional, once nothing depends on it: drop the @fr-private publish token and any Actions secrets used only for this package.

🤖 Generated with Claude Code

https://claude.ai/code/session_016Ux3fP9C1PgQ5zg1tQak1M

Move the visual editing plugin from the private monorepo into the public
one as @focus-reactive/payload-plugin-visual-editing (public npm access).

- rename scope from @fr-private to @focus-reactive, point repository at
  focusreactive/payload-plugins
- switch lint/format from ESLint + Prettier to Ultracite, add a tsgo
  check-types script, and fix the resulting oxlint errors
- drop the private CHANGELOG; semantic-release starts a fresh one
- list the plugin in the root README and CLAUDE.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016Ux3fP9C1PgQ5zg1tQak1M
Now that visual editing lives in this repo, consume it from the workspace
instead of the private @fr-private npm scope.

- apps/cms and apps/multi-tenancy-demo depend on
  @focus-reactive/payload-plugin-visual-editing via workspace:*
- create-ideal-cms drops the private-registry token prompt, the
  strip-private-plugins transform and the .npmrc writer; visual editing
  is pinned like the other plugins and always listed in the README
- remove the @fr-private registry lines from the root .npmrc

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016Ux3fP9C1PgQ5zg1tQak1M
@vercel

vercel Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ideal-cms Ready Ready Preview Oct 5, 2026 9:52am UTC

Request Review

…n14o

# Conflicts:
#	apps/cms/package.json
#	apps/multi-tenancy-demo/package.json
#	bun.lock
@ChiefCreator
ChiefCreator merged commit 3a2e2c2 into main Oct 5, 2026
2 checks passed
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.3.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 0.15.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.2.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.10.1 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.11.2 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

This branch was successfully deployed

1 active deployment
Preview — 08260b2a Deployed Oct 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants