@teambit/component-compare 1.0.525 → 1.0.526
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component-compare.main.runtime.d.ts +3 -1
- package/dist/component-compare.main.runtime.js +65 -87
- package/dist/component-compare.main.runtime.js.map +1 -1
- package/dist/diff-cmd.d.ts +2 -1
- package/dist/diff-cmd.js +11 -5
- package/dist/diff-cmd.js.map +1 -1
- package/dist/{preview-1737688828333.js → preview-1737893332947.js} +2 -2
- package/package.json +17 -15
|
@@ -31,9 +31,10 @@ export declare class ComponentCompareMain {
|
|
|
31
31
|
private workspace?;
|
|
32
32
|
constructor(componentAspect: ComponentMain, scope: ScopeMain, logger: Logger, tester: TesterMain, depResolver: DependencyResolverMain, importer: ImporterMain, workspace?: Workspace | undefined);
|
|
33
33
|
compare(baseIdStr: string, compareIdStr: string): Promise<ComponentCompareResult>;
|
|
34
|
-
diffByCLIValues(pattern?: string, version?: string, toVersion?: string, { verbose, table }?: {
|
|
34
|
+
diffByCLIValues(pattern?: string, version?: string, toVersion?: string, { verbose, table, parent }?: {
|
|
35
35
|
verbose?: boolean;
|
|
36
36
|
table?: boolean;
|
|
37
|
+
parent?: boolean;
|
|
37
38
|
}): Promise<any>;
|
|
38
39
|
getConfigForDiffById(id: string): Promise<ConfigDiff>;
|
|
39
40
|
getConfigForDiffByCompObject(component: Component, modifiedIds?: ComponentID[]): Promise<{
|
|
@@ -42,6 +43,7 @@ export declare class ComponentCompareMain {
|
|
|
42
43
|
aspects: {};
|
|
43
44
|
}>;
|
|
44
45
|
private componentsDiff;
|
|
46
|
+
private computeDiff;
|
|
45
47
|
diffBetweenVersionsObjects(modelComponent: ModelComponent, fromVersionObject: Version, toVersionObject: Version, fromVersion: string, toVersion: string, diffOpts: DiffOptions): Promise<DiffResults>;
|
|
46
48
|
static slots: never[];
|
|
47
49
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
@@ -11,6 +11,13 @@ function _cli() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
+
function _lodash() {
|
|
15
|
+
const data = require("lodash");
|
|
16
|
+
_lodash = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
14
21
|
function _bitError() {
|
|
15
22
|
const data = require("@teambit/bit-error");
|
|
16
23
|
_bitError = function () {
|
|
@@ -163,7 +170,8 @@ class ComponentCompareMain {
|
|
|
163
170
|
}
|
|
164
171
|
async diffByCLIValues(pattern, version, toVersion, {
|
|
165
172
|
verbose,
|
|
166
|
-
table
|
|
173
|
+
table,
|
|
174
|
+
parent
|
|
167
175
|
} = {}) {
|
|
168
176
|
if (!this.workspace) throw new (_workspace().OutsideWorkspaceError)();
|
|
169
177
|
const ids = pattern ? await this.workspace.idsByPattern(pattern) : await this.workspace.listTagPendingIds();
|
|
@@ -173,7 +181,8 @@ class ComponentCompareMain {
|
|
|
173
181
|
}
|
|
174
182
|
const diffResults = await this.componentsDiff(ids, version, toVersion, {
|
|
175
183
|
verbose,
|
|
176
|
-
formatDepsAsTable: table
|
|
184
|
+
formatDepsAsTable: table,
|
|
185
|
+
compareToParent: parent
|
|
177
186
|
});
|
|
178
187
|
await consumer.onDestroy('diff');
|
|
179
188
|
return diffResults;
|
|
@@ -211,102 +220,71 @@ class ComponentCompareMain {
|
|
|
211
220
|
}
|
|
212
221
|
async componentsDiff(ids, version, toVersion, diffOpts) {
|
|
213
222
|
if (!this.workspace) throw new (_workspace().OutsideWorkspaceError)();
|
|
214
|
-
const consumer = this.workspace?.consumer;
|
|
215
223
|
const components = await this.workspace.getMany(ids);
|
|
216
224
|
if (!components.length) throw new (_bitError().BitError)('failed loading the components');
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
return Promise.all(ids.map(id => getComponentDiffBetweenVersions(id)));
|
|
220
|
-
}
|
|
221
|
-
if (version) {
|
|
222
|
-
return Promise.all(components.map(component => getComponentDiffOfVersion(component)));
|
|
223
|
-
}
|
|
224
|
-
return Promise.all(components.map(component => getComponentDiff(component)));
|
|
225
|
-
};
|
|
226
|
-
const componentsDiffResults = await getResults();
|
|
225
|
+
if (toVersion && !version) throw new (_bitError().BitError)('error: componentsDiff expects to get version when toVersion is entered');
|
|
226
|
+
const componentsDiffResults = await Promise.all(components.map(component => this.computeDiff(component, version, toVersion, diffOpts)));
|
|
227
227
|
return componentsDiffResults;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// eslint-disable-next-line complexity
|
|
231
|
+
async computeDiff(component, version, toVersion, diffOpts) {
|
|
232
|
+
if (!this.workspace) throw new (_workspace().OutsideWorkspaceError)();
|
|
233
|
+
const consumer = this.workspace.consumer;
|
|
234
|
+
// if (!version) throw new Error('getComponentDiffOfVersion expects to get version');
|
|
235
|
+
const consumerComponent = component.state._consumer;
|
|
236
|
+
const diffResult = {
|
|
237
|
+
id: component.id,
|
|
238
|
+
hasDiff: false
|
|
239
|
+
};
|
|
240
|
+
const modelComponent = consumerComponent.modelComponent || (await consumer.scope.getModelComponentIfExist(component.id));
|
|
241
|
+
if (!modelComponent || !consumerComponent.componentFromModel) {
|
|
242
|
+
if (version || toVersion) {
|
|
237
243
|
throw new (_bitError().BitError)(`component ${component.id.toString()} doesn't have any version yet`);
|
|
238
244
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
const fromVersionObject = await modelComponent.loadVersion(version, repository);
|
|
246
|
-
const versionFiles = await fromVersionObject.modelFilesToSourceFiles(repository);
|
|
247
|
-
const fsFiles = consumerComponent.files;
|
|
248
|
-
// version must be defined as the component.componentFromModel do exist
|
|
249
|
-
const versionB = component.id.version;
|
|
250
|
-
// this function gets called only when version is set
|
|
251
|
-
diffResult.filesDiff = await (0, _legacy().getFilesDiff)(versionFiles, fsFiles, version, versionB);
|
|
252
|
-
const fromVersionComponent = await modelComponent.toConsumerComponent(version, consumer.scope.name, repository);
|
|
253
|
-
await updateFieldsDiff(fromVersionComponent, consumerComponent, diffResult, diffOpts);
|
|
254
|
-
return diffResult;
|
|
255
|
-
}
|
|
256
|
-
async function getComponentDiffBetweenVersions(id) {
|
|
257
|
-
if (!version || !toVersion) throw new Error('getComponentDiffBetweenVersions expects to get version and toVersion');
|
|
258
|
-
const diffResult = {
|
|
259
|
-
id,
|
|
260
|
-
hasDiff: false
|
|
261
|
-
};
|
|
262
|
-
const modelComponent = await consumer.scope.getModelComponentIfExist(id);
|
|
263
|
-
if (!modelComponent) {
|
|
264
|
-
throw new (_bitError().BitError)(`component ${id.toString()} doesn't have any version yet`);
|
|
265
|
-
}
|
|
266
|
-
const repository = consumer.scope.objects;
|
|
267
|
-
const idList = _componentId().ComponentIdList.fromArray([id.changeVersion(version), id.changeVersion(toVersion)]);
|
|
268
|
-
await consumer.scope.scopeImporter.importWithoutDeps(idList, {
|
|
269
|
-
cache: true,
|
|
270
|
-
reason: 'to show diff'
|
|
271
|
-
});
|
|
272
|
-
const fromVersionObject = await modelComponent.loadVersion(version, repository);
|
|
273
|
-
const toVersionObject = await modelComponent.loadVersion(toVersion, repository);
|
|
274
|
-
const fromVersionFiles = await fromVersionObject.modelFilesToSourceFiles(repository);
|
|
275
|
-
const toVersionFiles = await toVersionObject.modelFilesToSourceFiles(repository);
|
|
276
|
-
diffResult.filesDiff = await (0, _legacy().getFilesDiff)(fromVersionFiles, toVersionFiles, version, toVersion);
|
|
277
|
-
const fromVersionComponent = await modelComponent.toConsumerComponent(version, consumer.scope.name, repository);
|
|
278
|
-
const toVersionComponent = await modelComponent.toConsumerComponent(toVersion, consumer.scope.name, repository);
|
|
279
|
-
await updateFieldsDiff(fromVersionComponent, toVersionComponent, diffResult, diffOpts);
|
|
280
|
-
return diffResult;
|
|
281
|
-
}
|
|
282
|
-
async function getComponentDiff(component) {
|
|
283
|
-
const diffResult = {
|
|
284
|
-
id: component.id,
|
|
285
|
-
hasDiff: false
|
|
286
|
-
};
|
|
287
|
-
const consumerComponent = component.state._consumer;
|
|
288
|
-
if (!consumerComponent.componentFromModel) {
|
|
289
|
-
if (component.isDeleted()) {
|
|
290
|
-
// component exists in the model but not in the filesystem, show all files as deleted
|
|
291
|
-
// the reason it is loaded without componentFromModel is because it was loaded from the scope, not workspace.
|
|
292
|
-
// as a proof, consumerComponent.loadedFromFileSystem is false.
|
|
293
|
-
const modelFiles = consumerComponent.files;
|
|
294
|
-
diffResult.filesDiff = await (0, _legacy().getFilesDiff)(modelFiles, [], component.id.version, component.id.version);
|
|
295
|
-
if (hasDiff(diffResult)) diffResult.hasDiff = true;
|
|
296
|
-
return diffResult;
|
|
297
|
-
}
|
|
298
|
-
// it's a new component. not modified. show all files as new.
|
|
299
|
-
const fsFiles = consumerComponent.files;
|
|
300
|
-
diffResult.filesDiff = await (0, _legacy().getFilesDiff)([], fsFiles, component.id.version, component.id.version);
|
|
245
|
+
if (component.isDeleted()) {
|
|
246
|
+
// component exists in the model but not in the filesystem, show all files as deleted
|
|
247
|
+
// the reason it is loaded without componentFromModel is because it was loaded from the scope, not workspace.
|
|
248
|
+
// as a proof, consumerComponent.loadedFromFileSystem is false.
|
|
249
|
+
const modelFiles = consumerComponent.files;
|
|
250
|
+
diffResult.filesDiff = await (0, _legacy().getFilesDiff)(modelFiles, [], component.id.version, component.id.version);
|
|
301
251
|
if (hasDiff(diffResult)) diffResult.hasDiff = true;
|
|
302
252
|
return diffResult;
|
|
303
253
|
}
|
|
304
|
-
|
|
254
|
+
// it's a new component. not modified. show all files as new.
|
|
305
255
|
const fsFiles = consumerComponent.files;
|
|
306
|
-
diffResult.filesDiff = await (0, _legacy().getFilesDiff)(
|
|
307
|
-
|
|
256
|
+
diffResult.filesDiff = await (0, _legacy().getFilesDiff)([], fsFiles, component.id.version, component.id.version);
|
|
257
|
+
if (hasDiff(diffResult)) diffResult.hasDiff = true;
|
|
308
258
|
return diffResult;
|
|
309
259
|
}
|
|
260
|
+
const repository = consumer.scope.objects;
|
|
261
|
+
const idsToImport = (0, _lodash().compact)([version ? component.id.changeVersion(version) : undefined, toVersion ? component.id.changeVersion(toVersion) : undefined]);
|
|
262
|
+
const idList = _componentId().ComponentIdList.fromArray(idsToImport);
|
|
263
|
+
await consumer.scope.scopeImporter.importWithoutDeps(idList, {
|
|
264
|
+
cache: true,
|
|
265
|
+
reason: 'to show diff'
|
|
266
|
+
});
|
|
267
|
+
if (diffOpts.compareToParent) {
|
|
268
|
+
if (!version) throw new (_bitError().BitError)('--parent flag expects to get version');
|
|
269
|
+
if (toVersion) throw new (_bitError().BitError)('--parent flag expects to get only one version');
|
|
270
|
+
const versionObject = version ? await modelComponent.loadVersion(version, repository) : undefined;
|
|
271
|
+
const parent = versionObject.parents[0];
|
|
272
|
+
toVersion = version;
|
|
273
|
+
version = parent ? modelComponent.getTagOfRefIfExists(parent) : undefined;
|
|
274
|
+
}
|
|
275
|
+
const fromVersionObject = version ? await modelComponent.loadVersion(version, repository) : undefined;
|
|
276
|
+
const toVersionObject = toVersion ? await modelComponent.loadVersion(toVersion, repository) : undefined;
|
|
277
|
+
const fromVersionFiles = await fromVersionObject?.modelFilesToSourceFiles(repository);
|
|
278
|
+
const toVersionFiles = await toVersionObject?.modelFilesToSourceFiles(repository);
|
|
279
|
+
const fromFiles = fromVersionFiles || consumerComponent.componentFromModel.files;
|
|
280
|
+
const toFiles = toVersionFiles || consumerComponent.files;
|
|
281
|
+
const fromVersionLabel = version || component.id.version;
|
|
282
|
+
const toVersionLabel = toVersion || component.id.version;
|
|
283
|
+
diffResult.filesDiff = await (0, _legacy().getFilesDiff)(fromFiles, toFiles, fromVersionLabel, toVersionLabel);
|
|
284
|
+
const fromVersionComponent = version ? await modelComponent.toConsumerComponent(version, consumer.scope.name, repository) : consumerComponent.componentFromModel;
|
|
285
|
+
const toVersionComponent = toVersion ? await modelComponent.toConsumerComponent(toVersion, consumer.scope.name, repository) : consumerComponent;
|
|
286
|
+
await updateFieldsDiff(fromVersionComponent, toVersionComponent, diffResult, diffOpts);
|
|
287
|
+
return diffResult;
|
|
310
288
|
}
|
|
311
289
|
async diffBetweenVersionsObjects(modelComponent, fromVersionObject, toVersionObject, fromVersion, toVersion, diffOpts) {
|
|
312
290
|
const diffResult = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_bitError","_workspace","_componentId","_scope","_graphql","_builder","_dependencyResolver","_logger","_legacy","_tester","_component","_componentCompare","_componentCompare2","_diffCmd","_importer","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ComponentCompareMain","constructor","componentAspect","scope","logger","tester","depResolver","importer","workspace","compare","baseIdStr","compareIdStr","host","getHost","baseCompId","compareCompId","resolveMultipleComponentIds","modelComponent","legacyScope","getModelComponentIfExist","BitError","toString","importObjectsFromMainIfExist","cache","baseVersion","version","compareVersion","repository","objects","baseVersionObject","loadVersion","compareVersionObject","diff","diffBetweenVersionsObjects","baseComponent","get","compareComponent","baseTestFiles","getTestFiles","map","file","relative","compareTestFiles","allTestFiles","testFilesDiff","filesDiff","filter","fileDiff","includes","filePath","status","compareResult","id","code","fields","fieldsDiff","tests","diffByCLIValues","pattern","toVersion","verbose","table","OutsideWorkspaceError","ids","idsByPattern","listTagPendingIds","consumer","length","diffResults","componentsDiff","formatDepsAsTable","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","components","getMany","getResults","Promise","all","getComponentDiffBetweenVersions","getComponentDiffOfVersion","getComponentDiff","componentsDiffResults","consumerComponent","_consumer","diffResult","hasDiff","idList","ComponentIdList","fromArray","changeVersion","scopeImporter","importWithoutDeps","reason","fromVersionObject","versionFiles","modelFilesToSourceFiles","fsFiles","files","versionB","getFilesDiff","fromVersionComponent","toConsumerComponent","name","updateFieldsDiff","toVersionObject","fromVersionFiles","toVersionFiles","toVersionComponent","componentFromModel","isDeleted","modelFiles","fromVersion","toComponentId","color","undefined","hash","provider","graphql","loggerMain","cli","createLogger","ComponentCompareAspect","componentCompareMain","register","DiffCmd","componentCompareSchema","exports","GraphqlAspect","ComponentAspect","ScopeAspect","LoggerAspect","CLIAspect","WorkspaceAspect","TesterAspect","ImporterAspect","MainRuntime","find","diffOutput","componentA","componentB","diffBetweenComponentsObjects","addRuntime","_default","default"],"sources":["component-compare.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { BitError } from '@teambit/bit-error';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { ScopeMain, ScopeAspect } from '@teambit/scope';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { BuilderAspect } from '@teambit/builder';\nimport { ModelComponent, Version } from '@teambit/objects';\nimport { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport {\n DependencyResolverAspect,\n DependencyList,\n DependencyResolverMain,\n SerializedDependency,\n} from '@teambit/dependency-resolver';\nimport { LoggerAspect, LoggerMain, Logger } from '@teambit/logger';\nimport {\n DiffOptions,\n DiffResults,\n FieldsDiff,\n FileDiff,\n getFilesDiff,\n diffBetweenComponentsObjects,\n} from '@teambit/legacy.component-diff';\nimport { TesterMain, TesterAspect } from '@teambit/tester';\nimport { ComponentAspect, Component, ComponentMain } from '@teambit/component';\nimport { componentCompareSchema } from './component-compare.graphql';\nimport { ComponentCompareAspect } from './component-compare.aspect';\nimport { DiffCmd } from './diff-cmd';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\n\nexport type ComponentCompareResult = {\n id: string;\n code: FileDiff[];\n fields: FieldsDiff[];\n tests: FileDiff[];\n};\n\ntype ConfigDiff = {\n version?: string;\n dependencies?: string[];\n aspects?: Record<string, any>;\n};\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 workspace?: Workspace\n ) {}\n\n async compare(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\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 repository = this.scope.legacyScope.objects;\n const baseVersionObject = await modelComponent.loadVersion(baseVersion, repository);\n const compareVersionObject = await modelComponent.loadVersion(compareVersion, repository);\n\n const diff: DiffResults = await this.diffBetweenVersionsObjects(\n modelComponent,\n baseVersionObject,\n compareVersionObject,\n baseVersion,\n compareVersion,\n {}\n );\n\n const baseComponent = await host.get(baseCompId);\n const compareComponent = await host.get(compareCompId);\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 const compareResult = {\n id: `${baseCompId}-${compareCompId}`,\n code: diff.filesDiff || [],\n fields: diff.fieldsDiff || [],\n tests: testFilesDiff,\n };\n\n return compareResult;\n }\n\n async diffByCLIValues(\n pattern?: string,\n version?: string,\n toVersion?: string,\n { verbose, table }: { verbose?: boolean; table?: 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 });\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 | null | undefined,\n toVersion: string | null | undefined,\n diffOpts: DiffOptions\n ): Promise<DiffResults[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace?.consumer;\n const components = await this.workspace.getMany(ids);\n if (!components.length) throw new BitError('failed loading the components');\n\n const getResults = (): Promise<DiffResults[]> => {\n if (version && toVersion) {\n return Promise.all(ids.map((id) => getComponentDiffBetweenVersions(id)));\n }\n if (version) {\n return Promise.all(components.map((component) => getComponentDiffOfVersion(component)));\n }\n return Promise.all(components.map((component) => getComponentDiff(component)));\n };\n const componentsDiffResults = await getResults();\n return componentsDiffResults;\n\n async function getComponentDiffOfVersion(component: Component): Promise<DiffResults> {\n if (!version) throw new Error('getComponentDiffOfVersion expects to get version');\n const consumerComponent = component.state._consumer as ConsumerComponent;\n const diffResult: DiffResults = { id: component.id, hasDiff: false };\n const modelComponent = await consumer.scope.getModelComponentIfExist(component.id);\n if (!modelComponent) {\n throw new BitError(`component ${component.id.toString()} doesn't have any version yet`);\n }\n const repository = consumer.scope.objects;\n const idList = ComponentIdList.fromArray([component.id.changeVersion(version)]);\n await consumer.scope.scopeImporter.importWithoutDeps(idList, { cache: true, reason: 'to show diff' });\n const fromVersionObject: Version = await modelComponent.loadVersion(version, repository);\n const versionFiles = await fromVersionObject.modelFilesToSourceFiles(repository);\n const fsFiles = consumerComponent.files;\n // version must be defined as the component.componentFromModel do exist\n const versionB: string = component.id.version;\n // this function gets called only when version is set\n diffResult.filesDiff = await getFilesDiff(versionFiles, fsFiles, version, versionB);\n const fromVersionComponent = await modelComponent.toConsumerComponent(version, consumer.scope.name, repository);\n await updateFieldsDiff(fromVersionComponent, consumerComponent, diffResult, diffOpts);\n\n return diffResult;\n }\n\n async function getComponentDiffBetweenVersions(id: ComponentID): Promise<DiffResults> {\n if (!version || !toVersion)\n throw new Error('getComponentDiffBetweenVersions expects to get version and toVersion');\n const diffResult: DiffResults = { id, hasDiff: false };\n const modelComponent = await consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) {\n throw new BitError(`component ${id.toString()} doesn't have any version yet`);\n }\n const repository = consumer.scope.objects;\n const idList = ComponentIdList.fromArray([id.changeVersion(version), id.changeVersion(toVersion)]);\n await consumer.scope.scopeImporter.importWithoutDeps(idList, { cache: true, reason: 'to show diff' });\n const fromVersionObject: Version = await modelComponent.loadVersion(version, repository);\n const toVersionObject: Version = await modelComponent.loadVersion(toVersion, repository);\n const fromVersionFiles = await fromVersionObject.modelFilesToSourceFiles(repository);\n const toVersionFiles = await toVersionObject.modelFilesToSourceFiles(repository);\n diffResult.filesDiff = await getFilesDiff(fromVersionFiles, toVersionFiles, version, toVersion);\n const fromVersionComponent = await modelComponent.toConsumerComponent(version, consumer.scope.name, repository);\n const toVersionComponent = await modelComponent.toConsumerComponent(toVersion, consumer.scope.name, repository);\n await updateFieldsDiff(fromVersionComponent, toVersionComponent, diffResult, diffOpts);\n\n return diffResult;\n }\n\n async function getComponentDiff(component: Component): Promise<DiffResults> {\n const diffResult: DiffResults = { id: component.id, hasDiff: false };\n const consumerComponent = component.state._consumer as ConsumerComponent;\n if (!consumerComponent.componentFromModel) {\n if (component.isDeleted()) {\n // component exists in the model but not in the filesystem, show all files as deleted\n // the reason it is loaded without componentFromModel is because it was loaded from the scope, not workspace.\n // as a proof, consumerComponent.loadedFromFileSystem is false.\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 // 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 modelFiles = consumerComponent.componentFromModel.files;\n const fsFiles = consumerComponent.files;\n diffResult.filesDiff = await getFilesDiff(modelFiles, fsFiles, component.id.version, component.id.version);\n await updateFieldsDiff(consumerComponent.componentFromModel, consumerComponent, diffResult, diffOpts);\n\n return diffResult;\n }\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 ];\n static runtime = MainRuntime;\n static async provider([graphql, component, scope, loggerMain, cli, workspace, tester, depResolver, importer]: [\n GraphqlMain,\n ComponentMain,\n ScopeMain,\n LoggerMain,\n CLIMain,\n Workspace,\n TesterMain,\n DependencyResolverMain,\n ImporterMain,\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 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":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,SAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAQ,oBAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,mBAAA,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,CAAC;EAC5FY,UAAU,CAACC,OAAO,GAAGA,OAAO,CAACD,UAAU,CAAC;AAC1C;AAEAqC,2CAAsB,CAACoB,UAAU,CAAC/K,oBAAoB,CAAC;AAAC,IAAAgL,QAAA,GAAAhB,OAAA,CAAAiB,OAAA,GAEzCjL,oBAAoB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_lodash","_bitError","_workspace","_componentId","_scope","_graphql","_builder","_dependencyResolver","_logger","_legacy","_tester","_component","_componentCompare","_componentCompare2","_diffCmd","_importer","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ComponentCompareMain","constructor","componentAspect","scope","logger","tester","depResolver","importer","workspace","compare","baseIdStr","compareIdStr","host","getHost","baseCompId","compareCompId","resolveMultipleComponentIds","modelComponent","legacyScope","getModelComponentIfExist","BitError","toString","importObjectsFromMainIfExist","cache","baseVersion","version","compareVersion","repository","objects","baseVersionObject","loadVersion","compareVersionObject","diff","diffBetweenVersionsObjects","baseComponent","get","compareComponent","baseTestFiles","getTestFiles","map","file","relative","compareTestFiles","allTestFiles","testFilesDiff","filesDiff","filter","fileDiff","includes","filePath","status","compareResult","id","code","fields","fieldsDiff","tests","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","components","getMany","componentsDiffResults","Promise","all","computeDiff","consumerComponent","_consumer","diffResult","hasDiff","componentFromModel","isDeleted","modelFiles","files","getFilesDiff","fsFiles","idsToImport","compact","changeVersion","undefined","idList","ComponentIdList","fromArray","scopeImporter","importWithoutDeps","reason","versionObject","parents","getTagOfRefIfExists","fromVersionObject","toVersionObject","fromVersionFiles","modelFilesToSourceFiles","toVersionFiles","fromFiles","toFiles","fromVersionLabel","toVersionLabel","fromVersionComponent","toConsumerComponent","name","toVersionComponent","updateFieldsDiff","fromVersion","toComponentId","color","hash","provider","graphql","loggerMain","cli","createLogger","ComponentCompareAspect","componentCompareMain","register","DiffCmd","componentCompareSchema","exports","GraphqlAspect","ComponentAspect","ScopeAspect","LoggerAspect","CLIAspect","WorkspaceAspect","TesterAspect","ImporterAspect","MainRuntime","find","diffOutput","componentA","componentB","diffBetweenComponentsObjects","addRuntime","_default","default"],"sources":["component-compare.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { compact } from 'lodash';\nimport { BitError } from '@teambit/bit-error';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { ScopeMain, ScopeAspect } from '@teambit/scope';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { BuilderAspect } from '@teambit/builder';\nimport { ModelComponent, Version } from '@teambit/objects';\nimport { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport {\n DependencyResolverAspect,\n DependencyList,\n DependencyResolverMain,\n SerializedDependency,\n} from '@teambit/dependency-resolver';\nimport { LoggerAspect, LoggerMain, Logger } from '@teambit/logger';\nimport {\n DiffOptions,\n DiffResults,\n FieldsDiff,\n FileDiff,\n getFilesDiff,\n diffBetweenComponentsObjects,\n} from '@teambit/legacy.component-diff';\nimport { TesterMain, TesterAspect } from '@teambit/tester';\nimport { ComponentAspect, Component, ComponentMain } from '@teambit/component';\nimport { componentCompareSchema } from './component-compare.graphql';\nimport { ComponentCompareAspect } from './component-compare.aspect';\nimport { DiffCmd } from './diff-cmd';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\n\nexport type ComponentCompareResult = {\n id: string;\n code: FileDiff[];\n fields: FieldsDiff[];\n tests: FileDiff[];\n};\n\ntype ConfigDiff = {\n version?: string;\n dependencies?: string[];\n aspects?: Record<string, any>;\n};\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 workspace?: Workspace\n ) {}\n\n async compare(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\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 repository = this.scope.legacyScope.objects;\n const baseVersionObject = await modelComponent.loadVersion(baseVersion, repository);\n const compareVersionObject = await modelComponent.loadVersion(compareVersion, repository);\n\n const diff: DiffResults = await this.diffBetweenVersionsObjects(\n modelComponent,\n baseVersionObject,\n compareVersionObject,\n baseVersion,\n compareVersion,\n {}\n );\n\n const baseComponent = await host.get(baseCompId);\n const compareComponent = await host.get(compareCompId);\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 const compareResult = {\n id: `${baseCompId}-${compareCompId}`,\n code: diff.filesDiff || [],\n fields: diff.fieldsDiff || [],\n tests: testFilesDiff,\n };\n\n return compareResult;\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 // eslint-disable-next-line complexity\n private async computeDiff(\n component: Component,\n version: string | undefined,\n toVersion: string | undefined,\n diffOpts: DiffOptions\n ) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer = this.workspace.consumer;\n // if (!version) throw new Error('getComponentDiffOfVersion expects to get version');\n const consumerComponent = component.state._consumer as ConsumerComponent;\n const diffResult: DiffResults = { id: component.id, hasDiff: false };\n const modelComponent =\n consumerComponent.modelComponent || (await consumer.scope.getModelComponentIfExist(component.id));\n\n if (!modelComponent || !consumerComponent.componentFromModel) {\n if (version || toVersion) {\n throw new BitError(`component ${component.id.toString()} doesn't have any version yet`);\n }\n if (component.isDeleted()) {\n // component exists in the model but not in the filesystem, show all files as deleted\n // the reason it is loaded without componentFromModel is because it was loaded from the scope, not workspace.\n // as a proof, consumerComponent.loadedFromFileSystem is false.\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 // 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 = consumer.scope.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 consumer.scope.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 = version ? await modelComponent.loadVersion(version, repository) : undefined;\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 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, consumer.scope.name, repository)\n : consumerComponent.componentFromModel;\n\n const toVersionComponent = toVersion\n ? await modelComponent.toConsumerComponent(toVersion, consumer.scope.name, repository)\n : consumerComponent;\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 ];\n static runtime = MainRuntime;\n static async provider([graphql, component, scope, loggerMain, cli, workspace, tester, depResolver, importer]: [\n GraphqlMain,\n ComponentMain,\n ScopeMain,\n LoggerMain,\n CLIMain,\n Workspace,\n TesterMain,\n DependencyResolverMain,\n ImporterMain,\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 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":";;;;;;AAAA,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,OA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AsL,QAAA,GAAAhB,OAAA,CAAAiB,OAAA,GAEzCvL,oBAAoB","ignoreList":[]}
|
package/dist/diff-cmd.d.ts
CHANGED
|
@@ -18,8 +18,9 @@ export declare class DiffCmd implements Command {
|
|
|
18
18
|
}[];
|
|
19
19
|
loader: boolean;
|
|
20
20
|
constructor(componentCompareMain: ComponentCompareMain);
|
|
21
|
-
report([pattern, version, toVersion]: [string, string, string], { verbose, table }: {
|
|
21
|
+
report([pattern, version, toVersion]: [string, string, string], { verbose, table, parent }: {
|
|
22
22
|
verbose?: boolean;
|
|
23
23
|
table: boolean;
|
|
24
|
+
parent?: boolean;
|
|
24
25
|
}): Promise<string>;
|
|
25
26
|
}
|
package/dist/diff-cmd.js
CHANGED
|
@@ -41,13 +41,14 @@ class DiffCmd {
|
|
|
41
41
|
description: _legacy().COMPONENT_PATTERN_HELP
|
|
42
42
|
}, {
|
|
43
43
|
name: 'version',
|
|
44
|
-
description:
|
|
44
|
+
description: `the base version to compare from. if omitted, compares the workspace's current files to the component's latest version.`
|
|
45
45
|
}, {
|
|
46
46
|
name: 'to-version',
|
|
47
|
-
description:
|
|
47
|
+
description: `the target version to compare against "version".
|
|
48
|
+
if both "version" and "to-version" are provided, compare those two versions directly (ignoring the workspace).`
|
|
48
49
|
}]);
|
|
49
50
|
_defineProperty(this, "alias", '');
|
|
50
|
-
_defineProperty(this, "options", [['v', 'verbose', 'show a more verbose output where possible'], ['t', 'table', 'show tables instead of plain text for dependencies diff']]);
|
|
51
|
+
_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']]);
|
|
51
52
|
_defineProperty(this, "examples", [{
|
|
52
53
|
cmd: 'diff',
|
|
53
54
|
description: 'show diff for all modified components'
|
|
@@ -63,16 +64,21 @@ class DiffCmd {
|
|
|
63
64
|
}, {
|
|
64
65
|
cmd: "diff '$codeModified' ",
|
|
65
66
|
description: 'show diff only for components with modified files. ignore config changes'
|
|
67
|
+
}, {
|
|
68
|
+
cmd: 'diff foo 0.0.2 --parent',
|
|
69
|
+
description: 'compare "foo@0.0.2" to its parent version. showing what changed in 0.0.2'
|
|
66
70
|
}]);
|
|
67
71
|
_defineProperty(this, "loader", true);
|
|
68
72
|
}
|
|
69
73
|
async report([pattern, version, toVersion], {
|
|
70
74
|
verbose = false,
|
|
71
|
-
table = false
|
|
75
|
+
table = false,
|
|
76
|
+
parent
|
|
72
77
|
}) {
|
|
73
78
|
const diffResults = await this.componentCompareMain.diffByCLIValues(pattern, version, toVersion, {
|
|
74
79
|
verbose,
|
|
75
|
-
table
|
|
80
|
+
table,
|
|
81
|
+
parent
|
|
76
82
|
});
|
|
77
83
|
if (!diffResults.length) {
|
|
78
84
|
return _chalk().default.yellow('there are no modified components to diff');
|
package/dist/diff-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_legacy","_legacy2","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DiffCmd","constructor","componentCompareMain","name","description","COMPONENT_PATTERN_HELP","cmd","report","pattern","version","toVersion","verbose","table","diffResults","diffByCLIValues","length","chalk","yellow","outputDiffResults","exports"],"sources":["diff-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport { DiffResults, outputDiffResults } from '@teambit/legacy.component-diff';\nimport { ComponentCompareMain } from './component-compare.main.runtime';\n\nexport class DiffCmd implements Command {\n name = 'diff [component-pattern] [version] [to-version]';\n group = 'development';\n description =\n \"show the diff between the components' current source files and config, and their latest snapshot or tag\";\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:
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_legacy","_legacy2","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DiffCmd","constructor","componentCompareMain","name","description","COMPONENT_PATTERN_HELP","cmd","report","pattern","version","toVersion","verbose","table","parent","diffResults","diffByCLIValues","length","chalk","yellow","outputDiffResults","exports"],"sources":["diff-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport { DiffResults, outputDiffResults } from '@teambit/legacy.component-diff';\nimport { ComponentCompareMain } from './component-compare.main.runtime';\n\nexport class DiffCmd implements Command {\n name = 'diff [component-pattern] [version] [to-version]';\n group = 'development';\n description =\n \"show the diff between the components' current source files and config, and their latest snapshot or tag\";\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 ] 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 loader = true;\n\n constructor(private componentCompareMain: ComponentCompareMain) {}\n\n async report(\n [pattern, version, toVersion]: [string, string, string],\n { verbose = false, table = false, parent }: { verbose?: boolean; table: boolean; parent?: boolean }\n ) {\n const diffResults: DiffResults[] = await this.componentCompareMain.diffByCLIValues(pattern, version, toVersion, {\n verbose,\n table,\n parent,\n });\n if (!diffResults.length) {\n return chalk.yellow('there are no modified components to diff');\n }\n return outputDiffResults(diffResults);\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;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgF,SAAAC,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,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B;MAAEF,WAAW,EAAE;IAA0E,CAAC,EACjH;MAAEE,GAAG,EAAE,sBAAsB;MAAEF,WAAW,EAAE;IAAsE,CAAC,EACnH;MACEE,GAAG,EAAE,uBAAuB;MAC5BF,WAAW,EAAE;IACf,CAAC,EACD;MACEE,GAAG,EAAE,yBAAyB;MAC9BF,WAAW,EAAE;IACf,CAAC,CACF;IAAAtB,eAAA,iBACQ,IAAI;EAEoD;EAEjE,MAAMyB,MAAMA,CACV,CAACC,OAAO,EAAEC,OAAO,EAAEC,SAAS,CAA2B,EACvD;IAAEC,OAAO,GAAG,KAAK;IAAEC,KAAK,GAAG,KAAK;IAAEC;EAAgE,CAAC,EACnG;IACA,MAAMC,WAA0B,GAAG,MAAM,IAAI,CAACZ,oBAAoB,CAACa,eAAe,CAACP,OAAO,EAAEC,OAAO,EAAEC,SAAS,EAAE;MAC9GC,OAAO;MACPC,KAAK;MACLC;IACF,CAAC,CAAC;IACF,IAAI,CAACC,WAAW,CAACE,MAAM,EAAE;MACvB,OAAOC,gBAAK,CAACC,MAAM,CAAC,0CAA0C,CAAC;IACjE;IACA,OAAO,IAAAC,4BAAiB,EAACL,WAAW,CAAC;EACvC;AACF;AAACM,OAAA,CAAApB,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.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component-compare@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component-compare@1.0.526/dist/component-compare.compositions.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component-compare@1.0.526/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,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/component-compare",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.526",
|
|
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.
|
|
9
|
+
"version": "1.0.526"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"graphql-tag": "2.12.1",
|
|
13
|
+
"lodash": "4.17.21",
|
|
13
14
|
"lodash.flatten": "4.4.0",
|
|
14
15
|
"chalk": "2.4.2",
|
|
15
16
|
"@teambit/component.ui.component-compare.models.component-compare-change-type": "0.0.7",
|
|
@@ -19,26 +20,27 @@
|
|
|
19
20
|
"@teambit/component-id": "1.2.2",
|
|
20
21
|
"@teambit/component.ui.component-compare.compare-aspects.compare-aspects": "0.0.148",
|
|
21
22
|
"@teambit/component.ui.component-compare.models.component-compare-props": "0.0.114",
|
|
22
|
-
"@teambit/component": "1.0.
|
|
23
|
-
"@teambit/builder": "1.0.
|
|
24
|
-
"@teambit/cli": "0.0.
|
|
25
|
-
"@teambit/dependency-resolver": "1.0.
|
|
26
|
-
"@teambit/graphql": "1.0.
|
|
27
|
-
"@teambit/importer": "1.0.
|
|
28
|
-
"@teambit/legacy.component-diff": "0.0.
|
|
23
|
+
"@teambit/component": "1.0.526",
|
|
24
|
+
"@teambit/builder": "1.0.526",
|
|
25
|
+
"@teambit/cli": "0.0.1103",
|
|
26
|
+
"@teambit/dependency-resolver": "1.0.526",
|
|
27
|
+
"@teambit/graphql": "1.0.526",
|
|
28
|
+
"@teambit/importer": "1.0.526",
|
|
29
|
+
"@teambit/legacy.component-diff": "0.0.78",
|
|
29
30
|
"@teambit/legacy.consumer-component": "0.0.25",
|
|
30
|
-
"@teambit/logger": "0.0.
|
|
31
|
-
"@teambit/objects": "0.0.
|
|
32
|
-
"@teambit/scope": "1.0.
|
|
33
|
-
"@teambit/tester": "1.0.
|
|
34
|
-
"@teambit/workspace": "1.0.
|
|
31
|
+
"@teambit/logger": "0.0.1196",
|
|
32
|
+
"@teambit/objects": "0.0.33",
|
|
33
|
+
"@teambit/scope": "1.0.526",
|
|
34
|
+
"@teambit/tester": "1.0.526",
|
|
35
|
+
"@teambit/workspace": "1.0.526",
|
|
35
36
|
"@teambit/component.ui.component-compare.changelog": "0.0.199",
|
|
36
37
|
"@teambit/component.ui.component-compare.component-compare": "0.0.207",
|
|
37
38
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.513",
|
|
38
|
-
"@teambit/ui": "1.0.
|
|
39
|
+
"@teambit/ui": "1.0.526",
|
|
39
40
|
"@teambit/legacy.constants": "0.0.8"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
43
|
+
"@types/lodash": "4.14.165",
|
|
42
44
|
"@types/lodash.flatten": "4.4.6",
|
|
43
45
|
"@types/mocha": "9.1.0",
|
|
44
46
|
"@teambit/harmony.envs.core-aspect-env": "0.0.69"
|