Skip to content

Releases: ibm-garage/node-garage-utils

4.1.0

17 Aug 00:22
Compare
Choose a tag to compare

Features

  • cloudEnv: new cloudEnv abstraction for information about the CF or Kubernetes environment (6d2dc44)
  • cloudEnv: new serviceCreds() to obtain service credentials from VCAP_SERVICES (in CF) or a named environment variable (in Kubernetes) (5eadf08)

4.0.2

28 Mar 14:24
Compare
Choose a tag to compare

No functional changes. Dependency updates.

4.0.1

18 Jan 21:08
Compare
Choose a tag to compare

No functional changes. Switched npm account for publishing.

4.0.0

18 Jan 20:55
Compare
Choose a tag to compare

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

28 Aug 03:42
Compare
Choose a tag to compare

Features

  • appEnv: detect isSpec() for Jest using recognized test filename conventions (.spec.js, _spec.js, .test.js, _test.js) (2cebcfb)

3.2.0

14 Aug 21:39
Compare
Choose a tag to compare

Features

  • logger: automatically redact authorization headers; add expressLogger() options (childOptions and childSimple) and createSerializer() to support custom redaction (and other serializer customization) (a99739c)

3.1.0

14 Aug 21:39
Compare
Choose a tag to compare

Bug Fixes

  • logger: fix missing bind() in expressLogger(), which prevented request and response logging (e477f26)

Features

  • logger: rename expressLogger() option baseLogger to parentLogger (maintaining support for the old name) (b819fe3)

3.0.0

26 Jun 16:49
Compare
Choose a tag to compare

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.

2.2.0

15 May 15:34
Compare
Choose a tag to compare

Features

  • appEnv: add version (populated from package.json) (e3b322a)

2.1.0

08 Mar 23:02
Compare
Choose a tag to compare

Features

  • errors: add forbidden() to support status 403 (797f3e1)
  • logger: support specifying the logging level via a LOG_LEVEL environment variable (d707041)