bit-bin
Version:
<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b
75 lines (74 loc) • 3.22 kB
TypeScript
import { Capsule } from '../extensions/isolator/capsule';
import Consumer from '../consumer/consumer';
import { Scope, ComponentWithDependencies } from '../scope';
import { BitId } from '../bit-id';
import ManyComponentsWriter from '../consumer/component-ops/many-components-writer';
import PackageJsonFile from '../consumer/component/package-json-file';
import BitMap from '../consumer/bit-map';
import { PathOsBased } from '../utils/path';
import { PackageManagerResults } from '../npm-client/npm-client';
export interface IsolateOptions {
writeToPath?: PathOsBased;
override?: boolean;
writePackageJson?: boolean;
writeConfig?: boolean;
writeBitDependencies?: boolean;
createNpmLinkFiles?: boolean;
saveDependenciesAsComponents?: boolean;
writeDists?: boolean;
shouldBuildDependencies?: boolean;
installNpmPackages?: boolean;
keepExistingCapsule?: boolean;
installPeerDependencies?: boolean;
installProdPackagesOnly?: boolean;
verbose?: boolean;
excludeRegistryPrefix?: boolean;
silentPackageManagerResult?: boolean;
applyExtensionsAddedConfig?: boolean;
}
export default class Isolator {
capsule: Capsule;
consumer?: Consumer;
scope: Scope;
capsuleBitMap: BitMap;
capsulePackageJson: PackageJsonFile;
componentWithDependencies: ComponentWithDependencies;
manyComponentsWriter: ManyComponentsWriter;
_npmVersionHasValidated: boolean;
componentRootDir: string;
dir?: string;
constructor(capsule: Capsule, scope: Scope, consumer?: Consumer, dir?: string);
static getInstance(containerType: string | undefined, scope: Scope, consumer?: Consumer, dir?: string): Promise<Isolator>;
isolate(componentId: BitId, opts: IsolateOptions): Promise<ComponentWithDependencies>;
writeComponentsAndDependencies(opts?: {
keepExistingCapsule: boolean;
}): Promise<void>;
installComponentPackages(opts?: {
installNpmPackages: boolean;
keepExistingCapsule: boolean;
}): Promise<void>;
writeLinks(opts?: {
keepExistingCapsule: boolean;
}): Promise<void>;
writeLinksOnNodeModules(): Promise<void>;
_manipulateDir(): void;
_loadComponent(id: BitId): Promise<ComponentWithDependencies>;
_loadComponentFromConsumer(id: BitId): Promise<ComponentWithDependencies>;
_persistComponentsDataToCapsule(opts?: {
keepExistingCapsule: boolean;
}): Promise<void>;
_addComponentsToRoot(opts?: {
keepExistingCapsule: boolean;
}): Promise<void>;
_writeCapsulePackageJson(opts?: {
keepExistingCapsule: boolean;
}): Promise<void>;
_getNpmVersion(): Promise<any>;
installPackagesOnRoot(modules?: string[]): Promise<PackageManagerResults>;
_throwForOldNpmVersion(): Promise<void>;
capsuleExecUsingExeca(pkgManager: string, args: string[], dir?: string): Promise<PackageManagerResults>;
capsuleExec(cmd: string, options?: Record<string, any> | null | undefined): Promise<PackageManagerResults>;
_installWithPeerOption(installPeerDependencies?: boolean): Promise<void>;
_getPeerDependencies(): Promise<Record<string, any>>;
_getNpmListOutput(packageManager: string): Promise<string>;
}