Skip to main content

DataModel class

Represents a lazy-loading data model for an xpm package.

Signature

export declare class DataModel

Remarks

This class prepares substitution variables, creates the Liquid engine, and exposes actions and build configurations defined in the package.

The package processor serves as the top-level coordinator for all Liquid-based template processing in an xpm package. It establishes the foundation for variable substitution throughout the package hierarchy:

  1. Initializes base substitution variables (platform detection, system information, etc.).
  2. Adds package-specific variables from package.json metadata.
  3. Merges user-defined properties from xpack.properties.
  4. Creates package-level actions accessible across all contexts.
  5. Creates build configurations, each inheriting the base substitution context and adding configuration-specific variables.

This hierarchical structure ensures that templates at any level have access to appropriate variables while maintaining clear scoping rules. Package-level actions are available globally, while configuration-level actions are scoped to their respective configurations.

Constructors

Constructor

Modifiers

Description

(constructor)({ jsonPackage, log }, input)

Constructs a Liquid package processor.

Properties

Property

Modifiers

Type

Description

_engine

protected

readonly

LiquidEngine

The Liquid engine used for substitutions.

_jsonPackage

protected

readonly

JsonXpmPackage

The JSON package definition.

_log

protected

readonly

Logger

The logger instance for output and diagnostics.

actions

readonly

Actions

The actions collection for this package.

buildConfigurations

readonly

BuildConfigurations

The build configurations collection for this package.

substitutionsVariables

readonly

LiquidSubstitutionsVariables

The variables available for Liquid substitutions.


Generated via tsdoc2docusaurus 1.3.2 by API Extractor/Documenter 7.57.2.