@teambit/semantics.entities.semantic-schema 0.0.1
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/index.d.ts +4 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/json-schema.d.ts +1 -0
- package/dist/json-schema.js +3 -0
- package/dist/json-schema.js.map +1 -0
- package/dist/schema-node.d.ts +10 -0
- package/dist/schema-node.js +3 -0
- package/dist/schema-node.js.map +1 -0
- package/dist/schemas/class.d.ts +0 -0
- package/dist/schemas/class.js +1 -0
- package/dist/schemas/class.js.map +1 -0
- package/dist/schemas/enum.d.ts +0 -0
- package/dist/schemas/enum.js +1 -0
- package/dist/schemas/enum.js.map +1 -0
- package/dist/schemas/export.d.ts +39 -0
- package/dist/schemas/export.js +28 -0
- package/dist/schemas/export.js.map +1 -0
- package/dist/schemas/function.d.ts +16 -0
- package/dist/schemas/function.js +16 -0
- package/dist/schemas/function.js.map +1 -0
- package/dist/schemas/index.d.ts +4 -0
- package/dist/schemas/index.js +12 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/module.d.ts +13 -0
- package/dist/schemas/module.js +14 -0
- package/dist/schemas/module.js.map +1 -0
- package/dist/schemas/type-ref.d.ts +37 -0
- package/dist/schemas/type-ref.js +29 -0
- package/dist/schemas/type-ref.js.map +1 -0
- package/dist/schemas/type.d.ts +0 -0
- package/dist/schemas/type.js +1 -0
- package/dist/schemas/type.js.map +1 -0
- package/dist/semantic-schema.d.ts +12 -0
- package/dist/semantic-schema.docs.md +6 -0
- package/dist/semantic-schema.js +17 -0
- package/dist/semantic-schema.js.map +1 -0
- package/dist/type.d.ts +1 -0
- package/dist/type.js +3 -0
- package/dist/type.js.map +1 -0
- package/index.ts +4 -0
- package/json-schema.ts +1 -0
- package/package-tar/teambit-semantics.entities.semantic-schema-0.0.1.tgz +0 -0
- package/package.json +63 -0
- package/schema-node.ts +11 -0
- package/schemas/class.ts +0 -0
- package/schemas/enum.ts +0 -0
- package/schemas/export.ts +27 -0
- package/schemas/function.ts +23 -0
- package/schemas/index.ts +4 -0
- package/schemas/module.ts +11 -0
- package/schemas/type-ref.ts +39 -0
- package/schemas/type.ts +0 -0
- package/semantic-schema.docs.md +6 -0
- package/semantic-schema.ts +20 -0
- package/tsconfig.json +26 -0
- package/type.ts +1 -0
- package/types/asset.d.ts +29 -0
- package/types/style.d.ts +42 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeRefSchema = exports.FunctionSchema = exports.Module = exports.Export = exports.SemanticSchema = void 0;
|
|
4
|
+
var semantic_schema_1 = require("./semantic-schema");
|
|
5
|
+
Object.defineProperty(exports, "SemanticSchema", { enumerable: true, get: function () { return semantic_schema_1.SemanticSchema; } });
|
|
6
|
+
var schemas_1 = require("./schemas");
|
|
7
|
+
Object.defineProperty(exports, "Export", { enumerable: true, get: function () { return schemas_1.Export; } });
|
|
8
|
+
Object.defineProperty(exports, "Module", { enumerable: true, get: function () { return schemas_1.Module; } });
|
|
9
|
+
Object.defineProperty(exports, "FunctionSchema", { enumerable: true, get: function () { return schemas_1.FunctionSchema; } });
|
|
10
|
+
Object.defineProperty(exports, "TypeRefSchema", { enumerable: true, get: function () { return schemas_1.TypeRefSchema; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AAEvB,qCAA4F;AAAnF,iGAAA,MAAM,OAAA;AAAE,iGAAA,MAAM,OAAA;AAAoB,yGAAA,cAAc,OAAA;AAAE,wGAAA,aAAa,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { JSONSchema7 as JSONSchema, JSONSchema7Object as JSONSchemaObject } from 'json-schema';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-schema.js","sourceRoot":"","sources":["../json-schema.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-node.js","sourceRoot":"","sources":["../schema-node.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class.js","sourceRoot":"","sources":["../../schemas/class.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../schemas/enum.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SchemaNode } from '../schema-node';
|
|
2
|
+
declare type Primitive = string | number | boolean | null | undefined;
|
|
3
|
+
export declare type StaticProperties = Map<string, Primitive>;
|
|
4
|
+
export declare class Export {
|
|
5
|
+
/**
|
|
6
|
+
* named export identifier of the module export.
|
|
7
|
+
*/
|
|
8
|
+
readonly identifier: string;
|
|
9
|
+
/**
|
|
10
|
+
* API node.
|
|
11
|
+
*/
|
|
12
|
+
readonly node?: SchemaNode;
|
|
13
|
+
/**
|
|
14
|
+
* static properties attached to this export
|
|
15
|
+
* @example
|
|
16
|
+
* export hello = () => {};
|
|
17
|
+
* hello.value = "text"; // <-- staticProperty
|
|
18
|
+
* hello.count = 3; // <-- static property
|
|
19
|
+
*/
|
|
20
|
+
readonly staticProperties?: StaticProperties;
|
|
21
|
+
constructor(
|
|
22
|
+
/**
|
|
23
|
+
* named export identifier of the module export.
|
|
24
|
+
*/
|
|
25
|
+
identifier: string,
|
|
26
|
+
/**
|
|
27
|
+
* API node.
|
|
28
|
+
*/
|
|
29
|
+
node?: SchemaNode,
|
|
30
|
+
/**
|
|
31
|
+
* static properties attached to this export
|
|
32
|
+
* @example
|
|
33
|
+
* export hello = () => {};
|
|
34
|
+
* hello.value = "text"; // <-- staticProperty
|
|
35
|
+
* hello.count = 3; // <-- static property
|
|
36
|
+
*/
|
|
37
|
+
staticProperties?: StaticProperties);
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Export = void 0;
|
|
4
|
+
class Export {
|
|
5
|
+
constructor(
|
|
6
|
+
/**
|
|
7
|
+
* named export identifier of the module export.
|
|
8
|
+
*/
|
|
9
|
+
identifier,
|
|
10
|
+
/**
|
|
11
|
+
* API node.
|
|
12
|
+
*/
|
|
13
|
+
node,
|
|
14
|
+
/**
|
|
15
|
+
* static properties attached to this export
|
|
16
|
+
* @example
|
|
17
|
+
* export hello = () => {};
|
|
18
|
+
* hello.value = "text"; // <-- staticProperty
|
|
19
|
+
* hello.count = 3; // <-- static property
|
|
20
|
+
*/
|
|
21
|
+
staticProperties) {
|
|
22
|
+
this.identifier = identifier;
|
|
23
|
+
this.node = node;
|
|
24
|
+
this.staticProperties = staticProperties;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.Export = Export;
|
|
28
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../schemas/export.ts"],"names":[],"mappings":";;;AAKA,MAAa,MAAM;IACjB;IACE;;OAEG;IACM,UAAkB;IAE3B;;OAEG;IACM,IAAiB;IAE1B;;;;;;OAMG;IACM,gBAAmC;QAdnC,eAAU,GAAV,UAAU,CAAQ;QAKlB,SAAI,GAAJ,IAAI,CAAa;QASjB,qBAAgB,GAAhB,gBAAgB,CAAmB;IAC3C,CAAC;CACL;AArBD,wBAqBC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SchemaNode } from '../schema-node';
|
|
2
|
+
import { TypeRefSchema } from './type-ref';
|
|
3
|
+
export declare type Argument = {
|
|
4
|
+
name: string;
|
|
5
|
+
defaultValue?: any;
|
|
6
|
+
description: any;
|
|
7
|
+
type: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class FunctionSchema implements SchemaNode {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly args: Argument[];
|
|
12
|
+
readonly returnType: TypeRefSchema;
|
|
13
|
+
constructor(name: string, args: Argument[], returnType: TypeRefSchema);
|
|
14
|
+
serialize(): void;
|
|
15
|
+
toJsonSchema(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FunctionSchema = void 0;
|
|
4
|
+
class FunctionSchema {
|
|
5
|
+
constructor(name,
|
|
6
|
+
// readonly doc: any,
|
|
7
|
+
args, returnType) {
|
|
8
|
+
this.name = name;
|
|
9
|
+
this.args = args;
|
|
10
|
+
this.returnType = returnType;
|
|
11
|
+
}
|
|
12
|
+
serialize() { }
|
|
13
|
+
toJsonSchema() { }
|
|
14
|
+
}
|
|
15
|
+
exports.FunctionSchema = FunctionSchema;
|
|
16
|
+
//# sourceMappingURL=function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function.js","sourceRoot":"","sources":["../../schemas/function.ts"],"names":[],"mappings":";;;AAUA,MAAa,cAAc;IACzB,YACW,IAAY;IACrB,qBAAqB;IACZ,IAAgB,EAEhB,UAAyB;QAJzB,SAAI,GAAJ,IAAI,CAAQ;QAEZ,SAAI,GAAJ,IAAI,CAAY;QAEhB,eAAU,GAAV,UAAU,CAAe;IACjC,CAAC;IAEJ,SAAS,KAAI,CAAC;IAEd,YAAY,KAAI,CAAC;CAClB;AAZD,wCAYC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeRefSchema = exports.FunctionSchema = exports.Export = exports.Module = void 0;
|
|
4
|
+
var module_1 = require("./module");
|
|
5
|
+
Object.defineProperty(exports, "Module", { enumerable: true, get: function () { return module_1.Module; } });
|
|
6
|
+
var export_1 = require("./export");
|
|
7
|
+
Object.defineProperty(exports, "Export", { enumerable: true, get: function () { return export_1.Export; } });
|
|
8
|
+
var function_1 = require("./function");
|
|
9
|
+
Object.defineProperty(exports, "FunctionSchema", { enumerable: true, get: function () { return function_1.FunctionSchema; } });
|
|
10
|
+
var type_ref_1 = require("./type-ref");
|
|
11
|
+
Object.defineProperty(exports, "TypeRefSchema", { enumerable: true, get: function () { return type_ref_1.TypeRefSchema; } });
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../schemas/index.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,mCAAoD;AAA3C,gGAAA,MAAM,OAAA;AACf,uCAA4C;AAAnC,0GAAA,cAAc,OAAA;AACvB,uCAA2C;AAAlC,yGAAA,aAAa,OAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Export } from './export';
|
|
2
|
+
import { SchemaNode } from '../schema-node';
|
|
3
|
+
export declare class Module implements SchemaNode {
|
|
4
|
+
/**
|
|
5
|
+
* all module exports.
|
|
6
|
+
*/
|
|
7
|
+
readonly exports: Export[];
|
|
8
|
+
constructor(
|
|
9
|
+
/**
|
|
10
|
+
* all module exports.
|
|
11
|
+
*/
|
|
12
|
+
exports: Export[]);
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Module = void 0;
|
|
4
|
+
class Module {
|
|
5
|
+
constructor(
|
|
6
|
+
/**
|
|
7
|
+
* all module exports.
|
|
8
|
+
*/
|
|
9
|
+
exports) {
|
|
10
|
+
this.exports = exports;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.Module = Module;
|
|
14
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../schemas/module.ts"],"names":[],"mappings":";;;AAGA,MAAa,MAAM;IACjB;IACE;;OAEG;IACM,OAAiB;QAAjB,YAAO,GAAP,OAAO,CAAU;IACzB,CAAC;CACL;AAPD,wBAOC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ComponentID } from '@teambit/component';
|
|
2
|
+
import { SchemaNode } from '../schema-node';
|
|
3
|
+
export declare type PlainTypeRefSchema = {
|
|
4
|
+
name: string;
|
|
5
|
+
componentId?: string;
|
|
6
|
+
packageName?: string;
|
|
7
|
+
node?: SchemaNode;
|
|
8
|
+
};
|
|
9
|
+
export declare class TypeRefSchema implements SchemaNode {
|
|
10
|
+
/**
|
|
11
|
+
* name of the reference to type.
|
|
12
|
+
*/
|
|
13
|
+
readonly name: string;
|
|
14
|
+
/**
|
|
15
|
+
* target component id. existing if the type is defined in another component.
|
|
16
|
+
*/
|
|
17
|
+
readonly componentId?: ComponentID;
|
|
18
|
+
/**
|
|
19
|
+
* target package name. existing if type is defined in different package.
|
|
20
|
+
*/
|
|
21
|
+
readonly packageName?: string;
|
|
22
|
+
readonly node?: SchemaNode;
|
|
23
|
+
constructor(
|
|
24
|
+
/**
|
|
25
|
+
* name of the reference to type.
|
|
26
|
+
*/
|
|
27
|
+
name: string,
|
|
28
|
+
/**
|
|
29
|
+
* target component id. existing if the type is defined in another component.
|
|
30
|
+
*/
|
|
31
|
+
componentId?: ComponentID,
|
|
32
|
+
/**
|
|
33
|
+
* target package name. existing if type is defined in different package.
|
|
34
|
+
*/
|
|
35
|
+
packageName?: string, node?: SchemaNode);
|
|
36
|
+
static from(plainSchema: PlainTypeRefSchema): TypeRefSchema;
|
|
37
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeRefSchema = void 0;
|
|
4
|
+
const component_1 = require("@teambit/component");
|
|
5
|
+
class TypeRefSchema {
|
|
6
|
+
constructor(
|
|
7
|
+
/**
|
|
8
|
+
* name of the reference to type.
|
|
9
|
+
*/
|
|
10
|
+
name,
|
|
11
|
+
/**
|
|
12
|
+
* target component id. existing if the type is defined in another component.
|
|
13
|
+
*/
|
|
14
|
+
componentId,
|
|
15
|
+
/**
|
|
16
|
+
* target package name. existing if type is defined in different package.
|
|
17
|
+
*/
|
|
18
|
+
packageName, node) {
|
|
19
|
+
this.name = name;
|
|
20
|
+
this.componentId = componentId;
|
|
21
|
+
this.packageName = packageName;
|
|
22
|
+
this.node = node;
|
|
23
|
+
}
|
|
24
|
+
static from(plainSchema) {
|
|
25
|
+
return new TypeRefSchema(plainSchema.name, plainSchema.componentId ? component_1.ComponentID.fromString(plainSchema.componentId) : undefined, plainSchema.packageName, plainSchema.node);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.TypeRefSchema = TypeRefSchema;
|
|
29
|
+
//# sourceMappingURL=type-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-ref.js","sourceRoot":"","sources":["../../schemas/type-ref.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AAUjD,MAAa,aAAa;IACxB;IACE;;OAEG;IACM,IAAY;IAErB;;OAEG;IACM,WAAyB;IAElC;;OAEG;IACM,WAAoB,EAEpB,IAAiB;QAZjB,SAAI,GAAJ,IAAI,CAAQ;QAKZ,gBAAW,GAAX,WAAW,CAAc;QAKzB,gBAAW,GAAX,WAAW,CAAS;QAEpB,SAAI,GAAJ,IAAI,CAAa;IACzB,CAAC;IAEJ,MAAM,CAAC,IAAI,CAAC,WAA+B;QACzC,OAAO,IAAI,aAAa,CACtB,WAAW,CAAC,IAAI,EAChB,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,uBAAW,CAAC,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EACrF,WAAW,CAAC,WAAW,EACvB,WAAW,CAAC,IAAI,CACjB,CAAC;IACJ,CAAC;CACF;AA5BD,sCA4BC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../schemas/type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Export } from './schemas';
|
|
2
|
+
import { SchemaNode } from './schema-node';
|
|
3
|
+
export declare type PlainSemanticSchema = {
|
|
4
|
+
exports?: Export[];
|
|
5
|
+
};
|
|
6
|
+
export declare class SemanticSchema implements SchemaNode {
|
|
7
|
+
readonly exports: Export[];
|
|
8
|
+
constructor(exports?: Export[]);
|
|
9
|
+
toString(): string;
|
|
10
|
+
static fromSchema(): void;
|
|
11
|
+
static from(plainSchema: PlainSemanticSchema): SemanticSchema;
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SemanticSchema = void 0;
|
|
4
|
+
class SemanticSchema {
|
|
5
|
+
constructor(exports = []) {
|
|
6
|
+
this.exports = exports;
|
|
7
|
+
}
|
|
8
|
+
toString() {
|
|
9
|
+
return '';
|
|
10
|
+
}
|
|
11
|
+
static fromSchema() { }
|
|
12
|
+
static from(plainSchema) {
|
|
13
|
+
return new SemanticSchema(plainSchema.exports);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.SemanticSchema = SemanticSchema;
|
|
17
|
+
//# sourceMappingURL=semantic-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semantic-schema.js","sourceRoot":"","sources":["../semantic-schema.ts"],"names":[],"mappings":";;;AAOA,MAAa,cAAc;IACzB,YAAqB,UAAoB,EAAE;QAAtB,YAAO,GAAP,OAAO,CAAe;IAAG,CAAC;IAE/C,QAAQ;QACN,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,CAAC,UAAU,KAAI,CAAC;IAEtB,MAAM,CAAC,IAAI,CAAC,WAAgC;QAC1C,OAAO,IAAI,cAAc,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;CACF;AAZD,wCAYC"}
|
package/dist/type.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type TypeRef = {};
|
package/dist/type.js
ADDED
package/dist/type.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../type.ts"],"names":[],"mappings":""}
|
package/index.ts
ADDED
package/json-schema.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { JSONSchema7 as JSONSchema, JSONSchema7Object as JSONSchemaObject } from 'json-schema';
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teambit/semantics.entities.semantic-schema",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"componentId": {
|
|
6
|
+
"scope": "teambit.semantics",
|
|
7
|
+
"name": "entities/semantic-schema",
|
|
8
|
+
"version": "0.0.1"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"json-schema": "0.4.0"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@types/json-schema": "7.0.9",
|
|
15
|
+
"@types/mocha": "5.2.7",
|
|
16
|
+
"@babel/runtime": "7.12.18",
|
|
17
|
+
"@types/node": "12.20.4",
|
|
18
|
+
"@types/jest": "26.0.20"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"@teambit/legacy": "1.0.190"
|
|
22
|
+
},
|
|
23
|
+
"license": "Apache-2.0",
|
|
24
|
+
"bit": {
|
|
25
|
+
"bindingPrefix": "@teambit",
|
|
26
|
+
"env": {},
|
|
27
|
+
"overrides": {
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@teambit/legacy": "-"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@teambit/legacy": "-",
|
|
33
|
+
"@types/mocha": "5.2.7",
|
|
34
|
+
"@babel/runtime": "7.12.18",
|
|
35
|
+
"@types/node": "12.20.4",
|
|
36
|
+
"@types/jest": "26.0.20"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@teambit/legacy": "1.0.190"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"private": false,
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=12.22.0"
|
|
46
|
+
},
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "https://github.com/teambit/bit"
|
|
50
|
+
},
|
|
51
|
+
"keywords": [
|
|
52
|
+
"bit",
|
|
53
|
+
"components",
|
|
54
|
+
"collaboration",
|
|
55
|
+
"web",
|
|
56
|
+
"react",
|
|
57
|
+
"react-components",
|
|
58
|
+
"angular",
|
|
59
|
+
"angular-components",
|
|
60
|
+
"vue",
|
|
61
|
+
"vue-components"
|
|
62
|
+
]
|
|
63
|
+
}
|
package/schema-node.ts
ADDED
package/schemas/class.ts
ADDED
|
File without changes
|
package/schemas/enum.ts
ADDED
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SchemaNode } from '../schema-node';
|
|
2
|
+
|
|
3
|
+
type Primitive = string | number | boolean | null | undefined;
|
|
4
|
+
export type StaticProperties = Map<string, Primitive>;
|
|
5
|
+
|
|
6
|
+
export class Export {
|
|
7
|
+
constructor(
|
|
8
|
+
/**
|
|
9
|
+
* named export identifier of the module export.
|
|
10
|
+
*/
|
|
11
|
+
readonly identifier: string,
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* API node.
|
|
15
|
+
*/
|
|
16
|
+
readonly node?: SchemaNode,
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* static properties attached to this export
|
|
20
|
+
* @example
|
|
21
|
+
* export hello = () => {};
|
|
22
|
+
* hello.value = "text"; // <-- staticProperty
|
|
23
|
+
* hello.count = 3; // <-- static property
|
|
24
|
+
*/
|
|
25
|
+
readonly staticProperties?: StaticProperties
|
|
26
|
+
) {}
|
|
27
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SchemaNode } from '../schema-node';
|
|
2
|
+
import { TypeRefSchema } from './type-ref';
|
|
3
|
+
|
|
4
|
+
export type Argument = {
|
|
5
|
+
name: string;
|
|
6
|
+
defaultValue?: any;
|
|
7
|
+
description: any;
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export class FunctionSchema implements SchemaNode {
|
|
12
|
+
constructor(
|
|
13
|
+
readonly name: string,
|
|
14
|
+
// readonly doc: any,
|
|
15
|
+
readonly args: Argument[],
|
|
16
|
+
|
|
17
|
+
readonly returnType: TypeRefSchema
|
|
18
|
+
) {}
|
|
19
|
+
|
|
20
|
+
serialize() {}
|
|
21
|
+
|
|
22
|
+
toJsonSchema() {}
|
|
23
|
+
}
|
package/schemas/index.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ComponentID } from '@teambit/component';
|
|
2
|
+
import { SchemaNode } from '../schema-node';
|
|
3
|
+
|
|
4
|
+
export type PlainTypeRefSchema = {
|
|
5
|
+
name: string;
|
|
6
|
+
componentId?: string;
|
|
7
|
+
packageName?: string;
|
|
8
|
+
node?: SchemaNode;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export class TypeRefSchema implements SchemaNode {
|
|
12
|
+
constructor(
|
|
13
|
+
/**
|
|
14
|
+
* name of the reference to type.
|
|
15
|
+
*/
|
|
16
|
+
readonly name: string,
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* target component id. existing if the type is defined in another component.
|
|
20
|
+
*/
|
|
21
|
+
readonly componentId?: ComponentID,
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* target package name. existing if type is defined in different package.
|
|
25
|
+
*/
|
|
26
|
+
readonly packageName?: string,
|
|
27
|
+
|
|
28
|
+
readonly node?: SchemaNode
|
|
29
|
+
) {}
|
|
30
|
+
|
|
31
|
+
static from(plainSchema: PlainTypeRefSchema) {
|
|
32
|
+
return new TypeRefSchema(
|
|
33
|
+
plainSchema.name,
|
|
34
|
+
plainSchema.componentId ? ComponentID.fromString(plainSchema.componentId) : undefined,
|
|
35
|
+
plainSchema.packageName,
|
|
36
|
+
plainSchema.node
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
package/schemas/type.ts
ADDED
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Export } from './schemas';
|
|
2
|
+
import { SchemaNode } from './schema-node';
|
|
3
|
+
|
|
4
|
+
export type PlainSemanticSchema = {
|
|
5
|
+
exports?: Export[];
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export class SemanticSchema implements SchemaNode {
|
|
9
|
+
constructor(readonly exports: Export[] = []) {}
|
|
10
|
+
|
|
11
|
+
toString() {
|
|
12
|
+
return '';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static fromSchema() {}
|
|
16
|
+
|
|
17
|
+
static from(plainSchema: PlainSemanticSchema) {
|
|
18
|
+
return new SemanticSchema(plainSchema.exports);
|
|
19
|
+
}
|
|
20
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
"outDir": "dist",
|
|
18
|
+
"moduleResolution": "node",
|
|
19
|
+
"esModuleInterop": true,
|
|
20
|
+
"rootDir": ".",
|
|
21
|
+
"resolveJsonModule": true
|
|
22
|
+
},
|
|
23
|
+
"exclude": [
|
|
24
|
+
"dist"
|
|
25
|
+
]
|
|
26
|
+
}
|
package/type.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TypeRef = {};
|
package/types/asset.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare module '*.png' {
|
|
2
|
+
const value: any;
|
|
3
|
+
export = value;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.svg' {
|
|
6
|
+
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
|
+
|
|
8
|
+
export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
|
|
9
|
+
const src: string;
|
|
10
|
+
export default src;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// @TODO Gilad
|
|
14
|
+
declare module '*.jpg' {
|
|
15
|
+
const value: any;
|
|
16
|
+
export = value;
|
|
17
|
+
}
|
|
18
|
+
declare module '*.jpeg' {
|
|
19
|
+
const value: any;
|
|
20
|
+
export = value;
|
|
21
|
+
}
|
|
22
|
+
declare module '*.gif' {
|
|
23
|
+
const value: any;
|
|
24
|
+
export = value;
|
|
25
|
+
}
|
|
26
|
+
declare module '*.bmp' {
|
|
27
|
+
const value: any;
|
|
28
|
+
export = value;
|
|
29
|
+
}
|
package/types/style.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare module '*.module.css' {
|
|
2
|
+
const classes: { readonly [key: string]: string };
|
|
3
|
+
export default classes;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.module.scss' {
|
|
6
|
+
const classes: { readonly [key: string]: string };
|
|
7
|
+
export default classes;
|
|
8
|
+
}
|
|
9
|
+
declare module '*.module.sass' {
|
|
10
|
+
const classes: { readonly [key: string]: string };
|
|
11
|
+
export default classes;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module '*.module.less' {
|
|
15
|
+
const classes: { readonly [key: string]: string };
|
|
16
|
+
export default classes;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare module '*.less' {
|
|
20
|
+
const classes: { readonly [key: string]: string };
|
|
21
|
+
export default classes;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '*.css' {
|
|
25
|
+
const classes: { readonly [key: string]: string };
|
|
26
|
+
export default classes;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare module '*.sass' {
|
|
30
|
+
const classes: { readonly [key: string]: string };
|
|
31
|
+
export default classes;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare module '*.scss' {
|
|
35
|
+
const classes: { readonly [key: string]: string };
|
|
36
|
+
export default classes;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare module '*.mdx' {
|
|
40
|
+
const component: any;
|
|
41
|
+
export default component;
|
|
42
|
+
}
|