Releases: ibm-garage/node-garage-utils
4.1.0
4.0.2
No functional changes. Dependency updates.
4.0.1
No functional changes. Switched npm account for publishing.
4.0.0
Features
- appEnv: simplify env value computation and isDev(), isProd(), etc. functions, to more closely align with common Node conventions and work better with other tools (a4f5b2d)
- cf: remove automatic services.json parsing in cfEnv(), make getServiceCredsByLabel() and getServiceCredsByName() not fail-fast by default (421ecdd)
- cfutil: add logs command for Bunyan-friendly log streaming (ca1e706)
- cfutil: new CLI utility for Cloud Foundry projects, with env command (2b34f10)
BREAKING CHANGES
-
appEnv: appEnv.env special values are changed: "dev" -> "development", "prod" -> "production", "test" for all automated testing (replacing "unit" and some uses of "test"), "script" added; isSpec() and isUnit() functions are removed; GAPP_ENV is no longer used
Set NODE_ENV directly, instead of GAPP_ENV (which is now ignored). Use isTest() instead of isSpec() to detect any automated testing environment. Instead of trying to distinguish between unit and integration tests via appEnv, simply set VCAP_SERVICES (for CF) or secrets (for Kube) differently.
-
cf: cfEnv() no longer provides special handling for services when running in the dev environment; getServiceCredsByLabel() and getServiceCredsByName() now return null by default when no matching service is found
Developers must take care to set a VCAP_SERVICES environment variable in the dev environment or use the vcap or vcapFile option on cfEnv() to explicitly specify services. The former approach is recommended, and the new cfutil env command can help by generating a local artifact from an actual CF environment and a script that reads it.
To maintain the old error-throwing behavior of getServiceCredsByLabel() or getServiceCredsByName(), simply pass true as a second argument. Returning null by default allows for simpler client code in cases where the absence of a service can be tolerated (no try/catch required).
3.3.0
3.2.0
3.1.0
3.0.0
Features
- logger: switched logger to Bunyan implementation (10f08a8)
BREAKING CHANGES
-
logger: minor changes to the logger API based on the underlying implementation: removed configure() and log(); replaced setLevel() -> logger.level() and connectLogger() -> expressLogger()
Clients must adopt the API changes, and should expect new logging output. Notably, applications will now log in JSON.