vscode-ext
vscode-ext copied to clipboard
Deploying via ganache should rewrite truffle-config
When I deploy on VS Code on ganache, it rewrites the truffle-config
Additionally, is there a way to not add the loc_local_ prefix? It gets confusing to remember when i want to do --network ganache_name
Hi @emilyJLin95,
Ok, I just removed the loc
in front of the network name and kept just the name as it is displayed inside the network view panel.
About VSCode rewrites truffle-config.js
There are some points that we need to bring to the table. Today, we have the network view panel, that the user is free to create a new network or connect to one previously existent. Given that, there are 2 scenarios here:
-
If we leave the combobox with only the networks that are inside the
truffle-config.js
, this can cause a strangeness to the users and they considering it a bug, because the items from the network view panel, are not showing up as a target for deploy -
If we decide to keep it the same way (all networks showing up), but avoid rewriting the
truffle-config.js
, we won't be able to make a deploy for networks coming from the network view panel, because we must have the network target written inside thetruffle-config.js
in order to execute a deploy. In this specific case, the extension is trying to be proactive, modifying the configuration file to allow users do a deploy.
IMHO, maybe we can create a different style to show the network information inside the combobox. Something like
separate the networks that are coming from the the truffle-config.js
to the ones that have been coming from the network view panel. Below these last ones, we can add a warning saying something like: choosing this network, your deploy will be done and your truffle-config.js will be modified
.
Thoughts?
@kevinbluer for visibility
We might get rid of this issue altogether when/if https://github.com/trufflesuite/truffle/issues/5701 gets implemented. Because if it gets implemented, a new --url
flag will be introduced. This flag that allows us to pass down the network, instead of re-writing truffle-config.js
.