BE-3: Migrate Sanity Studio v2 to v3#20
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Conversation
- 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>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-typesAdded/upgraded:
sanityv3 (monolithic package replacing the individual v2 packages)@sanity/vision^3.0.0react/react-dom^18.0.0 (required by Sanity v3)styled-components^6.0.0New config files:
sanity.config.js—defineConfigwithstructureTool()+visionTool()plugins; schemas registered directlysanity.cli.js—defineCliConfigwith projectId/datasetDeleted:
sanity.json(v2 config, replaced by new config files)schemas/schema.js(v2part:@sanity/base/schema-creatorimport system, no longer needed)yarn.lock(consolidated topackage-lock.jsononly)Schema files (
product.js,banner.js) are unchanged — plain object exports work in v3.npx sanity buildand rootnpm run build(Next.js) both pass.Review & Testing Checklist for Human
projectIdanddatasetinsanity.config.jsandsanity.cli.jsmatch your Sanity project (vfxfwnaw/production) — these were carried over from the deletedsanity.jsonnpx sanity devinsidesanity_ecommerce/and confirm the studio loads, schemas appear, and existing content is accessiblestyled-componentsv5→v6 bump — this was not explicitly requested but was pulled in; verify no custom styled-components usage in the studio is brokennpm install --legacy-peer-depswas required to resolve peer dependency conflicts during install. Future contributors will need to use the same flag or the conflicts will need to be resolvedNotes
defineType/defineField. This works in v3 but could be enhanced later for better type support.sanity_ecommerce/only.Link to Devin session: https://app.devin.ai/sessions/f2ada0041c514172ae230332e42e2b37
Requested by: @Colhodm