import { Graph } from '@teambit/graph.cleargraph'; import type { IssuesList } from '@teambit/component-issues'; import type { AspectLoaderMain, AspectDefinition } from '@teambit/aspect-loader'; import type { ComponentMain, Component, ComponentFactory, InvalidComponent, ResolveAspectsOptions, AspectList } from '@teambit/component'; import type { ComponentScopeDirMap, WorkspaceConfig } from '@teambit/config'; import type { CurrentPkg, DependencyResolverMain, DependencyList, VariantPolicyConfigObject, VariantPolicyConfigArr } from '@teambit/dependency-resolver'; import type { EnvsMain, EnvJsonc } from '@teambit/envs'; import type { GraphqlMain } from '@teambit/graphql'; import type { Harmony } from '@teambit/harmony'; import type { Logger } from '@teambit/logger'; import type { ScopeMain } from '@teambit/scope'; import type { VariantsMain } from '@teambit/variants'; import { ComponentID, ComponentIdList } from '@teambit/component-id'; import { BitId } from '@teambit/legacy-bit-id'; import type { LaneId } from '@teambit/lane-id'; import type { Consumer } from '@teambit/legacy.consumer'; import type { GetBitMapComponentOptions } from '@teambit/legacy.bit-map'; import { ComponentsList } from '@teambit/legacy.component-list'; import { ExtensionDataList } from '@teambit/legacy.extension-data'; import type { PathOsBased, PathOsBasedRelative, PathOsBasedAbsolute } from '@teambit/toolbox.path.path'; import type { CompIdGraph, DepEdgeType } from '@teambit/graph'; import type { Dependency as LegacyDependency } from '@teambit/legacy.consumer-component'; import { ConsumerComponent } from '@teambit/legacy.consumer-component'; import type { WatchOptions } from '@teambit/watcher'; import type { ComponentLog, Lane } from '@teambit/objects'; import type { JsonVinyl } from '@teambit/component.sources'; import { SourceFile } from '@teambit/component.sources'; import type { GlobalConfigMain } from '@teambit/global-config'; import { ComponentConfigFile } from './component-config-file'; import type { OnComponentAdd, OnComponentChange, OnComponentEventResult, OnComponentLoad, OnComponentRemove } from './on-component-events'; import type { WorkspaceExtConfig } from './types'; import { ComponentStatus } from './workspace-component/component-status'; import type { OnAspectsResolve, OnAspectsResolveSlot, OnBitmapChange, OnBitmapChangeSlot, OnWorkspaceConfigChange, OnWorkspaceConfigChangeSlot, OnComponentAddSlot, OnComponentChangeSlot, OnComponentLoadSlot, OnComponentRemoveSlot, OnRootAspectAdded, OnRootAspectAddedSlot } from './workspace.main.runtime'; import type { ComponentLoadOptions } from './workspace-component/workspace-component-loader'; import { WorkspaceComponentLoader } from './workspace-component/workspace-component-loader'; import type { ShouldLoadFunc } from './build-graph-from-fs'; import { BitMap } from './bit-map'; import type { MergeOptions as BitmapMergeOptions } from './bit-map'; import type { AspectPackage, GetConfiguredUserAspectsPackagesOptions, WorkspaceLoadAspectsOptions } from './workspace-aspects-loader'; import { WorkspaceAspectsLoader } from './workspace-aspects-loader'; import type { MergeConflictFile } from './merge-conflict-file'; import { CompFiles } from './workspace-component/comp-files'; import { Filter } from './filter'; import type { ComponentStatusLegacy, ComponentStatusResult } from './workspace-component/component-status-loader'; import type { ConfigStoreMain, Store } from '@teambit/config-store'; import type { DependenciesOverridesData } from '@teambit/legacy.consumer-config'; export type EjectConfResult = { configPath: string; }; export type ClearCacheOptions = { skipClearFailedToLoadEnvs?: boolean; }; /** * Field used to mark aspect config as "specific" (set via .bitmap or component.json). * When __specific is true, this config takes precedence over workspace variants during merging. * See https://github.com/teambit/bit/pull/5342 for original implementation. * * Important behavior for dependency-resolver aspect: * - Dependencies set via workspace variants are saved WITHOUT __specific (until first `bit deps set`) * - Once `bit deps set` is called, the entire dependency-resolver config gets __specific: true * - From that point forward, ALL deps in that aspect are considered "specific" */ export declare const AspectSpecificField = "__specific"; export declare const ComponentAdded = "componentAdded"; export declare const ComponentChanged = "componentChanged"; export declare const ComponentRemoved = "componentRemoved"; export interface EjectConfOptions { propagate?: boolean; override?: boolean; } export type ComponentExtensionsOpts = { loadExtensions?: boolean; }; type ComponentExtensionsResponse = { extensions: ExtensionDataList; beforeMerge: Array<{ extensions: ExtensionDataList; origin: ExtensionsOrigin; extraData: any; }>; errors?: Error[]; envId?: string; }; export type ExtensionsOrigin = 'BitmapFile' | 'ModelSpecific' | 'ModelNonSpecific' | 'ConfigMerge' | 'WorkspaceVariants' | 'ComponentJsonFile' | 'FinalAfterMerge'; /** * API of the Bit Workspace */ export declare class Workspace implements ComponentFactory { private config; /** * private access to the legacy consumer instance. */ consumer: Consumer; /** * access to the workspace `Scope` instance */ readonly scope: ScopeMain; /** * access to the `ComponentProvider` instance */ private componentAspect; private dependencyResolver; readonly variants: VariantsMain; private aspectLoader; readonly logger: Logger; /** * private reference to the instance of Harmony. */ private harmony; /** * on component load slot. */ onComponentLoadSlot: OnComponentLoadSlot; /** * on component change slot. */ private onComponentChangeSlot; readonly envs: EnvsMain; readonly globalConfig: GlobalConfigMain; /** * on component add slot. */ private onComponentAddSlot; private onComponentRemoveSlot; private onAspectsResolveSlot; private onRootAspectAddedSlot; private graphql; private onBitmapChangeSlot; private onWorkspaceConfigChangeSlot; private configStore; private warnedAboutMisconfiguredEnvs; priority: boolean; owner?: string; componentsScopeDirsMap: ComponentScopeDirMap; componentLoader: WorkspaceComponentLoader; private componentStatusLoader; bitMap: BitMap; /** * Indicate that we are now running installation process * This is important to know to ignore missing modules across different places */ inInstallContext: boolean; /** * Indicate that we done with the package manager installation process * This is important to skip stuff when package manager install is not done yet */ inInstallAfterPmContext: boolean; private componentLoadedSelfAsAspects; private aspectsMerger; /** * Components paths are calculated from the component package names of the workspace * They are used in webpack configuration to only track changes from these paths inside `node_modules` */ private componentPathsRegExps; private _componentList; localAspects: Record; filter: Filter; constructor(config: WorkspaceExtConfig, /** * private access to the legacy consumer instance. */ consumer: Consumer, /** * access to the workspace `Scope` instance */ scope: ScopeMain, /** * access to the `ComponentProvider` instance */ componentAspect: ComponentMain, dependencyResolver: DependencyResolverMain, variants: VariantsMain, aspectLoader: AspectLoaderMain, logger: Logger, /** * private reference to the instance of Harmony. */ harmony: Harmony, /** * on component load slot. */ onComponentLoadSlot: OnComponentLoadSlot, /** * on component change slot. */ onComponentChangeSlot: OnComponentChangeSlot, envs: EnvsMain, globalConfig: GlobalConfigMain, /** * on component add slot. */ onComponentAddSlot: OnComponentAddSlot, onComponentRemoveSlot: OnComponentRemoveSlot, onAspectsResolveSlot: OnAspectsResolveSlot, onRootAspectAddedSlot: OnRootAspectAddedSlot, graphql: GraphqlMain, onBitmapChangeSlot: OnBitmapChangeSlot, onWorkspaceConfigChangeSlot: OnWorkspaceConfigChangeSlot, configStore: ConfigStoreMain); private validateConfig; get componentList(): ComponentsList; /** * root path of the Workspace. */ get path(): string; /** * Get the location of the bit roots folder */ get rootComponentsPath(): string; /** get the `node_modules` folder of this workspace */ private get modulesPath(); get isLegacy(): boolean; registerOnComponentLoad(loadFn: OnComponentLoad): this; registerOnComponentChange(onComponentChangeFunc: OnComponentChange): this; registerOnComponentAdd(onComponentAddFunc: OnComponentAdd): this; registerOnComponentRemove(onComponentRemoveFunc: OnComponentRemove): this; registerOnBitmapChange(OnBitmapChangeFunc: OnBitmapChange): this; registerOnWorkspaceConfigChange(onWorkspaceConfigChangeFunc: OnWorkspaceConfigChange): void; registerOnAspectsResolve(onAspectsResolveFunc: OnAspectsResolve): this; registerOnRootAspectAdded(onRootAspectAddedFunc: OnRootAspectAdded): this; /** * name of the workspace as configured in either `workspace.json`. * defaults to workspace root directory name. */ get name(): string; get icon(): string; getConfigStore(): Store; getAutoTagInfo(changedComponents: ComponentIdList): Promise; listAutoTagPendingComponentIds(): Promise; hasModifiedDependencies(component: Component): Promise; /** * get Component issues */ getComponentIssues(component: Component): IssuesList | null; /** * provides status of all components in the workspace. */ getComponentStatus(component: Component): Promise; /** * list all workspace components. */ list(filter?: { offset: number; limit: number; }, loadOpts?: ComponentLoadOptions): Promise; listWithInvalid(loadOpts?: ComponentLoadOptions): Promise<{ components: Component[]; invalidComponents: InvalidComponent[]; }>; /** * list all invalid components. * (see the invalid criteria in ConsumerComponent.isComponentInvalidByErrorType()) */ listInvalid(): Promise; /** * get ids of all workspace components. * deleted components are filtered out. (use this.listIdsIncludeRemoved() if you need them) */ listIds(): ComponentIdList; listIdsIncludeRemoved(): ComponentIdList; /** * whether the given component-id is part of the workspace. default to check for the exact version */ hasId(componentId: ComponentID, opts?: { includeDeleted?: boolean; ignoreVersion?: boolean; }): boolean; /** * given component-ids, return the ones that are part of the workspace */ filterIds(ids: ComponentID[]): Promise; /** * whether or not a workspace has a component with the given name */ hasName(name: string): Promise; /** * Check if a specific id exist in the workspace or in the scope * @param componentId */ hasIdNested(componentId: ComponentID, includeCache?: boolean): Promise; /** * list all modified components in the workspace. */ modified(loadOpts?: ComponentLoadOptions): Promise; /** * list all new components in the workspace. */ newComponents(): Promise; newComponentIds(): Promise; locallyDeletedIds(): Promise; duringMergeIds(): Promise; /** * @deprecated use `listIds()` instead. * get all workspace component-ids */ getAllComponentIds(): ComponentID[]; listTagPendingIds(): Promise; /** * list all components that can be tagged. (e.g. when tagging/snapping with --unmodified). * which are all components in the workspace, include locally deleted components. */ listPotentialTagIds(): Promise; getNewAndModifiedIds(): Promise; newAndModified(): Promise; getLogs(id: ComponentID, shortHash?: boolean, startsFrom?: string): Promise; getGraph(ids?: ComponentID[], shouldThrowOnMissingDep?: boolean): Promise>; getGraphIds(ids?: ComponentID[], shouldThrowOnMissingDep?: boolean): Promise; getUnavailableOnMainComponents(): Promise; getDependencies(component: Component): DependencyList; getSavedGraphOfComponentIfExist(component: Component): Promise | null>; /** * given component ids, find their dependents in the workspace */ getDependentsIds(ids: ComponentID[], filterOutNowWorkspaceIds?: boolean): Promise; createAspectList(extensionDataList: ExtensionDataList): Promise; private extensionDataEntryToAspectEntry; /** * this is not the complete legacy component (ConsumerComponent), it's missing dependencies and hooks from Harmony * are skipped. do not trust the data you get from this method unless you know what you're doing. */ getLegacyMinimal(id: ComponentID): Promise; getFilesModification(id: ComponentID): Promise; /** * get a component from workspace * @param id component ID */ get(componentId: ComponentID, legacyComponent?: ConsumerComponent, useCache?: boolean, storeInCache?: boolean, loadOpts?: ComponentLoadOptions): Promise; getConfiguredUserAspectsPackages(options: GetConfiguredUserAspectsPackagesOptions): Promise; /** * clears workspace, scope and all components caches. * doesn't clear the dependencies-data from the filesystem-cache. */ clearCache(options?: ClearCacheOptions): Promise; /** * clear the cache of all components in the workspace. * doesn't clear the dependencies-data from the filesystem-cache. */ clearAllComponentsCache(): void; clearComponentCache(id: ComponentID): void; clearComponentsCache(ids: ComponentID[]): void; warmCache(): Promise; getWorkspaceConfig(): WorkspaceConfig; cleanFromConfig(ids: ComponentID[]): Promise; /** * when tagging/snapping a component, its config data is written to the staged config. it helps for "bit reset" to * revert it back. * this method removes entries from that files. used by "bit export" and "bit remove". * in case the component is not found in the staged config, it doesn't throw an error. it simply ignores it. */ removeFromStagedConfig(ids: ComponentID[]): Promise; triggerOnComponentChange(id: ComponentID, files: PathOsBasedAbsolute[], removedFiles: PathOsBasedAbsolute[], watchOpts: WatchOptions): Promise; triggerOnComponentAdd(id: ComponentID, watchOpts: WatchOptions, loadOptions?: ComponentLoadOptions): Promise; triggerOnComponentRemove(id: ComponentID): Promise; triggerOnBitmapChange(): Promise; /** * the purpose is mostly to reload the workspace config when it changes, so entries like "defaultScope" are updated. * it also updates the DependencyResolver config. I couldn't find a good way to update all aspects in workspace.jsonc. */ triggerOnWorkspaceConfigChange(): Promise; getState(id: ComponentID, hash: string): Promise; getSnap(id: ComponentID, hash: string): Promise; getCurrentLaneId(): LaneId; getCurrentLaneObject(): Promise; isOnMain(): boolean; isOnLane(): boolean; /** * if checked out to a lane and the lane exists in the remote, * return the remote lane. otherwise, return null. */ getCurrentRemoteLane(): Promise; getDefaultExtensions(): ExtensionDataList; getComponentConfigVinylFile(id: ComponentID, options: EjectConfOptions, excludeLocalChanges?: boolean): Promise; private removeEnvVersionIfExistsLocally; ejectMultipleConfigs(ids: ComponentID[], options: EjectConfOptions): Promise; getAspectConfigForComponent(id: ComponentID, aspectId: string): Promise; getExtensionsFromScopeAndSpecific(id: ComponentID, excludeComponentJson?: boolean): Promise; /** * @deprecated use `this.idsByPattern` instead for consistency. also, it supports negation and list of patterns. * * load components into the workspace through a variants pattern. * @param pattern variants. * @param scope scope name. */ byPattern(pattern: string, scope?: string): Promise; hasPattern(strArr: string[]): boolean; isPattern(str: string): boolean; /** * get component-ids matching the given pattern. a pattern can have multiple patterns separated by a comma. * it supports negate (!) character to exclude ids. */ idsByPattern(pattern: string, throwForNoMatch?: boolean, opts?: { includeDeleted?: boolean; }): Promise; filterIdsFromPoolIdsByPattern(pattern: string, ids: ComponentID[], throwForNoMatch?: boolean): Promise; /** * useful for workspace commands, such as `bit build`, `bit compile`. * by default, it should be running on new and modified components. * a user can specify `--all` to run on all components or specify a pattern to limit to specific components. * some commands such as build/test needs to run also on the dependents. */ getComponentsByUserInput(all?: boolean, pattern?: string, includeDependents?: boolean): Promise; getComponentsUsingEnv(env: string, ignoreVersion?: boolean, throwIfNotFound?: boolean): Promise; getMany(ids: Array, loadOpts?: ComponentLoadOptions, throwOnFailure?: boolean): Promise; getManyByLegacy(components: ConsumerComponent[], loadOpts?: ComponentLoadOptions): Promise; /** * don't throw an error if the component was not found, simply return undefined. */ getIfExist(componentId: ComponentID): Promise; /** * @deprecated use `hasId` with "ignoreVersion: true" instead. */ exists(componentId: ComponentID, opts?: { includeDeleted?: boolean; }): boolean; getIdIfExist(componentId: ComponentID): ComponentID | undefined; mergeBitmaps(bitmapContent: string, otherBitmapContent: string, opts?: BitmapMergeOptions): string; /** * This will make sure to fetch the objects prior to load them * do not use it if you are not sure you need it. * It will influence the performance * currently it used only for get many of aspects * @param ids */ importAndGetMany(ids: Array, reason?: string, loadOpts?: ComponentLoadOptions, throwOnError?: boolean): Promise; /** * This is happening when the user is running "git pull", which updates ".bitmap" file, but the local scope objects * are not updated yet ("bit import" is not run yet). * Although it might happen on a lane. This is rare. Because using git with bit normally means that locally you don't have * any lane. The CI is the one that creates the lanes. * The following conditions are checked: * 1. we're on main. * 2. git is enabled. * 3. components on .bitmap has tags that are not in the local scope. * * It is designed to be performant. On mac M1 with 337 components, it takes around 100ms. * * @returns array of component IDs that have tags in .bitmap but not in local scope, or empty array if not outdated */ private getOutdatedIdsAgainstGit; /** * This is relevant when the user is running "git pull", which updates ".bitmap" file, but the local scope objects * are not updated yet ("bit import" is not run yet). In case it found outdated components, it imports them. * * Important: this is only for main (not lanes) and only when using git and only for tags, not snaps. * see `getOutdatedIdsAgainstGit` for more info. */ importObjectsIfOutdatedAgainstBitmap(): Promise; /** * This is pretty much the same as `importer.importCurrentObjects`. * The reason for the duplication is that many aspects can't depend on the `importer` aspect, due to circular dependencies. * The importer aspect is reacher in a way that it shows the results of what was imported by comparing the before and after. */ importCurrentObjects(compIds?: ComponentID[]): Promise; importCurrentLaneIfMissing(): Promise; /** * When `bitmapAutoSync` is enabled in workspace.jsonc, reconcile `.bitmap` with the * latest scope HEAD versions on the first Bit command after `git pull`. The sentinel * file at `.bit/last-pull-sync` makes subsequent commands at the same git HEAD a no-op. * * On a failed remote-scope fetch the sentinel is NOT advanced, so the next command * retries. */ reconcileBitmapWithScopeIfNeeded(): Promise; /** * Resolve the current git HEAD. Tries a direct read of `.git/HEAD` (+ the loose ref * file it points at) for the common case to avoid forking a process. Falls back to * `git rev-parse HEAD` for packed-refs, git worktrees / submodules (where `.git` is * a file pointing at the real gitdir, not a directory), and any other layout. Returns * null when HEAD can't be resolved at all — the caller treats that as "skip auto-sync." */ private readCurrentGitHead; use(aspectIdStr: string): Promise; unuse(aspectIdStr: string): Promise; write(component: Component, rootPath?: string): Promise; /** * @todo: the return path here is Linux when asking for relative and os-based when asking for absolute. fix this to be consistent. * * Get the component root dir in the file system (relative to workspace or full) * @param componentId * @param relative return the path relative to the workspace or full path */ componentDir(componentId: ComponentID, bitMapOptions?: GetBitMapComponentOptions, options?: { relative: boolean; }): PathOsBased; /** * component's files in the workspace are symlinked to the node_modules, and a package.json file is generated on that * package directory to simulate a valid node package. * @returns the package directory inside the node_module. * by default the absolute path, unless `options.relative` was set */ componentPackageDir(component: Component, options?: { relative: boolean; }): string; componentPackageName(component: Component): string; private componentDirFromLegacyId; componentDirToAbsolute(relativeComponentDir: PathOsBasedRelative): PathOsBasedAbsolute; /** * @deprecated long long ago we added it to the componentId object. use `componentId.scope` instead. */ componentDefaultScope(componentId: ComponentID): Promise; componentDefaultScopeFromComponentDirAndName(relativeComponentDir: PathOsBasedRelative, name: string): Promise; get defaultScope(): string; private componentDefaultScopeFromComponentDirAndNameWithoutConfigFile; /** * Calculate the component config based on: * the config property in the .bitmap file * the component.json file in the component folder * matching pattern in the variants config * defaults extensions from workspace config * extensions from the model. */ componentExtensions(componentId: ComponentID, componentFromScope?: Component, excludeOrigins?: ExtensionsOrigin[], opts?: ComponentExtensionsOpts): Promise; warnAboutMisconfiguredEnv(envId: string): Promise; getConfigMergeFilePath(): string; getConflictMergeFile(): MergeConflictFile; getDepsDataOfMergeConfig(id: ComponentID): VariantPolicyConfigArr; /** * @deprecated * the workspace.jsonc conflicts are not written to the config-merge file anymore. * see https://github.com/teambit/bit/pull/8393 for more details. */ getWorkspaceJsonConflictFromMergeConfig(): { data?: Record; conflict: boolean; }; getWorkspaceIssues(): Error[]; listComponentsDuringMerge(): Promise; getUnmergedComponent(componentId: ComponentID): Promise; isModified(component: Component): Promise; isModifiedOrNew(component: Component): Promise; isExported(id: ComponentID): boolean; getExportedFrom(ids: ComponentID[]): ComponentID[]; /** * filter the given component-ids and set default-scope only to the new ones. * returns the affected components. */ setDefaultScopeToComponents(componentIds: ComponentID[], scopeName: string): Promise; /** * @param scopeName * @param includeComponents whether to update new components in the workspace to use the new default-scope * this is relevant only for new components that were using the previous default-scope */ setDefaultScope(scopeName: string, includeComponents?: boolean): Promise; addSpecificComponentConfig(id: ComponentID, aspectId: string, config?: Record, { shouldMergeWithExisting, shouldMergeWithPrevious, }?: { shouldMergeWithExisting?: boolean; /** * relevant only when writing to .bitmap. * eject config of the given aspect-id, so then it won't override previous config. (see "adding prod dep, tagging then adding devDep" e2e-test) */ shouldMergeWithPrevious?: boolean; }): Promise; removeSpecificComponentConfig(id: ComponentID, aspectId: string, markWithMinusIfNotExist?: boolean): Promise; getAspectIdFromConfig(componentId: ComponentID, aspectIdStr: string, ignoreAspectVersion?: boolean): Promise; getSpecificComponentConfig(id: ComponentID, aspectId: string): Promise; private isVendorComponentByComponentDir; /** * return the component config from its folder (component.json) * @param componentId */ componentConfigFile(id: ComponentID): Promise; /** * @param componentPath can be relative or absolute. supports Linux and Windows */ getComponentIdByPath(componentPath: PathOsBased): Promise; private resolveIdFromRootDir; private componentConfigFileFromComponentDirAndName; /** * load aspects from the workspace and if not exists in the workspace, load from the scope. * keep in mind that the graph may have circles. */ loadAspects(ids?: string[], throwOnError?: boolean, neededFor?: string, opts?: WorkspaceLoadAspectsOptions): Promise; loadComponentsExtensions(extensions: ExtensionDataList, originatedFrom?: ComponentID, opts?: WorkspaceLoadAspectsOptions): Promise; /** * returns one graph that includes all dependencies types. each edge has a label of the dependency * type. the nodes content is the Component object. */ buildOneGraphForComponents(ids: ComponentID[], ignoreIds?: string[], shouldLoadFunc?: ShouldLoadFunc, shouldThrowOnMissingDep?: boolean): Promise>; resolveAspects(runtimeName?: string, componentIds?: ComponentID[], opts?: ResolveAspectsOptions): Promise; /** * Provides a cache folder, unique per key. * Return value may be undefined, if workspace folder is unconventional (bare-scope, no node_modules, etc) */ getTempDir(id: string): string; getWorkspaceAspectsLoader(): WorkspaceAspectsLoader; getCapsulePath(): string; shouldUseHashForCapsules(): boolean; /** } /** * this should be rarely in-use. * it's currently used by watch extension as a quick workaround to load .bitmap and the components */ _reloadConsumer(): Promise; getComponentPackagePath(component: Component): string; get defaultDirectory(): string; get legacyDefaultDirectory(): string; resolveComponentIdFromPackageName(packageName: string, keepOriginalVersion?: boolean): Promise; private resolveComponentIdFromWsComponents; private resolveComponentIdFromRegistryManifest; private resolveComponentIdFromPackageJsonInNM; /** * Transform the id to ComponentId and get the exact id as appear in bitmap */ resolveComponentId(id: string | BitId | ComponentID): Promise; resolveMultipleComponentIds(ids: Array): Promise; /** * component-id coming from Scope don't have the defaultScope, the legacyComponentId.scope is always populated. * in the .bitmap we need to distinguish between the two, so the componentId needs to be corrected with the defaultScope. */ resolveIdWithDefaultScope(componentId: ComponentID): ComponentID; /** * This will mutate the original extensions list and resolve it's ids * * @param {ExtensionDataList} extensions * @returns {Promise} * @memberof Workspace */ resolveExtensionsList(extensions: ExtensionDataList): Promise; /** * configure an environment to the given components in the .bitmap file, this configuration overrides other, such as * overrides in workspace.jsonc. */ setEnvToComponents(envId: ComponentID, componentIds: ComponentID[], verifyEnv?: boolean): Promise; /** * helpful when a user provides an env-string to be set and this env has no version. * in the workspace config, a custom-env needs to be set with a version unless it's part of the workspace. * (inside envs/envs it's set without a version). */ resolveEnvIdWithPotentialVersionForConfig(envId: ComponentID): Promise; resolveEnvManifest(envId: string, envExtendsDeps?: LegacyDependency[]): Promise; /** * remove env configuration from the .bitmap file, so then other configuration, such as "variants" will take place */ unsetEnvFromComponents(ids: ComponentID[]): Promise<{ changed: ComponentID[]; unchanged: ComponentID[]; }>; updateEnvForComponents(envIdStr?: string, pattern?: string): Promise<{ updated: { [envId: string]: ComponentID[]; }; alreadyUpToDate: ComponentID[]; }>; getComponentPathsRegExps(): RegExp[]; setComponentPathsRegExps(): Promise; getInjectedDirs(component: Component): Promise; /** * the dependencies returned from this method will override the auto-detected dependencies. (done by "applyAutoDetectOverridesOnComponent") * to calculate this, we merge several sources: env, env-for-itself, config from variant, and the merge-config. * keep in mind that component-config (coming from .bitmap or component.json) is not included in this merge. */ getAutoDetectOverrides(configuredExtensions: ExtensionDataList, id: ComponentID, legacyFiles: SourceFile[], envExtendedDeps?: LegacyDependency[]): Promise; getAutoDetectConfigMerge(id: ComponentID): DependenciesOverridesData | undefined; getManyComponentsStatuses(ids: ComponentID[]): Promise; getComponentStatusById(id: ComponentID): Promise; setLocalOnly(ids: ComponentID[]): Promise; unsetLocalOnly(ids: ComponentID[]): Promise; listLocalOnly(): ComponentIdList; writeDependencies(target?: 'workspace.jsonc' | 'package.json'): Promise; writeDependenciesToWorkspaceJsonc(): Promise; externalPackageManagerIsUsed(): boolean; writeDependenciesToPackageJson(dependencies?: Record): Promise; getAllDedupedDirectDependencies(): Promise; variantPatternsToDepPolicesDict(): Record; getComponentsWithDependencyPolicies(): Promise>; } export default Workspace;