xpm-lib package
A Node.js TypeScript module with the core code for xpm and xpm enabled projects.
Remarks
This library groups together various classes and functions used in common by xpm and the Visual Studio Code extension.
The main functionality is to manage actions and build configurations, especially those defined using Liquid templates.
The Lazy Evaluation Mechanism
Actions (Actions) and build configurations (BuildConfigurations) implement a two-step lazy evaluation process to avoid unnecessary operations:
- Name Expansion: During collection initialisation, only the matrix of options is evaluated for each template, expanding template names into concrete action or configuration names without processing their content.
- Content Evaluation: Later, when an action or build configuration is actually accessed and initialised (via
Action.initialise()orBuildConfiguration.initialise()), the template is fully evaluated and Liquid substitutions are performed.
This approach ensures that only items that are actually used incur the cost of template evaluation and variable substitution, significantly improving performance for projects with many actions or configurations.
Classes
|
Class |
Description |
|---|---|
|
An individual xpm action containing commands to be executed. | |
|
A collection of xpm actions for a build configuration or the entire package. | |
|
An individual xpm build configuration. | |
|
A collection of xpm build configurations. | |
|
Generates all possible combinations from a matrix of parameters. | |
|
Error indicating a configuration issue. | |
|
Represents a lazy-loading data model for an xpm package. | |
|
Error indicating that user input is invalid. | |
|
Error indicating a syntax error in configuration or template files. | |
|
Liquid engine configured for xpm templates. | |
|
Liquid drop that resolves | |
|
Liquid drop that resolves | |
|
Error indicating a failure during output generation. | |
|
Provides access to package metadata and xpm-specific validation. | |
|
Platform detection service for runtime environment identification. | |
|
Computes feature policy flags based on a minimum xpm version. | |
|
Error indicating that required prerequisites are not met. | |
|
Error indicating a template evaluation failure. | |
|
A generic template expansion engine for matrix-based template processing. |
Abstract Classes
|
Abstract Class |
Description |
|---|---|
|
Base class for |
Functions
|
Function |
Description |
|---|---|
|
chmodRecursively({ inputPath, readOnly, log, depth, maxDepth, }, input) |
Recursively changes file permissions within a folder tree. |
|
Replaces non-alphanumeric characters with dashes to make paths comply with file system names. | |
|
Replaces non-alphanumeric characters with dashes to make paths comply with POSIX file system names. | |
|
Replaces non-alphanumeric characters with dashes to make paths comply with Windows file system names. | |
|
Extracts an error message string from an unknown error value. | |
|
Builds a unique key using the current platform and architecture. | |
|
Checks whether a string contains Liquid template syntax. | |
|
Determines whether a value is a boolean. | |
|
Determines whether a value is a JSON array. | |
|
Determines whether a value is a JSON object. | |
|
Determines whether a value is a non-empty JSON object. | |
|
Determines whether a value is a finite number. | |
|
Determines whether a value is a non-array object. | |
|
Determines whether a value is a JavaScript primitive. | |
|
Determines whether a value is a string. | |
|
Performs substitutions on an input string using Liquid. | |
|
Validates and processes a matrix object for template expansion. |
Interfaces
|
Interface |
Description |
|---|---|
|
Configuration parameters for constructing an action instance. | |
|
Configuration parameters for constructing an actions collection instance. | |
|
Configuration parameters for constructing a build configuration instance. | |
|
Configuration parameters for constructing a build configurations collection. | |
|
Configuration parameters for constructing a combinations generator instance. | |
|
Defines the xpm configuration options. | |
|
Provides the execution context for xpm operations. | |
|
Configuration parameters for constructing a data model instance. | |
|
Configuration parameters for constructing an | |
|
Defines an | |
|
Defines an | |
|
Defines the substitution variables used by | |
|
Represents a JSON template action with a matrix for expansion. | |
|
Represents a JSON build configuration definition. | |
|
Represents a JSON template build configuration with matrix expansion. | |
|
Represents a JSON extended dependency definition. | |
|
Represents a JSON npm | |
|
Represents a JSON npm package specifier. | |
|
Represents a JSON xpm-specific section in | |
|
Represents a JSON binaries definition in | |
|
Represents a JSON xpm | |
|
Represents a JSON platform-specific binary file definition. | |
|
Configuration parameters for constructing a matrix drop instance. | |
|
Configuration parameters for constructing a properties drop instance. | |
|
Defines the substitution variables available to Liquid templates. | |
|
Configuration parameters for constructing a package instance. | |
|
Platform information structure for runtime environment detection. | |
|
Options for platform information retrieval. | |
|
Configuration parameters for constructing a policies instance. | |
|
Result of matrix validation and processing. | |
|
Configuration parameters for constructing a template expander instance. |
Variables
|
Variable |
Description |
|---|---|
|
The property name used for the build folder relative path. | |
|
The default maximum number of combinations that can be generated. | |
|
The base substitution variables initialised from the current environment. |
Type Aliases
|
Type Alias |
Description |
|---|---|
|
Represents a list of action command strings. | |
|
Represents the available items for a | |
|
Represents the supported platform identifiers for | |
|
Represents a map of | |
|
Represents the supported property types for | |
|
Callback function type for creating instances from template expansions. | |
|
Represents a JSON action definition or a template of one. | |
|
Represents a JSON action content as a string or string array. | |
|
Represents a JSON map of action definitions. | |
|
Represents a JSON build configuration definition or a template of one. | |
|
Represents a JSON array of build configuration names to inherit from. | |
|
Represents a JSON map of build configuration definitions. | |
|
Represents a JSON map of dependencies. | |
|
Represents a JSON dependency content as a string or extended definition. | |
|
Represents a JSON map of properties. | |
|
Represents a JSON property value. | |
|
Represents a JSON map of npm scripts. | |
|
Represents a matrix of parameters for template expansion. | |
|
Represents an array of string values for a single matrix parameter. | |
|
Represents a JSON map of binaries platforms. | |
|
Represents a map of substitution values used by Liquid templates. | |
|
A matrix combination mapping parameter names to their values. |
Generated via tsdoc2docusaurus 1.3.2 by API Extractor/Documenter 7.57.2.