fix(cli): specify 2.x version ranges for dependencies #3993
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.
Description
When bootstrapping new studios using the Sanity v2 CLI, you currently get the following error:
This is caused by the CLI installing the v3 version of
@sanity/vision
, because we specify that we wantlatest
. 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 solatest
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
To test:
yarn
)yarn build
)~/path/to/monorepo/packages/@sanity/cli/bin/sanity init
)sanity start
Note: CI fails because of this exact issue, ironically.
Notes for release
@sanity/vision
version being installed