nile
nile copied to clipboard
Support `nilerc`
This is related to #72 and something I personally wish was included. I think it would be helpful to have a configuration file that nile can use to lookup information such as:
- cairo path
- contracts directory
For example, the OZ cairo-contracts repository contains the cairo contracts in the openzeppelin directory and so nile compile won't compile them.
I'm also using the OZ contracts in my project and at the moment I can't compile with nile because I can't add the git submodule to the cairo path.
Absolutely spot on. Something I wish for as well.
I could also be a better solution to #75 (which, personally, I don't think fits the scope of nile).
What format should it have? TOML? JSON?
What attributes? So far, we got 1) cairo path, 2) contract directory (directories?), 3) method (starknet vs. cairo).
I think TOML is a good format, but a lot of Python projects use Python files for configuration and load them at runtime.
A lot of the modern python ecosystem seems to be moving towards using the pyproject.toml for configuration like this. Coming from other common tools like poetry or black, that's where I'd likely expect to find options like this (under the assumption we'll continue to have a strong tie to the python ecosystem for as long as nile is relevant)
Another option is to have a nile.toml file, if we don't want to be so integrated with the Python ecosystem.
Let's also make sure the configuration file allows users to define options for plugins (once implemented, see #53).
Is there any advantage of using nile.toml instead of pyproject.toml though?
With pyproject.toml we tie nile to the Python ecosystem. I think that's fine.
I don't think having it in pyproject.toml is a good idea. It's a file intended for python packages, it doesn't have anything to do with Nile. I've noticed a lot of people coming to the StarkNet ecosystem (and using nile) have JS dev background and don't have experience with python. Using a python specific config file would confuse them even further (that's why I'd also rather not use a .py file either).
Being a JS developer forced into python because of Cairo I can confirm I don't know how to use these files. That being said, I'm not sure how feasible it really is to move away from it, since Nile's scripting API is already python. I don't have a strong opinion, I guess we can just have a nile.toml?