trufflesuite / truffle

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
14.02k stars 2.32k forks source link

`truffle install` should allow updating ethpm.json, similar to `npm install` #807

Closed dmihal closed 5 years ago

dmihal commented 6 years ago

Issue

Truffle & EthPM seem to be designed to function similar to NPM. truffle install <package> installs the package to the installed_contracts directory, similar to how npm install <package> installs a NPM package to the node_modules directory.

Also, truffle install will install any dependencies from the ethpm.json file, similar to how npm install installs any dependencies from package.json.

One feature that seems missing is a command analogous to npm install -s <package>, which installs a package and adds the dependency to package.json.

Proposal

A feature would be added to the Truffle CLI to allow installing new dependencies and saving the dependency to ethpm.json. Keeping in line with NPM, this could be added with a -s flag, so truffle install -s <package>.

If the ethpm.json file doesn't exist, a new file could be automatically generated.

dmihal commented 6 years ago

I'm interested in developing this feature, does anybody have any thoughts or comments before I dive into the code?

cgewecke commented 6 years ago

@dmihal Yes. If you'd like to work on this please do. -s looks free to me.

dmihal commented 6 years ago

@lazaridiscom EthPM.js doesn't have any mechanism for writing to ethpm.json, except for ETHPM.init(), which copies the template ethpm.json file.

I was thinking truffle could use ETHPM.init() if the user uses the -s flag, but hasn't created an ethpm.json file yet.

stale[bot] commented 5 years ago

Thank you for raising this issue! It has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you would like to keep this issue open, please respond with information about the current state of this problem.

stale[bot] commented 5 years ago

There has been no new activity on this issue since it was marked as stale 7 days ago, so it is being automatically closed. If you'd like help with this or a different problem, please open a new issue. Thanks!