Skip to content

Commit

Permalink
scripts/check-siblings: Update to work with yarn patch versions. (#771
Browse files Browse the repository at this point in the history
)

`yarn patch` changes the version to something like this:
`patch:@sentry/nextjs@npm%3A8.27.0#~/.yarn/patches/@sentry-nextjs-npm-8.27.0-0e3a1ce4c2.patch`
This means that exact version `8.27.0` was used as base and patched.
  • Loading branch information
Shayan-To authored Nov 5, 2024
1 parent 886e501 commit 94a7430
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/check-siblings.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function ValidateSentryPackageParameters(packages) {
if (installedVersion.split('@').length === 2) {
errorMessages.push("You must specify the version to the package " + installedVersion + ". ( " + installedVersion + "@" + siblingVersion + ")");
}
else if (!installedVersion.endsWith(siblingVersion)) {
else if (!installedVersion.endsWith(siblingVersion) && !installedVersion.includes('%3A' + siblingVersion + '#')) {
errorMessages.push("You tried to install " + installedVersion + ", but the current version of @sentry/capacitor is only compatible with version " + siblingVersion + ". Please install the dependency with the correct version.");
}
}
Expand Down Expand Up @@ -137,7 +137,7 @@ function CheckSiblings() {

for (const lineData of packageJson) {
let sentryRef = lineData.match(jsonFilter);
if (sentryRef && sentryRef[2] !== siblingVersion) {
if (sentryRef && sentryRef[2] !== siblingVersion && !sentryRef[2].includes('%3A' + siblingVersion + '#')) {
incompatiblePackages.push(['@sentry/' + sentryRef[1], sentryRef[2]]);
}
}
Expand Down

0 comments on commit 94a7430

Please sign in to comment.