@teambit/objects 0.0.726 → 0.0.728
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/dist/models/model-component.d.ts +7 -9
- package/dist/models/model-component.js +2 -11
- package/dist/models/model-component.js.map +1 -1
- package/dist/models/scopeMeta.d.ts +1 -1
- package/dist/models/scopeMeta.js +1 -3
- package/dist/models/scopeMeta.js.map +1 -1
- package/dist/models/version.d.ts +0 -1
- package/dist/models/version.js +35 -18
- package/dist/models/version.js.map +1 -1
- package/dist/models/version.spec.js +36 -0
- package/dist/models/version.spec.js.map +1 -1
- package/dist/objects/object.js +0 -2
- package/dist/objects/object.js.map +1 -1
- package/dist/objects/raw-object.d.ts +2 -3
- package/dist/objects/raw-object.js +0 -4
- package/dist/objects/raw-object.js.map +1 -1
- package/dist/objects/repository.d.ts +1 -1
- package/dist/objects/repository.js +8 -5
- package/dist/objects/repository.js.map +1 -1
- package/dist/objects/scope-index.spec.js +1 -12
- package/dist/objects/scope-index.spec.js.map +1 -1
- package/models/model-component.ts +23 -20
- package/models/scopeMeta.ts +2 -4
- package/models/version.spec.ts +21 -0
- package/models/version.ts +33 -22
- package/objects/object.ts +1 -2
- package/objects/raw-object.ts +8 -13
- package/objects/repository.ts +11 -12
- package/objects/scope-index.spec.ts +1 -9
- package/package.json +12 -12
- /package/dist/{preview-1793031377870.js → preview-1793057865860.js} +0 -0
package/dist/models/scopeMeta.js
CHANGED
|
@@ -47,14 +47,12 @@ class ScopeMeta extends _objects().BitObject {
|
|
|
47
47
|
return Buffer.from(this.toString(pretty));
|
|
48
48
|
}
|
|
49
49
|
static fromScopeName(name) {
|
|
50
|
-
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
51
50
|
return ScopeMeta.fromObject({
|
|
52
51
|
name
|
|
53
52
|
}).hash();
|
|
54
53
|
}
|
|
55
54
|
static parse(propsStr) {
|
|
56
|
-
|
|
57
|
-
return this.fromObject(JSON.parse(propsStr));
|
|
55
|
+
return this.fromObject(JSON.parse(propsStr.toString()));
|
|
58
56
|
}
|
|
59
57
|
static fromObject(props) {
|
|
60
58
|
return new ScopeMeta(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_legacy","data","require","_objects","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ScopeMeta","BitObject","constructor","props","license","name","toObject","toString","pretty","args","getStringifyArgs","JSON","stringify","id","toBuffer","Buffer","from","fromScopeName","fromObject","hash","parse","propsStr","exports","default"],"sources":["scopeMeta.ts"],"sourcesContent":["import { getStringifyArgs } from '@teambit/legacy.utils';\nimport { BitObject } from '../objects';\nimport type Ref from '../objects/ref';\n\ntype ScopeMetaProps = {\n name: string;\n license
|
|
1
|
+
{"version":3,"names":["_legacy","data","require","_objects","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ScopeMeta","BitObject","constructor","props","license","name","toObject","toString","pretty","args","getStringifyArgs","JSON","stringify","id","toBuffer","Buffer","from","fromScopeName","fromObject","hash","parse","propsStr","exports","default"],"sources":["scopeMeta.ts"],"sourcesContent":["import { getStringifyArgs } from '@teambit/legacy.utils';\nimport { BitObject } from '../objects';\nimport type Ref from '../objects/ref';\n\ntype ScopeMetaProps = {\n name: string;\n license?: string | null;\n};\n\n// TODO: fix parse\nexport default class ScopeMeta extends BitObject {\n license: string | null | undefined;\n name: string;\n\n constructor(props: ScopeMetaProps) {\n super();\n this.license = props.license;\n this.name = props.name;\n }\n\n toObject(): Record<string, any> {\n return {\n license: this.license,\n name: this.name,\n };\n }\n\n toString(pretty: boolean): string {\n const args = getStringifyArgs(pretty);\n return JSON.stringify(this.toObject(), ...args);\n }\n\n id(): string {\n return this.name;\n }\n\n toBuffer(pretty): Buffer {\n return Buffer.from(this.toString(pretty));\n }\n\n static fromScopeName(name: string): Ref {\n return ScopeMeta.fromObject({ name }).hash();\n }\n\n static parse(propsStr: string | Buffer): ScopeMeta {\n return this.fromObject(JSON.parse(propsStr.toString()));\n }\n\n static fromObject(props: ScopeMetaProps): ScopeMeta {\n return new ScopeMeta(props);\n }\n\n static from(props: ScopeMetaProps): ScopeMeta {\n return ScopeMeta.fromObject(props);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAuC,SAAAG,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAQvC;AACe,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B,SAAA","ignoreList":[]}
|
package/dist/models/version.d.ts
CHANGED
|
@@ -293,7 +293,6 @@ export default class Version extends BitObject {
|
|
|
293
293
|
get isLegacy(): boolean;
|
|
294
294
|
get originLaneId(): LaneId | undefined;
|
|
295
295
|
get originId(): ComponentID | undefined;
|
|
296
|
-
setDist(dist: Source | undefined): void;
|
|
297
296
|
hasParent(ref: Ref): Ref | undefined;
|
|
298
297
|
addParent(ref: Ref): void;
|
|
299
298
|
setSquashed(squashData: SquashData, log: Log, replaceMessage?: string): void;
|
package/dist/models/version.js
CHANGED
|
@@ -135,11 +135,16 @@ const flattenedIdsCache = new Map();
|
|
|
135
135
|
const flattenedIdStrsCache = new Map();
|
|
136
136
|
const MAX_CACHED_FLATTENED_IDS = 100_000;
|
|
137
137
|
let cachedFlattenedIds = 0;
|
|
138
|
+
let flattenedEdgesCache = new WeakMap();
|
|
139
|
+
const MAX_CACHED_FLATTENED_EDGES = 100_000;
|
|
140
|
+
let cachedFlattenedEdges = 0;
|
|
138
141
|
function countCachedFlattenedId() {
|
|
139
142
|
if (cachedFlattenedIds >= MAX_CACHED_FLATTENED_IDS) {
|
|
140
143
|
flattenedIdsCache.clear();
|
|
141
144
|
flattenedIdStrsCache.clear();
|
|
142
145
|
cachedFlattenedIds = 0;
|
|
146
|
+
flattenedEdgesCache = new WeakMap();
|
|
147
|
+
cachedFlattenedEdges = 0;
|
|
143
148
|
}
|
|
144
149
|
cachedFlattenedIds += 1;
|
|
145
150
|
}
|
|
@@ -172,6 +177,33 @@ function getFlattenedId(dep) {
|
|
|
172
177
|
}
|
|
173
178
|
return id;
|
|
174
179
|
}
|
|
180
|
+
function getFlattenedEdge(source, target, type) {
|
|
181
|
+
if (cachedFlattenedEdges >= MAX_CACHED_FLATTENED_EDGES) {
|
|
182
|
+
flattenedEdgesCache = new WeakMap();
|
|
183
|
+
cachedFlattenedEdges = 0;
|
|
184
|
+
}
|
|
185
|
+
let byTarget = flattenedEdgesCache.get(source);
|
|
186
|
+
if (!byTarget) {
|
|
187
|
+
byTarget = new Map();
|
|
188
|
+
flattenedEdgesCache.set(source, byTarget);
|
|
189
|
+
}
|
|
190
|
+
let byType = byTarget.get(target);
|
|
191
|
+
if (!byType) {
|
|
192
|
+
byType = new Map();
|
|
193
|
+
byTarget.set(target, byType);
|
|
194
|
+
}
|
|
195
|
+
let edge = byType.get(type);
|
|
196
|
+
if (!edge) {
|
|
197
|
+
cachedFlattenedEdges += 1;
|
|
198
|
+
edge = {
|
|
199
|
+
source,
|
|
200
|
+
target,
|
|
201
|
+
type
|
|
202
|
+
};
|
|
203
|
+
byType.set(type, edge);
|
|
204
|
+
}
|
|
205
|
+
return edge;
|
|
206
|
+
}
|
|
175
207
|
|
|
176
208
|
// the deprecated `Version.flattenedDependencies` getter warns only once per process.
|
|
177
209
|
let warnedFlattenedDependenciesGetter = false;
|
|
@@ -530,11 +562,7 @@ class Version extends _objects().BitObject {
|
|
|
530
562
|
};
|
|
531
563
|
}
|
|
532
564
|
static depEdgeFromObject(depEdgeObj) {
|
|
533
|
-
return
|
|
534
|
-
source: _componentId().ComponentID.fromObject(depEdgeObj.source),
|
|
535
|
-
target: _componentId().ComponentID.fromObject(depEdgeObj.target),
|
|
536
|
-
type: depEdgeObj.type
|
|
537
|
-
};
|
|
565
|
+
return getFlattenedEdge(getFlattenedId(depEdgeObj.source), getFlattenedId(depEdgeObj.target), depEdgeObj.type);
|
|
538
566
|
}
|
|
539
567
|
/**
|
|
540
568
|
* until 1.9.86, we used depEdgeToObject.
|
|
@@ -546,11 +574,7 @@ class Version extends _objects().BitObject {
|
|
|
546
574
|
}
|
|
547
575
|
static depEdgeFromArray(depEdgeArr) {
|
|
548
576
|
const [sourceStr, targetStr, type] = depEdgeArr;
|
|
549
|
-
return
|
|
550
|
-
source: _componentId().ComponentID.fromString(sourceStr),
|
|
551
|
-
target: _componentId().ComponentID.fromString(targetStr),
|
|
552
|
-
type: type
|
|
553
|
-
};
|
|
577
|
+
return getFlattenedEdge(getFlattenedId(sourceStr), getFlattenedId(targetStr), type);
|
|
554
578
|
}
|
|
555
579
|
static flattenedEdgeToSource(flattenedEdges) {
|
|
556
580
|
if (!flattenedEdges) return undefined;
|
|
@@ -797,7 +821,7 @@ class Version extends _objects().BitObject {
|
|
|
797
821
|
dependenciesGraphRef: dependenciesGraph?.hash(),
|
|
798
822
|
flattenedDependencies: component.flattenedDependencies,
|
|
799
823
|
// not saved in the Version when `flattenedEdgesRef` is set, see `toObject()`.
|
|
800
|
-
flattenedEdges: component.flattenedEdges,
|
|
824
|
+
flattenedEdges: flattenedEdges ? [] : component.flattenedEdges,
|
|
801
825
|
flattenedEdgesRef: flattenedEdges?.hash(),
|
|
802
826
|
schema: component.schema,
|
|
803
827
|
overrides: component.overrides.componentOverridesData,
|
|
@@ -835,13 +859,6 @@ class Version extends _objects().BitObject {
|
|
|
835
859
|
name: this.origin.id.name
|
|
836
860
|
}) : undefined;
|
|
837
861
|
}
|
|
838
|
-
setDist(dist) {
|
|
839
|
-
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
840
|
-
this.dist = dist ? {
|
|
841
|
-
file: dist.hash(),
|
|
842
|
-
name: _legacy().DEFAULT_BUNDLE_FILENAME
|
|
843
|
-
} : null;
|
|
844
|
-
}
|
|
845
862
|
hasParent(ref) {
|
|
846
863
|
return this.parents.find(p => p.toString() === ref.toString());
|
|
847
864
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_lodash","data","require","_componentVersion","_componentId","_laneId","_uuid","_legacy","_legacy2","_component","_legacy3","_legacy4","_legacy5","_toolboxCrypto","_objects","_legacy6","_source","_interopRequireDefault","_dependenciesGraph","_bit","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","flattenedIdsCache","Map","flattenedIdStrsCache","MAX_CACHED_FLATTENED_IDS","cachedFlattenedIds","countCachedFlattenedId","clear","getFlattenedId","dep","id","get","ComponentID","fromString","set","box","fromObject","byName","scope","byVersion","name","version","warnedFlattenedDependenciesGetter","Version","BitObject","constructor","props","mainFile","files","log","dependencies","Dependencies","devDependencies","peerDependencies","docs","flattenedDependencies","flattenedDependenciesRef","flattenedEdges","flattenedEdgesRef","dependenciesGraphRef","packageDependencies","devPackageDependencies","peerPackageDependencies","bindingPrefix","schema","overrides","packageJsonChangedProps","_hash","hash","parents","squashed","unrelated","extensions","ExtensionDataList","fromArray","buildStatus","componentId","bitVersion","modified","origin","hidden","batchId","validateVersion","getFlattenedEdges","repo","getWithBackwardCompatibility","throws","flattenedEdgesSource","load","flattenedEdgesJson","JSON","parse","contents","toString","map","item","Array","isArray","depEdgeFromArray","depEdgeFromObject","_flattenedEdges","loadDependenciesGraph","dependenciesGraphSource","DependenciesGraph","deserialize","nonEmptyFields","forEach","field","VersionInvalid","getDependencies","deps","clonedDependencies","cloneAsString","dependency","getExtensions","sortedConfigOnly","sortById","toConfigArray","filterFunction","val","key","isEmpty","stringify","pickBy","filesToObject","logToObject","extensionDependencies","calculateHash","Ref","makeHash","Error","extensionsBitIds","Dependency","lastModified","length","date","logger","warn","stack","getLoadedFlattenedDependencies","_flattenedDependencies","ComponentIdList","flattenedDependencyIds","undefined","getFlattenedDependenciesIfLoaded","loadFlattenedDependencies","objects","source","setFlattenedDependenciesFromSource","loadFlattenedDependenciesSync","getFromMemory","loadSync","ids","moveFlattenedDependenciesToSource","Source","from","Buffer","getAllDependencies","depsIdsGroupedByType","getAllIds","getAllDependenciesCloned","getClone","getAllDependenciesIds","allDependencies","values","flat","getDependenciesIdsExcludeExtensions","refs","refsWithOptions","includeParents","includeArtifacts","allRefs","extractRefsFromFiles","file","push","artifacts","getRefsFromExtensions","refsWithoutParents","filter","ref","collectManyObjects","loadManyRaw","depEdgeToObject","depEdge","serialize","target","type","depEdgeObj","depEdgeToArray","depEdgeArr","sourceStr","targetStr","flattenedEdgeToSource","flattenedEdgesObj","f","flattenedEdgesBuffer","dependenciesGraphToSource","dependenciesGraph","dependenciesGraphBuffer","relativePath","test","message","username","email","toObject","cloneAsObject","toModelObjects","p","previousParents","laneId","head","validateBeforePersisting","versionStr","trace","validate","toBuffer","pretty","obj","args","getStringifyArgs","str","validateBeforePersist","contentParsed","flattenedDevDependencies","_getDependencies","getRelativePath","importSpecifiers","importSpecifier","BitIdCompIdError","relativePaths","parseFile","_getExtensions","exts","newExts","extension","extensionId","entry","ExtensionDataEntry","config","fromModelObject","LaneId","versionProps","fromComponent","component","pathNormalizeToLinux","componentOverridesData","getBitVersion","isSnap","setNewHash","sha1","v4","ignoreSharedDir","isSchemaSupport","SchemaFeature","sharedDir","isLegacy","SchemaName","Legacy","originLaneId","lane","originId","setDist","dist","DEFAULT_BUNDLE_FILENAME","hasParent","find","addParent","setSquashed","squashData","replaceMessage","addModifiedLog","Date","now","setUnrelated","externalHead","addAsOnlyParent","removeParent","removeAllParents","modelFilesToSourceFiles","repository","Promise","all","SourceFile","loadFromSourceFileModel","isRemoved","Boolean","findCoreExtension","Extensions","remove","removed","shouldRemoveFromMain","removeOnMain","validateVersionInstance","exports"],"sources":["version.ts"],"sourcesContent":["import { isEmpty, pickBy } from 'lodash';\nimport { isSnap } from '@teambit/component-version';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { LaneId } from '@teambit/lane-id';\nimport { v4 } from 'uuid';\nimport type { BuildStatus } from '@teambit/legacy.constants';\nimport { DEFAULT_BUNDLE_FILENAME, Extensions } from '@teambit/legacy.constants';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport {\n isSchemaSupport,\n SchemaFeature,\n SchemaName,\n Dependencies,\n Dependency,\n} from '@teambit/legacy.consumer-component';\nimport { getRefsFromExtensions, SourceFile } from '@teambit/component.sources';\nimport type { ComponentOverridesData } from '@teambit/legacy.consumer-config';\nimport { ExtensionDataEntry, ExtensionDataList } from '@teambit/legacy.extension-data';\nimport type { Doclet } from '@teambit/semantics.doc-parser';\nimport { logger } from '@teambit/legacy.logger';\nimport type { PathLinux } from '@teambit/legacy.utils';\nimport { getStringifyArgs, pathNormalizeToLinux } from '@teambit/legacy.utils';\nimport { sha1 } from '@teambit/toolbox.crypto.sha1';\nimport type { Repository } from '../objects';\nimport { BitObject, Ref } from '../objects';\nimport type { ObjectItem } from '../objects/object-list';\nimport { BitIdCompIdError, VersionInvalid, validateVersionInstance } from '@teambit/legacy.scope';\nimport Source from './source';\nimport { DependenciesGraph } from './dependencies-graph';\nimport { getBitVersion } from '@teambit/bit.get-bit-version';\n\n// the same flattened dependencies repeat across versions. in a typical scope, hundreds of thousands of entries are a\n// few thousand unique ids. ids are immutable, so the versions share them instead of each holding its own copies.\n// an id object is looked up by its parts (scope, then name, then version). building a key string for each entry instead\n// is slower than creating a new id.\nconst flattenedIdsCache = new Map<string, Map<string, Map<string, ComponentID>>>();\nconst flattenedIdStrsCache = new Map<string, ComponentID>();\nconst MAX_CACHED_FLATTENED_IDS = 100_000;\nlet cachedFlattenedIds = 0;\n\nfunction countCachedFlattenedId() {\n if (cachedFlattenedIds >= MAX_CACHED_FLATTENED_IDS) {\n flattenedIdsCache.clear();\n flattenedIdStrsCache.clear();\n cachedFlattenedIds = 0;\n }\n cachedFlattenedIds += 1;\n}\n\nfunction getFlattenedId(dep: string | Record<string, any>): ComponentID {\n if (typeof dep === 'string') {\n let id = flattenedIdStrsCache.get(dep);\n if (!id) {\n countCachedFlattenedId();\n id = ComponentID.fromString(dep);\n flattenedIdStrsCache.set(dep, id);\n }\n return id;\n }\n if (dep.box) return ComponentID.fromObject(dep as any); // legacy ids, rare. not worth another level.\n let byName = flattenedIdsCache.get(dep.scope);\n if (!byName) {\n byName = new Map();\n flattenedIdsCache.set(dep.scope, byName);\n }\n let byVersion = byName.get(dep.name);\n if (!byVersion) {\n byVersion = new Map();\n byName.set(dep.name, byVersion);\n }\n let id = byVersion.get(dep.version);\n if (!id) {\n countCachedFlattenedId();\n id = ComponentID.fromObject(dep as any);\n byVersion.set(dep.version, id);\n }\n return id;\n}\n\n// the deprecated `Version.flattenedDependencies` getter warns only once per process.\nlet warnedFlattenedDependenciesGetter = false;\n\nexport type SourceFileModel = {\n name: string;\n relativePath: PathLinux;\n test: boolean;\n file: Ref;\n};\n\nexport type DistFileModel = SourceFileModel;\n\nexport type ArtifactFileModel = {\n relativePath: PathLinux;\n file: Ref;\n};\n\nexport type Log = {\n message: string;\n date: string;\n username: string | undefined;\n email: string | undefined;\n};\n\n// anything objects can be loaded from by their ref: the scope repository, or the objects received from a remote.\nexport type ObjectsLoader = { load(ref: Ref, throws?: boolean): Promise<BitObject | undefined> };\n\nexport type DepEdgeType = 'prod' | 'dev' | 'peer' | 'ext';\nexport type DepEdge = { source: ComponentID; target: ComponentID; type: DepEdgeType };\n\ntype ExternalHead = { head: Ref; laneId: LaneId };\ntype SquashData = { previousParents: Ref[]; laneId: LaneId };\ntype VersionOrigin = { id: { scope: string; name: string }; lane?: { scope: string; name: string; hash: string } };\n\nexport type VersionProps = {\n mainFile: PathLinux;\n files: Array<SourceFileModel>;\n log: Log;\n docs?: Doclet[];\n dependencies?: Dependency[];\n devDependencies?: Dependency[];\n peerDependencies?: Dependency[];\n flattenedDependencies?: ComponentIdList;\n flattenedDependenciesRef?: Ref;\n _flattenedEdges?: DepEdge[];\n flattenedEdges?: DepEdge[];\n flattenedEdgesRef?: Ref;\n dependenciesGraphRef?: Ref;\n packageDependencies?: { [key: string]: string };\n devPackageDependencies?: { [key: string]: string };\n peerPackageDependencies?: { [key: string]: string };\n bindingPrefix: string;\n schema?: string;\n overrides: ComponentOverridesData;\n packageJsonChangedProps?: Record<string, any>;\n hash?: string;\n parents?: Ref[];\n squashed?: SquashData;\n unrelated?: ExternalHead;\n extensions?: ExtensionDataList;\n buildStatus?: BuildStatus;\n componentId?: ComponentID;\n bitVersion?: string;\n modified?: Log[];\n origin?: VersionOrigin;\n hidden?: boolean;\n batchId?: string;\n};\n\n/**\n * Represent a version model in the scope\n */\nexport default class Version extends BitObject {\n mainFile: PathLinux;\n files: Array<SourceFileModel>;\n log: Log;\n docs: Doclet[] | undefined;\n dependencies: Dependencies;\n devDependencies: Dependencies;\n peerDependencies: Dependencies;\n private _flattenedDependencies?: ComponentIdList;\n // the flattened dependencies of a parsed Version. the list is built on first access, most commands never read it.\n private flattenedDependencyIds?: ComponentID[];\n /**\n * ref to a Source object with the flattened dependencies, as a JSON array of id strings. when it's set, the Version\n * itself has no flattened dependencies, and they have to be loaded with `loadFlattenedDependencies()`.\n */\n flattenedDependenciesRef?: Ref;\n dependenciesGraphRef?: Ref;\n _dependenciesGraph?: DependenciesGraph; // caching for the dependencies graph\n flattenedEdgesRef?: Ref; // ref to a BitObject Source file, which is a JSON object containing the flattened edge\n _flattenedEdges?: DepEdge[]; // caching for the flattenedEdges\n /**\n * @deprecated\n * to get the flattenedEdges, please use `this.getFlattenedEdges()`, which supports both formats.\n * this holds the edges of old Versions, which were saved inside the Version, before `flattenedEdgesRef` was\n * introduced. Versions that have `flattenedEdgesRef` don't save the edges here (see `toObject()`).\n */\n private flattenedEdges: DepEdge[];\n packageDependencies: { [key: string]: string };\n devPackageDependencies: { [key: string]: string };\n peerPackageDependencies: { [key: string]: string };\n bindingPrefix: string;\n schema: string | undefined;\n overrides: ComponentOverridesData;\n packageJsonChangedProps: Record<string, any>;\n _hash: string; // reason for the underscore prefix is that we already have hash as a method\n parents: Ref[];\n squashed?: SquashData; // when a component is squashed during lane-merge\n unrelated?: ExternalHead; // when a component from a lane was created with the same name/scope as main, this ref points to the component of the lane\n extensions: ExtensionDataList;\n buildStatus?: BuildStatus;\n componentId?: ComponentID; // can help debugging errors when validating Version object\n bitVersion?: string;\n modified: Log[] = []; // currently mutation could happen as a result of either \"squash\" or \"sign\".\n // where this version was made: the component id it was snapped as, and the lane it was snapped on\n // (absent on main). set on every snap and tag, see SnappingMain.addSource. it is read as data, not\n // only as a debugging aid: Scope.isPartOfLaneHistoryOrMain tells a snap of a given lane from one of\n // main by it, and ModelComponent.filterLeanLaneRefs keeps the refs a lean lane scope owns by it.\n origin?: VersionOrigin;\n hidden?: boolean; // whether the version is hidden from commands such as \"bit log\", \"bit blame\". (needed for un-meaningful snaps, such as merged-lane snap prior to the tag)\n batchId?: string; // a shared UUID for all versions created in the same snap/tag operation\n\n constructor(props: VersionProps) {\n super();\n this.mainFile = props.mainFile;\n this.files = props.files;\n this.log = props.log;\n this.dependencies = new Dependencies(props.dependencies);\n this.devDependencies = new Dependencies(props.devDependencies);\n this.peerDependencies = new Dependencies(props.peerDependencies);\n this.docs = props.docs;\n if (props.flattenedDependencies) this.flattenedDependencies = props.flattenedDependencies;\n this.flattenedDependenciesRef = props.flattenedDependenciesRef;\n this.flattenedEdges = props.flattenedEdges || [];\n this.flattenedEdgesRef = props.flattenedEdgesRef;\n this.dependenciesGraphRef = props.dependenciesGraphRef;\n this.packageDependencies = props.packageDependencies || {};\n this.devPackageDependencies = props.devPackageDependencies || {};\n this.peerPackageDependencies = props.peerPackageDependencies || {};\n this.bindingPrefix = props.bindingPrefix;\n this.schema = props.schema;\n this.overrides = props.overrides || {};\n this.packageJsonChangedProps = props.packageJsonChangedProps || {};\n // @ts-ignore yes, props.hash can be undefined here, but it gets populated as soon as Version is created\n this._hash = props.hash;\n this.parents = props.parents || [];\n this.squashed = props.squashed;\n this.unrelated = props.unrelated;\n this.extensions = props.extensions || ExtensionDataList.fromArray([]);\n this.buildStatus = props.buildStatus;\n this.componentId = props.componentId;\n this.bitVersion = props.bitVersion;\n this.modified = props.modified || [];\n this.origin = props.origin;\n this.hidden = props.hidden;\n this.batchId = props.batchId;\n this.validateVersion();\n }\n\n /**\n * use only this method to get the flattened edges (graph of flattened dependencies).\n * it's backward compatible with the previous way this was stored on the Version object itself.\n */\n async getFlattenedEdges(repo: Repository): Promise<DepEdge[]> {\n const getWithBackwardCompatibility = async (): Promise<DepEdge[]> => {\n if (this.flattenedEdgesRef) {\n // it's possible that there is a ref but the file is not there.\n // it can happen if the remote-scope uses an older version that doesn't know to collect this ref.\n // in which case, the client will get the Version object with the ref prop, but not the Source object.\n const throws = false;\n const flattenedEdgesSource = (await repo.load(this.flattenedEdgesRef, throws)) as Source | undefined;\n if (flattenedEdgesSource) {\n const flattenedEdgesJson = JSON.parse(flattenedEdgesSource.contents.toString());\n return flattenedEdgesJson.map((item) =>\n Array.isArray(item) ? Version.depEdgeFromArray(item) : Version.depEdgeFromObject(item)\n );\n }\n }\n return this.flattenedEdges || [];\n };\n\n if (!this._flattenedEdges) {\n this._flattenedEdges = await getWithBackwardCompatibility();\n }\n\n return this._flattenedEdges;\n }\n\n async loadDependenciesGraph(repo: Repository): Promise<DependenciesGraph | undefined> {\n if (!this._dependenciesGraph) {\n if (this.dependenciesGraphRef) {\n // it's possible that there is a ref but the file is not there.\n // it can happen if the remote-scope uses an older version that doesn't know to collect this ref.\n // in which case, the client will get the Version object with the ref prop, but not the Source object.\n const throws = false;\n const dependenciesGraphSource = (await repo.load(this.dependenciesGraphRef, throws)) as Source | undefined;\n if (dependenciesGraphSource) {\n this._dependenciesGraph = DependenciesGraph.deserialize(dependenciesGraphSource.contents.toString());\n }\n }\n }\n return this._dependenciesGraph;\n }\n\n validateVersion() {\n const nonEmptyFields = ['mainFile', 'files'];\n nonEmptyFields.forEach((field) => {\n if (!this[field]) {\n throw new VersionInvalid(`failed creating a version object, the field \"${field}\" can't be empty`);\n }\n });\n }\n\n id() {\n const getDependencies = (deps: Dependencies) => {\n const clonedDependencies = deps.cloneAsString();\n return clonedDependencies.map((dependency) => {\n return {\n id: dependency.id,\n };\n });\n };\n\n const getExtensions = (extensions: ExtensionDataList) => {\n const sortedConfigOnly = extensions.sortById().toConfigArray();\n return sortedConfigOnly;\n };\n\n const filterFunction = (val, key) => {\n if (\n key === 'devDependencies' ||\n key === 'extensionDependencies' ||\n key === 'devPackageDependencies' ||\n key === 'peerPackageDependencies' ||\n key === 'overrides' ||\n key === 'extensions'\n ) {\n return !isEmpty(val);\n }\n return !!val;\n };\n\n return JSON.stringify(\n pickBy(\n {\n // only what the hash needs, not `toObject()`, which serializes the whole version (e.g. a deep clone of all extensions)\n mainFile: this.mainFile,\n files: this.filesToObject(),\n log: this.logToObject(),\n dependencies: getDependencies(this.dependencies),\n devDependencies: getDependencies(this.devDependencies),\n extensionDependencies: getDependencies(this.extensionDependencies),\n packageDependencies: this.packageDependencies,\n devPackageDependencies: this.devPackageDependencies,\n peerPackageDependencies: this.peerPackageDependencies,\n bindingPrefix: this.bindingPrefix,\n overrides: this.overrides,\n extensions: getExtensions(this.extensions),\n },\n filterFunction\n )\n );\n }\n\n calculateHash(): Ref {\n return new Ref(BitObject.makeHash(this.id()));\n }\n\n hash(): Ref {\n if (!this._hash) {\n throw new Error('hash is missing from a Version object');\n }\n return new Ref(this._hash);\n }\n\n get extensionDependencies() {\n return new Dependencies(this.extensions.extensionsBitIds.map((id) => new Dependency(id, [])));\n }\n\n lastModified(): string {\n if (!this.modified || !this.modified.length) return this.log.date;\n return this.modified[this.modified.length - 1].date;\n }\n\n /**\n * @deprecated use `await version.loadFlattenedDependencies(repo)`, which supports both formats. this getter throws\n * when the flattened dependencies are stored in a separate object (`flattenedDependenciesRef`) and weren't loaded.\n * bit doesn't write this format yet, so until it does (around Oct 2027), the getter keeps working.\n */\n get flattenedDependencies(): ComponentIdList {\n if (!warnedFlattenedDependenciesGetter) {\n warnedFlattenedDependenciesGetter = true;\n logger.warn(\n `Version.flattenedDependencies is deprecated and will throw for newer versions, use \"await version.loadFlattenedDependencies(repo)\" instead`,\n new Error().stack\n );\n }\n return this.getLoadedFlattenedDependencies();\n }\n\n /**\n * the flattened dependencies, when they're stored in the Version itself or were loaded already. throws otherwise,\n * when they're stored in a separate object (`flattenedDependenciesRef`), use `loadFlattenedDependencies()`.\n */\n getLoadedFlattenedDependencies(): ComponentIdList {\n if (!this._flattenedDependencies) {\n if (this.flattenedDependenciesRef) {\n throw new Error(\n `the flattened dependencies of version ${this._hash} are stored in the object ${this.flattenedDependenciesRef.toString()}, load them with loadFlattenedDependencies()`\n );\n }\n this._flattenedDependencies = ComponentIdList.fromArray(this.flattenedDependencyIds || []);\n this.flattenedDependencyIds = undefined;\n }\n return this._flattenedDependencies;\n }\n\n /**\n * a new list is saved in the Version itself, so a ref to a separate object, if there was one, is dropped.\n */\n set flattenedDependencies(flattenedDependencies: ComponentIdList) {\n this._flattenedDependencies = flattenedDependencies;\n this.flattenedDependencyIds = undefined;\n this.flattenedDependenciesRef = undefined;\n }\n\n /**\n * the flattened dependencies, if they're available without loading a separate object. otherwise, undefined.\n */\n getFlattenedDependenciesIfLoaded(): ComponentIdList | undefined {\n if (this.flattenedDependenciesRef && !this._flattenedDependencies) return undefined;\n return this.getLoadedFlattenedDependencies();\n }\n\n /**\n * use this to get the flattened dependencies. it supports both formats: stored in the Version itself, or stored in\n * a separate Source object (`flattenedDependenciesRef`). `objects` is usually the scope repository, but can be any\n * container of the objects, such as the objects received from a remote.\n */\n async loadFlattenedDependencies(objects: ObjectsLoader): Promise<ComponentIdList> {\n if (this._flattenedDependencies || !this.flattenedDependenciesRef) return this.getLoadedFlattenedDependencies();\n const source = (await objects.load(this.flattenedDependenciesRef, false)) as Source | undefined;\n return this.setFlattenedDependenciesFromSource(source);\n }\n\n /**\n * same as `loadFlattenedDependencies()`, for code that can't be async.\n */\n loadFlattenedDependenciesSync(repo: Repository): ComponentIdList {\n if (this._flattenedDependencies || !this.flattenedDependenciesRef) return this.getLoadedFlattenedDependencies();\n // objects added during tag, or fetched from a remote without being imported, are only in memory, not on the disk.\n const source = (repo.getFromMemory(this.flattenedDependenciesRef) ||\n repo.loadSync(this.flattenedDependenciesRef, false)) as Source | undefined;\n return this.setFlattenedDependenciesFromSource(source);\n }\n\n private setFlattenedDependenciesFromSource(source?: Source): ComponentIdList {\n if (!source) {\n // unlike the flattened edges, there is no fallback here. an empty list would be wrong, not just less efficient.\n throw new Error(\n `unable to find the object ${this.flattenedDependenciesRef?.toString()} with the flattened dependencies of version ${this._hash}`\n );\n }\n const ids: string[] = JSON.parse(source.contents.toString());\n // not by the setter, which would drop the ref.\n this._flattenedDependencies = ComponentIdList.fromArray(ids.map(getFlattenedId));\n this.flattenedDependencyIds = undefined;\n return this._flattenedDependencies;\n }\n\n /**\n * moves the flattened dependencies out of this Version into a new Source object, which the caller has to persist.\n */\n moveFlattenedDependenciesToSource(): Source | undefined {\n const flattenedDependencies = this.getLoadedFlattenedDependencies();\n if (!flattenedDependencies.length) return undefined;\n const source = Source.from(Buffer.from(JSON.stringify(flattenedDependencies.map((id) => id.toString()))));\n this.flattenedDependenciesRef = source.hash();\n return source;\n }\n\n getAllDependencies(): Dependency[] {\n return [\n ...this.dependencies.dependencies,\n ...this.devDependencies.dependencies,\n ...this.extensionDependencies.dependencies,\n ];\n }\n\n get depsIdsGroupedByType(): {\n dependencies: ComponentIdList;\n devDependencies: ComponentIdList;\n peerDependencies: ComponentIdList;\n extensionDependencies: ComponentIdList;\n } {\n return {\n dependencies: this.dependencies.getAllIds(),\n devDependencies: this.devDependencies.getAllIds(),\n peerDependencies: this.peerDependencies.getAllIds(),\n extensionDependencies: this.extensions.extensionsBitIds,\n };\n }\n\n getAllDependenciesCloned(): Dependencies {\n const dependencies = [...this.dependencies.getClone(), ...this.devDependencies.getClone()];\n return new Dependencies(dependencies);\n }\n\n getAllDependenciesIds(): ComponentIdList {\n const allDependencies = Object.values(this.depsIdsGroupedByType).flat();\n return ComponentIdList.fromArray(allDependencies);\n }\n\n getDependenciesIdsExcludeExtensions(): ComponentIdList {\n return ComponentIdList.fromArray([...this.dependencies.getAllIds(), ...this.devDependencies.getAllIds()]);\n }\n\n refs(): Ref[] {\n return this.refsWithOptions();\n }\n\n refsWithOptions(includeParents = true, includeArtifacts = true): Ref[] {\n const allRefs: Ref[] = [];\n const extractRefsFromFiles = (files) => {\n const refs = files ? files.map((file) => file.file) : [];\n return refs;\n };\n const files = extractRefsFromFiles(this.files);\n allRefs.push(...files);\n if (includeParents) {\n allRefs.push(...this.parents);\n }\n if (includeArtifacts) {\n const artifacts = getRefsFromExtensions(this.extensions);\n allRefs.push(...artifacts);\n }\n if (this.flattenedEdgesRef) allRefs.push(this.flattenedEdgesRef);\n if (this.dependenciesGraphRef) allRefs.push(this.dependenciesGraphRef);\n if (this.flattenedDependenciesRef) allRefs.push(this.flattenedDependenciesRef);\n return allRefs;\n }\n\n refsWithoutParents(): Ref[] {\n const extractRefsFromFiles = (files) => {\n const refs = files ? files.map((file) => file.file) : [];\n return refs;\n };\n const files = extractRefsFromFiles(this.files);\n const artifacts = getRefsFromExtensions(this.extensions);\n return [...files, ...artifacts].filter((ref) => ref);\n }\n\n async collectManyObjects(repo: Repository, refs: Ref[]): Promise<ObjectItem[]> {\n return repo.loadManyRaw(refs);\n }\n\n static depEdgeToObject(depEdge: DepEdge): Record<string, any> {\n return {\n source: depEdge.source.serialize(),\n target: depEdge.target.serialize(),\n type: depEdge.type,\n };\n }\n static depEdgeFromObject(depEdgeObj: Record<string, any>): DepEdge {\n return {\n source: ComponentID.fromObject(depEdgeObj.source),\n target: ComponentID.fromObject(depEdgeObj.target),\n type: depEdgeObj.type,\n };\n }\n /**\n * until 1.9.86, we used depEdgeToObject.\n * this one makes this object much much smaller (for 604 edges, it's now 143KB, with the array format it's 6KB!)\n * this format has been supported (but not used) since v1.6.97.\n */\n static depEdgeToArray(depEdge: DepEdge): Record<string, any> {\n return [depEdge.source.toString(), depEdge.target.toString(), depEdge.type];\n }\n static depEdgeFromArray(depEdgeArr: string[]): DepEdge {\n const [sourceStr, targetStr, type] = depEdgeArr;\n return {\n source: ComponentID.fromString(sourceStr),\n target: ComponentID.fromString(targetStr),\n type: type as DepEdgeType,\n };\n }\n static flattenedEdgeToSource(flattenedEdges?: DepEdge[]): Source | undefined {\n if (!flattenedEdges) return undefined;\n // const flattenedEdgesObj = flattenedEdges.map((f) => Version.depEdgeToArray(f));\n const flattenedEdgesObj = flattenedEdges.map((f) => Version.depEdgeToObject(f));\n const flattenedEdgesBuffer = Buffer.from(JSON.stringify(flattenedEdgesObj));\n return Source.from(flattenedEdgesBuffer);\n }\n static dependenciesGraphToSource(dependenciesGraph?: DependenciesGraph): Source | undefined {\n if (!dependenciesGraph) return undefined;\n const dependenciesGraphBuffer = Buffer.from(dependenciesGraph.serialize());\n return Source.from(dependenciesGraphBuffer);\n }\n\n private filesToObject() {\n return this.files?.map((file) => ({\n file: file.file.toString(),\n relativePath: file.relativePath,\n name: file.name,\n test: file.test,\n }));\n }\n\n private logToObject() {\n return {\n message: this.log.message,\n date: this.log.date,\n username: this.log.username,\n email: this.log.email,\n };\n }\n\n toObject() {\n return pickBy(\n {\n files: this.filesToObject(),\n mainFile: this.mainFile,\n bindingPrefix: this.bindingPrefix,\n schema: this.schema,\n log: this.logToObject(),\n docs: this.docs,\n dependencies: this.dependencies.cloneAsObject(),\n devDependencies: this.devDependencies.cloneAsObject(),\n flattenedDependencies: this.flattenedDependenciesRef\n ? undefined\n : this.getLoadedFlattenedDependencies().map((dep) => dep.toObject()),\n flattenedDependenciesRef: this.flattenedDependenciesRef?.toString(),\n flattenedEdges: this.flattenedEdgesRef ? undefined : this.flattenedEdges.map((f) => Version.depEdgeToObject(f)),\n flattenedEdgesRef: this.flattenedEdgesRef?.toString(),\n dependenciesGraphRef: this.dependenciesGraphRef?.toString(),\n extensions: this.extensions.toModelObjects(),\n packageDependencies: this.packageDependencies,\n devPackageDependencies: this.devPackageDependencies,\n peerPackageDependencies: this.peerPackageDependencies,\n overrides: this.overrides,\n buildStatus: this.buildStatus,\n packageJsonChangedProps: this.packageJsonChangedProps,\n parents: this.parents.map((p) => p.toString()),\n squashed: this.squashed\n ? {\n previousParents: this.squashed.previousParents.map((p) => p.toString()),\n laneId: this.squashed.laneId.toObject(),\n }\n : undefined,\n unrelated: this.unrelated\n ? { head: this.unrelated.head.toString(), laneId: this.unrelated.laneId.toObject() }\n : undefined,\n bitVersion: this.bitVersion,\n modified: this.modified,\n origin: this.origin,\n hidden: this.hidden,\n batchId: this.batchId,\n },\n (val) => !!val\n );\n }\n\n validateBeforePersisting(versionStr: string): void {\n logger.trace(`validating version object, hash: ${this.hash().hash}`);\n const version = Version.parse(versionStr, this._hash);\n version.validate();\n }\n\n toBuffer(pretty: boolean): Buffer {\n const obj = this.toObject();\n const args = getStringifyArgs(pretty);\n const str = JSON.stringify(obj, ...args);\n if (this.validateBeforePersist) this.validateBeforePersisting(str);\n return Buffer.from(str);\n }\n /**\n * used by the super class BitObject\n */\n static parse(contents: string, hash: string): Version {\n const contentParsed = JSON.parse(contents);\n const {\n mainFile,\n files,\n bindingPrefix,\n schema,\n log,\n docs,\n dependencies,\n devDependencies,\n flattenedDependencies,\n flattenedDevDependencies,\n flattenedDependenciesRef,\n flattenedEdges,\n flattenedEdgesRef,\n dependenciesGraphRef,\n devPackageDependencies,\n peerPackageDependencies,\n packageDependencies,\n overrides,\n packageJsonChangedProps,\n extensions,\n buildStatus,\n parents,\n squashed,\n unrelated,\n bitVersion,\n modified,\n origin,\n hidden,\n batchId,\n } = contentParsed;\n\n const _getDependencies = (deps = []): Dependency[] => {\n const getRelativePath = (relativePath) => {\n if (relativePath.importSpecifiers) {\n // backward compatibility. Before the massive validation was added, an item of\n // relativePath.importSpecifiers array could be missing the mainFile property, which is\n // an invalid ImportSpecifier. (instead the mainFile it had another importSpecifiers object).\n relativePath.importSpecifiers = relativePath.importSpecifiers.filter(\n (importSpecifier) => importSpecifier.mainFile\n );\n if (!relativePath.importSpecifiers.length) delete relativePath.importSpecifiers;\n }\n\n return relativePath;\n };\n\n return deps.map((dependency: any) => {\n if (!dependency.id.scope) {\n throw new BitIdCompIdError(dependency.id.name);\n }\n return new Dependency(\n ComponentID.fromObject(dependency.id),\n Array.isArray(dependency.relativePaths)\n ? dependency.relativePaths.map(getRelativePath)\n : dependency.relativePaths\n );\n });\n };\n\n const parseFile = (file) => {\n return {\n file: Ref.from(file.file),\n relativePath: file.relativePath,\n name: file.name,\n test: file.test,\n };\n };\n const _getExtensions = (exts = []): ExtensionDataList => {\n if (exts.length) {\n const newExts = exts.map((extension: any) => {\n if (extension.extensionId) {\n const extensionId = ComponentID.fromObject(extension.extensionId);\n const entry = new ExtensionDataEntry(undefined, extensionId, undefined, extension.config, extension.data);\n return entry;\n }\n const entry = new ExtensionDataEntry(\n extension.id,\n undefined,\n extension.name,\n extension.config,\n extension.data\n );\n return entry;\n });\n return ExtensionDataList.fromModelObject(newExts);\n }\n return new ExtensionDataList();\n };\n\n const version = new Version({\n mainFile,\n files: files.map(parseFile),\n bindingPrefix,\n schema: schema || undefined,\n log: {\n // workaround for a bug where the log.message was saved as boolean when running `bit tag -m \"\"`\n // the bug was fixed since v0.1.27, but old objects might still have this bug\n message: typeof log.message !== 'string' ? '' : log.message,\n date: log.date,\n username: log.username,\n email: log.email,\n },\n docs,\n dependencies: _getDependencies(dependencies),\n devDependencies: _getDependencies(devDependencies),\n // backward compatibility. before introducing `flattenedEdgesRef`, we only had `flattenedEdges`. see getFlattenedEdges() for more info.\n flattenedEdges: flattenedEdgesRef ? [] : flattenedEdges?.map((f) => Version.depEdgeFromObject(f)) || [],\n flattenedEdgesRef: flattenedEdgesRef ? Ref.from(flattenedEdgesRef) : undefined,\n dependenciesGraphRef: dependenciesGraphRef ? Ref.from(dependenciesGraphRef) : undefined,\n flattenedDependenciesRef: flattenedDependenciesRef ? Ref.from(flattenedDependenciesRef) : undefined,\n devPackageDependencies,\n peerPackageDependencies,\n packageDependencies,\n overrides,\n packageJsonChangedProps,\n hash,\n parents: parents ? parents.map((p) => Ref.from(p)) : [],\n squashed: squashed\n ? { previousParents: squashed.previousParents.map((r) => Ref.from(r)), laneId: new LaneId(squashed.laneId) }\n : undefined,\n unrelated: unrelated ? { head: Ref.from(unrelated.head), laneId: new LaneId(unrelated.laneId) } : undefined,\n extensions: _getExtensions(extensions),\n buildStatus,\n bitVersion,\n modified,\n origin,\n hidden,\n batchId,\n });\n // until v15, there were both flattenedDependencies and flattenedDevDependencies. since then, they're grouped into\n // flattenedDependencies. an entry is either an id string or an id object.\n version.flattenedDependencyIds = [...(flattenedDependencies || []), ...(flattenedDevDependencies || [])].map(\n getFlattenedId\n );\n return version;\n }\n\n /**\n * used by raw-object.toRealObject()\n */\n static from(versionProps: VersionProps, hash: string): Version {\n return Version.parse(JSON.stringify(versionProps), hash);\n }\n\n /**\n * Create version model object from consumer component\n * @param {*} param0\n */\n static fromComponent({\n component,\n files,\n flattenedEdges,\n dependenciesGraph,\n }: {\n component: ConsumerComponent;\n files: Array<SourceFileModel>;\n flattenedEdges?: Source;\n dependenciesGraph?: Source;\n }) {\n const parseFile = (file) => {\n return {\n file: file.file.hash(),\n relativePath: file.relativePath,\n name: file.name,\n test: file.test,\n };\n };\n\n if (!component.log) throw new Error('Version.fromComponent - component.log is missing');\n const version = new Version({\n mainFile: pathNormalizeToLinux(component.mainFile),\n files: files.map(parseFile),\n bindingPrefix: component.bindingPrefix,\n log: component.log as Log,\n docs: component.docs,\n dependencies: component.dependencies.get(),\n devDependencies: component.devDependencies.get(),\n packageDependencies: component.packageDependencies,\n devPackageDependencies: component.devPackageDependencies,\n peerPackageDependencies: component.peerPackageDependencies,\n dependenciesGraphRef: dependenciesGraph?.hash(),\n flattenedDependencies: component.flattenedDependencies,\n // not saved in the Version when `flattenedEdgesRef` is set, see `toObject()`.\n flattenedEdges: component.flattenedEdges,\n flattenedEdgesRef: flattenedEdges?.hash(),\n schema: component.schema,\n overrides: component.overrides.componentOverridesData,\n packageJsonChangedProps: component.packageJsonChangedProps,\n extensions: component.extensions,\n buildStatus: component.buildStatus,\n componentId: component.id,\n bitVersion: getBitVersion(),\n });\n if (isSnap(component.version)) {\n version._hash = component.version as string;\n } else {\n version.setNewHash();\n }\n\n return version;\n }\n\n setNewHash() {\n this._hash = sha1(v4());\n }\n\n get ignoreSharedDir(): boolean {\n return !isSchemaSupport(SchemaFeature.sharedDir, this.schema);\n }\n\n get isLegacy(): boolean {\n return !this.schema || this.schema === SchemaName.Legacy;\n }\n\n get originLaneId(): LaneId | undefined {\n return this.origin?.lane ? new LaneId({ name: this.origin.lane.name, scope: this.origin.lane.scope }) : undefined;\n }\n get originId(): ComponentID | undefined {\n return this.origin?.id\n ? ComponentID.fromObject({ scope: this.origin.id.scope, name: this.origin.id.name })\n : undefined;\n }\n\n setDist(dist: Source | undefined) {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n this.dist = dist\n ? {\n file: dist.hash(),\n name: DEFAULT_BUNDLE_FILENAME,\n }\n : null;\n }\n\n hasParent(ref: Ref) {\n return this.parents.find((p) => p.toString() === ref.toString());\n }\n\n addParent(ref: Ref) {\n if (this.isLegacy) return;\n if (this.hasParent(ref)) {\n return; // make sure to not add twice\n }\n this.parents.push(ref);\n }\n\n setSquashed(squashData: SquashData, log: Log, replaceMessage?: string) {\n this.squashed = squashData;\n this.addModifiedLog(log);\n if (replaceMessage) {\n this.addModifiedLog({\n username: undefined,\n email: undefined,\n date: Date.now().toString(),\n message: `squashing: replacing the original log.message, which was: \"${this.log.message || '<empty>'}\"`,\n });\n this.log.message = replaceMessage;\n }\n }\n\n setUnrelated(externalHead: ExternalHead) {\n this.unrelated = externalHead;\n }\n\n addModifiedLog(log: Log) {\n this.modified.push(log);\n }\n\n addAsOnlyParent(ref: Ref) {\n if (this.isLegacy) return;\n this.parents = [ref];\n }\n\n removeParent(ref: Ref) {\n this.parents = this.parents.filter((p) => p.toString() !== ref.toString());\n }\n\n removeAllParents() {\n this.parents = [];\n }\n\n modelFilesToSourceFiles(repository: Repository): Promise<SourceFile[]> {\n return Promise.all(this.files.map((file) => SourceFile.loadFromSourceFileModel(file, repository)));\n }\n\n isRemoved(): boolean {\n return Boolean(this.extensions.findCoreExtension(Extensions.remove)?.config?.removed);\n }\n shouldRemoveFromMain(): boolean {\n return Boolean(this.extensions.findCoreExtension(Extensions.remove)?.config?.removeOnMain);\n }\n\n /**\n * Validate the version model properties, to make sure we are not inserting something\n * in the wrong format\n */\n validate(): void {\n validateVersionInstance(this);\n }\n}\n"],"mappings":";;;;;;AAAA,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,CAAC,KAAKsF,GAAG,CAACtF,QAAQ,CAAC,CAAC,CAAC;EAC5E;EAEAwL,gBAAgBA,CAAA,EAAG;IACjB,IAAI,CAAChN,OAAO,GAAG,EAAE;EACnB;EAEAiN,uBAAuBA,CAACC,UAAsB,EAAyB;IACrE,OAAOC,OAAO,CAACC,GAAG,CAAC,IAAI,CAACzO,KAAK,CAAC8C,GAAG,CAAE+E,IAAI,IAAK6G,uBAAU,CAACC,uBAAuB,CAAC9G,IAAI,EAAE0G,UAAU,CAAC,CAAC,CAAC;EACpG;EAEAK,SAASA,CAAA,EAAY;IACnB,OAAOC,OAAO,CAAC,IAAI,CAACrN,UAAU,CAACsN,iBAAiB,CAACC,oBAAU,CAACC,MAAM,CAAC,EAAElD,MAAM,EAAEmD,OAAO,CAAC;EACvF;EACAC,oBAAoBA,CAAA,EAAY;IAC9B,OAAOL,OAAO,CAAC,IAAI,CAACrN,UAAU,CAACsN,iBAAiB,CAACC,oBAAU,CAACC,MAAM,CAAC,EAAElD,MAAM,EAAEqD,YAAY,CAAC;EAC5F;;EAEA;AACF;AACA;AACA;EACE7E,QAAQA,CAAA,EAAS;IACf,IAAA8E,kCAAuB,EAAC,IAAI,CAAC;EAC/B;AACF;AAACC,OAAA,CAAAnS,OAAA,GAAAyC,OAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_lodash","data","require","_componentVersion","_componentId","_laneId","_uuid","_legacy","_legacy2","_component","_legacy3","_legacy4","_legacy5","_toolboxCrypto","_objects","_legacy6","_source","_interopRequireDefault","_dependenciesGraph","_bit","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","flattenedIdsCache","Map","flattenedIdStrsCache","MAX_CACHED_FLATTENED_IDS","cachedFlattenedIds","flattenedEdgesCache","WeakMap","MAX_CACHED_FLATTENED_EDGES","cachedFlattenedEdges","countCachedFlattenedId","clear","getFlattenedId","dep","id","get","ComponentID","fromString","set","box","fromObject","byName","scope","byVersion","name","version","getFlattenedEdge","source","target","type","byTarget","byType","edge","warnedFlattenedDependenciesGetter","Version","BitObject","constructor","props","mainFile","files","log","dependencies","Dependencies","devDependencies","peerDependencies","docs","flattenedDependencies","flattenedDependenciesRef","flattenedEdges","flattenedEdgesRef","dependenciesGraphRef","packageDependencies","devPackageDependencies","peerPackageDependencies","bindingPrefix","schema","overrides","packageJsonChangedProps","_hash","hash","parents","squashed","unrelated","extensions","ExtensionDataList","fromArray","buildStatus","componentId","bitVersion","modified","origin","hidden","batchId","validateVersion","getFlattenedEdges","repo","getWithBackwardCompatibility","throws","flattenedEdgesSource","load","flattenedEdgesJson","JSON","parse","contents","toString","map","item","Array","isArray","depEdgeFromArray","depEdgeFromObject","_flattenedEdges","loadDependenciesGraph","dependenciesGraphSource","DependenciesGraph","deserialize","nonEmptyFields","forEach","field","VersionInvalid","getDependencies","deps","clonedDependencies","cloneAsString","dependency","getExtensions","sortedConfigOnly","sortById","toConfigArray","filterFunction","val","key","isEmpty","stringify","pickBy","filesToObject","logToObject","extensionDependencies","calculateHash","Ref","makeHash","Error","extensionsBitIds","Dependency","lastModified","length","date","logger","warn","stack","getLoadedFlattenedDependencies","_flattenedDependencies","ComponentIdList","flattenedDependencyIds","undefined","getFlattenedDependenciesIfLoaded","loadFlattenedDependencies","objects","setFlattenedDependenciesFromSource","loadFlattenedDependenciesSync","getFromMemory","loadSync","ids","moveFlattenedDependenciesToSource","Source","from","Buffer","getAllDependencies","depsIdsGroupedByType","getAllIds","getAllDependenciesCloned","getClone","getAllDependenciesIds","allDependencies","values","flat","getDependenciesIdsExcludeExtensions","refs","refsWithOptions","includeParents","includeArtifacts","allRefs","extractRefsFromFiles","file","push","artifacts","getRefsFromExtensions","refsWithoutParents","filter","ref","collectManyObjects","loadManyRaw","depEdgeToObject","depEdge","serialize","depEdgeObj","depEdgeToArray","depEdgeArr","sourceStr","targetStr","flattenedEdgeToSource","flattenedEdgesObj","f","flattenedEdgesBuffer","dependenciesGraphToSource","dependenciesGraph","dependenciesGraphBuffer","relativePath","test","message","username","email","toObject","cloneAsObject","toModelObjects","p","previousParents","laneId","head","validateBeforePersisting","versionStr","trace","validate","toBuffer","pretty","obj","args","getStringifyArgs","str","validateBeforePersist","contentParsed","flattenedDevDependencies","_getDependencies","getRelativePath","importSpecifiers","importSpecifier","BitIdCompIdError","relativePaths","parseFile","_getExtensions","exts","newExts","extension","extensionId","entry","ExtensionDataEntry","config","fromModelObject","LaneId","versionProps","fromComponent","component","pathNormalizeToLinux","componentOverridesData","getBitVersion","isSnap","setNewHash","sha1","v4","ignoreSharedDir","isSchemaSupport","SchemaFeature","sharedDir","isLegacy","SchemaName","Legacy","originLaneId","lane","originId","hasParent","find","addParent","setSquashed","squashData","replaceMessage","addModifiedLog","Date","now","setUnrelated","externalHead","addAsOnlyParent","removeParent","removeAllParents","modelFilesToSourceFiles","repository","Promise","all","SourceFile","loadFromSourceFileModel","isRemoved","Boolean","findCoreExtension","Extensions","remove","removed","shouldRemoveFromMain","removeOnMain","validateVersionInstance","exports"],"sources":["version.ts"],"sourcesContent":["import { isEmpty, pickBy } from 'lodash';\nimport { isSnap } from '@teambit/component-version';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { LaneId } from '@teambit/lane-id';\nimport { v4 } from 'uuid';\nimport type { BuildStatus } from '@teambit/legacy.constants';\nimport { Extensions } from '@teambit/legacy.constants';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport {\n isSchemaSupport,\n SchemaFeature,\n SchemaName,\n Dependencies,\n Dependency,\n} from '@teambit/legacy.consumer-component';\nimport { getRefsFromExtensions, SourceFile } from '@teambit/component.sources';\nimport type { ComponentOverridesData } from '@teambit/legacy.consumer-config';\nimport { ExtensionDataEntry, ExtensionDataList } from '@teambit/legacy.extension-data';\nimport type { Doclet } from '@teambit/semantics.doc-parser';\nimport { logger } from '@teambit/legacy.logger';\nimport type { PathLinux } from '@teambit/legacy.utils';\nimport { getStringifyArgs, pathNormalizeToLinux } from '@teambit/legacy.utils';\nimport { sha1 } from '@teambit/toolbox.crypto.sha1';\nimport type { Repository } from '../objects';\nimport { BitObject, Ref } from '../objects';\nimport type { ObjectItem } from '../objects/object-list';\nimport { BitIdCompIdError, VersionInvalid, validateVersionInstance } from '@teambit/legacy.scope';\nimport Source from './source';\nimport { DependenciesGraph } from './dependencies-graph';\nimport { getBitVersion } from '@teambit/bit.get-bit-version';\n\n// the same flattened dependencies repeat across versions. in a typical scope, hundreds of thousands of entries are a\n// few thousand unique ids. ids are immutable, so the versions share them instead of each holding its own copies.\n// an id object is looked up by its parts (scope, then name, then version). building a key string for each entry instead\n// is slower than creating a new id.\nconst flattenedIdsCache = new Map<string, Map<string, Map<string, ComponentID>>>();\nconst flattenedIdStrsCache = new Map<string, ComponentID>();\nconst MAX_CACHED_FLATTENED_IDS = 100_000;\nlet cachedFlattenedIds = 0;\nlet flattenedEdgesCache = new WeakMap<ComponentID, Map<ComponentID, Map<DepEdgeType, DepEdge>>>();\nconst MAX_CACHED_FLATTENED_EDGES = 100_000;\nlet cachedFlattenedEdges = 0;\n\nfunction countCachedFlattenedId() {\n if (cachedFlattenedIds >= MAX_CACHED_FLATTENED_IDS) {\n flattenedIdsCache.clear();\n flattenedIdStrsCache.clear();\n cachedFlattenedIds = 0;\n flattenedEdgesCache = new WeakMap();\n cachedFlattenedEdges = 0;\n }\n cachedFlattenedIds += 1;\n}\n\nfunction getFlattenedId(dep: string | Record<string, any>): ComponentID {\n if (typeof dep === 'string') {\n let id = flattenedIdStrsCache.get(dep);\n if (!id) {\n countCachedFlattenedId();\n id = ComponentID.fromString(dep);\n flattenedIdStrsCache.set(dep, id);\n }\n return id;\n }\n if (dep.box) return ComponentID.fromObject(dep as any); // legacy ids, rare. not worth another level.\n let byName = flattenedIdsCache.get(dep.scope);\n if (!byName) {\n byName = new Map();\n flattenedIdsCache.set(dep.scope, byName);\n }\n let byVersion = byName.get(dep.name);\n if (!byVersion) {\n byVersion = new Map();\n byName.set(dep.name, byVersion);\n }\n let id = byVersion.get(dep.version);\n if (!id) {\n countCachedFlattenedId();\n id = ComponentID.fromObject(dep as any);\n byVersion.set(dep.version, id);\n }\n return id;\n}\n\nfunction getFlattenedEdge(source: ComponentID, target: ComponentID, type: DepEdgeType): DepEdge {\n if (cachedFlattenedEdges >= MAX_CACHED_FLATTENED_EDGES) {\n flattenedEdgesCache = new WeakMap();\n cachedFlattenedEdges = 0;\n }\n let byTarget = flattenedEdgesCache.get(source);\n if (!byTarget) {\n byTarget = new Map();\n flattenedEdgesCache.set(source, byTarget);\n }\n let byType = byTarget.get(target);\n if (!byType) {\n byType = new Map();\n byTarget.set(target, byType);\n }\n let edge = byType.get(type);\n if (!edge) {\n cachedFlattenedEdges += 1;\n edge = { source, target, type };\n byType.set(type, edge);\n }\n return edge;\n}\n\n// the deprecated `Version.flattenedDependencies` getter warns only once per process.\nlet warnedFlattenedDependenciesGetter = false;\n\nexport type SourceFileModel = {\n name: string;\n relativePath: PathLinux;\n test: boolean;\n file: Ref;\n};\n\nexport type DistFileModel = SourceFileModel;\n\nexport type ArtifactFileModel = {\n relativePath: PathLinux;\n file: Ref;\n};\n\nexport type Log = {\n message: string;\n date: string;\n username: string | undefined;\n email: string | undefined;\n};\n\n// anything objects can be loaded from by their ref: the scope repository, or the objects received from a remote.\nexport type ObjectsLoader = { load(ref: Ref, throws?: boolean): Promise<BitObject | undefined> };\n\nexport type DepEdgeType = 'prod' | 'dev' | 'peer' | 'ext';\nexport type DepEdge = { source: ComponentID; target: ComponentID; type: DepEdgeType };\n\ntype ExternalHead = { head: Ref; laneId: LaneId };\ntype SquashData = { previousParents: Ref[]; laneId: LaneId };\ntype VersionOrigin = { id: { scope: string; name: string }; lane?: { scope: string; name: string; hash: string } };\n\nexport type VersionProps = {\n mainFile: PathLinux;\n files: Array<SourceFileModel>;\n log: Log;\n docs?: Doclet[];\n dependencies?: Dependency[];\n devDependencies?: Dependency[];\n peerDependencies?: Dependency[];\n flattenedDependencies?: ComponentIdList;\n flattenedDependenciesRef?: Ref;\n _flattenedEdges?: DepEdge[];\n flattenedEdges?: DepEdge[];\n flattenedEdgesRef?: Ref;\n dependenciesGraphRef?: Ref;\n packageDependencies?: { [key: string]: string };\n devPackageDependencies?: { [key: string]: string };\n peerPackageDependencies?: { [key: string]: string };\n bindingPrefix: string;\n schema?: string;\n overrides: ComponentOverridesData;\n packageJsonChangedProps?: Record<string, any>;\n hash?: string;\n parents?: Ref[];\n squashed?: SquashData;\n unrelated?: ExternalHead;\n extensions?: ExtensionDataList;\n buildStatus?: BuildStatus;\n componentId?: ComponentID;\n bitVersion?: string;\n modified?: Log[];\n origin?: VersionOrigin;\n hidden?: boolean;\n batchId?: string;\n};\n\n/**\n * Represent a version model in the scope\n */\nexport default class Version extends BitObject {\n mainFile: PathLinux;\n files: Array<SourceFileModel>;\n log: Log;\n docs: Doclet[] | undefined;\n dependencies: Dependencies;\n devDependencies: Dependencies;\n peerDependencies: Dependencies;\n private _flattenedDependencies?: ComponentIdList;\n // the flattened dependencies of a parsed Version. the list is built on first access, most commands never read it.\n private flattenedDependencyIds?: ComponentID[];\n /**\n * ref to a Source object with the flattened dependencies, as a JSON array of id strings. when it's set, the Version\n * itself has no flattened dependencies, and they have to be loaded with `loadFlattenedDependencies()`.\n */\n flattenedDependenciesRef?: Ref;\n dependenciesGraphRef?: Ref;\n _dependenciesGraph?: DependenciesGraph; // caching for the dependencies graph\n flattenedEdgesRef?: Ref; // ref to a BitObject Source file, which is a JSON object containing the flattened edge\n _flattenedEdges?: DepEdge[]; // caching for the flattenedEdges\n /**\n * @deprecated\n * to get the flattenedEdges, please use `this.getFlattenedEdges()`, which supports both formats.\n * this holds the edges of old Versions, which were saved inside the Version, before `flattenedEdgesRef` was\n * introduced. Versions that have `flattenedEdgesRef` don't save the edges here (see `toObject()`).\n */\n private flattenedEdges: DepEdge[];\n packageDependencies: { [key: string]: string };\n devPackageDependencies: { [key: string]: string };\n peerPackageDependencies: { [key: string]: string };\n bindingPrefix: string;\n schema: string | undefined;\n overrides: ComponentOverridesData;\n packageJsonChangedProps: Record<string, any>;\n _hash: string; // reason for the underscore prefix is that we already have hash as a method\n parents: Ref[];\n squashed?: SquashData; // when a component is squashed during lane-merge\n unrelated?: ExternalHead; // when a component from a lane was created with the same name/scope as main, this ref points to the component of the lane\n extensions: ExtensionDataList;\n buildStatus?: BuildStatus;\n componentId?: ComponentID; // can help debugging errors when validating Version object\n bitVersion?: string;\n modified: Log[] = []; // currently mutation could happen as a result of either \"squash\" or \"sign\".\n // where this version was made: the component id it was snapped as, and the lane it was snapped on\n // (absent on main). set on every snap and tag, see SnappingMain.addSource. it is read as data, not\n // only as a debugging aid: Scope.isPartOfLaneHistoryOrMain tells a snap of a given lane from one of\n // main by it, and ModelComponent.filterLeanLaneRefs keeps the refs a lean lane scope owns by it.\n origin?: VersionOrigin;\n hidden?: boolean; // whether the version is hidden from commands such as \"bit log\", \"bit blame\". (needed for un-meaningful snaps, such as merged-lane snap prior to the tag)\n batchId?: string; // a shared UUID for all versions created in the same snap/tag operation\n\n constructor(props: VersionProps) {\n super();\n this.mainFile = props.mainFile;\n this.files = props.files;\n this.log = props.log;\n this.dependencies = new Dependencies(props.dependencies);\n this.devDependencies = new Dependencies(props.devDependencies);\n this.peerDependencies = new Dependencies(props.peerDependencies);\n this.docs = props.docs;\n if (props.flattenedDependencies) this.flattenedDependencies = props.flattenedDependencies;\n this.flattenedDependenciesRef = props.flattenedDependenciesRef;\n this.flattenedEdges = props.flattenedEdges || [];\n this.flattenedEdgesRef = props.flattenedEdgesRef;\n this.dependenciesGraphRef = props.dependenciesGraphRef;\n this.packageDependencies = props.packageDependencies || {};\n this.devPackageDependencies = props.devPackageDependencies || {};\n this.peerPackageDependencies = props.peerPackageDependencies || {};\n this.bindingPrefix = props.bindingPrefix;\n this.schema = props.schema;\n this.overrides = props.overrides || {};\n this.packageJsonChangedProps = props.packageJsonChangedProps || {};\n // @ts-ignore yes, props.hash can be undefined here, but it gets populated as soon as Version is created\n this._hash = props.hash;\n this.parents = props.parents || [];\n this.squashed = props.squashed;\n this.unrelated = props.unrelated;\n this.extensions = props.extensions || ExtensionDataList.fromArray([]);\n this.buildStatus = props.buildStatus;\n this.componentId = props.componentId;\n this.bitVersion = props.bitVersion;\n this.modified = props.modified || [];\n this.origin = props.origin;\n this.hidden = props.hidden;\n this.batchId = props.batchId;\n this.validateVersion();\n }\n\n /**\n * use only this method to get the flattened edges (graph of flattened dependencies).\n * it's backward compatible with the previous way this was stored on the Version object itself.\n */\n async getFlattenedEdges(repo: Repository): Promise<DepEdge[]> {\n const getWithBackwardCompatibility = async (): Promise<DepEdge[]> => {\n if (this.flattenedEdgesRef) {\n // it's possible that there is a ref but the file is not there.\n // it can happen if the remote-scope uses an older version that doesn't know to collect this ref.\n // in which case, the client will get the Version object with the ref prop, but not the Source object.\n const throws = false;\n const flattenedEdgesSource = (await repo.load(this.flattenedEdgesRef, throws)) as Source | undefined;\n if (flattenedEdgesSource) {\n const flattenedEdgesJson = JSON.parse(flattenedEdgesSource.contents.toString());\n return flattenedEdgesJson.map((item) =>\n Array.isArray(item) ? Version.depEdgeFromArray(item) : Version.depEdgeFromObject(item)\n );\n }\n }\n return this.flattenedEdges || [];\n };\n\n if (!this._flattenedEdges) {\n this._flattenedEdges = await getWithBackwardCompatibility();\n }\n\n return this._flattenedEdges;\n }\n\n async loadDependenciesGraph(repo: Repository): Promise<DependenciesGraph | undefined> {\n if (!this._dependenciesGraph) {\n if (this.dependenciesGraphRef) {\n // it's possible that there is a ref but the file is not there.\n // it can happen if the remote-scope uses an older version that doesn't know to collect this ref.\n // in which case, the client will get the Version object with the ref prop, but not the Source object.\n const throws = false;\n const dependenciesGraphSource = (await repo.load(this.dependenciesGraphRef, throws)) as Source | undefined;\n if (dependenciesGraphSource) {\n this._dependenciesGraph = DependenciesGraph.deserialize(dependenciesGraphSource.contents.toString());\n }\n }\n }\n return this._dependenciesGraph;\n }\n\n validateVersion() {\n const nonEmptyFields = ['mainFile', 'files'];\n nonEmptyFields.forEach((field) => {\n if (!this[field]) {\n throw new VersionInvalid(`failed creating a version object, the field \"${field}\" can't be empty`);\n }\n });\n }\n\n id() {\n const getDependencies = (deps: Dependencies) => {\n const clonedDependencies = deps.cloneAsString();\n return clonedDependencies.map((dependency) => {\n return {\n id: dependency.id,\n };\n });\n };\n\n const getExtensions = (extensions: ExtensionDataList) => {\n const sortedConfigOnly = extensions.sortById().toConfigArray();\n return sortedConfigOnly;\n };\n\n const filterFunction = (val, key) => {\n if (\n key === 'devDependencies' ||\n key === 'extensionDependencies' ||\n key === 'devPackageDependencies' ||\n key === 'peerPackageDependencies' ||\n key === 'overrides' ||\n key === 'extensions'\n ) {\n return !isEmpty(val);\n }\n return !!val;\n };\n\n return JSON.stringify(\n pickBy(\n {\n // only what the hash needs, not `toObject()`, which serializes the whole version (e.g. a deep clone of all extensions)\n mainFile: this.mainFile,\n files: this.filesToObject(),\n log: this.logToObject(),\n dependencies: getDependencies(this.dependencies),\n devDependencies: getDependencies(this.devDependencies),\n extensionDependencies: getDependencies(this.extensionDependencies),\n packageDependencies: this.packageDependencies,\n devPackageDependencies: this.devPackageDependencies,\n peerPackageDependencies: this.peerPackageDependencies,\n bindingPrefix: this.bindingPrefix,\n overrides: this.overrides,\n extensions: getExtensions(this.extensions),\n },\n filterFunction\n )\n );\n }\n\n calculateHash(): Ref {\n return new Ref(BitObject.makeHash(this.id()));\n }\n\n hash(): Ref {\n if (!this._hash) {\n throw new Error('hash is missing from a Version object');\n }\n return new Ref(this._hash);\n }\n\n get extensionDependencies() {\n return new Dependencies(this.extensions.extensionsBitIds.map((id) => new Dependency(id, [])));\n }\n\n lastModified(): string {\n if (!this.modified || !this.modified.length) return this.log.date;\n return this.modified[this.modified.length - 1].date;\n }\n\n /**\n * @deprecated use `await version.loadFlattenedDependencies(repo)`, which supports both formats. this getter throws\n * when the flattened dependencies are stored in a separate object (`flattenedDependenciesRef`) and weren't loaded.\n * bit doesn't write this format yet, so until it does (around Oct 2027), the getter keeps working.\n */\n get flattenedDependencies(): ComponentIdList {\n if (!warnedFlattenedDependenciesGetter) {\n warnedFlattenedDependenciesGetter = true;\n logger.warn(\n `Version.flattenedDependencies is deprecated and will throw for newer versions, use \"await version.loadFlattenedDependencies(repo)\" instead`,\n new Error().stack\n );\n }\n return this.getLoadedFlattenedDependencies();\n }\n\n /**\n * the flattened dependencies, when they're stored in the Version itself or were loaded already. throws otherwise,\n * when they're stored in a separate object (`flattenedDependenciesRef`), use `loadFlattenedDependencies()`.\n */\n getLoadedFlattenedDependencies(): ComponentIdList {\n if (!this._flattenedDependencies) {\n if (this.flattenedDependenciesRef) {\n throw new Error(\n `the flattened dependencies of version ${this._hash} are stored in the object ${this.flattenedDependenciesRef.toString()}, load them with loadFlattenedDependencies()`\n );\n }\n this._flattenedDependencies = ComponentIdList.fromArray(this.flattenedDependencyIds || []);\n this.flattenedDependencyIds = undefined;\n }\n return this._flattenedDependencies;\n }\n\n /**\n * a new list is saved in the Version itself, so a ref to a separate object, if there was one, is dropped.\n */\n set flattenedDependencies(flattenedDependencies: ComponentIdList) {\n this._flattenedDependencies = flattenedDependencies;\n this.flattenedDependencyIds = undefined;\n this.flattenedDependenciesRef = undefined;\n }\n\n /**\n * the flattened dependencies, if they're available without loading a separate object. otherwise, undefined.\n */\n getFlattenedDependenciesIfLoaded(): ComponentIdList | undefined {\n if (this.flattenedDependenciesRef && !this._flattenedDependencies) return undefined;\n return this.getLoadedFlattenedDependencies();\n }\n\n /**\n * use this to get the flattened dependencies. it supports both formats: stored in the Version itself, or stored in\n * a separate Source object (`flattenedDependenciesRef`). `objects` is usually the scope repository, but can be any\n * container of the objects, such as the objects received from a remote.\n */\n async loadFlattenedDependencies(objects: ObjectsLoader): Promise<ComponentIdList> {\n if (this._flattenedDependencies || !this.flattenedDependenciesRef) return this.getLoadedFlattenedDependencies();\n const source = (await objects.load(this.flattenedDependenciesRef, false)) as Source | undefined;\n return this.setFlattenedDependenciesFromSource(source);\n }\n\n /**\n * same as `loadFlattenedDependencies()`, for code that can't be async.\n */\n loadFlattenedDependenciesSync(repo: Repository): ComponentIdList {\n if (this._flattenedDependencies || !this.flattenedDependenciesRef) return this.getLoadedFlattenedDependencies();\n // objects added during tag, or fetched from a remote without being imported, are only in memory, not on the disk.\n const source = (repo.getFromMemory(this.flattenedDependenciesRef) ||\n repo.loadSync(this.flattenedDependenciesRef, false)) as Source | undefined;\n return this.setFlattenedDependenciesFromSource(source);\n }\n\n private setFlattenedDependenciesFromSource(source?: Source): ComponentIdList {\n if (!source) {\n // unlike the flattened edges, there is no fallback here. an empty list would be wrong, not just less efficient.\n throw new Error(\n `unable to find the object ${this.flattenedDependenciesRef?.toString()} with the flattened dependencies of version ${this._hash}`\n );\n }\n const ids: string[] = JSON.parse(source.contents.toString());\n // not by the setter, which would drop the ref.\n this._flattenedDependencies = ComponentIdList.fromArray(ids.map(getFlattenedId));\n this.flattenedDependencyIds = undefined;\n return this._flattenedDependencies;\n }\n\n /**\n * moves the flattened dependencies out of this Version into a new Source object, which the caller has to persist.\n */\n moveFlattenedDependenciesToSource(): Source | undefined {\n const flattenedDependencies = this.getLoadedFlattenedDependencies();\n if (!flattenedDependencies.length) return undefined;\n const source = Source.from(Buffer.from(JSON.stringify(flattenedDependencies.map((id) => id.toString()))));\n this.flattenedDependenciesRef = source.hash();\n return source;\n }\n\n getAllDependencies(): Dependency[] {\n return [\n ...this.dependencies.dependencies,\n ...this.devDependencies.dependencies,\n ...this.extensionDependencies.dependencies,\n ];\n }\n\n get depsIdsGroupedByType(): {\n dependencies: ComponentIdList;\n devDependencies: ComponentIdList;\n peerDependencies: ComponentIdList;\n extensionDependencies: ComponentIdList;\n } {\n return {\n dependencies: this.dependencies.getAllIds(),\n devDependencies: this.devDependencies.getAllIds(),\n peerDependencies: this.peerDependencies.getAllIds(),\n extensionDependencies: this.extensions.extensionsBitIds,\n };\n }\n\n getAllDependenciesCloned(): Dependencies {\n const dependencies = [...this.dependencies.getClone(), ...this.devDependencies.getClone()];\n return new Dependencies(dependencies);\n }\n\n getAllDependenciesIds(): ComponentIdList {\n const allDependencies = Object.values(this.depsIdsGroupedByType).flat();\n return ComponentIdList.fromArray(allDependencies);\n }\n\n getDependenciesIdsExcludeExtensions(): ComponentIdList {\n return ComponentIdList.fromArray([...this.dependencies.getAllIds(), ...this.devDependencies.getAllIds()]);\n }\n\n refs(): Ref[] {\n return this.refsWithOptions();\n }\n\n refsWithOptions(includeParents = true, includeArtifacts = true): Ref[] {\n const allRefs: Ref[] = [];\n const extractRefsFromFiles = (files) => {\n const refs = files ? files.map((file) => file.file) : [];\n return refs;\n };\n const files = extractRefsFromFiles(this.files);\n allRefs.push(...files);\n if (includeParents) {\n allRefs.push(...this.parents);\n }\n if (includeArtifacts) {\n const artifacts = getRefsFromExtensions(this.extensions);\n allRefs.push(...artifacts);\n }\n if (this.flattenedEdgesRef) allRefs.push(this.flattenedEdgesRef);\n if (this.dependenciesGraphRef) allRefs.push(this.dependenciesGraphRef);\n if (this.flattenedDependenciesRef) allRefs.push(this.flattenedDependenciesRef);\n return allRefs;\n }\n\n refsWithoutParents(): Ref[] {\n const extractRefsFromFiles = (files) => {\n const refs = files ? files.map((file) => file.file) : [];\n return refs;\n };\n const files = extractRefsFromFiles(this.files);\n const artifacts = getRefsFromExtensions(this.extensions);\n return [...files, ...artifacts].filter((ref) => ref);\n }\n\n async collectManyObjects(repo: Repository, refs: Ref[]): Promise<ObjectItem[]> {\n return repo.loadManyRaw(refs);\n }\n\n static depEdgeToObject(depEdge: DepEdge): Record<string, any> {\n return {\n source: depEdge.source.serialize(),\n target: depEdge.target.serialize(),\n type: depEdge.type,\n };\n }\n static depEdgeFromObject(depEdgeObj: Record<string, any>): DepEdge {\n return getFlattenedEdge(getFlattenedId(depEdgeObj.source), getFlattenedId(depEdgeObj.target), depEdgeObj.type);\n }\n /**\n * until 1.9.86, we used depEdgeToObject.\n * this one makes this object much much smaller (for 604 edges, it's now 143KB, with the array format it's 6KB!)\n * this format has been supported (but not used) since v1.6.97.\n */\n static depEdgeToArray(depEdge: DepEdge): Record<string, any> {\n return [depEdge.source.toString(), depEdge.target.toString(), depEdge.type];\n }\n static depEdgeFromArray(depEdgeArr: string[]): DepEdge {\n const [sourceStr, targetStr, type] = depEdgeArr;\n return getFlattenedEdge(getFlattenedId(sourceStr), getFlattenedId(targetStr), type as DepEdgeType);\n }\n static flattenedEdgeToSource(flattenedEdges?: DepEdge[]): Source | undefined {\n if (!flattenedEdges) return undefined;\n // const flattenedEdgesObj = flattenedEdges.map((f) => Version.depEdgeToArray(f));\n const flattenedEdgesObj = flattenedEdges.map((f) => Version.depEdgeToObject(f));\n const flattenedEdgesBuffer = Buffer.from(JSON.stringify(flattenedEdgesObj));\n return Source.from(flattenedEdgesBuffer);\n }\n static dependenciesGraphToSource(dependenciesGraph?: DependenciesGraph): Source | undefined {\n if (!dependenciesGraph) return undefined;\n const dependenciesGraphBuffer = Buffer.from(dependenciesGraph.serialize());\n return Source.from(dependenciesGraphBuffer);\n }\n\n private filesToObject() {\n return this.files?.map((file) => ({\n file: file.file.toString(),\n relativePath: file.relativePath,\n name: file.name,\n test: file.test,\n }));\n }\n\n private logToObject() {\n return {\n message: this.log.message,\n date: this.log.date,\n username: this.log.username,\n email: this.log.email,\n };\n }\n\n toObject() {\n return pickBy(\n {\n files: this.filesToObject(),\n mainFile: this.mainFile,\n bindingPrefix: this.bindingPrefix,\n schema: this.schema,\n log: this.logToObject(),\n docs: this.docs,\n dependencies: this.dependencies.cloneAsObject(),\n devDependencies: this.devDependencies.cloneAsObject(),\n flattenedDependencies: this.flattenedDependenciesRef\n ? undefined\n : this.getLoadedFlattenedDependencies().map((dep) => dep.toObject()),\n flattenedDependenciesRef: this.flattenedDependenciesRef?.toString(),\n flattenedEdges: this.flattenedEdgesRef ? undefined : this.flattenedEdges.map((f) => Version.depEdgeToObject(f)),\n flattenedEdgesRef: this.flattenedEdgesRef?.toString(),\n dependenciesGraphRef: this.dependenciesGraphRef?.toString(),\n extensions: this.extensions.toModelObjects(),\n packageDependencies: this.packageDependencies,\n devPackageDependencies: this.devPackageDependencies,\n peerPackageDependencies: this.peerPackageDependencies,\n overrides: this.overrides,\n buildStatus: this.buildStatus,\n packageJsonChangedProps: this.packageJsonChangedProps,\n parents: this.parents.map((p) => p.toString()),\n squashed: this.squashed\n ? {\n previousParents: this.squashed.previousParents.map((p) => p.toString()),\n laneId: this.squashed.laneId.toObject(),\n }\n : undefined,\n unrelated: this.unrelated\n ? { head: this.unrelated.head.toString(), laneId: this.unrelated.laneId.toObject() }\n : undefined,\n bitVersion: this.bitVersion,\n modified: this.modified,\n origin: this.origin,\n hidden: this.hidden,\n batchId: this.batchId,\n },\n (val) => !!val\n );\n }\n\n validateBeforePersisting(versionStr: string): void {\n logger.trace(`validating version object, hash: ${this.hash().hash}`);\n const version = Version.parse(versionStr, this._hash);\n version.validate();\n }\n\n toBuffer(pretty: boolean): Buffer {\n const obj = this.toObject();\n const args = getStringifyArgs(pretty);\n const str = JSON.stringify(obj, ...args);\n if (this.validateBeforePersist) this.validateBeforePersisting(str);\n return Buffer.from(str);\n }\n /**\n * used by the super class BitObject\n */\n static parse(contents: string, hash: string): Version {\n const contentParsed = JSON.parse(contents);\n const {\n mainFile,\n files,\n bindingPrefix,\n schema,\n log,\n docs,\n dependencies,\n devDependencies,\n flattenedDependencies,\n flattenedDevDependencies,\n flattenedDependenciesRef,\n flattenedEdges,\n flattenedEdgesRef,\n dependenciesGraphRef,\n devPackageDependencies,\n peerPackageDependencies,\n packageDependencies,\n overrides,\n packageJsonChangedProps,\n extensions,\n buildStatus,\n parents,\n squashed,\n unrelated,\n bitVersion,\n modified,\n origin,\n hidden,\n batchId,\n } = contentParsed;\n\n const _getDependencies = (deps = []): Dependency[] => {\n const getRelativePath = (relativePath) => {\n if (relativePath.importSpecifiers) {\n // backward compatibility. Before the massive validation was added, an item of\n // relativePath.importSpecifiers array could be missing the mainFile property, which is\n // an invalid ImportSpecifier. (instead the mainFile it had another importSpecifiers object).\n relativePath.importSpecifiers = relativePath.importSpecifiers.filter(\n (importSpecifier) => importSpecifier.mainFile\n );\n if (!relativePath.importSpecifiers.length) delete relativePath.importSpecifiers;\n }\n\n return relativePath;\n };\n\n return deps.map((dependency: any) => {\n if (!dependency.id.scope) {\n throw new BitIdCompIdError(dependency.id.name);\n }\n return new Dependency(\n ComponentID.fromObject(dependency.id),\n Array.isArray(dependency.relativePaths)\n ? dependency.relativePaths.map(getRelativePath)\n : dependency.relativePaths\n );\n });\n };\n\n const parseFile = (file) => {\n return {\n file: Ref.from(file.file),\n relativePath: file.relativePath,\n name: file.name,\n test: file.test,\n };\n };\n const _getExtensions = (exts = []): ExtensionDataList => {\n if (exts.length) {\n const newExts = exts.map((extension: any) => {\n if (extension.extensionId) {\n const extensionId = ComponentID.fromObject(extension.extensionId);\n const entry = new ExtensionDataEntry(undefined, extensionId, undefined, extension.config, extension.data);\n return entry;\n }\n const entry = new ExtensionDataEntry(\n extension.id,\n undefined,\n extension.name,\n extension.config,\n extension.data\n );\n return entry;\n });\n return ExtensionDataList.fromModelObject(newExts);\n }\n return new ExtensionDataList();\n };\n\n const version = new Version({\n mainFile,\n files: files.map(parseFile),\n bindingPrefix,\n schema: schema || undefined,\n log: {\n // workaround for a bug where the log.message was saved as boolean when running `bit tag -m \"\"`\n // the bug was fixed since v0.1.27, but old objects might still have this bug\n message: typeof log.message !== 'string' ? '' : log.message,\n date: log.date,\n username: log.username,\n email: log.email,\n },\n docs,\n dependencies: _getDependencies(dependencies),\n devDependencies: _getDependencies(devDependencies),\n // backward compatibility. before introducing `flattenedEdgesRef`, we only had `flattenedEdges`. see getFlattenedEdges() for more info.\n flattenedEdges: flattenedEdgesRef ? [] : flattenedEdges?.map((f) => Version.depEdgeFromObject(f)) || [],\n flattenedEdgesRef: flattenedEdgesRef ? Ref.from(flattenedEdgesRef) : undefined,\n dependenciesGraphRef: dependenciesGraphRef ? Ref.from(dependenciesGraphRef) : undefined,\n flattenedDependenciesRef: flattenedDependenciesRef ? Ref.from(flattenedDependenciesRef) : undefined,\n devPackageDependencies,\n peerPackageDependencies,\n packageDependencies,\n overrides,\n packageJsonChangedProps,\n hash,\n parents: parents ? parents.map((p) => Ref.from(p)) : [],\n squashed: squashed\n ? { previousParents: squashed.previousParents.map((r) => Ref.from(r)), laneId: new LaneId(squashed.laneId) }\n : undefined,\n unrelated: unrelated ? { head: Ref.from(unrelated.head), laneId: new LaneId(unrelated.laneId) } : undefined,\n extensions: _getExtensions(extensions),\n buildStatus,\n bitVersion,\n modified,\n origin,\n hidden,\n batchId,\n });\n // until v15, there were both flattenedDependencies and flattenedDevDependencies. since then, they're grouped into\n // flattenedDependencies. an entry is either an id string or an id object.\n version.flattenedDependencyIds = [...(flattenedDependencies || []), ...(flattenedDevDependencies || [])].map(\n getFlattenedId\n );\n return version;\n }\n\n /**\n * used by raw-object.toRealObject()\n */\n static from(versionProps: VersionProps, hash: string): Version {\n return Version.parse(JSON.stringify(versionProps), hash);\n }\n\n /**\n * Create version model object from consumer component\n * @param {*} param0\n */\n static fromComponent({\n component,\n files,\n flattenedEdges,\n dependenciesGraph,\n }: {\n component: ConsumerComponent;\n files: Array<SourceFileModel>;\n flattenedEdges?: Source;\n dependenciesGraph?: Source;\n }) {\n const parseFile = (file) => {\n return {\n file: file.file.hash(),\n relativePath: file.relativePath,\n name: file.name,\n test: file.test,\n };\n };\n\n if (!component.log) throw new Error('Version.fromComponent - component.log is missing');\n const version = new Version({\n mainFile: pathNormalizeToLinux(component.mainFile),\n files: files.map(parseFile),\n bindingPrefix: component.bindingPrefix,\n log: component.log as Log,\n docs: component.docs,\n dependencies: component.dependencies.get(),\n devDependencies: component.devDependencies.get(),\n packageDependencies: component.packageDependencies,\n devPackageDependencies: component.devPackageDependencies,\n peerPackageDependencies: component.peerPackageDependencies,\n dependenciesGraphRef: dependenciesGraph?.hash(),\n flattenedDependencies: component.flattenedDependencies,\n // not saved in the Version when `flattenedEdgesRef` is set, see `toObject()`.\n flattenedEdges: flattenedEdges ? [] : component.flattenedEdges,\n flattenedEdgesRef: flattenedEdges?.hash(),\n schema: component.schema,\n overrides: component.overrides.componentOverridesData,\n packageJsonChangedProps: component.packageJsonChangedProps,\n extensions: component.extensions,\n buildStatus: component.buildStatus,\n componentId: component.id,\n bitVersion: getBitVersion(),\n });\n if (isSnap(component.version)) {\n version._hash = component.version as string;\n } else {\n version.setNewHash();\n }\n\n return version;\n }\n\n setNewHash() {\n this._hash = sha1(v4());\n }\n\n get ignoreSharedDir(): boolean {\n return !isSchemaSupport(SchemaFeature.sharedDir, this.schema);\n }\n\n get isLegacy(): boolean {\n return !this.schema || this.schema === SchemaName.Legacy;\n }\n\n get originLaneId(): LaneId | undefined {\n return this.origin?.lane ? new LaneId({ name: this.origin.lane.name, scope: this.origin.lane.scope }) : undefined;\n }\n get originId(): ComponentID | undefined {\n return this.origin?.id\n ? ComponentID.fromObject({ scope: this.origin.id.scope, name: this.origin.id.name })\n : undefined;\n }\n\n hasParent(ref: Ref) {\n return this.parents.find((p) => p.toString() === ref.toString());\n }\n\n addParent(ref: Ref) {\n if (this.isLegacy) return;\n if (this.hasParent(ref)) {\n return; // make sure to not add twice\n }\n this.parents.push(ref);\n }\n\n setSquashed(squashData: SquashData, log: Log, replaceMessage?: string) {\n this.squashed = squashData;\n this.addModifiedLog(log);\n if (replaceMessage) {\n this.addModifiedLog({\n username: undefined,\n email: undefined,\n date: Date.now().toString(),\n message: `squashing: replacing the original log.message, which was: \"${this.log.message || '<empty>'}\"`,\n });\n this.log.message = replaceMessage;\n }\n }\n\n setUnrelated(externalHead: ExternalHead) {\n this.unrelated = externalHead;\n }\n\n addModifiedLog(log: Log) {\n this.modified.push(log);\n }\n\n addAsOnlyParent(ref: Ref) {\n if (this.isLegacy) return;\n this.parents = [ref];\n }\n\n removeParent(ref: Ref) {\n this.parents = this.parents.filter((p) => p.toString() !== ref.toString());\n }\n\n removeAllParents() {\n this.parents = [];\n }\n\n modelFilesToSourceFiles(repository: Repository): Promise<SourceFile[]> {\n return Promise.all(this.files.map((file) => SourceFile.loadFromSourceFileModel(file, repository)));\n }\n\n isRemoved(): boolean {\n return Boolean(this.extensions.findCoreExtension(Extensions.remove)?.config?.removed);\n }\n shouldRemoveFromMain(): boolean {\n return Boolean(this.extensions.findCoreExtension(Extensions.remove)?.config?.removeOnMain);\n }\n\n /**\n * Validate the version model properties, to make sure we are not inserting something\n * in the wrong format\n */\n validate(): void {\n validateVersionInstance(this);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,kBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,iBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,aAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,SAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,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,QAAQ,CAAC,CAAC,CAAC;EAC5E;EAEAkL,gBAAgBA,CAAA,EAAG;IACjB,IAAI,CAAC1M,OAAO,GAAG,EAAE;EACnB;EAEA2M,uBAAuBA,CAACC,UAAsB,EAAyB;IACrE,OAAOC,OAAO,CAACC,GAAG,CAAC,IAAI,CAACnO,KAAK,CAAC8C,GAAG,CAAE8E,IAAI,IAAKwG,uBAAU,CAACC,uBAAuB,CAACzG,IAAI,EAAEqG,UAAU,CAAC,CAAC,CAAC;EACpG;EAEAK,SAASA,CAAA,EAAY;IACnB,OAAOC,OAAO,CAAC,IAAI,CAAC/M,UAAU,CAACgN,iBAAiB,CAACC,oBAAU,CAACC,MAAM,CAAC,EAAE/C,MAAM,EAAEgD,OAAO,CAAC;EACvF;EACAC,oBAAoBA,CAAA,EAAY;IAC9B,OAAOL,OAAO,CAAC,IAAI,CAAC/M,UAAU,CAACgN,iBAAiB,CAACC,oBAAU,CAACC,MAAM,CAAC,EAAE/C,MAAM,EAAEkD,YAAY,CAAC;EAC5F;;EAEA;AACF;AACA;AACA;EACE1E,QAAQA,CAAA,EAAS;IACf,IAAA2E,kCAAuB,EAAC,IAAI,CAAC;EAC/B;AACF;AAACC,OAAA,CAAAxS,OAAA,GAAAoD,OAAA","ignoreList":[]}
|
|
@@ -160,6 +160,42 @@ describe('Version', () => {
|
|
|
160
160
|
(0, _chai().expect)(first.getLoadedFlattenedDependencies()).to.not.equal(second.getLoadedFlattenedDependencies());
|
|
161
161
|
(0, _chai().expect)(first.getLoadedFlattenedDependencies()[0]).to.equal(second.getLoadedFlattenedDependencies()[0]);
|
|
162
162
|
});
|
|
163
|
+
it('should share the same id and edge instances for flattenedEdges', () => {
|
|
164
|
+
const edgeFromObj1 = _version().default.depEdgeFromObject({
|
|
165
|
+
source: {
|
|
166
|
+
scope: 'my-scope',
|
|
167
|
+
name: 'comp-a',
|
|
168
|
+
version: '0.0.1'
|
|
169
|
+
},
|
|
170
|
+
target: {
|
|
171
|
+
scope: 'my-scope',
|
|
172
|
+
name: 'is-type',
|
|
173
|
+
version: '0.0.1'
|
|
174
|
+
},
|
|
175
|
+
type: 'prod'
|
|
176
|
+
});
|
|
177
|
+
const edgeFromObj2 = _version().default.depEdgeFromObject({
|
|
178
|
+
source: {
|
|
179
|
+
scope: 'my-scope',
|
|
180
|
+
name: 'comp-a',
|
|
181
|
+
version: '0.0.1'
|
|
182
|
+
},
|
|
183
|
+
target: {
|
|
184
|
+
scope: 'my-scope',
|
|
185
|
+
name: 'is-type',
|
|
186
|
+
version: '0.0.1'
|
|
187
|
+
},
|
|
188
|
+
type: 'prod'
|
|
189
|
+
});
|
|
190
|
+
(0, _chai().expect)(edgeFromObj1).to.equal(edgeFromObj2);
|
|
191
|
+
(0, _chai().expect)(edgeFromObj1.source).to.equal(edgeFromObj2.source);
|
|
192
|
+
(0, _chai().expect)(edgeFromObj1.target).to.equal(edgeFromObj2.target);
|
|
193
|
+
const edgeFromArr1 = _version().default.depEdgeFromArray(['my-scope/comp-a@0.0.1', 'my-scope/is-type@0.0.1', 'prod']);
|
|
194
|
+
const edgeFromArr2 = _version().default.depEdgeFromArray(['my-scope/comp-a@0.0.1', 'my-scope/is-type@0.0.1', 'prod']);
|
|
195
|
+
(0, _chai().expect)(edgeFromArr1).to.equal(edgeFromArr2);
|
|
196
|
+
(0, _chai().expect)(edgeFromArr1.source).to.equal(edgeFromArr2.source);
|
|
197
|
+
(0, _chai().expect)(edgeFromArr1.target).to.equal(edgeFromArr2.target);
|
|
198
|
+
});
|
|
163
199
|
it('should keep a list that was set, and serialize it', () => {
|
|
164
200
|
const version = getVersionWithDepsFixture();
|
|
165
201
|
version.flattenedDependencies = new (_componentId().ComponentIdList)(_componentId().ComponentID.fromString('my-scope/is-type@0.0.3'));
|