@teambit/schema 0.0.741 → 0.0.742
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/schema.cmd.d.ts +4 -3
- package/dist/schema.cmd.js +25 -15
- package/dist/schema.cmd.js.map +1 -1
- package/package-tar/teambit-schema-0.0.742.tgz +0 -0
- package/package.json +9 -9
- package/{preview-1653494536947.js → preview-1653535588073.js} +2 -2
- package/package-tar/teambit-schema-0.0.741.tgz +0 -0
package/dist/schema.cmd.d.ts
CHANGED
|
@@ -6,10 +6,11 @@ export declare class SchemaCommand implements Command {
|
|
|
6
6
|
private component;
|
|
7
7
|
name: string;
|
|
8
8
|
description: string;
|
|
9
|
+
extendedDescription: string;
|
|
9
10
|
group: string;
|
|
10
11
|
options: CommandOptions;
|
|
11
12
|
constructor(schema: SchemaMain, component: ComponentMain);
|
|
12
|
-
report([
|
|
13
|
-
json([
|
|
14
|
-
private
|
|
13
|
+
report([pattern]: [any]): Promise<string>;
|
|
14
|
+
json([pattern]: [any]): Promise<Record<string, any>[]>;
|
|
15
|
+
private getSchemas;
|
|
15
16
|
}
|
package/dist/schema.cmd.js
CHANGED
|
@@ -21,10 +21,20 @@ function _defineProperty2() {
|
|
|
21
21
|
return data;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
function
|
|
25
|
-
const data = require("
|
|
24
|
+
function _pMapSeries() {
|
|
25
|
+
const data = _interopRequireDefault(require("p-map-series"));
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
_pMapSeries = function () {
|
|
28
|
+
return data;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return data;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function _constants() {
|
|
35
|
+
const data = require("@teambit/legacy/dist/constants");
|
|
36
|
+
|
|
37
|
+
_constants = function () {
|
|
28
38
|
return data;
|
|
29
39
|
};
|
|
30
40
|
|
|
@@ -35,28 +45,28 @@ class SchemaCommand {
|
|
|
35
45
|
constructor(schema, component) {
|
|
36
46
|
this.schema = schema;
|
|
37
47
|
this.component = component;
|
|
38
|
-
(0, _defineProperty2().default)(this, "name", 'schema <
|
|
48
|
+
(0, _defineProperty2().default)(this, "name", 'schema <pattern>');
|
|
39
49
|
(0, _defineProperty2().default)(this, "description", 'shows the API schema of a certain component.');
|
|
50
|
+
(0, _defineProperty2().default)(this, "extendedDescription", `${(0, _constants().PATTERN_HELP)('schema')}`);
|
|
40
51
|
(0, _defineProperty2().default)(this, "group", 'component');
|
|
41
52
|
(0, _defineProperty2().default)(this, "options", [['j', 'json', 'return the component data in json format']]);
|
|
42
53
|
}
|
|
43
54
|
|
|
44
|
-
async report([
|
|
45
|
-
const
|
|
46
|
-
return schema.toStringPerType();
|
|
55
|
+
async report([pattern]) {
|
|
56
|
+
const schemas = await this.getSchemas([pattern]);
|
|
57
|
+
return schemas.map(schema => schema.toStringPerType()).join('\n\n\n');
|
|
47
58
|
}
|
|
48
59
|
|
|
49
|
-
async json([
|
|
50
|
-
const
|
|
51
|
-
return schema.toObject();
|
|
60
|
+
async json([pattern]) {
|
|
61
|
+
const schemas = await this.getSchemas([pattern]);
|
|
62
|
+
return schemas.map(schema => schema.toObject());
|
|
52
63
|
}
|
|
53
64
|
|
|
54
|
-
async
|
|
65
|
+
async getSchemas([pattern]) {
|
|
55
66
|
const host = this.component.getHost();
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
return this.schema.getSchema(component);
|
|
67
|
+
const ids = await host.idsByPattern(pattern, true);
|
|
68
|
+
const components = await host.getMany(ids);
|
|
69
|
+
return (0, _pMapSeries().default)(components, component => this.schema.getSchema(component));
|
|
60
70
|
}
|
|
61
71
|
|
|
62
72
|
}
|
package/dist/schema.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SchemaCommand","constructor","schema","component","report","
|
|
1
|
+
{"version":3,"names":["SchemaCommand","constructor","schema","component","PATTERN_HELP","report","pattern","schemas","getSchemas","map","toStringPerType","join","json","toObject","host","getHost","ids","idsByPattern","components","getMany","pMapSeries","getSchema"],"sources":["schema.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentMain } from '@teambit/component';\nimport pMapSeries from 'p-map-series';\nimport { APISchema } from '@teambit/semantics.entities.semantic-schema';\nimport { PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport type { SchemaMain } from './schema.main.runtime';\n\nexport class SchemaCommand implements Command {\n name = 'schema <pattern>';\n description = 'shows the API schema of a certain component.';\n extendedDescription = `${PATTERN_HELP('schema')}`;\n group = 'component';\n options = [['j', 'json', 'return the component data in json format']] as CommandOptions;\n\n constructor(private schema: SchemaMain, private component: ComponentMain) {}\n\n async report([pattern]) {\n const schemas = await this.getSchemas([pattern]);\n return schemas.map((schema) => schema.toStringPerType()).join('\\n\\n\\n');\n }\n\n async json([pattern]) {\n const schemas = await this.getSchemas([pattern]);\n return schemas.map((schema) => schema.toObject());\n }\n\n private async getSchemas([pattern]): Promise<APISchema[]> {\n const host = this.component.getHost();\n const ids = await host.idsByPattern(pattern, true);\n const components = await host.getMany(ids);\n return pMapSeries(components, (component) => this.schema.getSchema(component));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,aAAN,CAAuC;EAO5CC,WAAW,CAASC,MAAT,EAAqCC,SAArC,EAA+D;IAAA,KAAtDD,MAAsD,GAAtDA,MAAsD;IAAA,KAA1BC,SAA0B,GAA1BA,SAA0B;IAAA,8CANnE,kBAMmE;IAAA,qDAL5D,8CAK4D;IAAA,6DAJnD,GAAE,IAAAC,yBAAA,EAAa,QAAb,CAAuB,EAI0B;IAAA,+CAHlE,WAGkE;IAAA,iDAFhE,CAAC,CAAC,GAAD,EAAM,MAAN,EAAc,0CAAd,CAAD,CAEgE;EAAE;;EAEhE,MAANC,MAAM,CAAC,CAACC,OAAD,CAAD,EAAY;IACtB,MAAMC,OAAO,GAAG,MAAM,KAAKC,UAAL,CAAgB,CAACF,OAAD,CAAhB,CAAtB;IACA,OAAOC,OAAO,CAACE,GAAR,CAAaP,MAAD,IAAYA,MAAM,CAACQ,eAAP,EAAxB,EAAkDC,IAAlD,CAAuD,QAAvD,CAAP;EACD;;EAES,MAAJC,IAAI,CAAC,CAACN,OAAD,CAAD,EAAY;IACpB,MAAMC,OAAO,GAAG,MAAM,KAAKC,UAAL,CAAgB,CAACF,OAAD,CAAhB,CAAtB;IACA,OAAOC,OAAO,CAACE,GAAR,CAAaP,MAAD,IAAYA,MAAM,CAACW,QAAP,EAAxB,CAAP;EACD;;EAEuB,MAAVL,UAAU,CAAC,CAACF,OAAD,CAAD,EAAkC;IACxD,MAAMQ,IAAI,GAAG,KAAKX,SAAL,CAAeY,OAAf,EAAb;IACA,MAAMC,GAAG,GAAG,MAAMF,IAAI,CAACG,YAAL,CAAkBX,OAAlB,EAA2B,IAA3B,CAAlB;IACA,MAAMY,UAAU,GAAG,MAAMJ,IAAI,CAACK,OAAL,CAAaH,GAAb,CAAzB;IACA,OAAO,IAAAI,qBAAA,EAAWF,UAAX,EAAwBf,SAAD,IAAe,KAAKD,MAAL,CAAYmB,SAAZ,CAAsBlB,SAAtB,CAAtC,CAAP;EACD;;AAxB2C"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.742",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/semantics/schema",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.semantics",
|
|
8
8
|
"name": "schema",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.742"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
+
"p-map-series": "2.1.0",
|
|
12
13
|
"graphql-tag": "2.12.1",
|
|
13
14
|
"graphql-type-json": "0.3.2",
|
|
14
15
|
"@babel/runtime": "7.12.18",
|
|
15
16
|
"core-js": "^3.0.0",
|
|
16
17
|
"@teambit/harmony": "0.3.3",
|
|
17
18
|
"@teambit/base-react.navigation.link": "1.23.0",
|
|
18
|
-
"@teambit/semantics.entities.semantic-schema": "0.0.
|
|
19
|
-
"@teambit/builder": "0.0.
|
|
20
|
-
"@teambit/component": "0.0.
|
|
19
|
+
"@teambit/semantics.entities.semantic-schema": "0.0.15",
|
|
20
|
+
"@teambit/builder": "0.0.742",
|
|
21
|
+
"@teambit/component": "0.0.742",
|
|
21
22
|
"@teambit/cli": "0.0.492",
|
|
22
|
-
"@teambit/
|
|
23
|
-
"@teambit/
|
|
24
|
-
"@teambit/graphql": "0.0.741"
|
|
23
|
+
"@teambit/envs": "0.0.742",
|
|
24
|
+
"@teambit/graphql": "0.0.742"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/react": "^17.0.8",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@types/node": "12.20.4",
|
|
35
35
|
"@teambit/harmony.testing.load-aspect": "0.0.6",
|
|
36
36
|
"@teambit/workspace.testing.mock-workspace": "0.0.5",
|
|
37
|
-
"@teambit/workspace": "0.0.
|
|
37
|
+
"@teambit/workspace": "0.0.742"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@teambit/legacy": "1.0.272",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.
|
|
2
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.
|
|
1
|
+
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.742/dist/schema.composition.js'), require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.742/dist/mock/button/button.composition.js')]
|
|
2
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.742/dist/schema.docs.mdx')]
|
|
Binary file
|