Skip to main content

XpmPolicies class

Computes feature policy flags based on a minimum xpm version.

Signature

export declare class XpmPolicies

Remarks

This class derives compatibility flags from a specified minimum version to preserve legacy behaviour when required.

Policy versioning allows xpm to evolve its behavior while maintaining backward compatibility for packages that specify older minimum versions. Each policy flag represents a breaking change introduced at a specific xpm version:

  • Packages with minimumXpmRequired < version threshold get legacy behavior.
  • Packages with minimumXpmRequired >= version threshold get new behavior.

This approach ensures that:

  1. Existing packages continue to work with newer xpm versions without modification.
  2. New packages can opt into modern behavior by specifying a recent minimumXpmRequired.
  3. Breaking changes are tied to explicit version declarations rather than xpm installation version.

Policy flags are evaluated once during initialization and cached for the duration of the operation.

Constructors

Constructor

Modifiers

Description

(constructor)({ log, minVersion })

Constructs policy flags based on a minimum xpm version.

Properties

Property

Modifiers

Type

Description

minVersion

string

The minimum xpm version used to derive policy flags.

nonHierarchicalLocalXpacksFolder

boolean

Indicates whether local xpacks folders are non-hierarchical.

onlyStringDependencies

boolean

Indicates whether dependencies are restricted to string-only notation.

shareNpmDependencies

boolean

Indicates whether npm dependencies are shared across installations.

singleParameterXpmInitTemplate

boolean

Indicates whether xpm init templates accept a single parameter.


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