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
121 lines (120 loc) • 7.03 kB
TypeScript
import semver from 'semver';
import { BitId, BitIds } from '../bit-id';
import Component from './component';
import { Scope, ComponentWithDependencies } from '../scope';
import BitMap from './bit-map/bit-map';
import DirStructure from './dir-structure/dir-structure';
import { ModelComponent, Version } from '../scope/models';
import CompilerExtension from '../legacy-extensions/compiler-extension';
import TesterExtension from '../legacy-extensions/tester-extension';
import { PathOsBased, PathRelative, PathAbsolute, PathOsBasedAbsolute, PathOsBasedRelative } from '../utils/path';
import { InvalidComponent } from './component/consumer-component';
import { BitIdStr } from '../bit-id/bit-id';
import ComponentLoader from './component/component-loader';
import EnvExtension from '../legacy-extensions/env-extension';
import { AutoTagResult } from '../scope/component-ops/auto-tag';
import { EnvType } from '../legacy-extensions/env-extension-types';
import { WorkspaceConfigProps } from './config/workspace-config';
import { ILegacyWorkspaceConfig } from './config';
import { ComponentStatusLoader, ComponentStatusResult, ComponentStatus } from './component-ops/component-status-loader';
declare type ConsumerProps = {
projectPath: string;
config: ILegacyWorkspaceConfig;
scope: Scope;
created?: boolean;
isolated?: boolean;
bitMap: BitMap;
addedGitHooks?: string[] | undefined;
existingGitHooks: string[] | undefined;
};
export default class Consumer {
projectPath: PathOsBased;
created: boolean;
config: ILegacyWorkspaceConfig;
scope: Scope;
bitMap: BitMap;
isolated: boolean;
addedGitHooks: string[] | undefined;
existingGitHooks: string[] | undefined;
_dirStructure: DirStructure;
_componentsStatusCache: Record<string, any>;
packageManagerArgs: string[];
componentLoader: ComponentLoader;
componentStatusLoader: ComponentStatusLoader;
packageJson: any;
constructor({ projectPath, config, scope, created, isolated, bitMap, addedGitHooks, existingGitHooks }: ConsumerProps);
get compiler(): Promise<CompilerExtension | undefined>;
get tester(): Promise<TesterExtension | undefined>;
get dirStructure(): DirStructure;
get bitmapIds(): BitIds;
getEnv(envType: EnvType, context: Record<string, any> | undefined): Promise<EnvExtension | undefined>;
getTmpFolder(fullPath?: boolean): PathOsBased;
cleanTmpFolder(): Promise<void>;
migrate(verbose: any): Record<string, any>;
write(): Promise<Consumer>;
getPath(): PathOsBased;
toAbsolutePath(pathStr: PathRelative): PathOsBasedAbsolute;
getPathRelativeToConsumer(pathToCheck: PathRelative | PathAbsolute): PathOsBasedRelative;
getParsedId(id: BitIdStr): BitId;
getParsedIdIfExist(id: BitIdStr): BitId | undefined;
loadComponentFromModel(id: BitId): Promise<Component>;
loadComponentFromModelIfExist(id: BitId): Promise<Component | undefined>;
loadAllVersionsOfComponentFromModel(id: BitId): Promise<Component[]>;
loadComponentWithDependenciesFromModel(id: BitId, throwIfNotExist?: boolean): Promise<ComponentWithDependencies>;
loadComponent(id: BitId): Promise<Component>;
loadComponentForCapsule(id: BitId): Promise<Component>;
loadComponents(ids: BitIds, throwOnFailure?: boolean): Promise<{
components: Component[];
invalidComponents: InvalidComponent[];
}>;
importEnvironment(bitId: BitId, verbose: boolean | undefined, dontPrintEnvMsg: boolean): Promise<ComponentWithDependencies[]>;
importComponents(ids: BitIds, withAllVersions: boolean, saveDependenciesAsComponents?: boolean): Promise<ComponentWithDependencies[]>;
shouldDependenciesSavedAsComponents(bitIds: BitId[], saveDependenciesAsComponents?: boolean): Promise<{
id: BitId;
saveDependenciesAsComponents: boolean;
}[]>;
shouldDistsBeInsideTheComponent(): boolean;
potentialComponentsForAutoTagging(modifiedComponents: BitIds): BitIds;
listComponentsForAutoTagging(modifiedComponents: BitIds): Promise<ModelComponent[]>;
isComponentModified(componentFromModel: Version, componentFromFileSystem: Component): Promise<boolean>;
getManyComponentsStatuses(ids: BitId[]): Promise<ComponentStatusResult[]>;
getComponentStatusById(id: BitId): Promise<ComponentStatus>;
tag(ids: BitIds, message: string, exactVersion: string | undefined, releaseType: semver.ReleaseType, force: boolean | undefined, verbose: boolean | undefined, ignoreUnresolvedDependencies: boolean | undefined, ignoreNewestVersion: boolean, skipTests: boolean | undefined, skipAutoTag: boolean): Promise<{
taggedComponents: Component[];
autoTaggedResults: AutoTagResult[];
}>;
_loadComponentsForTag(ids: BitIds): Promise<Component[]>;
updateComponentsVersions(components: Array<ModelComponent | Component>): Promise<any>;
getComponentIdFromNodeModulesPath(requirePath: string, bindingPrefix: string): BitId;
composeRelativeComponentPath(bitId: BitId): string;
composeComponentPath(bitId: BitId): PathOsBasedAbsolute;
composeRelativeDependencyPath(bitId: BitId): PathOsBased;
composeDependencyPath(bitId: BitId): PathOsBased;
static create(projectPath: PathOsBasedAbsolute, noGit?: boolean, workspaceConfigProps?: WorkspaceConfigProps): Promise<Consumer>;
static _getScopePath(projectPath: PathOsBasedAbsolute, noGit: boolean): PathOsBasedAbsolute;
static ensure(projectPath: PathOsBasedAbsolute, standAlone?: boolean, workspaceConfigProps?: WorkspaceConfigProps): Promise<Consumer>;
static reset(projectPath: PathOsBasedAbsolute, resetHard: boolean, noGit?: boolean): Promise<void>;
static createIsolatedWithExistingScope(consumerPath: PathOsBased, scope: Scope): Promise<Consumer>;
static locateProjectScope(projectPath: string): string | undefined;
static load(currentPath: PathOsBasedAbsolute): Promise<Consumer>;
get isLegacy(): boolean;
cleanFromBitMap(componentsToRemoveFromFs: BitIds, removedDependencies: BitIds): Promise<void>;
addRemoteAndLocalVersionsToDependencies(component: Component, loadedFromFileSystem: boolean): Promise<void>;
getAuthoredAndImportedDependentsIdsOf(components: Component[]): Promise<BitIds>;
getAuthoredAndImportedDependentsComponentsOf(components: Component[]): Promise<Component[]>;
ejectConf(componentId: BitId): Promise<import("./component-ops/eject-conf").EjectConfResult>;
injectConf(componentId: BitId, force: boolean): Promise<import("./component-ops/eject-conf").EjectConfResult>;
_getEnvProps(envType: EnvType, context: Record<string, any> | undefined): {
name: string;
consumerPath: string;
scopePath: string;
rawConfig: Record<string, any>;
files: string[];
bitJsonPath: string;
options: import("../legacy-extensions/base-extension").BaseExtensionOptions;
envType: EnvType;
context: Record<string, any> | undefined;
} | undefined;
onDestroy(): Promise<any>;
}
export {};