@teambit/component 1.0.321 → 1.0.323
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 +6 -6
- package/dist/{preview-1719751947574.js → preview-1719976973592.js} +2 -2
- package/dist/show/legacy-show/docs-template.d.ts +4 -0
- package/dist/show/legacy-show/docs-template.js +97 -0
- package/dist/show/legacy-show/docs-template.js.map +1 -0
- package/dist/show/{get-consumer-component.d.ts → legacy-show/get-consumer-component.d.ts} +1 -9
- package/dist/show/legacy-show/get-consumer-component.js +45 -0
- package/dist/show/legacy-show/get-consumer-component.js.map +1 -0
- package/dist/show/legacy-show/legacy-show.d.ts +8 -0
- package/dist/show/{legacy-show.js → legacy-show/legacy-show.js} +3 -20
- package/dist/show/legacy-show/legacy-show.js.map +1 -0
- package/dist/show/legacy-show/show-legacy-cmd.d.ts +11 -0
- package/dist/show/legacy-show/show-legacy-cmd.js +206 -0
- package/dist/show/legacy-show/show-legacy-cmd.js.map +1 -0
- package/dist/show/show.cmd.js +1 -2
- package/dist/show/show.cmd.js.map +1 -1
- package/package.json +23 -17
- package/show/legacy-show/docs-template.ts +76 -0
- package/show/legacy-show/get-consumer-component.ts +25 -0
- package/show/{legacy-show.ts → legacy-show/legacy-show.ts} +0 -22
- package/show/legacy-show/show-legacy-cmd.ts +218 -0
- package/show/show.cmd.ts +1 -2
- package/dist/show/get-consumer-component.js +0 -75
- package/dist/show/get-consumer-component.js.map +0 -1
- package/dist/show/legacy-show.d.ts +0 -28
- package/dist/show/legacy-show.js.map +0 -1
- package/dist/show/show-legacy-cmd.d.ts +0 -23
- package/dist/show/show-legacy-cmd.js +0 -112
- package/dist/show/show-legacy-cmd.js.map +0 -1
- package/show/get-consumer-component.ts +0 -49
- package/show/show-legacy-cmd.ts +0 -114
- /package/dist/show/{get-scope-component.d.ts → legacy-show/get-scope-component.d.ts} +0 -0
- /package/dist/show/{get-scope-component.js → legacy-show/get-scope-component.js} +0 -0
- /package/dist/show/{get-scope-component.js.map → legacy-show/get-scope-component.js.map} +0 -0
- /package/dist/show/{nothing-to-compare-to.d.ts → legacy-show/nothing-to-compare-to.d.ts} +0 -0
- /package/dist/show/{nothing-to-compare-to.js → legacy-show/nothing-to-compare-to.js} +0 -0
- /package/dist/show/{nothing-to-compare-to.js.map → legacy-show/nothing-to-compare-to.js.map} +0 -0
- /package/show/{get-scope-component.ts → legacy-show/get-scope-component.ts} +0 -0
- /package/show/{nothing-to-compare-to.ts → legacy-show/nothing-to-compare-to.ts} +0 -0
|
@@ -1,112 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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":"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","ignoreList":[]}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Consumer, loadConsumer } from '@teambit/legacy/dist/consumer';
|
|
2
|
-
import DependencyGraph, { DependenciesInfo } from '@teambit/legacy/dist/scope/graph/scope-graph';
|
|
3
|
-
import { NothingToCompareTo } from './nothing-to-compare-to';
|
|
4
|
-
|
|
5
|
-
export async function getConsumerComponent({
|
|
6
|
-
id,
|
|
7
|
-
compare,
|
|
8
|
-
allVersions,
|
|
9
|
-
showRemoteVersions,
|
|
10
|
-
showDependents,
|
|
11
|
-
showDependencies,
|
|
12
|
-
}: {
|
|
13
|
-
id: string;
|
|
14
|
-
compare: boolean;
|
|
15
|
-
allVersions: boolean | null | undefined;
|
|
16
|
-
showRemoteVersions: boolean;
|
|
17
|
-
showDependents: boolean;
|
|
18
|
-
showDependencies: boolean;
|
|
19
|
-
}) {
|
|
20
|
-
const consumer: Consumer = await loadConsumer();
|
|
21
|
-
const bitId = consumer.getParsedId(id);
|
|
22
|
-
if (allVersions) {
|
|
23
|
-
return consumer.loadAllVersionsOfComponentFromModel(bitId);
|
|
24
|
-
}
|
|
25
|
-
const component = await consumer.loadComponent(bitId); // loads recent component
|
|
26
|
-
let dependenciesInfo: DependenciesInfo[] = [];
|
|
27
|
-
let dependentsInfo: DependenciesInfo[] = [];
|
|
28
|
-
if (showDependents || showDependencies) {
|
|
29
|
-
const graph = await DependencyGraph.buildGraphFromWorkspace(consumer);
|
|
30
|
-
const dependencyGraph = new DependencyGraph(graph);
|
|
31
|
-
const componentGraph = dependencyGraph.getSubGraphOfConnectedComponents(component.id);
|
|
32
|
-
const componentDepGraph = new DependencyGraph(componentGraph);
|
|
33
|
-
if (showDependents) {
|
|
34
|
-
dependentsInfo = componentDepGraph.getDependentsInfo(component.id);
|
|
35
|
-
}
|
|
36
|
-
if (showDependencies) {
|
|
37
|
-
dependenciesInfo = componentDepGraph.getDependenciesInfo(component.id);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (showRemoteVersions) {
|
|
41
|
-
await consumer.addRemoteAndLocalVersionsToDependencies(component, true);
|
|
42
|
-
}
|
|
43
|
-
if (compare) {
|
|
44
|
-
if (!component.componentFromModel) throw new NothingToCompareTo(id);
|
|
45
|
-
return { component, componentModel: component.componentFromModel };
|
|
46
|
-
}
|
|
47
|
-
await consumer.onDestroy('get-component');
|
|
48
|
-
return { component, dependentsInfo, dependenciesInfo };
|
|
49
|
-
}
|
package/show/show-legacy-cmd.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { BitError } from '@teambit/bit-error';
|
|
2
|
-
import { show } from './legacy-show';
|
|
3
|
-
import ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';
|
|
4
|
-
import { DependenciesInfo } from '@teambit/legacy/dist/scope/graph/scope-graph';
|
|
5
|
-
import paintComponent from '@teambit/legacy/dist/cli/templates/component-template';
|
|
6
|
-
|
|
7
|
-
export function actionLegacy(
|
|
8
|
-
[id]: [string],
|
|
9
|
-
{
|
|
10
|
-
json,
|
|
11
|
-
versions,
|
|
12
|
-
remote = false,
|
|
13
|
-
outdated = false,
|
|
14
|
-
compare = false,
|
|
15
|
-
detailed = false,
|
|
16
|
-
dependents = false,
|
|
17
|
-
dependencies = false,
|
|
18
|
-
}: {
|
|
19
|
-
json?: boolean;
|
|
20
|
-
versions: boolean | null | undefined;
|
|
21
|
-
remote: boolean;
|
|
22
|
-
outdated?: boolean;
|
|
23
|
-
compare?: boolean;
|
|
24
|
-
detailed?: boolean;
|
|
25
|
-
dependents?: boolean;
|
|
26
|
-
dependencies?: boolean;
|
|
27
|
-
}
|
|
28
|
-
): Promise<any> {
|
|
29
|
-
if (versions && (compare || outdated)) {
|
|
30
|
-
throw new BitError('the [--compare] or [--outdated] flag cannot be used along with --versions');
|
|
31
|
-
}
|
|
32
|
-
if (versions && remote) {
|
|
33
|
-
throw new BitError('the [--versions] and [--remote] flags cannot be used together');
|
|
34
|
-
}
|
|
35
|
-
if (compare && outdated) {
|
|
36
|
-
throw new BitError('the [--compare] and [--outdated] flags cannot be used together');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return show({
|
|
40
|
-
id,
|
|
41
|
-
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
42
|
-
json,
|
|
43
|
-
versions,
|
|
44
|
-
remote,
|
|
45
|
-
outdated,
|
|
46
|
-
compare,
|
|
47
|
-
detailed,
|
|
48
|
-
dependents,
|
|
49
|
-
dependencies,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export function reportLegacy({
|
|
54
|
-
component,
|
|
55
|
-
componentModel,
|
|
56
|
-
dependenciesInfo,
|
|
57
|
-
dependentsInfo,
|
|
58
|
-
json,
|
|
59
|
-
versions,
|
|
60
|
-
components,
|
|
61
|
-
outdated,
|
|
62
|
-
detailed,
|
|
63
|
-
}: {
|
|
64
|
-
component: ConsumerComponent;
|
|
65
|
-
componentModel?: ConsumerComponent;
|
|
66
|
-
dependenciesInfo: DependenciesInfo[];
|
|
67
|
-
dependentsInfo: DependenciesInfo[];
|
|
68
|
-
json: boolean | null | undefined;
|
|
69
|
-
versions: boolean | null | undefined;
|
|
70
|
-
components: ConsumerComponent[] | null | undefined;
|
|
71
|
-
outdated: boolean;
|
|
72
|
-
detailed: boolean;
|
|
73
|
-
}): string {
|
|
74
|
-
if (versions) {
|
|
75
|
-
return JSON.stringify(
|
|
76
|
-
(components || []).map((c) => c.toObject()),
|
|
77
|
-
null,
|
|
78
|
-
' '
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
if (component.componentFromModel) {
|
|
82
|
-
component.scopesList = component.componentFromModel.scopesList;
|
|
83
|
-
}
|
|
84
|
-
if (json) {
|
|
85
|
-
const makeComponentReadable = (comp: ConsumerComponent) => {
|
|
86
|
-
if (!comp) return comp;
|
|
87
|
-
const componentObj = comp.toObject();
|
|
88
|
-
componentObj.files = comp.files.map((file) => file.toReadableString());
|
|
89
|
-
|
|
90
|
-
if (comp.componentMap) {
|
|
91
|
-
componentObj.componentDir = comp.componentMap.getComponentDir();
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return componentObj;
|
|
95
|
-
};
|
|
96
|
-
const componentFromFileSystem = makeComponentReadable(component);
|
|
97
|
-
if (dependenciesInfo) {
|
|
98
|
-
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
99
|
-
componentFromFileSystem.dependenciesInfo = dependenciesInfo;
|
|
100
|
-
}
|
|
101
|
-
if (dependentsInfo) {
|
|
102
|
-
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
103
|
-
componentFromFileSystem.dependentsInfo = dependentsInfo;
|
|
104
|
-
}
|
|
105
|
-
if (component.scopesList) {
|
|
106
|
-
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
107
|
-
componentFromFileSystem.scopesList = component.scopesList;
|
|
108
|
-
}
|
|
109
|
-
const componentFromModel = componentModel ? makeComponentReadable(componentModel) : undefined;
|
|
110
|
-
const jsonObject = componentFromModel ? { componentFromFileSystem, componentFromModel } : componentFromFileSystem;
|
|
111
|
-
return JSON.stringify(jsonObject, null, ' ');
|
|
112
|
-
}
|
|
113
|
-
return paintComponent(component, componentModel, outdated, detailed, dependenciesInfo, dependentsInfo);
|
|
114
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/show/{nothing-to-compare-to.js.map → legacy-show/nothing-to-compare-to.js.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|