@teambit/lanes.modules.diff 0.0.486 → 0.0.487
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/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/lane-diff-generator.d.ts +4 -0
- package/dist/lane-diff-generator.js +91 -3
- package/dist/lane-diff-generator.js.map +1 -1
- package/dist/lane-diff.cmd.js +2 -20
- package/dist/lane-diff.cmd.js.map +1 -1
- package/dist/lane-history-diff.cmd.d.ts +22 -0
- package/dist/lane-history-diff.cmd.js +52 -0
- package/dist/lane-history-diff.cmd.js.map +1 -0
- package/index.ts +1 -0
- package/lane-diff-generator.ts +115 -7
- package/lane-diff.cmd.ts +2 -20
- package/lane-history-diff.cmd.ts +52 -0
- package/package.json +2 -2
- /package/dist/{preview-1730431405757.js → preview-1730517501720.js} +0 -0
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LaneDiffGenerator = exports.LaneDiffCmd = void 0;
|
|
3
|
+
exports.LaneDiffGenerator = exports.LaneHistoryDiffCmd = exports.LaneDiffCmd = void 0;
|
|
4
4
|
var lane_diff_cmd_1 = require("./lane-diff.cmd");
|
|
5
5
|
Object.defineProperty(exports, "LaneDiffCmd", { enumerable: true, get: function () { return lane_diff_cmd_1.LaneDiffCmd; } });
|
|
6
|
+
var lane_history_diff_cmd_1 = require("./lane-history-diff.cmd");
|
|
7
|
+
Object.defineProperty(exports, "LaneHistoryDiffCmd", { enumerable: true, get: function () { return lane_history_diff_cmd_1.LaneHistoryDiffCmd; } });
|
|
6
8
|
var lane_diff_generator_1 = require("./lane-diff-generator");
|
|
7
9
|
Object.defineProperty(exports, "LaneDiffGenerator", { enumerable: true, get: function () { return lane_diff_generator_1.LaneDiffGenerator; } });
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAArC,4GAAA,WAAW,OAAA;AACpB,6DAA2E;AAAlE,wHAAA,iBAAiB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAArC,4GAAA,WAAW,OAAA;AACpB,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAC3B,6DAA2E;AAAlE,wHAAA,iBAAiB,OAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ScopeMain } from '@teambit/scope';
|
|
2
2
|
import { Workspace } from '@teambit/workspace';
|
|
3
|
+
import { Lane, LaneHistory } from '@teambit/legacy/dist/scope/models';
|
|
3
4
|
import { ComponentID } from '@teambit/component-id';
|
|
4
5
|
import { DiffResults, DiffOptions } from '@teambit/legacy.component-diff';
|
|
5
6
|
import { ComponentCompareMain } from '@teambit/component-compare';
|
|
@@ -35,9 +36,12 @@ export declare class LaneDiffGenerator {
|
|
|
35
36
|
* [from, to] => diff between "from" lane and "to" lane.
|
|
36
37
|
*/
|
|
37
38
|
generate(values: string[], diffOptions?: DiffOptions, pattern?: string): Promise<LaneDiffResults>;
|
|
39
|
+
generateDiffHistory(lane: Lane, laneHistory: LaneHistory, fromHistoryId: string, toHistoryId: string, pattern?: string): Promise<LaneDiffResults>;
|
|
40
|
+
laneDiffResultsToString(laneDiffResults: LaneDiffResults): string;
|
|
38
41
|
private componentDiff;
|
|
39
42
|
private getLaneNames;
|
|
40
43
|
private getDefaultLaneData;
|
|
41
44
|
private mapToLaneData;
|
|
45
|
+
private mapHistoryToLaneData;
|
|
42
46
|
}
|
|
43
47
|
export {};
|
|
@@ -8,11 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.LaneDiffGenerator = void 0;
|
|
13
16
|
const component_id_1 = require("@teambit/component-id");
|
|
17
|
+
const objects_1 = require("@teambit/legacy/dist/scope/objects");
|
|
18
|
+
const legacy_component_diff_1 = require("@teambit/legacy.component-diff");
|
|
14
19
|
const lane_id_1 = require("@teambit/lane-id");
|
|
15
20
|
const bit_error_1 = require("@teambit/bit-error");
|
|
21
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
16
22
|
class LaneDiffGenerator {
|
|
17
23
|
constructor(workspace, scope, componentCompare) {
|
|
18
24
|
this.workspace = workspace;
|
|
@@ -96,7 +102,58 @@ class LaneDiffGenerator {
|
|
|
96
102
|
if (idsToCheckDiff && !idsToCheckDiff.hasWithoutVersion(id)) {
|
|
97
103
|
return;
|
|
98
104
|
}
|
|
99
|
-
yield this.componentDiff(id, head, diffOptions);
|
|
105
|
+
yield this.componentDiff(id, head, diffOptions, true);
|
|
106
|
+
})));
|
|
107
|
+
return {
|
|
108
|
+
newCompsFrom: this.newCompsFrom.map((id) => id.toString()),
|
|
109
|
+
newCompsTo: this.newCompsTo.map((id) => id.toString()),
|
|
110
|
+
compsWithDiff: this.compsWithDiff,
|
|
111
|
+
compsWithNoChanges: this.compsWithNoChanges.map((id) => id.toString()),
|
|
112
|
+
toLaneName: this.toLaneData.name,
|
|
113
|
+
fromLaneName: this.fromLaneData.name,
|
|
114
|
+
failures: this.failures,
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
generateDiffHistory(lane, laneHistory, fromHistoryId, toHistoryId, pattern) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
const laneId = lane.toLaneId();
|
|
121
|
+
const history = laneHistory.getHistory();
|
|
122
|
+
const fromLane = history[fromHistoryId];
|
|
123
|
+
const toLane = history[toHistoryId];
|
|
124
|
+
if (!fromLane)
|
|
125
|
+
throw new Error(`unable to find the from-history-id "${fromHistoryId}" in lane "${laneId.toString()}"`);
|
|
126
|
+
if (!toLane)
|
|
127
|
+
throw new Error(`unable to find the to-history-id "${toHistoryId}" in lane "${laneId.toString()}"`);
|
|
128
|
+
this.fromLaneData = this.mapHistoryToLaneData(laneId, fromHistoryId, fromLane);
|
|
129
|
+
this.toLaneData = this.mapHistoryToLaneData(laneId, toHistoryId, toLane);
|
|
130
|
+
let idsToCheckDiff;
|
|
131
|
+
if (pattern) {
|
|
132
|
+
const compIds = this.toLaneData.components.map((c) => c.id);
|
|
133
|
+
idsToCheckDiff = component_id_1.ComponentIdList.fromArray(yield this.scope.filterIdsFromPoolIdsByPattern(pattern, compIds));
|
|
134
|
+
}
|
|
135
|
+
if (!this.toLaneData.components.length) {
|
|
136
|
+
throw new bit_error_1.BitError(`lane-history "${toHistoryId}" is empty, nothing to show`);
|
|
137
|
+
}
|
|
138
|
+
const idsOfTo = component_id_1.ComponentIdList.fromArray(this.toLaneData.components.map((c) => { var _a; return c.id.changeVersion((_a = c.head) === null || _a === void 0 ? void 0 : _a.toString()); }));
|
|
139
|
+
yield this.scope.legacyScope.scopeImporter.importWithoutDeps(idsOfTo, {
|
|
140
|
+
cache: true,
|
|
141
|
+
lane,
|
|
142
|
+
ignoreMissingHead: true,
|
|
143
|
+
reason: `for the "to" diff - ${laneId.toString()}-${toHistoryId}`,
|
|
144
|
+
});
|
|
145
|
+
const idsOfFrom = component_id_1.ComponentIdList.fromArray(this.fromLaneData.components.map((c) => { var _a; return c.id.changeVersion((_a = c.head) === null || _a === void 0 ? void 0 : _a.toString()); }));
|
|
146
|
+
yield this.scope.legacyScope.scopeImporter.importWithoutDeps(idsOfFrom, {
|
|
147
|
+
cache: true,
|
|
148
|
+
lane,
|
|
149
|
+
ignoreMissingHead: true,
|
|
150
|
+
reason: `for the "from" diff - ${laneId.toString()}-${fromHistoryId}`,
|
|
151
|
+
});
|
|
152
|
+
yield Promise.all(this.toLaneData.components.map(({ id, head }) => __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
if (idsToCheckDiff && !idsToCheckDiff.hasWithoutVersion(id)) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
yield this.componentDiff(id, head);
|
|
100
157
|
})));
|
|
101
158
|
return {
|
|
102
159
|
newCompsFrom: this.newCompsFrom.map((id) => id.toString()),
|
|
@@ -109,11 +166,29 @@ class LaneDiffGenerator {
|
|
|
109
166
|
};
|
|
110
167
|
});
|
|
111
168
|
}
|
|
112
|
-
|
|
169
|
+
laneDiffResultsToString(laneDiffResults) {
|
|
170
|
+
const { compsWithDiff, newCompsFrom, newCompsTo, toLaneName, fromLaneName, failures } = laneDiffResults;
|
|
171
|
+
const newCompsOutput = (laneName, ids) => {
|
|
172
|
+
if (!ids.length)
|
|
173
|
+
return '';
|
|
174
|
+
const newCompsIdsStr = ids.map((id) => chalk_1.default.bold(id)).join('\n');
|
|
175
|
+
const newCompsTitle = `\nThe following components were introduced in ${chalk_1.default.bold(laneName)} lane`;
|
|
176
|
+
return `${chalk_1.default.inverse(newCompsTitle)}\n${newCompsIdsStr}`;
|
|
177
|
+
};
|
|
178
|
+
const diffResultsStr = (0, legacy_component_diff_1.outputDiffResults)(compsWithDiff);
|
|
179
|
+
const failuresTitle = `\n\nDiff failed on the following component(s)`;
|
|
180
|
+
const failuresIds = failures.map((f) => `${f.id.toString()} - ${chalk_1.default.red(f.msg)}`).join('\n');
|
|
181
|
+
const failuresStr = failures.length ? `${chalk_1.default.inverse(failuresTitle)}\n${failuresIds}` : '';
|
|
182
|
+
const newCompsToStr = newCompsOutput(toLaneName, newCompsTo);
|
|
183
|
+
const newCompsFromStr = newCompsOutput(fromLaneName, newCompsFrom);
|
|
184
|
+
return `${diffResultsStr}${newCompsToStr}${newCompsFromStr}${failuresStr}`;
|
|
185
|
+
}
|
|
186
|
+
componentDiff(id, toLaneHead, diffOptions = {}, compareToHeadIfEmpty = false) {
|
|
113
187
|
var _a;
|
|
114
188
|
return __awaiter(this, void 0, void 0, function* () {
|
|
115
189
|
const modelComponent = yield this.scope.legacyScope.getModelComponent(id);
|
|
116
|
-
const
|
|
190
|
+
const foundFromLane = (_a = this.fromLaneData.components.find((c) => c.id.isEqualWithoutVersion(id))) === null || _a === void 0 ? void 0 : _a.head;
|
|
191
|
+
const fromLaneHead = compareToHeadIfEmpty ? foundFromLane || modelComponent.head : foundFromLane;
|
|
117
192
|
if (!fromLaneHead) {
|
|
118
193
|
this.newCompsTo.push(id);
|
|
119
194
|
return;
|
|
@@ -203,6 +278,19 @@ class LaneDiffGenerator {
|
|
|
203
278
|
};
|
|
204
279
|
});
|
|
205
280
|
}
|
|
281
|
+
mapHistoryToLaneData(laneId, historyId, historyItem) {
|
|
282
|
+
return {
|
|
283
|
+
name: historyId,
|
|
284
|
+
components: historyItem.components.map((compStr) => {
|
|
285
|
+
const compId = component_id_1.ComponentID.fromString(compStr);
|
|
286
|
+
return {
|
|
287
|
+
id: compId.changeVersion(undefined),
|
|
288
|
+
head: objects_1.Ref.from(compId.version),
|
|
289
|
+
};
|
|
290
|
+
}),
|
|
291
|
+
remote: laneId.toString(),
|
|
292
|
+
};
|
|
293
|
+
}
|
|
206
294
|
}
|
|
207
295
|
exports.LaneDiffGenerator = LaneDiffGenerator;
|
|
208
296
|
//# sourceMappingURL=lane-diff-generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lane-diff-generator.js","sourceRoot":"","sources":["../lane-diff-generator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,wDAAqE;AAGrE,8CAAgD;AAChD,kDAA8C;AAwB9C,MAAa,iBAAiB;IAQ5B,YACU,SAAgC,EAChC,KAAgB,EAChB,gBAAsC;QAFtC,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BACnC,IAAI,EAAE,aAAG,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;iBAC/B,CAAC;YACJ,CAAC,CAAC;YACF,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE;SAC1B,CAAC;IACJ,CAAC;CACF;AApTD,8CAoTC"}
|
package/dist/lane-diff.cmd.js
CHANGED
|
@@ -8,13 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.LaneDiffCmd = void 0;
|
|
16
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
17
|
-
const legacy_component_diff_1 = require("@teambit/legacy.component-diff");
|
|
18
13
|
const constants_1 = require("@teambit/legacy/dist/constants");
|
|
19
14
|
const lane_diff_generator_1 = require("./lane-diff-generator");
|
|
20
15
|
class LaneDiffCmd {
|
|
@@ -54,21 +49,8 @@ component-pattern format: ${constants_1.COMPONENT_PATTERN_HELP}`,
|
|
|
54
49
|
report([values = []], { pattern }) {
|
|
55
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
51
|
const laneDiffGenerator = new lane_diff_generator_1.LaneDiffGenerator(this.workspace, this.scope, this.componentCompare);
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
if (!ids.length)
|
|
60
|
-
return '';
|
|
61
|
-
const newCompsIdsStr = ids.map((id) => chalk_1.default.bold(id)).join('\n');
|
|
62
|
-
const newCompsTitle = `\nThe following components were introduced in ${chalk_1.default.bold(laneName)} lane`;
|
|
63
|
-
return newCompsFrom.length ? `${chalk_1.default.inverse(newCompsTitle)}\n${newCompsIdsStr}` : '';
|
|
64
|
-
};
|
|
65
|
-
const diffResultsStr = (0, legacy_component_diff_1.outputDiffResults)(compsWithDiff);
|
|
66
|
-
const failuresTitle = `\n\nDiff failed on the following component(s)`;
|
|
67
|
-
const failuresIds = failures.map((f) => `${f.id.toString()} - ${chalk_1.default.red(f.msg)}`).join('\n');
|
|
68
|
-
const failuresStr = failures.length ? `${chalk_1.default.inverse(failuresTitle)}\n${failuresIds}` : '';
|
|
69
|
-
const newCompsToStr = newCompsOutput(toLaneName, newCompsTo);
|
|
70
|
-
const newCompsFromStr = newCompsOutput(fromLaneName, newCompsFrom);
|
|
71
|
-
return `${diffResultsStr}${newCompsToStr}${newCompsFromStr}${failuresStr}`;
|
|
52
|
+
const results = yield laneDiffGenerator.generate(values, undefined, pattern);
|
|
53
|
+
return laneDiffGenerator.laneDiffResultsToString(results);
|
|
72
54
|
});
|
|
73
55
|
}
|
|
74
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lane-diff.cmd.js","sourceRoot":"","sources":["../lane-diff.cmd.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lane-diff.cmd.js","sourceRoot":"","sources":["../lane-diff.cmd.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,8DAAwE;AACxE,+DAA0D;AAE1D,MAAa,WAAW;IA8BtB,YACU,SAAoB,EACpB,KAAgB,EAChB,gBAAsC;QAFtC,cAAS,GAAT,SAAS,CAAW;QACpB,UAAK,GAAL,KAAK,CAAW;QAChB,qBAAgB,GAAhB,gBAAgB,CAAsB;QAhChD,SAAI,GAAG,kBAAkB,CAAC;QAC1B,gBAAW,GAAG,yBAAyB,CAAC;QACxC,wBAAmB,GAAG;;iEAEyC,CAAC;QAChE,UAAK,GAAG,EAAE,CAAC;QACX,cAAS,GAAG;YACV;gBACE,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,0BAA0B;aACxC;YACD;gBACE,IAAI,EAAE,IAAI;gBACV,WAAW,EAAE,kCAAkC;aAChD;SACF,CAAC;QACF,YAAO,GAAG;YACR;gBACE,EAAE;gBACF,6BAA6B;gBAC7B;4BACsB,kCAAsB,EAAE;aAC/C;SACgB,CAAC;QACpB,WAAM,GAAG,IAAI,CAAC;QACd,YAAO,GAAG,IAAI,CAAC;QACf,aAAQ,GAAG,IAAI,CAAC;QAChB,kBAAa,GAAG,IAAI,CAAC;IAMlB,CAAC;IAEE,MAAM,CAAC,CAAC,MAAM,GAAG,EAAE,CAAa,EAAE,EAAE,OAAO,EAAwB;;YACvE,MAAM,iBAAiB,GAAG,IAAI,uCAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;YACnG,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;YAC7E,OAAO,iBAAiB,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;QAC5D,CAAC;KAAA;CACF;AAzCD,kCAyCC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
+
import { ScopeMain } from '@teambit/scope';
|
|
3
|
+
import { Workspace } from '@teambit/workspace';
|
|
4
|
+
import { ComponentCompareMain } from '@teambit/component-compare';
|
|
5
|
+
import { LanesMain } from '@teambit/lanes';
|
|
6
|
+
export declare class LaneHistoryDiffCmd implements Command {
|
|
7
|
+
private lanes;
|
|
8
|
+
private workspace;
|
|
9
|
+
private scope;
|
|
10
|
+
private componentCompare;
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
extendedDescription: string;
|
|
14
|
+
alias: string;
|
|
15
|
+
options: CommandOptions;
|
|
16
|
+
loader: boolean;
|
|
17
|
+
constructor(lanes: LanesMain, workspace: Workspace, scope: ScopeMain, componentCompare: ComponentCompareMain);
|
|
18
|
+
report([fromHistoryId, toHistoryId]: [string, string], { lane, pattern }: {
|
|
19
|
+
lane?: string;
|
|
20
|
+
pattern?: string;
|
|
21
|
+
}): Promise<string>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LaneHistoryDiffCmd = void 0;
|
|
13
|
+
const constants_1 = require("@teambit/legacy/dist/constants");
|
|
14
|
+
const lane_diff_generator_1 = require("./lane-diff-generator");
|
|
15
|
+
const bit_error_1 = require("@teambit/bit-error");
|
|
16
|
+
class LaneHistoryDiffCmd {
|
|
17
|
+
constructor(lanes, workspace, scope, componentCompare) {
|
|
18
|
+
this.lanes = lanes;
|
|
19
|
+
this.workspace = workspace;
|
|
20
|
+
this.scope = scope;
|
|
21
|
+
this.componentCompare = componentCompare;
|
|
22
|
+
this.name = 'history-diff <from-history-id> <to-history-id>';
|
|
23
|
+
this.description = 'EXPERIMENTAL. show diff between two lane-history ids';
|
|
24
|
+
this.extendedDescription = 'run "bit lane history" to find these history-ids';
|
|
25
|
+
this.alias = '';
|
|
26
|
+
this.options = [
|
|
27
|
+
['l', 'lane <lane-name>', 'the name of the lane to diff. if not specified, the current lane is used'],
|
|
28
|
+
[
|
|
29
|
+
'',
|
|
30
|
+
'pattern <component-pattern>',
|
|
31
|
+
`show lane-diff for components conforming to the specified component-pattern only
|
|
32
|
+
component-pattern format: ${constants_1.COMPONENT_PATTERN_HELP}`,
|
|
33
|
+
],
|
|
34
|
+
];
|
|
35
|
+
this.loader = true;
|
|
36
|
+
}
|
|
37
|
+
report([fromHistoryId, toHistoryId], { lane, pattern }) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const laneId = lane ? yield this.lanes.parseLaneId(lane) : this.lanes.getCurrentLaneId();
|
|
40
|
+
if (!laneId || laneId.isDefault())
|
|
41
|
+
throw new bit_error_1.BitError(`unable to show diff-history of the default lane (main)`);
|
|
42
|
+
yield this.lanes.importLaneHistory(laneId);
|
|
43
|
+
const laneHistory = yield this.lanes.getLaneHistory(laneId);
|
|
44
|
+
const laneDiffGenerator = new lane_diff_generator_1.LaneDiffGenerator(this.workspace, this.scope, this.componentCompare);
|
|
45
|
+
const laneObj = yield this.lanes.loadLane(laneId);
|
|
46
|
+
const results = yield laneDiffGenerator.generateDiffHistory(laneObj, laneHistory, fromHistoryId, toHistoryId, pattern);
|
|
47
|
+
return laneDiffGenerator.laneDiffResultsToString(results);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.LaneHistoryDiffCmd = LaneHistoryDiffCmd;
|
|
52
|
+
//# sourceMappingURL=lane-history-diff.cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lane-history-diff.cmd.js","sourceRoot":"","sources":["../lane-history-diff.cmd.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,8DAAwE;AACxE,+DAA0D;AAC1D,kDAA8C;AAG9C,MAAa,kBAAkB;IAgB7B,YACU,KAAgB,EAChB,SAAoB,EACpB,KAAgB,EAChB,gBAAsC;QAHtC,UAAK,GAAL,KAAK,CAAW;QAChB,cAAS,GAAT,SAAS,CAAW;QACpB,UAAK,GAAL,KAAK,CAAW;QAChB,qBAAgB,GAAhB,gBAAgB,CAAsB;QAnBhD,SAAI,GAAG,gDAAgD,CAAC;QAC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0CC"}
|
package/index.ts
CHANGED
package/lane-diff-generator.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ScopeMain } from '@teambit/scope';
|
|
2
2
|
import { Workspace } from '@teambit/workspace';
|
|
3
|
-
import { Lane, Version } from '@teambit/legacy/dist/scope/models';
|
|
3
|
+
import { Lane, LaneHistory, Version } from '@teambit/legacy/dist/scope/models';
|
|
4
4
|
import { ComponentID, ComponentIdList } from '@teambit/component-id';
|
|
5
5
|
import { Ref } from '@teambit/legacy/dist/scope/objects';
|
|
6
|
-
import { DiffResults, DiffOptions } from '@teambit/legacy.component-diff';
|
|
7
|
-
import { DEFAULT_LANE } from '@teambit/lane-id';
|
|
6
|
+
import { DiffResults, DiffOptions, outputDiffResults } from '@teambit/legacy.component-diff';
|
|
7
|
+
import { DEFAULT_LANE, LaneId } from '@teambit/lane-id';
|
|
8
8
|
import { BitError } from '@teambit/bit-error';
|
|
9
9
|
import { ComponentCompareMain } from '@teambit/component-compare';
|
|
10
|
+
import { HistoryItem } from '@teambit/legacy/dist/scope/models/lane-history';
|
|
11
|
+
import chalk from 'chalk';
|
|
10
12
|
|
|
11
13
|
type LaneData = {
|
|
12
14
|
name: string;
|
|
@@ -118,7 +120,7 @@ export class LaneDiffGenerator {
|
|
|
118
120
|
if (idsToCheckDiff && !idsToCheckDiff.hasWithoutVersion(id)) {
|
|
119
121
|
return;
|
|
120
122
|
}
|
|
121
|
-
await this.componentDiff(id, head, diffOptions);
|
|
123
|
+
await this.componentDiff(id, head, diffOptions, true);
|
|
122
124
|
})
|
|
123
125
|
);
|
|
124
126
|
|
|
@@ -133,10 +135,102 @@ export class LaneDiffGenerator {
|
|
|
133
135
|
};
|
|
134
136
|
}
|
|
135
137
|
|
|
136
|
-
|
|
138
|
+
async generateDiffHistory(
|
|
139
|
+
lane: Lane,
|
|
140
|
+
laneHistory: LaneHistory,
|
|
141
|
+
fromHistoryId: string,
|
|
142
|
+
toHistoryId: string,
|
|
143
|
+
pattern?: string
|
|
144
|
+
): Promise<LaneDiffResults> {
|
|
145
|
+
const laneId = lane.toLaneId();
|
|
146
|
+
const history = laneHistory.getHistory();
|
|
147
|
+
const fromLane = history[fromHistoryId];
|
|
148
|
+
const toLane = history[toHistoryId];
|
|
149
|
+
if (!fromLane)
|
|
150
|
+
throw new Error(`unable to find the from-history-id "${fromHistoryId}" in lane "${laneId.toString()}"`);
|
|
151
|
+
if (!toLane) throw new Error(`unable to find the to-history-id "${toHistoryId}" in lane "${laneId.toString()}"`);
|
|
152
|
+
this.fromLaneData = this.mapHistoryToLaneData(laneId, fromHistoryId, fromLane);
|
|
153
|
+
this.toLaneData = this.mapHistoryToLaneData(laneId, toHistoryId, toLane);
|
|
154
|
+
|
|
155
|
+
let idsToCheckDiff: ComponentIdList | undefined;
|
|
156
|
+
if (pattern) {
|
|
157
|
+
const compIds = this.toLaneData.components.map((c) => c.id);
|
|
158
|
+
idsToCheckDiff = ComponentIdList.fromArray(await this.scope.filterIdsFromPoolIdsByPattern(pattern, compIds));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (!this.toLaneData.components.length) {
|
|
162
|
+
throw new BitError(`lane-history "${toHistoryId}" is empty, nothing to show`);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const idsOfTo = ComponentIdList.fromArray(
|
|
166
|
+
this.toLaneData.components.map((c) => c.id.changeVersion(c.head?.toString()))
|
|
167
|
+
);
|
|
168
|
+
await this.scope.legacyScope.scopeImporter.importWithoutDeps(idsOfTo, {
|
|
169
|
+
cache: true,
|
|
170
|
+
lane,
|
|
171
|
+
ignoreMissingHead: true,
|
|
172
|
+
reason: `for the "to" diff - ${laneId.toString()}-${toHistoryId}`,
|
|
173
|
+
});
|
|
174
|
+
const idsOfFrom = ComponentIdList.fromArray(
|
|
175
|
+
this.fromLaneData.components.map((c) => c.id.changeVersion(c.head?.toString()))
|
|
176
|
+
);
|
|
177
|
+
await this.scope.legacyScope.scopeImporter.importWithoutDeps(idsOfFrom, {
|
|
178
|
+
cache: true,
|
|
179
|
+
lane,
|
|
180
|
+
ignoreMissingHead: true,
|
|
181
|
+
reason: `for the "from" diff - ${laneId.toString()}-${fromHistoryId}`,
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
await Promise.all(
|
|
185
|
+
this.toLaneData.components.map(async ({ id, head }) => {
|
|
186
|
+
if (idsToCheckDiff && !idsToCheckDiff.hasWithoutVersion(id)) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
await this.componentDiff(id, head);
|
|
190
|
+
})
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
return {
|
|
194
|
+
newCompsFrom: this.newCompsFrom.map((id) => id.toString()),
|
|
195
|
+
newCompsTo: this.newCompsTo.map((id) => id.toString()),
|
|
196
|
+
compsWithDiff: this.compsWithDiff,
|
|
197
|
+
compsWithNoChanges: this.compsWithNoChanges.map((id) => id.toString()),
|
|
198
|
+
toLaneName: this.toLaneData.name,
|
|
199
|
+
fromLaneName: this.fromLaneData.name,
|
|
200
|
+
failures: this.failures,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
laneDiffResultsToString(laneDiffResults: LaneDiffResults): string {
|
|
205
|
+
const { compsWithDiff, newCompsFrom, newCompsTo, toLaneName, fromLaneName, failures } = laneDiffResults;
|
|
206
|
+
|
|
207
|
+
const newCompsOutput = (laneName: string, ids: string[]) => {
|
|
208
|
+
if (!ids.length) return '';
|
|
209
|
+
const newCompsIdsStr = ids.map((id) => chalk.bold(id)).join('\n');
|
|
210
|
+
const newCompsTitle = `\nThe following components were introduced in ${chalk.bold(laneName)} lane`;
|
|
211
|
+
return `${chalk.inverse(newCompsTitle)}\n${newCompsIdsStr}`;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
const diffResultsStr = outputDiffResults(compsWithDiff);
|
|
215
|
+
|
|
216
|
+
const failuresTitle = `\n\nDiff failed on the following component(s)`;
|
|
217
|
+
const failuresIds = failures.map((f) => `${f.id.toString()} - ${chalk.red(f.msg)}`).join('\n');
|
|
218
|
+
const failuresStr = failures.length ? `${chalk.inverse(failuresTitle)}\n${failuresIds}` : '';
|
|
219
|
+
const newCompsToStr = newCompsOutput(toLaneName, newCompsTo);
|
|
220
|
+
|
|
221
|
+
const newCompsFromStr = newCompsOutput(fromLaneName, newCompsFrom);
|
|
222
|
+
return `${diffResultsStr}${newCompsToStr}${newCompsFromStr}${failuresStr}`;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
private async componentDiff(
|
|
226
|
+
id: ComponentID,
|
|
227
|
+
toLaneHead: Ref | null,
|
|
228
|
+
diffOptions: DiffOptions = {},
|
|
229
|
+
compareToHeadIfEmpty = false
|
|
230
|
+
) {
|
|
137
231
|
const modelComponent = await this.scope.legacyScope.getModelComponent(id);
|
|
138
|
-
const
|
|
139
|
-
|
|
232
|
+
const foundFromLane = this.fromLaneData.components.find((c) => c.id.isEqualWithoutVersion(id))?.head;
|
|
233
|
+
const fromLaneHead = compareToHeadIfEmpty ? foundFromLane || modelComponent.head : foundFromLane;
|
|
140
234
|
if (!fromLaneHead) {
|
|
141
235
|
this.newCompsTo.push(id);
|
|
142
236
|
return;
|
|
@@ -231,4 +325,18 @@ export class LaneDiffGenerator {
|
|
|
231
325
|
remote: lane.toLaneId().toString(),
|
|
232
326
|
};
|
|
233
327
|
}
|
|
328
|
+
|
|
329
|
+
private mapHistoryToLaneData(laneId: LaneId, historyId: string, historyItem: HistoryItem): LaneData {
|
|
330
|
+
return {
|
|
331
|
+
name: historyId,
|
|
332
|
+
components: historyItem.components.map((compStr) => {
|
|
333
|
+
const compId = ComponentID.fromString(compStr);
|
|
334
|
+
return {
|
|
335
|
+
id: compId.changeVersion(undefined),
|
|
336
|
+
head: Ref.from(compId.version),
|
|
337
|
+
};
|
|
338
|
+
}),
|
|
339
|
+
remote: laneId.toString(),
|
|
340
|
+
};
|
|
341
|
+
}
|
|
234
342
|
}
|
package/lane-diff.cmd.ts
CHANGED
|
@@ -2,8 +2,6 @@ import { Command, CommandOptions } from '@teambit/cli';
|
|
|
2
2
|
import { ScopeMain } from '@teambit/scope';
|
|
3
3
|
import { Workspace } from '@teambit/workspace';
|
|
4
4
|
import { ComponentCompareMain } from '@teambit/component-compare';
|
|
5
|
-
import chalk from 'chalk';
|
|
6
|
-
import { outputDiffResults } from '@teambit/legacy.component-diff';
|
|
7
5
|
import { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';
|
|
8
6
|
import { LaneDiffGenerator } from './lane-diff-generator';
|
|
9
7
|
|
|
@@ -45,23 +43,7 @@ component-pattern format: ${COMPONENT_PATTERN_HELP}`,
|
|
|
45
43
|
|
|
46
44
|
async report([values = []]: [string[]], { pattern }: { pattern?: string }) {
|
|
47
45
|
const laneDiffGenerator = new LaneDiffGenerator(this.workspace, this.scope, this.componentCompare);
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const newCompsOutput = (laneName: string, ids: string[]) => {
|
|
52
|
-
if (!ids.length) return '';
|
|
53
|
-
const newCompsIdsStr = ids.map((id) => chalk.bold(id)).join('\n');
|
|
54
|
-
const newCompsTitle = `\nThe following components were introduced in ${chalk.bold(laneName)} lane`;
|
|
55
|
-
return newCompsFrom.length ? `${chalk.inverse(newCompsTitle)}\n${newCompsIdsStr}` : '';
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const diffResultsStr = outputDiffResults(compsWithDiff);
|
|
59
|
-
|
|
60
|
-
const failuresTitle = `\n\nDiff failed on the following component(s)`;
|
|
61
|
-
const failuresIds = failures.map((f) => `${f.id.toString()} - ${chalk.red(f.msg)}`).join('\n');
|
|
62
|
-
const failuresStr = failures.length ? `${chalk.inverse(failuresTitle)}\n${failuresIds}` : '';
|
|
63
|
-
const newCompsToStr = newCompsOutput(toLaneName, newCompsTo);
|
|
64
|
-
const newCompsFromStr = newCompsOutput(fromLaneName, newCompsFrom);
|
|
65
|
-
return `${diffResultsStr}${newCompsToStr}${newCompsFromStr}${failuresStr}`;
|
|
46
|
+
const results = await laneDiffGenerator.generate(values, undefined, pattern);
|
|
47
|
+
return laneDiffGenerator.laneDiffResultsToString(results);
|
|
66
48
|
}
|
|
67
49
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
+
import { ScopeMain } from '@teambit/scope';
|
|
3
|
+
import { Workspace } from '@teambit/workspace';
|
|
4
|
+
import { ComponentCompareMain } from '@teambit/component-compare';
|
|
5
|
+
import { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';
|
|
6
|
+
import { LaneDiffGenerator } from './lane-diff-generator';
|
|
7
|
+
import { BitError } from '@teambit/bit-error';
|
|
8
|
+
import { LanesMain } from '@teambit/lanes';
|
|
9
|
+
|
|
10
|
+
export class LaneHistoryDiffCmd implements Command {
|
|
11
|
+
name = 'history-diff <from-history-id> <to-history-id>';
|
|
12
|
+
description = 'EXPERIMENTAL. show diff between two lane-history ids';
|
|
13
|
+
extendedDescription = 'run "bit lane history" to find these history-ids';
|
|
14
|
+
alias = '';
|
|
15
|
+
options = [
|
|
16
|
+
['l', 'lane <lane-name>', 'the name of the lane to diff. if not specified, the current lane is used'],
|
|
17
|
+
[
|
|
18
|
+
'',
|
|
19
|
+
'pattern <component-pattern>',
|
|
20
|
+
`show lane-diff for components conforming to the specified component-pattern only
|
|
21
|
+
component-pattern format: ${COMPONENT_PATTERN_HELP}`,
|
|
22
|
+
],
|
|
23
|
+
] as CommandOptions;
|
|
24
|
+
loader = true;
|
|
25
|
+
|
|
26
|
+
constructor(
|
|
27
|
+
private lanes: LanesMain,
|
|
28
|
+
private workspace: Workspace,
|
|
29
|
+
private scope: ScopeMain,
|
|
30
|
+
private componentCompare: ComponentCompareMain
|
|
31
|
+
) {}
|
|
32
|
+
|
|
33
|
+
async report(
|
|
34
|
+
[fromHistoryId, toHistoryId]: [string, string],
|
|
35
|
+
{ lane, pattern }: { lane?: string; pattern?: string }
|
|
36
|
+
): Promise<string> {
|
|
37
|
+
const laneId = lane ? await this.lanes.parseLaneId(lane) : this.lanes.getCurrentLaneId();
|
|
38
|
+
if (!laneId || laneId.isDefault()) throw new BitError(`unable to show diff-history of the default lane (main)`);
|
|
39
|
+
await this.lanes.importLaneHistory(laneId);
|
|
40
|
+
const laneHistory = await this.lanes.getLaneHistory(laneId);
|
|
41
|
+
const laneDiffGenerator = new LaneDiffGenerator(this.workspace, this.scope, this.componentCompare);
|
|
42
|
+
const laneObj = await this.lanes.loadLane(laneId);
|
|
43
|
+
const results = await laneDiffGenerator.generateDiffHistory(
|
|
44
|
+
laneObj!,
|
|
45
|
+
laneHistory,
|
|
46
|
+
fromHistoryId,
|
|
47
|
+
toHistoryId,
|
|
48
|
+
pattern
|
|
49
|
+
);
|
|
50
|
+
return laneDiffGenerator.laneDiffResultsToString(results);
|
|
51
|
+
}
|
|
52
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/lanes.modules.diff",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.487",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/lanes/modules/diff",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.lanes",
|
|
8
8
|
"name": "modules/diff",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.487"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
File without changes
|