@teambit/semantics.entities.semantic-schema 0.0.77 → 0.0.79
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/api-schema.d.ts +3 -3
- package/dist/api-schema.js +160 -115
- package/dist/api-schema.js.map +1 -1
- package/dist/export.d.ts +2 -2
- package/dist/export.js +27 -23
- package/dist/export.js.map +1 -1
- package/dist/index.js +134 -39
- package/dist/index.js.map +1 -1
- package/dist/schema-node-constructor.js +1 -1
- package/dist/schema-node-constructor.js.map +1 -1
- package/dist/schema-node.js +45 -40
- package/dist/schema-node.js.map +1 -1
- package/dist/schema-registry.js +36 -23
- package/dist/schema-registry.js.map +1 -1
- package/dist/schemas/array-literal-expression.js +43 -23
- package/dist/schemas/array-literal-expression.js.map +1 -1
- package/dist/schemas/class.d.ts +17 -17
- package/dist/schemas/class.js +116 -83
- package/dist/schemas/class.js.map +1 -1
- package/dist/schemas/conditional-type.js +58 -36
- package/dist/schemas/conditional-type.js.map +1 -1
- package/dist/schemas/constructor.js +46 -18
- package/dist/schemas/constructor.js.map +1 -1
- package/dist/schemas/decorator.d.ts +12 -12
- package/dist/schemas/decorator.js +64 -40
- package/dist/schemas/decorator.js.map +1 -1
- package/dist/schemas/docs/doc.d.ts +10 -10
- package/dist/schemas/docs/doc.js +66 -51
- package/dist/schemas/docs/doc.js.map +1 -1
- package/dist/schemas/docs/index.js +57 -10
- package/dist/schemas/docs/index.js.map +1 -1
- package/dist/schemas/docs/property-like-tag.d.ts +5 -5
- package/dist/schemas/docs/property-like-tag.js +51 -32
- package/dist/schemas/docs/property-like-tag.js.map +1 -1
- package/dist/schemas/docs/return-tag.d.ts +6 -6
- package/dist/schemas/docs/return-tag.js +47 -29
- package/dist/schemas/docs/return-tag.js.map +1 -1
- package/dist/schemas/docs/tag.d.ts +5 -5
- package/dist/schemas/docs/tag.js +68 -58
- package/dist/schemas/docs/tag.js.map +1 -1
- package/dist/schemas/enum-member.d.ts +11 -11
- package/dist/schemas/enum-member.js +59 -40
- package/dist/schemas/enum-member.js.map +1 -1
- package/dist/schemas/enum.d.ts +8 -8
- package/dist/schemas/enum.js +81 -52
- package/dist/schemas/enum.js.map +1 -1
- package/dist/schemas/export.d.ts +9 -9
- package/dist/schemas/export.js +84 -58
- package/dist/schemas/export.js.map +1 -1
- package/dist/schemas/expression-with-arguments.js +53 -31
- package/dist/schemas/expression-with-arguments.js.map +1 -1
- package/dist/schemas/function-like.d.ts +16 -16
- package/dist/schemas/function-like.js +136 -99
- package/dist/schemas/function-like.js.map +1 -1
- package/dist/schemas/get-accessor.js +67 -42
- package/dist/schemas/get-accessor.js.map +1 -1
- package/dist/schemas/ignored.d.ts +1 -1
- package/dist/schemas/ignored.js +49 -30
- package/dist/schemas/ignored.js.map +1 -1
- package/dist/schemas/index-signature.js +55 -28
- package/dist/schemas/index-signature.js.map +1 -1
- package/dist/schemas/index.js +620 -107
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/indexed-access-type.js +50 -30
- package/dist/schemas/indexed-access-type.js.map +1 -1
- package/dist/schemas/inference-type.d.ts +8 -8
- package/dist/schemas/inference-type.js +54 -38
- package/dist/schemas/inference-type.js.map +1 -1
- package/dist/schemas/interface.d.ts +11 -11
- package/dist/schemas/interface.js +100 -67
- package/dist/schemas/interface.js.map +1 -1
- package/dist/schemas/keyword-type.js +35 -22
- package/dist/schemas/keyword-type.js.map +1 -1
- package/dist/schemas/literal-type.js +35 -22
- package/dist/schemas/literal-type.js.map +1 -1
- package/dist/schemas/literal-value.js +36 -23
- package/dist/schemas/literal-value.js.map +1 -1
- package/dist/schemas/module.d.ts +1 -1
- package/dist/schemas/module.js +81 -57
- package/dist/schemas/module.js.map +1 -1
- package/dist/schemas/named-tuple.d.ts +3 -3
- package/dist/schemas/named-tuple.js +48 -28
- package/dist/schemas/named-tuple.js.map +1 -1
- package/dist/schemas/object-literal-expression.js +47 -30
- package/dist/schemas/object-literal-expression.js.map +1 -1
- package/dist/schemas/parameter.d.ts +5 -5
- package/dist/schemas/parameter.js +83 -61
- package/dist/schemas/parameter.js.map +1 -1
- package/dist/schemas/parenthesized-type.js +45 -26
- package/dist/schemas/parenthesized-type.js.map +1 -1
- package/dist/schemas/property-assignment.d.ts +10 -10
- package/dist/schemas/property-assignment.js +61 -34
- package/dist/schemas/property-assignment.js.map +1 -1
- package/dist/schemas/set-accessor.d.ts +2 -2
- package/dist/schemas/set-accessor.js +60 -35
- package/dist/schemas/set-accessor.js.map +1 -1
- package/dist/schemas/template-literal-type-span.js +48 -28
- package/dist/schemas/template-literal-type-span.js.map +1 -1
- package/dist/schemas/template-literal-type.js +47 -27
- package/dist/schemas/template-literal-type.js.map +1 -1
- package/dist/schemas/this-type.js +29 -19
- package/dist/schemas/this-type.js.map +1 -1
- package/dist/schemas/tuple-type.js +42 -23
- package/dist/schemas/tuple-type.js.map +1 -1
- package/dist/schemas/type-array.js +45 -26
- package/dist/schemas/type-array.js.map +1 -1
- package/dist/schemas/type-intersection.js +45 -26
- package/dist/schemas/type-intersection.js.map +1 -1
- package/dist/schemas/type-literal.js +56 -37
- package/dist/schemas/type-literal.js.map +1 -1
- package/dist/schemas/type-operator.js +48 -28
- package/dist/schemas/type-operator.js.map +1 -1
- package/dist/schemas/type-predicate.d.ts +1 -1
- package/dist/schemas/type-predicate.js +56 -36
- package/dist/schemas/type-predicate.js.map +1 -1
- package/dist/schemas/type-query.js +51 -31
- package/dist/schemas/type-query.js.map +1 -1
- package/dist/schemas/type-ref.d.ts +8 -8
- package/dist/schemas/type-ref.js +138 -101
- package/dist/schemas/type-ref.js.map +1 -1
- package/dist/schemas/type-union.js +50 -31
- package/dist/schemas/type-union.js.map +1 -1
- package/dist/schemas/type.js +74 -43
- package/dist/schemas/type.js.map +1 -1
- package/dist/schemas/unimplemented-schema.js +37 -24
- package/dist/schemas/unimplemented-schema.js.map +1 -1
- package/dist/schemas/unknown-schema.js +37 -24
- package/dist/schemas/unknown-schema.js.map +1 -1
- package/dist/schemas/unresolved-schema.js +32 -22
- package/dist/schemas/unresolved-schema.js.map +1 -1
- package/dist/schemas/variable-like.d.ts +11 -11
- package/dist/schemas/variable-like.js +84 -51
- package/dist/schemas/variable-like.js.map +1 -1
- package/dist/type.js +1 -1
- package/dist/type.js.map +1 -1
- package/dist/unknown-schema-factory.js +13 -7
- package/dist/unknown-schema-factory.js.map +1 -1
- package/package.json +4 -4
- package/schemas/type.ts +2 -2
- package/types/asset.d.ts +15 -3
- package/dist/preview-1736711473672.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_schemaNode","data","require","UnImplementedSchema","SchemaNode","constructor","location","name","type","toString","toFullSignature","toObject","fromObject","obj","exports"],"sources":["unimplemented-schema.ts"],"sourcesContent":["import { SchemaLocation, SchemaNode } from '../schema-node';\n\nexport class UnImplementedSchema extends SchemaNode {\n constructor(\n readonly location: SchemaLocation,\n readonly name: string,\n readonly type: string\n ) {\n super();\n }\n\n toString() {\n return `<<unimplemented schema ${this.name} of type ${this.type}>>`;\n }\n\n toFullSignature(): string {\n return `<<unimplemented schema ${this.name} of type ${this.type}>>`;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n type: this.type,\n };\n }\n\n static fromObject(obj: Record<string, any>): UnImplementedSchema {\n const location = obj.location;\n const name = obj.name;\n const type = obj.type;\n return new UnImplementedSchema(location, name, type);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,mBAAmB,SAASC,wBAAU,CAAC;EAClDC,WAAWA,CACAC,QAAwB,EACxBC,IAAY,EACZC,IAAY,EACrB;IACA,KAAK,CAAC,CAAC;IAAC,KAJCF,QAAwB,GAAxBA,QAAwB;IAAA,KACxBC,IAAY,GAAZA,IAAY;IAAA,KACZC,IAAY,GAAZA,IAAY;EAGvB;EAEAC,QAAQA,CAAA,EAAG;IACT,OAAO,0BAA0B,IAAI,CAACF,IAAI,YAAY,IAAI,CAACC,IAAI,IAAI;EACrE;EAEAE,eAAeA,CAAA,EAAW;IACxB,OAAO,0BAA0B,IAAI,CAACH,IAAI,YAAY,IAAI,CAACC,IAAI,IAAI;EACrE;EAEAG,QAAQA,CAAA,EAAG;IACT,OAAO;MACL,GAAG,KAAK,CAACA,QAAQ,CAAC,CAAC;MACnBH,IAAI,EAAE,IAAI,CAACA;IACb,CAAC;EACH;EAEA,OAAOI,UAAUA,CAACC,GAAwB,EAAuB;IAC/D,MAAMP,QAAQ,GAAGO,GAAG,CAACP,QAAQ;IAC7B,MAAMC,IAAI,GAAGM,GAAG,CAACN,IAAI;IACrB,MAAMC,IAAI,GAAGK,GAAG,CAACL,IAAI;IACrB,OAAO,IAAIL,mBAAmB,CAACG,QAAQ,EAAEC,IAAI,EAAEC,IAAI,CAAC;EACtD;AACF;AAACM,OAAA,CAAAX,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -1,34 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.UnknownSchema = void 0;
|
|
4
|
-
|
|
7
|
+
function _schemaNode() {
|
|
8
|
+
const data = require("../schema-node");
|
|
9
|
+
_schemaNode = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
5
14
|
/**
|
|
6
15
|
* needed for better backward and forward compatibility.
|
|
7
16
|
* in case a previous version of the semantic-schema had a schema class that doesn't exist anymore, then it'll be
|
|
8
17
|
* wrapped in this class.
|
|
9
18
|
*/
|
|
10
|
-
class UnknownSchema extends
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
class UnknownSchema extends _schemaNode().SchemaNode {
|
|
20
|
+
constructor(location, name, schemaObj) {
|
|
21
|
+
super();
|
|
22
|
+
this.location = location;
|
|
23
|
+
this.name = name;
|
|
24
|
+
this.schemaObj = schemaObj;
|
|
25
|
+
}
|
|
26
|
+
toString() {
|
|
27
|
+
return `<<unknown schema ${this.name}>>`;
|
|
28
|
+
}
|
|
29
|
+
toFullSignature() {
|
|
30
|
+
return this.toString();
|
|
31
|
+
}
|
|
32
|
+
toObject() {
|
|
33
|
+
return {
|
|
34
|
+
...super.toObject(),
|
|
35
|
+
schemaObj: this.schemaObj
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
static fromObject(obj) {
|
|
39
|
+
const location = obj.location;
|
|
40
|
+
const name = obj.name;
|
|
41
|
+
const schemaObj = obj.schemaObj;
|
|
42
|
+
return new UnknownSchema(location, name, schemaObj);
|
|
43
|
+
}
|
|
32
44
|
}
|
|
33
45
|
exports.UnknownSchema = UnknownSchema;
|
|
46
|
+
|
|
34
47
|
//# sourceMappingURL=unknown-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_schemaNode","data","require","UnknownSchema","SchemaNode","constructor","location","name","schemaObj","toString","toFullSignature","toObject","fromObject","obj","exports"],"sources":["unknown-schema.ts"],"sourcesContent":["import { SchemaLocation, SchemaNode } from '../schema-node';\n\n/**\n * needed for better backward and forward compatibility.\n * in case a previous version of the semantic-schema had a schema class that doesn't exist anymore, then it'll be\n * wrapped in this class.\n */\nexport class UnknownSchema extends SchemaNode {\n constructor(\n readonly location: SchemaLocation,\n readonly name: string,\n readonly schemaObj: Record<string, any>\n ) {\n super();\n }\n\n toString() {\n return `<<unknown schema ${this.name}>>`;\n }\n\n toFullSignature(): string {\n return this.toString();\n }\n\n toObject() {\n return {\n ...super.toObject(),\n schemaObj: this.schemaObj,\n };\n }\n\n static fromObject(obj: Record<string, any>): UnknownSchema {\n const location = obj.location;\n const name = obj.name;\n const schemaObj = obj.schemaObj;\n return new UnknownSchema(location, name, schemaObj);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACO,MAAME,aAAa,SAASC,wBAAU,CAAC;EAC5CC,WAAWA,CACAC,QAAwB,EACxBC,IAAY,EACZC,SAA8B,EACvC;IACA,KAAK,CAAC,CAAC;IAAC,KAJCF,QAAwB,GAAxBA,QAAwB;IAAA,KACxBC,IAAY,GAAZA,IAAY;IAAA,KACZC,SAA8B,GAA9BA,SAA8B;EAGzC;EAEAC,QAAQA,CAAA,EAAG;IACT,OAAO,oBAAoB,IAAI,CAACF,IAAI,IAAI;EAC1C;EAEAG,eAAeA,CAAA,EAAW;IACxB,OAAO,IAAI,CAACD,QAAQ,CAAC,CAAC;EACxB;EAEAE,QAAQA,CAAA,EAAG;IACT,OAAO;MACL,GAAG,KAAK,CAACA,QAAQ,CAAC,CAAC;MACnBH,SAAS,EAAE,IAAI,CAACA;IAClB,CAAC;EACH;EAEA,OAAOI,UAAUA,CAACC,GAAwB,EAAiB;IACzD,MAAMP,QAAQ,GAAGO,GAAG,CAACP,QAAQ;IAC7B,MAAMC,IAAI,GAAGM,GAAG,CAACN,IAAI;IACrB,MAAMC,SAAS,GAAGK,GAAG,CAACL,SAAS;IAC/B,OAAO,IAAIL,aAAa,CAACG,QAAQ,EAAEC,IAAI,EAAEC,SAAS,CAAC;EACrD;AACF;AAACM,OAAA,CAAAX,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -1,31 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.UnresolvedSchema = void 0;
|
|
4
|
-
|
|
7
|
+
function _schemaNode() {
|
|
8
|
+
const data = require("../schema-node");
|
|
9
|
+
_schemaNode = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
5
14
|
/**
|
|
6
15
|
* needed for cases when the exported entity could not be resolved.
|
|
7
16
|
* e.g. exporting mdx variables in the main index.ts file.
|
|
8
17
|
*/
|
|
9
|
-
class UnresolvedSchema extends
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
class UnresolvedSchema extends _schemaNode().SchemaNode {
|
|
19
|
+
constructor(location, name) {
|
|
20
|
+
super();
|
|
21
|
+
this.location = location;
|
|
22
|
+
this.name = name;
|
|
23
|
+
}
|
|
24
|
+
toString() {
|
|
25
|
+
return this.name;
|
|
26
|
+
}
|
|
27
|
+
toFullSignature() {
|
|
28
|
+
return this.toString();
|
|
29
|
+
}
|
|
30
|
+
toObject() {
|
|
31
|
+
return super.toObject();
|
|
32
|
+
}
|
|
33
|
+
static fromObject(obj) {
|
|
34
|
+
const location = obj.location;
|
|
35
|
+
const name = obj.name;
|
|
36
|
+
return new UnresolvedSchema(location, name);
|
|
37
|
+
}
|
|
29
38
|
}
|
|
30
39
|
exports.UnresolvedSchema = UnresolvedSchema;
|
|
40
|
+
|
|
31
41
|
//# sourceMappingURL=unresolved-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_schemaNode","data","require","UnresolvedSchema","SchemaNode","constructor","location","name","toString","toFullSignature","toObject","fromObject","obj","exports"],"sources":["unresolved-schema.ts"],"sourcesContent":["import { SchemaLocation, SchemaNode } from '../schema-node';\n\n/**\n * needed for cases when the exported entity could not be resolved.\n * e.g. exporting mdx variables in the main index.ts file.\n */\nexport class UnresolvedSchema extends SchemaNode {\n constructor(\n readonly location: SchemaLocation,\n readonly name: string\n ) {\n super();\n }\n\n toString() {\n return this.name;\n }\n\n toFullSignature(): string {\n return this.toString();\n }\n\n toObject() {\n return super.toObject();\n }\n\n static fromObject(obj: Record<string, any>): UnresolvedSchema {\n const location = obj.location;\n const name = obj.name;\n return new UnresolvedSchema(location, name);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA;AACA;AACA;AACA;AACO,MAAME,gBAAgB,SAASC,wBAAU,CAAC;EAC/CC,WAAWA,CACAC,QAAwB,EACxBC,IAAY,EACrB;IACA,KAAK,CAAC,CAAC;IAAC,KAHCD,QAAwB,GAAxBA,QAAwB;IAAA,KACxBC,IAAY,GAAZA,IAAY;EAGvB;EAEAC,QAAQA,CAAA,EAAG;IACT,OAAO,IAAI,CAACD,IAAI;EAClB;EAEAE,eAAeA,CAAA,EAAW;IACxB,OAAO,IAAI,CAACD,QAAQ,CAAC,CAAC;EACxB;EAEAE,QAAQA,CAAA,EAAG;IACT,OAAO,KAAK,CAACA,QAAQ,CAAC,CAAC;EACzB;EAEA,OAAOC,UAAUA,CAACC,GAAwB,EAAoB;IAC5D,MAAMN,QAAQ,GAAGM,GAAG,CAACN,QAAQ;IAC7B,MAAMC,IAAI,GAAGK,GAAG,CAACL,IAAI;IACrB,OAAO,IAAIJ,gBAAgB,CAACG,QAAQ,EAAEC,IAAI,CAAC;EAC7C;AACF;AAACM,OAAA,CAAAV,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -8,10 +8,10 @@ export declare class VariableLikeSchema extends SchemaNode {
|
|
|
8
8
|
readonly name: string;
|
|
9
9
|
readonly signature: string;
|
|
10
10
|
readonly isOptional: boolean;
|
|
11
|
-
readonly defaultValue?: string;
|
|
11
|
+
readonly defaultValue?: string | undefined;
|
|
12
12
|
type: SchemaNode;
|
|
13
13
|
readonly doc?: DocSchema;
|
|
14
|
-
constructor(location: SchemaLocation, name: string, signature: string, type: SchemaNode, isOptional: boolean, doc?: DocSchema, defaultValue?: string);
|
|
14
|
+
constructor(location: SchemaLocation, name: string, signature: string, type: SchemaNode, isOptional: boolean, doc?: DocSchema, defaultValue?: string | undefined);
|
|
15
15
|
getNodes(): SchemaNode[];
|
|
16
16
|
toString(options?: {
|
|
17
17
|
color?: boolean;
|
|
@@ -26,21 +26,21 @@ export declare class VariableLikeSchema extends SchemaNode {
|
|
|
26
26
|
isOptional: boolean;
|
|
27
27
|
doc: {
|
|
28
28
|
__schema: string;
|
|
29
|
-
name: string;
|
|
29
|
+
name: string | undefined;
|
|
30
30
|
location: SchemaLocation;
|
|
31
|
-
signature: string;
|
|
31
|
+
signature: string | undefined;
|
|
32
32
|
raw: string;
|
|
33
|
-
comment: string;
|
|
33
|
+
comment: string | undefined;
|
|
34
34
|
tags: {
|
|
35
35
|
__schema: string;
|
|
36
36
|
location: SchemaLocation;
|
|
37
|
-
name: string;
|
|
38
|
-
signature: string;
|
|
37
|
+
name: string | undefined;
|
|
38
|
+
signature: string | undefined;
|
|
39
39
|
tagName: string;
|
|
40
|
-
comment: string;
|
|
41
|
-
}[];
|
|
42
|
-
};
|
|
43
|
-
defaultValue: string;
|
|
40
|
+
comment: string | undefined;
|
|
41
|
+
}[] | undefined;
|
|
42
|
+
} | undefined;
|
|
43
|
+
defaultValue: string | undefined;
|
|
44
44
|
};
|
|
45
45
|
static fromObject(obj: Record<string, any>): VariableLikeSchema;
|
|
46
46
|
}
|
|
@@ -1,61 +1,94 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
6
|
exports.VariableLikeSchema = void 0;
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
function _chalk() {
|
|
8
|
+
const data = _interopRequireDefault(require("chalk"));
|
|
9
|
+
_chalk = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _schemaNode() {
|
|
15
|
+
const data = require("../schema-node");
|
|
16
|
+
_schemaNode = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _docs() {
|
|
22
|
+
const data = require("./docs");
|
|
23
|
+
_docs = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _schemaRegistry() {
|
|
29
|
+
const data = require("../schema-registry");
|
|
30
|
+
_schemaRegistry = function () {
|
|
31
|
+
return data;
|
|
32
|
+
};
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
36
|
/**
|
|
12
37
|
* can be also a property or property-signature
|
|
13
38
|
*/
|
|
14
|
-
class VariableLikeSchema extends
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
if ((options === null || options === void 0 ? void 0 : options.showDocs) && this.doc) {
|
|
40
|
-
const docString = this.doc.toFullSignature();
|
|
41
|
-
signature = `${docString}\n${signature}`;
|
|
42
|
-
}
|
|
43
|
-
return signature;
|
|
44
|
-
}
|
|
45
|
-
toObject() {
|
|
46
|
-
var _a;
|
|
47
|
-
return Object.assign(Object.assign({}, super.toObject()), { name: this.name, signature: this.signature, type: this.type.toObject(), isOptional: this.isOptional, doc: (_a = this.doc) === null || _a === void 0 ? void 0 : _a.toObject(), defaultValue: this.defaultValue });
|
|
39
|
+
class VariableLikeSchema extends _schemaNode().SchemaNode {
|
|
40
|
+
constructor(location, name, signature, type, isOptional, doc, defaultValue) {
|
|
41
|
+
super();
|
|
42
|
+
this.location = location;
|
|
43
|
+
this.name = name;
|
|
44
|
+
this.signature = signature;
|
|
45
|
+
this.isOptional = isOptional;
|
|
46
|
+
this.defaultValue = defaultValue;
|
|
47
|
+
this.type = type;
|
|
48
|
+
this.doc = doc;
|
|
49
|
+
}
|
|
50
|
+
getNodes() {
|
|
51
|
+
return [this.type];
|
|
52
|
+
}
|
|
53
|
+
toString(options) {
|
|
54
|
+
const bold = options?.color ? _chalk().default.bold : str => str;
|
|
55
|
+
return `${bold(this.name)}${this.isOptional ? '?' : ''}: ${this.type.toString(options)}`;
|
|
56
|
+
}
|
|
57
|
+
toFullSignature(options) {
|
|
58
|
+
const namePart = `${this.name}${this.isOptional ? '?' : ''}`;
|
|
59
|
+
const typeSignature = this.type.toFullSignature(options);
|
|
60
|
+
let signature = `${namePart}: ${typeSignature}`;
|
|
61
|
+
if (this.defaultValue !== undefined) {
|
|
62
|
+
signature += ` = ${this.defaultValue}`;
|
|
48
63
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const signature = obj.signature;
|
|
53
|
-
const type = schema_registry_1.SchemaRegistry.fromObject(obj.type);
|
|
54
|
-
const isOptional = obj.isOptional;
|
|
55
|
-
const doc = obj.doc ? docs_1.DocSchema.fromObject(obj.doc) : undefined;
|
|
56
|
-
const defaultValue = obj.defaultValue;
|
|
57
|
-
return new VariableLikeSchema(location, name, signature, type, isOptional, doc, defaultValue);
|
|
64
|
+
if (options?.showDocs && this.doc) {
|
|
65
|
+
const docString = this.doc.toFullSignature();
|
|
66
|
+
signature = `${docString}\n${signature}`;
|
|
58
67
|
}
|
|
68
|
+
return signature;
|
|
69
|
+
}
|
|
70
|
+
toObject() {
|
|
71
|
+
return {
|
|
72
|
+
...super.toObject(),
|
|
73
|
+
name: this.name,
|
|
74
|
+
signature: this.signature,
|
|
75
|
+
type: this.type.toObject(),
|
|
76
|
+
isOptional: this.isOptional,
|
|
77
|
+
doc: this.doc?.toObject(),
|
|
78
|
+
defaultValue: this.defaultValue
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
static fromObject(obj) {
|
|
82
|
+
const location = obj.location;
|
|
83
|
+
const name = obj.name;
|
|
84
|
+
const signature = obj.signature;
|
|
85
|
+
const type = _schemaRegistry().SchemaRegistry.fromObject(obj.type);
|
|
86
|
+
const isOptional = obj.isOptional;
|
|
87
|
+
const doc = obj.doc ? _docs().DocSchema.fromObject(obj.doc) : undefined;
|
|
88
|
+
const defaultValue = obj.defaultValue;
|
|
89
|
+
return new VariableLikeSchema(location, name, signature, type, isOptional, doc, defaultValue);
|
|
90
|
+
}
|
|
59
91
|
}
|
|
60
92
|
exports.VariableLikeSchema = VariableLikeSchema;
|
|
93
|
+
|
|
61
94
|
//# sourceMappingURL=variable-like.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_schemaNode","_docs","_schemaRegistry","e","__esModule","default","VariableLikeSchema","SchemaNode","constructor","location","name","signature","type","isOptional","doc","defaultValue","getNodes","toString","options","bold","color","chalk","str","toFullSignature","namePart","typeSignature","undefined","showDocs","docString","toObject","fromObject","obj","SchemaRegistry","DocSchema","exports"],"sources":["variable-like.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { SchemaLocation, SchemaNode } from '../schema-node';\nimport { DocSchema } from './docs';\nimport { SchemaRegistry } from '../schema-registry';\n\n/**\n * can be also a property or property-signature\n */\nexport class VariableLikeSchema extends SchemaNode {\n type: SchemaNode;\n readonly doc?: DocSchema;\n\n constructor(\n readonly location: SchemaLocation,\n readonly name: string,\n readonly signature: string,\n type: SchemaNode,\n readonly isOptional: boolean,\n doc?: DocSchema,\n readonly defaultValue?: string\n ) {\n super();\n this.type = type;\n this.doc = doc;\n }\n\n getNodes() {\n return [this.type];\n }\n\n toString(options?: { color?: boolean }) {\n const bold = options?.color ? chalk.bold : (str: string) => str;\n return `${bold(this.name)}${this.isOptional ? '?' : ''}: ${this.type.toString(options)}`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n const namePart = `${this.name}${this.isOptional ? '?' : ''}`;\n const typeSignature = this.type.toFullSignature(options);\n let signature = `${namePart}: ${typeSignature}`;\n\n if (this.defaultValue !== undefined) {\n signature += ` = ${this.defaultValue}`;\n }\n\n if (options?.showDocs && this.doc) {\n const docString = this.doc.toFullSignature();\n signature = `${docString}\\n${signature}`;\n }\n\n return signature;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n name: this.name,\n signature: this.signature,\n type: this.type.toObject(),\n isOptional: this.isOptional,\n doc: this.doc?.toObject(),\n defaultValue: this.defaultValue,\n };\n }\n\n static fromObject(obj: Record<string, any>): VariableLikeSchema {\n const location = obj.location;\n const name = obj.name;\n const signature = obj.signature;\n const type = SchemaRegistry.fromObject(obj.type);\n const isOptional = obj.isOptional;\n const doc = obj.doc ? DocSchema.fromObject(obj.doc) : undefined;\n const defaultValue = obj.defaultValue;\n return new VariableLikeSchema(location, name, signature, type, isOptional, doc, defaultValue);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAA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GAAGsB,GAAG,CAACtB,QAAQ;IAC7B,MAAMC,IAAI,GAAGqB,GAAG,CAACrB,IAAI;IACrB,MAAMC,SAAS,GAAGoB,GAAG,CAACpB,SAAS;IAC/B,MAAMC,IAAI,GAAGoB,gCAAc,CAACF,UAAU,CAACC,GAAG,CAACnB,IAAI,CAAC;IAChD,MAAMC,UAAU,GAAGkB,GAAG,CAAClB,UAAU;IACjC,MAAMC,GAAG,GAAGiB,GAAG,CAACjB,GAAG,GAAGmB,iBAAS,CAACH,UAAU,CAACC,GAAG,CAACjB,GAAG,CAAC,GAAGY,SAAS;IAC/D,MAAMX,YAAY,GAAGgB,GAAG,CAAChB,YAAY;IACrC,OAAO,IAAIT,kBAAkB,CAACG,QAAQ,EAAEC,IAAI,EAAEC,SAAS,EAAEC,IAAI,EAAEC,UAAU,EAAEC,GAAG,EAAEC,YAAY,CAAC;EAC/F;AACF;AAACmB,OAAA,CAAA5B,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
package/dist/type.js
CHANGED
package/dist/type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["type.ts"],"sourcesContent":["export type TypeRef = {};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.UnknownSchemaFactory = void 0;
|
|
4
7
|
class UnknownSchemaFactory {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
8
|
+
static create(location, name, schemaObj) {
|
|
9
|
+
// dynamic require() to import UnknownSchema at runtime when it's needed, which breaks the circular dependency.
|
|
10
|
+
// eslint-disable-next-line global-require
|
|
11
|
+
const {
|
|
12
|
+
UnknownSchema
|
|
13
|
+
} = require('./schemas/unknown-schema');
|
|
14
|
+
return new UnknownSchema(location, name, schemaObj);
|
|
15
|
+
}
|
|
11
16
|
}
|
|
12
17
|
exports.UnknownSchemaFactory = UnknownSchemaFactory;
|
|
18
|
+
|
|
13
19
|
//# sourceMappingURL=unknown-schema-factory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["UnknownSchemaFactory","create","location","name","schemaObj","UnknownSchema","require","exports"],"sources":["unknown-schema-factory.ts"],"sourcesContent":["import { SchemaLocation } from './schema-node';\n\nexport class UnknownSchemaFactory {\n static create(location: SchemaLocation, name: string, schemaObj: Record<string, any>): any {\n // dynamic require() to import UnknownSchema at runtime when it's needed, which breaks the circular dependency.\n // eslint-disable-next-line global-require\n const { UnknownSchema } = require('./schemas/unknown-schema');\n return new UnknownSchema(location, name, schemaObj);\n }\n}\n"],"mappings":";;;;;;AAEO,MAAMA,oBAAoB,CAAC;EAChC,OAAOC,MAAMA,CAACC,QAAwB,EAAEC,IAAY,EAAEC,SAA8B,EAAO;IACzF;IACA;IACA,MAAM;MAAEC;IAAc,CAAC,GAAGC,OAAO,CAAC,0BAA0B,CAAC;IAC7D,OAAO,IAAID,aAAa,CAACH,QAAQ,EAAEC,IAAI,EAAEC,SAAS,CAAC;EACrD;AACF;AAACG,OAAA,CAAAP,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
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.79",
|
|
4
4
|
"homepage": "https://bit.cloud/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.79"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/lodash": "4.14.165",
|
|
18
18
|
"@types/mocha": "9.1.0",
|
|
19
|
-
"
|
|
20
|
-
"@
|
|
19
|
+
"chai": "4.3.0",
|
|
20
|
+
"@teambit/node.envs.node-babel-mocha": "0.1.4"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {},
|
|
23
23
|
"license": "Apache-2.0",
|
package/schemas/type.ts
CHANGED
|
@@ -21,13 +21,13 @@ export class TypeSchema extends SchemaNode {
|
|
|
21
21
|
|
|
22
22
|
toString(options?: { color?: boolean }) {
|
|
23
23
|
const bold = options?.color ? chalk.bold : (str: string) => str;
|
|
24
|
-
return
|
|
24
|
+
return `type ${bold(this.name)}: ${this.type.toString(options)}`;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
toFullSignature(options?: { showDocs?: boolean }): string {
|
|
28
28
|
const typeSignature = this.type.toFullSignature(options);
|
|
29
29
|
|
|
30
|
-
let signature =
|
|
30
|
+
let signature = `type ${this.name}: ${typeSignature}`;
|
|
31
31
|
|
|
32
32
|
if (options?.showDocs && this.doc) {
|
|
33
33
|
const docString = this.doc.toFullSignature();
|
package/types/asset.d.ts
CHANGED
|
@@ -5,12 +5,12 @@ declare module '*.png' {
|
|
|
5
5
|
declare module '*.svg' {
|
|
6
6
|
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
7
|
|
|
8
|
-
export const ReactComponent: FunctionComponent<
|
|
8
|
+
export const ReactComponent: FunctionComponent<
|
|
9
|
+
SVGProps<SVGSVGElement> & { title?: string }
|
|
10
|
+
>;
|
|
9
11
|
const src: string;
|
|
10
12
|
export default src;
|
|
11
13
|
}
|
|
12
|
-
|
|
13
|
-
// @TODO Gilad
|
|
14
14
|
declare module '*.jpg' {
|
|
15
15
|
const value: any;
|
|
16
16
|
export = value;
|
|
@@ -27,3 +27,15 @@ declare module '*.bmp' {
|
|
|
27
27
|
const value: any;
|
|
28
28
|
export = value;
|
|
29
29
|
}
|
|
30
|
+
declare module '*.otf' {
|
|
31
|
+
const value: any;
|
|
32
|
+
export = value;
|
|
33
|
+
}
|
|
34
|
+
declare module '*.woff' {
|
|
35
|
+
const value: any;
|
|
36
|
+
export = value;
|
|
37
|
+
}
|
|
38
|
+
declare module '*.woff2' {
|
|
39
|
+
const value: any;
|
|
40
|
+
export = value;
|
|
41
|
+
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
;
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.semantics_entities_semantic-schema@0.0.77/dist/semantic-schema.docs.md';
|
|
3
|
-
|
|
4
|
-
export const compositions = [];
|
|
5
|
-
export const overview = [overview_0];
|
|
6
|
-
|
|
7
|
-
export const compositions_metadata = {"compositions":[]};
|