@teambit/semantics.entities.semantic-schema 0.0.14 → 0.0.17
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 +10 -2
- package/class-transformers/comp-id-transformer.ts +22 -0
- package/class-transformers/index.ts +2 -0
- package/{schema-obj-to-class.ts → class-transformers/schema-obj-to-class.ts} +12 -3
- package/dist/api-schema.d.ts +3 -1
- package/dist/api-schema.js +11 -4
- package/dist/api-schema.js.map +1 -1
- package/dist/class-transformers/comp-id-transformer.d.ts +6 -0
- package/dist/class-transformers/comp-id-transformer.js +20 -0
- package/dist/class-transformers/comp-id-transformer.js.map +1 -0
- package/dist/class-transformers/index.d.ts +2 -0
- package/dist/class-transformers/index.js +9 -0
- package/dist/class-transformers/index.js.map +1 -0
- package/dist/{schema-obj-to-class.d.ts → class-transformers/schema-obj-to-class.d.ts} +3 -3
- package/dist/{schema-obj-to-class.js → class-transformers/schema-obj-to-class.js} +5 -2
- package/dist/class-transformers/schema-obj-to-class.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +14 -30
- package/dist/index.js.map +1 -1
- package/dist/schema-node.d.ts +2 -0
- package/dist/schema-node.js.map +1 -1
- package/dist/schemas/class.d.ts +3 -1
- package/dist/schemas/class.js +7 -3
- package/dist/schemas/class.js.map +1 -1
- package/dist/schemas/constructor.js +2 -2
- package/dist/schemas/constructor.js.map +1 -1
- package/dist/schemas/docs/doc.d.ts +11 -0
- package/dist/schemas/docs/doc.js +37 -0
- package/dist/schemas/docs/doc.js.map +1 -0
- package/dist/schemas/docs/index.d.ts +3 -0
- package/dist/schemas/docs/index.js +10 -0
- package/dist/schemas/docs/index.js.map +1 -0
- package/dist/schemas/docs/return-tag.d.ts +13 -0
- package/dist/schemas/docs/return-tag.js +22 -0
- package/dist/schemas/docs/return-tag.js.map +1 -0
- package/dist/schemas/docs/tag.d.ts +33 -0
- package/dist/schemas/docs/tag.js +44 -0
- package/dist/schemas/docs/tag.js.map +1 -0
- package/dist/schemas/function-like.d.ts +6 -2
- package/dist/schemas/function-like.js +21 -10
- package/dist/schemas/function-like.js.map +1 -1
- package/dist/schemas/get-accessor.js +2 -2
- package/dist/schemas/get-accessor.js.map +1 -1
- package/dist/schemas/index-signature.js +3 -3
- package/dist/schemas/index-signature.js.map +1 -1
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +14 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/indexed-access-type.js +3 -3
- package/dist/schemas/indexed-access-type.js.map +1 -1
- package/dist/schemas/interface.js +2 -2
- package/dist/schemas/interface.js.map +1 -1
- package/dist/schemas/keyword-type.d.ts +1 -1
- package/dist/schemas/keyword-type.js.map +1 -1
- package/dist/schemas/module.js +2 -2
- package/dist/schemas/module.js.map +1 -1
- package/dist/schemas/parameter.js +2 -2
- package/dist/schemas/parameter.js.map +1 -1
- package/dist/schemas/parenthesized-type.js +2 -2
- package/dist/schemas/parenthesized-type.js.map +1 -1
- package/dist/schemas/set-accessor.js +2 -2
- package/dist/schemas/set-accessor.js.map +1 -1
- package/dist/schemas/template-literal-type-span.js +2 -2
- package/dist/schemas/template-literal-type-span.js.map +1 -1
- package/dist/schemas/template-literal-type.js +2 -2
- package/dist/schemas/template-literal-type.js.map +1 -1
- package/dist/schemas/this-type.d.ts +9 -0
- package/dist/schemas/this-type.js +18 -0
- package/dist/schemas/this-type.js.map +1 -0
- package/dist/schemas/tuple-type.js +2 -2
- package/dist/schemas/tuple-type.js.map +1 -1
- package/dist/schemas/type-array.js +2 -2
- package/dist/schemas/type-array.js.map +1 -1
- package/dist/schemas/type-intersection.js +2 -2
- package/dist/schemas/type-intersection.js.map +1 -1
- package/dist/schemas/type-literal.js +2 -2
- package/dist/schemas/type-literal.js.map +1 -1
- package/dist/schemas/type-operator.js +2 -2
- package/dist/schemas/type-operator.js.map +1 -1
- package/dist/schemas/type-predicate.js +2 -2
- package/dist/schemas/type-predicate.js.map +1 -1
- package/dist/schemas/type-query.js +2 -2
- package/dist/schemas/type-query.js.map +1 -1
- package/dist/schemas/type-ref.d.ts +1 -4
- package/dist/schemas/type-ref.js +7 -3
- package/dist/schemas/type-ref.js.map +1 -1
- package/dist/schemas/type-union.js +2 -2
- package/dist/schemas/type-union.js.map +1 -1
- package/dist/schemas/type.js +2 -2
- package/dist/schemas/type.js.map +1 -1
- package/dist/schemas/variable.js +2 -2
- package/dist/schemas/variable.js.map +1 -1
- package/dist/tsconfig.json +32 -0
- package/index.ts +2 -32
- package/package-tar/teambit-semantics.entities.semantic-schema-0.0.17.tgz +0 -0
- package/package.json +4 -5
- package/{preview-1653494536947.js → preview-1654313169583.js} +1 -1
- package/schema-node.ts +2 -0
- package/schemas/class.ts +8 -2
- package/schemas/constructor.ts +1 -1
- package/schemas/docs/doc.ts +27 -0
- package/schemas/docs/index.ts +3 -0
- package/schemas/docs/return-tag.ts +21 -0
- package/schemas/docs/tag.ts +38 -0
- package/schemas/function-like.ts +22 -9
- package/schemas/get-accessor.ts +1 -1
- package/schemas/index-signature.ts +1 -1
- package/schemas/index.ts +2 -0
- package/schemas/indexed-access-type.ts +1 -1
- package/schemas/interface.ts +1 -1
- package/schemas/keyword-type.ts +1 -1
- package/schemas/module.ts +1 -1
- package/schemas/parameter.ts +1 -1
- package/schemas/parenthesized-type.ts +1 -1
- package/schemas/set-accessor.ts +1 -1
- package/schemas/template-literal-type-span.ts +1 -1
- package/schemas/template-literal-type.ts +1 -1
- package/schemas/this-type.ts +14 -0
- package/schemas/tuple-type.ts +1 -1
- package/schemas/type-array.ts +1 -1
- package/schemas/type-intersection.ts +1 -1
- package/schemas/type-literal.ts +1 -1
- package/schemas/type-operator.ts +1 -1
- package/schemas/type-predicate.ts +1 -1
- package/schemas/type-query.ts +1 -1
- package/schemas/type-ref.ts +7 -10
- package/schemas/type-union.ts +1 -1
- package/schemas/type.ts +1 -1
- package/schemas/variable.ts +1 -1
- package/tsconfig.json +6 -1
- package/dist/json-schema.d.ts +0 -1
- package/dist/json-schema.js +0 -3
- package/dist/json-schema.js.map +0 -1
- package/dist/schema-obj-to-class.js.map +0 -1
- package/json-schema.ts +0 -1
- package/package-tar/teambit-semantics.entities.semantic-schema-0.0.14.tgz +0 -0
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.TypeOperatorSchema = void 0;
|
|
10
10
|
const class_transformer_1 = require("class-transformer");
|
|
11
11
|
const schema_node_1 = require("../schema-node");
|
|
12
|
-
const
|
|
12
|
+
const class_transformers_1 = require("../class-transformers");
|
|
13
13
|
class TypeOperatorSchema extends schema_node_1.SchemaNode {
|
|
14
14
|
constructor(location, operatorName, type) {
|
|
15
15
|
super();
|
|
@@ -22,7 +22,7 @@ class TypeOperatorSchema extends schema_node_1.SchemaNode {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
__decorate([
|
|
25
|
-
(0, class_transformer_1.Transform)(
|
|
25
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
26
26
|
], TypeOperatorSchema.prototype, "type", void 0);
|
|
27
27
|
exports.TypeOperatorSchema = TypeOperatorSchema;
|
|
28
28
|
//# sourceMappingURL=type-operator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-operator.js","sourceRoot":"","sources":["../../schemas/type-operator.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"type-operator.js","sourceRoot":"","sources":["../../schemas/type-operator.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,8DAA4D;AAE5D,MAAa,kBAAmB,SAAQ,wBAAU;IAGhD,YAAqB,QAAkB,EAAW,YAAoB,EAAE,IAAgB;QACtF,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAW,iBAAY,GAAZ,YAAY,CAAQ;QAEpE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;IACxD,CAAC;CACF;AATC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;gDACd;AAFnB,gDAWC"}
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.TypePredicateSchema = void 0;
|
|
10
10
|
const class_transformer_1 = require("class-transformer");
|
|
11
11
|
const schema_node_1 = require("../schema-node");
|
|
12
|
-
const
|
|
12
|
+
const class_transformers_1 = require("../class-transformers");
|
|
13
13
|
/**
|
|
14
14
|
* e.g. `function f(str: any): str is string {}`
|
|
15
15
|
*
|
|
@@ -38,7 +38,7 @@ class TypePredicateSchema extends schema_node_1.SchemaNode {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
__decorate([
|
|
41
|
-
(0, class_transformer_1.Transform)(
|
|
41
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
42
42
|
], TypePredicateSchema.prototype, "type", void 0);
|
|
43
43
|
exports.TypePredicateSchema = TypePredicateSchema;
|
|
44
44
|
//# sourceMappingURL=type-predicate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-predicate.js","sourceRoot":"","sources":["../../schemas/type-predicate.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"type-predicate.js","sourceRoot":"","sources":["../../schemas/type-predicate.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,8DAA4D;AAE5D;;;;;;;;;;;;GAYG;AACH,MAAa,mBAAoB,SAAQ,wBAAU;IAGjD,YACW,QAAkB,EAClB,aAAqB,EAC9B,IAAiB,EACR,qBAAqB,KAAK;QAEnC,KAAK,EAAE,CAAC;QALC,aAAQ,GAAR,QAAQ,CAAU;QAClB,kBAAa,GAAb,aAAa,CAAQ;QAErB,uBAAkB,GAAlB,kBAAkB,CAAQ;QAGnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,MAAM,cAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,OAAO,cAAc,GAAG,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;IACvD,CAAC;CACF;AAhBC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;iDACJ;AAF7B,kDAkBC"}
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.TypeQuerySchema = void 0;
|
|
10
10
|
const class_transformer_1 = require("class-transformer");
|
|
11
11
|
const schema_node_1 = require("../schema-node");
|
|
12
|
-
const
|
|
12
|
+
const class_transformers_1 = require("../class-transformers");
|
|
13
13
|
/**
|
|
14
14
|
* e.g. `typeof Foo`
|
|
15
15
|
*/
|
|
@@ -28,7 +28,7 @@ class TypeQuerySchema extends schema_node_1.SchemaNode {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
__decorate([
|
|
31
|
-
(0, class_transformer_1.Transform)(
|
|
31
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
32
32
|
], TypeQuerySchema.prototype, "type", void 0);
|
|
33
33
|
exports.TypeQuerySchema = TypeQuerySchema;
|
|
34
34
|
//# sourceMappingURL=type-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-query.js","sourceRoot":"","sources":["../../schemas/type-query.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"type-query.js","sourceRoot":"","sources":["../../schemas/type-query.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,8DAA4D;AAE5D;;GAEG;AACH,MAAa,eAAgB,SAAQ,wBAAU;IAG7C,YAAqB,QAAkB,EAAE,IAAgB,EAAW,SAAiB;QACnF,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAA6B,cAAS,GAAT,SAAS,CAAQ;QAEnF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IACD,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,QAAQ;QACN,OAAO,UAAU,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC1C,CAAC;CACF;AAZC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;6CACL;AAF5B,0CAcC"}
|
|
@@ -17,10 +17,6 @@ export declare class TypeRefSchema extends SchemaNode {
|
|
|
17
17
|
* name of the reference to type.
|
|
18
18
|
*/
|
|
19
19
|
readonly name: string;
|
|
20
|
-
/**
|
|
21
|
-
* target component id. existing if the type is defined in another component.
|
|
22
|
-
*/
|
|
23
|
-
readonly componentId?: ComponentID;
|
|
24
20
|
/**
|
|
25
21
|
* target package name. existing if type is defined in different package.
|
|
26
22
|
*/
|
|
@@ -29,6 +25,7 @@ export declare class TypeRefSchema extends SchemaNode {
|
|
|
29
25
|
* optional type arguments, e.g. type Foo = Bar<X, Y>. The X and Y are type arguments.
|
|
30
26
|
*/
|
|
31
27
|
typeArgs?: SchemaNode[];
|
|
28
|
+
readonly componentId?: ComponentID;
|
|
32
29
|
constructor(location: Location,
|
|
33
30
|
/**
|
|
34
31
|
* name of the reference to type.
|
package/dist/schemas/type-ref.js
CHANGED
|
@@ -13,7 +13,8 @@ exports.TypeRefSchema = 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");
|
|
16
|
-
const
|
|
16
|
+
const class_transformers_1 = require("../class-transformers");
|
|
17
|
+
const comp_id_transformer_1 = require("../class-transformers/comp-id-transformer");
|
|
17
18
|
/**
|
|
18
19
|
* can be one of the following:
|
|
19
20
|
* 1. a reference to another "export" in the same component
|
|
@@ -37,8 +38,8 @@ class TypeRefSchema extends schema_node_1.SchemaNode {
|
|
|
37
38
|
super();
|
|
38
39
|
this.location = location;
|
|
39
40
|
this.name = name;
|
|
40
|
-
this.componentId = componentId;
|
|
41
41
|
this.packageName = packageName;
|
|
42
|
+
this.componentId = componentId;
|
|
42
43
|
}
|
|
43
44
|
toString() {
|
|
44
45
|
const name = this.nameToString();
|
|
@@ -67,7 +68,10 @@ class TypeRefSchema extends schema_node_1.SchemaNode {
|
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
__decorate([
|
|
70
|
-
(0, class_transformer_1.Transform)(
|
|
71
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjArrayToInstances)
|
|
71
72
|
], TypeRefSchema.prototype, "typeArgs", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, class_transformer_1.Transform)(comp_id_transformer_1.componentIdTransformer)
|
|
75
|
+
], TypeRefSchema.prototype, "componentId", void 0);
|
|
72
76
|
exports.TypeRefSchema = TypeRefSchema;
|
|
73
77
|
//# sourceMappingURL=type-ref.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-ref.js","sourceRoot":"","sources":["../../schemas/type-ref.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAE9C,kDAA0B;AAC1B,gDAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"type-ref.js","sourceRoot":"","sources":["../../schemas/type-ref.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAE9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAAkE;AAClE,mFAAmF;AAQnF;;;;;GAKG;AACH,MAAa,aAAc,SAAQ,wBAAU;IAU3C,YACW,QAAkB;IAC3B;;OAEG;IACM,IAAY;IAErB;;OAEG;IACH,WAAyB;IAEzB;;OAEG;IACM,WAAoB;QAE7B,KAAK,EAAE,CAAC;QAhBC,aAAQ,GAAR,QAAQ,CAAU;QAIlB,SAAI,GAAJ,IAAI,CAAQ;QAUZ,gBAAW,GAAX,WAAW,CAAS;QAG7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,QAAQ;QACN,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,OAAO,IAAI,CAAC;SACb;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnE,OAAO,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC;IAC5B,CAAC;IAEO,YAAY;QAClB,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,MAAM,OAAO,GAAG,eAAK,CAAC,GAAG,CAAC,eAAe,IAAI,CAAC,WAAW,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;YACvF,OAAO,GAAG,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;SAClC;QACD,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,MAAM,MAAM,GAAG,eAAK,CAAC,GAAG,CAAC,aAAa,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;YAC3D,OAAO,GAAG,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;SACjC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,mBAAmB;QACjB,OAAO,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;IAChD,CAAC;CACF;AArDC;IAJC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;+CAIb;AAGxB;IADC,IAAA,6BAAS,EAAC,4CAAsB,CAAC;kDACC;AARrC,sCA0DC"}
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.TypeUnionSchema = void 0;
|
|
10
10
|
const class_transformer_1 = require("class-transformer");
|
|
11
11
|
const schema_node_1 = require("../schema-node");
|
|
12
|
-
const
|
|
12
|
+
const class_transformers_1 = require("../class-transformers");
|
|
13
13
|
class TypeUnionSchema extends schema_node_1.SchemaNode {
|
|
14
14
|
constructor(location, types) {
|
|
15
15
|
super();
|
|
@@ -21,7 +21,7 @@ class TypeUnionSchema extends schema_node_1.SchemaNode {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
__decorate([
|
|
24
|
-
(0, class_transformer_1.Transform)(
|
|
24
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjArrayToInstances)
|
|
25
25
|
], TypeUnionSchema.prototype, "types", void 0);
|
|
26
26
|
exports.TypeUnionSchema = TypeUnionSchema;
|
|
27
27
|
//# sourceMappingURL=type-union.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-union.js","sourceRoot":"","sources":["../../schemas/type-union.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"type-union.js","sourceRoot":"","sources":["../../schemas/type-union.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,8DAAkE;AAElE,MAAa,eAAgB,SAAQ,wBAAU;IAG7C,YAAqB,QAAkB,EAAE,KAAmB;QAC1D,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAErC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IACD,QAAQ;QACN,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IACpE,CAAC;CACF;AARC;IADC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;8CACR;AAF/B,0CAUC"}
|
package/dist/schemas/type.js
CHANGED
|
@@ -13,7 +13,7 @@ exports.TypeSchema = 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");
|
|
16
|
-
const
|
|
16
|
+
const class_transformers_1 = require("../class-transformers");
|
|
17
17
|
class TypeSchema extends schema_node_1.SchemaNode {
|
|
18
18
|
constructor(location, name, type, signature) {
|
|
19
19
|
super();
|
|
@@ -27,7 +27,7 @@ class TypeSchema extends schema_node_1.SchemaNode {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
__decorate([
|
|
30
|
-
(0, class_transformer_1.Transform)(
|
|
30
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
31
31
|
], TypeSchema.prototype, "type", void 0);
|
|
32
32
|
exports.TypeSchema = TypeSchema;
|
|
33
33
|
//# sourceMappingURL=type.js.map
|
package/dist/schemas/type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../schemas/type.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../schemas/type.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAA4D;AAE5D,MAAa,UAAW,SAAQ,wBAAU;IAGxC,YAAqB,QAAkB,EAAW,IAAY,EAAE,IAAgB,EAAW,SAAiB;QAC1G,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAW,SAAI,GAAJ,IAAI,CAAQ;QAA6B,cAAS,GAAT,SAAS,CAAQ;QAE1G,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC7D,CAAC;CACF;AATC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;wCACL;AAF5B,gCAWC"}
|
package/dist/schemas/variable.js
CHANGED
|
@@ -13,7 +13,7 @@ exports.VariableSchema = 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");
|
|
16
|
-
const
|
|
16
|
+
const class_transformers_1 = require("../class-transformers");
|
|
17
17
|
/**
|
|
18
18
|
* can be also a property or property-signature
|
|
19
19
|
*/
|
|
@@ -30,7 +30,7 @@ class VariableSchema extends schema_node_1.SchemaNode {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
__decorate([
|
|
33
|
-
(0, class_transformer_1.Transform)(
|
|
33
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
34
34
|
], VariableSchema.prototype, "type", void 0);
|
|
35
35
|
exports.VariableSchema = VariableSchema;
|
|
36
36
|
//# sourceMappingURL=variable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variable.js","sourceRoot":"","sources":["../../schemas/variable.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,
|
|
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,YAAqB,QAAkB,EAAW,IAAY,EAAW,SAAiB,EAAE,IAAgB;QAC1G,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAW,SAAI,GAAJ,IAAI,CAAQ;QAAW,cAAS,GAAT,SAAS,CAAQ;QAExF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC7D,CAAC;CACF;AATC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;4CACd;AAFnB,wCAWC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": [
|
|
4
|
+
"es2019",
|
|
5
|
+
"DOM",
|
|
6
|
+
"ES6",
|
|
7
|
+
"DOM.Iterable"
|
|
8
|
+
],
|
|
9
|
+
"target": "es2015",
|
|
10
|
+
"module": "CommonJS",
|
|
11
|
+
"jsx": "react",
|
|
12
|
+
"allowJs": true,
|
|
13
|
+
"composite": true,
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"sourceMap": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"experimentalDecorators": true,
|
|
18
|
+
"outDir": "dist",
|
|
19
|
+
"moduleResolution": "node",
|
|
20
|
+
"esModuleInterop": true,
|
|
21
|
+
"rootDir": ".",
|
|
22
|
+
"resolveJsonModule": true
|
|
23
|
+
},
|
|
24
|
+
"exclude": [
|
|
25
|
+
"dist",
|
|
26
|
+
"package.json"
|
|
27
|
+
],
|
|
28
|
+
"include": [
|
|
29
|
+
"**/*",
|
|
30
|
+
"**/*.json"
|
|
31
|
+
]
|
|
32
|
+
}
|
package/index.ts
CHANGED
|
@@ -1,35 +1,5 @@
|
|
|
1
1
|
export { APISchema } from './api-schema';
|
|
2
2
|
export { Export, StaticProperties } from './export';
|
|
3
3
|
export type { SchemaNode, Location } from './schema-node';
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
FunctionLikeSchema,
|
|
7
|
-
Modifier,
|
|
8
|
-
TypeRefSchema,
|
|
9
|
-
VariableSchema,
|
|
10
|
-
ClassSchema,
|
|
11
|
-
ConstructorSchema,
|
|
12
|
-
TypeSchema,
|
|
13
|
-
TypeIntersectionSchema,
|
|
14
|
-
TypeUnionSchema,
|
|
15
|
-
TypeLiteralSchema,
|
|
16
|
-
IndexSignatureSchema,
|
|
17
|
-
InterfaceSchema,
|
|
18
|
-
GetAccessorSchema,
|
|
19
|
-
SetAccessorSchema,
|
|
20
|
-
TypeQuerySchema,
|
|
21
|
-
InferenceTypeSchema,
|
|
22
|
-
LiteralTypeSchema,
|
|
23
|
-
KeywordTypeSchema,
|
|
24
|
-
TypeArraySchema,
|
|
25
|
-
TypeOperatorSchema,
|
|
26
|
-
TupleTypeSchema,
|
|
27
|
-
ParameterSchema,
|
|
28
|
-
EnumSchema,
|
|
29
|
-
ParenthesizedTypeSchema,
|
|
30
|
-
TypePredicateSchema,
|
|
31
|
-
IndexedAccessSchema,
|
|
32
|
-
TemplateLiteralTypeSchema,
|
|
33
|
-
TemplateLiteralTypeSpanSchema,
|
|
34
|
-
} from './schemas';
|
|
35
|
-
export type { JSONSchema, JSONSchemaObject } from './json-schema';
|
|
4
|
+
export * from './schemas';
|
|
5
|
+
export { TagName } from './schemas/docs/tag';
|
package/package.json
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/semantics.entities.semantic-schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
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.17"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
13
13
|
"class-transformer": "0.5.1",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"lodash": "4.17.21",
|
|
15
|
+
"@teambit/component-id": "0.0.402"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/json-schema": "7.0.9",
|
|
19
18
|
"@types/lodash": "4.14.165",
|
|
20
19
|
"@types/mocha": "9.1.0",
|
|
21
20
|
"@babel/runtime": "7.12.18",
|
|
@@ -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.17/dist/semantic-schema.docs.md')]
|
package/schema-node.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { instanceToPlain } from 'class-transformer';
|
|
2
|
+
import { DocSchema } from './schemas';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* a convenient abstract class for all schema to extend.
|
|
@@ -8,6 +9,7 @@ import { instanceToPlain } from 'class-transformer';
|
|
|
8
9
|
export abstract class SchemaNode {
|
|
9
10
|
readonly __schema = this.constructor.name;
|
|
10
11
|
abstract readonly location: Location;
|
|
12
|
+
readonly doc?: DocSchema;
|
|
11
13
|
readonly signature?: string;
|
|
12
14
|
|
|
13
15
|
abstract toString(): string;
|
package/schemas/class.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { Transform } from 'class-transformer';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { Location, SchemaNode } from '../schema-node';
|
|
4
|
-
import { schemaObjArrayToInstances } from '../
|
|
4
|
+
import { schemaObjArrayToInstances, schemaObjToInstance } from '../class-transformers';
|
|
5
|
+
import { DocSchema } from './docs';
|
|
5
6
|
|
|
6
7
|
export class ClassSchema extends SchemaNode {
|
|
7
8
|
@Transform(schemaObjArrayToInstances)
|
|
8
9
|
readonly members: SchemaNode[];
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
@Transform(schemaObjToInstance)
|
|
12
|
+
readonly doc?: DocSchema;
|
|
13
|
+
|
|
14
|
+
constructor(readonly className: string, members: SchemaNode[], readonly location: Location, doc?: DocSchema) {
|
|
10
15
|
super();
|
|
11
16
|
this.members = members;
|
|
17
|
+
this.doc = doc;
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
toString() {
|
package/schemas/constructor.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Transform } from 'class-transformer';
|
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { Location, SchemaNode } from '../schema-node';
|
|
4
4
|
import { ParameterSchema } from './parameter';
|
|
5
|
-
import { schemaObjArrayToInstances } from '../
|
|
5
|
+
import { schemaObjArrayToInstances } from '../class-transformers';
|
|
6
6
|
|
|
7
7
|
export class ConstructorSchema extends SchemaNode {
|
|
8
8
|
@Transform(schemaObjArrayToInstances)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Transform } from 'class-transformer';
|
|
2
|
+
import { schemaObjArrayToInstances } from '../../class-transformers';
|
|
3
|
+
import { Location, SchemaNode } from '../../schema-node';
|
|
4
|
+
import { TagName, TagSchema } from './tag';
|
|
5
|
+
|
|
6
|
+
export class DocSchema extends SchemaNode {
|
|
7
|
+
@Transform(schemaObjArrayToInstances)
|
|
8
|
+
readonly tags?: TagSchema[];
|
|
9
|
+
constructor(readonly location: Location, readonly comment?: string, tags?: TagSchema[]) {
|
|
10
|
+
super();
|
|
11
|
+
this.tags = tags;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
toString() {
|
|
15
|
+
const comment = this.comment ? `${this.comment}\n` : '';
|
|
16
|
+
const tags = this.tags ? this.tags.map((tag) => tag.toString()).join('\n') : '';
|
|
17
|
+
return `${comment}${tags}`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
hasTag(tagName: TagName) {
|
|
21
|
+
return Boolean(this.findTag(tagName));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
findTag(tagName: TagName) {
|
|
25
|
+
return this.tags?.find((tag) => tag.tagName === tagName);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Location, SchemaNode } from '../../schema-node';
|
|
2
|
+
import { TagName, TagSchema } from './tag';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* e.g. `@return {string} some comment`
|
|
6
|
+
*/
|
|
7
|
+
export class ReturnTagSchema extends TagSchema {
|
|
8
|
+
constructor(
|
|
9
|
+
readonly location: Location,
|
|
10
|
+
readonly tagName = TagName.return,
|
|
11
|
+
readonly comment?: string,
|
|
12
|
+
readonly type?: SchemaNode
|
|
13
|
+
) {
|
|
14
|
+
super(location, tagName, comment);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
toString() {
|
|
18
|
+
const comment = this.comment ? ` ${this.comment}` : '';
|
|
19
|
+
return `@${this.tagName}${comment}`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Location, SchemaNode } from '../../schema-node';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* e.g. `@deprecated please use something else`
|
|
5
|
+
*/
|
|
6
|
+
export class TagSchema extends SchemaNode {
|
|
7
|
+
constructor(readonly location: Location, readonly tagName: TagName | string, readonly comment?: string) {
|
|
8
|
+
super();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
toString() {
|
|
12
|
+
const comment = this.comment ? ` ${this.comment}` : '';
|
|
13
|
+
return `@${this.tagName}${comment}`;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum TagName {
|
|
18
|
+
augments = 'augments',
|
|
19
|
+
author = 'author',
|
|
20
|
+
class = 'class',
|
|
21
|
+
callback = 'callback',
|
|
22
|
+
public = 'public',
|
|
23
|
+
private = 'private',
|
|
24
|
+
protected = 'protected',
|
|
25
|
+
readonly = 'readonly',
|
|
26
|
+
override = 'override',
|
|
27
|
+
see = 'see',
|
|
28
|
+
enum = 'enum',
|
|
29
|
+
parameter = 'parameter',
|
|
30
|
+
this = 'this',
|
|
31
|
+
type = 'type',
|
|
32
|
+
template = 'template',
|
|
33
|
+
typedef = 'typedef',
|
|
34
|
+
property = 'property',
|
|
35
|
+
implements = 'implements',
|
|
36
|
+
return = 'return',
|
|
37
|
+
deprecated = 'deprecated',
|
|
38
|
+
}
|
package/schemas/function-like.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Transform } from 'class-transformer';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { Location, SchemaNode } from '../schema-node';
|
|
4
|
-
import { schemaObjArrayToInstances, schemaObjToInstance } from '../
|
|
4
|
+
import { schemaObjArrayToInstances, schemaObjToInstance } from '../class-transformers';
|
|
5
5
|
import { ParameterSchema } from './parameter';
|
|
6
|
+
import { DocSchema } from './docs';
|
|
7
|
+
import { TagName } from './docs/tag';
|
|
6
8
|
|
|
7
9
|
export type Modifier =
|
|
8
10
|
| 'static'
|
|
@@ -25,28 +27,39 @@ export class FunctionLikeSchema extends SchemaNode {
|
|
|
25
27
|
@Transform(schemaObjArrayToInstances)
|
|
26
28
|
readonly params: ParameterSchema[];
|
|
27
29
|
|
|
30
|
+
@Transform(schemaObjToInstance)
|
|
31
|
+
readonly doc?: DocSchema;
|
|
32
|
+
|
|
28
33
|
constructor(
|
|
29
34
|
readonly location: Location,
|
|
30
35
|
readonly name: string,
|
|
31
|
-
// readonly doc: any,
|
|
32
36
|
params: ParameterSchema[],
|
|
33
|
-
|
|
34
37
|
returnType: SchemaNode,
|
|
35
38
|
readonly signature: string,
|
|
36
|
-
readonly modifiers: Modifier[] = []
|
|
39
|
+
readonly modifiers: Modifier[] = [],
|
|
40
|
+
doc?: DocSchema,
|
|
41
|
+
readonly typeParams?: string[] // generics e.g. <T>myFunction
|
|
37
42
|
) {
|
|
38
43
|
super();
|
|
39
44
|
this.params = params;
|
|
40
45
|
this.returnType = returnType;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
getSignature() {
|
|
44
|
-
return this.signature;
|
|
46
|
+
this.doc = doc;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
toString() {
|
|
48
50
|
const paramsStr = this.params.map((param) => param.toString()).join(', ');
|
|
49
|
-
|
|
51
|
+
const typeParamsStr = this.typeParams ? `<${this.typeParams.join(', ')}>` : '';
|
|
52
|
+
return `${this.modifiersToString()}${typeParamsStr}${chalk.bold(
|
|
53
|
+
this.name
|
|
54
|
+
)}(${paramsStr}): ${this.returnType.toString()}`;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
isDeprecated(): boolean {
|
|
58
|
+
return Boolean(this.doc?.hasTag(TagName.deprecated));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
isPrivate(): boolean {
|
|
62
|
+
return Boolean(this.modifiers.find((m) => m === 'private') || this.doc?.hasTag(TagName.private));
|
|
50
63
|
}
|
|
51
64
|
|
|
52
65
|
private modifiersToString() {
|
package/schemas/get-accessor.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Transform } from 'class-transformer';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { Location, SchemaNode } from '../schema-node';
|
|
4
|
-
import { schemaObjToInstance } from '../
|
|
4
|
+
import { schemaObjToInstance } from '../class-transformers';
|
|
5
5
|
|
|
6
6
|
export class GetAccessorSchema extends SchemaNode {
|
|
7
7
|
@Transform(schemaObjToInstance)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Transform } from 'class-transformer';
|
|
2
2
|
import { Location, SchemaNode } from '../schema-node';
|
|
3
3
|
import { ParameterSchema } from './parameter';
|
|
4
|
-
import { schemaObjArrayToInstances, schemaObjToInstance } from '../
|
|
4
|
+
import { schemaObjArrayToInstances, schemaObjToInstance } from '../class-transformers';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* e.g. `{ [key: string]: boolean };`
|
package/schemas/index.ts
CHANGED
|
@@ -26,3 +26,5 @@ export { TypePredicateSchema } from './type-predicate';
|
|
|
26
26
|
export { IndexedAccessSchema } from './indexed-access-type';
|
|
27
27
|
export { TemplateLiteralTypeSchema } from './template-literal-type';
|
|
28
28
|
export { TemplateLiteralTypeSpanSchema } from './template-literal-type-span';
|
|
29
|
+
export { ThisTypeSchema } from './this-type';
|
|
30
|
+
export * from './docs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Transform } from 'class-transformer';
|
|
2
2
|
import { Location, SchemaNode } from '../schema-node';
|
|
3
|
-
import { schemaObjToInstance } from '../
|
|
3
|
+
import { schemaObjToInstance } from '../class-transformers';
|
|
4
4
|
|
|
5
5
|
export class IndexedAccessSchema extends SchemaNode {
|
|
6
6
|
@Transform(schemaObjToInstance)
|
package/schemas/interface.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Transform } from 'class-transformer';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { Location, SchemaNode } from '../schema-node';
|
|
4
|
-
import { schemaObjArrayToInstances } from '../
|
|
4
|
+
import { schemaObjArrayToInstances } from '../class-transformers';
|
|
5
5
|
|
|
6
6
|
export class InterfaceSchema extends SchemaNode {
|
|
7
7
|
@Transform(schemaObjArrayToInstances)
|
package/schemas/keyword-type.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Location, SchemaNode } from '../schema-node';
|
|
|
4
4
|
* e.g. 'string', 'boolean', etc.
|
|
5
5
|
*/
|
|
6
6
|
export class KeywordTypeSchema extends SchemaNode {
|
|
7
|
-
constructor(readonly location: Location,
|
|
7
|
+
constructor(readonly location: Location, readonly name: string) {
|
|
8
8
|
super();
|
|
9
9
|
}
|
|
10
10
|
|
package/schemas/module.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import { Transform } from 'class-transformer';
|
|
3
3
|
import { Location, SchemaNode } from '../schema-node';
|
|
4
|
-
import { schemaObjArrayToInstances } from '../
|
|
4
|
+
import { schemaObjArrayToInstances } from '../class-transformers';
|
|
5
5
|
|
|
6
6
|
export class Module extends SchemaNode {
|
|
7
7
|
@Transform(schemaObjArrayToInstances)
|
package/schemas/parameter.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Transform } from 'class-transformer';
|
|
2
2
|
import { Location, SchemaNode } from '../schema-node';
|
|
3
|
-
import { schemaObjToInstance } from '../
|
|
3
|
+
import { schemaObjToInstance } from '../class-transformers';
|
|
4
4
|
|
|
5
5
|
export class ParameterSchema extends SchemaNode {
|
|
6
6
|
@Transform(schemaObjToInstance)
|
package/schemas/set-accessor.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Transform } from 'class-transformer';
|
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { Location, SchemaNode } from '../schema-node';
|
|
4
4
|
import { ParameterSchema } from './parameter';
|
|
5
|
-
import { schemaObjToInstance } from '../
|
|
5
|
+
import { schemaObjToInstance } from '../class-transformers';
|
|
6
6
|
|
|
7
7
|
export class SetAccessorSchema extends SchemaNode {
|
|
8
8
|
@Transform(schemaObjToInstance)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Transform } from 'class-transformer';
|
|
2
2
|
import { Location, SchemaNode } from '../schema-node';
|
|
3
|
-
import { schemaObjToInstance } from '../
|
|
3
|
+
import { schemaObjToInstance } from '../class-transformers';
|
|
4
4
|
|
|
5
5
|
export class TemplateLiteralTypeSpanSchema extends SchemaNode {
|
|
6
6
|
@Transform(schemaObjToInstance)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Transform } from 'class-transformer';
|
|
2
2
|
import { Location, SchemaNode } from '../schema-node';
|
|
3
|
-
import { schemaObjArrayToInstances } from '../
|
|
3
|
+
import { schemaObjArrayToInstances } from '../class-transformers';
|
|
4
4
|
import { TemplateLiteralTypeSpanSchema } from './template-literal-type-span';
|
|
5
5
|
|
|
6
6
|
export class TemplateLiteralTypeSchema extends SchemaNode {
|