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

Adopt .contract.js naming for contract definition files #4994

Open
turadg opened this issue Apr 1, 2022 · 2 comments
Open

Adopt .contract.js naming for contract definition files #4994

turadg opened this issue Apr 1, 2022 · 2 comments
Labels
tooling repo-wide infrastructure Zoe Contract Contracts within Zoe

Comments

@turadg
Copy link
Member

turadg commented Apr 1, 2022

What is the Problem Being Solved?

It's sometimes hard to find a contract file. They can appear anywhere in the source tree and have no distinguishing features in their names.

The lack of a consistent name also makes more work for #4770

Description of the Design

(from thread)

  • Adopt a convention of .subtype.js for flavors of JS files
  • Rename contract files to .contract.js
  • Ensure they each have exactly one named export, a start function

Security Considerations

--

Test Plan

--

@turadg turadg added enhancement New feature or request tooling repo-wide infrastructure and removed enhancement New feature or request labels Apr 1, 2022
@Tartuffo Tartuffo added the Zoe Contract Contracts within Zoe label Apr 14, 2022
@turadg
Copy link
Member Author

turadg commented May 5, 2022

I'm running into this again where it's hard to find a particular contract. @dckc you were opposed to the .contract.js convention. Are you willing for there to be a file name/path convention at all? If so, what would you prefer?

One alternative to the file subtype is to have at most one contract per directory and name it as the contract like packages/run-protocol/vaultFactory/contract.js. Related files would be grouped in the same directory.

@dckc
Copy link
Member

dckc commented May 5, 2022

I'm running into this again where it's hard to find a particular contract.

Which one? What sort of search are you doing that fails?

you were opposed to the .contract.js convention.

It's not the convention I oppose; it's renaming. Renaming breaks web links, git blame, etc.
I think it's only cost-effective when the benefit is very substantial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling repo-wide infrastructure Zoe Contract Contracts within Zoe
Projects
None yet
Development

No branches or pull requests

3 participants