-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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(gatsby-dev-cli): resolve correct versions of packages with unpkg #33551
Conversation
`https://unpkg.com/${packageName}/package.json` | ||
) | ||
const version = getPackageVersion(packageName) | ||
const url = `https://unpkg.com/${packageName}@${version}/package.json` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
monorepoPKGjson.version = `${monorepoPKGjson.version}-dev-${versionPostFix}` |
gatsby-dev
might set to some version available only locally, so this unpkg
would likely fail for those and fallback to using verdaccio which is fine I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This codepath is only active a) for the initial scan b) when there are no local dependencies (so no node_modules
). If you have deps already installed with verdaccio, we won't even try to check unpkg
.
So I think it should be fine
…33551) * fix(gatsby-dev-cli): resolve correct versions of packages with unpkg * a bit more details in case of errors * defaults for deps
…atsbyjs#33551) * fix(gatsby-dev-cli): resolve correct versions of packages with unpkg * a bit more details in case of errors * defaults for deps
…33551) * fix(gatsby-dev-cli): resolve correct versions of packages with unpkg * a bit more details in case of errors * defaults for deps
Description
This PR fixes an issue with the incorrect detection of changed dependencies in the case when local dependencies are not installed.
Say we have this in project package.json and dependencies are not installed (so no
node_modules
folder):In this case
gatsby-dev-cli
attempts to load package details fromunpkg
to compare against dependencies in the monorepo:gatsby/packages/gatsby-dev-cli/src/utils/check-deps-changes.js
Lines 56 to 65 in 357230d
The problem is that
packageName
here will begatsby
and notgatsby@next
. So it will always diff with dependencies of thelatest
version, regardless of the actual local version.