2.0.0 • Published 4 years ago

cam-toggler v2.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Toggler

Pull the lever, Kronk!

This tool is for setting and persisting the FEATURE_TOGGLES environment variable during local development of Digital Publishing applications.

No more faffing around exporting a JSON string every time you run an application!

Get feature configurations from INT/TEST/LIVE for easier testing and debugging!

Requirements

  • Node 10+
  • Access to the BBC's NPM registry
  • Certs set up to use with @bbc/http-client
    • i.e. your dev cert at /etc/pki/certificate.pem

Installation

(better installation method to come 🙂) 1. Clone this repo 2. npm install 3. Add something like this your .bashrc or whatever:

```bash
toggler_path=/path/to/dpub-toggler
source $toggler_path/export.sh
alias toggle="source $toggler_path/set.sh"
```

Usage

With the above alias set up, simple use the toggle command to enter the CLI and set your feature toggles. Your selected toggles will be exported in your current terminal session and saved to be exported into future terminal sessions.

The CLI initially gathers its feature toggles from the Cosmos configs of its supported applications. Additional features can be adding by selecting Custom then add features. All features the CLI comes across are cached so they stick around even after toggling them off. Cached features are kept in the ~/.toggler_features file, so you can also edit that to remove any unwanted cached features.

Supported Applications

  • optimo
  • passport-control

FAQ / Troubleshooting

I can't install @bbc/http-client

Make sure you're either a member of the BBC's NPM organisation or are set up to use a mirror registry. Try deleting package-lock.json if you have trouble installing.