@teambit/component 1.0.317 → 1.0.319

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.
@@ -2698,7 +2698,7 @@
2698
2698
  "_legacy": {
2699
2699
  "scope": "teambit.component",
2700
2700
  "name": "component",
2701
- "version": "1.0.317"
2701
+ "version": "1.0.319"
2702
2702
  },
2703
2703
  "_scope": "teambit.component"
2704
2704
  }
@@ -8787,7 +8787,7 @@
8787
8787
  "_legacy": {
8788
8788
  "scope": "teambit.component",
8789
8789
  "name": "component",
8790
- "version": "1.0.317"
8790
+ "version": "1.0.319"
8791
8791
  },
8792
8792
  "_scope": "teambit.component"
8793
8793
  }
@@ -20192,7 +20192,7 @@
20192
20192
  "_legacy": {
20193
20193
  "scope": "teambit.component",
20194
20194
  "name": "component",
20195
- "version": "1.0.317"
20195
+ "version": "1.0.319"
20196
20196
  },
20197
20197
  "_scope": "teambit.component"
20198
20198
  }
@@ -25675,7 +25675,7 @@
25675
25675
  "_legacy": {
25676
25676
  "scope": "teambit.component",
25677
25677
  "name": "component",
25678
- "version": "1.0.317"
25678
+ "version": "1.0.319"
25679
25679
  },
25680
25680
  "_scope": "teambit.component"
25681
25681
  }
@@ -32196,7 +32196,7 @@
32196
32196
  "_legacy": {
32197
32197
  "scope": "teambit.component",
32198
32198
  "name": "component",
32199
- "version": "1.0.317"
32199
+ "version": "1.0.319"
32200
32200
  },
32201
32201
  "_scope": "teambit.component"
32202
32202
  }
@@ -34696,7 +34696,7 @@
34696
34696
  "componentId": {
34697
34697
  "scope": "teambit.component",
34698
34698
  "name": "component",
34699
- "version": "1.0.317"
34699
+ "version": "1.0.319"
34700
34700
  },
34701
34701
  "taggedModuleExports": []
