@teambit/objects 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/__bit_junit.xml +68 -0
- package/artifacts/preview/teambit_scope_objects-preview.js +1 -0
- package/dist/fixtures/version-model-extended.json +48 -0
- package/dist/fixtures/version-model-object.json +87 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +371 -0
- package/dist/index.js.map +1 -0
- package/dist/models/dependencies-graph.d.ts +45 -0
- package/dist/models/dependencies-graph.js +106 -0
- package/dist/models/dependencies-graph.js.map +1 -0
- package/dist/models/detach-heads.d.ts +25 -0
- package/dist/models/detach-heads.js +84 -0
- package/dist/models/detach-heads.js.map +1 -0
- package/dist/models/export-metadata.d.ts +24 -0
- package/dist/models/export-metadata.js +76 -0
- package/dist/models/export-metadata.js.map +1 -0
- package/dist/models/index.d.ts +10 -0
- package/dist/models/index.js +125 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/lane-history.d.ts +40 -0
- package/dist/models/lane-history.js +117 -0
- package/dist/models/lane-history.js.map +1 -0
- package/dist/models/lane.d.ts +124 -0
- package/dist/models/lane.js +463 -0
- package/dist/models/lane.js.map +1 -0
- package/dist/models/model-component.d.ts +317 -0
- package/dist/models/model-component.js +1365 -0
- package/dist/models/model-component.js.map +1 -0
- package/dist/models/model-component.spec.d.ts +1 -0
- package/dist/models/model-component.spec.js +71 -0
- package/dist/models/model-component.spec.js.map +1 -0
- package/dist/models/scopeMeta.d.ts +20 -0
- package/dist/models/scopeMeta.js +71 -0
- package/dist/models/scopeMeta.js.map +1 -0
- package/dist/models/source.d.ts +10 -0
- package/dist/models/source.js +43 -0
- package/dist/models/source.js.map +1 -0
- package/dist/models/symlink.d.ts +30 -0
- package/dist/models/symlink.js +91 -0
- package/dist/models/symlink.js.map +1 -0
- package/dist/models/version-history.d.ts +59 -0
- package/dist/models/version-history.js +285 -0
- package/dist/models/version-history.js.map +1 -0
- package/dist/models/version.d.ts +279 -0
- package/dist/models/version.js +777 -0
- package/dist/models/version.js.map +1 -0
- package/dist/models/version.spec.d.ts +1 -0
- package/dist/models/version.spec.js +340 -0
- package/dist/models/version.spec.js.map +1 -0
- package/dist/objects/bit-object-list.d.ts +24 -0
- package/dist/objects/bit-object-list.js +65 -0
- package/dist/objects/bit-object-list.js.map +1 -0
- package/dist/objects/index.d.ts +5 -0
- package/dist/objects/index.js +60 -0
- package/dist/objects/index.js.map +1 -0
- package/dist/objects/object-list-to-graph.d.ts +13 -0
- package/dist/objects/object-list-to-graph.js +93 -0
- package/dist/objects/object-list-to-graph.js.map +1 -0
- package/dist/objects/object-list.d.ts +52 -0
- package/dist/objects/object-list.js +369 -0
- package/dist/objects/object-list.js.map +1 -0
- package/dist/objects/object.d.ts +35 -0
- package/dist/objects/object.js +190 -0
- package/dist/objects/object.js.map +1 -0
- package/dist/objects/objects-readable-generator.d.ts +31 -0
- package/dist/objects/objects-readable-generator.js +192 -0
- package/dist/objects/objects-readable-generator.js.map +1 -0
- package/dist/objects/raw-object.d.ts +23 -0
- package/dist/objects/raw-object.js +155 -0
- package/dist/objects/raw-object.js.map +1 -0
- package/dist/objects/ref.d.ts +14 -0
- package/dist/objects/ref.js +45 -0
- package/dist/objects/ref.js.map +1 -0
- package/dist/objects/repository-hooks.d.ts +4 -0
- package/dist/objects/repository-hooks.js +56 -0
- package/dist/objects/repository-hooks.js.map +1 -0
- package/dist/objects/repository.d.ts +148 -0
- package/dist/objects/repository.js +842 -0
- package/dist/objects/repository.js.map +1 -0
- package/dist/objects/scope-index.d.ts +73 -0
- package/dist/objects/scope-index.js +251 -0
- package/dist/objects/scope-index.js.map +1 -0
- package/dist/objects/scope-index.spec.d.ts +1 -0
- package/dist/objects/scope-index.spec.js +152 -0
- package/dist/objects/scope-index.spec.js.map +1 -0
- package/dist/objects.aspect.d.ts +2 -0
- package/dist/objects.aspect.js +18 -0
- package/dist/objects.aspect.js.map +1 -0
- package/dist/objects.main.runtime.d.ts +7 -0
- package/dist/objects.main.runtime.js +36 -0
- package/dist/objects.main.runtime.js.map +1 -0
- package/dist/preview-1736824735631.js +7 -0
- package/fixtures/version-model-extended.json +48 -0
- package/fixtures/version-model-object.json +87 -0
- package/models/dependencies-graph.ts +119 -0
- package/models/detach-heads.ts +79 -0
- package/models/export-metadata.ts +57 -0
- package/models/index.ts +11 -0
- package/models/lane-history.ts +106 -0
- package/models/lane.ts +367 -0
- package/models/model-component.spec.ts +55 -0
- package/models/model-component.ts +1367 -0
- package/models/scopeMeta.ts +60 -0
- package/models/source.ts +32 -0
- package/models/symlink.ts +66 -0
- package/models/version-history.ts +266 -0
- package/models/version.spec.ts +288 -0
- package/models/version.ts +818 -0
- package/objects/bit-object-list.ts +59 -0
- package/objects/index.ts +6 -0
- package/objects/object-list-to-graph.ts +69 -0
- package/objects/object-list.ts +313 -0
- package/objects/object.ts +153 -0
- package/objects/objects-readable-generator.ts +167 -0
- package/objects/raw-object.ts +142 -0
- package/objects/ref.ts +45 -0
- package/objects/repository-hooks.ts +42 -0
- package/objects/repository.ts +753 -0
- package/objects/scope-index.spec.ts +95 -0
- package/objects/scope-index.ts +192 -0
- package/package.json +98 -0
- package/types/asset.d.ts +41 -0
- package/types/style.d.ts +42 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_uuid","data","require","_semver","_lodash","_bitError","_componentId","_componentVersion","_laneId","_legacy","_legacyCli","_legacy2","_legacy3","_toolboxCrypto","_component","_objects","globalConfig","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","OLD_LANE_SCHEMA","SCHEMA_INCLUDING_DELETED_COMPONENTS_DATA","CURRENT_LANE_SCHEMA","Lane","BitObject","constructor","props","name","scope","components","log","date","Date","now","toString","_hash","hash","readmeComponent","forkedFrom","schema","updateDependents","overrideUpdateDependents","id","LANE_REMOTE_DELIMITER","Error","Ref","changeName","hasChanged","changeScope","refs","map","c","head","validateBeforePersisting","str","logger","debug","lane","parse","validate","toObject","obj","pickBy","component","fullName","isDeleted","val","from","create","bitCloudUser","username","getSync","CFG_USER_NAME_KEY","email","CFG_USER_EMAIL_KEY","profileImage","sha1","v4","isNew","contents","laneObject","JSON","ComponentID","fromObject","LaneId","fromString","toBuffer","pretty","args","getStringifyArgs","stringify","validateBeforePersist","Buffer","addComponent","existsComponent","getComponent","isEqual","removeComponentFromUpdateDependentsIfExist","componentId","updateDependentsList","ComponentIdList","fromArray","exist","searchWithoutVersion","removeIfExist","undefined","addComponentToUpdateDependents","removeAllUpdateDependents","shouldOverrideUpdateDependents","setOverrideUpdateDependents","removeComponent","isEqualWithoutVersion","find","getComponentHead","bitId","found","setLaneComponents","laneComponents","clone","setReadmeComponent","previousReadme","isFullyMerged","unmerged","getMergedAndUnmergedIds","merged","Promise","all","modelComponent","getModelComponentIfExist","startTraverseFrom","getHead","headExist","hasVersionByRef","objects","toBitIds","toComponentIds","changeVersion","toComponentIdsIncludeUpdateDependents","concat","toLaneId","collectObjectsById","repo","headVersion","load","collect","includeDeletedData","gte","setSchemaToSupportDeletedData","setSchemaToNotSupportDeletedData","getCompHeadIncludeUpdateDependents","comp","fromUpdateDependents","version","message","bitIds","filterWithoutVersion","ValidationError","isSnap","toStringWithoutVersion","DEFAULT_LANE","BitError","PREVIOUS_DEFAULT_LANE","thisComponents","toStringArray","sort","otherComponents","cloneDeep","exports"],"sources":["lane.ts"],"sourcesContent":["import { v4 } from 'uuid';\nimport { gte } from 'semver';\nimport { cloneDeep, isEqual, pickBy } from 'lodash';\nimport { BitError } from '@teambit/bit-error';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { isSnap } from '@teambit/component-version';\nimport { LaneId, DEFAULT_LANE, LANE_REMOTE_DELIMITER } from '@teambit/lane-id';\nimport { Scope } from '@teambit/legacy.scope';\nimport { CFG_USER_EMAIL_KEY, CFG_USER_NAME_KEY, PREVIOUS_DEFAULT_LANE } from '@teambit/legacy.constants';\nimport { ValidationError } from '@teambit/legacy.cli.error';\nimport { logger } from '@teambit/legacy.logger';\nimport { getStringifyArgs } from '@teambit/legacy.utils';\nimport { sha1 } from '@teambit/toolbox.crypto.sha1';\nimport { hasVersionByRef } from '@teambit/component.snap-distance';\nimport { BitObject, Ref, Repository } from '../objects';\nimport Version from './version';\nimport * as globalConfig from '@teambit/legacy.global-config';\n\nexport type Log = { date: string; username?: string; email?: string; profileImage?: string };\n\nexport type LaneProps = {\n name: string;\n scope: string;\n log: Log;\n components?: LaneComponent[];\n hash: string;\n schema?: string;\n readmeComponent?: LaneReadmeComponent;\n forkedFrom?: LaneId;\n updateDependents?: ComponentID[];\n overrideUpdateDependents?: boolean;\n};\n\nconst OLD_LANE_SCHEMA = '0.0.0';\nconst SCHEMA_INCLUDING_DELETED_COMPONENTS_DATA = '1.0.0';\nconst CURRENT_LANE_SCHEMA = SCHEMA_INCLUDING_DELETED_COMPONENTS_DATA;\n\nexport type LaneComponent = { id: ComponentID; head: Ref; isDeleted?: boolean };\nexport type LaneReadmeComponent = { id: ComponentID; head: Ref | null };\nexport default class Lane extends BitObject {\n name: string;\n scope: string;\n components: LaneComponent[];\n log: Log;\n schema: string;\n readmeComponent?: LaneReadmeComponent;\n forkedFrom?: LaneId;\n _hash: string; // reason for the underscore prefix is that we already have hash as a method\n isNew = false; // doesn't get saved in the object. only needed for in-memory instance\n hasChanged = false; // doesn't get saved in the object. only needed for in-memory instance\n /**\n * populated when a user clicks on \"update\" in the UI. it's a list of components that are dependents on the\n * components in the lane. their dependencies are updated according to the lane.\n * from the CLI perspective, it's added by \"bit _snap\" and merged by \"bit _merge-lane\".\n * otherwise, the user is not aware of it. it's not imported to the workspace and the objects are not fetched.\n */\n updateDependents?: ComponentID[];\n private overrideUpdateDependents?: boolean;\n constructor(props: LaneProps) {\n super();\n if (!props.name) throw new TypeError('Lane constructor expects to get a name parameter');\n this.name = props.name;\n this.scope = props.scope;\n this.components = props.components || [];\n this.log = props.log || { date: Date.now().toString() };\n this._hash = props.hash;\n this.readmeComponent = props.readmeComponent;\n this.forkedFrom = props.forkedFrom;\n this.schema = props.schema || OLD_LANE_SCHEMA;\n this.updateDependents = props.updateDependents;\n this.overrideUpdateDependents = props.overrideUpdateDependents;\n }\n id(): string {\n return this.scope + LANE_REMOTE_DELIMITER + this.name;\n }\n hash(): Ref {\n if (!this._hash) {\n throw new Error('hash is missing from a Lane object');\n }\n return new Ref(this._hash);\n }\n changeName(name: string) {\n this.name = name;\n this.hasChanged = true;\n }\n changeScope(scope: string) {\n this.scope = scope;\n this.hasChanged = true;\n }\n refs(): Ref[] {\n return this.components.map((c) => c.head);\n }\n validateBeforePersisting(str: string) {\n logger.debug(`validating lane object: ${this.hash().toString()} ${this.id()}`);\n const lane = Lane.parse(str, this.hash().toString());\n lane.validate();\n }\n toObject() {\n const obj = pickBy(\n {\n name: this.name,\n scope: this.scope,\n components: this.components.map((component) => ({\n id: { scope: component.id.scope, name: component.id.fullName },\n head: component.head.toString(),\n ...(component.isDeleted && { isDeleted: component.isDeleted }),\n })),\n log: this.log,\n readmeComponent: this.readmeComponent && {\n id: { scope: this.readmeComponent.id.scope, name: this.readmeComponent.id.fullName },\n head: this.readmeComponent.head?.toString() ?? null,\n },\n forkedFrom: this.forkedFrom && this.forkedFrom.toObject(),\n schema: this.schema,\n updateDependents: this.updateDependents?.map((c) => c.toString()),\n overrideUpdateDependents: this.overrideUpdateDependents,\n },\n (val) => !!val\n );\n return obj;\n }\n static from(props: LaneProps): Lane {\n return new Lane(props);\n }\n static create(\n name: string,\n scope: string,\n forkedFrom?: LaneId,\n bitCloudUser?: {\n username?: string;\n email?: string;\n profileImage?: string;\n }\n ) {\n const log = {\n date: Date.now().toString(),\n username: bitCloudUser?.username || globalConfig.getSync(CFG_USER_NAME_KEY),\n email: bitCloudUser?.email || globalConfig.getSync(CFG_USER_EMAIL_KEY),\n profileImage: bitCloudUser?.profileImage,\n };\n const lane = new Lane({ name, scope, hash: sha1(v4()), log, forkedFrom, schema: CURRENT_LANE_SCHEMA });\n lane.isNew = true;\n lane.hasChanged = true;\n return lane;\n }\n static parse(contents: string, hash: string): Lane {\n const laneObject = JSON.parse(contents);\n return Lane.from({\n name: laneObject.name,\n scope: laneObject.scope,\n log: laneObject.log,\n components: laneObject.components.map((component) => ({\n id: ComponentID.fromObject({ scope: component.id.scope, name: component.id.name }),\n head: new Ref(component.head),\n isDeleted: component.isDeleted,\n })),\n readmeComponent: laneObject.readmeComponent && {\n id: ComponentID.fromObject({\n scope: laneObject.readmeComponent.id.scope,\n name: laneObject.readmeComponent.id.name,\n }),\n head: laneObject.readmeComponent.head && new Ref(laneObject.readmeComponent.head),\n },\n forkedFrom: laneObject.forkedFrom && LaneId.from(laneObject.forkedFrom.name, laneObject.forkedFrom.scope),\n updateDependents: laneObject.updateDependents?.map((c) => ComponentID.fromString(c)),\n overrideUpdateDependents: laneObject.overrideUpdateDependents,\n hash: laneObject.hash || hash,\n schema: laneObject.schema,\n });\n }\n toBuffer(pretty?: boolean) {\n const args = getStringifyArgs(pretty);\n const obj = this.toObject();\n const str = JSON.stringify(obj, ...args);\n if (this.validateBeforePersist) this.validateBeforePersisting(str);\n return Buffer.from(str);\n }\n addComponent(component: LaneComponent) {\n const existsComponent = this.getComponent(component.id);\n if (existsComponent) {\n if (!existsComponent.head.isEqual(component.head)) this.hasChanged = true;\n existsComponent.id = component.id;\n existsComponent.head = component.head;\n existsComponent.isDeleted = component.isDeleted;\n } else {\n logger.debug(`Lane.addComponent, adding component ${component.id.toString()} to lane ${this.id()}`);\n this.components.push(component);\n this.hasChanged = true;\n }\n }\n removeComponentFromUpdateDependentsIfExist(componentId: ComponentID) {\n const updateDependentsList = ComponentIdList.fromArray(this.updateDependents || []);\n const exist = updateDependentsList.searchWithoutVersion(componentId);\n if (!exist) return;\n this.updateDependents = updateDependentsList.removeIfExist(exist);\n if (!this.updateDependents.length) this.updateDependents = undefined;\n this.hasChanged = true;\n }\n addComponentToUpdateDependents(componentId: ComponentID) {\n this.removeComponentFromUpdateDependentsIfExist(componentId);\n (this.updateDependents ||= []).push(componentId);\n this.hasChanged = true;\n }\n removeAllUpdateDependents() {\n if (this.updateDependents?.length) return;\n this.updateDependents = undefined;\n this.hasChanged = true;\n }\n shouldOverrideUpdateDependents() {\n return this.overrideUpdateDependents;\n }\n /**\n * !!! important !!!\n * this should get called only on a \"temp lane\", such as running \"bit _snap\", which the scope gets destroys after the\n * command is done. when _scope exports the lane, this \"overrideUpdateDependents\" is not saved to the remote-scope.\n *\n * on a user local lane object, this prop should never be true. otherwise, it'll override the remote-scope data.\n */\n setOverrideUpdateDependents(overrideUpdateDependents: boolean) {\n this.overrideUpdateDependents = overrideUpdateDependents;\n this.hasChanged = true;\n }\n\n removeComponent(id: ComponentID): boolean {\n const existsComponent = this.getComponent(id);\n if (!existsComponent) return false;\n this.components = this.components.filter((c) => !c.id.isEqualWithoutVersion(id));\n this.hasChanged = true;\n return true;\n }\n getComponent(id: ComponentID): LaneComponent | undefined {\n return this.components.find((c) => c.id.isEqualWithoutVersion(id));\n }\n getComponentHead(bitId: ComponentID): Ref | null {\n const found = this.components.find((c) => c.id.isEqual(bitId));\n if (found) return found.head;\n return null;\n }\n setLaneComponents(laneComponents: LaneComponent[]) {\n // this gets called when adding lane-components from other lanes/remotes, so it's better to\n // clone the objects to not change the original data.\n this.components = laneComponents.map((c) => ({ id: c.id.clone(), head: c.head.clone() }));\n this.hasChanged = true;\n }\n setReadmeComponent(id?: ComponentID) {\n const previousReadme = this.readmeComponent;\n if (!id) {\n this.readmeComponent = undefined;\n if (previousReadme) this.hasChanged = true;\n return;\n }\n const readmeComponent = this.getComponent(id);\n if (!readmeComponent) {\n this.readmeComponent = { id, head: null };\n } else {\n this.readmeComponent = readmeComponent;\n }\n if (\n !previousReadme ||\n !previousReadme.id.isEqual(id) ||\n previousReadme.head?.toString() !== this.readmeComponent.head?.toString()\n ) {\n this.hasChanged = true;\n }\n }\n\n async isFullyMerged(scope: Scope): Promise<boolean> {\n const { unmerged } = await this.getMergedAndUnmergedIds(scope);\n return unmerged.length === 0;\n }\n async getMergedAndUnmergedIds(scope: Scope): Promise<{ merged: ComponentID[]; unmerged: ComponentID[] }> {\n const merged: ComponentID[] = [];\n const unmerged: ComponentID[] = [];\n await Promise.all(\n this.components.map(async (component) => {\n const modelComponent = await scope.getModelComponentIfExist(component.id);\n if (!modelComponent) {\n unmerged.push(component.id);\n return;\n }\n const startTraverseFrom = modelComponent.getHead() || null; // it's important to have it as null and not as undefined, see hasVersionByRef\n const headExist = await hasVersionByRef(modelComponent, component.head, scope.objects, startTraverseFrom);\n if (headExist) merged.push(component.id);\n else unmerged.push(component.id);\n })\n );\n return { merged, unmerged };\n }\n /**\n * @deprecated use toComponentIds instead\n */\n toBitIds(): ComponentIdList {\n return this.toComponentIds();\n }\n toComponentIds(): ComponentIdList {\n return ComponentIdList.fromArray(this.components.map((c) => c.id.changeVersion(c.head.toString())));\n }\n toComponentIdsIncludeUpdateDependents(): ComponentIdList {\n return ComponentIdList.fromArray(this.toComponentIds().concat(this.updateDependents || []));\n }\n toLaneId() {\n return new LaneId({ scope: this.scope, name: this.name });\n }\n collectObjectsById(repo: Repository): Promise<Array<{ id: ComponentID; objects: BitObject[] }>> {\n return Promise.all(\n this.components.map(async (component) => {\n const headVersion = (await component.head.load(repo)) as Version;\n const objects = [headVersion, ...headVersion.collect(repo)];\n return { id: component.id, objects };\n })\n );\n }\n includeDeletedData(): boolean {\n return gte(this.schema, SCHEMA_INCLUDING_DELETED_COMPONENTS_DATA);\n }\n setSchemaToSupportDeletedData() {\n this.schema = SCHEMA_INCLUDING_DELETED_COMPONENTS_DATA;\n this.hasChanged = true;\n }\n setSchemaToNotSupportDeletedData() {\n this.schema = OLD_LANE_SCHEMA;\n this.hasChanged = true;\n }\n getCompHeadIncludeUpdateDependents(componentId: ComponentID): Ref | undefined {\n const comp = this.getComponent(componentId);\n if (comp) return comp.head;\n const fromUpdateDependents = this.updateDependents?.find((c) => c.isEqualWithoutVersion(componentId));\n if (fromUpdateDependents) return Ref.from(fromUpdateDependents.version);\n return undefined;\n }\n validate() {\n const message = `unable to save Lane object \"${this.id()}\"`;\n const bitIds = this.toComponentIds();\n this.components.forEach((component) => {\n if (bitIds.filterWithoutVersion(component.id).length > 1) {\n throw new ValidationError(`${message}, the following component is duplicated \"${component.id.fullName}\"`);\n }\n if (!isSnap(component.head.hash)) {\n throw new ValidationError(\n `${message}, lane component ${component.id.toStringWithoutVersion()} head should be a hash, got ${\n component.head.hash\n }`\n );\n }\n });\n if (this.name === DEFAULT_LANE) {\n throw new BitError(`${message}, this name is reserved as the default lane`);\n }\n if (this.name === PREVIOUS_DEFAULT_LANE) {\n throw new BitError(`${message}, this name is reserved as the old default lane`);\n }\n }\n isEqual(lane: Lane): boolean {\n if (this.id() !== lane.id()) return false;\n const thisComponents = this.toComponentIds().toStringArray().sort();\n const otherComponents = lane.toComponentIds().toStringArray().sort();\n return isEqual(thisComponents, otherComponents);\n }\n clone() {\n return new Lane({\n ...this,\n hash: this._hash,\n overrideUpdateDependents: this.overrideUpdateDependents,\n components: cloneDeep(this.components),\n });\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,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semver from 'semver';
|
2
|
+
import { LaneId } from '@teambit/lane-id';
|
3
|
+
import { ComponentID } from '@teambit/component-id';
|
4
|
+
import { LegacyComponentLog } from '@teambit/legacy-component-log';
|
5
|
+
import { BitId } from '@teambit/legacy-bit-id';
|
6
|
+
import { ConsumerComponent } from '@teambit/legacy.consumer-component';
|
7
|
+
import { SnapsDistance } from '@teambit/component.snap-distance';
|
8
|
+
import { ComponentObjects, ComponentVersion } from '@teambit/legacy.scope';
|
9
|
+
import { Repository, BitObject, Ref } from '../objects';
|
10
|
+
import Lane from './lane';
|
11
|
+
import Version from './version';
|
12
|
+
import VersionHistory, { VersionParents } from './version-history';
|
13
|
+
import { ObjectItem } from '../objects/object-list';
|
14
|
+
import type { Scope } from '@teambit/legacy.scope';
|
15
|
+
import { DetachedHeads } from './detach-heads';
|
16
|
+
type State = {
|
17
|
+
versions?: {
|
18
|
+
[version: string]: {
|
19
|
+
local?: boolean;
|
20
|
+
};
|
21
|
+
};
|
22
|
+
};
|
23
|
+
export type AddVersionOpts = {
|
24
|
+
addToUpdateDependentsInLane?: boolean;
|
25
|
+
/**
|
26
|
+
* kind of rebase.
|
27
|
+
* if true, set the head as the parent of the new version.
|
28
|
+
* by default, the parent is the currently used version in .bitmap.
|
29
|
+
* (this prop takes affect only when the component is checked out to an older version)
|
30
|
+
*/
|
31
|
+
setHeadAsParent?: boolean;
|
32
|
+
detachHead?: boolean;
|
33
|
+
overrideHead?: boolean;
|
34
|
+
};
|
35
|
+
type Versions = {
|
36
|
+
[version: string]: Ref;
|
37
|
+
};
|
38
|
+
export type ScopeListItem = {
|
39
|
+
url: string;
|
40
|
+
name: string;
|
41
|
+
date: string;
|
42
|
+
};
|
43
|
+
export type ComponentLog = LegacyComponentLog;
|
44
|
+
export type ComponentProps = {
|
45
|
+
scope: string;
|
46
|
+
name: string;
|
47
|
+
versions?: Versions;
|
48
|
+
orphanedVersions?: Versions;
|
49
|
+
lang: string;
|
50
|
+
deprecated: boolean;
|
51
|
+
bindingPrefix: string;
|
52
|
+
state?: State;
|
53
|
+
scopesList?: ScopeListItem[];
|
54
|
+
head?: Ref;
|
55
|
+
schema?: string | undefined;
|
56
|
+
detachedHeads?: DetachedHeads;
|
57
|
+
};
|
58
|
+
export declare const VERSION_ZERO = "0.0.0";
|
59
|
+
/**
|
60
|
+
* we can't rename the class as ModelComponent because old components are already saved in the model
|
61
|
+
* with 'Component' in their headers. see object-registrar.types()
|
62
|
+
*/
|
63
|
+
export default class Component extends BitObject {
|
64
|
+
scope: string;
|
65
|
+
name: string;
|
66
|
+
versions: Versions;
|
67
|
+
orphanedVersions: Versions;
|
68
|
+
lang: string;
|
69
|
+
/**
|
70
|
+
* @deprecated moved to the Version object inside teambit/deprecation aspect
|
71
|
+
*/
|
72
|
+
deprecated: boolean;
|
73
|
+
bindingPrefix: string;
|
74
|
+
/**
|
75
|
+
* @deprecated since 0.12.6 (long long ago :) probably can be removed)
|
76
|
+
*/
|
77
|
+
local: boolean | null | undefined;
|
78
|
+
state: State;
|
79
|
+
scopesList: ScopeListItem[];
|
80
|
+
head?: Ref;
|
81
|
+
remoteHead?: Ref | null;
|
82
|
+
/**
|
83
|
+
* doesn't get saved in the scope, used to easier access the local snap head data
|
84
|
+
* when checked out to a lane, this prop is either Ref or null. otherwise (when on main), this prop is undefined.
|
85
|
+
*/
|
86
|
+
laneHeadLocal?: Ref | null;
|
87
|
+
/**
|
88
|
+
* doesn't get saved in the scope, used to easier access the remote snap head data
|
89
|
+
* when checked out to a lane, this prop is either Ref or null. otherwise (when on main), this prop is undefined.
|
90
|
+
*/
|
91
|
+
laneHeadRemote?: Ref | null;
|
92
|
+
/**
|
93
|
+
* when checked out to a lane, calculate what should be the head on the remote.
|
94
|
+
* if the laneHeadRemote is null, for example, when the lane is new, then used the the lane it was forked from.
|
95
|
+
* it no head is found on the lane/forked, then use the component.head.
|
96
|
+
*/
|
97
|
+
calculatedRemoteHeadWhenOnLane?: Ref | null;
|
98
|
+
laneId?: LaneId;
|
99
|
+
laneDataIsPopulated: boolean;
|
100
|
+
schema: string | undefined;
|
101
|
+
detachedHeads: DetachedHeads;
|
102
|
+
private divergeData?;
|
103
|
+
private populateVersionHistoryMutex;
|
104
|
+
constructor(props: ComponentProps);
|
105
|
+
get versionArray(): Ref[];
|
106
|
+
setVersion(tag: string, ref: Ref): void;
|
107
|
+
setOrphanedVersion(tag: string, ref: Ref): void;
|
108
|
+
getRef(version: string): Ref | null;
|
109
|
+
getHeadStr(): string | null;
|
110
|
+
getHead(): Ref | undefined;
|
111
|
+
/**
|
112
|
+
* returns the head hash. regardless of whether current lane is the default or not.
|
113
|
+
* if on a lane, it returns the head of the component on the lane.
|
114
|
+
*/
|
115
|
+
getHeadRegardlessOfLane(): Ref | undefined;
|
116
|
+
getHeadAsTagIfExist(): string | undefined;
|
117
|
+
hasHead(): boolean;
|
118
|
+
setHead(head: Ref | undefined): void;
|
119
|
+
listVersions(sort?: 'ASC' | 'DESC'): string[];
|
120
|
+
listVersionsIncludeOrphaned(sort?: 'ASC' | 'DESC'): string[];
|
121
|
+
hasVersion(version: string, repo: Repository, includeOrphaned?: boolean): Promise<boolean>;
|
122
|
+
hasTag(version: string): boolean;
|
123
|
+
get versionsIncludeOrphaned(): Versions;
|
124
|
+
hasTagIncludeOrphaned(version: string): boolean;
|
125
|
+
/**
|
126
|
+
* whether the head is a snap (not a tag)
|
127
|
+
*/
|
128
|
+
isHeadSnap(): boolean | undefined;
|
129
|
+
/**
|
130
|
+
* add a new remote if it is not there already
|
131
|
+
*/
|
132
|
+
addScopeListItem(scopeListItem: ScopeListItem): void;
|
133
|
+
/**
|
134
|
+
* on main - it checks local-head (or .bitmap version if given) vs remote-head.
|
135
|
+
* on lane - it checks local-head on lane vs remote-head on lane.
|
136
|
+
* however, to get an accurate `divergeData.snapsOnSourceOnly`, the above is not enough.
|
137
|
+
* for example, comp-a@snap-x from lane-a is merged into lane-b. we don't want this snap-x to be "local", because
|
138
|
+
* then, bit-status will show it as "staged" and bit-reset will remove it unexpectedly.
|
139
|
+
* if we only check by the local-head and remote-head on lane, it'll be local because the remote-head of lane-b is empty.
|
140
|
+
* to address this, we search all remote-refs files for this bit-id and during the local history traversal, if a hash
|
141
|
+
* is found there, it'll stop the traversal and not mark it as remote.
|
142
|
+
* in this example, during the merge, lane-a was fetched, and the remote-ref of this lane has snap-x as the head.
|
143
|
+
*/
|
144
|
+
setDivergeData(repo: Repository, throws?: boolean, fromCache?: boolean, workspaceId?: ComponentID): Promise<void>;
|
145
|
+
isOnLane(): boolean;
|
146
|
+
/**
|
147
|
+
* this is used (among others) by `bit status` to check whether snaps are local (staged), for `bit reset` to remove them
|
148
|
+
* and for `bit export` to push them. for "merge pending" status, use `this.getDivergeDataForMergePending()`.
|
149
|
+
*/
|
150
|
+
getDivergeData(): SnapsDistance;
|
151
|
+
/**
|
152
|
+
* don't use modelComponent.getDivergeData() because in some scenarios when on a lane, it compares the head
|
153
|
+
* on the lane against the head on the main, which could show the component as diverged incorrectly.
|
154
|
+
*/
|
155
|
+
getDivergeDataForMergePending(repo: Repository): Promise<SnapsDistance>;
|
156
|
+
populateLocalAndRemoteHeads(repo: Repository, lane?: Lane): Promise<void>;
|
157
|
+
setLaneHeadLocal(lane?: Lane): void;
|
158
|
+
/**
|
159
|
+
* returns only the versions that exist in both components (regardless whether the hash are the same)
|
160
|
+
* e.g. this.component = [0.0.1, 0.0.2, 0.0.3], other component = [0.0.3, 0.0.4]. it returns only [0.0.3].
|
161
|
+
* also, in case it is coming from 'bit import', the version must be locally changed.
|
162
|
+
* otherwise, it doesn't matter whether the hashes are different.
|
163
|
+
*/
|
164
|
+
_getComparableVersionsObjects(otherComponent: Component, // in case of merging, the otherComponent is the existing component, and "this" is the incoming component
|
165
|
+
local: boolean): {
|
166
|
+
thisComponentVersions: Versions;
|
167
|
+
otherComponentVersions: Versions;
|
168
|
+
};
|
169
|
+
compatibleWith(component: Component, local: boolean): boolean;
|
170
|
+
diffWith(component: Component, local: boolean): string[];
|
171
|
+
isEmpty(): boolean;
|
172
|
+
/**
|
173
|
+
* on main return main head, on lane, return lane head.
|
174
|
+
* if the head is also a tag, return the tag, otherwise, return the hash.
|
175
|
+
*/
|
176
|
+
getHeadRegardlessOfLaneAsTagOrHash(returnVersionZeroForNoHead?: boolean): string;
|
177
|
+
/**
|
178
|
+
* get the recent head. if locally is ahead, return the local head. otherwise, return the remote head.
|
179
|
+
*
|
180
|
+
* a user can be checked out to a lane, in which case, `this.laneHeadLocal` and `this.laneHeadRemote`
|
181
|
+
* may be populated.
|
182
|
+
* `this.head` may not be populated, e.g. when a component was created on
|
183
|
+
* this lane and never got snapped on main.
|
184
|
+
* it's impossible that `this.head.isEqual(this.laneHeadLocal)`, because when snapping it's either
|
185
|
+
* on main, which goes to this.head OR on a lane, which goes to this.laneHeadLocal.
|
186
|
+
*/
|
187
|
+
headIncludeRemote(repo: Repository): Promise<string>;
|
188
|
+
getRefOfAncestor(repo: Repository, generationsToGoBack: number): Promise<Ref>;
|
189
|
+
latestVersion(): string;
|
190
|
+
latestVersionIfExist(): string | undefined;
|
191
|
+
isLatestGreaterThan(version: string | null | undefined): boolean;
|
192
|
+
/**
|
193
|
+
* Return the lateset version which actuall exists in the scope
|
194
|
+
* (exists means the object itself exists)
|
195
|
+
* This relevant for cases when the component version array has few versions
|
196
|
+
* but we don't have all the refs in the object
|
197
|
+
*
|
198
|
+
* @returns {number}
|
199
|
+
* @memberof Component
|
200
|
+
*/
|
201
|
+
latestExisting(repository: Repository): string;
|
202
|
+
/**
|
203
|
+
* get component log and sort by the timestamp in ascending order (from the earliest to the latest)
|
204
|
+
*/
|
205
|
+
collectLogs(scope: Scope, shortHash?: boolean, startFrom?: Ref): Promise<ComponentLog[]>;
|
206
|
+
collectVersions(repo: Repository): Promise<ConsumerComponent[]>;
|
207
|
+
getTagOfRefIfExists(ref: Ref, allTags?: Versions): string | undefined;
|
208
|
+
getTag(version: string): string | undefined;
|
209
|
+
switchHashesWithTagsIfExist(refs: Ref[]): string[];
|
210
|
+
/**
|
211
|
+
* if exactVersion is defined, add exact version instead of using the semver mechanism
|
212
|
+
*/
|
213
|
+
getVersionToAdd(releaseType?: semver.ReleaseType, exactVersion?: string | null, incrementBy?: number, preReleaseId?: string): string;
|
214
|
+
isEqual(component: Component, considerOrphanedVersions?: boolean): boolean;
|
215
|
+
addVersion(version: Version, versionToAdd: string, lane?: Lane, previouslyUsedVersion?: string, { addToUpdateDependentsInLane, setHeadAsParent, detachHead, overrideHead }?: AddVersionOpts): string;
|
216
|
+
version(releaseType?: semver.ReleaseType, incrementBy?: number, preReleaseId?: string): string;
|
217
|
+
id(): string;
|
218
|
+
/**
|
219
|
+
* @deprecated use toComponentId() instead
|
220
|
+
*/
|
221
|
+
toBitId(): BitId;
|
222
|
+
toComponentId(): ComponentID;
|
223
|
+
/**
|
224
|
+
* @deprecated use toComponentIdWithLatestVersion() instead
|
225
|
+
*/
|
226
|
+
toBitIdWithLatestVersion(): BitId;
|
227
|
+
toComponentIdWithLatestVersion(): ComponentID;
|
228
|
+
toComponentIdWithHead(): ComponentID;
|
229
|
+
toBitIdWithLatestVersionAllowNull(): ComponentID;
|
230
|
+
toObject(): {
|
231
|
+
name: string;
|
232
|
+
scope: string;
|
233
|
+
versions: {};
|
234
|
+
lang: string;
|
235
|
+
deprecated: boolean;
|
236
|
+
bindingPrefix: string;
|
237
|
+
remotes: ScopeListItem[];
|
238
|
+
schema: string | undefined;
|
239
|
+
detachedHeads: {
|
240
|
+
heads?: string[];
|
241
|
+
deleted?: string[];
|
242
|
+
current?: string;
|
243
|
+
} | undefined;
|
244
|
+
};
|
245
|
+
loadVersion(versionStr: string, repository: Repository, throws?: boolean): Promise<Version>;
|
246
|
+
loadVersionSync(version: string, repository: Repository, throws?: boolean): Version;
|
247
|
+
collectVersionsObjects(repo: Repository, versions: string[], throwForMissingLocalArtifacts?: boolean, workspaceId?: ComponentID): Promise<ObjectItem[]>;
|
248
|
+
collectObjects(repo: Repository): Promise<ComponentObjects>;
|
249
|
+
/**
|
250
|
+
* to delete a version from a component, don't call this method directly. Instead, use sources.removeVersion()
|
251
|
+
*/
|
252
|
+
removeVersion(version: string): Ref;
|
253
|
+
toComponentVersion(versionStr?: string): ComponentVersion;
|
254
|
+
/**
|
255
|
+
* if no "specificVersion" is given, it returns according to the head
|
256
|
+
*/
|
257
|
+
isDeprecated(repo: Repository, specificVersion?: string): Promise<boolean | null>;
|
258
|
+
isRemoved(repo: Repository, specificVersion?: string): Promise<boolean | null>;
|
259
|
+
isLaneReadmeOf(repo: Repository): Promise<string[]>;
|
260
|
+
/**
|
261
|
+
* convert a ModelComponent of a specific version to ConsumerComponent
|
262
|
+
* @see sources.consumerComponentToVersion() for the opposite action.
|
263
|
+
*/
|
264
|
+
toConsumerComponent(versionStr: string, scopeName: string, repository: Repository): Promise<ConsumerComponent>;
|
265
|
+
private addDepsInfoFromDepsResolver;
|
266
|
+
refs(): Ref[];
|
267
|
+
validateBeforePersisting(componentStr: string): void;
|
268
|
+
toBuffer(pretty: boolean): Buffer;
|
269
|
+
/**
|
270
|
+
* Clear data that is relevant only for the local scope and should not be moved to the remote scope
|
271
|
+
*/
|
272
|
+
clearStateData(): void;
|
273
|
+
markVersionAsLocal(version: string): void;
|
274
|
+
/**
|
275
|
+
* local versions that are not exported on the main lane.
|
276
|
+
* @see `this.getLocalTagsOrHashes()`, to get local snaps on the current lane
|
277
|
+
*/
|
278
|
+
getLocalVersions(): string[];
|
279
|
+
hasLocalTag(tag: string): boolean;
|
280
|
+
getLocalTagsOrHashes(repo: Repository, workspaceId?: ComponentID): Promise<string[]>;
|
281
|
+
getLocalHashes(repo: Repository, workspaceId?: ComponentID): Promise<Ref[]>;
|
282
|
+
/**
|
283
|
+
* for most cases, use `isLocallyChanged`, which takes into account lanes.
|
284
|
+
* this is for cases when we only care about the versions exist in the `state` prop.
|
285
|
+
*/
|
286
|
+
isLocallyChangedRegardlessOfLanes(): boolean;
|
287
|
+
/**
|
288
|
+
* whether the component was locally changed, either by adding a new snap/tag or by merging
|
289
|
+
* components from different lanes.
|
290
|
+
*/
|
291
|
+
isLocallyChanged(repo: Repository, lane?: Lane | null, workspaceId?: ComponentID): Promise<boolean>;
|
292
|
+
getVersionHistory(repo: Repository): Promise<VersionHistory>;
|
293
|
+
getAndPopulateVersionHistory(repo: Repository, head: Ref): Promise<VersionHistory>;
|
294
|
+
/**
|
295
|
+
* careful! the `versions` passed here can belong to other components, not necessarily to this one.
|
296
|
+
* that's why it checks whether the version-hash exists in the VersionHistory, and if it's not,
|
297
|
+
* it won't update it.
|
298
|
+
*/
|
299
|
+
updateRebasedVersionHistory(repo: Repository, versions: Version[]): Promise<VersionHistory | undefined>;
|
300
|
+
updateVersionHistory(repo: Repository, versions: Version[]): Promise<VersionHistory>;
|
301
|
+
populateVersionHistoryIfMissingGracefully(repo: Repository, versionHistory: VersionHistory, head: Ref,
|
302
|
+
/**
|
303
|
+
* during traversal, if a hash is found in the VersionHistory it probably means that it has all history until this
|
304
|
+
* point, so we can stop there for better performance. In some rare cases (e.g. the export was interrupted), we
|
305
|
+
* need the ability of full traversal to repair the VersionHistory.
|
306
|
+
*/
|
307
|
+
exitWhenFind?: boolean): Promise<{
|
308
|
+
err?: Error;
|
309
|
+
added?: VersionParents[];
|
310
|
+
}>;
|
311
|
+
static parse(contents: string): Component;
|
312
|
+
static from(props: ComponentProps): Component;
|
313
|
+
static fromBitId(bitId: ComponentID): Component;
|
314
|
+
get isLegacy(): boolean;
|
315
|
+
validate(): void;
|
316
|
+
}
|
317
|
+
export {};
|