UNPKG

piral-cli

Version:

The standard CLI for creating and building a Piral instance or a Pilet.

65 lines (64 loc) 4.44 kB
import { PackageType, NpmClientType, NpmClient } from '../types'; /** * For details about how this works consult issue * https://github.com/smapiot/piral/issues/203 * @param root The project's root directory. * @param selected The proposed ("selected") npm client. */ export declare function determineNpmClient(root: string, selected?: NpmClientType): Promise<NpmClient>; export declare function isMonorepoPackageRef(refName: string, client: NpmClient): Promise<boolean>; export declare function installNpmDependencies(client: NpmClient, target?: string): Promise<string>; export declare function installNpmPackageFromOptionalRegistry(packageRef: string, target: string, registry: string): Promise<void>; export declare function uninstallNpmPackage(client: NpmClient, packageRef: string, target?: string, ...flags: Array<string>): Promise<string>; export declare function installNpmPackage(client: NpmClient, packageRef: string, target?: string, ...flags: Array<string>): Promise<string>; export declare function initNpmProject(client: NpmClient, projectName: string, target: string): Promise<void>; export declare function publishNpmPackage(target?: string, file?: string, flags?: Array<string>, interactive?: boolean): Promise<string>; export declare function createNpmPackage(target?: string): Promise<string>; export declare function findNpmTarball(packageRef: string): Promise<string>; export declare function findSpecificVersion(packageName: string, version: string): Promise<string>; export declare function findLatestVersion(packageName: string): Promise<string>; export declare function isLocalPackage(baseDir: string, fullName: string): boolean; export declare function isNpmPackage(fullName: string): boolean; export declare function makeNpmAlias(name: string, version: string): string; export declare function isGitPackage(fullName: string): boolean; export declare function isRemotePackage(fullName: string): boolean; export declare function makeGitUrl(fullName: string): string; export declare function makeFilePath(basePath: string, fullName: string): string; /** * Looks at the provided package name and normalizes it * resulting in the following tuple: * [ * normalized / real package name, * found package version / version identifier, * indicator if an explicit version was used, * the used package type * ] * @param baseDir The base directory of the current operation. * @param fullName The provided package name. * @param client The used npm client. */ export declare function dissectPackageName(baseDir: string, fullName: string, client: NpmClient): Promise<[string, string, boolean, PackageType]>; /** * Looks at the current package name / version and * normalizes it resulting in the following tuple: * [ * normalized / real package name, * found package version / version identifier, * ] * @param baseDir The base directory of the current operation. * @param sourceName The used package name. * @param sourceVersion The used package version. * @param desired The desired package version. */ export declare function getCurrentPackageDetails(baseDir: string, sourceName: string, sourceVersion: string, desired: string, root: string): Promise<[string, undefined | string]>; export declare function tryResolvePackage(name: string, baseDir?: string): string; export declare function findPackageRoot(pck: string, baseDir: string): string; export declare function isLinkedPackage(name: string, type: PackageType, hadVersion: boolean, target: string): boolean; export declare function combinePackageRef(name: string, version: string, type: PackageType): string; export declare function getPackageName(root: string, name: string, type: PackageType): Promise<string>; export declare function getFilePackageVersion(sourceName: string, root: string): string; export declare function getGitPackageVersion(sourceName: string): string; export declare function getPackageVersion(hadVersion: boolean, sourceName: string, sourceVersion: string, type: PackageType, root: string): string; export declare function makePiletExternals(root: string, dependencies: Record<string, string>, fromEmulator: boolean, piralInfo: any): Promise<Array<string>>; export declare function mergeExternals(customExternals?: Array<string>, coreExternals?: Array<string>): string[]; export declare function makeExternals(root: string, dependencies: Record<string, string>, externals: Array<string>): Promise<string[]>;