Skip to content

Restructure repo - #201

Merged
andrew-fleming merged 16 commits into
OpenZeppelin:mainfrom
andrew-fleming:restructure-repo
Aug 14, 2025
Merged

Restructure repo#201
andrew-fleming merged 16 commits into
OpenZeppelin:mainfrom
andrew-fleming:restructure-repo

Conversation

@andrew-fleming

@andrew-fleming andrew-fleming commented Aug 4, 2025

Copy link
Copy Markdown
Contributor

Fixes #177.

Draft because docs still need to be updated and tests may be moved to contracts/test/. The latter may be better addressed in another issue/PR

This PR proposes to:

  • Move all modules into a single contracts workspace
  • Output artifacts as contracts/artifacts (as opposed to contracts/src/artifacts/)
  • Remove node_modules from compact module imports
  • Improve ts test utils representation: MaybeString -> Maybe<string>
  • Clean up compact and build turbo tasks
  • Split utils directory into security and utils
    • Security module includes Pausable and Initializable
    • Utils module only has Utils (Might be worth considering a dif name because the path is utils/Utils)

Docs:

  • Update imports according to new structure
  • Combine Ownable and AccessControl guides into a single Access page (same with API)
  • Switch the order of the sample import and module title -> Now the title comes first and the import second
  • Add security guide page and API

The downside with this approach is that it's not easy to filter tests and compilations and thus, these actions take a much longer time than before. If this PR is approved, this is something that should be improved to speed up development


Considerations that are out of scope (will track with issues if this PR is approved):

  1. src should be removed from the import path
  2. Tests can be moved to its own directory alongside src; however, it's not clear whether this makes more sense than keeping colocated tests. Requires further discussion and planning

@andrew-fleming
andrew-fleming marked this pull request as ready for review August 5, 2025 23:20
@andrew-fleming
andrew-fleming requested a review from a team as a code owner August 5, 2025 23:20

@emnul emnul left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks a lot cleaner! Longer compilation times shouldn't be too worrisome. It should be very fixable with more work on our compilation tooling at a later date

@andrew-fleming
andrew-fleming merged commit 8b1d2a8 into OpenZeppelin:main Aug 14, 2025
6 checks passed
@andrew-fleming
andrew-fleming deleted the restructure-repo branch August 14, 2025 15:42
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.

Restructure repo

2 participants