Open jaredhirsch opened 9 years ago
Or maybe we just always build the add-on using the prod settings, then go into FF and manually set prefs in about:config?
I think that's it. The prefs in package.json are just initial defaults - and it seems like prod settings would be the best defaults for shipping. Then, you can overlay dev-specific things in local profile via about:config. (Maybe even with a second add-on that configures everything for you. (yo dawg))
Here's what might be a crazy idea: What if the idea town addon listens for client messages from the known hosts for prod, dev, staging, local dev, etc? One of the messages on login could supply the addon with config details for that server - API endpoint, etc. Then, when you login, the addon can auto-configure itself for that particular server.
I think the big caveat for this is that devs should really use a different Firefox profile for working on each server environment. Could also have the addon present a quick confirmation dialog on environment change, something like "You just logged into Idea Town {Dev,Staging,Local} - do you want to configure Firefox for this instance? [yes] [no]"
IIUC, jpm allows you to set the prefs location via the --prefs
flag: https://github.com/mozilla-jetpack/jpm#usage
That may make it marginally easier to separate the dev vs prod logic into separate files, and then we could use convict to choose the correct config file location based on Node env.
The
jpm
package seems to assume that prefs live in package.json. What, then, is a clean way to toggle between dev and prod URLs?Do we want to build package.json from several other files?
Or, maybe we want to have
package.json.dev
andpackage.json.prod
, and some build process copies one or the other topackage.json
, so that jpm can see it?Or maybe we just always build the addon using the prod settings, then go into FF and manually set prefs in about:config?
¯(ツ)/¯
This bug covers figuring out the most add-on idiomatic way of toggling prefs, and then implementing it.