local-npm-registry
Version:
Manages local npm package installations and updates across your machine.
82 lines • 3.02 kB
TypeScript
import type { Config as VerdaccioConfig } from '@verdaccio/types';
type StrictVerdaccioConfig = VerdaccioConfig & {
storage: string;
};
/**
* Service to manage the local Verdaccio registry.
*/
export declare class VerdaccioService {
private static verdaccioServer;
private static isStarting;
private static _verdaccioConfig;
static get verdaccioConfig(): StrictVerdaccioConfig;
/**
* Starts the Verdaccio registry server.
* This must be called before any npm publish commands can work.
*/
static start(): Promise<void>;
/**
* Stops the Verdaccio registry server.
*/
static stop(): Promise<void>;
/**
* Publishes a package to the local Verdaccio registry.
* Note: Verdaccio must be started first using start() method.
*
* @param packagePath - Path to the package directory containing package.json
* @param additionalPublishArgs - Additional arguments to pass to the npm publish command
*/
static publishPackage(packagePath: string, additionalPublishArgs?: string[]): Promise<void>;
/**
* Unpublishes a package from the local Verdaccio registry.
* This removes the package from the local Verdaccio storage.
*
* @param packageName - The name of the package to unpublish
*/
static unpublishPackage(packageName: string): Promise<void>;
/**
* Starts Verdaccio using the runServer function.
* Verdaccio will automatically stop when the process exits.
*
* @param config - The local npm configuration
*/
private static startVerdaccio;
/**
* Clears a specific published package from the local Verdaccio storage.
* This removes the package from the .verdaccio-db.json file and deletes
* the package folder from the verdaccio directory.
*
* @param packageName - The name of the package to clear from local storage
*/
private static clearPublishedPackagesLocally;
private static loadVerdaccioConfig;
/**
* Creates a basic Verdaccio configuration object.
*
* @param config - The local npm configuration
*/
private static createVerdaccioConfig;
/**
* Parses npmrc configurations to extract organization-specific registries and auth tokens
* for Verdaccio uplinks and packages configuration.
*
* @param npmrcConfigs - Map of npmrc key-value pairs
*/
private static parseNpmrcForVerdaccio;
/**
* Creates a safe uplink name from a registry URL.
*
* @param registryUrl - The registry URL
*/
private static createUplinkName;
/**
* Builds npm publish arguments with direct registry and auth token configuration.
*
* @param packageName - The name of the package being published
* @param registryUrl - The registry URL to publish to
* @param additionalArgs - Additional arguments to pass to the npm publish command
*/
private static buildPublishArgs;
}
export {};
//# sourceMappingURL=VerdaccioService.d.ts.map