Skip to main content

Module package_json

Module package_json 

Source
Expand description

package.json parsing and pre-processing for Components.js metadata.

Reads the lsd:* fields that Components.js adds to package.json:

FieldMeaning
lsd:moduletrue (auto-expand) or an explicit module IRI string
lsd:componentsrelative path to components.jsonld
lsd:contextsmap of context IRI → relative path to the context file
lsd:importPathsmap of IRI prefix → relative directory for import resolution
lsd:basePathoptional path prefix applied to all relative paths above

preprocess_package_json handles the lsd:module: true shorthand: it expands the module IRI to https://linkedsoftwaredependencies.org/bundles/npm/<name> and auto-detects the standard components/ and config/ directories.

Structs§

PackageJson
Parsed package.json with CJS-specific fields.

Enums§

LsdModule
lsd:module can be either true or a string IRI.

Functions§

get_module_iri
Get the resolved module IRI from a PackageJson (after preprocessing).
preprocess_all
Preprocess all package.json files.
preprocess_package_json
Preprocess a package.json: expand lsd:module: true into full IRI, auto-detect components and config directories. Mirrors ModuleStateBuilder.preprocessPackageJson.
read_package_jsons
Read package.json files from all given module directory URLs.