Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): specify 2.x version ranges for dependencies #3993

Merged
merged 1 commit into from Dec 21, 2022

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented Dec 19, 2022

Description

When bootstrapping new studios using the Sanity v2 CLI, you currently get the following error:

Error: No "sanity.json" file found in plugin "@sanity/vision"

This is caused by the CLI installing the v3 version of @sanity/vision, because we specify that we want latest. Theoretically all the other dependencies have the same issue - the only reason they work is because we no longer use these modules in v3, and so latest still points to the v2 version.

This PR changes to use version ranges (^2.0.0) for everything (and drops resolving the latest version, since it is irrelevant), which should ensure that even if we do release new versions of these packages, it won't break anything in v2 studios.

[sc-28222]

What to review

  • You are able to bootstrap new v2 studios with v2 dependencies

To test:

  • Check out the branch
  • Use node 14
  • Install dependencies (yarn)
  • Build the monorepo (yarn build)
  • Initialize a new project (~/path/to/monorepo/packages/@sanity/cli/bin/sanity init)
  • Check that it installs dependencies and you can run sanity start

Note: CI fails because of this exact issue, ironically.

Notes for release

  • Fixed issue where new v2 studios failed to be created because of the incorrect @sanity/vision version being installed

@vercel
Copy link

vercel bot commented Dec 19, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
studio-workshop ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Dec 19, 2022 at 7:00PM (UTC)
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Dec 19, 2022 at 7:00PM (UTC)

@bjoerge bjoerge merged commit a7e00a0 into 2.x-next Dec 21, 2022
@bjoerge bjoerge deleted the fix/v2-dependency-ranges branch December 21, 2022 15:09
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.

None yet

2 participants