Skip to content

Commit

Permalink
Update location of strictPeerDependencies config setting
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeharder committed Feb 7, 2023
1 parent 0f67e5f commit 0b473d3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions eng/scripts/check-external-dependency.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ $deprecatedDependency = "Deprecated-Dependency"
$dependencyRegex = "^\+\s(?<pkg>[\S]*)\s(?<version>[\S]*)\s\((?<newVersion>[0-9\.a-b]*).*\)\s?(?<deprecated>deprecated)?"
$RepoRoot = Resolve-Path -Path "${PSScriptRoot}/../.."
Write-Host "Repo root: $RepoRoot"
$rushFile = join-Path -Path $RepoRoot "rush.json"
Write-Host "Path to rush.json: $rushFile"
$pnpmConfigFile = Join-path -Path $RepoRoot "common" "config" "rush" "pnpm-config.json"
Write-Host "Path to pnpm-config.json: $pnpmConfigFile"
$commonConfigFile = Join-path -Path $RepoRoot "common" "config" "rush" "common-versions.json"
Write-Host "Path to common-versions.json: $commonConfigFile"

Expand Down Expand Up @@ -81,17 +81,17 @@ function Set-GitHubIssue($Package) {


# Update rush configuration files to alter settings
if ((Test-Path $rushFile) -and (Test-Path $commonConfigFile)) {
$rushJson = Get-Content -Path $rushFile | ConvertFrom-Json
$rushJson.pnpmOptions.strictPeerDependencies = $false
Set-Content -Path $rushFile -Value (ConvertTo-Json -InputObject $rushJson)
if ((Test-Path $pnpmConfigFile) -and (Test-Path $commonConfigFile)) {
$pnpmConfigJson = Get-Content -Path $pnpmConfigFile | ConvertFrom-Json
$pnpmConfigJson.strictPeerDependencies = $false
Set-Content -Path $pnpmConfigFile -Value (ConvertTo-Json -InputObject $pnpmConfigJson)

$configJson = Get-Content -Path $commonConfigFile | ConvertFrom-Json
$configJson.implicitlyPreferredVersions = $true
Set-Content -Path $commonConfigFile -Value (ConvertTo-Json -InputObject $configJson)
}
else {
Write-Error "Failed to find $($rushFile) and/or $($commonConfigFile). Verify repo root parameter."
Write-Error "Failed to find $($pnpmConfigFile) and/or $($commonConfigFile). Verify repo root parameter."
exit 1
}

Expand Down

0 comments on commit 0b473d3

Please sign in to comment.