Skip to content

Commit 79fe92c

Browse files
authored
Merge pull request #4692 from NomicFoundation/solidity-survey
Add solidity survey banner and message
2 parents 377796b + 3adbba2 commit 79fe92c

File tree

5 files changed

+38
-6
lines changed

5 files changed

+38
-6
lines changed

.changeset/three-boxes-divide.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat": patch
3+
---
4+
5+
Added a temporary message about the 2023 Solidtiy Developer Survey

docs/redirects.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ const customRedirects = [
100100
permanent: false,
101101
},
102102
{
103-
source: "/solidity-survey-2022",
103+
source: "/solidity-survey-2023",
104104
destination:
105-
"https://cryptpad.fr/form/#/2/form/view/HuPIRv4gvziSV0dPV1SJncKzYJXTVc8LGCaMfLUoj2c/",
105+
"https://cryptpad.fr/form/#/2/form/view/pV-DdryeJoYUWvW+gXsFaMNynEY7t5mUsgeD1urgwSE",
106106
permanent: false,
107107
},
108108
{

docs/src/config.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ export const SOCIALS_LINKS = {
2222
[SocialsEnum.DISCORD]: "/discord",
2323
};
2424

25-
export const BANNER_LINK = "https://nomic.foundation/hiring";
25+
export const BANNER_LINK =
26+
"https://cryptpad.fr/form/#/2/form/view/pV-DdryeJoYUWvW+gXsFaMNynEY7t5mUsgeD1urgwSE";
2627

2728
export const PRIVACY_POLICY_PATH = "/privacy-policy.html";
2829

2930
export const bannerContent = {
30-
text: "Join the Hardhat team! Nomic Foundation is hiring",
31-
shortText: "Join the Hardhat team! We are hiring",
31+
text: "Please take a few minutes to complete the 2023 Solidity Survey",
32+
shortText: "Complete the 2023 Solidity Survey here",
3233
href: BANNER_LINK,
3334
};
3435

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

+11-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import { saveFlamegraph } from "../core/flamegraph";
4242
import { Analytics } from "./analytics";
4343
import { ArgumentsParser } from "./ArgumentsParser";
4444
import { enableEmoji } from "./emoji";
45-
import { createProject } from "./project-creation";
45+
import { createProject, showSoliditySurveyMessage } from "./project-creation";
4646
import { confirmHHVSCodeInstallation, confirmTelemetryConsent } from "./prompt";
4747
import {
4848
InstallationState,
@@ -358,6 +358,16 @@ async function main() {
358358
) {
359359
await suggestInstallingHardhatVscode();
360360

361+
// we show the solidity survey message if the tests failed and only
362+
// 1/3 of the time
363+
if (
364+
process.exitCode !== 0 &&
365+
Math.random() < 0.3333 &&
366+
process.env.HARDHAT_HIDE_SOLIDITY_SURVEY_MESSAGE !== "true"
367+
) {
368+
showSoliditySurveyMessage();
369+
}
370+
361371
// we show the viaIR warning only if the tests failed
362372
if (process.exitCode !== 0) {
363373
showViaIRWarning(resolvedConfig);

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

+16
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,20 @@ function showStarOnGitHubMessage() {
362362
console.log(chalk.cyan(" https://github.com/NomicFoundation/hardhat"));
363363
}
364364

365+
export function showSoliditySurveyMessage() {
366+
if (new Date() > new Date("2024-01-07 23:39")) {
367+
// the survey has finished
368+
return;
369+
}
370+
371+
console.log();
372+
console.log(
373+
chalk.cyan(
374+
"Please take a moment to complete the 2023 Solidity Survey: https://hardhat.org/solidity-survey-2023"
375+
)
376+
);
377+
}
378+
365379
export async function createProject() {
366380
printAsciiLogo();
367381

@@ -407,6 +421,7 @@ export async function createProject() {
407421

408422
console.log();
409423
showStarOnGitHubMessage();
424+
showSoliditySurveyMessage();
410425

411426
return;
412427
}
@@ -512,6 +527,7 @@ export async function createProject() {
512527
console.log("See the README.md file for some example tasks you can run");
513528
console.log();
514529
showStarOnGitHubMessage();
530+
showSoliditySurveyMessage();
515531
}
516532

517533
async function canInstallRecommendedDeps() {

0 commit comments

Comments
 (0)