Abstract
the parsed package metadata as an object.
Protected
Readonly
packagethe fetched/parsed package metadata file's raw contents.
Protected
Abstract
importthe import-map entries of the package, sorted from the largest key-alias to the shortest.
each subclass will have to assign on their own, in addition to ensuring the required sorting order.
Protected
Abstract
exportthe export-map entries of the package, sorted from the largest key-alias to the shortest.
each subclass will have to assign on their own, in addition to ensuring the required sorting order.
Abstract
getget the package's name.
Abstract
getget the package's version string.
this method tries to resolve the provided export path_alias
of this package,
to an absolutely referenced path to the resource (using the internal exportMapSortedEntries).
if no exported resources match the given path_alias
, then undefined
will be returned.
for test case examples and configuration options, see the documentation comments of resolvePathFromImportMapEntries
Optional
config: Partial<ResolvePathFromImportMapEntriesConfig>this method tries to resolve the provided import path_alias
done by some resource within this package,
using the internal importMapSortedEntries list of import-aliases that this package uses.
if no import resources match the given path_alias
, then undefined
will be returned
(which would probably mean that the given path_alias
is already either an absolute or relative path, or perhaps incorrect altogether.
for test case examples and configuration options, see the documentation comments of resolvePathFromImportMapEntries
Optional
config: Partial<ResolvePathFromImportMapEntriesConfig>Static
fromcreate an instance of this class by loading a package's json(c) file from a url or local file-system path.
the constructor uses a "JSONC" parser (from @std/jsonc) for the fetched files. therefore, you may provide links to ".jsonc" files, instead of parsing them yourself before calling the super constructor.
an abstraction for import-map utilities of a general javascript runtime's package object with the schema
SCHEMA
.SCHEMA
would representpackage.json
's schema.SCHEMA
would representdeno.json
,deno.jsonc
, orjsr.json
's schema.