Skip to content

Updating Larva

Lara Schenck edited this page Feb 20, 2020 · 1 revision

In pmc-core-v2

Shared Larva patterns (those stored in the larva-patterns package) are built and committed to the parent theme repository, or pmc-core-v2. Include referenced @larva will be transformed into a path that points to the parent theme, while includes written as @project point to template-parts/patterns in the child theme.

When there are updates made to shared larva-patterns, they must be updated in pmc-core-v2 and deployed there, as well as published to npm.

Here are the steps for updating shared patterns in pmc-core-v2:

  1. Review the latest release to Larva, specifically larva-patterns, and ensure there are no breaking changes, or that you are prepared to handle them
  2. In pmc-core-v2/larva run command npm install @penskemediacorp/larva@latest where @latest is a specific version, if that is preferred.
  3. Check your git diff. There is a postinstall script that should clean the patterns directory and re-run the parser, and you should see the updates reflected.
  4. There will likely be mistakes in PHPCS formatting, so next run phpcbf
  5. Commit, test, and deploy your changes as usual when working with pmc-core-v2

In a child theme

Follow the same steps, but wait until the current version is deployed to pmc-core-v2.