Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Advanced Sample Project that uses TypeScript #1770

Merged
merged 21 commits into from
Oct 4, 2021
Merged

Conversation

feuGeneA
Copy link
Contributor

@feuGeneA feuGeneA commented Aug 6, 2021

Fixes #1755

  • Add advanced sample project with TypeScript
  • Convert require to import in packages/hardhat-core/sample-projects/advanced-ts/scripts/deploy.ts.

@feuGeneA feuGeneA self-assigned this Aug 6, 2021
@feuGeneA feuGeneA force-pushed the sample-ts-project branch 2 times, most recently from d15141f to 429071d Compare August 10, 2021 17:02
@feuGeneA feuGeneA marked this pull request as ready for review August 10, 2021 17:36
@feuGeneA feuGeneA requested a review from fvictorio August 10, 2021 17:36
Base automatically changed from multiple-sample-projects to master August 13, 2021 12:26
@fvictorio
Copy link
Member

Minor point but: I think we should use .env.example instead of .env.template. I personally have always seen and used .example, but besides the anecdotal evidence, there seems to be more of those files according to GH search: 584K vs 37K. There's also dotenv-safe, which assumes the example file is called that way.

feuGeneA and others added 3 commits August 18, 2021 12:31
@feuGeneA feuGeneA requested a review from fvictorio August 23, 2021 21:26
@changeset-bot
Copy link

changeset-bot bot commented Aug 27, 2021

🦋 Changeset detected

Latest commit: a00345c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
hardhat Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@fvictorio fvictorio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think @alcuadrado was going to review this one too.

@fvictorio fvictorio requested a review from alcuadrado August 27, 2021 10:56
@fvictorio
Copy link
Member

Oh, one minor comment is that running the suggested eslint command in the README results in this warning:

=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.4.0

YOUR TYPESCRIPT VERSION: 4.4.2

Please only submit bug reports when using the officially supported version.

=============

I don't know if there's a perfect solution for this. If we always use the latest versions of both typescript and @typescript-eslint, this will happen now and then. If we pin them, we'll need to remember to upgrade them (and we probably won't). I say we leave it as it is and, if users care, they can downgrade typescript manually.

Copy link
Contributor

@cgewecke cgewecke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool! ❤️

},
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
currency: "USD",
Copy link
Contributor

@cgewecke cgewecke Aug 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@feuGeneA

Hi, wrt your issue at hardhat-gas-reporter 72. Was not able to reproduce (using a valid coinmarketcap api. key). I know you tried that but ... maybe there was a copy-paste error or something?

Price data seems to be working ok for latest hardhat in this recent CI run for the plugin.

The config used for that test is:

gasReporter: {
    coinmarketcap: process.env.CMC_API_KEY
 }

[EDIT - I think the price problem is a race-condition issue that likely only affects tiny projects (like a sample). More detail about this in hh-gas-reporter 72 comment]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cgewecke, is there a way to disable this feature and just show the prices in eth? While i find it really cool, it would be nice if we don't ask the users to provide another api key in these sample projects.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes good idea,. Someone else has requested that here as well ... (cross-linking: cgewecke/eth-gas-reporter#219)

},
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
currency: "USD",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cgewecke, is there a way to disable this feature and just show the prices in eth? While i find it really cool, it would be nice if we don't ask the users to provide another api key in these sample projects.

feuGeneA added a commit that referenced this pull request Sep 21, 2021
feuGeneA added a commit that referenced this pull request Sep 21, 2021
feuGeneA added a commit that referenced this pull request Sep 21, 2021
Now matches what we were already doing in the advanced JS project.

Addresses review comment #1770 (comment)
Store source file as npmignore (without the leading period) so that it
doesn't instruct the packaging of hardhat itself to exclude the files
listed therein, otherwise they won't be available at project creation
time.

Addresses review comment #1770 (comment)
Now matches what we were already doing in the advanced JS project.

Addresses review comment #1770 (comment)
@feuGeneA feuGeneA requested a review from alcuadrado September 22, 2021 21:57
Copy link
Member

@alcuadrado alcuadrado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good now, @feuGeneA!

I just added another changeset mentioning there were changes to the advance sample project.

@feuGeneA feuGeneA merged commit 1239385 into master Oct 4, 2021
@fvictorio fvictorio deleted the sample-ts-project branch October 4, 2021 21:57
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature : Typescript Sample project through CLI
4 participants