trufflesuite / ganache

: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
2.62k stars 676 forks source link

Universal Conf #4156

Open tenthirtyone opened 1 year ago

tenthirtyone commented 1 year ago
    ```suggestion

const versionCheck = new VersionCheck(version);



Let's extend `VersionCheck` so we can pass a `packageName` property to it to avoid the additional `package.json` file read and parse on every ganache start up.

While `new VersionCheck(version, "ganache")` would work, we need to consider the case were someone wanted to use the `@ganache/cli` package instead of the bundled `ganache` package. In this case should the `packageName`, and thus the `config` itself, be different? Hmmmmmmm. An alternative is to `new VersionCheck(version, process.env.PACKAGE_NAME)` and set `PACKAGE_NAME` in our webpack bundle step.

UPDATE:

I just noticed that `DEFAULTS` already has a `packageName` property we could use for `Conf`'s `packageName` option... though teccchnnnically these values represent different things: one is for the `version-check` server and one is for the config path.

UPDATE 2:

Ugh. So Ganache UI uses `Ganache` for it's configuration location; we probably shouldn't reuse the same folder name for both  :sob:.  Maybe we should default to `ganache-cli`? Thoughts?

_Originally posted by @davidmurdoch in https://github.com/trufflesuite/ganache/pull/3285#discussion_r942937066_