PluginPackages: how plugin packages reach and leave the data root's npm prefix, as NpmPluginPackages implements it (plugin/packages.ts) — with npm, or without it for a package that needs nothing npm does on a machine that has none.
API
@Interface()
export abstract class PluginPackages {
abstract check(root: string, spec: string): Promise<void>;
abstract install(root: string, source: string): Promise<InstalledPackage>;
abstract installFiles(root: string, files: Record<string, Uint8Array>): Promise<InstalledPackage>;
abstract installTarball(root: string, file: string, name: string): Promise<InstalledPackage>;
abstract installChannel(
root: string,
channel: IndexChannel,
opts?: { onProgress?: (received: number, total: number | null) => void },
): Promise<InstalledPackage>;
abstract remove(root: string, name: string): Promise<void>;
}Contract Topology
Static AST wiring across @Module / @Provide / @UseMembers (6)
check
check(root: string, spec: string): Promise<void>Asks the registry whether it has a name (name, name@range) before it is installed, within
a short window; throws npm's failure.
@paramroot
string@paramspec
string@returns
Promise<void>install
install(root: string, source: string): Promise<InstalledPackage>A registry name (name, name@range) or a link npm fetches; answers which package that was.
@paramroot
string@paramsource
string@returns
Promise<InstalledPackage>installFiles
installFiles(root: string, files: Record<string, Uint8Array>): Promise<InstalledPackage>An uploaded package's files, relative path → bytes (checked by the caller).
@paramroot
string@paramfiles
Record<string, Uint8Array>@returns
Promise<InstalledPackage>installTarball
installTarball(root: string, file: string, name: string): Promise<InstalledPackage>A package tarball already on this machine, verified by the caller (an offline archive).
@paramroot
string@paramfile
string@paramname
string@returns
Promise<InstalledPackage>installChannel
installChannel(root: string, channel: IndexChannel, opts?: { onProgress?: (received: number, total: number | null) => void }): Promise<InstalledPackage>A version from the published index's release channel, its bytes verified against the entry's sha512.
@paramroot
string@paramchannel
IndexChannel@paramopts?
{ onProgress?: (received: number, total: number | null) => void }@returns
Promise<InstalledPackage>remove
remove(root: string, name: string): Promise<void>@paramroot
string@paramname
string@returns
Promise<void>