Skip to content

Commit 5c15b73

Browse files
authored
Merge branch 'main' into prague-support
2 parents cc29fc4 + a5419a7 commit 5c15b73

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

.changeset/hot-birds-cover.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat": patch
3+
---
4+
5+
Use `npm_config_user_agent` to determine what package manager to use for project creation

docs/src/content/hardhat-runner/docs/supporter-guides/oracles.md

-2
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ There are multiple oracle applications you can integrate into your dapp:
232232

233233
- [Band Protocol](https://bandprotocol.com/) - _Band Protocol is a cross-chain data oracle platform that aggregates and connects real-world data and APIs to smart contracts._
234234

235-
- [Provable](https://provable.xyz/) - _Provable connects blockchain dapps with any external Web API and leverages TLSNotary proofs, Trusted Execution Environments (TEEs), and secure cryptographic primitives to guarantee data authenticity._
236-
237235
- [Paralink](https://paralink.network/) - _Paralink provides an open source and decentralized oracle platform for smart contracts running on Ethereum and other popular blockchains._
238236

239237
- [Dos.Network](https://dos.network/) - _DOS Network is a decentralized oracle service network to boost blockchain usability with real-world data and computation power._

packages/hardhat-core/src/internal/cli/project-creation.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,24 @@ function isInstalled(dep: string) {
554554
return dep in allDependencies;
555555
}
556556

557+
function getProjectTypeFromUserAgent() {
558+
const userAgent = process.env.npm_config_user_agent;
559+
// Get first part of user agent string
560+
const [projectType] = userAgent?.split("/") ?? [];
561+
return projectType;
562+
}
563+
557564
async function isYarnProject() {
558-
return fsExtra.pathExists("yarn.lock");
565+
return (
566+
getProjectTypeFromUserAgent() === "yarn" || fsExtra.pathExists("yarn.lock")
567+
);
559568
}
560569

561570
async function isPnpmProject() {
562-
return fsExtra.pathExists("pnpm-lock.yaml");
571+
return (
572+
getProjectTypeFromUserAgent() === "pnpm" ||
573+
fsExtra.pathExists("pnpm-lock.yaml")
574+
);
563575
}
564576

565577
async function getProjectPackageManager(): Promise<PackageManager> {

0 commit comments

Comments
 (0)