Skip to content

fix: reexport properly#35

Merged
gakonst merged 3 commits intofoundry-rs:developfrom
mattsse:matt/reexport-properly
May 30, 2022
Merged

fix: reexport properly#35
gakonst merged 3 commits intofoundry-rs:developfrom
mattsse:matt/reexport-properly

Conversation

@mattsse
Copy link
Copy Markdown
Member

@mattsse mattsse commented May 24, 2022

use import "@foundry-rs/hardhat-forge";

tested with local project yard add file:...

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented May 24, 2022

🦋 Changeset detected

Latest commit: 63b6efa

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

This PR includes changesets to release 1 package
Name Type
@foundry-rs/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

@guacamoleoverflow
Copy link
Copy Markdown

apologies for the random comment - I think some of this dist stuff is just related to how tsc builds to the output folder? I'm not that familiar myself but the current dist is including src/test, and I'm not sure we'd want that in npm? Usually you just include the compiled src to make the download a little smaller. I think we'd just need to add include the other tsconfig files?

for example:

for hardhat-forge,

image

the dist folder includes the test folder, also the src folder. but with "include": ["src/**/*.ts"]

image

there's only the contents of the src folder, and you can just specify dist/index.js for "main" in package.json

(I was testing this myself the other day and stumbled upon #26/#31 earlier, maybe next time I'll do a PR 😄 )

@@ -1,2 +1,2 @@
import "../../hardhat-forge/src/index";
import "../../hardhat-anvil/src/index";
import "@foundry-rs/hardhat-forge";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this actually work? It looks like its just importing and not exporting.

Google search says you can do something like:

export * from "@foundry-rs/hardhat-forge";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yeah if you want to export, you'd want that. Can also do export * as forge from "@foundry-rs/hardhat-forge"; if you want the exports to have a name vs import each thing from it.

the compiled version currently is the equivalent of just the imports, so

require("@foundry-rs/hardhat-forge");
require("@foundry-rs/hardhat-anvil");

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

nice, using aliases now

@gakonst gakonst merged commit 6d0971c into foundry-rs:develop May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants