Skip to content

refactor: extract artifacts to a separate crate#142

Merged
DaniPopes merged 22 commits intomainfrom
klkvr/extract-artifacts
Jun 14, 2024
Merged

refactor: extract artifacts to a separate crate#142
DaniPopes merged 22 commits intomainfrom
klkvr/extract-artifacts

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 requested review from DaniPopes and Evalir as code owners June 13, 2024 00:12
@klkvr klkvr changed the title extract artifacts to a separate crate refactor: extract artifacts to a separate crate Jun 13, 2024
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
@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