34702
34702
  }
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component@1.0.317/dist/component.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component@1.0.317/dist/component.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component@1.0.319/dist/component.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component@1.0.319/dist/component.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -0,0 +1,19 @@
1
+ import { DependenciesInfo } from '@teambit/legacy/dist/scope/graph/scope-graph';
2
+ export declare function getConsumerComponent({ id, compare, allVersions, showRemoteVersions, showDependents, showDependencies, }: {
3
+ id: string;
4
+ compare: boolean;
5
+ allVersions: boolean | null | undefined;
6
+ showRemoteVersions: boolean;
7
+ showDependents: boolean;
8
+ showDependencies: boolean;
9
+ }): Promise<import("@teambit/legacy/dist/consumer/component").default[] | {
10
+ component: import("@teambit/legacy/dist/consumer/component").default;
11
+ componentModel: import("@teambit/legacy/dist/consumer/component").default;
12
+ dependentsInfo?: undefined;
13
+ dependenciesInfo?: undefined;
14
+ } | {
15
+ component: import("@teambit/legacy/dist/consumer/component").default;
16
+ dependentsInfo: DependenciesInfo[];
17
+ dependenciesInfo: DependenciesInfo[];
18
+ componentModel?: undefined;
19
+ }>;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getConsumerComponent = getConsumerComponent;
7
+ function _consumer() {
8
+ const data = require("@teambit/legacy/dist/consumer");
9
+ _consumer = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _scopeGraph() {
15
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/scope/graph/scope-graph"));
16
+ _scopeGraph = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _nothingToCompareTo() {
22
+ const data = require("./nothing-to-compare-to");
23
+ _nothingToCompareTo = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
29
+ async function getConsumerComponent({
30
+ id,
31
+ compare,
32
+ allVersions,
33
+ showRemoteVersions,
34
+ showDependents,
35
+ showDependencies
36
+ }) {
37
+ const consumer = await (0, _consumer().loadConsumer)();
38
+ const bitId = consumer.getParsedId(id);
39
+ if (allVersions) {
40
+ return consumer.loadAllVersionsOfComponentFromModel(bitId);
41
+ }
42
+ const component = await consumer.loadComponent(bitId); // loads recent component
43
+ let dependenciesInfo = [];
44
+ let dependentsInfo = [];
45
+ if (showDependents || showDependencies) {
46
+ const graph = await _scopeGraph().default.buildGraphFromWorkspace(consumer);
47
+ const dependencyGraph = new (_scopeGraph().default)(graph);
48
+ const componentGraph = dependencyGraph.getSubGraphOfConnectedComponents(component.id);
49
+ const componentDepGraph = new (_scopeGraph().default)(componentGraph);
50
+ if (showDependents) {
51
+ dependentsInfo = componentDepGraph.getDependentsInfo(component.id);
52
+ }
53
+ if (showDependencies) {
54
+ dependenciesInfo = componentDepGraph.getDependenciesInfo(component.id);
55
+ }
56
+ }
57
+ if (showRemoteVersions) {
58
+ await consumer.addRemoteAndLocalVersionsToDependencies(component, true);
59
+ }
60
+ if (compare) {
61
+ if (!component.componentFromModel) throw new (_nothingToCompareTo().NothingToCompareTo)(id);
62
+ return {
63
+ component,
64
+ componentModel: component.componentFromModel
65
+ };
66
+ }
67
+ await consumer.onDestroy('get-component');
68
+ return {
69
+ component,
70
+ dependentsInfo,
71
+ dependenciesInfo
72
+ };
73
+ }
74
+
75
+ //# sourceMappingURL=get-consumer-component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_consumer","data","require","_scopeGraph","_interopRequireDefault","_nothingToCompareTo","e","__esModule","default","getConsumerComponent","id","compare","allVersions","showRemoteVersions","showDependents","showDependencies","consumer","loadConsumer","bitId","getParsedId","loadAllVersionsOfComponentFromModel","component","loadComponent","dependenciesInfo","dependentsInfo","graph","DependencyGraph","buildGraphFromWorkspace","dependencyGraph","componentGraph","getSubGraphOfConnectedComponents","componentDepGraph","getDependentsInfo","getDependenciesInfo","addRemoteAndLocalVersionsToDependencies","componentFromModel","NothingToCompareTo","componentModel","onDestroy"],"sources":["get-consumer-component.ts"],"sourcesContent":["import { Consumer, loadConsumer } from '@teambit/legacy/dist/consumer';\nimport DependencyGraph, { DependenciesInfo } from '@teambit/legacy/dist/scope/graph/scope-graph';\nimport { NothingToCompareTo } from './nothing-to-compare-to';\n\nexport async function getConsumerComponent({\n id,\n compare,\n allVersions,\n showRemoteVersions,\n showDependents,\n showDependencies,\n}: {\n id: string;\n compare: boolean;\n allVersions: boolean | null | undefined;\n showRemoteVersions: boolean;\n showDependents: boolean;\n showDependencies: boolean;\n}) {\n const consumer: Consumer = await loadConsumer();\n const bitId = consumer.getParsedId(id);\n if (allVersions) {\n return consumer.loadAllVersionsOfComponentFromModel(bitId);\n }\n const component = await consumer.loadComponent(bitId); // loads recent component\n let dependenciesInfo: DependenciesInfo[] = [];\n let dependentsInfo: DependenciesInfo[] = [];\n if (showDependents || showDependencies) {\n const graph = await DependencyGraph.buildGraphFromWorkspace(consumer);\n const dependencyGraph = new DependencyGraph(graph);\n const componentGraph = dependencyGraph.getSubGraphOfConnectedComponents(component.id);\n const componentDepGraph = new DependencyGraph(componentGraph);\n if (showDependents) {\n dependentsInfo = componentDepGraph.getDependentsInfo(component.id);\n }\n if (showDependencies) {\n dependenciesInfo = componentDepGraph.getDependenciesInfo(component.id);\n }\n }\n if (showRemoteVersions) {\n await consumer.addRemoteAndLocalVersionsToDependencies(component, true);\n }\n if (compare) {\n if (!component.componentFromModel) throw new NothingToCompareTo(id);\n return { component, componentModel: component.componentFromModel };\n }\n await consumer.onDestroy('get-component');\n return { component, dependentsInfo, dependenciesInfo };\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,S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CAACX,SAAS,CAACX,EAAE,CAAC;IACpE;IACA,IAAIK,gBAAgB,EAAE;MACpBQ,gBAAgB,GAAGQ,iBAAiB,CAACE,mBAAmB,CAACZ,SAAS,CAACX,EAAE,CAAC;IACxE;EACF;EACA,IAAIG,kBAAkB,EAAE;IACtB,MAAMG,QAAQ,CAACkB,uCAAuC,CAACb,SAAS,EAAE,IAAI,CAAC;EACzE;EACA,IAAIV,OAAO,EAAE;IACX,IAAI,CAACU,SAAS,CAACc,kBAAkB,EAAE,MAAM,KAAIC,wCAAkB,EAAC1B,EAAE,CAAC;IACnE,OAAO;MAAEW,SAAS;MAAEgB,cAAc,EAAEhB,SAAS,CAACc;IAAmB,CAAC;EACpE;EACA,MAAMnB,QAAQ,CAACsB,SAAS,CAAC,eAAe,CAAC;EACzC,OAAO;IAAEjB,SAAS;IAAEG,cAAc;IAAED;EAAiB,CAAC;AACxD","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ import Component from '@teambit/legacy/dist/consumer/component';
2
+ export declare function getScopeComponent({ id, allVersions, scopePath, showDependents, showDependencies, loadScopeFromCache, }: {
3
+ id: string;
4
+ allVersions?: boolean | null;
5
+ scopePath?: string | null;
6
+ showDependents?: boolean;
7
+ showDependencies?: boolean;
8
+ loadScopeFromCache?: boolean;
9
+ }): Promise<{
10
+ component: Component[] | Component;
11
+ }>;
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getScopeComponent = getScopeComponent;
7
+ function _componentId() {
8
+ const data = require("@teambit/component-id");
9
+ _componentId = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _loader() {
15
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/cli/loader"));
16
+ _loader = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _consumer() {
22
+ const data = require("@teambit/legacy/dist/consumer");
23
+ _consumer = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _getRemoteByName() {
29
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/remotes/get-remote-by-name"));
30
+ _getRemoteByName = function () {
31
+ return data;
32
+ };
33
+ return data;
34
+ }
35
+ function _scope() {
36
+ const data = require("@teambit/legacy/dist/scope");
37
+ _scope = function () {
38
+ return data;
39
+ };
40
+ return data;
41
+ }
42
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
43
+ async function getScopeComponent({
44
+ id,
45
+ allVersions,
46
+ scopePath,
47
+ showDependents,
48
+ showDependencies,
49
+ loadScopeFromCache
50
+ }) {
51
+ const bitId = _componentId().ComponentID.fromString(id); // user used --remote so we know it has a scope
52
+
53
+ if (scopePath) {
54
+ // coming from the api
55
+ const scope = await (0, _scope().loadScope)(scopePath, loadScopeFromCache);
56
+ const component = await showComponentUsingScope(scope);
57
+ return {
58
+ component
59
+ };
60
+ }
61
+ const consumer = await (0, _consumer().loadConsumerIfExist)();
62
+ const remote = await (0, _getRemoteByName().default)(bitId.scope, consumer);
63
+ _loader().default.start('showing a component...');
64
+ const component = await remote.show(bitId);
65
+ let dependenciesInfo = [];
66
+ let dependentsInfo = [];
67
+ if (showDependents || showDependencies) {
68
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
69
+ const componentDepGraph = await remote.graph(component.id);
70
+ if (showDependents) {
71
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
72
+ dependentsInfo = componentDepGraph.getDependentsInfo(component.id);
73
+ }
74
+ if (showDependencies) {
75
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
76
+ dependenciesInfo = componentDepGraph.getDependenciesInfo(component.id);
77
+ }
78
+ }
79
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
80
+ return {
81
+ component,
82
+ dependentsInfo,
83
+ dependenciesInfo
84
+ };
85
+ async function showComponentUsingScope(scope) {
86
+ if (allVersions) {
87
+ return scope.loadAllVersions(bitId);
88
+ }
89
+ const scopeComponentsImporter = scope.scopeImporter;
90
+ return scopeComponentsImporter.loadRemoteComponent(bitId);
91
+ }
92
+ }
93
+
94
+ //# sourceMappingURL=get-scope-component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_componentId","data","require","_loader","_interopRequireDefault","_consumer","_getRemoteByName","_scope","e","__esModule","default","getScopeComponent","id","allVersions","scopePath","showDependents","showDependencies","loadScopeFromCache","bitId","ComponentID","fromString","scope","loadScope","component","showComponentUsingScope","consumer","loadConsumerIfExist","remote","getRemoteByName","loader","start","show","dependenciesInfo","dependentsInfo","componentDepGraph","graph","getDependentsInfo","getDependenciesInfo","loadAllVersions","scopeComponentsImporter","scopeImporter","loadRemoteComponent"],"sources":["get-scope-component.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component-id';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { Consumer, loadConsumerIfExist } from '@teambit/legacy/dist/consumer';\nimport Component from '@teambit/legacy/dist/consumer/component';\nimport getRemoteByName from '@teambit/legacy/dist/remotes/get-remote-by-name';\nimport { loadScope, Scope } from '@teambit/legacy/dist/scope';\nimport { DependenciesInfo } from '@teambit/legacy/dist/scope/graph/scope-graph';\n\nexport async function getScopeComponent({\n id,\n allVersions,\n scopePath,\n showDependents,\n showDependencies,\n loadScopeFromCache,\n}: {\n id: string;\n allVersions?: boolean | null;\n scopePath?: string | null; // used by the api (see /src/api.js)\n showDependents?: boolean;\n showDependencies?: boolean;\n loadScopeFromCache?: boolean;\n}): Promise<{ component: Component[] | Component }> {\n const bitId = ComponentID.fromString(id); // user used --remote so we know it has a scope\n\n if (scopePath) {\n // coming from the api\n const scope: Scope = await loadScope(scopePath, loadScopeFromCache);\n const component = await showComponentUsingScope(scope);\n return { component };\n }\n\n const consumer: Consumer | undefined = await loadConsumerIfExist();\n const remote = await getRemoteByName(bitId.scope, consumer);\n loader.start('showing a component...');\n const component = await remote.show(bitId);\n let dependenciesInfo: DependenciesInfo[] = [];\n let dependentsInfo: DependenciesInfo[] = [];\n if (showDependents || showDependencies) {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const componentDepGraph = await remote.graph(component.id);\n if (showDependents) {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n dependentsInfo = componentDepGraph.getDependentsInfo(component.id);\n }\n if (showDependencies) {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n dependenciesInfo = componentDepGraph.getDependenciesInfo(component.id);\n }\n }\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return { component, dependentsInfo, dependenciesInfo };\n\n async function showComponentUsingScope(scope: Scope) {\n if (allVersions) {\n return scope.loadAllVersions(bitId);\n }\n const scopeComponentsImporter = scope.scopeImporter;\n return scopeComponentsImporter.loadRemoteComponent(bitId);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,iBAAA;EAAA,MAAAL,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAI,gBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,MAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;E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xE;EACF;EACA;EACA,OAAO;IAAEW,SAAS;IAAEU,cAAc;IAAED;EAAiB,CAAC;EAEtD,eAAeR,uBAAuBA,CAACH,KAAY,EAAE;IACnD,IAAIR,WAAW,EAAE;MACf,OAAOQ,KAAK,CAACiB,eAAe,CAACpB,KAAK,CAAC;IACrC;IACA,MAAMqB,uBAAuB,GAAGlB,KAAK,CAACmB,aAAa;IACnD,OAAOD,uBAAuB,CAACE,mBAAmB,CAACvB,KAAK,CAAC;EAC3D;AACF","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ export declare function show({ id, json, versions, remote, outdated, compare, detailed, dependents, dependencies, }: {
2
+ id: string;
3
+ json: boolean;
4
+ versions: boolean | null | undefined;
5
+ remote: boolean;
6
+ outdated: boolean;
7
+ compare: boolean;
8
+ detailed: boolean;
9
+ dependents: boolean;
10
+ dependencies: boolean;
11
+ }): Promise<{
12
+ component: import("@teambit/legacy/dist/consumer/component").default[] | import("@teambit/legacy/dist/consumer/component").default;
13
+ } | {
14
+ components: import("@teambit/legacy/dist/consumer/component").default[] | {
15
+ component: import("@teambit/legacy/dist/consumer/component").default;
16
+ componentModel: import("@teambit/legacy/dist/consumer/component").default;
17
+ dependentsInfo?: undefined;
18
+ dependenciesInfo?: undefined;
19
+ } | {
20
+ component: import("@teambit/legacy/dist/consumer/component").default;
21
+ dependentsInfo: import("@teambit/legacy/dist/scope/graph/scope-graph").DependenciesInfo[];
22
+ dependenciesInfo: import("@teambit/legacy/dist/scope/graph/scope-graph").DependenciesInfo[];
23
+ componentModel?: undefined;
24
+ } | {
25
+ component: import("@teambit/legacy/dist/consumer/component").default[] | import("@teambit/legacy/dist/consumer/component").default;
26
+ };
27
+ versions: true;
28
+ }>;
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.show = show;
7
+ function _getConsumerComponent() {
8
+ const data = require("./get-consumer-component");
9
+ _getConsumerComponent = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _getScopeComponent() {
15
+ const data = require("./get-scope-component");
16
+ _getScopeComponent = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _loader() {
22
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/cli/loader/loader"));
23
+ _loader = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
29
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
30
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
31
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
32
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
33
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
34
+ const BEFORE_SHOW_REMOTE = 'showing a component...';
35
+ async function show({
36
+ id,
37
+ json,
38
+ versions,
39
+ remote,
40
+ outdated,
41
+ compare,
42
+ detailed,
43
+ dependents,
44
+ dependencies
45
+ }) {
46
+ if (versions) {
47
+ const components = await getComponent(versions);
48
+ return {
49
+ components,
50
+ versions
51
+ };
52
+ }
53
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
54
+ return getComponent().then(({
55
+ component,
56
+ componentModel,
57
+ dependentsInfo,
58
+ dependenciesInfo
59
+ }) => ({
60
+ component,
61
+ componentModel,
62
+ dependentsInfo,
63
+ dependenciesInfo,
64
+ json,
65
+ outdated,
66
+ detailed
67
+ }));
68
+ function getComponent(allVersions) {
69
+ const params = {
70
+ id,
71
+ allVersions,
72
+ showRemoteVersions: outdated,
73
+ showDependents: dependents,
74
+ showDependencies: dependencies
75
+ };
76
+ if (remote) {
77
+ _loader().default.start(BEFORE_SHOW_REMOTE);
78
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
79
+ return (0, _getScopeComponent().getScopeComponent)(params);
80
+ }
81
+ return (0, _getConsumerComponent().getConsumerComponent)(_objectSpread(_objectSpread({}, params), {}, {
82
+ compare
83
+ }));
84
+ }
85
+ }
86
+
87
+ //# sourceMappingURL=legacy-show.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_getConsumerComponent","data","require","_getScopeComponent","_loader","_interopRequireDefault","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BEFORE_SHOW_REMOTE","show","id","json","versions","remote","outdated","compare","detailed","dependents","dependencies","components","getComponent","then","component","componentModel","dependentsInfo","dependenciesInfo","allVersions","params","showRemoteVersions","showDependents","showDependencies","loader","start","getScopeComponent","getConsumerComponent"],"sources":["legacy-show.ts"],"sourcesContent":["import { getConsumerComponent } from './get-consumer-component';\nimport { getScopeComponent } from './get-scope-component';\nimport loader from '@teambit/legacy/dist/cli/loader/loader';\n\nconst BEFORE_SHOW_REMOTE = 'showing a component...';\n\nexport async function show({\n id,\n json,\n versions,\n remote,\n outdated,\n compare,\n detailed,\n dependents,\n dependencies,\n}: {\n id: string;\n json: boolean;\n versions: boolean | null | undefined;\n remote: boolean;\n outdated: boolean;\n compare: boolean;\n detailed: boolean;\n dependents: boolean;\n dependencies: boolean;\n}) {\n if (versions) {\n const components = await getComponent(versions);\n return {\n components,\n versions,\n };\n }\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return getComponent().then(({ component, componentModel, dependentsInfo, dependenciesInfo }) => ({\n component,\n componentModel,\n dependentsInfo,\n dependenciesInfo,\n json,\n outdated,\n detailed,\n }));\n\n function getComponent(allVersions: boolean | null | undefined) {\n const params = {\n id,\n allVersions,\n showRemoteVersions: outdated,\n showDependents: dependents,\n showDependencies: dependencies,\n };\n if (remote) {\n loader.start(BEFORE_SHOW_REMOTE);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return getScopeComponent(params);\n }\n return getConsumerComponent({ ...params, compare });\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,sBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,qBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4D,SAAAI,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,QAAAH,CAAA,EAAAI,CAAA,QAAAC,CAAA,GAAAC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ACxB,kBAAkB,CAAC;MAChC;MACA,OAAO,IAAAyB,sCAAiB,EAACN,MAAM,CAAC;IAClC;IACA,OAAO,IAAAO,4CAAoB,EAAA9C,aAAA,CAAAA,aAAA,KAAMuC,MAAM;MAAEZ;IAAO,EAAE,CAAC;EACrD;AACF","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import { BitError } from '@teambit/bit-error';
2
+ export declare class NothingToCompareTo extends BitError {
3
+ id: string;
4
+ constructor(id: string);
5
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NothingToCompareTo = void 0;
7
+ function _bitError() {
8
+ const data = require("@teambit/bit-error");
9
+ _bitError = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ class NothingToCompareTo extends _bitError().BitError {
15
+ constructor(id) {
16
+ super('no previous versions to compare');
17
+ this.id = id;
18
+ }
19
+ }
20
+ exports.NothingToCompareTo = NothingToCompareTo;
21
+
22
+ //# sourceMappingURL=nothing-to-compare-to.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_bitError","data","require","NothingToCompareTo","BitError","constructor","id","exports"],"sources":["nothing-to-compare-to.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\n\nexport class NothingToCompareTo extends BitError {\n constructor(public id: string) {\n super('no previous versions to compare');\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,kBAAkB,SAASC,oBAAQ,CAAC;EAC/CC,WAAWA,CAAQC,EAAU,EAAE;IAC7B,KAAK,CAAC,iCAAiC,CAAC;IAAC,KADxBA,EAAU,GAAVA,EAAU;EAE7B;AACF;AAACC,OAAA,CAAAJ,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ import ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';
2
+ import { DependenciesInfo } from '@teambit/legacy/dist/scope/graph/scope-graph';
3
+ export declare function actionLegacy([id]: [string], { json, versions, remote, outdated, compare, detailed, dependents, dependencies, }: {
4
+ json?: boolean;
5
+ versions: boolean | null | undefined;
6
+ remote: boolean;
7
+ outdated?: boolean;
8
+ compare?: boolean;
9
+ detailed?: boolean;
10
+ dependents?: boolean;
11
+ dependencies?: boolean;
12
+ }): Promise<any>;
13
+ export declare function reportLegacy({ component, componentModel, dependenciesInfo, dependentsInfo, json, versions, components, outdated, detailed, }: {
14
+ component: ConsumerComponent;
15
+ componentModel?: ConsumerComponent;
16
+ dependenciesInfo: DependenciesInfo[];
17
+ dependentsInfo: DependenciesInfo[];
18
+ json: boolean | null | undefined;
19
+ versions: boolean | null | undefined;
20
+ components: ConsumerComponent[] | null | undefined;
21
+ outdated: boolean;
22
+ detailed: boolean;
23
+ }): string;
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.actionLegacy = actionLegacy;
7
+ exports.reportLegacy = reportLegacy;
8
+ function _bitError() {
9
+ const data = require("@teambit/bit-error");
10
+ _bitError = function () {
11
+ return data;
12
+ };
13
+ return data;
14
+ }
15
+ function _legacyShow() {
16
+ const data = require("./legacy-show");
17
+ _legacyShow = function () {
18
+ return data;
19
+ };
20
+ return data;
21
+ }
22
+ function _componentTemplate() {
23
+ const data = _interopRequireDefault(require("@teambit/legacy/dist/cli/templates/component-template"));
24
+ _componentTemplate = function () {
25
+ return data;
26
+ };
27
+ return data;
28
+ }
29
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
30
+ function actionLegacy([id], {
31
+ json,
32
+ versions,
33
+ remote = false,
34
+ outdated = false,
35
+ compare = false,
36
+ detailed = false,
37
+ dependents = false,
38
+ dependencies = false
39
+ }) {
40
+ if (versions && (compare || outdated)) {
41
+ throw new (_bitError().BitError)('the [--compare] or [--outdated] flag cannot be used along with --versions');
42
+ }
43
+ if (versions && remote) {
44
+ throw new (_bitError().BitError)('the [--versions] and [--remote] flags cannot be used together');
45
+ }
46
+ if (compare && outdated) {
47
+ throw new (_bitError().BitError)('the [--compare] and [--outdated] flags cannot be used together');
48
+ }
49
+ return (0, _legacyShow().show)({
50
+ id,
51
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
52
+ json,
53
+ versions,
54
+ remote,
55
+ outdated,
56
+ compare,
57
+ detailed,
58
+ dependents,
59
+ dependencies
60
+ });
61
+ }
62
+ function reportLegacy({
63
+ component,
64
+ componentModel,
65
+ dependenciesInfo,
66
+ dependentsInfo,
67
+ json,
68
+ versions,
69
+ components,
70
+ outdated,
71
+ detailed
72
+ }) {
73
+ if (versions) {
74
+ return JSON.stringify((components || []).map(c => c.toObject()), null, ' ');
75
+ }
76
+ if (component.componentFromModel) {
77
+ component.scopesList = component.componentFromModel.scopesList;
78
+ }
79
+ if (json) {
80
+ const makeComponentReadable = comp => {
81
+ if (!comp) return comp;
82
+ const componentObj = comp.toObject();
83
+ componentObj.files = comp.files.map(file => file.toReadableString());
84
+ if (comp.componentMap) {
85
+ componentObj.componentDir = comp.componentMap.getComponentDir();
86
+ }
87
+ return componentObj;
88
+ };
89
+ const componentFromFileSystem = makeComponentReadable(component);
90
+ if (dependenciesInfo) {
91
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
92
+ componentFromFileSystem.dependenciesInfo = dependenciesInfo;
93
+ }
94
+ if (dependentsInfo) {
95
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
96
+ componentFromFileSystem.dependentsInfo = dependentsInfo;
97
+ }
98
+ if (component.scopesList) {
99
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
100
+ componentFromFileSystem.scopesList = component.scopesList;
101
+ }
102
+ const componentFromModel = componentModel ? makeComponentReadable(componentModel) : undefined;
103
+ const jsonObject = componentFromModel ? {
104
+ componentFromFileSystem,
105
+ componentFromModel
106
+ } : componentFromFileSystem;
107
+ return JSON.stringify(jsonObject, null, ' ');
108
+ }
109
+ return (0, _componentTemplate().default)(component, componentModel, outdated, detailed, dependenciesInfo, dependentsInfo);
110
+ }
111
+
112
+ //# sourceMappingURL=show-legacy-cmd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_bitError","data","require","_legacyShow","_componentTemplate","_interopRequireDefault","e","__esModule","default","actionLegacy","id","json","versions","remote","outdated","compare","detailed","dependents","dependencies","BitError","show","reportLegacy","component","componentModel","dependenciesInfo","dependentsInfo","components","JSON","stringify","map","c","toObject","componentFromModel","scopesList","makeComponentReadable","comp","componentObj","files","file","toReadableString","componentMap","componentDir","getComponentDir","componentFromFileSystem","undefined","jsonObject","paintComponent"],"sources":["show-legacy-cmd.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { show } from './legacy-show';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { DependenciesInfo } from '@teambit/legacy/dist/scope/graph/scope-graph';\nimport paintComponent from '@teambit/legacy/dist/cli/templates/component-template';\n\nexport function actionLegacy(\n [id]: [string],\n {\n json,\n versions,\n remote = false,\n outdated = false,\n compare = false,\n detailed = false,\n dependents = false,\n dependencies = false,\n }: {\n json?: boolean;\n versions: boolean | null | undefined;\n remote: boolean;\n outdated?: boolean;\n compare?: boolean;\n detailed?: boolean;\n dependents?: boolean;\n dependencies?: boolean;\n }\n): Promise<any> {\n if (versions && (compare || outdated)) {\n throw new BitError('the [--compare] or [--outdated] flag cannot be used along with --versions');\n }\n if (versions && remote) {\n throw new BitError('the [--versions] and [--remote] flags cannot be used together');\n }\n if (compare && outdated) {\n throw new BitError('the [--compare] and [--outdated] flags cannot be used together');\n }\n\n return show({\n id,\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n json,\n versions,\n remote,\n outdated,\n compare,\n detailed,\n dependents,\n dependencies,\n });\n}\n\nexport function reportLegacy({\n component,\n componentModel,\n dependenciesInfo,\n dependentsInfo,\n json,\n versions,\n components,\n outdated,\n detailed,\n}: {\n component: ConsumerComponent;\n componentModel?: ConsumerComponent;\n dependenciesInfo: DependenciesInfo[];\n dependentsInfo: DependenciesInfo[];\n json: boolean | null | undefined;\n versions: boolean | null | undefined;\n components: ConsumerComponent[] | null | undefined;\n outdated: boolean;\n detailed: boolean;\n}): string {\n if (versions) {\n return JSON.stringify(\n (components || []).map((c) => c.toObject()),\n null,\n ' '\n );\n }\n if (component.componentFromModel) {\n component.scopesList = component.componentFromModel.scopesList;\n }\n if (json) {\n const makeComponentReadable = (comp: ConsumerComponent) => {\n if (!comp) return comp;\n const componentObj = comp.toObject();\n componentObj.files = comp.files.map((file) => file.toReadableString());\n\n if (comp.componentMap) {\n componentObj.componentDir = comp.componentMap.getComponentDir();\n }\n\n return componentObj;\n };\n const componentFromFileSystem = makeComponentReadable(component);\n if (dependenciesInfo) {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n componentFromFileSystem.dependenciesInfo = dependenciesInfo;\n }\n if (dependentsInfo) {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n componentFromFileSystem.dependentsInfo = dependentsInfo;\n }\n if (component.scopesList) {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n componentFromFileSystem.scopesList = component.scopesList;\n }\n const componentFromModel = componentModel ? makeComponentReadable(componentModel) : undefined;\n const jsonObject = componentFromModel ? { componentFromFileSystem, componentFromModel } : componentFromFileSystem;\n return JSON.stringify(jsonObject, null, ' ');\n }\n return paintComponent(component, componentModel, outdated, detailed, dependenciesInfo, dependentsInfo);\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,I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MAAEW,uBAAuB;MAAEX;IAAmB,CAAC,GAAGW,uBAAuB;IACjH,OAAOhB,IAAI,CAACC,SAAS,CAACiB,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC;EAC/C;EACA,OAAO,IAAAC,4BAAc,EAACxB,SAAS,EAAEC,cAAc,EAAET,QAAQ,EAAEE,QAAQ,EAAEQ,gBAAgB,EAAEC,cAAc,CAAC;AACxG","ignoreList":[]}
@@ -39,9 +39,9 @@ function _componentId() {
39
39
  };
40
40
  return data;
41
41
  }
42
- function _showCmd() {
43
- const data = _interopRequireDefault(require("@teambit/legacy/dist/cli/commands/public-cmds/show-cmd"));
44
- _showCmd = function () {
42
+ function _showLegacyCmd() {
43
+ const data = require("./show-legacy-cmd");
44
+ _showLegacyCmd = function () {
45
45
  return data;
46
46
  };
47
47
  return data;
@@ -84,14 +84,13 @@ to see the legacy bit show, please use "--legacy" flag`);
84
84
  return component;
85
85
  }
86
86
  async useLegacy(id, json = false, remote = false, compare = false) {
87
- const legacyShow = new (_showCmd().default)();
88
- const showData = await legacyShow.action([id], {
87
+ const showData = await (0, _showLegacyCmd().actionLegacy)([id], {
89
88
  json,
90
89
  versions: undefined,
91
90
  remote,
92
91
  compare
93
92
  });
94
- return legacyShow.report(showData);
93
+ return (0, _showLegacyCmd().reportLegacy)(showData);
95
94
  }
96
95
  async report([idStr], {
97
96
  legacy,