XpmPackage class
Provides access to package metadata and xpm-specific validation.
Signature
export declare class XpmPackage
Remarks
This class loads and validates package.json content, determines package capabilities, and provides helper methods used across xpm workflows.
The package abstraction provides a layer over package.json processing with progressive validation:
- Basic file I/O: Read and write
package.jsonwith error handling. - npm validation: Check for valid npm package structure (name, version).
- xpm validation: Verify
xpacksection presence and structure. - Binary package validation: Validate binary-specific metadata (executables, binaries, platforms).
- Capability detection: Determine package features (scripts, actions, build configurations).
- Version checking: Validate minimum xpm version requirements.
- Specifier parsing: Extract scope, name, and version from package identifiers.
This hierarchy allows validation to be performed incrementally as needed, avoiding unnecessary checks for packages that don't meet earlier criteria.
Constructors
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
Constructs a package helper bound to a specific folder. |
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
|
Logger |
The logger instance for output and diagnostics. | |
|
(Optional) The parsed | |||
|
string |
The absolute path to the package folder. |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Validates the minimum required xpm version against the installed CLI. | ||
|
Retrieves the minimum required xpm version specified by the package. | ||
|
Determines whether the package defines any npm scripts. | ||
|
Determines whether the package defines any xpm actions. | ||
|
Determines whether the package is a Node module with a binary entry. | ||
|
Determines whether the package is a binary xpm package. | ||
|
Determines whether the package is a Node module without xpm metadata. | ||
|
Determines whether the | ||
|
Determines whether the package is an xpm package. | ||
|
Parses an npm package specifier into its components. | ||
|
Reads and parses | ||
|
Writes the provided |
Generated via tsdoc2docusaurus 1.3.0-pre by API Extractor/Documenter 7.55.2.