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

refactor: extract artifacts to a separate crate #142

Merged
merged 22 commits into from
Jun 14, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Jun 13, 2024

Closes #129

Divides foundry-compilers into 3 crates:

  • foundry-compilers-artifacts - JSON artifacts for Solc and Vyper compilers
  • foundry-compilers-project - Project related logic, including compiler abstraction and compilation pipeline
  • foundry-compilers-core - error types and utilties shared by both crates

@klkvr klkvr changed the title extract artifacts to a separate crate refactor: extract artifacts to a separate crate Jun 13, 2024
crates/artifacts/src/vyper/mod.rs Outdated Show resolved Hide resolved
crates/artifacts/LICENSE-APACHE Outdated Show resolved Hide resolved
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

splitting into
artifacts
core
compilers

makes sense

I suggest to do a foundry companion first before we merge this so that we can fix things like missing re-exports etc.

Comment on lines 53 to 57
use foundry_compilers_artifacts::{
output_selection::OutputSelection,
sources::{Source, Sources},
Contract, Settings, Severity, SourceFile, StandardJsonCompilerInput,
};
Copy link
Member

Choose a reason for hiding this comment

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

we likely want to re-export

foundry_compilers_artifacts as artifacts

so that you don't need to depend on all crates if you're already pulling in compilers

Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

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

last thing, artifacts should be a subdirectory like

  • artifacts
    • solc/src -- base solc
    • vyper/src -- base vyper + imports solc
    • artifacts/src -- meta crate that re-exports both solc and vyper (might not be necessary cc @mattsse )

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

I like this

image

@DaniPopes DaniPopes merged commit c99fe3b into main Jun 14, 2024
14 checks passed
@DaniPopes DaniPopes deleted the klkvr/extract-artifacts branch June 14, 2024 16:50
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.

Extract JSON artifacts to separate crates
3 participants