This repository was archived by the owner on Dec 1, 2023. It is now read-only.
Refine project structure #196
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@martriay @andrew-fleming I did a refactor to the project structure, trying to achieve better organization as a result of a call I had with Marto on Friday. I think it has a lot of room for improvement, but this is at least a first proposal (what is described is on this PR):
Informal specification:
project root (nile directory): Only for “core” wrappers (like cli and nre). The wrappers can import from core, but the opposite direction shouldn’t be allowed (core SHOULD NOT import from packages in root).
utils directory (module): For utilities that are helpful for but NOT specific to Nile (like
felt_to_stror generic test helpers likeassert_revert). For utilities specific to Nile logic (like accounts.py functions) use the common module inside core.core directory:
Core elements like Account (in account.py), including the commands and the common submodules. commands for command logic (like deploy or get-nonce), and common for utilities specific to Nile logic (like accounts.py functions). For generic utilities, use the utils module, sibling to core.
This module shouldn’t import anything from the root (except for utils, being generic utilities). This is why the deployments.py and the accounts.py modules have been moved to core (inside the common module because they are functions supporting other logic, not a core logic by itself, at the contrary of account.py, signer.py, or plugins.py, which have been kept on the root of core).
commands and common (submodules of core): ^^ the idea is presented above.
artifacts and base_project: remain with the same objective.