@teambit/component-compare 1.0.1087 → 1.0.1088

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.
@@ -113,6 +113,7 @@ export declare class ComponentCompareMain {
113
113
  * 2. scope mode - the version and toVersion are mandatory.
114
114
  */
115
115
  private computeDiff;
116
+ private haveSameFiles;
116
117
  diffBetweenVersionsObjects(modelComponent: ModelComponent, fromVersionObject: Version, toVersionObject: Version, fromVersion: string, toVersion: string, diffOpts: DiffOptions): Promise<DiffResults>;
117
118
  static slots: never[];
118
119
  static dependencies: import("@teambit/harmony").Aspect[];
@@ -444,8 +444,9 @@ class ComponentCompareMain {
444
444
  hasDiff: false
445
445
  };
446
446
  const modelComponent = consumerComponent.modelComponent || (await this.scope.legacyScope.getModelComponentIfExist(component.id));
447
- if (this.workspace && component.isDeleted()) {
448
- // component exists in the model but not in the filesystem, show all files as deleted
447
+ if (this.workspace && component.isDeleted() && !diffOpts.compareToParent) {
448
+ // component exists in the model but not in the filesystem, show all files as deleted.
449
+ // with --parent, the comparison is between stored versions, so the deletion state is irrelevant.
449
450
  const modelFiles = consumerComponent.files;
450
451
  diffResult.filesDiff = await (0, _legacy().getFilesDiff)(modelFiles, [], component.id.version, component.id.version);
451
452
  if (hasDiff(diffResult)) diffResult.hasDiff = true;
@@ -462,6 +463,10 @@ class ComponentCompareMain {
462
463
  return diffResult;
463
464
  }
464
465
  const repository = this.scope.legacyScope.objects;
466
+ if (diffOpts.compareToParent) {
467
+ if (toVersion) throw new (_bitError().BitError)('--parent flag expects to get only one version');
468
+ if (!version) version = component.id.version;
469
+ }
465
470
  const idsToImport = (0, _lodash().compact)([version ? component.id.changeVersion(version) : undefined, toVersion ? component.id.changeVersion(toVersion) : undefined]);
466
471
  const idList = _componentId().ComponentIdList.fromArray(idsToImport);
467
472
  await this.scope.legacyScope.scopeImporter.importWithoutDeps(idList, {
@@ -469,12 +474,64 @@ class ComponentCompareMain {
469
474
  reason: 'to show diff'
470
475
  });
471
476
  if (diffOpts.compareToParent) {
472
- if (!version) throw new (_bitError().BitError)('--parent flag expects to get version');
473
- if (toVersion) throw new (_bitError().BitError)('--parent flag expects to get only one version');
474
- const versionObject = await modelComponent.loadVersion(version, repository);
475
- const parent = versionObject.parents[0];
476
- toVersion = version;
477
- version = parent ? modelComponent.getTagOfRefIfExists(parent) : undefined;
477
+ const targetVersion = version; // guaranteed to be set above when compareToParent
478
+ const versionObject = await modelComponent.loadVersion(targetVersion, repository);
479
+ let parentRef = versionObject.parents[0];
480
+ if (!parentRef) {
481
+ // it's the first version. show all files as new.
482
+ const versionFiles = await versionObject.modelFilesToSourceFiles(repository);
483
+ diffResult.filesDiff = await (0, _legacy().getFilesDiff)([], versionFiles, 'no parent', targetVersion);
484
+ if (hasDiff(diffResult)) diffResult.hasDiff = true;
485
+ return diffResult;
486
+ }
487
+ // walk up the parent chain and skip ancestors that are not meaningful to diff against:
488
+ // 1. hidden ancestors. when a lane is merged and the tag is created by tag-from-scope (_tag),
489
+ // the tag is identical to the merged snap, so that snap is marked as hidden.
490
+ // 2. snap ancestors with content identical to the given version. same tag-from-scope scenario,
491
+ // but when the artifacts are re-built, the merged snap is not marked as hidden.
492
+ // a tag ancestor is never skipped by content, so a legit tag with no changes (e.g. created
493
+ // with --unmodified) still shows no diff.
494
+ toVersion = targetVersion;
495
+ let foundMeaningfulParent = false;
496
+ while (parentRef) {
497
+ const parentTag = modelComponent.getTagOfRefIfExists(parentRef);
498
+ const parentVersion = parentTag || parentRef.toString();
499
+ await this.scope.legacyScope.scopeImporter.importWithoutDeps(_componentId().ComponentIdList.fromArray([component.id.changeVersion(parentVersion)]), {
500
+ cache: true,
501
+ reason: 'to show diff'
502
+ });
503
+ const parentObject = await modelComponent.loadVersion(parentVersion, repository);
504
+ version = parentVersion;
505
+ if (!parentObject.hidden) {
506
+ if (parentTag) {
507
+ foundMeaningfulParent = true;
508
+ break;
509
+ }
510
+ // cheap check first. when the files differ, this ancestor is meaningful, no need to
511
+ // compute the full diff here (it is computed once below for the output).
512
+ if (!this.haveSameFiles(parentObject, versionObject)) {
513
+ foundMeaningfulParent = true;
514
+ break;
515
+ }
516
+ // files are identical, compute the diff to find out whether the fields (deps/config) differ.
517
+ const parentDiff = await this.diffBetweenVersionsObjects(modelComponent, parentObject, versionObject, parentVersion, toVersion, diffOpts);
518
+ if (parentDiff.hasDiff) {
519
+ foundMeaningfulParent = true;
520
+ break;
521
+ }
522
+ }
523
+ parentRef = parentObject.parents[0];
524
+ }
525
+ if (!foundMeaningfulParent) {
526
+ // the entire parent chain consists of skipped ancestors - hidden snaps and/or snaps with
527
+ // identical content (e.g. the first release of a component created by the merge +
528
+ // tag-from-scope flow, with or without rebuilt artifacts). treat it as having no parent
529
+ // and show all files as new, rather than diffing against a skipped snap.
530
+ const versionFiles = await versionObject.modelFilesToSourceFiles(repository);
531
+ diffResult.filesDiff = await (0, _legacy().getFilesDiff)([], versionFiles, 'no parent', targetVersion);
532
+ if (hasDiff(diffResult)) diffResult.hasDiff = true;
533
+ return diffResult;
534
+ }
478
535
  }
479
536
  const fromVersionObject = version ? await modelComponent.loadVersion(version, repository) : undefined;
480
537
  const toVersionObject = toVersion ? await modelComponent.loadVersion(toVersion, repository) : undefined;
@@ -494,6 +551,10 @@ class ComponentCompareMain {
494
551
  await updateFieldsDiff(fromVersionComponent, toVersionComponent, diffResult, diffOpts);
495
552
  return diffResult;
496
553
  }
554
+ haveSameFiles(versionA, versionB) {
555
+ const serializeFiles = version => version.files.map(file => `${file.relativePath}:${file.file.toString()}`).sort().join();
556
+ return serializeFiles(versionA) === serializeFiles(versionB);
557
+ }
497
558
  async diffBetweenVersionsObjects(modelComponent, fromVersionObject, toVersionObject, fromVersion, toVersion, diffOpts) {
498
559
  const diffResult = {
499
560
  id: modelComponent.toComponentId(),
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_lodash","_bitError","_workspace","_componentId","_scope","_graphql","_builder","_dependencyResolver","_logger","_legacy","_tester","_component","_schema","_cache","_componentCompare","_componentCompare2","_diffCmd","_importer","_harmonyModules","_compareComponentPairs","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","PERSISTENT_CACHE_TTL_MS","ComponentCompareMain","constructor","componentAspect","scope","logger","tester","depResolver","importer","schema","cache","workspace","Map","getOrCompute","inflight","cacheKey","compute","cacheable","skipPersistentCache","pending","get","cached","undefined","started","promise","then","result","set","finally","delete","compare","baseIdStr","compareIdStr","compareInflight","computeCompare","isLiveWorkspace","comparesLiveWorkspace","isLiveCheckout","idStr","id","ComponentID","fromString","checkedOut","getIdIfExist","hasVersion","version","host","getHost","baseCompId","compareCompId","resolveMultipleComponentIds","modelComponent","legacyScope","getModelComponentIfExist","comparingWithLocalChanges","BitError","toString","importObjectsFromMainIfExist","baseVersion","compareVersion","components","getMany","baseComponent","compareComponent","componentWithoutVersion","changeVersion","checkedOutVersion","compareIsLiveWorkspace","Boolean","effectiveBaseVersion","effectiveCompareVersion","diff","computeDiff","filesDiff","fieldsDiff","baseTestFiles","getTestFiles","map","file","relative","compareTestFiles","allTestFiles","testFilesDiff","filter","fileDiff","includes","filePath","status","baseId","compareId","code","fields","tests","compareComponents","pairs","options","compareComponentPairs","offset","limit","concurrency","concurrentComponentsLimit","onError","pair","err","warn","apiDiffs","getAPIDiff","isApiDiffCacheable","base","live","pendingOrTransient","reason","apiDiffInflight","computeAPIDiff","v","diffByCLIValues","pattern","toVersion","verbose","table","parent","OutsideWorkspaceError","ids","idsByPattern","listTagPendingIds","consumer","length","diffResults","componentsDiff","formatDepsAsTable","compareToParent","onDestroy","getConfigForDiffById","componentId","resolveComponentId","component","Error","getConfigForDiffByCompObject","modifiedIds","depData","getDependencies","modifiedIdsStr","toStringWithoutVersion","serializedToString","dep","idWithoutVersion","__type","split","lifecycle","source","serializeAndSort","deps","serialized","serialize","sort","serializeAspect","comp","aspects","state","withoutEntries","BuilderAspect","DependencyResolverAspect","toLegacy","sortById","toConfigObject","dependencies","diffOpts","componentsDiffResults","Promise","all","consumerComponent","_consumer","diffResult","hasDiff","isDeleted","modelFiles","files","getFilesDiff","fsFiles","repository","objects","idsToImport","compact","idList","ComponentIdList","fromArray","scopeImporter","importWithoutDeps","versionObject","loadVersion","parents","getTagOfRefIfExists","fromVersionObject","toVersionObject","fromVersionFiles","modelFilesToSourceFiles","toVersionFiles","fromFiles","componentFromModel","toFiles","fromVersionLabel","toVersionLabel","fromVersionComponent","toConsumerComponent","name","toVersionComponent","updateFieldsDiff","diffBetweenVersionsObjects","fromVersion","toComponentId","color","hash","provider","graphql","loggerMain","cli","createLogger","ComponentCompareAspect","componentCompareMain","register","DiffCmd","componentCompareSchema","exports","GraphqlAspect","ComponentAspect","ScopeAspect","LoggerAspect","CLIAspect","WorkspaceAspect","TesterAspect","ImporterAspect","SchemaAspect","CacheAspect","MainRuntime","find","diffOutput","componentA","componentB","diffBetweenComponentsObjects","addRuntime","_default","default"],"sources":["component-compare.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport { compact } from 'lodash';\nimport { BitError } from '@teambit/bit-error';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect, OutsideWorkspaceError } from '@teambit/workspace';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport type { ScopeMain } from '@teambit/scope';\nimport { ScopeAspect } from '@teambit/scope';\nimport type { GraphqlMain } from '@teambit/graphql';\nimport { GraphqlAspect } from '@teambit/graphql';\nimport { BuilderAspect } from '@teambit/builder';\nimport type { ModelComponent, Version } from '@teambit/objects';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport type { DependencyList, DependencyResolverMain, SerializedDependency } from '@teambit/dependency-resolver';\nimport { DependencyResolverAspect } from '@teambit/dependency-resolver';\nimport type { LoggerMain, Logger } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { DiffOptions, DiffResults, FieldsDiff, FileDiff } from '@teambit/legacy.component-diff';\nimport { getFilesDiff, diffBetweenComponentsObjects } from '@teambit/legacy.component-diff';\nimport type { TesterMain } from '@teambit/tester';\nimport { TesterAspect } from '@teambit/tester';\nimport type { Component, ComponentMain } from '@teambit/component';\nimport { ComponentAspect } from '@teambit/component';\nimport type { SchemaMain } from '@teambit/schema';\nimport { SchemaAspect } from '@teambit/schema';\nimport type { CacheMain } from '@teambit/cache';\nimport { CacheAspect } from '@teambit/cache';\n\nimport { componentCompareSchema } from './component-compare.graphql';\nimport { ComponentCompareAspect } from './component-compare.aspect';\nimport { DiffCmd } from './diff-cmd';\nimport type { ImporterMain } from '@teambit/importer';\nimport { ImporterAspect } from '@teambit/importer';\nimport { concurrentComponentsLimit } from '@teambit/harmony.modules.concurrency';\nimport { compareComponentPairs } from './compare-component-pairs';\nimport type { ComponentComparePair } from './compare-component-pairs';\n\nexport type ComponentCompareResult = {\n id: string;\n baseId: string;\n compareId: string;\n code: FileDiff[];\n fields: FieldsDiff[];\n tests: FileDiff[];\n /**\n * true when the compare side is the live workspace (on-disk files, incl. uncommitted changes).\n * such a result is inherently mutable, so it must never be persisted to the cross-run cache —\n * only the in-flight single-flight dedupe applies. not exposed via graphql.\n */\n isLiveWorkspace?: boolean;\n};\n\ntype ConfigDiff = {\n version?: string;\n dependencies?: string[];\n aspects?: Record<string, any>;\n};\n\n/**\n * expiry for persisted compare/api-diff results. the results themselves are immutable (keyed on snap\n * hashes), but the payloads are heavy — full per-file contents per pair — so without a TTL the cache\n * directory grows with every pair ever viewed. two weeks comfortably covers a review cycle.\n */\nconst PERSISTENT_CACHE_TTL_MS = 14 * 24 * 60 * 60 * 1000;\n\nexport class ComponentCompareMain {\n constructor(\n private componentAspect: ComponentMain,\n private scope: ScopeMain,\n private logger: Logger,\n private tester: TesterMain,\n private depResolver: DependencyResolverMain,\n private importer: ImporterMain,\n private schema: SchemaMain,\n private cache: CacheMain,\n private workspace?: Workspace\n ) {}\n\n // in-flight `compute` promises, so concurrent callers for the same pair share one computation\n // instead of recomputing (the lane compare UI and lane-diff status hit the same pairs in parallel\n // on a cold load). Persisted results survive restarts via the global `@teambit/cache` aspect.\n private compareInflight = new Map<string, Promise<ComponentCompareResult>>();\n private apiDiffInflight = new Map<string, Promise<Record<string, any> | null>>();\n\n /**\n * Read-through cache with single-flight dedupe: serve a persisted result, else share an in-flight\n * computation, else compute once and persist. Most `(baseId, compareId)` pairs are immutable (keyed\n * on snap hashes), so a cached result never goes stale. `cacheable` gates which results are persisted.\n *\n * `skipPersistentCache` bypasses the persistent cache entirely (neither read nor write) while still\n * sharing the in-flight computation. Callers must set it whenever the result depends on mutable state\n * the key does not capture — e.g. a live-workspace diff against on-disk files — so a previously\n * persisted snap-to-snap result for the same key is never served in its place.\n */\n private async getOrCompute<T>(\n inflight: Map<string, Promise<T>>,\n cacheKey: string,\n compute: () => Promise<T>,\n cacheable: (value: T) => boolean = () => true,\n skipPersistentCache = false\n ): Promise<T> {\n const pending = inflight.get(cacheKey);\n if (pending) return pending;\n if (!skipPersistentCache) {\n const cached = await this.cache.get<T>(cacheKey);\n if (cached !== undefined) return cached;\n // a concurrent caller may have started computing while we awaited the cache read.\n const started = inflight.get(cacheKey);\n if (started) return started;\n }\n const promise = compute()\n .then((result) => {\n // TTL keeps the cache bounded: compare payloads embed full per-file contents for every pair,\n // so without an expiry every pair ever viewed stays on disk forever. entries are cheap to\n // recompute after expiry (sources still cached in the scope), so a stale-eviction is harmless.\n if (!skipPersistentCache && cacheable(result)) void this.cache.set(cacheKey, result, PERSISTENT_CACHE_TTL_MS);\n return result;\n })\n .finally(() => inflight.delete(cacheKey));\n inflight.set(cacheKey, promise);\n return promise;\n }\n\n async compare(baseIdStr: string, compareIdStr: string): Promise<ComponentCompareResult> {\n return this.getOrCompute(\n this.compareInflight,\n `component-compare:result:${baseIdStr}|${compareIdStr}`,\n () => this.computeCompare(baseIdStr, compareIdStr),\n // never persist a live-workspace diff: it reflects on-disk files (incl. uncommitted changes),\n // so a cached copy would go stale the moment the user edits a file. the (baseId, compareId)\n // pair is otherwise immutable (keyed on snap hashes), so those stay cacheable.\n (result) => !result.isLiveWorkspace,\n // whether this call *reads* the persistent cache is decided up front from the same signal:\n // a live-workspace compare must skip the cache entirely, otherwise a snap-to-snap result\n // persisted for this key in a prior run (or a non-live context) would mask on-disk changes.\n this.comparesLiveWorkspace(baseIdStr, compareIdStr)\n );\n }\n\n /**\n * cheap, synchronous pre-check mirroring the `comparingWithLocalChanges` / `compareIsLiveWorkspace`\n * logic in `computeCompare`: will this compare diff against live on-disk workspace files rather than\n * two immutable snaps? errs toward `true` (skip the persistent cache) whenever the id cannot be\n * classified, so a stale snap-to-snap result is never served in place of a live one.\n */\n private comparesLiveWorkspace(baseIdStr: string, compareIdStr: string): boolean {\n if (!this.workspace) return false; // scope/remote host: every compare is an immutable snap-to-snap pair\n if (baseIdStr === compareIdStr) return true; // the \"local changes\" view: checked-out snap vs on-disk files\n return this.isLiveCheckout(compareIdStr);\n }\n\n /**\n * whether this id refers to the component version currently checked out on disk — the one case\n * where \"the same versioned id\" can produce different data over time (the user edits files). errs\n * toward `true` when the id cannot be classified, so a stale cached result is never served.\n */\n private isLiveCheckout(idStr: string): boolean {\n if (!this.workspace) return false;\n let id: ComponentID;\n try {\n id = ComponentID.fromString(idStr);\n } catch {\n return true; // unclassifiable id → assume live so a stale cached diff is never returned\n }\n const checkedOut = this.workspace.getIdIfExist(id);\n if (!checkedOut) return false; // not checked out → a stored snap, safe to cache\n // live only when this side is the exact version currently checked out on disk.\n return !id.hasVersion() || checkedOut.version === id.version;\n }\n\n /** The original `compare()` body — moved here so the public method can wrap with memo + single-flight. */\n private async computeCompare(baseIdStr: string, compareIdStr: string): Promise<ComponentCompareResult> {\n const host = this.componentAspect.getHost();\n const [baseCompId, compareCompId] = await host.resolveMultipleComponentIds([baseIdStr, compareIdStr]);\n const modelComponent = await this.scope.legacyScope.getModelComponentIfExist(compareCompId);\n const comparingWithLocalChanges = this.workspace && baseIdStr === compareIdStr;\n\n if (!modelComponent) {\n throw new BitError(`component ${compareCompId.toString()} doesn't have any version yet`);\n }\n\n // import missing components that might be on main\n await this.importer.importObjectsFromMainIfExist([baseCompId, compareCompId], {\n cache: true,\n });\n\n const baseVersion = baseCompId.version as string;\n const compareVersion = compareCompId.version as string;\n\n const components = await host.getMany([baseCompId, compareCompId]);\n const baseComponent = components?.[0];\n const compareComponent = components?.[1];\n const componentWithoutVersion = await host.get((baseCompId || compareCompId).changeVersion(undefined));\n\n // When the compare side is the component currently checked out in the workspace, diff against the\n // on-disk files rather than a stored snap: passing `undefined` as the compare version makes\n // `computeDiff` fall back to `consumerComponent.files`, so uncommitted local changes are included.\n // This covers two cases with one code path:\n // - base === compare (the classic \"local changes\" view): checked-out model → workspace files.\n // - base = an earlier version: that version's committed changes + any uncommitted changes on top.\n // Without this, the default workspace compare resolves base and compare to the same checked-out\n // snap and reports no changes, collapsing the compare view to only its always-on sections.\n const checkedOutVersion = componentWithoutVersion?.id.version;\n const compareIsLiveWorkspace = Boolean(this.workspace && checkedOutVersion && compareVersion === checkedOutVersion);\n const effectiveBaseVersion = comparingWithLocalChanges ? undefined : baseVersion;\n const effectiveCompareVersion = comparingWithLocalChanges || compareIsLiveWorkspace ? undefined : compareVersion;\n\n const diff = componentWithoutVersion\n ? await this.computeDiff(componentWithoutVersion, effectiveBaseVersion, effectiveCompareVersion, {})\n : {\n filesDiff: [],\n fieldsDiff: [],\n };\n\n const baseTestFiles =\n (baseComponent && (await this.tester.getTestFiles(baseComponent).map((file) => file.relative))) || [];\n const compareTestFiles =\n (compareComponent && (await this.tester.getTestFiles(compareComponent).map((file) => file.relative))) || [];\n\n const allTestFiles = [...baseTestFiles, ...compareTestFiles];\n\n const testFilesDiff = (diff.filesDiff || []).filter(\n (fileDiff: FileDiff) => allTestFiles.includes(fileDiff.filePath) && fileDiff.status !== 'UNCHANGED'\n );\n\n return {\n id: `${baseCompId}-${compareCompId}`,\n baseId: baseIdStr,\n compareId: compareIdStr,\n code: diff.filesDiff || [],\n fields: diff.fieldsDiff || [],\n tests: testFilesDiff,\n isLiveWorkspace: compareIsLiveWorkspace,\n };\n }\n\n /**\n * compare a paginated slice of component pairs in one call.\n * a pair that fails to compare (e.g. a component without versions) becomes `null` in the\n * returned array rather than failing the whole batch. the array is aligned to the requested\n * slice (`pairs[offset .. offset + limit]`).\n */\n async compareComponents(\n pairs: ComponentComparePair[],\n options?: { offset?: number; limit?: number }\n ): Promise<Array<ComponentCompareResult | null>> {\n return compareComponentPairs(pairs, (baseId, compareId) => this.compare(baseId, compareId), {\n offset: options?.offset,\n limit: options?.limit,\n concurrency: concurrentComponentsLimit(),\n onError: (pair, err) => {\n this.logger.warn(`compareComponents: failed to compare ${pair.baseId} <> ${pair.compareId}`, err);\n },\n });\n }\n\n /**\n * api-diff a paginated slice of component pairs in one call — the bulk counterpart of the single\n * `getAPIDiff`, mirroring `compareComponents`. reuses `getAPIDiff` per pair (so its disk memo +\n * single-flight dedupe still apply), turning a pair whose diff throws into `null` rather than\n * failing the whole batch. the returned array is aligned to the requested slice.\n */\n async apiDiffs(\n pairs: ComponentComparePair[],\n options?: { offset?: number; limit?: number }\n ): Promise<Array<Record<string, any> | null>> {\n return compareComponentPairs(pairs, (baseId, compareId) => this.getAPIDiff(baseId, compareId), {\n offset: options?.offset,\n limit: options?.limit,\n concurrency: concurrentComponentsLimit(),\n onError: (pair, err) => {\n this.logger.warn(`apiDiffs: failed to compute api diff ${pair.baseId} <> ${pair.compareId}`, err);\n },\n });\n }\n\n private static isApiDiffCacheable(result: Record<string, any>): boolean {\n // a live-extracted side reflects the current working tree, not the snap the cache key names —\n // persisting it would serve a stale (possibly degraded) diff for that pair forever.\n if (result.base?.live || result.compare?.live) return false;\n if (result.status === 'COMPUTED') return true;\n // A non-COMPUTED result is only safe to persist (disk cache, keyed on the immutable snap pair, no\n // TTL) when it can never change for that pair. FAILED is transient. NOT_BUILT is *pending*: the snap\n // simply hasn't been built yet, and once CI builds it (same hash) the schema appears — caching the\n // pre-build \"unavailable\" answer would keep the API view blank forever. NO_EXTRACTOR/DISABLED are\n // stable properties of the snap's env, so they stay cacheable.\n const pendingOrTransient = (reason?: string) => reason === 'FAILED' || reason === 'NOT_BUILT';\n return !pendingOrTransient(result.base?.reason) && !pendingOrTransient(result.compare?.reason);\n }\n\n async getAPIDiff(baseIdStr: string, compareIdStr: string): Promise<Record<string, any> | null> {\n // never persist a result that can still change: `null` (snaps couldn't load), FAILED (schema\n // retrieval threw) and NOT_BUILT (snap not yet built) must recompute next call; NO_EXTRACTOR/\n // DISABLED are stable env properties and safe to cache (see `isApiDiffCacheable`).\n // the version namespace invalidates older computed results on engine changes:\n // v2 — availability-aware results; v3 — self-referential-returnType display fix.\n // skip the persistent cache when EITHER side is the live checkout: SchemaMain live-extracts the\n // schema of a modified checkout of the exact same versioned id, so a snap-to-snap result cached\n // under this key in a prior (unmodified) run would mask the user's on-disk API changes. both\n // sides are checked (unlike `compare()`, where only the compare side can be live) because the\n // checked-out version can appear on either side of an API diff pair.\n return this.getOrCompute(\n this.apiDiffInflight,\n `component-compare:api-diff:v3:${baseIdStr}|${compareIdStr}`,\n () => this.computeAPIDiff(baseIdStr, compareIdStr),\n (v) => v !== null && ComponentCompareMain.isApiDiffCacheable(v),\n this.isLiveCheckout(baseIdStr) || this.isLiveCheckout(compareIdStr)\n );\n }\n\n private async computeAPIDiff(baseIdStr: string, compareIdStr: string): Promise<Record<string, any> | null> {\n const host = this.componentAspect.getHost();\n const [baseCompId, compareCompId] = await host.resolveMultipleComponentIds([baseIdStr, compareIdStr]);\n await this.importer.importObjectsFromMainIfExist([baseCompId, compareCompId], { cache: true });\n const components = await host.getMany([baseCompId, compareCompId]);\n const baseComponent = components?.[0];\n const compareComponent = components?.[1];\n if (!baseComponent || !compareComponent) return null;\n return this.schema.computeAPIDiff(baseComponent, compareComponent);\n }\n\n async diffByCLIValues(\n pattern?: string,\n version?: string,\n toVersion?: string,\n { verbose, table, parent }: { verbose?: boolean; table?: boolean; parent?: boolean } = {}\n ): Promise<any> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const ids = pattern ? await this.workspace.idsByPattern(pattern) : await this.workspace.listTagPendingIds();\n const consumer = this.workspace.consumer;\n if (!ids.length) {\n return [];\n }\n const diffResults = await this.componentsDiff(ids, version, toVersion, {\n verbose,\n formatDepsAsTable: table,\n compareToParent: parent,\n });\n await consumer.onDestroy('diff');\n return diffResults;\n }\n\n async getConfigForDiffById(id: string): Promise<ConfigDiff> {\n const workspace = this.workspace;\n if (!workspace) throw new OutsideWorkspaceError();\n const componentId = await workspace.resolveComponentId(id);\n const component = await workspace.scope.get(componentId, false);\n if (!component) throw new Error(`getConfigForDiff: unable to find component ${id} in local scope`);\n return this.getConfigForDiffByCompObject(component);\n }\n\n async getConfigForDiffByCompObject(component: Component, modifiedIds?: ComponentID[]) {\n const depData = this.depResolver.getDependencies(component);\n const modifiedIdsStr = modifiedIds?.map((id) => id.toStringWithoutVersion());\n const serializedToString = (dep: SerializedDependency) => {\n const idWithoutVersion = dep.__type === 'package' ? dep.id : dep.id.split('@')[0];\n const version = modifiedIdsStr?.includes(idWithoutVersion) ? `<modified>` : dep.version;\n return `${idWithoutVersion}@${version} (${dep.lifecycle}) ${dep.source ? `(${dep.source})` : ''}`;\n };\n const serializeAndSort = (deps: DependencyList) => {\n const serialized = deps.serialize().map(serializedToString);\n return serialized.sort();\n };\n const serializeAspect = (comp: Component) => {\n const aspects = comp.state.aspects.withoutEntries([BuilderAspect.id, DependencyResolverAspect.id]);\n // return aspects.serialize();\n return aspects.toLegacy().sortById().toConfigObject();\n };\n return {\n version: component.id.version,\n dependencies: serializeAndSort(depData),\n aspects: serializeAspect(component),\n };\n }\n\n private async componentsDiff(\n ids: ComponentID[],\n version: string | undefined,\n toVersion: string | undefined,\n diffOpts: DiffOptions\n ): Promise<DiffResults[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const components = await this.workspace.getMany(ids);\n if (!components.length) throw new BitError('failed loading the components');\n if (toVersion && !version)\n throw new BitError('error: componentsDiff expects to get version when toVersion is entered');\n const componentsDiffResults = await Promise.all(\n components.map((component) => this.computeDiff(component, version, toVersion, diffOpts))\n );\n return componentsDiffResults;\n }\n\n /**\n * this method operates in two modes:\n * 1. workspace mode - the version and toVersion can be undefined.\n * 2. scope mode - the version and toVersion are mandatory.\n */\n private async computeDiff(\n component: Component,\n version: string | undefined,\n toVersion: string | undefined,\n diffOpts: DiffOptions\n ): Promise<DiffResults> {\n const consumerComponent = component.state._consumer as ConsumerComponent;\n\n const diffResult: DiffResults = { id: component.id, hasDiff: false };\n const modelComponent =\n consumerComponent.modelComponent || (await this.scope.legacyScope.getModelComponentIfExist(component.id));\n\n if (this.workspace && component.isDeleted()) {\n // component exists in the model but not in the filesystem, show all files as deleted\n const modelFiles = consumerComponent.files;\n diffResult.filesDiff = await getFilesDiff(modelFiles, [], component.id.version, component.id.version);\n if (hasDiff(diffResult)) diffResult.hasDiff = true;\n return diffResult;\n }\n if (!modelComponent) {\n if (version || toVersion) {\n throw new BitError(`component ${component.id.toString()} doesn't have any version yet`);\n }\n // it's a new component. not modified. show all files as new.\n const fsFiles = consumerComponent.files;\n diffResult.filesDiff = await getFilesDiff([], fsFiles, component.id.version, component.id.version);\n if (hasDiff(diffResult)) diffResult.hasDiff = true;\n return diffResult;\n }\n const repository = this.scope.legacyScope.objects;\n const idsToImport = compact([\n version ? component.id.changeVersion(version) : undefined,\n toVersion ? component.id.changeVersion(toVersion) : undefined,\n ]);\n const idList = ComponentIdList.fromArray(idsToImport);\n await this.scope.legacyScope.scopeImporter.importWithoutDeps(idList, { cache: true, reason: 'to show diff' });\n if (diffOpts.compareToParent) {\n if (!version) throw new BitError('--parent flag expects to get version');\n if (toVersion) throw new BitError('--parent flag expects to get only one version');\n const versionObject = await modelComponent.loadVersion(version, repository);\n const parent = versionObject.parents[0];\n toVersion = version;\n version = parent ? modelComponent.getTagOfRefIfExists(parent) : undefined;\n }\n const fromVersionObject = version ? await modelComponent.loadVersion(version, repository) : undefined;\n const toVersionObject = toVersion ? await modelComponent.loadVersion(toVersion, repository) : undefined;\n const fromVersionFiles = await fromVersionObject?.modelFilesToSourceFiles(repository);\n const toVersionFiles = await toVersionObject?.modelFilesToSourceFiles(repository);\n\n const fromFiles = fromVersionFiles || consumerComponent.componentFromModel?.files;\n if (!fromFiles)\n throw new Error(\n `computeDiff: fromFiles must be defined for ${component.id.toString()}. if on workspace, consumerComponent.componentFromModel must be set. if on scope, fromVersionFiles must be set`\n );\n const toFiles = toVersionFiles || consumerComponent.files;\n const fromVersionLabel = version || component.id.version;\n const toVersionLabel = toVersion || component.id.version;\n\n diffResult.filesDiff = await getFilesDiff(fromFiles!, toFiles, fromVersionLabel, toVersionLabel);\n const fromVersionComponent = version\n ? await modelComponent.toConsumerComponent(version, this.scope.legacyScope.name, repository)\n : consumerComponent.componentFromModel;\n\n const toVersionComponent = toVersion\n ? await modelComponent.toConsumerComponent(toVersion, this.scope.legacyScope.name, repository)\n : consumerComponent;\n\n if (!fromVersionComponent) {\n throw new Error(\n `computeDiff: fromVersionComponent must be defined for ${component.id.toString()}. if on workspace, consumerComponent.componentFromModel must be set. if on scope, \"version\" must be set`\n );\n }\n\n await updateFieldsDiff(fromVersionComponent, toVersionComponent, diffResult, diffOpts);\n\n return diffResult;\n }\n\n async diffBetweenVersionsObjects(\n modelComponent: ModelComponent,\n fromVersionObject: Version,\n toVersionObject: Version,\n fromVersion: string,\n toVersion: string,\n diffOpts: DiffOptions\n ) {\n const diffResult: DiffResults = { id: modelComponent.toComponentId(), hasDiff: false };\n const scope = this.scope.legacyScope;\n const repository = scope.objects;\n const fromVersionFiles = await fromVersionObject.modelFilesToSourceFiles(repository);\n const toVersionFiles = await toVersionObject.modelFilesToSourceFiles(repository);\n const color = diffOpts.color ?? true;\n diffResult.filesDiff = await getFilesDiff(\n fromVersionFiles,\n toVersionFiles,\n fromVersion,\n toVersion,\n undefined,\n color\n );\n const fromVersionComponent = await modelComponent.toConsumerComponent(\n fromVersionObject.hash().toString(),\n scope.name,\n repository\n );\n const toVersionComponent = await modelComponent.toConsumerComponent(\n toVersionObject.hash().toString(),\n scope.name,\n repository\n );\n await updateFieldsDiff(fromVersionComponent, toVersionComponent, diffResult, diffOpts);\n return diffResult;\n }\n\n static slots = [];\n static dependencies = [\n GraphqlAspect,\n ComponentAspect,\n ScopeAspect,\n LoggerAspect,\n CLIAspect,\n WorkspaceAspect,\n TesterAspect,\n DependencyResolverAspect,\n ImporterAspect,\n SchemaAspect,\n CacheAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n graphql,\n component,\n scope,\n loggerMain,\n cli,\n workspace,\n tester,\n depResolver,\n importer,\n schema,\n cache,\n ]: [\n GraphqlMain,\n ComponentMain,\n ScopeMain,\n LoggerMain,\n CLIMain,\n Workspace,\n TesterMain,\n DependencyResolverMain,\n ImporterMain,\n SchemaMain,\n CacheMain,\n ]) {\n const logger = loggerMain.createLogger(ComponentCompareAspect.id);\n const componentCompareMain = new ComponentCompareMain(\n component,\n scope,\n logger,\n tester,\n depResolver,\n importer,\n schema,\n cache,\n workspace\n );\n cli.register(new DiffCmd(componentCompareMain));\n graphql.register(() => componentCompareSchema(componentCompareMain));\n return componentCompareMain;\n }\n}\n\nfunction hasDiff(diffResult: DiffResults): boolean {\n return !!((diffResult.filesDiff && diffResult.filesDiff.find((file) => file.diffOutput)) || diffResult.fieldsDiff);\n}\n\nasync function updateFieldsDiff(\n componentA: ConsumerComponent,\n componentB: ConsumerComponent,\n diffResult: DiffResults,\n diffOpts: DiffOptions\n) {\n diffResult.fieldsDiff = await diffBetweenComponentsObjects(componentA, componentB, diffOpts);\n diffResult.hasDiff = hasDiff(diffResult);\n}\n\nComponentCompareAspect.addRuntime(ComponentCompareMain);\n\nexport default ComponentCompareMain;\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YA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AACnG,SAAS,IAAImG,UAAU,CAACnG,SAAS,CAACiK,IAAI,CAAE5J,IAAI,IAAKA,IAAI,CAAC6J,UAAU,CAAC,IAAK/D,UAAU,CAAClG,UAAU,CAAC;AACpH;AAEA,eAAeoI,gBAAgBA,CAC7B8B,UAA6B,EAC7BC,UAA6B,EAC7BjE,UAAuB,EACvBN,QAAqB,EACrB;EACAM,UAAU,CAAClG,UAAU,GAAG,MAAM,IAAAoK,sCAA4B,EAACF,UAAU,EAAEC,UAAU,EAAEvE,QAAQ,CAAC;EAC5FM,UAAU,CAACC,OAAO,GAAGA,OAAO,CAACD,UAAU,CAAC;AAC1C;AAEA6C,2CAAsB,CAACsB,UAAU,CAAC9O,oBAAoB,CAAC;AAAC,IAAA+O,QAAA,GAAAlB,OAAA,CAAAmB,OAAA,GAEzChP,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_lodash","_bitError","_workspace","_componentId","_scope","_graphql","_builder","_dependencyResolver","_logger","_legacy","_tester","_component","_schema","_cache","_componentCompare","_componentCompare2","_diffCmd","_importer","_harmonyModules","_compareComponentPairs","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","PERSISTENT_CACHE_TTL_MS","ComponentCompareMain","constructor","componentAspect","scope","logger","tester","depResolver","importer","schema","cache","workspace","Map","getOrCompute","inflight","cacheKey","compute","cacheable","skipPersistentCache","pending","get","cached","undefined","started","promise","then","result","set","finally","delete","compare","baseIdStr","compareIdStr","compareInflight","computeCompare","isLiveWorkspace","comparesLiveWorkspace","isLiveCheckout","idStr","id","ComponentID","fromString","checkedOut","getIdIfExist","hasVersion","version","host","getHost","baseCompId","compareCompId","resolveMultipleComponentIds","modelComponent","legacyScope","getModelComponentIfExist","comparingWithLocalChanges","BitError","toString","importObjectsFromMainIfExist","baseVersion","compareVersion","components","getMany","baseComponent","compareComponent","componentWithoutVersion","changeVersion","checkedOutVersion","compareIsLiveWorkspace","Boolean","effectiveBaseVersion","effectiveCompareVersion","diff","computeDiff","filesDiff","fieldsDiff","baseTestFiles","getTestFiles","map","file","relative","compareTestFiles","allTestFiles","testFilesDiff","filter","fileDiff","includes","filePath","status","baseId","compareId","code","fields","tests","compareComponents","pairs","options","compareComponentPairs","offset","limit","concurrency","concurrentComponentsLimit","onError","pair","err","warn","apiDiffs","getAPIDiff","isApiDiffCacheable","base","live","pendingOrTransient","reason","apiDiffInflight","computeAPIDiff","v","diffByCLIValues","pattern","toVersion","verbose","table","parent","OutsideWorkspaceError","ids","idsByPattern","listTagPendingIds","consumer","length","diffResults","componentsDiff","formatDepsAsTable","compareToParent","onDestroy","getConfigForDiffById","componentId","resolveComponentId","component","Error","getConfigForDiffByCompObject","modifiedIds","depData","getDependencies","modifiedIdsStr","toStringWithoutVersion","serializedToString","dep","idWithoutVersion","__type","split","lifecycle","source","serializeAndSort","deps","serialized","serialize","sort","serializeAspect","comp","aspects","state","withoutEntries","BuilderAspect","DependencyResolverAspect","toLegacy","sortById","toConfigObject","dependencies","diffOpts","componentsDiffResults","Promise","all","consumerComponent","_consumer","diffResult","hasDiff","isDeleted","modelFiles","files","getFilesDiff","fsFiles","repository","objects","idsToImport","compact","idList","ComponentIdList","fromArray","scopeImporter","importWithoutDeps","targetVersion","versionObject","loadVersion","parentRef","parents","versionFiles","modelFilesToSourceFiles","foundMeaningfulParent","parentTag","getTagOfRefIfExists","parentVersion","parentObject","hidden","haveSameFiles","parentDiff","diffBetweenVersionsObjects","fromVersionObject","toVersionObject","fromVersionFiles","toVersionFiles","fromFiles","componentFromModel","toFiles","fromVersionLabel","toVersionLabel","fromVersionComponent","toConsumerComponent","name","toVersionComponent","updateFieldsDiff","versionA","versionB","serializeFiles","relativePath","join","fromVersion","toComponentId","color","hash","provider","graphql","loggerMain","cli","createLogger","ComponentCompareAspect","componentCompareMain","register","DiffCmd","componentCompareSchema","exports","GraphqlAspect","ComponentAspect","ScopeAspect","LoggerAspect","CLIAspect","WorkspaceAspect","TesterAspect","ImporterAspect","SchemaAspect","CacheAspect","MainRuntime","find","diffOutput","componentA","componentB","diffBetweenComponentsObjects","addRuntime","_default","default"],"sources":["component-compare.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport { compact } from 'lodash';\nimport { BitError } from '@teambit/bit-error';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect, OutsideWorkspaceError } from '@teambit/workspace';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport type { ScopeMain } from '@teambit/scope';\nimport { ScopeAspect } from '@teambit/scope';\nimport type { GraphqlMain } from '@teambit/graphql';\nimport { GraphqlAspect } from '@teambit/graphql';\nimport { BuilderAspect } from '@teambit/builder';\nimport type { ModelComponent, Version } from '@teambit/objects';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport type { DependencyList, DependencyResolverMain, SerializedDependency } from '@teambit/dependency-resolver';\nimport { DependencyResolverAspect } from '@teambit/dependency-resolver';\nimport type { LoggerMain, Logger } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { DiffOptions, DiffResults, FieldsDiff, FileDiff } from '@teambit/legacy.component-diff';\nimport { getFilesDiff, diffBetweenComponentsObjects } from '@teambit/legacy.component-diff';\nimport type { TesterMain } from '@teambit/tester';\nimport { TesterAspect } from '@teambit/tester';\nimport type { Component, ComponentMain } from '@teambit/component';\nimport { ComponentAspect } from '@teambit/component';\nimport type { SchemaMain } from '@teambit/schema';\nimport { SchemaAspect } from '@teambit/schema';\nimport type { CacheMain } from '@teambit/cache';\nimport { CacheAspect } from '@teambit/cache';\n\nimport { componentCompareSchema } from './component-compare.graphql';\nimport { ComponentCompareAspect } from './component-compare.aspect';\nimport { DiffCmd } from './diff-cmd';\nimport type { ImporterMain } from '@teambit/importer';\nimport { ImporterAspect } from '@teambit/importer';\nimport { concurrentComponentsLimit } from '@teambit/harmony.modules.concurrency';\nimport { compareComponentPairs } from './compare-component-pairs';\nimport type { ComponentComparePair } from './compare-component-pairs';\n\nexport type ComponentCompareResult = {\n id: string;\n baseId: string;\n compareId: string;\n code: FileDiff[];\n fields: FieldsDiff[];\n tests: FileDiff[];\n /**\n * true when the compare side is the live workspace (on-disk files, incl. uncommitted changes).\n * such a result is inherently mutable, so it must never be persisted to the cross-run cache —\n * only the in-flight single-flight dedupe applies. not exposed via graphql.\n */\n isLiveWorkspace?: boolean;\n};\n\ntype ConfigDiff = {\n version?: string;\n dependencies?: string[];\n aspects?: Record<string, any>;\n};\n\n/**\n * expiry for persisted compare/api-diff results. the results themselves are immutable (keyed on snap\n * hashes), but the payloads are heavy — full per-file contents per pair — so without a TTL the cache\n * directory grows with every pair ever viewed. two weeks comfortably covers a review cycle.\n */\nconst PERSISTENT_CACHE_TTL_MS = 14 * 24 * 60 * 60 * 1000;\n\nexport class ComponentCompareMain {\n constructor(\n private componentAspect: ComponentMain,\n private scope: ScopeMain,\n private logger: Logger,\n private tester: TesterMain,\n private depResolver: DependencyResolverMain,\n private importer: ImporterMain,\n private schema: SchemaMain,\n private cache: CacheMain,\n private workspace?: Workspace\n ) {}\n\n // in-flight `compute` promises, so concurrent callers for the same pair share one computation\n // instead of recomputing (the lane compare UI and lane-diff status hit the same pairs in parallel\n // on a cold load). Persisted results survive restarts via the global `@teambit/cache` aspect.\n private compareInflight = new Map<string, Promise<ComponentCompareResult>>();\n private apiDiffInflight = new Map<string, Promise<Record<string, any> | null>>();\n\n /**\n * Read-through cache with single-flight dedupe: serve a persisted result, else share an in-flight\n * computation, else compute once and persist. Most `(baseId, compareId)` pairs are immutable (keyed\n * on snap hashes), so a cached result never goes stale. `cacheable` gates which results are persisted.\n *\n * `skipPersistentCache` bypasses the persistent cache entirely (neither read nor write) while still\n * sharing the in-flight computation. Callers must set it whenever the result depends on mutable state\n * the key does not capture — e.g. a live-workspace diff against on-disk files — so a previously\n * persisted snap-to-snap result for the same key is never served in its place.\n */\n private async getOrCompute<T>(\n inflight: Map<string, Promise<T>>,\n cacheKey: string,\n compute: () => Promise<T>,\n cacheable: (value: T) => boolean = () => true,\n skipPersistentCache = false\n ): Promise<T> {\n const pending = inflight.get(cacheKey);\n if (pending) return pending;\n if (!skipPersistentCache) {\n const cached = await this.cache.get<T>(cacheKey);\n if (cached !== undefined) return cached;\n // a concurrent caller may have started computing while we awaited the cache read.\n const started = inflight.get(cacheKey);\n if (started) return started;\n }\n const promise = compute()\n .then((result) => {\n // TTL keeps the cache bounded: compare payloads embed full per-file contents for every pair,\n // so without an expiry every pair ever viewed stays on disk forever. entries are cheap to\n // recompute after expiry (sources still cached in the scope), so a stale-eviction is harmless.\n if (!skipPersistentCache && cacheable(result)) void this.cache.set(cacheKey, result, PERSISTENT_CACHE_TTL_MS);\n return result;\n })\n .finally(() => inflight.delete(cacheKey));\n inflight.set(cacheKey, promise);\n return promise;\n }\n\n async compare(baseIdStr: string, compareIdStr: string): Promise<ComponentCompareResult> {\n return this.getOrCompute(\n this.compareInflight,\n `component-compare:result:${baseIdStr}|${compareIdStr}`,\n () => this.computeCompare(baseIdStr, compareIdStr),\n // never persist a live-workspace diff: it reflects on-disk files (incl. uncommitted changes),\n // so a cached copy would go stale the moment the user edits a file. the (baseId, compareId)\n // pair is otherwise immutable (keyed on snap hashes), so those stay cacheable.\n (result) => !result.isLiveWorkspace,\n // whether this call *reads* the persistent cache is decided up front from the same signal:\n // a live-workspace compare must skip the cache entirely, otherwise a snap-to-snap result\n // persisted for this key in a prior run (or a non-live context) would mask on-disk changes.\n this.comparesLiveWorkspace(baseIdStr, compareIdStr)\n );\n }\n\n /**\n * cheap, synchronous pre-check mirroring the `comparingWithLocalChanges` / `compareIsLiveWorkspace`\n * logic in `computeCompare`: will this compare diff against live on-disk workspace files rather than\n * two immutable snaps? errs toward `true` (skip the persistent cache) whenever the id cannot be\n * classified, so a stale snap-to-snap result is never served in place of a live one.\n */\n private comparesLiveWorkspace(baseIdStr: string, compareIdStr: string): boolean {\n if (!this.workspace) return false; // scope/remote host: every compare is an immutable snap-to-snap pair\n if (baseIdStr === compareIdStr) return true; // the \"local changes\" view: checked-out snap vs on-disk files\n return this.isLiveCheckout(compareIdStr);\n }\n\n /**\n * whether this id refers to the component version currently checked out on disk — the one case\n * where \"the same versioned id\" can produce different data over time (the user edits files). errs\n * toward `true` when the id cannot be classified, so a stale cached result is never served.\n */\n private isLiveCheckout(idStr: string): boolean {\n if (!this.workspace) return false;\n let id: ComponentID;\n try {\n id = ComponentID.fromString(idStr);\n } catch {\n return true; // unclassifiable id → assume live so a stale cached diff is never returned\n }\n const checkedOut = this.workspace.getIdIfExist(id);\n if (!checkedOut) return false; // not checked out → a stored snap, safe to cache\n // live only when this side is the exact version currently checked out on disk.\n return !id.hasVersion() || checkedOut.version === id.version;\n }\n\n /** The original `compare()` body — moved here so the public method can wrap with memo + single-flight. */\n private async computeCompare(baseIdStr: string, compareIdStr: string): Promise<ComponentCompareResult> {\n const host = this.componentAspect.getHost();\n const [baseCompId, compareCompId] = await host.resolveMultipleComponentIds([baseIdStr, compareIdStr]);\n const modelComponent = await this.scope.legacyScope.getModelComponentIfExist(compareCompId);\n const comparingWithLocalChanges = this.workspace && baseIdStr === compareIdStr;\n\n if (!modelComponent) {\n throw new BitError(`component ${compareCompId.toString()} doesn't have any version yet`);\n }\n\n // import missing components that might be on main\n await this.importer.importObjectsFromMainIfExist([baseCompId, compareCompId], {\n cache: true,\n });\n\n const baseVersion = baseCompId.version as string;\n const compareVersion = compareCompId.version as string;\n\n const components = await host.getMany([baseCompId, compareCompId]);\n const baseComponent = components?.[0];\n const compareComponent = components?.[1];\n const componentWithoutVersion = await host.get((baseCompId || compareCompId).changeVersion(undefined));\n\n // When the compare side is the component currently checked out in the workspace, diff against the\n // on-disk files rather than a stored snap: passing `undefined` as the compare version makes\n // `computeDiff` fall back to `consumerComponent.files`, so uncommitted local changes are included.\n // This covers two cases with one code path:\n // - base === compare (the classic \"local changes\" view): checked-out model → workspace files.\n // - base = an earlier version: that version's committed changes + any uncommitted changes on top.\n // Without this, the default workspace compare resolves base and compare to the same checked-out\n // snap and reports no changes, collapsing the compare view to only its always-on sections.\n const checkedOutVersion = componentWithoutVersion?.id.version;\n const compareIsLiveWorkspace = Boolean(this.workspace && checkedOutVersion && compareVersion === checkedOutVersion);\n const effectiveBaseVersion = comparingWithLocalChanges ? undefined : baseVersion;\n const effectiveCompareVersion = comparingWithLocalChanges || compareIsLiveWorkspace ? undefined : compareVersion;\n\n const diff = componentWithoutVersion\n ? await this.computeDiff(componentWithoutVersion, effectiveBaseVersion, effectiveCompareVersion, {})\n : {\n filesDiff: [],\n fieldsDiff: [],\n };\n\n const baseTestFiles =\n (baseComponent && (await this.tester.getTestFiles(baseComponent).map((file) => file.relative))) || [];\n const compareTestFiles =\n (compareComponent && (await this.tester.getTestFiles(compareComponent).map((file) => file.relative))) || [];\n\n const allTestFiles = [...baseTestFiles, ...compareTestFiles];\n\n const testFilesDiff = (diff.filesDiff || []).filter(\n (fileDiff: FileDiff) => allTestFiles.includes(fileDiff.filePath) && fileDiff.status !== 'UNCHANGED'\n );\n\n return {\n id: `${baseCompId}-${compareCompId}`,\n baseId: baseIdStr,\n compareId: compareIdStr,\n code: diff.filesDiff || [],\n fields: diff.fieldsDiff || [],\n tests: testFilesDiff,\n isLiveWorkspace: compareIsLiveWorkspace,\n };\n }\n\n /**\n * compare a paginated slice of component pairs in one call.\n * a pair that fails to compare (e.g. a component without versions) becomes `null` in the\n * returned array rather than failing the whole batch. the array is aligned to the requested\n * slice (`pairs[offset .. offset + limit]`).\n */\n async compareComponents(\n pairs: ComponentComparePair[],\n options?: { offset?: number; limit?: number }\n ): Promise<Array<ComponentCompareResult | null>> {\n return compareComponentPairs(pairs, (baseId, compareId) => this.compare(baseId, compareId), {\n offset: options?.offset,\n limit: options?.limit,\n concurrency: concurrentComponentsLimit(),\n onError: (pair, err) => {\n this.logger.warn(`compareComponents: failed to compare ${pair.baseId} <> ${pair.compareId}`, err);\n },\n });\n }\n\n /**\n * api-diff a paginated slice of component pairs in one call — the bulk counterpart of the single\n * `getAPIDiff`, mirroring `compareComponents`. reuses `getAPIDiff` per pair (so its disk memo +\n * single-flight dedupe still apply), turning a pair whose diff throws into `null` rather than\n * failing the whole batch. the returned array is aligned to the requested slice.\n */\n async apiDiffs(\n pairs: ComponentComparePair[],\n options?: { offset?: number; limit?: number }\n ): Promise<Array<Record<string, any> | null>> {\n return compareComponentPairs(pairs, (baseId, compareId) => this.getAPIDiff(baseId, compareId), {\n offset: options?.offset,\n limit: options?.limit,\n concurrency: concurrentComponentsLimit(),\n onError: (pair, err) => {\n this.logger.warn(`apiDiffs: failed to compute api diff ${pair.baseId} <> ${pair.compareId}`, err);\n },\n });\n }\n\n private static isApiDiffCacheable(result: Record<string, any>): boolean {\n // a live-extracted side reflects the current working tree, not the snap the cache key names —\n // persisting it would serve a stale (possibly degraded) diff for that pair forever.\n if (result.base?.live || result.compare?.live) return false;\n if (result.status === 'COMPUTED') return true;\n // A non-COMPUTED result is only safe to persist (disk cache, keyed on the immutable snap pair, no\n // TTL) when it can never change for that pair. FAILED is transient. NOT_BUILT is *pending*: the snap\n // simply hasn't been built yet, and once CI builds it (same hash) the schema appears — caching the\n // pre-build \"unavailable\" answer would keep the API view blank forever. NO_EXTRACTOR/DISABLED are\n // stable properties of the snap's env, so they stay cacheable.\n const pendingOrTransient = (reason?: string) => reason === 'FAILED' || reason === 'NOT_BUILT';\n return !pendingOrTransient(result.base?.reason) && !pendingOrTransient(result.compare?.reason);\n }\n\n async getAPIDiff(baseIdStr: string, compareIdStr: string): Promise<Record<string, any> | null> {\n // never persist a result that can still change: `null` (snaps couldn't load), FAILED (schema\n // retrieval threw) and NOT_BUILT (snap not yet built) must recompute next call; NO_EXTRACTOR/\n // DISABLED are stable env properties and safe to cache (see `isApiDiffCacheable`).\n // the version namespace invalidates older computed results on engine changes:\n // v2 — availability-aware results; v3 — self-referential-returnType display fix.\n // skip the persistent cache when EITHER side is the live checkout: SchemaMain live-extracts the\n // schema of a modified checkout of the exact same versioned id, so a snap-to-snap result cached\n // under this key in a prior (unmodified) run would mask the user's on-disk API changes. both\n // sides are checked (unlike `compare()`, where only the compare side can be live) because the\n // checked-out version can appear on either side of an API diff pair.\n return this.getOrCompute(\n this.apiDiffInflight,\n `component-compare:api-diff:v3:${baseIdStr}|${compareIdStr}`,\n () => this.computeAPIDiff(baseIdStr, compareIdStr),\n (v) => v !== null && ComponentCompareMain.isApiDiffCacheable(v),\n this.isLiveCheckout(baseIdStr) || this.isLiveCheckout(compareIdStr)\n );\n }\n\n private async computeAPIDiff(baseIdStr: string, compareIdStr: string): Promise<Record<string, any> | null> {\n const host = this.componentAspect.getHost();\n const [baseCompId, compareCompId] = await host.resolveMultipleComponentIds([baseIdStr, compareIdStr]);\n await this.importer.importObjectsFromMainIfExist([baseCompId, compareCompId], { cache: true });\n const components = await host.getMany([baseCompId, compareCompId]);\n const baseComponent = components?.[0];\n const compareComponent = components?.[1];\n if (!baseComponent || !compareComponent) return null;\n return this.schema.computeAPIDiff(baseComponent, compareComponent);\n }\n\n async diffByCLIValues(\n pattern?: string,\n version?: string,\n toVersion?: string,\n { verbose, table, parent }: { verbose?: boolean; table?: boolean; parent?: boolean } = {}\n ): Promise<any> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const ids = pattern ? await this.workspace.idsByPattern(pattern) : await this.workspace.listTagPendingIds();\n const consumer = this.workspace.consumer;\n if (!ids.length) {\n return [];\n }\n const diffResults = await this.componentsDiff(ids, version, toVersion, {\n verbose,\n formatDepsAsTable: table,\n compareToParent: parent,\n });\n await consumer.onDestroy('diff');\n return diffResults;\n }\n\n async getConfigForDiffById(id: string): Promise<ConfigDiff> {\n const workspace = this.workspace;\n if (!workspace) throw new OutsideWorkspaceError();\n const componentId = await workspace.resolveComponentId(id);\n const component = await workspace.scope.get(componentId, false);\n if (!component) throw new Error(`getConfigForDiff: unable to find component ${id} in local scope`);\n return this.getConfigForDiffByCompObject(component);\n }\n\n async getConfigForDiffByCompObject(component: Component, modifiedIds?: ComponentID[]) {\n const depData = this.depResolver.getDependencies(component);\n const modifiedIdsStr = modifiedIds?.map((id) => id.toStringWithoutVersion());\n const serializedToString = (dep: SerializedDependency) => {\n const idWithoutVersion = dep.__type === 'package' ? dep.id : dep.id.split('@')[0];\n const version = modifiedIdsStr?.includes(idWithoutVersion) ? `<modified>` : dep.version;\n return `${idWithoutVersion}@${version} (${dep.lifecycle}) ${dep.source ? `(${dep.source})` : ''}`;\n };\n const serializeAndSort = (deps: DependencyList) => {\n const serialized = deps.serialize().map(serializedToString);\n return serialized.sort();\n };\n const serializeAspect = (comp: Component) => {\n const aspects = comp.state.aspects.withoutEntries([BuilderAspect.id, DependencyResolverAspect.id]);\n // return aspects.serialize();\n return aspects.toLegacy().sortById().toConfigObject();\n };\n return {\n version: component.id.version,\n dependencies: serializeAndSort(depData),\n aspects: serializeAspect(component),\n };\n }\n\n private async componentsDiff(\n ids: ComponentID[],\n version: string | undefined,\n toVersion: string | undefined,\n diffOpts: DiffOptions\n ): Promise<DiffResults[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const components = await this.workspace.getMany(ids);\n if (!components.length) throw new BitError('failed loading the components');\n if (toVersion && !version)\n throw new BitError('error: componentsDiff expects to get version when toVersion is entered');\n const componentsDiffResults = await Promise.all(\n components.map((component) => this.computeDiff(component, version, toVersion, diffOpts))\n );\n return componentsDiffResults;\n }\n\n /**\n * this method operates in two modes:\n * 1. workspace mode - the version and toVersion can be undefined.\n * 2. scope mode - the version and toVersion are mandatory.\n */\n private async computeDiff(\n component: Component,\n version: string | undefined,\n toVersion: string | undefined,\n diffOpts: DiffOptions\n ): Promise<DiffResults> {\n const consumerComponent = component.state._consumer as ConsumerComponent;\n\n const diffResult: DiffResults = { id: component.id, hasDiff: false };\n const modelComponent =\n consumerComponent.modelComponent || (await this.scope.legacyScope.getModelComponentIfExist(component.id));\n\n if (this.workspace && component.isDeleted() && !diffOpts.compareToParent) {\n // component exists in the model but not in the filesystem, show all files as deleted.\n // with --parent, the comparison is between stored versions, so the deletion state is irrelevant.\n const modelFiles = consumerComponent.files;\n diffResult.filesDiff = await getFilesDiff(modelFiles, [], component.id.version, component.id.version);\n if (hasDiff(diffResult)) diffResult.hasDiff = true;\n return diffResult;\n }\n if (!modelComponent) {\n if (version || toVersion) {\n throw new BitError(`component ${component.id.toString()} doesn't have any version yet`);\n }\n // it's a new component. not modified. show all files as new.\n const fsFiles = consumerComponent.files;\n diffResult.filesDiff = await getFilesDiff([], fsFiles, component.id.version, component.id.version);\n if (hasDiff(diffResult)) diffResult.hasDiff = true;\n return diffResult;\n }\n const repository = this.scope.legacyScope.objects;\n if (diffOpts.compareToParent) {\n if (toVersion) throw new BitError('--parent flag expects to get only one version');\n if (!version) version = component.id.version;\n }\n const idsToImport = compact([\n version ? component.id.changeVersion(version) : undefined,\n toVersion ? component.id.changeVersion(toVersion) : undefined,\n ]);\n const idList = ComponentIdList.fromArray(idsToImport);\n await this.scope.legacyScope.scopeImporter.importWithoutDeps(idList, { cache: true, reason: 'to show diff' });\n if (diffOpts.compareToParent) {\n const targetVersion = version as string; // guaranteed to be set above when compareToParent\n const versionObject = await modelComponent.loadVersion(targetVersion, repository);\n let parentRef = versionObject.parents[0];\n if (!parentRef) {\n // it's the first version. show all files as new.\n const versionFiles = await versionObject.modelFilesToSourceFiles(repository);\n diffResult.filesDiff = await getFilesDiff([], versionFiles, 'no parent', targetVersion);\n if (hasDiff(diffResult)) diffResult.hasDiff = true;\n return diffResult;\n }\n // walk up the parent chain and skip ancestors that are not meaningful to diff against:\n // 1. hidden ancestors. when a lane is merged and the tag is created by tag-from-scope (_tag),\n // the tag is identical to the merged snap, so that snap is marked as hidden.\n // 2. snap ancestors with content identical to the given version. same tag-from-scope scenario,\n // but when the artifacts are re-built, the merged snap is not marked as hidden.\n // a tag ancestor is never skipped by content, so a legit tag with no changes (e.g. created\n // with --unmodified) still shows no diff.\n toVersion = targetVersion;\n let foundMeaningfulParent = false;\n while (parentRef) {\n const parentTag = modelComponent.getTagOfRefIfExists(parentRef);\n const parentVersion: string = parentTag || parentRef.toString();\n await this.scope.legacyScope.scopeImporter.importWithoutDeps(\n ComponentIdList.fromArray([component.id.changeVersion(parentVersion)]),\n { cache: true, reason: 'to show diff' }\n );\n const parentObject = await modelComponent.loadVersion(parentVersion, repository);\n version = parentVersion;\n if (!parentObject.hidden) {\n if (parentTag) {\n foundMeaningfulParent = true;\n break;\n }\n // cheap check first. when the files differ, this ancestor is meaningful, no need to\n // compute the full diff here (it is computed once below for the output).\n if (!this.haveSameFiles(parentObject, versionObject)) {\n foundMeaningfulParent = true;\n break;\n }\n // files are identical, compute the diff to find out whether the fields (deps/config) differ.\n const parentDiff = await this.diffBetweenVersionsObjects(\n modelComponent,\n parentObject,\n versionObject,\n parentVersion,\n toVersion,\n diffOpts\n );\n if (parentDiff.hasDiff) {\n foundMeaningfulParent = true;\n break;\n }\n }\n parentRef = parentObject.parents[0];\n }\n if (!foundMeaningfulParent) {\n // the entire parent chain consists of skipped ancestors - hidden snaps and/or snaps with\n // identical content (e.g. the first release of a component created by the merge +\n // tag-from-scope flow, with or without rebuilt artifacts). treat it as having no parent\n // and show all files as new, rather than diffing against a skipped snap.\n const versionFiles = await versionObject.modelFilesToSourceFiles(repository);\n diffResult.filesDiff = await getFilesDiff([], versionFiles, 'no parent', targetVersion);\n if (hasDiff(diffResult)) diffResult.hasDiff = true;\n return diffResult;\n }\n }\n const fromVersionObject = version ? await modelComponent.loadVersion(version, repository) : undefined;\n const toVersionObject = toVersion ? await modelComponent.loadVersion(toVersion, repository) : undefined;\n const fromVersionFiles = await fromVersionObject?.modelFilesToSourceFiles(repository);\n const toVersionFiles = await toVersionObject?.modelFilesToSourceFiles(repository);\n\n const fromFiles = fromVersionFiles || consumerComponent.componentFromModel?.files;\n if (!fromFiles)\n throw new Error(\n `computeDiff: fromFiles must be defined for ${component.id.toString()}. if on workspace, consumerComponent.componentFromModel must be set. if on scope, fromVersionFiles must be set`\n );\n const toFiles = toVersionFiles || consumerComponent.files;\n const fromVersionLabel = version || component.id.version;\n const toVersionLabel = toVersion || component.id.version;\n\n diffResult.filesDiff = await getFilesDiff(fromFiles!, toFiles, fromVersionLabel, toVersionLabel);\n const fromVersionComponent = version\n ? await modelComponent.toConsumerComponent(version, this.scope.legacyScope.name, repository)\n : consumerComponent.componentFromModel;\n\n const toVersionComponent = toVersion\n ? await modelComponent.toConsumerComponent(toVersion, this.scope.legacyScope.name, repository)\n : consumerComponent;\n\n if (!fromVersionComponent) {\n throw new Error(\n `computeDiff: fromVersionComponent must be defined for ${component.id.toString()}. if on workspace, consumerComponent.componentFromModel must be set. if on scope, \"version\" must be set`\n );\n }\n\n await updateFieldsDiff(fromVersionComponent, toVersionComponent, diffResult, diffOpts);\n\n return diffResult;\n }\n\n private haveSameFiles(versionA: Version, versionB: Version): boolean {\n const serializeFiles = (version: Version) =>\n version.files\n .map((file) => `${file.relativePath}:${file.file.toString()}`)\n .sort()\n .join();\n return serializeFiles(versionA) === serializeFiles(versionB);\n }\n\n async diffBetweenVersionsObjects(\n modelComponent: ModelComponent,\n fromVersionObject: Version,\n toVersionObject: Version,\n fromVersion: string,\n toVersion: string,\n diffOpts: DiffOptions\n ) {\n const diffResult: DiffResults = { id: modelComponent.toComponentId(), hasDiff: false };\n const scope = this.scope.legacyScope;\n const repository = scope.objects;\n const fromVersionFiles = await fromVersionObject.modelFilesToSourceFiles(repository);\n const toVersionFiles = await toVersionObject.modelFilesToSourceFiles(repository);\n const color = diffOpts.color ?? true;\n diffResult.filesDiff = await getFilesDiff(\n fromVersionFiles,\n toVersionFiles,\n fromVersion,\n toVersion,\n undefined,\n color\n );\n const fromVersionComponent = await modelComponent.toConsumerComponent(\n fromVersionObject.hash().toString(),\n scope.name,\n repository\n );\n const toVersionComponent = await modelComponent.toConsumerComponent(\n toVersionObject.hash().toString(),\n scope.name,\n repository\n );\n await updateFieldsDiff(fromVersionComponent, toVersionComponent, diffResult, diffOpts);\n return diffResult;\n }\n\n static slots = [];\n static dependencies = [\n GraphqlAspect,\n ComponentAspect,\n ScopeAspect,\n LoggerAspect,\n CLIAspect,\n WorkspaceAspect,\n TesterAspect,\n DependencyResolverAspect,\n ImporterAspect,\n SchemaAspect,\n CacheAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n graphql,\n component,\n scope,\n loggerMain,\n cli,\n workspace,\n tester,\n depResolver,\n importer,\n schema,\n cache,\n ]: [\n GraphqlMain,\n ComponentMain,\n ScopeMain,\n LoggerMain,\n CLIMain,\n Workspace,\n TesterMain,\n DependencyResolverMain,\n ImporterMain,\n SchemaMain,\n CacheMain,\n ]) {\n const logger = loggerMain.createLogger(ComponentCompareAspect.id);\n const componentCompareMain = new ComponentCompareMain(\n component,\n scope,\n logger,\n tester,\n depResolver,\n importer,\n schema,\n cache,\n workspace\n );\n cli.register(new DiffCmd(componentCompareMain));\n graphql.register(() => componentCompareSchema(componentCompareMain));\n return componentCompareMain;\n }\n}\n\nfunction hasDiff(diffResult: DiffResults): boolean {\n return !!((diffResult.filesDiff && diffResult.filesDiff.find((file) => file.diffOutput)) || diffResult.fieldsDiff);\n}\n\nasync function updateFieldsDiff(\n componentA: ConsumerComponent,\n componentB: ConsumerComponent,\n diffResult: DiffResults,\n diffOpts: DiffOptions\n) {\n diffResult.fieldsDiff = await diffBetweenComponentsObjects(componentA, componentB, diffOpts);\n diffResult.hasDiff = hasDiff(diffResult);\n}\n\nComponentCompareAspect.addRuntime(ComponentCompareMain);\n\nexport default ComponentCompareMain;\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA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,GAAAlB,OAAA,CAAAmB,OAAA,GAEzC/P,oBAAoB","ignoreList":[]}
@@ -39,15 +39,15 @@ export declare class DiffCmd implements Command {
39
39
  additions: number;
40
40
  deletions: number;
41
41
  filePath: string;
42
- status: import("@teambit/legacy.component-diff/dist/components-diff").DiffStatus;
42
+ status: import("@teambit/legacy.component-diff/dist/components-diff.js").DiffStatus;
43
43
  diffOutput?: undefined;
44
44
  } | {
45
45
  filePath: string;
46
- status: import("@teambit/legacy.component-diff/dist/components-diff").DiffStatus;
46
+ status: import("@teambit/legacy.component-diff/dist/components-diff.js").DiffStatus;
47
47
  diffOutput?: undefined;
48
48
  } | {
49
49
  filePath: string;
50
- status: import("@teambit/legacy.component-diff/dist/components-diff").DiffStatus;
50
+ status: import("@teambit/legacy.component-diff/dist/components-diff.js").DiffStatus;
51
51
  diffOutput: string;
52
52
  })[] | undefined;
53
53
  fieldsDiff: import("@teambit/legacy.component-diff").FieldsDiff[] | null | undefined;
package/dist/diff-cmd.js CHANGED
@@ -62,7 +62,7 @@ for ai-agent workflows, use --name-only to list what changed, --file to drill in
62
62
  if both "version" and "to-version" are provided, compare those two versions directly (ignoring the workspace).`
63
63
  }]);
64
64
  _defineProperty(this, "alias", '');
65
- _defineProperty(this, "options", [['p', 'parent', 'compare the specified "version" to its immediate parent instead of comparing to the current one'], ['v', 'verbose', 'show a more verbose output where possible'], ['t', 'table', 'show tables instead of plain text for dependencies diff'], ['', 'file <paths>', 'show only file diffs for the given component-relative path(s). comma-separated. implies --files-only'], ['', 'files-only', 'show only file-content diffs; omit dependency, env, and aspect-config changes'], ['', 'configs-only', 'show only dependency, env, and aspect-config changes; omit file-content diffs'], ['', 'name-only', 'summary: list changed files with status (M/A/D) and changed field categories; no diff bodies'], ['', 'stat', 'summary: like --name-only but includes +N -M line counts per file'], ['j', 'json', 'return the diff result as json']]);
65
+ _defineProperty(this, "options", [['p', 'parent', 'compare the specified "version" (or the current version if not specified) to its nearest meaningful ancestor, showing what changed in that version. hidden ancestors and identical un-tagged snaps (e.g. the merged snap a release-tag was created from) are skipped; tagged ancestors are never skipped'], ['v', 'verbose', 'show a more verbose output where possible'], ['t', 'table', 'show tables instead of plain text for dependencies diff'], ['', 'file <paths>', 'show only file diffs for the given component-relative path(s). comma-separated. implies --files-only'], ['', 'files-only', 'show only file-content diffs; omit dependency, env, and aspect-config changes'], ['', 'configs-only', 'show only dependency, env, and aspect-config changes; omit file-content diffs'], ['', 'name-only', 'summary: list changed files with status (M/A/D) and changed field categories; no diff bodies'], ['', 'stat', 'summary: like --name-only but includes +N -M line counts per file'], ['j', 'json', 'return the diff result as json']]);
66
66
  _defineProperty(this, "examples", [{
67
67
  cmd: 'diff',
68
68
  description: 'show diff for all modified components'
@@ -81,6 +81,9 @@ if both "version" and "to-version" are provided, compare those two versions dire
81
81
  }, {
82
82
  cmd: 'diff foo 0.0.2 --parent',
83
83
  description: 'compare "foo@0.0.2" to its parent version. showing what changed in 0.0.2'
84
+ }, {
85
+ cmd: 'diff foo --parent',
86
+ description: 'compare the current version of "foo" to its parent version. showing what changed in it'
84
87
  }, {
85
88
  cmd: 'diff foo --name-only',
86
89
  description: 'list changed files and field categories without diff bodies'
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_bitError","_legacy","_legacy2","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DiffCmd","constructor","componentCompareMain","name","description","COMPONENT_PATTERN_HELP","cmd","report","pattern","version","toVersion","flags","outputOpts","parseOutputOpts","diffResults","runDiff","chalk","yellow","outputDiffResultsFormatted","json","filtered","filterDiffResults","map","result","id","toStringWithoutVersion","hasDiff","filesDiff","fd","status","diffOutput","projectFileDiffForJson","fieldsDiff","opts","filePath","stat","countDiffLines","nameOnly","verbose","table","parent","diffByCLIValues","file","filesOnly","configsOnly","files","split","f","trim","Boolean","undefined","BitError","exports"],"sources":["diff-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { BitError } from '@teambit/bit-error';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { DiffOutputOptions, DiffResults, FileDiff } from '@teambit/legacy.component-diff';\nimport { countDiffLines, filterDiffResults, outputDiffResultsFormatted } from '@teambit/legacy.component-diff';\nimport type { ComponentCompareMain } from './component-compare.main.runtime';\n\ntype DiffFlags = {\n verbose?: boolean;\n table?: boolean;\n parent?: boolean;\n file?: string;\n filesOnly?: boolean;\n configsOnly?: boolean;\n nameOnly?: boolean;\n stat?: boolean;\n json?: boolean;\n};\n\nexport class DiffCmd implements Command {\n name = 'diff [component-pattern] [version] [to-version]';\n group = 'info-analysis';\n description = 'compare component changes between versions or against the current workspace';\n extendedDescription = `shows a detailed diff of component files, dependencies, and configuration changes.\nby default, compares workspace changes against the latest version. specify versions to compare historical changes.\nsupports pattern matching to filter components and various output formats for better readability.\nfor ai-agent workflows, use --name-only to list what changed, --file to drill into a specific file,\n--files-only / --configs-only to focus on one diff category, or --json for machine-readable output.`;\n helpUrl = 'docs/components/merging-changes#compare-component-snaps';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n {\n name: 'version',\n description: `the base version to compare from. if omitted, compares the workspace's current files to the component's latest version.`,\n },\n {\n name: 'to-version',\n description: `the target version to compare against \"version\".\nif both \"version\" and \"to-version\" are provided, compare those two versions directly (ignoring the workspace).`,\n },\n ];\n alias = '';\n options = [\n ['p', 'parent', 'compare the specified \"version\" to its immediate parent instead of comparing to the current one'],\n ['v', 'verbose', 'show a more verbose output where possible'],\n ['t', 'table', 'show tables instead of plain text for dependencies diff'],\n [\n '',\n 'file <paths>',\n 'show only file diffs for the given component-relative path(s). comma-separated. implies --files-only',\n ],\n ['', 'files-only', 'show only file-content diffs; omit dependency, env, and aspect-config changes'],\n ['', 'configs-only', 'show only dependency, env, and aspect-config changes; omit file-content diffs'],\n ['', 'name-only', 'summary: list changed files with status (M/A/D) and changed field categories; no diff bodies'],\n ['', 'stat', 'summary: like --name-only but includes +N -M line counts per file'],\n ['j', 'json', 'return the diff result as json'],\n ] as CommandOptions;\n examples = [\n { cmd: 'diff', description: 'show diff for all modified components' },\n { cmd: 'diff foo', description: 'show diff for a component \"foo\"' },\n { cmd: 'diff foo 0.0.1', description: 'show diff for a component \"foo\" from the current state to version 0.0.1' },\n { cmd: 'diff foo 0.0.1 0.0.2', description: 'show diff for a component \"foo\" from version 0.0.1 to version 0.0.2' },\n {\n cmd: \"diff '$codeModified' \",\n description: 'show diff only for components with modified files. ignore config changes',\n },\n {\n cmd: 'diff foo 0.0.2 --parent',\n description: 'compare \"foo@0.0.2\" to its parent version. showing what changed in 0.0.2',\n },\n { cmd: 'diff foo --name-only', description: 'list changed files and field categories without diff bodies' },\n { cmd: 'diff foo --file src/index.ts', description: 'show the diff of a single file in a component' },\n { cmd: 'diff foo --files-only', description: 'show only source-code diffs, skip dependency/config changes' },\n { cmd: 'diff foo --json', description: 'return the diff result as json for programmatic consumption' },\n ];\n loader = true;\n pager = true;\n\n constructor(private componentCompareMain: ComponentCompareMain) {}\n\n async report([pattern, version, toVersion]: [string, string, string], flags: DiffFlags) {\n const outputOpts = this.parseOutputOpts(flags);\n const diffResults = await this.runDiff([pattern, version, toVersion], flags);\n if (!diffResults.length) {\n return chalk.yellow('there are no modified components to diff');\n }\n return outputDiffResultsFormatted(diffResults, outputOpts);\n }\n\n async json([pattern, version, toVersion]: [string, string, string], flags: DiffFlags) {\n const outputOpts = this.parseOutputOpts(flags);\n const diffResults = await this.runDiff([pattern, version, toVersion], flags);\n const filtered = filterDiffResults(diffResults, outputOpts);\n return filtered.map((result) => ({\n id: result.id.toStringWithoutVersion(),\n hasDiff: result.hasDiff,\n filesDiff: result.filesDiff\n ?.filter((fd) => fd.status !== 'UNCHANGED' && fd.diffOutput)\n .map((fd) => this.projectFileDiffForJson(fd, outputOpts)),\n fieldsDiff: result.fieldsDiff,\n }));\n }\n\n private projectFileDiffForJson(fd: FileDiff, opts: DiffOutputOptions) {\n const { filePath, status } = fd;\n if (opts.stat) {\n return { filePath, status, ...countDiffLines(fd.diffOutput) };\n }\n if (opts.nameOnly) {\n return { filePath, status };\n }\n return { filePath, status, diffOutput: fd.diffOutput };\n }\n\n private async runDiff(\n [pattern, version, toVersion]: [string, string, string],\n { verbose = false, table = false, parent }: DiffFlags\n ): Promise<DiffResults[]> {\n return this.componentCompareMain.diffByCLIValues(pattern, version, toVersion, {\n verbose,\n table,\n parent,\n });\n }\n\n private parseOutputOpts(flags: DiffFlags): DiffOutputOptions {\n const { file, filesOnly, configsOnly, nameOnly, stat } = flags;\n const files = file\n ? file\n .split(',')\n .map((f) => f.trim())\n .filter(Boolean)\n : undefined;\n\n if (filesOnly && configsOnly) {\n throw new BitError('--files-only and --configs-only are mutually exclusive');\n }\n if (configsOnly && files && files.length) {\n throw new BitError('--file and --configs-only are mutually exclusive');\n }\n if (nameOnly && stat) {\n throw new BitError('--name-only and --stat are mutually exclusive');\n }\n\n return {\n filesOnly: filesOnly || Boolean(files && files.length),\n configsOnly,\n files,\n nameOnly,\n stat,\n };\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAA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KAAK,CAAC/D,MAAM,EAAE;MACxC,MAAM,KAAIqE,oBAAQ,EAAC,kDAAkD,CAAC;IACxE;IACA,IAAId,QAAQ,IAAIF,IAAI,EAAE;MACpB,MAAM,KAAIgB,oBAAQ,EAAC,+CAA+C,CAAC;IACrE;IAEA,OAAO;MACLR,SAAS,EAAEA,SAAS,IAAIM,OAAO,CAACJ,KAAK,IAAIA,KAAK,CAAC/D,MAAM,CAAC;MACtD8D,WAAW;MACXC,KAAK;MACLR,QAAQ;MACRF;IACF,CAAC;EACH;AACF;AAACiB,OAAA,CAAApD,OAAA,GAAAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_bitError","_legacy","_legacy2","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DiffCmd","constructor","componentCompareMain","name","description","COMPONENT_PATTERN_HELP","cmd","report","pattern","version","toVersion","flags","outputOpts","parseOutputOpts","diffResults","runDiff","chalk","yellow","outputDiffResultsFormatted","json","filtered","filterDiffResults","map","result","id","toStringWithoutVersion","hasDiff","filesDiff","fd","status","diffOutput","projectFileDiffForJson","fieldsDiff","opts","filePath","stat","countDiffLines","nameOnly","verbose","table","parent","diffByCLIValues","file","filesOnly","configsOnly","files","split","f","trim","Boolean","undefined","BitError","exports"],"sources":["diff-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { BitError } from '@teambit/bit-error';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { DiffOutputOptions, DiffResults, FileDiff } from '@teambit/legacy.component-diff';\nimport { countDiffLines, filterDiffResults, outputDiffResultsFormatted } from '@teambit/legacy.component-diff';\nimport type { ComponentCompareMain } from './component-compare.main.runtime';\n\ntype DiffFlags = {\n verbose?: boolean;\n table?: boolean;\n parent?: boolean;\n file?: string;\n filesOnly?: boolean;\n configsOnly?: boolean;\n nameOnly?: boolean;\n stat?: boolean;\n json?: boolean;\n};\n\nexport class DiffCmd implements Command {\n name = 'diff [component-pattern] [version] [to-version]';\n group = 'info-analysis';\n description = 'compare component changes between versions or against the current workspace';\n extendedDescription = `shows a detailed diff of component files, dependencies, and configuration changes.\nby default, compares workspace changes against the latest version. specify versions to compare historical changes.\nsupports pattern matching to filter components and various output formats for better readability.\nfor ai-agent workflows, use --name-only to list what changed, --file to drill into a specific file,\n--files-only / --configs-only to focus on one diff category, or --json for machine-readable output.`;\n helpUrl = 'docs/components/merging-changes#compare-component-snaps';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n {\n name: 'version',\n description: `the base version to compare from. if omitted, compares the workspace's current files to the component's latest version.`,\n },\n {\n name: 'to-version',\n description: `the target version to compare against \"version\".\nif both \"version\" and \"to-version\" are provided, compare those two versions directly (ignoring the workspace).`,\n },\n ];\n alias = '';\n options = [\n [\n 'p',\n 'parent',\n 'compare the specified \"version\" (or the current version if not specified) to its nearest meaningful ancestor, showing what changed in that version. hidden ancestors and identical un-tagged snaps (e.g. the merged snap a release-tag was created from) are skipped; tagged ancestors are never skipped',\n ],\n ['v', 'verbose', 'show a more verbose output where possible'],\n ['t', 'table', 'show tables instead of plain text for dependencies diff'],\n [\n '',\n 'file <paths>',\n 'show only file diffs for the given component-relative path(s). comma-separated. implies --files-only',\n ],\n ['', 'files-only', 'show only file-content diffs; omit dependency, env, and aspect-config changes'],\n ['', 'configs-only', 'show only dependency, env, and aspect-config changes; omit file-content diffs'],\n ['', 'name-only', 'summary: list changed files with status (M/A/D) and changed field categories; no diff bodies'],\n ['', 'stat', 'summary: like --name-only but includes +N -M line counts per file'],\n ['j', 'json', 'return the diff result as json'],\n ] as CommandOptions;\n examples = [\n { cmd: 'diff', description: 'show diff for all modified components' },\n { cmd: 'diff foo', description: 'show diff for a component \"foo\"' },\n { cmd: 'diff foo 0.0.1', description: 'show diff for a component \"foo\" from the current state to version 0.0.1' },\n { cmd: 'diff foo 0.0.1 0.0.2', description: 'show diff for a component \"foo\" from version 0.0.1 to version 0.0.2' },\n {\n cmd: \"diff '$codeModified' \",\n description: 'show diff only for components with modified files. ignore config changes',\n },\n {\n cmd: 'diff foo 0.0.2 --parent',\n description: 'compare \"foo@0.0.2\" to its parent version. showing what changed in 0.0.2',\n },\n {\n cmd: 'diff foo --parent',\n description: 'compare the current version of \"foo\" to its parent version. showing what changed in it',\n },\n { cmd: 'diff foo --name-only', description: 'list changed files and field categories without diff bodies' },\n { cmd: 'diff foo --file src/index.ts', description: 'show the diff of a single file in a component' },\n { cmd: 'diff foo --files-only', description: 'show only source-code diffs, skip dependency/config changes' },\n { cmd: 'diff foo --json', description: 'return the diff result as json for programmatic consumption' },\n ];\n loader = true;\n pager = true;\n\n constructor(private componentCompareMain: ComponentCompareMain) {}\n\n async report([pattern, version, toVersion]: [string, string, string], flags: DiffFlags) {\n const outputOpts = this.parseOutputOpts(flags);\n const diffResults = await this.runDiff([pattern, version, toVersion], flags);\n if (!diffResults.length) {\n return chalk.yellow('there are no modified components to diff');\n }\n return outputDiffResultsFormatted(diffResults, outputOpts);\n }\n\n async json([pattern, version, toVersion]: [string, string, string], flags: DiffFlags) {\n const outputOpts = this.parseOutputOpts(flags);\n const diffResults = await this.runDiff([pattern, version, toVersion], flags);\n const filtered = filterDiffResults(diffResults, outputOpts);\n return filtered.map((result) => ({\n id: result.id.toStringWithoutVersion(),\n hasDiff: result.hasDiff,\n filesDiff: result.filesDiff\n ?.filter((fd) => fd.status !== 'UNCHANGED' && fd.diffOutput)\n .map((fd) => this.projectFileDiffForJson(fd, outputOpts)),\n fieldsDiff: result.fieldsDiff,\n }));\n }\n\n private projectFileDiffForJson(fd: FileDiff, opts: DiffOutputOptions) {\n const { filePath, status } = fd;\n if (opts.stat) {\n return { filePath, status, ...countDiffLines(fd.diffOutput) };\n }\n if (opts.nameOnly) {\n return { filePath, status };\n }\n return { filePath, status, diffOutput: fd.diffOutput };\n }\n\n private async runDiff(\n [pattern, version, toVersion]: [string, string, string],\n { verbose = false, table = false, parent }: DiffFlags\n ): Promise<DiffResults[]> {\n return this.componentCompareMain.diffByCLIValues(pattern, version, toVersion, {\n verbose,\n table,\n parent,\n });\n }\n\n private parseOutputOpts(flags: DiffFlags): DiffOutputOptions {\n const { file, filesOnly, configsOnly, nameOnly, stat } = flags;\n const files = file\n ? file\n .split(',')\n .map((f) => f.trim())\n .filter(Boolean)\n : undefined;\n\n if (filesOnly && configsOnly) {\n throw new BitError('--files-only and --configs-only are mutually exclusive');\n }\n if (configsOnly && files && files.length) {\n throw new BitError('--file and --configs-only are mutually exclusive');\n }\n if (nameOnly && stat) {\n throw new BitError('--name-only and --stat are mutually exclusive');\n }\n\n return {\n filesOnly: filesOnly || Boolean(files && files.length),\n configsOnly,\n files,\n nameOnly,\n stat,\n };\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA+G,SAAAC,uBAAAK,CAAA,WAAAA,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gB,oBAAQ,EAAC,+CAA+C,CAAC;IACrE;IAEA,OAAO;MACLR,SAAS,EAAEA,SAAS,IAAIM,OAAO,CAACJ,KAAK,IAAIA,KAAK,CAAC/D,MAAM,CAAC;MACtD8D,WAAW;MACXC,KAAK;MACLR,QAAQ;MACRF;IACF,CAAC;EACH;AACF;AAACiB,OAAA,CAAApD,OAAA,GAAAA,OAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component-compare@1.0.1087/dist/component-compare.compositions.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component-compare@1.0.1087/dist/component-compare.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component-compare@1.0.1088/dist/component-compare.compositions.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component-compare@1.0.1088/dist/component-compare.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/component-compare",
3
- "version": "1.0.1087",
3
+ "version": "1.0.1088",
4
4
  "homepage": "https://bit.cloud/teambit/component/component-compare",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "component-compare",
9
- "version": "1.0.1087"
9
+ "version": "1.0.1088"
10
10
  },
11
11
  "dependencies": {
12
12
  "p-map": "4.0.0",
@@ -29,28 +29,28 @@
29
29
  "@teambit/semantics.ui.api-diff-view": "0.0.2",
30
30
  "@teambit/harmony": "0.4.12",
31
31
  "@teambit/bit-error": "0.0.404",
32
+ "@teambit/cache": "0.0.1453",
33
+ "@teambit/cli": "0.0.1360",
32
34
  "@teambit/component-id": "1.2.4",
33
35
  "@teambit/harmony.modules.concurrency": "0.0.40",
36
+ "@teambit/legacy.component-diff": "0.0.199",
37
+ "@teambit/legacy.consumer-component": "0.0.144",
38
+ "@teambit/logger": "0.0.1453",
34
39
  "@teambit/component.ui.component-compare.changelog": "0.0.249",
35
40
  "@teambit/ui-foundation.ui.react-router.slot-router": "0.0.527",
36
41
  "@teambit/component.ui.component-compare.compare-aspects.compare-aspects": "0.0.155",
37
42
  "@teambit/legacy.constants": "0.0.39",
38
- "@teambit/component": "1.0.1087",
39
- "@teambit/graphql": "1.0.1087",
40
- "@teambit/builder": "1.0.1087",
41
- "@teambit/cache": "0.0.1453",
42
- "@teambit/cli": "0.0.1360",
43
- "@teambit/dependency-resolver": "1.0.1087",
44
- "@teambit/importer": "1.0.1087",
45
- "@teambit/legacy.component-diff": "0.0.199",
46
- "@teambit/legacy.consumer-component": "0.0.144",
47
- "@teambit/logger": "0.0.1453",
48
- "@teambit/objects": "0.0.594",
49
- "@teambit/schema": "1.0.1087",
50
- "@teambit/scope": "1.0.1087",
51
- "@teambit/tester": "1.0.1087",
52
- "@teambit/workspace": "1.0.1087",
53
- "@teambit/ui": "1.0.1087"
43
+ "@teambit/component": "1.0.1088",
44
+ "@teambit/graphql": "1.0.1088",
45
+ "@teambit/builder": "1.0.1088",
46
+ "@teambit/dependency-resolver": "1.0.1088",
47
+ "@teambit/importer": "1.0.1088",
48
+ "@teambit/objects": "0.0.595",
49
+ "@teambit/schema": "1.0.1088",
50
+ "@teambit/scope": "1.0.1088",
51
+ "@teambit/tester": "1.0.1088",
52
+ "@teambit/workspace": "1.0.1088",
53
+ "@teambit/ui": "1.0.1088"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/classnames": "^2.3.4",