Skip to main content

XpmBuildConfiguration._substituteInherits() method

Performs selective substitution on the inherits field only.

Signature

protected _substituteInherits(): Promise<JsonBuildConfigurationContent>;

Returns

Promise<JsonBuildConfigurationContent>

A promise that resolves to the build configuration content with the inherits field substituted.

Exceptions

XpmError If Liquid template substitution fails on the inherits field.

Remarks

This method is invoked during initialisation for regular (non-template) configurations to substitute template variables in the inheritance specification whilst leaving other fields untouched until later processing.

Processing steps:

  1. Extract the inherits (or deprecated inherit) field from the configuration.
  2. Stringify the inherits field and check for template syntax ({{ or {%).
  3. If templates are found:
    • Perform Liquid substitutions with current variable context.
    • Parse the substituted JSON string back into an object.
    • Return a new configuration object with the substituted inherits field and all other fields unchanged.
  4. If no templates are found, return the original configuration as-is.

This selective approach is more efficient than full JSON substitution for regular configurations that do not have matrix parameters. The remaining fields (properties, dependencies, actions) are processed during inheritance resolution and dependency substitution phases.


Generated via tsdoc2docusaurus 1.3.0-pre by API Extractor/Documenter 7.55.2.