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

Basic support for ESM #3211

Closed
wants to merge 44 commits into from
Closed

Basic support for ESM #3211

wants to merge 44 commits into from

Conversation

fvictorio
Copy link
Member

@fvictorio fvictorio commented Sep 23, 2022

Closes #3043
Closes #3240
Closes #2927

This PR:

  • Adds support for having scripts and tests in ESM
  • Adds a new advanced guide about this
  • Upgrades typescript and ts-node. This was done in a previous iteration, when we wanted to have support for ESM in TypeScript projects. We decided we won't do that, but I think we can keep the upgraded packages.
  • Makes some changes to the project initialization:
    • If the project has a package.json with "type": "module", the options shown are a bit different
    • There's a new javascript-esm sample project
    • I also made some changes to how we handle the project initialization if the directory already has files. Basically: we skip the README.md file if there's already one, and we properly check for clashing files, not directories.
  • There's also a small change in the Toolbox to handle Hardhat config files with the .cjs extension.

phated and others added 28 commits September 8, 2022 11:13
feat: Support .cts extension with ts-node 10+
feat: Load hardhat.config.cjs to partially support ESM projects
Read the comment in `test/builtin-task/test.ts` to understand why there are so many changes in this commit.
feat: Support ESM test running via the test task
@vercel
Copy link

vercel bot commented Sep 23, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 6, 2023 at 9:44AM (UTC)
hardhat-storybook ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 6, 2023 at 9:44AM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented Sep 23, 2022

🦋 Changeset detected

Latest commit: db79940

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

This PR includes changesets to release 2 packages
Name Type
@nomicfoundation/hardhat-toolbox Patch
hardhat Minor

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

@fvictorio
Copy link
Member Author

Closing in favor of #3550

@fvictorio fvictorio closed this Jan 6, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2023
@fvictorio fvictorio deleted the esm branch August 7, 2023 10:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
2 participants