@teambit/schema 0.0.549 → 0.0.555

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/parser.d.ts CHANGED
@@ -1,5 +1,11 @@
1
1
  import { Module } from './schemas';
2
2
  export interface Parser {
3
+ /**
4
+ * regex to apply on which components compiler applies.
5
+ */
3
6
  extension: RegExp;
7
+ /**
8
+ * parse a module.
9
+ */
4
10
  parseModule(modulePath: string): Module;
5
11
  }
@@ -1,5 +1,8 @@
1
1
  import { Component } from '@teambit/component';
2
2
  import { Module } from './schemas';
3
3
  export interface SchemaExtractor {
4
+ /**
5
+ * extract a semantic schema from a component.
6
+ */
4
7
  extract(component: Component): Promise<Module>;
5
8
  }
@@ -7,16 +7,42 @@ import { Module } from './schemas';
7
7
  import { SemanticSchema } from './semantic-schema';
8
8
  export declare type ParserSlot = SlotRegistry<Parser>;
9
9
  export declare type SchemaConfig = {
10
+ /**
11
+ * default parser
12
+ */
10
13
  defaultParser: string;
11
14
  };
15
+ /**
16
+ * extension for extracting component schemas.
17
+ */
12
18
  export declare class SchemaMain {
19
+ /**
20
+ * parsers slot.
21
+ */
13
22
  private parserSlot;
14
23
  private envs;
15
24
  private config;
16
- constructor(parserSlot: ParserSlot, envs: EnvsMain, config: SchemaConfig);
25
+ constructor(
26
+ /**
27
+ * parsers slot.
28
+ */
29
+ parserSlot: ParserSlot, envs: EnvsMain, config: SchemaConfig);
30
+ /**
31
+ * get the default parser.
32
+ */
17
33
  getDefaultParser(): Parser;
34
+ /**
35
+ * parse a module into a component schema.
36
+ */
18
37
  parseModule(path: string): Module;
38
+ /**
39
+ * get a schema of a component.
40
+ * @param component target component.
41
+ */
19
42
  getSchema(component: Component): Promise<SemanticSchema>;
43
+ /**
44
+ * register a new parser.
45
+ */
20
46
  registerParser(parser: Parser): SchemaMain;
21
47
  static runtime: import("@teambit/harmony").RuntimeDefinition;
22
48
  static dependencies: import("@teambit/harmony").Aspect[];
@@ -1,8 +1,30 @@
1
1
  declare type Primitive = string | number | boolean | null | undefined;
2
2
  export declare type StaticProperties = Map<string, Primitive>;
3
3
  export declare class Export {
4
+ /**
5
+ * named export identifier of the module export.
6
+ */
4
7
  readonly identifier: string;
8
+ /**
9
+ * static properties attached to this export
10
+ * @example
11
+ * export hello = () => {};
12
+ * hello.value = "text"; // <-- staticProperty
13
+ * hello.count = 3; // <-- static property
14
+ */
5
15
  readonly staticProperties?: StaticProperties | undefined;
6
- constructor(identifier: string, staticProperties?: StaticProperties | undefined);
16
+ constructor(
17
+ /**
18
+ * named export identifier of the module export.
19
+ */
20
+ identifier: string,
21
+ /**
22
+ * static properties attached to this export
23
+ * @example
24
+ * export hello = () => {};
25
+ * hello.value = "text"; // <-- staticProperty
26
+ * hello.count = 3; // <-- static property
27
+ */
28
+ staticProperties?: StaticProperties | undefined);
7
29
  }
8
30
  export {};
@@ -1,5 +1,12 @@
1
1
  import { Export } from './export';
2
2
  export declare class Module {
3
+ /**
4
+ * all module exports.
5
+ */
3
6
  readonly exports: Export[];
4
- constructor(exports: Export[]);
7
+ constructor(
8
+ /**
9
+ * all module exports.
10
+ */
11
+ exports: Export[]);
5
12
  }
@@ -1,3 +1,6 @@
1
+ /**
2
+ * describes the semantic schema of a component.
3
+ */
1
4
  export interface SemanticSchema {
2
5
  exports: [];
3
6
  }
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@teambit/schema",
3
- "version": "0.0.549",
3
+ "version": "0.0.555",
4
4
  "homepage": "https://bit.dev/teambit/semantics/schema",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.semantics",
8
8
  "name": "schema",
9
- "version": "0.0.549"
9
+ "version": "0.0.555"
10
10
  },
11
11
  "dependencies": {
12
12
  "@teambit/harmony": "0.2.11",
13
13
  "graphql-tag": "2.12.1",
14
14
  "@babel/runtime": "7.12.18",
15
15
  "core-js": "^3.0.0",
16
- "@teambit/component": "0.0.549",
17
- "@teambit/cli": "0.0.380",
18
- "@teambit/envs": "0.0.549",
19
- "@teambit/graphql": "0.0.549"
16
+ "@teambit/component": "0.0.555",
17
+ "@teambit/cli": "0.0.386",
18
+ "@teambit/envs": "0.0.555",
19
+ "@teambit/graphql": "0.0.555"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/mocha": "5.2.7",
@@ -27,7 +27,7 @@
27
27
  "@types/node": "12.20.4"
28
28
  },
29
29
  "peerDependencies": {
30
- "@teambit/legacy": "1.0.76",
30
+ "@teambit/legacy": "1.0.172",
31
31
  "react-dom": "^16.8.0 || ^17.0.0",
32
32
  "react": "^16.8.0 || ^17.0.0"
33
33
  },
@@ -55,7 +55,7 @@
55
55
  "react": "-"
56
56
  },
57
57
  "peerDependencies": {
58
- "@teambit/legacy": "1.0.76",
58
+ "@teambit/legacy": "1.0.172",
59
59
  "react-dom": "^16.8.0 || ^17.0.0",
60
60
  "react": "^16.8.0 || ^17.0.0"
61
61
  }
package/tsconfig.json CHANGED
@@ -25,7 +25,6 @@
25
25
  "strict": true,
26
26
  "noImplicitAny": false,
27
27
  "rootDir": ".",
28
- "removeComments": true,
29
28
  "preserveConstEnums": true,
30
29
  "resolveJsonModule": true
31
30
  },