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

feat(forge): new config option for filtering the contract artifacts which get generated #4979

Open
PaulRBerg opened this issue May 18, 2023 · 5 comments
Labels
A-config Area: config C-forge Command: forge T-feature Type: feature

Comments

@PaulRBerg
Copy link
Contributor

PaulRBerg commented May 18, 2023

Component

Forge

Describe the feature you would like

The idea is to introduce a new config option called filter (or sift) that accepts a list of whitelisted contracts:

[profile.artifacts]
filter = [
  "Foo",
  "Bar",
]

When it sees this config, Forge generates artifacts only for the members listed under filter, regardless of whatever other members may be present in the repository. Note that by "members" in this context, I mean any of the following:

  • contract
  • interface
  • abstract
  • library

The primary use case is shipping a Node.js package that should include only the production contracts' artifacts - though there may be more use cases than just that. Anything related to artifact generation may benefit from such a feature.

Additional context

In our project, we wrote a Bash script because we couldn't find a way to filter contracts with Foundry itself.

@PaulRBerg
Copy link
Contributor Author

@zerosnacks zerosnacks added C-forge Command: forge A-config Area: config labels Jul 2, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@grandizzy
Copy link
Collaborator

@PaulRBerg we have a PR in works #8668 would this solve your request here too? thank you!

@PaulRBerg
Copy link
Contributor Author

Thanks @grandizzy, tagging @smol-ninja and @andreivladbrg for taking a look.

@smol-ninja
Copy link

@grandizzy as per this comment, that PR does not seem to solve this issue.

However, there is a mention of --skip flag that can be used to dictate artifacts. Is that something already a part of foundry (couldn't find it in the book though)?

@grandizzy
Copy link
Collaborator

However, there is a mention of --skip flag that can be used to dictate artifacts. Is that something already a part of foundry (couldn't find it in the book though)?

nope, nothing yet, just wanted to check if the PR could work for you too. thank you

@grandizzy grandizzy removed this from the v1.0.0 milestone Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-config Area: config C-forge Command: forge T-feature Type: feature
Projects
Archived in project
Development

No branches or pull requests

4 participants