@teambit/component 1.0.508 → 1.0.509
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/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_component_component-preview.js +1 -1
- package/artifacts/schema.json +13 -13
- package/dist/{preview-1736535915537.js → preview-1736565522692.js} +2 -2
- package/dist/show/legacy-show/get-consumer-component.d.ts +2 -3
- package/dist/show/legacy-show/get-consumer-component.js +1 -5
- package/dist/show/legacy-show/get-consumer-component.js.map +1 -1
- package/dist/show/legacy-show/get-scope-component.d.ts +1 -2
- package/dist/show/legacy-show/get-scope-component.js +0 -4
- package/dist/show/legacy-show/get-scope-component.js.map +1 -1
- package/dist/show/legacy-show/legacy-show.d.ts +5 -1
- package/dist/show/legacy-show/legacy-show.js +2 -4
- package/dist/show/legacy-show/legacy-show.js.map +1 -1
- package/package.json +30 -30
- package/show/legacy-show/get-consumer-component.ts +1 -12
- package/show/legacy-show/get-scope-component.ts +0 -5
- package/show/legacy-show/legacy-show.ts +1 -3
package/artifacts/schema.json
CHANGED
|
@@ -2712,7 +2712,7 @@
|
|
|
2712
2712
|
"_legacy": {
|
|
2713
2713
|
"scope": "teambit.component",
|
|
2714
2714
|
"name": "component",
|
|
2715
|
-
"version": "1.0.
|
|
2715
|
+
"version": "1.0.509"
|
|
2716
2716
|
},
|
|
2717
2717
|
"_scope": "teambit.component"
|
|
2718
2718
|
}
|
|
@@ -2853,7 +2853,7 @@
|
|
|
2853
2853
|
"componentId": {
|
|
2854
2854
|
"scope": "teambit.legacy",
|
|
2855
2855
|
"name": "extension-data",
|
|
2856
|
-
"version": "0.0.
|
|
2856
|
+
"version": "0.0.18"
|
|
2857
2857
|
}
|
|
2858
2858
|
}
|
|
2859
2859
|
}
|
|
@@ -6402,7 +6402,7 @@
|
|
|
6402
6402
|
"componentId": {
|
|
6403
6403
|
"scope": "teambit.legacy",
|
|
6404
6404
|
"name": "extension-data",
|
|
6405
|
-
"version": "0.0.
|
|
6405
|
+
"version": "0.0.18"
|
|
6406
6406
|
}
|
|
6407
6407
|
},
|
|
6408
6408
|
"modifiers": []
|
|
@@ -6607,7 +6607,7 @@
|
|
|
6607
6607
|
"componentId": {
|
|
6608
6608
|
"scope": "teambit.legacy",
|
|
6609
6609
|
"name": "extension-data",
|
|
6610
|
-
"version": "0.0.
|
|
6610
|
+
"version": "0.0.18"
|
|
6611
6611
|
}
|
|
6612
6612
|
}
|
|
6613
6613
|
},
|
|
@@ -8753,7 +8753,7 @@
|
|
|
8753
8753
|
"_legacy": {
|
|
8754
8754
|
"scope": "teambit.component",
|
|
8755
8755
|
"name": "component",
|
|
8756
|
-
"version": "1.0.
|
|
8756
|
+
"version": "1.0.509"
|
|
8757
8757
|
},
|
|
8758
8758
|
"_scope": "teambit.component"
|
|
8759
8759
|
}
|
|
@@ -15706,7 +15706,7 @@
|
|
|
15706
15706
|
"componentId": {
|
|
15707
15707
|
"scope": "teambit.legacy",
|
|
15708
15708
|
"name": "extension-data",
|
|
15709
|
-
"version": "0.0.
|
|
15709
|
+
"version": "0.0.18"
|
|
15710
15710
|
}
|
|
15711
15711
|
}
|
|
15712
15712
|
}
|
|
@@ -20029,7 +20029,7 @@
|
|
|
20029
20029
|
"_legacy": {
|
|
20030
20030
|
"scope": "teambit.component",
|
|
20031
20031
|
"name": "component",
|
|
20032
|
-
"version": "1.0.
|
|
20032
|
+
"version": "1.0.509"
|
|
20033
20033
|
},
|
|
20034
20034
|
"_scope": "teambit.component"
|
|
20035
20035
|
}
|
|
@@ -20170,7 +20170,7 @@
|
|
|
20170
20170
|
"componentId": {
|
|
20171
20171
|
"scope": "teambit.legacy",
|
|
20172
20172
|
"name": "extension-data",
|
|
20173
|
-
"version": "0.0.
|
|
20173
|
+
"version": "0.0.18"
|
|
20174
20174
|
}
|
|
20175
20175
|
}
|
|
20176
20176
|
}
|
|
@@ -23690,7 +23690,7 @@
|
|
|
23690
23690
|
"componentId": {
|
|
23691
23691
|
"scope": "teambit.legacy",
|
|
23692
23692
|
"name": "extension-data",
|
|
23693
|
-
"version": "0.0.
|
|
23693
|
+
"version": "0.0.18"
|
|
23694
23694
|
}
|
|
23695
23695
|
},
|
|
23696
23696
|
"modifiers": []
|
|
@@ -24162,7 +24162,7 @@
|
|
|
24162
24162
|
"componentId": {
|
|
24163
24163
|
"scope": "teambit.legacy",
|
|
24164
24164
|
"name": "extension-data",
|
|
24165
|
-
"version": "0.0.
|
|
24165
|
+
"version": "0.0.18"
|
|
24166
24166
|
}
|
|
24167
24167
|
}
|
|
24168
24168
|
},
|
|
@@ -25445,7 +25445,7 @@
|
|
|
25445
25445
|
"_legacy": {
|
|
25446
25446
|
"scope": "teambit.component",
|
|
25447
25447
|
"name": "component",
|
|
25448
|
-
"version": "1.0.
|
|
25448
|
+
"version": "1.0.509"
|
|
25449
25449
|
},
|
|
25450
25450
|
"_scope": "teambit.component"
|
|
25451
25451
|
}
|
|
@@ -31853,7 +31853,7 @@
|
|
|
31853
31853
|
"_legacy": {
|
|
31854
31854
|
"scope": "teambit.component",
|
|
31855
31855
|
"name": "component",
|
|
31856
|
-
"version": "1.0.
|
|
31856
|
+
"version": "1.0.509"
|
|
31857
31857
|
},
|
|
31858
31858
|
"_scope": "teambit.component"
|
|
31859
31859
|
}
|
|
@@ -34299,7 +34299,7 @@
|
|
|
34299
34299
|
"componentId": {
|
|
34300
34300
|
"scope": "teambit.component",
|
|
34301
34301
|
"name": "component",
|
|
34302
|
-
"version": "1.0.
|
|
34302
|
+
"version": "1.0.509"
|
|
34303
34303
|
},
|
|
34304
34304
|
"taggedModuleExports": []
|
|
34305
34305
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component@1.0.509/dist/component.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component@1.0.509/dist/component.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export declare function getConsumerComponent({ id, compare
|
|
1
|
+
export declare function getConsumerComponent({ id, compare }: {
|
|
2
2
|
id: string;
|
|
3
3
|
compare: boolean;
|
|
4
|
-
|
|
5
|
-
}): Promise<import("@teambit/legacy.consumer-component").ConsumerComponent[] | {
|
|
4
|
+
}): Promise<{
|
|
6
5
|
component: import("@teambit/legacy.consumer-component").ConsumerComponent;
|
|
7
6
|
componentModel: import("@teambit/legacy.consumer-component").ConsumerComponent;
|
|
8
7
|
} | {
|
|
@@ -20,14 +20,10 @@ function _nothingToCompareTo() {
|
|
|
20
20
|
}
|
|
21
21
|
async function getConsumerComponent({
|
|
22
22
|
id,
|
|
23
|
-
compare
|
|
24
|
-
allVersions
|
|
23
|
+
compare
|
|
25
24
|
}) {
|
|
26
25
|
const consumer = await (0, _legacy().loadConsumer)();
|
|
27
26
|
const bitId = consumer.getParsedId(id);
|
|
28
|
-
if (allVersions) {
|
|
29
|
-
return consumer.loadAllVersionsOfComponentFromModel(bitId);
|
|
30
|
-
}
|
|
31
27
|
const component = await consumer.loadComponent(bitId); // loads recent component
|
|
32
28
|
if (compare) {
|
|
33
29
|
if (!component.componentFromModel) throw new (_nothingToCompareTo().NothingToCompareTo)(id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_legacy","data","require","_nothingToCompareTo","getConsumerComponent","id","compare","
|
|
1
|
+
{"version":3,"names":["_legacy","data","require","_nothingToCompareTo","getConsumerComponent","id","compare","consumer","loadConsumer","bitId","getParsedId","component","loadComponent","componentFromModel","NothingToCompareTo","componentModel","onDestroy"],"sources":["get-consumer-component.ts"],"sourcesContent":["import { Consumer, loadConsumer } from '@teambit/legacy.consumer';\nimport { NothingToCompareTo } from './nothing-to-compare-to';\n\nexport async function getConsumerComponent({ id, compare }: { id: string; compare: boolean }) {\n const consumer: Consumer = await loadConsumer();\n const bitId = consumer.getParsedId(id);\n const component = await consumer.loadComponent(bitId); // loads recent component\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 };\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,oBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,mBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,eAAeG,oBAAoBA,CAAC;EAAEC,EAAE;EAAEC;AAA0C,CAAC,EAAE;EAC5F,MAAMC,QAAkB,GAAG,MAAM,IAAAC,sBAAY,EAAC,CAAC;EAC/C,MAAMC,KAAK,GAAGF,QAAQ,CAACG,WAAW,CAACL,EAAE,CAAC;EACtC,MAAMM,SAAS,GAAG,MAAMJ,QAAQ,CAACK,aAAa,CAACH,KAAK,CAAC,CAAC,CAAC;EACvD,IAAIH,OAAO,EAAE;IACX,IAAI,CAACK,SAAS,CAACE,kBAAkB,EAAE,MAAM,KAAIC,wCAAkB,EAACT,EAAE,CAAC;IACnE,OAAO;MAAEM,SAAS;MAAEI,cAAc,EAAEJ,SAAS,CAACE;IAAmB,CAAC;EACpE;EACA,MAAMN,QAAQ,CAACS,SAAS,CAAC,eAAe,CAAC;EACzC,OAAO;IAAEL;EAAU,CAAC;AACtB","ignoreList":[]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ConsumerComponent as Component } from '@teambit/legacy.consumer-component';
|
|
2
|
-
export declare function getScopeComponent({ id,
|
|
2
|
+
export declare function getScopeComponent({ id, scopePath, showDependents, showDependencies, loadScopeFromCache, }: {
|
|
3
3
|
id: string;
|
|
4
|
-
allVersions?: boolean | null;
|
|
5
4
|
scopePath?: string | null;
|
|
6
5
|
showDependents?: boolean;
|
|
7
6
|
showDependencies?: boolean;
|
|
@@ -41,7 +41,6 @@ function _legacy3() {
|
|
|
41
41
|
}
|
|
42
42
|
async function getScopeComponent({
|
|
43
43
|
id,
|
|
44
|
-
allVersions,
|
|
45
44
|
scopePath,
|
|
46
45
|
showDependents,
|
|
47
46
|
showDependencies,
|
|
@@ -82,9 +81,6 @@ async function getScopeComponent({
|
|
|
82
81
|
dependenciesInfo
|
|
83
82
|
};
|
|
84
83
|
async function showComponentUsingScope(scope) {
|
|
85
|
-
if (allVersions) {
|
|
86
|
-
return scope.loadAllVersions(bitId);
|
|
87
|
-
}
|
|
88
84
|
const scopeComponentsImporter = scope.scopeImporter;
|
|
89
85
|
return scopeComponentsImporter.loadRemoteComponent(bitId);
|
|
90
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_componentId","data","require","_legacy","_legacy2","_scope","_legacy3","getScopeComponent","id","
|
|
1
|
+
{"version":3,"names":["_componentId","data","require","_legacy","_legacy2","_scope","_legacy3","getScopeComponent","id","scopePath","showDependents","showDependencies","loadScopeFromCache","bitId","ComponentID","fromString","scope","loadScope","component","showComponentUsingScope","consumer","loadConsumerIfExist","remote","getRemoteByName","loader","start","show","dependenciesInfo","dependentsInfo","componentDepGraph","graph","getDependentsInfo","getDependenciesInfo","scopeComponentsImporter","scopeImporter","loadRemoteComponent"],"sources":["get-scope-component.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component-id';\nimport { loader } from '@teambit/legacy.loader';\nimport { Consumer, loadConsumerIfExist } from '@teambit/legacy.consumer';\nimport { ConsumerComponent as Component } from '@teambit/legacy.consumer-component';\nimport { getRemoteByName } from '@teambit/scope.remotes';\nimport { loadScope, Scope } from '@teambit/legacy.scope';\nimport { DependenciesInfo } from '@teambit/legacy.dependency-graph';\n\nexport async function getScopeComponent({\n id,\n scopePath,\n showDependents,\n showDependencies,\n loadScopeFromCache,\n}: {\n id: string;\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 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,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AAgB,EAAE;IACtC;IACA,MAAMkB,iBAAiB,GAAG,MAAMP,MAAM,CAACQ,KAAK,CAACZ,SAAS,CAACV,EAAE,CAAC;IAC1D,IAAIE,cAAc,EAAE;MAClB;MACAkB,cAAc,GAAGC,iBAAiB,CAACE,iBAAiB,CAACb,SAAS,CAACV,EAAE,CAAC;IACpE;IACA,IAAIG,gBAAgB,EAAE;MACpB;MACAgB,gBAAgB,GAAGE,iBAAiB,CAACG,mBAAmB,CAACd,SAAS,CAACV,EAAE,CAAC;IACxE;EACF;EACA;EACA,OAAO;IAAEU,SAAS;IAAEU,cAAc;IAAED;EAAiB,CAAC;EAEtD,eAAeR,uBAAuBA,CAACH,KAAY,EAAE;IACnD,MAAMiB,uBAAuB,GAAGjB,KAAK,CAACkB,aAAa;IACnD,OAAOD,uBAAuB,CAACE,mBAAmB,CAACtB,KAAK,CAAC;EAC3D;AACF","ignoreList":[]}
|
|
@@ -4,5 +4,9 @@ export declare function show({ id, json, remote, compare, }: {
|
|
|
4
4
|
remote: boolean;
|
|
5
5
|
compare: boolean;
|
|
6
6
|
}): Promise<{
|
|
7
|
-
component: import("@teambit/legacy.consumer-component").ConsumerComponent
|
|
7
|
+
component: import("@teambit/legacy.consumer-component").ConsumerComponent | import("@teambit/legacy.consumer-component").ConsumerComponent[];
|
|
8
|
+
componentModel: any;
|
|
9
|
+
dependentsInfo: any;
|
|
10
|
+
dependenciesInfo: any;
|
|
11
|
+
json: boolean;
|
|
8
12
|
}>;
|
|
@@ -50,14 +50,12 @@ async function show({
|
|
|
50
50
|
dependenciesInfo,
|
|
51
51
|
json
|
|
52
52
|
}));
|
|
53
|
-
function getComponent(
|
|
53
|
+
function getComponent() {
|
|
54
54
|
const params = {
|
|
55
|
-
id
|
|
56
|
-
allVersions
|
|
55
|
+
id
|
|
57
56
|
};
|
|
58
57
|
if (remote) {
|
|
59
58
|
_legacy().loader.start(BEFORE_SHOW_REMOTE);
|
|
60
|
-
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
61
59
|
return (0, _getScopeComponent().getScopeComponent)(params);
|
|
62
60
|
}
|
|
63
61
|
return (0, _getConsumerComponent().getConsumerComponent)(_objectSpread(_objectSpread({}, params), {}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_getConsumerComponent","data","require","_getScopeComponent","_legacy","ownKeys","e","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","remote","compare","getComponent","then","component","componentModel","dependentsInfo","dependenciesInfo","
|
|
1
|
+
{"version":3,"names":["_getConsumerComponent","data","require","_getScopeComponent","_legacy","ownKeys","e","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","remote","compare","getComponent","then","component","componentModel","dependentsInfo","dependenciesInfo","params","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.loader';\n\nconst BEFORE_SHOW_REMOTE = 'showing a component...';\n\nexport async function show({\n id,\n json,\n remote,\n compare,\n}: {\n id: string;\n json: boolean;\n remote: boolean;\n compare: boolean;\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 }));\n\n function getComponent() {\n const params = {\n id,\n };\n if (remote) {\n loader.start(BEFORE_SHOW_REMOTE);\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,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgD,SAAAI,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,IAAAe,eAAA,CAAAhB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA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C,cAAc;IAAEC;EAAiB,CAAC,MAAM;IAC/FH,SAAS;IACTC,cAAc;IACdC,cAAc;IACdC,gBAAgB;IAChBR;EACF,CAAC,CAAC,CAAC;EAEH,SAASG,YAAYA,CAAA,EAAG;IACtB,MAAMM,MAAM,GAAG;MACbV;IACF,CAAC;IACD,IAAIE,MAAM,EAAE;MACVS,gBAAM,CAACC,KAAK,CAACd,kBAAkB,CAAC;MAChC,OAAO,IAAAe,sCAAiB,EAACH,MAAM,CAAC;IAClC;IACA,OAAO,IAAAI,4CAAoB,EAAApC,aAAA,CAAAA,aAAA,KAAMgC,MAAM;MAAEP;IAAO,EAAE,CAAC;EACrD;AACF","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/component",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.509",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/component",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "component",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.509"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/any-fs": "0.0.5",
|
|
@@ -36,58 +36,58 @@
|
|
|
36
36
|
"@teambit/ui-foundation.ui.use-box.menu": "1.0.15",
|
|
37
37
|
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.506",
|
|
38
38
|
"@teambit/ui-foundation.ui.react-router.use-query": "0.0.501",
|
|
39
|
+
"@teambit/design.ui.pages.not-found": "0.0.371",
|
|
40
|
+
"@teambit/design.ui.pages.server-error": "0.0.368",
|
|
39
41
|
"@teambit/design.ui.empty-box": "0.0.363",
|
|
40
42
|
"@teambit/documenter.ui.heading": "4.1.1",
|
|
41
43
|
"@teambit/documenter.ui.separator": "4.1.1",
|
|
42
|
-
"@teambit/design.ui.pages.not-found": "0.0.371",
|
|
43
|
-
"@teambit/design.ui.pages.server-error": "0.0.368",
|
|
44
44
|
"@teambit/design.ui.styles.ellipsis": "0.0.357",
|
|
45
45
|
"@teambit/explorer.ui.command-bar": "2.0.16",
|
|
46
46
|
"@teambit/design.navigation.responsive-navbar": "0.0.8",
|
|
47
47
|
"@teambit/base-ui.layout.breakpoints": "1.0.0",
|
|
48
48
|
"@teambit/lanes.ui.models.lanes-model": "0.0.221",
|
|
49
49
|
"@teambit/ui-foundation.ui.use-box.dropdown": "0.0.143",
|
|
50
|
-
"@teambit/legacy.extension-data": "0.0.
|
|
51
|
-
"@teambit/aspect-loader": "1.0.
|
|
52
|
-
"@teambit/dependency-resolver": "1.0.
|
|
53
|
-
"@teambit/graph": "1.0.
|
|
54
|
-
"@teambit/legacy.consumer-component": "0.0.
|
|
55
|
-
"@teambit/scope.objects": "0.0.
|
|
56
|
-
"@teambit/component.sources": "0.0.
|
|
50
|
+
"@teambit/legacy.extension-data": "0.0.18",
|
|
51
|
+
"@teambit/aspect-loader": "1.0.509",
|
|
52
|
+
"@teambit/dependency-resolver": "1.0.509",
|
|
53
|
+
"@teambit/graph": "1.0.509",
|
|
54
|
+
"@teambit/legacy.consumer-component": "0.0.17",
|
|
55
|
+
"@teambit/scope.objects": "0.0.16",
|
|
56
|
+
"@teambit/component.sources": "0.0.68",
|
|
57
57
|
"@teambit/toolbox.path.match-patterns": "0.0.16",
|
|
58
58
|
"@teambit/toolbox.string.eol": "0.0.2",
|
|
59
59
|
"@teambit/toolbox.string.capitalize": "0.0.497",
|
|
60
|
-
"@teambit/graphql": "1.0.
|
|
60
|
+
"@teambit/graphql": "1.0.509",
|
|
61
61
|
"@teambit/toolbox.path.path": "0.0.5",
|
|
62
|
-
"@teambit/cli": "0.0.
|
|
63
|
-
"@teambit/express": "0.0.
|
|
64
|
-
"@teambit/logger": "0.0.
|
|
62
|
+
"@teambit/cli": "0.0.1086",
|
|
63
|
+
"@teambit/express": "0.0.1185",
|
|
64
|
+
"@teambit/logger": "0.0.1179",
|
|
65
65
|
"@teambit/legacy.constants": "0.0.4",
|
|
66
|
-
"@teambit/command-bar": "1.0.
|
|
66
|
+
"@teambit/command-bar": "1.0.509",
|
|
67
67
|
"@teambit/component-package-version": "0.0.434",
|
|
68
|
-
"@teambit/preview": "1.0.
|
|
69
|
-
"@teambit/pubsub": "1.0.
|
|
70
|
-
"@teambit/react-router": "1.0.
|
|
68
|
+
"@teambit/preview": "1.0.509",
|
|
69
|
+
"@teambit/pubsub": "1.0.509",
|
|
70
|
+
"@teambit/react-router": "1.0.509",
|
|
71
71
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.513",
|
|
72
|
-
"@teambit/ui": "1.0.
|
|
72
|
+
"@teambit/ui": "1.0.509",
|
|
73
73
|
"@teambit/legacy.utils": "0.0.12",
|
|
74
74
|
"@teambit/component-issues": "0.0.152",
|
|
75
75
|
"@teambit/pkg.modules.semver-helper": "0.0.3",
|
|
76
76
|
"@teambit/cli-table": "0.0.49",
|
|
77
|
-
"@teambit/legacy.bit-map": "0.0.
|
|
77
|
+
"@teambit/legacy.bit-map": "0.0.73",
|
|
78
78
|
"@teambit/legacy-component-log": "0.0.404",
|
|
79
79
|
"@teambit/component-descriptor": "0.0.430",
|
|
80
|
-
"@teambit/semantics.doc-parser": "0.0.
|
|
81
|
-
"@teambit/legacy.consumer": "0.0.
|
|
82
|
-
"@teambit/legacy.dependency-graph": "0.0.
|
|
80
|
+
"@teambit/semantics.doc-parser": "0.0.24",
|
|
81
|
+
"@teambit/legacy.consumer": "0.0.16",
|
|
82
|
+
"@teambit/legacy.dependency-graph": "0.0.19",
|
|
83
83
|
"@teambit/legacy.loader": "0.0.4",
|
|
84
|
-
"@teambit/legacy.scope": "0.0.
|
|
85
|
-
"@teambit/scope.remotes": "0.0.
|
|
86
|
-
"@teambit/legacy.component-diff": "0.0.
|
|
84
|
+
"@teambit/legacy.scope": "0.0.16",
|
|
85
|
+
"@teambit/scope.remotes": "0.0.16",
|
|
86
|
+
"@teambit/legacy.component-diff": "0.0.69",
|
|
87
87
|
"@teambit/harmony.ui.aspect-box": "0.0.508",
|
|
88
|
-
"@teambit/compositions": "1.0.
|
|
89
|
-
"@teambit/deprecation": "1.0.
|
|
90
|
-
"@teambit/envs": "1.0.
|
|
88
|
+
"@teambit/compositions": "1.0.509",
|
|
89
|
+
"@teambit/deprecation": "1.0.509",
|
|
90
|
+
"@teambit/envs": "1.0.509",
|
|
91
91
|
"@teambit/envs.ui.env-icon": "0.0.506",
|
|
92
92
|
"@teambit/workspace.ui.use-workspace-mode": "0.0.2",
|
|
93
93
|
"@teambit/component.ui.version-dropdown": "0.0.875",
|
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
import { Consumer, loadConsumer } from '@teambit/legacy.consumer';
|
|
2
2
|
import { NothingToCompareTo } from './nothing-to-compare-to';
|
|
3
3
|
|
|
4
|
-
export async function getConsumerComponent({
|
|
5
|
-
id,
|
|
6
|
-
compare,
|
|
7
|
-
allVersions,
|
|
8
|
-
}: {
|
|
9
|
-
id: string;
|
|
10
|
-
compare: boolean;
|
|
11
|
-
allVersions: boolean | null | undefined;
|
|
12
|
-
}) {
|
|
4
|
+
export async function getConsumerComponent({ id, compare }: { id: string; compare: boolean }) {
|
|
13
5
|
const consumer: Consumer = await loadConsumer();
|
|
14
6
|
const bitId = consumer.getParsedId(id);
|
|
15
|
-
if (allVersions) {
|
|
16
|
-
return consumer.loadAllVersionsOfComponentFromModel(bitId);
|
|
17
|
-
}
|
|
18
7
|
const component = await consumer.loadComponent(bitId); // loads recent component
|
|
19
8
|
if (compare) {
|
|
20
9
|
if (!component.componentFromModel) throw new NothingToCompareTo(id);
|
|
@@ -8,14 +8,12 @@ import { DependenciesInfo } from '@teambit/legacy.dependency-graph';
|
|
|
8
8
|
|
|
9
9
|
export async function getScopeComponent({
|
|
10
10
|
id,
|
|
11
|
-
allVersions,
|
|
12
11
|
scopePath,
|
|
13
12
|
showDependents,
|
|
14
13
|
showDependencies,
|
|
15
14
|
loadScopeFromCache,
|
|
16
15
|
}: {
|
|
17
16
|
id: string;
|
|
18
|
-
allVersions?: boolean | null;
|
|
19
17
|
scopePath?: string | null; // used by the api (see /src/api.js)
|
|
20
18
|
showDependents?: boolean;
|
|
21
19
|
showDependencies?: boolean;
|
|
@@ -52,9 +50,6 @@ export async function getScopeComponent({
|
|
|
52
50
|
return { component, dependentsInfo, dependenciesInfo };
|
|
53
51
|
|
|
54
52
|
async function showComponentUsingScope(scope: Scope) {
|
|
55
|
-
if (allVersions) {
|
|
56
|
-
return scope.loadAllVersions(bitId);
|
|
57
|
-
}
|
|
58
53
|
const scopeComponentsImporter = scope.scopeImporter;
|
|
59
54
|
return scopeComponentsImporter.loadRemoteComponent(bitId);
|
|
60
55
|
}
|
|
@@ -24,14 +24,12 @@ export async function show({
|
|
|
24
24
|
json,
|
|
25
25
|
}));
|
|
26
26
|
|
|
27
|
-
function getComponent(
|
|
27
|
+
function getComponent() {
|
|
28
28
|
const params = {
|
|
29
29
|
id,
|
|
30
|
-
allVersions,
|
|
31
30
|
};
|
|
32
31
|
if (remote) {
|
|
33
32
|
loader.start(BEFORE_SHOW_REMOTE);
|
|
34
|
-
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
35
33
|
return getScopeComponent(params);
|
|
36
34
|
}
|
|
37
35
|
return getConsumerComponent({ ...params, compare });
|