@teambit/semantics.entities.semantic-schema 0.0.14 → 0.0.15
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/api-schema.ts +7 -1
- package/dist/api-schema.d.ts +3 -1
- package/dist/api-schema.js +5 -2
- package/dist/api-schema.js.map +1 -1
- package/package-tar/teambit-semantics.entities.semantic-schema-0.0.15.tgz +0 -0
- package/package.json +4 -3
- package/{preview-1653494536947.js → preview-1653535588073.js} +1 -1
- package/package-tar/teambit-semantics.entities.semantic-schema-0.0.14.tgz +0 -0
package/api-schema.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Transform, plainToInstance } from 'class-transformer';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
+
import { ComponentID } from '@teambit/component-id';
|
|
3
4
|
import {
|
|
4
5
|
ClassSchema,
|
|
5
6
|
EnumSchema,
|
|
@@ -17,9 +18,12 @@ export class APISchema extends SchemaNode {
|
|
|
17
18
|
@Transform(schemaObjToInstance)
|
|
18
19
|
readonly module: Module;
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
readonly componentId: ComponentID;
|
|
22
|
+
|
|
23
|
+
constructor(readonly location: Location, module: Module, componentId: ComponentID) {
|
|
21
24
|
super();
|
|
22
25
|
this.module = module;
|
|
26
|
+
this.componentId = componentId;
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
toString() {
|
|
@@ -31,6 +35,7 @@ export class APISchema extends SchemaNode {
|
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
toStringPerType() {
|
|
38
|
+
const title = chalk.inverse(`API Schema of ${this.componentId.toString()}\n`);
|
|
34
39
|
const getSection = (ClassObj, sectionName: string) => {
|
|
35
40
|
const objects = this.module.exports.filter((exp) => exp instanceof ClassObj);
|
|
36
41
|
if (!objects.length) {
|
|
@@ -41,6 +46,7 @@ export class APISchema extends SchemaNode {
|
|
|
41
46
|
};
|
|
42
47
|
|
|
43
48
|
return (
|
|
49
|
+
title +
|
|
44
50
|
getSection(Module, 'Namespaces') +
|
|
45
51
|
getSection(ClassSchema, 'Classes') +
|
|
46
52
|
getSection(InterfaceSchema, 'Interfaces') +
|
package/dist/api-schema.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { ComponentID } from '@teambit/component-id';
|
|
1
2
|
import { Module } from './schemas';
|
|
2
3
|
import { Location, SchemaNode } from './schema-node';
|
|
3
4
|
export declare class APISchema extends SchemaNode {
|
|
4
5
|
readonly location: Location;
|
|
5
6
|
readonly module: Module;
|
|
6
|
-
|
|
7
|
+
readonly componentId: ComponentID;
|
|
8
|
+
constructor(location: Location, module: Module, componentId: ComponentID);
|
|
7
9
|
toString(): string;
|
|
8
10
|
toStringPerType(): string;
|
|
9
11
|
listSignatures(): string[];
|
package/dist/api-schema.js
CHANGED
|
@@ -16,15 +16,17 @@ const schemas_1 = require("./schemas");
|
|
|
16
16
|
const schema_node_1 = require("./schema-node");
|
|
17
17
|
const schema_obj_to_class_1 = require("./schema-obj-to-class");
|
|
18
18
|
class APISchema extends schema_node_1.SchemaNode {
|
|
19
|
-
constructor(location, module) {
|
|
19
|
+
constructor(location, module, componentId) {
|
|
20
20
|
super();
|
|
21
21
|
this.location = location;
|
|
22
22
|
this.module = module;
|
|
23
|
+
this.componentId = componentId;
|
|
23
24
|
}
|
|
24
25
|
toString() {
|
|
25
26
|
return JSON.stringify(this.module.exports.map((exp) => exp.toObject()), undefined, 2);
|
|
26
27
|
}
|
|
27
28
|
toStringPerType() {
|
|
29
|
+
const title = chalk_1.default.inverse(`API Schema of ${this.componentId.toString()}\n`);
|
|
28
30
|
const getSection = (ClassObj, sectionName) => {
|
|
29
31
|
const objects = this.module.exports.filter((exp) => exp instanceof ClassObj);
|
|
30
32
|
if (!objects.length) {
|
|
@@ -32,7 +34,8 @@ class APISchema extends schema_node_1.SchemaNode {
|
|
|
32
34
|
}
|
|
33
35
|
return `${chalk_1.default.green.bold(sectionName)}\n${objects.map((c) => c.toString()).join('\n')}\n\n`;
|
|
34
36
|
};
|
|
35
|
-
return (
|
|
37
|
+
return (title +
|
|
38
|
+
getSection(schemas_1.Module, 'Namespaces') +
|
|
36
39
|
getSection(schemas_1.ClassSchema, 'Classes') +
|
|
37
40
|
getSection(schemas_1.InterfaceSchema, 'Interfaces') +
|
|
38
41
|
getSection(schemas_1.FunctionLikeSchema, 'Functions') +
|
package/dist/api-schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-schema.js","sourceRoot":"","sources":["../api-schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA+D;AAC/D,kDAA0B;
|
|
1
|
+
{"version":3,"file":"api-schema.js","sourceRoot":"","sources":["../api-schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA+D;AAC/D,kDAA0B;AAE1B,uCASmB;AACnB,+CAAqD;AACrD,+DAA4D;AAE5D,MAAa,SAAU,SAAQ,wBAAU;IAMvC,YAAqB,QAAkB,EAAE,MAAc,EAAE,WAAwB;QAC/E,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAErC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,SAAS,CACnB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,EAChD,SAAS,EACT,CAAC,CACF,CAAC;IACJ,CAAC;IAED,eAAe;QACb,MAAM,KAAK,GAAG,eAAK,CAAC,OAAO,CAAC,iBAAiB,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC9E,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,WAAmB,EAAE,EAAE;YACnD,MAAM,OAAO,GAAG,IAAI,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": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/semantics/entities/semantic-schema",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.semantics",
|
|
8
8
|
"name": "entities/semantic-schema",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.15"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
13
13
|
"class-transformer": "0.5.1",
|
|
14
14
|
"json-schema": "0.4.0",
|
|
15
|
-
"lodash": "4.17.21"
|
|
15
|
+
"lodash": "4.17.21",
|
|
16
|
+
"@teambit/component-id": "0.0.402"
|
|
16
17
|
},
|
|
17
18
|
"devDependencies": {
|
|
18
19
|
"@types/json-schema": "7.0.9",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_entities_semantic-schema@0.0.
|
|
1
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_entities_semantic-schema@0.0.15/dist/semantic-schema.docs.md')]
|
|
Binary file
|