Skip to content

Commit

Permalink
[cli] Add array of packages excluded from update
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedicte Emilie Brækken authored and benedicteb committed Jan 28, 2021
1 parent adcaa8e commit 686fb62
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ import dynamicRequire from '../../util/dynamicRequire'
import getLocalVersion from '../../util/getLocalVersion'
import pkg from '../../../package.json'

/*
* Some packages can introduce errors when updating. For example with Sanity UI
* we are at the moment dependant upon the version of @sanity/ui that
* @sanity/base imports to be the only version used since all imports of UI
* need to use the same context.
*
* Put them in this array to make sure the upgrade script doesn't upgrade
* them.
*/
const PACKAGES_TO_EXCLUDE = ['@sanity/ui']

const defaultOptions = {
includeCli: true,
}
Expand Down Expand Up @@ -51,6 +62,7 @@ function filterSanityModules(manifest) {

const sanityDeps = Object.keys(dependencies)
.filter((mod) => mod.indexOf('@sanity/') === 0)
.filter((mod) => !PACKAGES_TO_EXCLUDE.includes(mod))
.sort()

return sanityDeps.reduce((versions, dependency) => {
Expand Down

1 comment on commit 686fb62

@vercel
Copy link

@vercel vercel bot commented on 686fb62 Jan 28, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.