Skip to content

guardian/commercial-shared

Repository files navigation

Commercial shared library Release

This codebase holds the business logic for the display of commercial components, so that it can be shared across all Guardian platforms: web and app.

Assumptions

  1. It will be included in all frontend deployments that show commercial components
  2. It will be included in mapi deployments
  3. It won't make any calls to external services
  4. Its only dependencies are the capi model and the facia model

Usage

Add the library as dependency: libraryDependencies += "com.gu" %% "commercial-shared" % "<x.y.z>"

Known usages

Examples

  1. Find branding for a given content item, section, tag or container: See branding tests.
  2. Build display ad targeting for a given content item, section or tag: See ad targeting tests.

How to ...

Start sbt session

Run bin/activator

Test locally in a downstream project

Run the sbt publishLocal task. This will generate a local snapshot artefact. Add the snapshot version as a dependency of the downstream project.

Release

See: https://github.com/guardian/gha-scala-library-release-workflow/blob/main/docs/making-a-release.md