Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make the teambit.scope/objects component a core-aspect #9441

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .bitmap
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,13 @@
"scope": "teambit.scope",
"version": "0.0.15",
"mainFile": "index.ts",
"rootDir": "scopes/scope/objects"
"rootDir": "scopes/scope/objects",
"config": {
"teambit.harmony/envs/core-aspect-env@0.0.65": {},
"teambit.envs/envs": {
"env": "teambit.harmony/envs/core-aspect-env"
}
}
},
"overview/api-reference-table-of-contents": {
"name": "overview/api-reference-table-of-contents",
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/component-list/components-list.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import { ComponentID, ComponentIdList } from '@teambit/component-id';
import { ModelComponent } from '@teambit/scope.objects';
import { ModelComponent } from '@teambit/objects';
import { ComponentsList } from './components-list';

describe('ComponentList', function () {
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/component-list/components-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import pFilter from 'p-filter';
import { ComponentID, ComponentIdList } from '@teambit/component-id';
import R from 'ramda';
import { LATEST } from '@teambit/legacy.constants';
import { ModelComponent, Lane } from '@teambit/scope.objects';
import { ModelComponent, Lane } from '@teambit/objects';
import { Scope } from '@teambit/legacy.scope';
import { fetchRemoteVersions } from '@teambit/scope.remotes';
import { isBitIdMatchByWildcards } from '@teambit/legacy.utils';
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/consumer-component/component-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ComponentIssue } from '@teambit/component-issues';
import { getMaxSizeForComponents, InMemoryCache, createInMemoryCache } from '@teambit/harmony.modules.in-memory-cache';
import { BIT_MAP } from '@teambit/legacy.constants';
import { logger } from '@teambit/legacy.logger';
import { ModelComponent, VERSION_ZERO } from '@teambit/scope.objects';
import { ModelComponent, VERSION_ZERO } from '@teambit/objects';
import { getLatestVersionNumber } from '@teambit/legacy.utils';
import { pMapPool } from '@teambit/toolbox.promise.map-pool';
import { getLastModifiedPathsTimestampMs } from '@teambit/toolbox.fs.last-modified';
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/consumer-component/consumer-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from '@teambit/legacy.constants';
import { Doclet, parser as docsParser } from '@teambit/semantics.doc-parser';
import { logger } from '@teambit/legacy.logger';
import { Version, DepEdge, Log, ScopeListItem, DependenciesGraph, ModelComponent } from '@teambit/scope.objects';
import { Version, DepEdge, Log, ScopeListItem, DependenciesGraph, ModelComponent } from '@teambit/objects';
import { pathNormalizeToLinux, PathLinux, PathOsBased, PathOsBasedRelative } from '@teambit/toolbox.path.path';
import { sha1 } from '@teambit/toolbox.crypto.sha1';
import { ComponentMap } from '@teambit/legacy.bit-map';
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/consumer/consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '@teambit/legacy.constants';
import { logger } from '@teambit/legacy.logger';
import { NoHeadNoVersion, Scope, ComponentNotFound, ScopeNotFound } from '@teambit/legacy.scope';
import { Lane, ModelComponent, Version } from '@teambit/scope.objects';
import { Lane, ModelComponent, Version } from '@teambit/objects';
// import { generateRandomStr } from '@teambit/toolbox.string.random';
import { sortObjectByKeys } from '@teambit/toolbox.object.sorter';
import format from 'string-format';
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/dependency-graph/scope-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ConsumerComponent as Component, DEPENDENCIES_TYPES_UI_MAP } from '@team
import { getLatestVersionNumber } from '@teambit/legacy.utils';
import { getAllVersionsInfo } from '@teambit/component.snap-distance';
import { Scope, IdNotFoundInGraph } from '@teambit/legacy.scope';
import { ModelComponent, Version } from '@teambit/scope.objects';
import { ModelComponent, Version } from '@teambit/objects';
import { Workspace } from '@teambit/workspace';

export type DependenciesInfo = {
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/scope-api/lib/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { LaneId } from '@teambit/lane-id';
import { LATEST_BIT_VERSION } from '@teambit/legacy.constants';
import { logger } from '@teambit/legacy.logger';
import { loadScope, Scope } from '@teambit/legacy.scope';
import { Lane, LaneHistory, Ref, ComponentWithCollectOptions, ObjectsReadableGenerator } from '@teambit/scope.objects';
import { Lane, LaneHistory, Ref, ComponentWithCollectOptions, ObjectsReadableGenerator } from '@teambit/objects';
import { LaneNotFound } from './exceptions/lane-not-found';

/**
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/scope-api/lib/put.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentIdList } from '@teambit/component-id';
import { loadScope } from '@teambit/legacy.scope';
import { exportManyBareScope } from '@teambit/export';
import { ObjectList } from '@teambit/scope.objects';
import { ObjectList } from '@teambit/objects';

export type ComponentObjectsInput = {
path: string;
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/scope/component-objects.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { toBase64ArrayBuffer } from '@teambit/legacy.utils';
import { ModelComponent, BitObject } from '@teambit/scope.objects';
import { ModelComponent, BitObject } from '@teambit/objects';

export class ComponentObjects {
component: Buffer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'chai';
import { MergeConflict } from '../exceptions';
import ComponentNeedsUpdate from '../exceptions/component-needs-update';
import { ModelComponent as Component } from '@teambit/scope.objects';
import { ModelComponent as Component } from '@teambit/objects';
import { ModelComponentMerger } from './model-components-merger';

describe('ModelComponentMerger', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { logger } from '@teambit/legacy.logger';
import { MergeConflict } from '../exceptions';
import ComponentNeedsUpdate from '../exceptions/component-needs-update';
import { ModelComponent } from '@teambit/scope.objects';
import { ModelComponent } from '@teambit/objects';

/**
* the base component to save is the existingComponent because it might contain local data that
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { pMapPool } from '@teambit/toolbox.promise.map-pool';
import { concurrentComponentsLimit } from '@teambit/harmony.modules.concurrency';
import { ModelComponent } from '@teambit/scope.objects';
import { ModelComponent } from '@teambit/objects';
import { SourceRepository } from '../repositories';
import { ModelComponentMerger } from './model-components-merger';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ComponentID, ComponentIdList } from '@teambit/component-id';
import { LATEST_BIT_VERSION } from '@teambit/legacy.constants';
import { Consumer } from '@teambit/legacy.consumer';
import { logger } from '@teambit/legacy.logger';
import { Ref, Lane } from '@teambit/scope.objects';
import { Ref, Lane } from '@teambit/objects';
import { RemovedObjects } from '../removed-components';
import Scope from '../scope';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
ObjectList,
Ref,
Repository,
} from '@teambit/scope.objects';
} from '@teambit/objects';
import SourcesRepository, { ComponentDef } from '../repositories/sources';
import { Remotes, getScopeRemotes } from '@teambit/scope.remotes';
import { VersionDependencies } from '../version-dependencies';
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/scope/component-version.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentID, ComponentIdList } from '@teambit/component-id';
import { ConsumerComponent } from '@teambit/legacy.consumer-component';
import { Repository, Version, ModelComponent } from '@teambit/scope.objects';
import { Repository, Version, ModelComponent } from '@teambit/objects';

export class ComponentVersion {
readonly component: ModelComponent;
Expand Down
11 changes: 1 addition & 10 deletions components/legacy/scope/garbage-collector.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import pMap from 'p-map';
import { logger } from '@teambit/legacy.logger';
import {
Ref,
Lane,
LaneHistory,
ModelComponent,
ScopeMeta,
Source,
Version,
VersionHistory,
} from '@teambit/scope.objects';
import { Ref, Lane, LaneHistory, ModelComponent, ScopeMeta, Source, Version, VersionHistory } from '@teambit/objects';
import Scope, { GarbageCollectorOpts } from './scope';
import { getAllVersionsInfo } from '@teambit/component.snap-distance';
import pMapSeries from 'p-map-series';
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/scope/lanes/lanes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
Lane,
LaneHistory,
Version,
} from '@teambit/scope.objects';
} from '@teambit/objects';
import { ScopeJson, TrackLane } from '../scope-json';

export default class Lanes {
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/scope/lanes/remote-lanes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { compact, set } from 'lodash';
import { Mutex } from 'async-mutex';
import { PREVIOUS_DEFAULT_LANE, REMOTE_REFS_DIR } from '@teambit/legacy.constants';
import { glob } from '@teambit/legacy.utils';
import { Ref, LaneComponent, Lane, ModelComponent } from '@teambit/scope.objects';
import { Ref, LaneComponent, Lane, ModelComponent } from '@teambit/objects';
import { logger } from '@teambit/legacy.logger';

type Lanes = { [laneName: string]: LaneComponent[] };
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/scope/lanes/unmerged-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { compact } from 'lodash';
import path from 'path';
import R from 'ramda';
import { ComponentID } from '@teambit/component-id';
import { Ref } from '@teambit/scope.objects';
import { Ref } from '@teambit/objects';

export type UnmergedComponent = {
id: {
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/scope/object-registrar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
ExportMetadata,
VersionHistory,
LaneHistory,
} from '@teambit/scope.objects';
} from '@teambit/objects';

export default function types() {
return [Source, ModelComponent, Version, ScopeMeta, Symlink, Lane, ExportMetadata, VersionHistory, LaneHistory];
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/scope/objects-fetcher/objects-fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { logger } from '@teambit/legacy.logger';
import { ScopeNotFound } from '../exceptions';
import { ErrorFromRemote } from '../exceptions/error-from-remote';
import { UnexpectedNetworkError } from '@teambit/scope.network';
import { Repository, ObjectItemsStream, Lane } from '@teambit/scope.objects';
import { Repository, ObjectItemsStream, Lane } from '@teambit/objects';
import { ObjectsWritable } from './objects-writable-stream';
import { WriteObjectsQueue } from './write-objects-queue';
import { groupByScopeName } from '../component-ops/scope-components-importer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
ModelComponent,
Version,
VersionHistory,
} from '@teambit/scope.objects';
} from '@teambit/objects';
import { WriteObjectsQueue } from './write-objects-queue';
import { ComponentsPerRemote } from '../component-ops/multiple-component-merger';

Expand Down
2 changes: 1 addition & 1 deletion components/legacy/scope/repositories/sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
Ref,
Lane,
LaneComponent,
} from '@teambit/scope.objects';
} from '@teambit/objects';
import Scope from '../scope';
import { ExportMissingVersions } from '../exceptions/export-missing-versions';
import { ModelComponentMerger } from '../component-ops/model-components-merger';
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/scope/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import {
ObjectItem,
ObjectList,
DependenciesGraph,
} from '@teambit/scope.objects';
} from '@teambit/objects';
import { RemovedObjects } from './removed-components';
import { Tmp } from './repositories';
import SourcesRepository from './repositories/sources';
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/scope/version-dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ComponentID, ComponentIdList } from '@teambit/component-id';
import ComponentWithDependencies from './component-dependencies';
import { ComponentVersion } from './component-version';
import { DependenciesNotFound } from './exceptions/dependencies-not-found';
import { Repository, Version } from '@teambit/scope.objects';
import { Repository, Version } from '@teambit/objects';
import { ConsumerComponent } from '@teambit/legacy.consumer-component';

export class VersionDependencies {
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/scope/version-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ExtensionDataEntry, ExtensionDataList } from '@teambit/legacy.extension
import { PathLinux, isValidPath } from '@teambit/legacy.utils';
import { validateType } from './validate-type';
import VersionInvalid from './exceptions/version-invalid';
import { Version } from '@teambit/scope.objects';
import { Version } from '@teambit/objects';

/**
* make sure a Version instance is correct. throw an exceptions if it is not.
Expand Down
2 changes: 1 addition & 1 deletion components/scope/remotes/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { Scope } from '@teambit/legacy.scope';
import { RemovedObjects, LaneData, ComponentObjects } from '@teambit/legacy.scope';
import { DependencyGraph } from '@teambit/legacy.dependency-graph';
import { Network, connect } from '@teambit/scope.network';
import { ComponentLog, ObjectItemsStream, ObjectList } from '@teambit/scope.objects';
import { ComponentLog, ObjectItemsStream, ObjectList } from '@teambit/objects';
import { isBitUrl } from '@teambit/legacy.utils';
import { InvalidRemote } from './exceptions';

Expand Down
2 changes: 1 addition & 1 deletion components/scope/remotes/remotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { PrimaryOverloaded } from './exceptions';
import { Remote } from './remote';
import remoteResolver from './remote-resolver/remote-resolver';
import { UnexpectedNetworkError } from '@teambit/scope.network';
import { ObjectItemsStream } from '@teambit/scope.objects';
import { ObjectItemsStream } from '@teambit/objects';
import { ScopeNotFoundOrDenied } from './exceptions/scope-not-found-or-denied';

export class Remotes extends Map<string, Remote> {
Expand Down
2 changes: 1 addition & 1 deletion e2e/harmony/graph-harmony.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import chai, { expect } from 'chai';
import { ScopeMain, ScopeAspect } from '@teambit/scope';
import { loadBit } from '@teambit/bit';
import { Helper } from '@teambit/legacy.e2e-helper';
import { ModelComponent, Version, objectListToGraph, IdGraph } from '@teambit/scope.objects';
import { ModelComponent, Version, objectListToGraph, IdGraph } from '@teambit/objects';

chai.use(require('chai-fs'));
chai.use(require('chai-string'));
Expand Down
Loading