@teambit/semantics.entities.semantic-schema 0.0.18 → 0.0.21
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 +5 -3
- package/class-transformers/schema-obj-to-class.ts +7 -3
- package/dist/api-schema.js +3 -2
- package/dist/api-schema.js.map +1 -1
- package/dist/class-transformers/schema-obj-to-class.js +6 -2
- package/dist/class-transformers/schema-obj-to-class.js.map +1 -1
- package/dist/schema-node.d.ts +4 -1
- package/dist/schemas/docs/doc.d.ts +2 -1
- package/dist/schemas/docs/doc.js +2 -1
- package/dist/schemas/docs/doc.js.map +1 -1
- package/dist/schemas/docs/index.d.ts +1 -0
- package/dist/schemas/docs/index.js +3 -1
- package/dist/schemas/docs/index.js.map +1 -1
- package/dist/schemas/docs/property-like-tag.d.ts +13 -0
- package/dist/schemas/docs/property-like-tag.js +34 -0
- package/dist/schemas/docs/property-like-tag.js.map +1 -0
- package/dist/schemas/docs/return-tag.d.ts +2 -3
- package/dist/schemas/docs/return-tag.js +13 -3
- package/dist/schemas/docs/return-tag.js.map +1 -1
- package/dist/schemas/index.d.ts +3 -1
- package/dist/schemas/index.js +7 -3
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/unknown-schema.d.ts +13 -0
- package/dist/schemas/unknown-schema.js +22 -0
- package/dist/schemas/unknown-schema.js.map +1 -0
- package/dist/schemas/unresolved-schema.d.ts +11 -0
- package/dist/schemas/unresolved-schema.js +20 -0
- package/dist/schemas/unresolved-schema.js.map +1 -0
- package/dist/schemas/{variable.d.ts → variable-like.d.ts} +1 -1
- package/dist/schemas/{variable.js → variable-like.js} +5 -5
- package/dist/schemas/variable-like.js.map +1 -0
- package/package-tar/teambit-semantics.entities.semantic-schema-0.0.21.tgz +0 -0
- package/package.json +2 -2
- package/{preview-1654572446572.js → preview-1655263660719.js} +1 -1
- package/schema-node.ts +8 -1
- package/schemas/docs/doc.ts +1 -1
- package/schemas/docs/index.ts +1 -0
- package/schemas/docs/property-like-tag.ts +22 -0
- package/schemas/docs/return-tag.ts +7 -7
- package/schemas/index.ts +3 -1
- package/schemas/unknown-schema.ts +16 -0
- package/schemas/unresolved-schema.ts +15 -0
- package/schemas/{variable.ts → variable-like.ts} +1 -1
- package/dist/schemas/variable.js.map +0 -1
- package/package-tar/teambit-semantics.entities.semantic-schema-0.0.18.tgz +0 -0
package/api-schema.ts
CHANGED
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
Module,
|
|
10
10
|
TypeRefSchema,
|
|
11
11
|
TypeSchema,
|
|
12
|
-
|
|
12
|
+
UnresolvedSchema,
|
|
13
|
+
VariableLikeSchema,
|
|
13
14
|
} from './schemas';
|
|
14
15
|
import { Location, SchemaNode } from './schema-node';
|
|
15
16
|
import { schemaObjToInstance } from './class-transformers';
|
|
@@ -53,10 +54,11 @@ export class APISchema extends SchemaNode {
|
|
|
53
54
|
getSection(ClassSchema, 'Classes') +
|
|
54
55
|
getSection(InterfaceSchema, 'Interfaces') +
|
|
55
56
|
getSection(FunctionLikeSchema, 'Functions') +
|
|
56
|
-
getSection(
|
|
57
|
+
getSection(VariableLikeSchema, 'Variables') +
|
|
57
58
|
getSection(TypeSchema, 'Types') +
|
|
58
59
|
getSection(EnumSchema, 'Enums') +
|
|
59
|
-
getSection(TypeRefSchema, 'TypeReferences')
|
|
60
|
+
getSection(TypeRefSchema, 'TypeReferences') +
|
|
61
|
+
getSection(UnresolvedSchema, 'Unresolved')
|
|
60
62
|
);
|
|
61
63
|
}
|
|
62
64
|
|
|
@@ -2,6 +2,7 @@ import { plainToInstance, TransformationType, ClassConstructor } from 'class-tra
|
|
|
2
2
|
import { compact } from 'lodash';
|
|
3
3
|
import { SchemaNode } from '../schema-node';
|
|
4
4
|
import * as Schemas from '../schemas';
|
|
5
|
+
import { UnknownSchema } from '../schemas/unknown-schema';
|
|
5
6
|
|
|
6
7
|
export function schemaObjArrayToInstances({ value, type }: { value: SchemaNode[]; type: TransformationType }) {
|
|
7
8
|
if (type !== TransformationType.PLAIN_TO_CLASS) {
|
|
@@ -31,15 +32,18 @@ function transformFromObjectToInstance(obj: Record<string, any>): SchemaNode {
|
|
|
31
32
|
throw new Error(`fatal: "__schema" is missing, make sure the transformer is set on SchemaNode type`);
|
|
32
33
|
}
|
|
33
34
|
const SchemaClass = getClassBySchemaName(obj.__schema);
|
|
35
|
+
if (!SchemaClass) {
|
|
36
|
+
// for backward and forward compatibility, to not break the users, it's better to return an unknown schema than throwing.
|
|
37
|
+
return new UnknownSchema(obj.location || { path: '', line: 0, character: 0 }, obj.__schema, obj);
|
|
38
|
+
}
|
|
34
39
|
return plainToInstance(SchemaClass, obj);
|
|
35
40
|
}
|
|
36
41
|
|
|
37
|
-
function getClassBySchemaName(schemaName: string): ClassConstructor<SchemaNode> {
|
|
42
|
+
function getClassBySchemaName(schemaName: string): ClassConstructor<SchemaNode> | null {
|
|
38
43
|
const schemasClasses = compact(Object.values(Schemas));
|
|
39
44
|
const schemaClass = schemasClasses.find((schema) => schema.name === schemaName);
|
|
40
45
|
if (!schemaClass) {
|
|
41
|
-
|
|
42
|
-
${schemasClasses.map((s) => s.name).join(', ')}`);
|
|
46
|
+
return null;
|
|
43
47
|
}
|
|
44
48
|
return schemaClass;
|
|
45
49
|
}
|
package/dist/api-schema.js
CHANGED
|
@@ -40,10 +40,11 @@ class APISchema extends schema_node_1.SchemaNode {
|
|
|
40
40
|
getSection(schemas_1.ClassSchema, 'Classes') +
|
|
41
41
|
getSection(schemas_1.InterfaceSchema, 'Interfaces') +
|
|
42
42
|
getSection(schemas_1.FunctionLikeSchema, 'Functions') +
|
|
43
|
-
getSection(schemas_1.
|
|
43
|
+
getSection(schemas_1.VariableLikeSchema, 'Variables') +
|
|
44
44
|
getSection(schemas_1.TypeSchema, 'Types') +
|
|
45
45
|
getSection(schemas_1.EnumSchema, 'Enums') +
|
|
46
|
-
getSection(schemas_1.TypeRefSchema, 'TypeReferences')
|
|
46
|
+
getSection(schemas_1.TypeRefSchema, 'TypeReferences') +
|
|
47
|
+
getSection(schemas_1.UnresolvedSchema, 'Unresolved'));
|
|
47
48
|
}
|
|
48
49
|
listSignatures() {
|
|
49
50
|
return this.module.exports.map((exp) => exp.signature);
|
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;AAE1B,
|
|
1
|
+
{"version":3,"file":"api-schema.js","sourceRoot":"","sources":["../api-schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA+D;AAC/D,kDAA0B;AAE1B,uCAUmB;AACnB,+CAAqD;AACrD,6DAA2D;AAC3D,kFAAkF;AAElF,MAAa,SAAU,SAAQ,wBAAU;IAOvC,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,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,YAAY,QAAQ,CAAC,CAAC;YAC7E,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;gBACnB,OAAO,EAAE,CAAC;aACX;YAED,OAAO,GAAG,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;QAChG,CAAC,CAAC;QAEF,OAAO,CACL,KAAK;YACL,UAAU,CAAC,gBAAM,EAAE,YAAY,CAAC;YAChC,UAAU,CAAC,qBAAW,EAAE,SAAS,CAAC;YAClC,UAAU,CAAC,yBAAe,EAAE,YAAY,CAAC;YACzC,UAAU,CAAC,4BAAkB,EAAE,WAAW,CAAC;YAC3C,UAAU,CAAC,4BAAkB,EAAE,WAAW,CAAC;YAC3C,UAAU,CAAC,oBAAU,EAAE,OAAO,CAAC;YAC/B,UAAU,CAAC,oBAAU,EAAE,OAAO,CAAC;YAC/B,UAAU,CAAC,uBAAa,EAAE,gBAAgB,CAAC;YAC3C,UAAU,CAAC,0BAAgB,EAAE,YAAY,CAAC,CAC3C,CAAC;IACJ,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAwB;QACxC,OAAO,IAAA,mCAAe,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;CACF;AAnDC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;yCACP;AAGxB;IADC,IAAA,6BAAS,EAAC,4CAAsB,CAAC;8CACA;AALpC,8BAqDC"}
|
|
@@ -23,6 +23,7 @@ exports.schemaObjToInstance = exports.schemaObjArrayToInstances = void 0;
|
|
|
23
23
|
const class_transformer_1 = require("class-transformer");
|
|
24
24
|
const lodash_1 = require("lodash");
|
|
25
25
|
const Schemas = __importStar(require("../schemas"));
|
|
26
|
+
const unknown_schema_1 = require("../schemas/unknown-schema");
|
|
26
27
|
function schemaObjArrayToInstances({ value, type }) {
|
|
27
28
|
if (type !== class_transformer_1.TransformationType.PLAIN_TO_CLASS) {
|
|
28
29
|
return value;
|
|
@@ -45,14 +46,17 @@ function transformFromObjectToInstance(obj) {
|
|
|
45
46
|
throw new Error(`fatal: "__schema" is missing, make sure the transformer is set on SchemaNode type`);
|
|
46
47
|
}
|
|
47
48
|
const SchemaClass = getClassBySchemaName(obj.__schema);
|
|
49
|
+
if (!SchemaClass) {
|
|
50
|
+
// for backward and forward compatibility, to not break the users, it's better to return an unknown schema than throwing.
|
|
51
|
+
return new unknown_schema_1.UnknownSchema(obj.location || { path: '', line: 0, character: 0 }, obj.__schema, obj);
|
|
52
|
+
}
|
|
48
53
|
return (0, class_transformer_1.plainToInstance)(SchemaClass, obj);
|
|
49
54
|
}
|
|
50
55
|
function getClassBySchemaName(schemaName) {
|
|
51
56
|
const schemasClasses = (0, lodash_1.compact)(Object.values(Schemas));
|
|
52
57
|
const schemaClass = schemasClasses.find((schema) => schema.name === schemaName);
|
|
53
58
|
if (!schemaClass) {
|
|
54
|
-
|
|
55
|
-
${schemasClasses.map((s) => s.name).join(', ')}`);
|
|
59
|
+
return null;
|
|
56
60
|
}
|
|
57
61
|
return schemaClass;
|
|
58
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-obj-to-class.js","sourceRoot":"","sources":["../../class-transformers/schema-obj-to-class.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA0F;AAC1F,mCAAiC;AAEjC,oDAAsC;
|
|
1
|
+
{"version":3,"file":"schema-obj-to-class.js","sourceRoot":"","sources":["../../class-transformers/schema-obj-to-class.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA0F;AAC1F,mCAAiC;AAEjC,oDAAsC;AACtC,8DAA0D;AAE1D,SAAgB,yBAAyB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAqD;IAC1G,IAAI,IAAI,KAAK,sCAAkB,CAAC,cAAc,EAAE;QAC9C,OAAO,KAAK,CAAC;KACd;IACD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,6BAA6B,CAAC,GAAG,CAAC,CAAC,CAAC;AAChE,CAAC;AALD,8DAKC;AAED,SAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,IAAI,GAIL;IACC,IAAI,IAAI,KAAK,sCAAkB,CAAC,cAAc,EAAE;QAC9C,OAAO,KAAK,CAAC;KACd;IACD,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,6BAA6B,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC;AAdD,kDAcC;AAED,SAAS,6BAA6B,CAAC,GAAwB;IAC7D,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,mFAAmF,CAAC,CAAC;KACtG;IACD,MAAM,WAAW,GAAG,oBAAoB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACvD,IAAI,CAAC,WAAW,EAAE;QAChB,yHAAyH;QACzH,OAAO,IAAI,8BAAa,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;KAClG;IACD,OAAO,IAAA,mCAAe,EAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,oBAAoB,CAAC,UAAkB;IAC9C,MAAM,cAAc,GAAG,IAAA,gBAAO,EAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACvD,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;IAChF,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
package/dist/schema-node.d.ts
CHANGED
|
@@ -13,7 +13,10 @@ export declare abstract class SchemaNode {
|
|
|
13
13
|
toObject(): Record<string, any>;
|
|
14
14
|
}
|
|
15
15
|
export declare type Location = {
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* file-path relative to the component root-dir. normalized to Linux.
|
|
18
|
+
*/
|
|
19
|
+
filePath: string;
|
|
17
20
|
line: number;
|
|
18
21
|
character: number;
|
|
19
22
|
};
|
|
@@ -2,9 +2,10 @@ import { Location, SchemaNode } from '../../schema-node';
|
|
|
2
2
|
import { TagName, TagSchema } from './tag';
|
|
3
3
|
export declare class DocSchema extends SchemaNode {
|
|
4
4
|
readonly location: Location;
|
|
5
|
+
readonly raw: string;
|
|
5
6
|
readonly comment?: string;
|
|
6
7
|
readonly tags?: TagSchema[];
|
|
7
|
-
constructor(location: Location, comment?: string, tags?: TagSchema[]);
|
|
8
|
+
constructor(location: Location, raw: string, comment?: string, tags?: TagSchema[]);
|
|
8
9
|
toString(): string;
|
|
9
10
|
hasTag(tagName: TagName): boolean;
|
|
10
11
|
findTag(tagName: TagName): TagSchema;
|
package/dist/schemas/docs/doc.js
CHANGED
|
@@ -11,9 +11,10 @@ const class_transformer_1 = require("class-transformer");
|
|
|
11
11
|
const class_transformers_1 = require("../../class-transformers");
|
|
12
12
|
const schema_node_1 = require("../../schema-node");
|
|
13
13
|
class DocSchema extends schema_node_1.SchemaNode {
|
|
14
|
-
constructor(location, comment, tags) {
|
|
14
|
+
constructor(location, raw, comment, tags) {
|
|
15
15
|
super();
|
|
16
16
|
this.location = location;
|
|
17
|
+
this.raw = raw;
|
|
17
18
|
this.comment = comment;
|
|
18
19
|
this.tags = tags;
|
|
19
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc.js","sourceRoot":"","sources":["../../../schemas/docs/doc.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,iEAAqE;AACrE,mDAAyD;AAGzD,MAAa,SAAU,SAAQ,wBAAU;IAGvC,YAAqB,QAAkB,EAAW,OAAgB,EAAE,IAAkB;
|
|
1
|
+
{"version":3,"file":"doc.js","sourceRoot":"","sources":["../../../schemas/docs/doc.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,iEAAqE;AACrE,mDAAyD;AAGzD,MAAa,SAAU,SAAQ,wBAAU;IAGvC,YAAqB,QAAkB,EAAW,GAAW,EAAW,OAAgB,EAAE,IAAkB;QAC1G,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAW,QAAG,GAAH,GAAG,CAAQ;QAAW,YAAO,GAAP,OAAO,CAAS;QAEtF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAChF,OAAO,GAAG,OAAO,GAAG,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,OAAgB;QACrB,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,CAAC,OAAgB;;QACtB,OAAO,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;IAC3D,CAAC;CACF;AAnBC;IADC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;uCACT;AAF9B,8BAqBC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReturnTagSchema = exports.TagSchema = exports.DocSchema = void 0;
|
|
3
|
+
exports.PropertyLikeTagSchema = exports.ReturnTagSchema = exports.TagSchema = exports.DocSchema = void 0;
|
|
4
4
|
var doc_1 = require("./doc");
|
|
5
5
|
Object.defineProperty(exports, "DocSchema", { enumerable: true, get: function () { return doc_1.DocSchema; } });
|
|
6
6
|
var tag_1 = require("./tag");
|
|
7
7
|
Object.defineProperty(exports, "TagSchema", { enumerable: true, get: function () { return tag_1.TagSchema; } });
|
|
8
8
|
var return_tag_1 = require("./return-tag");
|
|
9
9
|
Object.defineProperty(exports, "ReturnTagSchema", { enumerable: true, get: function () { return return_tag_1.ReturnTagSchema; } });
|
|
10
|
+
var property_like_tag_1 = require("./property-like-tag");
|
|
11
|
+
Object.defineProperty(exports, "PropertyLikeTagSchema", { enumerable: true, get: function () { return property_like_tag_1.PropertyLikeTagSchema; } });
|
|
10
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schemas/docs/index.ts"],"names":[],"mappings":";;;AAAA,6BAAkC;AAAzB,gGAAA,SAAS,OAAA;AAClB,6BAAkC;AAAzB,gGAAA,SAAS,OAAA;AAClB,2CAA+C;AAAtC,6GAAA,eAAe,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schemas/docs/index.ts"],"names":[],"mappings":";;;AAAA,6BAAkC;AAAzB,gGAAA,SAAS,OAAA;AAClB,6BAAkC;AAAzB,gGAAA,SAAS,OAAA;AAClB,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AACxB,yDAA4D;AAAnD,0HAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Location, SchemaNode } from '../../schema-node';
|
|
2
|
+
import { TagSchema } from './tag';
|
|
3
|
+
/**
|
|
4
|
+
* e.g. `@param myParam {string} some comment`
|
|
5
|
+
*/
|
|
6
|
+
export declare class PropertyLikeTagSchema extends TagSchema {
|
|
7
|
+
readonly location: Location;
|
|
8
|
+
readonly paramName: string;
|
|
9
|
+
readonly comment?: string;
|
|
10
|
+
readonly type?: SchemaNode;
|
|
11
|
+
constructor(location: Location, paramName: string, comment?: string, type?: SchemaNode);
|
|
12
|
+
toString(): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PropertyLikeTagSchema = void 0;
|
|
10
|
+
const class_transformer_1 = require("class-transformer");
|
|
11
|
+
const tag_1 = require("./tag");
|
|
12
|
+
const class_transformers_1 = require("../../class-transformers");
|
|
13
|
+
/**
|
|
14
|
+
* e.g. `@param myParam {string} some comment`
|
|
15
|
+
*/
|
|
16
|
+
class PropertyLikeTagSchema extends tag_1.TagSchema {
|
|
17
|
+
constructor(location, paramName, comment, type) {
|
|
18
|
+
super(location, tag_1.TagName.parameter, comment);
|
|
19
|
+
this.location = location;
|
|
20
|
+
this.paramName = paramName;
|
|
21
|
+
this.comment = comment;
|
|
22
|
+
this.type = type;
|
|
23
|
+
}
|
|
24
|
+
toString() {
|
|
25
|
+
const comment = this.comment ? ` ${this.comment}` : '';
|
|
26
|
+
const type = this.type ? ` {${this.type.toString()}} ` : '';
|
|
27
|
+
return `@${this.tagName} ${this.paramName}${type} ${comment}`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
32
|
+
], PropertyLikeTagSchema.prototype, "type", void 0);
|
|
33
|
+
exports.PropertyLikeTagSchema = PropertyLikeTagSchema;
|
|
34
|
+
//# sourceMappingURL=property-like-tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-like-tag.js","sourceRoot":"","sources":["../../../schemas/docs/property-like-tag.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAE9C,+BAA2C;AAC3C,iEAA+D;AAE/D;;GAEG;AACH,MAAa,qBAAsB,SAAQ,eAAS;IAGlD,YAAqB,QAAkB,EAAW,SAAiB,EAAW,OAAgB,EAAE,IAAiB;QAC/G,KAAK,CAAC,QAAQ,EAAE,aAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QADzB,aAAQ,GAAR,QAAQ,CAAU;QAAW,cAAS,GAAT,SAAS,CAAQ;QAAW,YAAO,GAAP,OAAO,CAAS;QAE5F,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5D,OAAO,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC;IAChE,CAAC;CACF;AAXC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;mDACJ;AAF7B,sDAaC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Location, SchemaNode } from '../../schema-node';
|
|
2
|
-
import {
|
|
2
|
+
import { TagSchema } from './tag';
|
|
3
3
|
/**
|
|
4
4
|
* e.g. `@return {string} some comment`
|
|
5
5
|
*/
|
|
6
6
|
export declare class ReturnTagSchema extends TagSchema {
|
|
7
7
|
readonly location: Location;
|
|
8
|
-
readonly tagName: TagName;
|
|
9
8
|
readonly comment?: string;
|
|
10
9
|
readonly type?: SchemaNode;
|
|
11
|
-
constructor(location: Location,
|
|
10
|
+
constructor(location: Location, comment?: string, type?: SchemaNode);
|
|
12
11
|
toString(): string;
|
|
13
12
|
}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
9
|
exports.ReturnTagSchema = void 0;
|
|
10
|
+
const class_transformer_1 = require("class-transformer");
|
|
4
11
|
const tag_1 = require("./tag");
|
|
12
|
+
const class_transformers_1 = require("../../class-transformers");
|
|
5
13
|
/**
|
|
6
14
|
* e.g. `@return {string} some comment`
|
|
7
15
|
*/
|
|
8
16
|
class ReturnTagSchema extends tag_1.TagSchema {
|
|
9
|
-
constructor(location,
|
|
10
|
-
super(location,
|
|
17
|
+
constructor(location, comment, type) {
|
|
18
|
+
super(location, tag_1.TagName.return, comment);
|
|
11
19
|
this.location = location;
|
|
12
|
-
this.tagName = tagName;
|
|
13
20
|
this.comment = comment;
|
|
14
21
|
this.type = type;
|
|
15
22
|
}
|
|
@@ -18,5 +25,8 @@ class ReturnTagSchema extends tag_1.TagSchema {
|
|
|
18
25
|
return `@${this.tagName}${comment}`;
|
|
19
26
|
}
|
|
20
27
|
}
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
30
|
+
], ReturnTagSchema.prototype, "type", void 0);
|
|
21
31
|
exports.ReturnTagSchema = ReturnTagSchema;
|
|
22
32
|
//# sourceMappingURL=return-tag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"return-tag.js","sourceRoot":"","sources":["../../../schemas/docs/return-tag.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"return-tag.js","sourceRoot":"","sources":["../../../schemas/docs/return-tag.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAE9C,+BAA2C;AAC3C,iEAA+D;AAE/D;;GAEG;AACH,MAAa,eAAgB,SAAQ,eAAS;IAG5C,YAAqB,QAAkB,EAAW,OAAgB,EAAE,IAAiB;QACnF,KAAK,CAAC,QAAQ,EAAE,aAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QADtB,aAAQ,GAAR,QAAQ,CAAU;QAAW,YAAO,GAAP,OAAO,CAAS;QAEhE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,OAAO,IAAI,IAAI,CAAC,OAAO,GAAG,OAAO,EAAE,CAAC;IACtC,CAAC;CACF;AAVC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;6CACJ;AAF7B,0CAYC"}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Module } from './module';
|
|
2
2
|
export { FunctionLikeSchema, Modifier } from './function-like';
|
|
3
3
|
export { TypeRefSchema } from './type-ref';
|
|
4
|
-
export {
|
|
4
|
+
export { VariableLikeSchema } from './variable-like';
|
|
5
5
|
export { ClassSchema } from './class';
|
|
6
6
|
export { ConstructorSchema } from './constructor';
|
|
7
7
|
export { TypeSchema } from './type';
|
|
@@ -27,4 +27,6 @@ export { IndexedAccessSchema } from './indexed-access-type';
|
|
|
27
27
|
export { TemplateLiteralTypeSchema } from './template-literal-type';
|
|
28
28
|
export { TemplateLiteralTypeSpanSchema } from './template-literal-type-span';
|
|
29
29
|
export { ThisTypeSchema } from './this-type';
|
|
30
|
+
export { UnknownSchema } from './unknown-schema';
|
|
31
|
+
export { UnresolvedSchema } from './unresolved-schema';
|
|
30
32
|
export * from './docs';
|
package/dist/schemas/index.js
CHANGED
|
@@ -10,15 +10,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.ThisTypeSchema = exports.TemplateLiteralTypeSpanSchema = exports.TemplateLiteralTypeSchema = exports.IndexedAccessSchema = exports.TypePredicateSchema = exports.ParenthesizedTypeSchema = exports.EnumSchema = exports.ParameterSchema = exports.TupleTypeSchema = exports.TypeOperatorSchema = exports.TypeArraySchema = exports.KeywordTypeSchema = exports.LiteralTypeSchema = exports.InferenceTypeSchema = exports.TypeQuerySchema = exports.SetAccessorSchema = exports.GetAccessorSchema = exports.InterfaceSchema = exports.IndexSignatureSchema = exports.TypeLiteralSchema = exports.TypeUnionSchema = exports.TypeIntersectionSchema = exports.TypeSchema = exports.ConstructorSchema = exports.ClassSchema = exports.
|
|
13
|
+
exports.UnresolvedSchema = exports.UnknownSchema = exports.ThisTypeSchema = exports.TemplateLiteralTypeSpanSchema = exports.TemplateLiteralTypeSchema = exports.IndexedAccessSchema = exports.TypePredicateSchema = exports.ParenthesizedTypeSchema = exports.EnumSchema = exports.ParameterSchema = exports.TupleTypeSchema = exports.TypeOperatorSchema = exports.TypeArraySchema = exports.KeywordTypeSchema = exports.LiteralTypeSchema = exports.InferenceTypeSchema = exports.TypeQuerySchema = exports.SetAccessorSchema = exports.GetAccessorSchema = exports.InterfaceSchema = exports.IndexSignatureSchema = exports.TypeLiteralSchema = exports.TypeUnionSchema = exports.TypeIntersectionSchema = exports.TypeSchema = exports.ConstructorSchema = exports.ClassSchema = exports.VariableLikeSchema = exports.TypeRefSchema = exports.FunctionLikeSchema = exports.Module = void 0;
|
|
14
14
|
var module_1 = require("./module");
|
|
15
15
|
Object.defineProperty(exports, "Module", { enumerable: true, get: function () { return module_1.Module; } });
|
|
16
16
|
var function_like_1 = require("./function-like");
|
|
17
17
|
Object.defineProperty(exports, "FunctionLikeSchema", { enumerable: true, get: function () { return function_like_1.FunctionLikeSchema; } });
|
|
18
18
|
var type_ref_1 = require("./type-ref");
|
|
19
19
|
Object.defineProperty(exports, "TypeRefSchema", { enumerable: true, get: function () { return type_ref_1.TypeRefSchema; } });
|
|
20
|
-
var
|
|
21
|
-
Object.defineProperty(exports, "
|
|
20
|
+
var variable_like_1 = require("./variable-like");
|
|
21
|
+
Object.defineProperty(exports, "VariableLikeSchema", { enumerable: true, get: function () { return variable_like_1.VariableLikeSchema; } });
|
|
22
22
|
var class_1 = require("./class");
|
|
23
23
|
Object.defineProperty(exports, "ClassSchema", { enumerable: true, get: function () { return class_1.ClassSchema; } });
|
|
24
24
|
var constructor_1 = require("./constructor");
|
|
@@ -69,5 +69,9 @@ var template_literal_type_span_1 = require("./template-literal-type-span");
|
|
|
69
69
|
Object.defineProperty(exports, "TemplateLiteralTypeSpanSchema", { enumerable: true, get: function () { return template_literal_type_span_1.TemplateLiteralTypeSpanSchema; } });
|
|
70
70
|
var this_type_1 = require("./this-type");
|
|
71
71
|
Object.defineProperty(exports, "ThisTypeSchema", { enumerable: true, get: function () { return this_type_1.ThisTypeSchema; } });
|
|
72
|
+
var unknown_schema_1 = require("./unknown-schema");
|
|
73
|
+
Object.defineProperty(exports, "UnknownSchema", { enumerable: true, get: function () { return unknown_schema_1.UnknownSchema; } });
|
|
74
|
+
var unresolved_schema_1 = require("./unresolved-schema");
|
|
75
|
+
Object.defineProperty(exports, "UnresolvedSchema", { enumerable: true, get: function () { return unresolved_schema_1.UnresolvedSchema; } });
|
|
72
76
|
__exportStar(require("./docs"), exports);
|
|
73
77
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,iDAA+D;AAAtD,mHAAA,kBAAkB,OAAA;AAC3B,uCAA2C;AAAlC,yGAAA,aAAa,OAAA;AACtB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,iDAA+D;AAAtD,mHAAA,kBAAkB,OAAA;AAC3B,uCAA2C;AAAlC,yGAAA,aAAa,OAAA;AACtB,iDAAqD;AAA5C,mHAAA,kBAAkB,OAAA;AAC3B,iCAAsC;AAA7B,oGAAA,WAAW,OAAA;AACpB,6CAAkD;AAAzC,gHAAA,iBAAiB,OAAA;AAC1B,+BAAoC;AAA3B,kGAAA,UAAU,OAAA;AACnB,yDAA6D;AAApD,2HAAA,sBAAsB,OAAA;AAC/B,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AACxB,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,qDAAyD;AAAhD,uHAAA,oBAAoB,OAAA;AAC7B,yCAA8C;AAArC,4GAAA,eAAe,OAAA;AACxB,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AACxB,mDAAuD;AAA9C,qHAAA,mBAAmB,OAAA;AAC5B,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AACxB,iDAAqD;AAA5C,mHAAA,kBAAkB,OAAA;AAC3B,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AACxB,yCAA8C;AAArC,4GAAA,eAAe,OAAA;AACxB,+BAAoC;AAA3B,kGAAA,UAAU,OAAA;AACnB,2DAA+D;AAAtD,6HAAA,uBAAuB,OAAA;AAChC,mDAAuD;AAA9C,qHAAA,mBAAmB,OAAA;AAC5B,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,iEAAoE;AAA3D,kIAAA,yBAAyB,OAAA;AAClC,2EAA6E;AAApE,2IAAA,6BAA6B,OAAA;AACtC,yCAA6C;AAApC,2GAAA,cAAc,OAAA;AACvB,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,yCAAuB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Location, SchemaNode } from '../schema-node';
|
|
2
|
+
/**
|
|
3
|
+
* needed for better backward and forward compatibility.
|
|
4
|
+
* in case a previous version of the semantic-schema had a schema class that doesn't exist anymore, then it'll be
|
|
5
|
+
* wrapped in this class.
|
|
6
|
+
*/
|
|
7
|
+
export declare class UnknownSchema extends SchemaNode {
|
|
8
|
+
readonly location: Location;
|
|
9
|
+
readonly schemaName: string;
|
|
10
|
+
readonly schemaObj: Record<string, any>;
|
|
11
|
+
constructor(location: Location, schemaName: string, schemaObj: Record<string, any>);
|
|
12
|
+
toString(): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnknownSchema = void 0;
|
|
4
|
+
const schema_node_1 = require("../schema-node");
|
|
5
|
+
/**
|
|
6
|
+
* needed for better backward and forward compatibility.
|
|
7
|
+
* in case a previous version of the semantic-schema had a schema class that doesn't exist anymore, then it'll be
|
|
8
|
+
* wrapped in this class.
|
|
9
|
+
*/
|
|
10
|
+
class UnknownSchema extends schema_node_1.SchemaNode {
|
|
11
|
+
constructor(location, schemaName, schemaObj) {
|
|
12
|
+
super();
|
|
13
|
+
this.location = location;
|
|
14
|
+
this.schemaName = schemaName;
|
|
15
|
+
this.schemaObj = schemaObj;
|
|
16
|
+
}
|
|
17
|
+
toString() {
|
|
18
|
+
return `<<unknown schema ${this.schemaName}>>`;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.UnknownSchema = UnknownSchema;
|
|
22
|
+
//# sourceMappingURL=unknown-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unknown-schema.js","sourceRoot":"","sources":["../../schemas/unknown-schema.ts"],"names":[],"mappings":";;;AAAA,gDAAsD;AAEtD;;;;GAIG;AACH,MAAa,aAAc,SAAQ,wBAAU;IAC3C,YAAqB,QAAkB,EAAW,UAAkB,EAAW,SAA8B;QAC3G,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAW,eAAU,GAAV,UAAU,CAAQ;QAAW,cAAS,GAAT,SAAS,CAAqB;IAE7G,CAAC;IAED,QAAQ;QACN,OAAO,oBAAoB,IAAI,CAAC,UAAU,IAAI,CAAC;IACjD,CAAC;CACF;AARD,sCAQC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Location, SchemaNode } from '../schema-node';
|
|
2
|
+
/**
|
|
3
|
+
* needed for cases when the exported entity could not be resolved.
|
|
4
|
+
* e.g. exporting mdx variables in the main index.ts file.
|
|
5
|
+
*/
|
|
6
|
+
export declare class UnresolvedSchema extends SchemaNode {
|
|
7
|
+
readonly location: Location;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
constructor(location: Location, name: string);
|
|
10
|
+
toString(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnresolvedSchema = void 0;
|
|
4
|
+
const schema_node_1 = require("../schema-node");
|
|
5
|
+
/**
|
|
6
|
+
* needed for cases when the exported entity could not be resolved.
|
|
7
|
+
* e.g. exporting mdx variables in the main index.ts file.
|
|
8
|
+
*/
|
|
9
|
+
class UnresolvedSchema extends schema_node_1.SchemaNode {
|
|
10
|
+
constructor(location, name) {
|
|
11
|
+
super();
|
|
12
|
+
this.location = location;
|
|
13
|
+
this.name = name;
|
|
14
|
+
}
|
|
15
|
+
toString() {
|
|
16
|
+
return this.name;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.UnresolvedSchema = UnresolvedSchema;
|
|
20
|
+
//# sourceMappingURL=unresolved-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unresolved-schema.js","sourceRoot":"","sources":["../../schemas/unresolved-schema.ts"],"names":[],"mappings":";;;AAAA,gDAAsD;AAEtD;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,wBAAU;IAC9C,YAAqB,QAAkB,EAAW,IAAY;QAC5D,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAW,SAAI,GAAJ,IAAI,CAAQ;IAE9D,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF;AARD,4CAQC"}
|
|
@@ -2,7 +2,7 @@ import { Location, SchemaNode } from '../schema-node';
|
|
|
2
2
|
/**
|
|
3
3
|
* can be also a property or property-signature
|
|
4
4
|
*/
|
|
5
|
-
export declare class
|
|
5
|
+
export declare class VariableLikeSchema extends SchemaNode {
|
|
6
6
|
readonly location: Location;
|
|
7
7
|
readonly name: string;
|
|
8
8
|
readonly signature: string;
|
|
@@ -9,7 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.VariableLikeSchema = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const chalk_1 = __importDefault(require("chalk"));
|
|
15
15
|
const schema_node_1 = require("../schema-node");
|
|
@@ -17,7 +17,7 @@ const class_transformers_1 = require("../class-transformers");
|
|
|
17
17
|
/**
|
|
18
18
|
* can be also a property or property-signature
|
|
19
19
|
*/
|
|
20
|
-
class
|
|
20
|
+
class VariableLikeSchema extends schema_node_1.SchemaNode {
|
|
21
21
|
constructor(location, name, signature, type, isOptional) {
|
|
22
22
|
super();
|
|
23
23
|
this.location = location;
|
|
@@ -32,6 +32,6 @@ class VariableSchema extends schema_node_1.SchemaNode {
|
|
|
32
32
|
}
|
|
33
33
|
__decorate([
|
|
34
34
|
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
35
|
-
],
|
|
36
|
-
exports.
|
|
37
|
-
//# sourceMappingURL=variable.js.map
|
|
35
|
+
], VariableLikeSchema.prototype, "type", void 0);
|
|
36
|
+
exports.VariableLikeSchema = VariableLikeSchema;
|
|
37
|
+
//# sourceMappingURL=variable-like.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable-like.js","sourceRoot":"","sources":["../../schemas/variable-like.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAA4D;AAE5D;;GAEG;AACH,MAAa,kBAAmB,SAAQ,wBAAU;IAGhD,YACW,QAAkB,EAClB,IAAY,EACZ,SAAiB,EAC1B,IAAgB,EACP,UAAmB;QAE5B,KAAK,EAAE,CAAC;QANC,aAAQ,GAAR,QAAQ,CAAU;QAClB,SAAI,GAAJ,IAAI,CAAQ;QACZ,cAAS,GAAT,SAAS,CAAQ;QAEjB,eAAU,GAAV,UAAU,CAAS;QAG5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC1F,CAAC;CACF;AAfC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;gDACd;AAFnB,gDAiBC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/semantics.entities.semantic-schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
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.21"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -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.21/dist/semantic-schema.docs.md')]
|
package/schema-node.ts
CHANGED
|
@@ -19,4 +19,11 @@ export abstract class SchemaNode {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export type Location = {
|
|
22
|
+
export type Location = {
|
|
23
|
+
/**
|
|
24
|
+
* file-path relative to the component root-dir. normalized to Linux.
|
|
25
|
+
*/
|
|
26
|
+
filePath: string;
|
|
27
|
+
line: number;
|
|
28
|
+
character: number;
|
|
29
|
+
};
|
package/schemas/docs/doc.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { TagName, TagSchema } from './tag';
|
|
|
6
6
|
export class DocSchema extends SchemaNode {
|
|
7
7
|
@Transform(schemaObjArrayToInstances)
|
|
8
8
|
readonly tags?: TagSchema[];
|
|
9
|
-
constructor(readonly location: Location, readonly comment?: string, tags?: TagSchema[]) {
|
|
9
|
+
constructor(readonly location: Location, readonly raw: string, readonly comment?: string, tags?: TagSchema[]) {
|
|
10
10
|
super();
|
|
11
11
|
this.tags = tags;
|
|
12
12
|
}
|
package/schemas/docs/index.ts
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Transform } from 'class-transformer';
|
|
2
|
+
import { Location, SchemaNode } from '../../schema-node';
|
|
3
|
+
import { TagName, TagSchema } from './tag';
|
|
4
|
+
import { schemaObjToInstance } from '../../class-transformers';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* e.g. `@param myParam {string} some comment`
|
|
8
|
+
*/
|
|
9
|
+
export class PropertyLikeTagSchema extends TagSchema {
|
|
10
|
+
@Transform(schemaObjToInstance)
|
|
11
|
+
readonly type?: SchemaNode;
|
|
12
|
+
constructor(readonly location: Location, readonly paramName: string, readonly comment?: string, type?: SchemaNode) {
|
|
13
|
+
super(location, TagName.parameter, comment);
|
|
14
|
+
this.type = type;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
toString() {
|
|
18
|
+
const comment = this.comment ? ` ${this.comment}` : '';
|
|
19
|
+
const type = this.type ? ` {${this.type.toString()}} ` : '';
|
|
20
|
+
return `@${this.tagName} ${this.paramName}${type} ${comment}`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { Transform } from 'class-transformer';
|
|
1
2
|
import { Location, SchemaNode } from '../../schema-node';
|
|
2
3
|
import { TagName, TagSchema } from './tag';
|
|
4
|
+
import { schemaObjToInstance } from '../../class-transformers';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* e.g. `@return {string} some comment`
|
|
6
8
|
*/
|
|
7
9
|
export class ReturnTagSchema extends TagSchema {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
) {
|
|
14
|
-
super(location, tagName, comment);
|
|
10
|
+
@Transform(schemaObjToInstance)
|
|
11
|
+
readonly type?: SchemaNode;
|
|
12
|
+
constructor(readonly location: Location, readonly comment?: string, type?: SchemaNode) {
|
|
13
|
+
super(location, TagName.return, comment);
|
|
14
|
+
this.type = type;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
toString() {
|
package/schemas/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Module } from './module';
|
|
2
2
|
export { FunctionLikeSchema, Modifier } from './function-like';
|
|
3
3
|
export { TypeRefSchema } from './type-ref';
|
|
4
|
-
export {
|
|
4
|
+
export { VariableLikeSchema } from './variable-like';
|
|
5
5
|
export { ClassSchema } from './class';
|
|
6
6
|
export { ConstructorSchema } from './constructor';
|
|
7
7
|
export { TypeSchema } from './type';
|
|
@@ -27,4 +27,6 @@ export { IndexedAccessSchema } from './indexed-access-type';
|
|
|
27
27
|
export { TemplateLiteralTypeSchema } from './template-literal-type';
|
|
28
28
|
export { TemplateLiteralTypeSpanSchema } from './template-literal-type-span';
|
|
29
29
|
export { ThisTypeSchema } from './this-type';
|
|
30
|
+
export { UnknownSchema } from './unknown-schema';
|
|
31
|
+
export { UnresolvedSchema } from './unresolved-schema';
|
|
30
32
|
export * from './docs';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Location, SchemaNode } from '../schema-node';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* needed for better backward and forward compatibility.
|
|
5
|
+
* in case a previous version of the semantic-schema had a schema class that doesn't exist anymore, then it'll be
|
|
6
|
+
* wrapped in this class.
|
|
7
|
+
*/
|
|
8
|
+
export class UnknownSchema extends SchemaNode {
|
|
9
|
+
constructor(readonly location: Location, readonly schemaName: string, readonly schemaObj: Record<string, any>) {
|
|
10
|
+
super();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
toString() {
|
|
14
|
+
return `<<unknown schema ${this.schemaName}>>`;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Location, SchemaNode } from '../schema-node';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* needed for cases when the exported entity could not be resolved.
|
|
5
|
+
* e.g. exporting mdx variables in the main index.ts file.
|
|
6
|
+
*/
|
|
7
|
+
export class UnresolvedSchema extends SchemaNode {
|
|
8
|
+
constructor(readonly location: Location, readonly name: string) {
|
|
9
|
+
super();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
toString() {
|
|
13
|
+
return this.name;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -6,7 +6,7 @@ import { schemaObjToInstance } from '../class-transformers';
|
|
|
6
6
|
/**
|
|
7
7
|
* can be also a property or property-signature
|
|
8
8
|
*/
|
|
9
|
-
export class
|
|
9
|
+
export class VariableLikeSchema extends SchemaNode {
|
|
10
10
|
@Transform(schemaObjToInstance)
|
|
11
11
|
type: SchemaNode;
|
|
12
12
|
constructor(
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"variable.js","sourceRoot":"","sources":["../../schemas/variable.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAA4D;AAE5D;;GAEG;AACH,MAAa,cAAe,SAAQ,wBAAU;IAG5C,YACW,QAAkB,EAClB,IAAY,EACZ,SAAiB,EAC1B,IAAgB,EACP,UAAmB;QAE5B,KAAK,EAAE,CAAC;QANC,aAAQ,GAAR,QAAQ,CAAU;QAClB,SAAI,GAAJ,IAAI,CAAQ;QACZ,cAAS,GAAT,SAAS,CAAQ;QAEjB,eAAU,GAAV,UAAU,CAAS;QAG5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC1F,CAAC;CACF;AAfC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;4CACd;AAFnB,wCAiBC"}
|
|
Binary file
|