-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: No longer error on pnpm lockfile specifier mismatch (#3656)
Fixes #3638 I added a regression in #3611 where we would error if there was a specifier mismatch and the specifier wasn't totally resolved. This was an unintended change to the previous behavior would indicate it didn't find a package resolution. Tested against [provided reproduction](https://github.com/sushiswap/sushiswap)
- Loading branch information
1 parent
1bfa7c2
commit 1493cc2
Showing
3 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -289,3 +289,22 @@ func Test_LockfileTopLevelOverride(t *testing.T) { | |
assert.DeepEqual(t, pkg.Key, "/ci-info/3.7.1") | ||
assert.DeepEqual(t, pkg.Version, "3.7.1") | ||
} | ||
|
||
func Test_PnpmOverride(t *testing.T) { | ||
contents, err := getFixture(t, "pnpm_override.yaml") | ||
if err != nil { | ||
t.Error(err) | ||
} | ||
lockfile, err := DecodePnpmLockfile(contents) | ||
assert.NilError(t, err, "decode lockfile") | ||
|
||
pkg, err := lockfile.ResolvePackage( | ||
turbopath.AnchoredUnixPath("config/hardhat"), | ||
"@nomiclabs/hardhat-ethers", | ||
"npm:[email protected]", | ||
) | ||
assert.NilError(t, err, "failure to find package") | ||
assert.Assert(t, pkg.Found) | ||
assert.DeepEqual(t, pkg.Key, "/hardhat-deploy-ethers/0.3.0-beta.13_yab2ug5tvye2kp6e24l5x3z7uy") | ||
assert.DeepEqual(t, pkg.Version, "/hardhat-deploy-ethers/0.3.0-beta.13_yab2ug5tvye2kp6e24l5x3z7uy") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
lockfileVersion: 5.4 | ||
|
||
overrides: | ||
"@nomiclabs/hardhat-ethers": npm:hardhat-deploy-ethers@^0.3.0-beta.13 | ||
|
||
importers: | ||
config/hardhat: | ||
specifiers: | ||
"@nomiclabs/hardhat-ethers": npm:hardhat-deploy-ethers@^0.3.0-beta.13 | ||
dependencies: | ||
"@nomiclabs/hardhat-ethers": /hardhat-deploy-ethers/0.3.0-beta.13_yab2ug5tvye2kp6e24l5x3z7uy | ||
|
||
packages: | ||
/hardhat-deploy-ethers/0.3.0-beta.13_yab2ug5tvye2kp6e24l5x3z7uy: | ||
resolution: | ||
{ | ||
integrity: sha512-PdWVcKB9coqWV1L7JTpfXRCI91Cgwsm7KLmBcwZ8f0COSm1xtABHZTyz3fvF6p42cTnz1VM0QnfDvMFlIRkSNw==, | ||
} | ||
peerDependencies: | ||
ethers: ^5.0.0 | ||
hardhat: ^2.0.0 | ||
dependencies: | ||
ethers: 5.7.2 | ||
hardhat: [email protected] |