Skip to content

BE-3: Migrate Sanity Studio v2 to v3#20

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1776272353-migrate-sanity-studio-v3
Open

BE-3: Migrate Sanity Studio v2 to v3#20
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1776272353-migrate-sanity-studio-v3

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Apr 15, 2026

Summary

Migrates the sanity_ecommerce/ subdirectory from Sanity Studio v2 to v3.

Removed v2 packages: @sanity/base, @sanity/core, @sanity/default-layout, @sanity/default-login, @sanity/desk-tool, prop-types

Added/upgraded:

  • sanity v3 (monolithic package replacing the individual v2 packages)
  • @sanity/vision ^3.0.0
  • react / react-dom ^18.0.0 (required by Sanity v3)
  • styled-components ^6.0.0

New config files:

  • sanity.config.jsdefineConfig with structureTool() + visionTool() plugins; schemas registered directly
  • sanity.cli.jsdefineCliConfig with projectId/dataset

Deleted:

  • sanity.json (v2 config, replaced by new config files)
  • schemas/schema.js (v2 part:@sanity/base/schema-creator import system, no longer needed)
  • yarn.lock (consolidated to package-lock.json only)

Schema files (product.js, banner.js) are unchanged — plain object exports work in v3.

npx sanity build and root npm run build (Next.js) both pass.

Review & Testing Checklist for Human

  • Verify projectId and dataset in sanity.config.js and sanity.cli.js match your Sanity project (vfxfwnaw / production) — these were carried over from the deleted sanity.json
  • Run npx sanity dev inside sanity_ecommerce/ and confirm the studio loads, schemas appear, and existing content is accessible
  • Check styled-components v5→v6 bump — this was not explicitly requested but was pulled in; verify no custom styled-components usage in the studio is broken
  • Note: npm install --legacy-peer-deps was required to resolve peer dependency conflicts during install. Future contributors will need to use the same flag or the conflicts will need to be resolved

Notes

  • The schema files were kept as plain object exports rather than wrapping with defineType/defineField. This works in v3 but could be enhanced later for better type support.
  • The root Next.js app remains on React 17 with its own dependencies — the React 18 upgrade is scoped to sanity_ecommerce/ only.

Link to Devin session: https://app.devin.ai/sessions/f2ada0041c514172ae230332e42e2b37
Requested by: @Colhodm


Open with Devin

- Remove v2 packages: @sanity/base, @sanity/core, @sanity/default-layout, @sanity/default-login, @sanity/desk-tool
- Add sanity v3 monolithic package and update @sanity/vision to v3
- Update React to v18 (required by Sanity v3)
- Create sanity.config.js with defineConfig, structureTool, and visionTool
- Create sanity.cli.js with defineCliConfig
- Remove legacy schemas/schema.js (part:@sanity/base/schema-creator import system)
- Remove sanity.json (v2 config file replaced by sanity.config.js and sanity.cli.js)
- Schemas (product.js, banner.js) registered directly in sanity.config.js

Co-Authored-By: Arjun Mishra <arjunsaxmishra@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant