Skip to content

Commit

Permalink
refactor, move config-merger code from merging aspect to a new teambi…
Browse files Browse the repository at this point in the history
…t.workspace/config-merger aspect (#8402)
  • Loading branch information
davidfirst committed Jan 12, 2024
1 parent bffb865 commit b34d33d
Show file tree
Hide file tree
Showing 12 changed files with 323 additions and 263 deletions.
14 changes: 14 additions & 0 deletions .bitmap
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,20 @@
"mainFile": "index.ts",
"rootDir": "scopes/harmony/config"
},
"config-merger": {
"name": "config-merger",
"scope": "",
"version": "",
"defaultScope": "teambit.workspace",
"mainFile": "index.ts",
"rootDir": "scopes/workspace/config-merger",
"config": {
"teambit.harmony/aspect": {},
"teambit.envs/envs": {
"env": "teambit.harmony/aspect"
}
}
},
"content/cli-reference": {
"name": "content/cli-reference",
"scope": "teambit.harmony",
Expand Down
1 change: 0 additions & 1 deletion scopes/component/merging/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ export type {
FilesStatus,
FailedComponents,
} from './merging.main.runtime';
export { ConfigMergeResult } from './config-merge-result';
export default MergingAspect;
export { MergingAspect };
2 changes: 1 addition & 1 deletion scopes/component/merging/merge-cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
} from '@teambit/legacy/dist/constants';
import { FileStatus, MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';
import { GlobalConfigMain } from '@teambit/global-config';
import { ConfigMergeResult } from '@teambit/config-merger';
import { BitError } from '@teambit/bit-error';
import { ApplyVersionResults, MergingMain, ApplyVersionResult } from './merging.main.runtime';
import { ConfigMergeResult } from './config-merge-result';

export class MergeCmd implements Command {
name = 'merge [ids...]';
Expand Down
4 changes: 2 additions & 2 deletions scopes/component/merging/merge-status-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { compact } from 'lodash';
import threeWayMerge from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';
import { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';
import { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap';
import { ConfigMerger } from './config-merger';
import { ComponentConfigMerger } from '@teambit/config-merger';
import { ComponentMergeStatus, ComponentMergeStatusBeforeMergeAttempt } from './merging.main.runtime';

export type MergeStatusProviderOptions = {
Expand Down Expand Up @@ -118,7 +118,7 @@ other: ${otherLaneHead.toString()}`);
otherLaneName === currentLaneName ? 'incoming' : otherLaneName
})`;
const workspaceIds = await this.workspace.listIds();
const configMerger = new ConfigMerger(
const configMerger = new ComponentConfigMerger(
id.toStringWithoutVersion(),
workspaceIds,
this.otherLane,
Expand Down

0 comments on commit b34d33d

Please sign in to comment.