@teambit/schema 0.0.522 → 0.0.526

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  export { Parser } from './parser';
2
2
  export { SchemaExtractor } from './schema-extractor';
3
- export { Export, Module } from './schemas';
3
+ export { Export, Module, StaticProperties } from './schemas';
4
4
  export type { SchemaMain } from './schema.main.runtime';
5
5
  export { SchemaAspect } from './schema.aspect';
6
6
  export { SemanticSchema } from './semantic-schema';
package/dist/index.js CHANGED
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "Module", {
27
27
  return _schemas().Module;
28
28
  }
29
29
  });
30
+ Object.defineProperty(exports, "StaticProperties", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _schemas().StaticProperties;
34
+ }
35
+ });
30
36
  Object.defineProperty(exports, "SchemaAspect", {
31
37
  enumerable: true,
32
38
  get: function () {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA","sourcesContent":["export { Parser } from './parser';\nexport { SchemaExtractor } from './schema-extractor';\nexport { Export, Module } from './schemas';\nexport type { SchemaMain } from './schema.main.runtime';\nexport { SchemaAspect } from './schema.aspect';\nexport { SemanticSchema } from './semantic-schema';\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA","sourcesContent":["export { Parser } from './parser';\nexport { SchemaExtractor } from './schema-extractor';\nexport { Export, Module, StaticProperties } from './schemas';\nexport type { SchemaMain } from './schema.main.runtime';\nexport { SchemaAspect } from './schema.aspect';\nexport { SemanticSchema } from './semantic-schema';\n"]}
@@ -1,4 +1,8 @@
1
+ declare type Primitive = string | number | boolean | null | undefined;
2
+ export declare type StaticProperties = Map<string, Primitive>;
1
3
  export declare class Export {
2
4
  readonly identifier: string;
3
- constructor(identifier: string);
5
+ readonly staticProperties?: StaticProperties | undefined;
6
+ constructor(identifier: string, staticProperties?: StaticProperties | undefined);
4
7
  }
8
+ export {};
@@ -10,8 +10,17 @@ class Export {
10
10
  /**
11
11
  * named export identifier of the module export.
12
12
  */
13
- identifier) {
13
+ identifier,
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) {
14
22
  this.identifier = identifier;
23
+ this.staticProperties = staticProperties;
15
24
  }
16
25
 
17
26
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["export.ts"],"names":["Export","constructor","identifier"],"mappings":";;;;;;;AAAO,MAAMA,MAAN,CAAa;AAClBC,EAAAA,WAAW;AACT;AACJ;AACA;AACaC,EAAAA,UAJA,EAKT;AAAA,SADSA,UACT,GADSA,UACT;AAAE;;AANc","sourcesContent":["export class Export {\n constructor(\n /**\n * named export identifier of the module export.\n */\n readonly identifier: string\n ) {}\n}\n"]}
1
+ {"version":3,"sources":["export.ts"],"names":["Export","constructor","identifier","staticProperties"],"mappings":";;;;;;;AAGO,MAAMA,MAAN,CAAa;AAClBC,EAAAA,WAAW;AACT;AACJ;AACA;AACaC,EAAAA,UAJA;AAMT;AACJ;AACA;AACA;AACA;AACA;AACA;AACaC,EAAAA,gBAbA,EAcT;AAAA,SAVSD,UAUT,GAVSA,UAUT;AAAA,SADSC,gBACT,GADSA,gBACT;AAAE;;AAfc","sourcesContent":["type Primitive = string | number | boolean | null | undefined;\nexport type StaticProperties = Map<string, Primitive>;\n\nexport class Export {\n constructor(\n /**\n * named export identifier of the module export.\n */\n readonly identifier: string,\n\n /**\n * static properties attached to this export\n * @example\n * export hello = () => {};\n * hello.value = \"text\"; // <-- staticProperty\n * hello.count = 3; // <-- static property\n */\n readonly staticProperties?: StaticProperties\n ) {}\n}\n"]}
@@ -1,2 +1,2 @@
1
1
  export { Module } from './module';
2
- export { Export } from './export';
2
+ export { Export, StaticProperties } from './export';
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "Export", {
15
15
  return _export().Export;
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "StaticProperties", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _export().StaticProperties;
22
+ }
23
+ });
18
24
 
19
25
  function _module() {
20
26
  const data = require("./module");
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA","sourcesContent":["export { Module } from './module';\nexport { Export } from './export';\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA","sourcesContent":["export { Module } from './module';\nexport { Export, StaticProperties } from './export';\n"]}
package/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { Parser } from './parser';
2
2
  export { SchemaExtractor } from './schema-extractor';
3
- export { Export, Module } from './schemas';
3
+ export { Export, Module, StaticProperties } from './schemas';
4
4
  export type { SchemaMain } from './schema.main.runtime';
5
5
  export { SchemaAspect } from './schema.aspect';
6
6
  export { SemanticSchema } from './semantic-schema';
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@teambit/schema",
3
- "version": "0.0.522",
3
+ "version": "0.0.526",
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.522"
9
+ "version": "0.0.526"
10
10
  },
11
11
  "dependencies": {
12
12
  "@teambit/harmony": "0.2.11",
13
13
  "@babel/runtime": "7.12.18",
14
14
  "core-js": "^3.0.0",
15
- "@teambit/component": "0.0.522",
16
- "@teambit/cli": "0.0.379",
17
- "@teambit/envs": "0.0.522"
15
+ "@teambit/component": "0.0.526",
16
+ "@teambit/cli": "0.0.380",
17
+ "@teambit/envs": "0.0.526"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@types/mocha": "5.2.7",
@@ -29,7 +29,7 @@
29
29
  "react-dom": "^16.8.0 || ^17.0.0",
30
30
  "react": "^16.8.0 || ^17.0.0"
31
31
  },
32
- "license": "SEE LICENSE IN LICENSE",
32
+ "license": "Apache-2.0",
33
33
  "bit": {
34
34
  "bindingPrefix": "@teambit",
35
35
  "env": {},
package/schemas/export.ts CHANGED
@@ -1,8 +1,20 @@
1
+ type Primitive = string | number | boolean | null | undefined;
2
+ export type StaticProperties = Map<string, Primitive>;
3
+
1
4
  export class Export {
2
5
  constructor(
3
6
  /**
4
7
  * named export identifier of the module export.
5
8
  */
6
- readonly identifier: string
9
+ readonly identifier: string,
10
+
11
+ /**
12
+ * static properties attached to this export
13
+ * @example
14
+ * export hello = () => {};
15
+ * hello.value = "text"; // <-- staticProperty
16
+ * hello.count = 3; // <-- static property
17
+ */
18
+ readonly staticProperties?: StaticProperties
7
19
  ) {}
8
20
  }
package/schemas/index.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { Module } from './module';
2
- export { Export } from './export';
2
+ export { Export, StaticProperties } from './export';