From 0e18b9122d12dbfa187022838730afd73bd47fd8 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 1 Mar 2023 15:25:23 -0800 Subject: [PATCH 1/3] Use "npm ci" to install cspell and respect package-lock.json --- eng/common/spelling/Invoke-Cspell.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/common/spelling/Invoke-Cspell.ps1 b/eng/common/spelling/Invoke-Cspell.ps1 index 79205ed90643..e2e42802ba81 100644 --- a/eng/common/spelling/Invoke-Cspell.ps1 +++ b/eng/common/spelling/Invoke-Cspell.ps1 @@ -25,7 +25,7 @@ created in the temp folder, package*.json files will be placed in that folder. .PARAMETER LeavePackageInstallCache If set the PackageInstallCache will not be deleted. Use if there are multiple calls to Invoke-Cspell.ps1 to prevent creating multiple working directories and -redundant calls `npm install`. +redundant calls `npm ci`. .PARAMETER Test Run test functions against the script logic @@ -167,9 +167,9 @@ $originalLocation = Get-Location try { Set-Location $PackageInstallCache - npm install npx | Out-Null - npm install cspell | Out-Null - npm install | Out-Null + npm ci npx | Out-Null + npm ci cspell | Out-Null + npm ci | Out-Null # Use the mutated configuration file when calling cspell $command = "npx cspell $JobType --config $CSpellConfigPath --no-must-find-files --root $SpellCheckRoot --relative" From 1fa77830eeb12b443d245d258274b4d438e75a8c Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 2 Mar 2023 11:42:36 -0800 Subject: [PATCH 2/3] Review feedback --- eng/common/spelling/Invoke-Cspell.ps1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/eng/common/spelling/Invoke-Cspell.ps1 b/eng/common/spelling/Invoke-Cspell.ps1 index e2e42802ba81..939e5c8d7a38 100644 --- a/eng/common/spelling/Invoke-Cspell.ps1 +++ b/eng/common/spelling/Invoke-Cspell.ps1 @@ -167,9 +167,7 @@ $originalLocation = Get-Location try { Set-Location $PackageInstallCache - npm ci npx | Out-Null - npm ci cspell | Out-Null - npm ci | Out-Null + npm ci # Use the mutated configuration file when calling cspell $command = "npx cspell $JobType --config $CSpellConfigPath --no-must-find-files --root $SpellCheckRoot --relative" From d13047a3e20e3ee6e6c863f30419a3e99b2a6290 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 2 Mar 2023 13:03:05 -0800 Subject: [PATCH 3/3] Pipe npm ci output to Write-Host --- eng/common/spelling/Invoke-Cspell.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/spelling/Invoke-Cspell.ps1 b/eng/common/spelling/Invoke-Cspell.ps1 index 939e5c8d7a38..9fc5dec9b991 100644 --- a/eng/common/spelling/Invoke-Cspell.ps1 +++ b/eng/common/spelling/Invoke-Cspell.ps1 @@ -167,7 +167,7 @@ $originalLocation = Get-Location try { Set-Location $PackageInstallCache - npm ci + npm ci | Write-Host # Use the mutated configuration file when calling cspell $command = "npx cspell $JobType --config $CSpellConfigPath --no-must-find-files --root $SpellCheckRoot --relative"