Skip to content

Migrate @sanity/personalization-plugin into the monorepo#971

Draft
stipsan wants to merge 194 commits into
mainfrom
cursor/migrate-personalization-plugin-ba8d
Draft

Migrate @sanity/personalization-plugin into the monorepo#971
stipsan wants to merge 194 commits into
mainfrom
cursor/migrate-personalization-plugin-ba8d

Conversation

@stipsan

@stipsan stipsan commented Jun 12, 2026

Copy link
Copy Markdown
Member

Migrate @sanity/personalization-plugin

Transfers @sanity/personalization-plugin into the monorepo using the copy plugin generator (git subtree with full history preserved).

Demo

Field-level experiment flow verified in the test studio (kitchen-sink workspace): default value, beaker "Add experiment" action, experiment selection, and variant value entry.

personalization_plugin_experiment_demo.mp4

Configured experiment with two variants

What's included

  • Plugin workspace at plugins/@sanity/personalization-plugin with monorepo config (package.json, package.config.ts, tsconfig.json, tsconfig.build.json, vitest.config.ts)
  • All three entry points preserved: ., ./launchDarkly, and ./growthbook (ESM-only)
  • @sanity/studio-secrets dependency now resolved via workspace:* (it lives in this monorepo)
  • Source adapted to monorepo lint rules (type-only imports, @sanity/ui spacegap, deprecated FormEventChangeEvent, no accumulating spreads, index-signature access); targeted .oxlintrc.json override added for remaining legacy patterns (unsafe type assertions, pagination awaits-in-loop, set-state-in-effect) following the sanity-naive-html-serializer precedent
  • README assets (overview.gif, beaker.svg, screenshots) and the growthbook.md / launchdarkly.md docs restored from the original repo
  • Test-studio example (dev/test-studio/src/personalization) wired into the kitchen-sink workspace with a personalizationTest document using experimentString / experimentText fields
  • Package exports test with snapshot covering all three entry points
  • Major changeset + root README plugins table entry

Transfer verification

  • Trusted publishing configured: npm trust github @sanity/personalization-plugin --file=release.yml --repository=sanity-io/plugins
  • package.json dependencies/peerDependencies/exports verified against original repo
  • Test studio example wired and manually verified (pnpm dev)
  • pnpm format, pnpm knip, pnpm lint, pnpm build, pnpm test run all pass
  • Major changeset added with validated breaking changes

Maintainer follow-up

Agents cannot complete these steps themselves. Ask the maintainer to handle them:

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

jjburbridge and others added 30 commits November 13, 2024 10:57
chore: updated release workflow
jjburbridge and others added 22 commits August 14, 2025 14:52
fix(deps): make peer dependencies include sanity 5.x
feat: add launch darkly as a integration
Rewrite and expand README documentation
…5b54d50691318f458d14ebed2a39ea'

git-subtree-dir: plugins/@sanity/personalization-plugin
git-subtree-mainline: 064dc6b
git-subtree-split: 9301f25
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
plugins-studio Ready Ready Preview, Comment Jun 12, 2026 2:53pm

Request Review

@changeset-bot

changeset-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0c663d0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sanity/personalization-plugin Major

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

@socket-security

socket-security Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​react-icons@​5.6.0881001008580
Addednpm/​@​sanity/​assist@​6.1.19810010097100

View full report

@socket-security

socket-security Bot commented Jun 12, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm react-icons is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: plugins/@sanity/personalization-plugin/package.jsonnpm/react-icons@5.6.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/react-icons@5.6.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

…alization-plugin-ba8d

# Conflicts:
#	pnpm-lock.yaml
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.

8 participants