@oazmi/esbuild-plugin-deno - v0.4.0
    Preparing search index...

    Class RuntimePackage<SCHEMA>Abstract

    an abstraction for import-map utilities of a general javascript runtime's package object with the schema SCHEMA.

    • in the case of node, SCHEMA would represent package.json's schema.
    • in the case of deno, SCHEMA would represent deno.json, deno.jsonc, or jsr.json's schema.

    Type Parameters

    • SCHEMA extends Record<string, any>

      a record type representing the package schema.

    Hierarchy (View Summary)

    Index

    Constructors

    • Type Parameters

      • SCHEMA extends Record<string, any>

      Parameters

      • package_object: SCHEMA

        the parsed package metadata as an object.

        • in the case of node, this would be your json-parsed "package.json" file.
        • in the case of deno, this would be your json-parsed "deno.json" file.
      • package_path: string

      Returns RuntimePackage<SCHEMA>

    Properties

    packagePath: string

    the path or url of the package json(c) file.

    the base class does nothing with this information; it is just there so that subclasses can make uses of this information (usually for resolving relative paths).

    packageInfo: SCHEMA

    the fetched/parsed package metadata file's raw contents.

    importMapSortedEntries: ImportMapSortedEntries

    the import-map entries of the package, sorted from the largest key-alias to the shortest.

    Note

    each subclass will have to assign on their own, in addition to ensuring the required sorting order.

    exportMapSortedEntries: ImportMapSortedEntries

    the export-map entries of the package, sorted from the largest key-alias to the shortest.

    Note

    each subclass will have to assign on their own, in addition to ensuring the required sorting order.

    Methods

    • get the path/url to the package's json(c) file.

      the base class does nothing with this information; it is just there so that subclasses can make uses of this information (usually for resolving relative paths).

      Returns string

    • 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.

      Tip

      for test case examples and configuration options, see the documentation comments of resolvePathFromImportMapEntries

      Parameters

      Returns undefined | string

    • create an instance of this class by loading a package's json(c) file from a url or local file-system path.

      Tip

      the constructor uses a "JSONC" parser (from @oazmi/kitchensink/stringman) for the fetched files. therefore, you may provide links to ".jsonc" files, instead of parsing them yourself before calling the super constructor.

      Type Parameters

      Parameters

      • this: ConstructorOf<INSTANCE, [SCHEMA, string]>
      • package_jsonc_path: string | URL

      Returns Promise<INSTANCE>