@teambit/schema 0.0.880 → 0.0.882

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.
@@ -9,14 +9,11 @@ Object.defineProperty(exports, "ParserNotFound", {
9
9
  return _parserNotFound().ParserNotFound;
10
10
  }
11
11
  });
12
-
13
12
  function _parserNotFound() {
14
13
  const data = require("./parser-not-found");
15
-
16
14
  _parserNotFound = function () {
17
15
  return data;
18
16
  };
19
-
20
17
  return data;
21
18
  }
22
19
 
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { ParserNotFound } from './parser-not-found';\n"],"mappings":";;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { ParserNotFound } from './parser-not-found';\n"],"mappings":";;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ParserNotFound = void 0;
7
-
8
7
  class ParserNotFound extends Error {
9
8
  constructor(filePath) {
10
9
  super(`
@@ -13,9 +12,7 @@ please use an extension to handle your file extension formats.
13
12
  `);
14
13
  this.filePath = filePath;
15
14
  }
16
-
17
15
  }
18
-
19
16
  exports.ParserNotFound = ParserNotFound;
20
17
 
21
18
  //# sourceMappingURL=parser-not-found.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ParserNotFound","Error","constructor","filePath"],"sources":["parser-not-found.ts"],"sourcesContent":["export class ParserNotFound extends Error {\n constructor(readonly filePath: string) {\n super(`\nno parser is configured to apply on file path: ${filePath}.\\n\nplease use an extension to handle your file extension formats.\n`);\n }\n}\n"],"mappings":";;;;;;;AAAO,MAAMA,cAAN,SAA6BC,KAA7B,CAAmC;EACxCC,WAAW,CAAUC,QAAV,EAA4B;IACrC,MAAO;AACX,iDAAiDA,QAAS;AAC1D;AACA,CAHI;IADqC,KAAlBA,QAAkB,GAAlBA,QAAkB;EAKtC;;AANuC"}
1
+ {"version":3,"names":["ParserNotFound","Error","constructor","filePath"],"sources":["parser-not-found.ts"],"sourcesContent":["export class ParserNotFound extends Error {\n constructor(readonly filePath: string) {\n super(`\nno parser is configured to apply on file path: ${filePath}.\\n\nplease use an extension to handle your file extension formats.\n`);\n }\n}\n"],"mappings":";;;;;;AAAO,MAAMA,cAAc,SAASC,KAAK,CAAC;EACxCC,WAAW,CAAUC,QAAgB,EAAE;IACrC,KAAK,CAAE;AACX,iDAAiDA,QAAS;AAC1D;AACA,CAAC,CAAC;IAAC,KAJoBA,QAAgB,GAAhBA,QAAgB;EAKrC;AACF;AAAC"}
package/dist/index.js CHANGED
@@ -21,34 +21,25 @@ Object.defineProperty(exports, "SchemaExtractor", {
21
21
  return _schemaExtractor().SchemaExtractor;
22
22
  }
23
23
  });
24
-
25
24
  function _parser() {
26
25
  const data = require("./parser");
27
-
28
26
  _parser = function () {
29
27
  return data;
30
28
  };
31
-
32
29
  return data;
33
30
  }
34
-
35
31
  function _schemaExtractor() {
36
32
  const data = require("./schema-extractor");
37
-
38
33
  _schemaExtractor = function () {
39
34
  return data;
40
35
  };
41
-
42
36
  return data;
43
37
  }
44
-
45
38
  function _schema() {
46
39
  const data = require("./schema.aspect");
47
-
48
40
  _schema = function () {
49
41
  return data;
50
42
  };
51
-
52
43
  return data;
53
44
  }
54
45
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { Parser } from './parser';\nexport { SchemaExtractor } from './schema-extractor';\nexport type { SchemaMain } from './schema.main.runtime';\nexport { SchemaAspect } from './schema.aspect';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { Parser } from './parser';\nexport { SchemaExtractor } from './schema-extractor';\nexport type { SchemaMain } from './schema.main.runtime';\nexport { SchemaAspect } from './schema.aspect';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
@@ -1,52 +1,41 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.ButtonWithIcon = exports.ButtonWithCustomStyles = exports.ButtonAsALink = exports.BasicButton = void 0;
9
8
  exports.Footer = Footer;
10
-
11
9
  function _react() {
12
10
  const data = _interopRequireDefault(require("react"));
13
-
14
11
  _react = function () {
15
12
  return data;
16
13
  };
17
-
18
14
  return data;
19
15
  }
20
-
21
16
  function _button() {
22
17
  const data = require("./button");
23
-
24
18
  _button = function () {
25
19
  return data;
26
20
  };
27
-
28
21
  return data;
29
22
  }
30
-
31
23
  /* eslint-disable no-alert */
32
-
33
24
  /* eslint-disable @typescript-eslint/no-unused-vars */
25
+
34
26
  const BasicButton = () => {
35
27
  return /*#__PURE__*/_react().default.createElement(_button().Button, null, "click me");
36
28
  };
29
+
37
30
  /**
38
31
  * example of passing a JSX Element as a parameter
39
32
  */
40
-
41
-
42
33
  exports.BasicButton = BasicButton;
43
-
44
34
  function Footer({
45
35
  children = /*#__PURE__*/_react().default.createElement(BasicButton, null)
46
36
  }) {
47
37
  return /*#__PURE__*/_react().default.createElement(_button().Button, null, children);
48
38
  }
49
-
50
39
  const ButtonWithCustomStyles = () => {
51
40
  return /*#__PURE__*/_react().default.createElement(_button().Button, {
52
41
  style: {
@@ -54,21 +43,16 @@ const ButtonWithCustomStyles = () => {
54
43
  }
55
44
  }, "click me");
56
45
  };
57
-
58
46
  exports.ButtonWithCustomStyles = ButtonWithCustomStyles;
59
-
60
47
  const ButtonWithIcon = () => {
61
48
  return /*#__PURE__*/_react().default.createElement(_button().Button, null, "click me");
62
49
  };
63
-
64
50
  exports.ButtonWithIcon = ButtonWithIcon;
65
-
66
51
  const ButtonAsALink = () => {
67
52
  return /*#__PURE__*/_react().default.createElement(_button().Button, {
68
53
  href: "https://bit.dev"
69
54
  }, "Bit");
70
55
  };
71
-
72
56
  exports.ButtonAsALink = ButtonAsALink;
73
57
 
74
58
  //# sourceMappingURL=button.composition.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BasicButton","Footer","children","ButtonWithCustomStyles","background","ButtonWithIcon","ButtonAsALink"],"sources":["button.composition.tsx"],"sourcesContent":["/* eslint-disable no-alert */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport React from 'react';\nimport { Button } from './button';\n\nexport const BasicButton = () => {\n return <Button>click me</Button>;\n};\n\n/**\n * example of passing a JSX Element as a parameter\n */\nexport function Footer({ children = <BasicButton /> }) {\n return <Button>{children}</Button>;\n}\n\nexport const ButtonWithCustomStyles = () => {\n return <Button style={{ background: 'red' }}>click me</Button>;\n};\n\nexport const ButtonWithIcon = () => {\n return (\n <Button>\n {/* <Image src=\"https://static.bit.dev/bit-logo.svg\" /> */}\n click me\n </Button>\n );\n};\n\nexport const ButtonAsALink = () => {\n return <Button href=\"https://bit.dev\">Bit</Button>;\n};\n"],"mappings":";;;;;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAHA;;AACA;AAIO,MAAMA,WAAW,GAAG,MAAM;EAC/B,oBAAO,+BAAC,gBAAD,mBAAP;AACD,CAFM;AAIP;AACA;AACA;;;;;AACO,SAASC,MAAT,CAAgB;EAAEC,QAAQ,gBAAG,+BAAC,WAAD;AAAb,CAAhB,EAAgD;EACrD,oBAAO,+BAAC,gBAAD,QAASA,QAAT,CAAP;AACD;;AAEM,MAAMC,sBAAsB,GAAG,MAAM;EAC1C,oBAAO,+BAAC,gBAAD;IAAQ,KAAK,EAAE;MAAEC,UAAU,EAAE;IAAd;EAAf,cAAP;AACD,CAFM;;;;AAIA,MAAMC,cAAc,GAAG,MAAM;EAClC,oBACE,+BAAC,gBAAD,mBADF;AAMD,CAPM;;;;AASA,MAAMC,aAAa,GAAG,MAAM;EACjC,oBAAO,+BAAC,gBAAD;IAAQ,IAAI,EAAC;EAAb,SAAP;AACD,CAFM"}
1
+ {"version":3,"names":["BasicButton","Footer","children","ButtonWithCustomStyles","background","ButtonWithIcon","ButtonAsALink"],"sources":["button.composition.tsx"],"sourcesContent":["/* eslint-disable no-alert */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport React from 'react';\nimport { Button } from './button';\n\nexport const BasicButton = () => {\n return <Button>click me</Button>;\n};\n\n/**\n * example of passing a JSX Element as a parameter\n */\nexport function Footer({ children = <BasicButton /> }) {\n return <Button>{children}</Button>;\n}\n\nexport const ButtonWithCustomStyles = () => {\n return <Button style={{ background: 'red' }}>click me</Button>;\n};\n\nexport const ButtonWithIcon = () => {\n return (\n <Button>\n {/* <Image src=\"https://static.bit.dev/bit-logo.svg\" /> */}\n click me\n </Button>\n );\n};\n\nexport const ButtonAsALink = () => {\n return <Button href=\"https://bit.dev\">Bit</Button>;\n};\n"],"mappings":";;;;;;;;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAHA;AACA;;AAIO,MAAMA,WAAW,GAAG,MAAM;EAC/B,oBAAO,+BAAC,gBAAM,mBAAkB;AAClC,CAAC;;AAED;AACA;AACA;AAFA;AAGO,SAASC,MAAM,CAAC;EAAEC,QAAQ,gBAAG,+BAAC,WAAW;AAAI,CAAC,EAAE;EACrD,oBAAO,+BAAC,gBAAM,QAAEA,QAAQ,CAAU;AACpC;AAEO,MAAMC,sBAAsB,GAAG,MAAM;EAC1C,oBAAO,+BAAC,gBAAM;IAAC,KAAK,EAAE;MAAEC,UAAU,EAAE;IAAM;EAAE,cAAkB;AAChE,CAAC;AAAC;AAEK,MAAMC,cAAc,GAAG,MAAM;EAClC,oBACE,+BAAC,gBAAM,mBAGE;AAEb,CAAC;AAAC;AAEK,MAAMC,aAAa,GAAG,MAAM;EACjC,oBAAO,+BAAC,gBAAM;IAAC,IAAI,EAAC;EAAiB,SAAa;AACpD,CAAC;AAAC"}
@@ -1,65 +1,48 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.Bar = void 0;
9
8
  exports.Button = Button;
10
-
11
9
  function _extends2() {
12
10
  const data = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
11
  _extends2 = function () {
15
12
  return data;
16
13
  };
17
-
18
14
  return data;
19
15
  }
20
-
21
16
  function _defineProperty2() {
22
17
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
-
24
18
  _defineProperty2 = function () {
25
19
  return data;
26
20
  };
27
-
28
21
  return data;
29
22
  }
30
-
31
23
  function _react() {
32
24
  const data = _interopRequireWildcard(require("react"));
33
-
34
25
  _react = function () {
35
26
  return data;
36
27
  };
37
-
38
28
  return data;
39
29
  }
40
-
41
30
  function _baseReactNavigation() {
42
31
  const data = require("@teambit/base-react.navigation.link");
43
-
44
32
  _baseReactNavigation = function () {
45
33
  return data;
46
34
  };
47
-
48
35
  return data;
49
36
  }
50
-
51
37
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
52
-
53
38
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
54
-
55
39
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
56
-
57
40
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
58
-
59
41
  function Button(props) {
60
42
  var _props$href, _props$href2;
43
+ const ref = (0, _react().useRef)();
61
44
 
62
- const ref = (0, _react().useRef)(); // const { buttonProps } = useButton(
45
+ // const { buttonProps } = useButton(
63
46
  // {
64
47
  // ...props,
65
48
  // elementType: props.href ? 'a' : undefined,
@@ -69,7 +52,6 @@ function Button(props) {
69
52
  // );
70
53
 
71
54
  const allProps = _objectSpread({}, props);
72
-
73
55
  const external = ((_props$href = props.href) === null || _props$href === void 0 ? void 0 : _props$href.startsWith('http:')) || ((_props$href2 = props.href) === null || _props$href2 === void 0 ? void 0 : _props$href2.startsWith('https:'));
74
56
  return /*#__PURE__*/_react().default.createElement(_react().default.Fragment, null, !props.href ?
75
57
  /*#__PURE__*/
@@ -86,12 +68,9 @@ function Button(props) {
86
68
  className: props.className
87
69
  }, allProps), props.children));
88
70
  }
89
-
90
71
  class Bar {
91
72
  foo() {}
92
-
93
73
  }
94
-
95
74
  exports.Bar = Bar;
96
75
 
97
76
  //# sourceMappingURL=button.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Button","props","ref","useRef","allProps","external","href","startsWith","className","children","Bar","foo"],"sources":["button.tsx"],"sourcesContent":["/* eslint-disable import/no-unresolved */\nimport React, { ReactNode, useRef } from 'react';\n// @ts-ignore\n// import { useButton } from '@react-aria/button';\nimport { Link } from '@teambit/base-react.navigation.link';\n\nexport type ButtonElementType = 'a' | 'button';\n\nexport type ButtonProps = {\n /**\n * children of the Button.\n */\n children: ReactNode;\n\n /**\n * link to target page. once href is used, Button is considered an A tag.\n */\n href?: string;\n\n /**\n * class names to inject.\n */\n className?: string;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport function Button(props: ButtonProps) {\n const ref = useRef();\n\n // const { buttonProps } = useButton(\n // {\n // ...props,\n // elementType: props.href ? 'a' : undefined,\n // },\n // // @ts-ignore figure this out.\n // ref\n // );\n\n const allProps = {\n // ...buttonProps,\n ...props,\n };\n const external = props.href?.startsWith('http:') || props.href?.startsWith('https:');\n\n return (\n <>\n {!props.href ? (\n // @ts-ignore\n <button className={props.className} ref={ref} {...allProps}>\n {props.children}\n </button>\n ) : (\n // @ts-ignore\n <Link external={external} ref={ref} className={props.className} {...allProps}>\n {props.children}\n </Link>\n )}\n </>\n );\n}\n\nexport class Bar {\n foo() {}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;;;;;AAqBO,SAASA,MAAT,CAAgBC,KAAhB,EAAoC;EAAA;;EACzC,MAAMC,GAAG,GAAG,IAAAC,eAAA,GAAZ,CADyC,CAGzC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA,MAAMC,QAAQ,qBAETH,KAFS,CAAd;;EAIA,MAAMI,QAAQ,GAAG,gBAAAJ,KAAK,CAACK,IAAN,4DAAYC,UAAZ,CAAuB,OAAvB,uBAAmCN,KAAK,CAACK,IAAzC,iDAAmC,aAAYC,UAAZ,CAAuB,QAAvB,CAAnC,CAAjB;EAEA,oBACE,gEACG,CAACN,KAAK,CAACK,IAAP;EAAA;EACC;EACA;IAAQ,SAAS,EAAEL,KAAK,CAACO,SAAzB;IAAoC,GAAG,EAAEN;EAAzC,GAAkDE,QAAlD,GACGH,KAAK,CAACQ,QADT,CAFD;EAAA;EAMC;EACA,+BAAC,2BAAD;IAAM,QAAQ,EAAEJ,QAAhB;IAA0B,GAAG,EAAEH,GAA/B;IAAoC,SAAS,EAAED,KAAK,CAACO;EAArD,GAAoEJ,QAApE,GACGH,KAAK,CAACQ,QADT,CARJ,CADF;AAeD;;AAEM,MAAMC,GAAN,CAAU;EACfC,GAAG,GAAG,CAAE;;AADO"}
1
+ {"version":3,"names":["Button","props","ref","useRef","allProps","external","href","startsWith","className","children","Bar","foo"],"sources":["button.tsx"],"sourcesContent":["/* eslint-disable import/no-unresolved */\nimport React, { ReactNode, useRef } from 'react';\n// @ts-ignore\n// import { useButton } from '@react-aria/button';\nimport { Link } from '@teambit/base-react.navigation.link';\n\nexport type ButtonElementType = 'a' | 'button';\n\nexport type ButtonProps = {\n /**\n * children of the Button.\n */\n children: ReactNode;\n\n /**\n * link to target page. once href is used, Button is considered an A tag.\n */\n href?: string;\n\n /**\n * class names to inject.\n */\n className?: string;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport function Button(props: ButtonProps) {\n const ref = useRef();\n\n // const { buttonProps } = useButton(\n // {\n // ...props,\n // elementType: props.href ? 'a' : undefined,\n // },\n // // @ts-ignore figure this out.\n // ref\n // );\n\n const allProps = {\n // ...buttonProps,\n ...props,\n };\n const external = props.href?.startsWith('http:') || props.href?.startsWith('https:');\n\n return (\n <>\n {!props.href ? (\n // @ts-ignore\n <button className={props.className} ref={ref} {...allProps}>\n {props.children}\n </button>\n ) : (\n // @ts-ignore\n <Link external={external} ref={ref} className={props.className} {...allProps}>\n {props.children}\n </Link>\n )}\n </>\n );\n}\n\nexport class Bar {\n foo() {}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA2D;AAAA;AAAA;AAAA;AAqBpD,SAASA,MAAM,CAACC,KAAkB,EAAE;EAAA;EACzC,MAAMC,GAAG,GAAG,IAAAC,eAAM,GAAE;;EAEpB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA,MAAMC,QAAQ,qBAETH,KAAK,CACT;EACD,MAAMI,QAAQ,GAAG,gBAAAJ,KAAK,CAACK,IAAI,gDAAV,YAAYC,UAAU,CAAC,OAAO,CAAC,sBAAIN,KAAK,CAACK,IAAI,iDAAV,aAAYC,UAAU,CAAC,QAAQ,CAAC;EAEpF,oBACE,gEACG,CAACN,KAAK,CAACK,IAAI;EAAA;EACV;EACA;IAAQ,SAAS,EAAEL,KAAK,CAACO,SAAU;IAAC,GAAG,EAAEN;EAAI,GAAKE,QAAQ,GACvDH,KAAK,CAACQ,QAAQ,CACR;EAAA;EAET;EACA,+BAAC,2BAAI;IAAC,QAAQ,EAAEJ,QAAS;IAAC,GAAG,EAAEH,GAAI;IAAC,SAAS,EAAED,KAAK,CAACO;EAAU,GAAKJ,QAAQ,GACzEH,KAAK,CAACQ,QAAQ,CAElB,CACA;AAEP;AAEO,MAAMC,GAAG,CAAC;EACfC,GAAG,GAAG,CAAC;AACT;AAAC"}
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.array.iterator.js");
6
-
7
5
  require("core-js/modules/es.promise.js");
8
-
9
6
  Object.defineProperty(exports, "__esModule", {
10
7
  value: true
11
8
  });
@@ -40,19 +37,14 @@ exports.objectBindingElements = objectBindingElements;
40
37
  exports.tuple = void 0;
41
38
  exports.typePredicateFn = typePredicateFn;
42
39
  exports.typePredicateNoTypeFn = typePredicateNoTypeFn;
43
-
44
40
  function _defineProperty2() {
45
41
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
46
-
47
42
  _defineProperty2 = function () {
48
43
  return data;
49
44
  };
50
-
51
45
  return data;
52
46
  }
53
-
54
47
  var _button = require("./button");
55
-
56
48
  Object.keys(_button).forEach(function (key) {
57
49
  if (key === "default" || key === "__esModule") return;
58
50
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -64,38 +56,26 @@ Object.keys(_button).forEach(function (key) {
64
56
  }
65
57
  });
66
58
  });
67
-
68
59
  function _Compositions() {
69
60
  const data = _interopRequireWildcard(require("./button.composition"));
70
-
71
61
  _Compositions = function () {
72
62
  return data;
73
63
  };
74
-
75
64
  return data;
76
65
  }
77
-
78
66
  Object.defineProperty(exports, "Compositions", {
79
67
  enumerable: true,
80
68
  get: function () {
81
69
  return _Compositions();
82
70
  }
83
71
  });
84
-
85
72
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
86
-
87
73
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
88
-
89
74
  /* eslint-disable @typescript-eslint/no-empty-function */
90
-
91
75
  /* eslint-disable @typescript-eslint/no-shadow */
92
-
93
76
  /* eslint-disable @typescript-eslint/no-unused-vars */
94
-
95
77
  /* eslint-disable @typescript-eslint/prefer-as-const */
96
-
97
78
  /* eslint-disable one-var */
98
-
99
79
  /* eslint-disable max-classes-per-file */
100
80
 
101
81
  /**
@@ -108,42 +88,31 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
108
88
  function myFunc(a = 4, b = 5) {
109
89
  return a + b;
110
90
  }
111
-
112
91
  function Hi() {}
113
-
114
92
  const a = 4,
115
- b = 5;
93
+ b = 5;
116
94
  exports.b = b;
117
95
  exports.a = a;
118
96
  const HiThere = 'HiThere';
119
97
  exports.HiThere = HiThere;
120
-
121
98
  const Function = () => {};
122
-
123
99
  exports.Function = Function;
124
100
  const Array = ['hi', 'there'];
125
101
  exports.Array = Array;
126
-
127
102
  class Foo {}
128
-
129
103
  class ClassSomething {
130
104
  constructor(da) {
131
105
  this.da = da;
132
106
  (0, _defineProperty2().default)(this, "app", '');
133
107
  }
134
-
135
108
  a() {
136
109
  return new Foo();
137
110
  }
138
-
139
111
  get getter() {
140
112
  return 'hi';
141
113
  }
142
-
143
114
  set setter(a) {}
144
-
145
115
  }
146
-
147
116
  exports.ClassSomething = ClassSomething;
148
117
  const obj = {
149
118
  a: 1,
@@ -154,55 +123,39 @@ const a1 = {
154
123
  b: 9
155
124
  };
156
125
  exports.a1 = a1;
157
-
158
126
  // this is for Jump in the definition
159
127
  class Bar {
160
128
  foo() {}
161
-
162
129
  }
163
-
164
130
  const getBar = bar => new Bar();
165
-
166
131
  exports.getBar = getBar;
167
-
168
132
  const tuple = ([a, b, c]) => {};
169
-
170
133
  exports.tuple = tuple;
171
134
  let Food;
172
135
  exports.Food = Food;
173
-
174
136
  (function (Food) {
175
137
  Food[Food["Falafel"] = 0] = "Falafel";
176
138
  Food[Food["Hummus"] = 1] = "Hummus";
177
139
  Food[Food["Tahini"] = 2] = "Tahini";
178
140
  })(Food || (exports.Food = Food = {}));
179
-
180
141
  async function getPromise() {
181
142
  return 'promise';
182
143
  }
183
-
184
144
  class T1 {}
185
-
186
145
  class T2 {}
187
-
188
146
  class T3 {}
189
-
190
147
  function typePredicateFn(str) {
191
148
  return str;
192
149
  }
193
-
194
150
  function typePredicateNoTypeFn(condition, msg) {}
195
-
196
151
  async function objectBindingElements({
197
152
  prop = 1
198
153
  }) {
199
154
  return prop;
200
155
  }
201
-
202
156
  async function arrayBindingElements([prop]) {
203
157
  return prop;
204
158
  }
205
-
206
159
  const computedName = 'str';
207
160
 
208
161
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["myFunc","a","b","Hi","HiThere","Function","Array","Foo","ClassSomething","constructor","da","getter","setter","obj","a1","Bar","foo","getBar","bar","tuple","c","Food","getPromise","T1","T2","T3","typePredicateFn","str","typePredicateNoTypeFn","condition","msg","objectBindingElements","prop","arrayBindingElements","computedName"],"sources":["index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-disable @typescript-eslint/no-shadow */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/prefer-as-const */\n/* eslint-disable one-var */\n/* eslint-disable max-classes-per-file */\n\n/**\n * General comment of the myFunc\n * @deprecate example of deprecation tag\n * @param a { number } this is A\n * @param b this is B\n * @returns { number } results of adding a to b\n */\nexport function myFunc(a = 4, b = 5): number {\n return a + b;\n}\n\nexport * from './button';\n\nexport function Hi() {}\n\nexport const a = 4,\n b: 5 = 5;\n\nexport * as Compositions from './button.composition';\n\nexport const HiThere = 'HiThere';\n\nexport const Function = () => {};\n\nexport const Array = ['hi', 'there'];\n\nclass Foo {}\n\nclass ClassSomething {\n app = '';\n constructor(readonly da: 'dsa') {}\n\n a() {\n return new Foo();\n }\n get getter() {\n return 'hi';\n }\n\n set setter(a: boolean) {}\n}\n\nexport { ClassSomething };\n\nexport type IndexSig = { [key: string]: boolean };\n\nexport interface Hello {\n propertySig: () => void;\n methodSig(): string;\n}\n\nconst obj = { a: 1, b: 2 };\n\nexport const a1: typeof obj = { a: 5, b: 9 };\n\nexport type TypeOperator = keyof typeof obj;\n\n// this is for Jump in the definition\nclass Bar {\n foo() {}\n}\nexport const getBar = (bar: Bar) => new Bar();\n\nexport const tuple = ([a, b, c]: [string, Function, Record<string, any>]) => {};\n\nexport enum Food {\n Falafel,\n Hummus,\n Tahini,\n}\n\nexport async function getPromise(): Promise<string> {\n return 'promise';\n}\n\nclass T1 {}\nclass T2 {}\nclass T3<T, K> {}\nexport type TypeRefWithArgs = T3<T1, T2>;\n\nexport type ParenthesizedType = (T1 | T2)[];\n\nexport function typePredicateFn(str: any): str is string {\n return str;\n}\n\nexport function typePredicateNoTypeFn(condition: any, msg?: string): asserts condition {}\n\nexport async function objectBindingElements({ prop = 1 }) {\n return prop;\n}\nexport async function arrayBindingElements([prop]: [string]) {\n return prop;\n}\n\ninterface config {\n someField: { a: string; b: boolean };\n}\nexport type IndexedAccessType = config['someField'];\n\nconst computedName = 'str';\nexport interface ComputedNameWithType {\n [computedName]: boolean;\n}\nexport interface ComputedNameNoType {\n [computedName];\n}\n\ntype World1 = 'world1-a' | 'world1-b';\ntype World2 = 'world2';\nexport type templateLiteralType = `hello ${World1} hi ${World2}`;\n\nexport interface CallSignatureWithTypeParams {\n <T>(a: string): T;\n}\n\n/**\n * Conditional Generic Type\n */\nexport type If<T, U, Y, N> = T extends U ? Y : N;\n"],"mappings":";;;;;;;;;;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AJ,EAAOkB,CAAP,CAAD,KAAwD,CAAE,CAAxE;;;IAEKC,I;;;WAAAA,I;EAAAA,I,CAAAA,I;EAAAA,I,CAAAA,I;EAAAA,I,CAAAA,I;GAAAA,I,oBAAAA,I;;AAML,eAAeC,UAAf,GAA6C;EAClD,OAAO,SAAP;AACD;;AAED,MAAMC,EAAN,CAAS;;AACT,MAAMC,EAAN,CAAS;;AACT,MAAMC,EAAN,CAAe;;AAKR,SAASC,eAAT,CAAyBC,GAAzB,EAAkD;EACvD,OAAOA,GAAP;AACD;;AAEM,SAASC,qBAAT,CAA+BC,SAA/B,EAA+CC,GAA/C,EAAgF,CAAE;;AAElF,eAAeC,qBAAf,CAAqC;EAAEC,IAAI,GAAG;AAAT,CAArC,EAAmD;EACxD,OAAOA,IAAP;AACD;;AACM,eAAeC,oBAAf,CAAoC,CAACD,IAAD,CAApC,EAAsD;EAC3D,OAAOA,IAAP;AACD;;AAOD,MAAME,YAAY,GAAG,KAArB"}
1
+ {"version":3,"names":["myFunc","a","b","Hi","HiThere","Function","Array","Foo","ClassSomething","constructor","da","getter","setter","obj","a1","Bar","foo","getBar","bar","tuple","c","Food","getPromise","T1","T2","T3","typePredicateFn","str","typePredicateNoTypeFn","condition","msg","objectBindingElements","prop","arrayBindingElements","computedName"],"sources":["index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-disable @typescript-eslint/no-shadow */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/prefer-as-const */\n/* eslint-disable one-var */\n/* eslint-disable max-classes-per-file */\n\n/**\n * General comment of the myFunc\n * @deprecate example of deprecation tag\n * @param a { number } this is A\n * @param b this is B\n * @returns { number } results of adding a to b\n */\nexport function myFunc(a = 4, b = 5): number {\n return a + b;\n}\n\nexport * from './button';\n\nexport function Hi() {}\n\nexport const a = 4,\n b: 5 = 5;\n\nexport * as Compositions from './button.composition';\n\nexport const HiThere = 'HiThere';\n\nexport const Function = () => {};\n\nexport const Array = ['hi', 'there'];\n\nclass Foo {}\n\nclass ClassSomething {\n app = '';\n constructor(readonly da: 'dsa') {}\n\n a() {\n return new Foo();\n }\n get getter() {\n return 'hi';\n }\n\n set setter(a: boolean) {}\n}\n\nexport { ClassSomething };\n\nexport type IndexSig = { [key: string]: boolean };\n\nexport interface Hello {\n propertySig: () => void;\n methodSig(): string;\n}\n\nconst obj = { a: 1, b: 2 };\n\nexport const a1: typeof obj = { a: 5, b: 9 };\n\nexport type TypeOperator = keyof typeof obj;\n\n// this is for Jump in the definition\nclass Bar {\n foo() {}\n}\nexport const getBar = (bar: Bar) => new Bar();\n\nexport const tuple = ([a, b, c]: [string, Function, Record<string, any>]) => {};\n\nexport enum Food {\n Falafel,\n Hummus,\n Tahini,\n}\n\nexport async function getPromise(): Promise<string> {\n return 'promise';\n}\n\nclass T1 {}\nclass T2 {}\nclass T3<T, K> {}\nexport type TypeRefWithArgs = T3<T1, T2>;\n\nexport type ParenthesizedType = (T1 | T2)[];\n\nexport function typePredicateFn(str: any): str is string {\n return str;\n}\n\nexport function typePredicateNoTypeFn(condition: any, msg?: string): asserts condition {}\n\nexport async function objectBindingElements({ prop = 1 }) {\n return prop;\n}\nexport async function arrayBindingElements([prop]: [string]) {\n return prop;\n}\n\ninterface config {\n someField: { a: string; b: boolean };\n}\nexport type IndexedAccessType = config['someField'];\n\nconst computedName = 'str';\nexport interface ComputedNameWithType {\n [computedName]: boolean;\n}\nexport interface ComputedNameNoType {\n [computedName];\n}\n\ntype World1 = 'world1-a' | 'world1-b';\ntype World2 = 'world2';\nexport type templateLiteralType = `hello ${World1} hi ${World2}`;\n\nexport interface CallSignatureWithTypeParams {\n <T>(a: string): T;\n}\n\n/**\n * Conditional Generic Type\n */\nexport type If<T, U, Y, N> = T extends U ? Y : N;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MA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AC;AAAC;AAAA,IAEpEC,IAAI;AAAA;AAAA,WAAJA,IAAI;EAAJA,IAAI,CAAJA,IAAI;EAAJA,IAAI,CAAJA,IAAI;EAAJA,IAAI,CAAJA,IAAI;AAAA,GAAJA,IAAI,oBAAJA,IAAI;AAMT,eAAeC,UAAU,GAAoB;EAClD,OAAO,SAAS;AAClB;AAEA,MAAMC,EAAE,CAAC;AACT,MAAMC,EAAE,CAAC;AACT,MAAMC,EAAE,CAAO;AAKR,SAASC,eAAe,CAACC,GAAQ,EAAiB;EACvD,OAAOA,GAAG;AACZ;AAEO,SAASC,qBAAqB,CAACC,SAAc,EAAEC,GAAY,EAAqB,CAAC;AAEjF,eAAeC,qBAAqB,CAAC;EAAEC,IAAI,GAAG;AAAE,CAAC,EAAE;EACxD,OAAOA,IAAI;AACb;AACO,eAAeC,oBAAoB,CAAC,CAACD,IAAI,CAAW,EAAE;EAC3D,OAAOA,IAAI;AACb;AAOA,MAAME,YAAY,GAAG,KAAK"}
@@ -1,35 +1,27 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.SchemaExtract = void 0;
9
-
10
8
  function _defineProperty2() {
11
9
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
-
13
10
  _defineProperty2 = function () {
14
11
  return data;
15
12
  };
16
-
17
13
  return data;
18
14
  }
19
-
20
15
  class SchemaExtract {
21
16
  constructor(aspectId) {
22
17
  this.aspectId = aspectId;
23
18
  (0, _defineProperty2().default)(this, "name", 'schema-extraction');
24
19
  (0, _defineProperty2().default)(this, "description", 'extract api schema for a set of components');
25
20
  }
26
-
27
21
  execute() {
28
22
  throw new Error('Method not implemented.');
29
23
  }
30
-
31
24
  }
32
-
33
25
  exports.SchemaExtract = SchemaExtract;
34
26
 
35
27
  //# sourceMappingURL=schema-extract.task.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SchemaExtract","constructor","aspectId","execute","Error"],"sources":["schema-extract.task.ts"],"sourcesContent":["import { BuildTask, BuiltTaskResult } from '@teambit/builder';\n\nexport class SchemaExtract implements BuildTask {\n name = 'schema-extraction';\n description = 'extract api schema for a set of components';\n\n constructor(readonly aspectId: string) {}\n\n execute(): Promise<BuiltTaskResult> {\n throw new Error('Method not implemented.');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAEO,MAAMA,aAAN,CAAyC;EAI9CC,WAAW,CAAUC,QAAV,EAA4B;IAAA,KAAlBA,QAAkB,GAAlBA,QAAkB;IAAA,8CAHhC,mBAGgC;IAAA,qDAFzB,4CAEyB;EAAE;;EAEzCC,OAAO,GAA6B;IAClC,MAAM,IAAIC,KAAJ,CAAU,yBAAV,CAAN;EACD;;AAR6C"}
1
+ {"version":3,"names":["SchemaExtract","constructor","aspectId","execute","Error"],"sources":["schema-extract.task.ts"],"sourcesContent":["import { BuildTask, BuiltTaskResult } from '@teambit/builder';\n\nexport class SchemaExtract implements BuildTask {\n name = 'schema-extraction';\n description = 'extract api schema for a set of components';\n\n constructor(readonly aspectId: string) {}\n\n execute(): Promise<BuiltTaskResult> {\n throw new Error('Method not implemented.');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAEO,MAAMA,aAAa,CAAsB;EAI9CC,WAAW,CAAUC,QAAgB,EAAE;IAAA,KAAlBA,QAAgB,GAAhBA,QAAgB;IAAA,8CAH9B,mBAAmB;IAAA,qDACZ,4CAA4C;EAElB;EAExCC,OAAO,GAA6B;IAClC,MAAM,IAAIC,KAAK,CAAC,yBAAyB,CAAC;EAC5C;AACF;AAAC"}
@@ -4,21 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.SchemaAspect = void 0;
7
-
8
7
  function _harmony() {
9
8
  const data = require("@teambit/harmony");
10
-
11
9
  _harmony = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  const SchemaAspect = _harmony().Aspect.create({
19
15
  id: 'teambit.semantics/schema'
20
16
  });
21
-
22
17
  exports.SchemaAspect = SchemaAspect;
23
18
 
24
19
  //# sourceMappingURL=schema.aspect.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SchemaAspect","Aspect","create","id"],"sources":["schema.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const SchemaAspect = Aspect.create({\n id: 'teambit.semantics/schema',\n});\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,YAAY,GAAGC,iBAAA,CAAOC,MAAP,CAAc;EACxCC,EAAE,EAAE;AADoC,CAAd,CAArB"}
1
+ {"version":3,"names":["SchemaAspect","Aspect","create","id"],"sources":["schema.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const SchemaAspect = Aspect.create({\n id: 'teambit.semantics/schema',\n});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,YAAY,GAAGC,iBAAM,CAACC,MAAM,CAAC;EACxCC,EAAE,EAAE;AACN,CAAC,CAAC;AAAC"}
@@ -1,46 +1,33 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.array.iterator.js");
6
-
7
5
  require("core-js/modules/es.promise.js");
8
-
9
6
  Object.defineProperty(exports, "__esModule", {
10
7
  value: true
11
8
  });
12
9
  exports.SchemaCommand = void 0;
13
-
14
10
  function _defineProperty2() {
15
11
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
-
17
12
  _defineProperty2 = function () {
18
13
  return data;
19
14
  };
20
-
21
15
  return data;
22
16
  }
23
-
24
17
  function _pMapSeries() {
25
18
  const data = _interopRequireDefault(require("p-map-series"));
26
-
27
19
  _pMapSeries = function () {
28
20
  return data;
29
21
  };
30
-
31
22
  return data;
32
23
  }
33
-
34
24
  function _constants() {
35
25
  const data = require("@teambit/legacy/dist/constants");
36
-
37
26
  _constants = function () {
38
27
  return data;
39
28
  };
40
-
41
29
  return data;
42
30
  }
43
-
44
31
  class SchemaCommand {
45
32
  constructor(schema, component, logger) {
46
33
  this.schema = schema;
@@ -52,17 +39,14 @@ class SchemaCommand {
52
39
  (0, _defineProperty2().default)(this, "group", 'development');
53
40
  (0, _defineProperty2().default)(this, "options", [['j', 'json', 'return the component data in json format']]);
54
41
  }
55
-
56
42
  async report([pattern]) {
57
43
  const schemas = await this.getSchemas([pattern]);
58
44
  return schemas.map(schema => schema.toStringPerType()).join('\n\n\n');
59
45
  }
60
-
61
46
  async json([pattern]) {
62
47
  const schemas = await this.getSchemas([pattern]);
63
48
  return schemas.map(schema => schema.toObject());
64
49
  }
65
-
66
50
  async getSchemas([pattern]) {
67
51
  const host = this.component.getHost();
68
52
  const ids = await host.idsByPattern(pattern, true);
@@ -75,9 +59,7 @@ class SchemaCommand {
75
59
  longRunningLog.end();
76
60
  return results;
77
61
  }
78
-
79
62
  }
80
-
81
63
  exports.SchemaCommand = SchemaCommand;
82
64
 
83
65
  //# sourceMappingURL=schema.cmd.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SchemaCommand","constructor","schema","component","logger","PATTERN_HELP","report","pattern","schemas","getSchemas","map","toStringPerType","join","json","toObject","host","getHost","ids","idsByPattern","components","getMany","longRunningLog","createLongProcessLogger","length","results","pMapSeries","logProgress","id","toString","getSchema","end"],"sources":["schema.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentMain } from '@teambit/component';\nimport pMapSeries from 'p-map-series';\nimport { Logger } from '@teambit/logger';\nimport { APISchema } from '@teambit/semantics.entities.semantic-schema';\nimport { PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport type { SchemaMain } from './schema.main.runtime';\n\nexport class SchemaCommand implements Command {\n name = 'schema <pattern>';\n description = 'shows the API schema of a certain component.';\n extendedDescription = `${PATTERN_HELP('schema')}`;\n group = 'development';\n options = [['j', 'json', 'return the component data in json format']] as CommandOptions;\n\n constructor(private schema: SchemaMain, private component: ComponentMain, private logger: Logger) {}\n\n async report([pattern]) {\n const schemas = await this.getSchemas([pattern]);\n return schemas.map((schema) => schema.toStringPerType()).join('\\n\\n\\n');\n }\n\n async json([pattern]) {\n const schemas = await this.getSchemas([pattern]);\n return schemas.map((schema) => schema.toObject());\n }\n\n private async getSchemas([pattern]): Promise<APISchema[]> {\n const host = this.component.getHost();\n const ids = await host.idsByPattern(pattern, true);\n const components = await host.getMany(ids);\n const longRunningLog = this.logger.createLongProcessLogger('generating schema', ids.length);\n const results = await pMapSeries(components, (component) => {\n longRunningLog.logProgress(component.id.toString());\n return this.schema.getSchema(component);\n });\n longRunningLog.end();\n return results;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,aAAN,CAAuC;EAO5CC,WAAW,CAASC,MAAT,EAAqCC,SAArC,EAAuEC,MAAvE,EAAuF;IAAA,KAA9EF,MAA8E,GAA9EA,MAA8E;IAAA,KAAlDC,SAAkD,GAAlDA,SAAkD;IAAA,KAAhBC,MAAgB,GAAhBA,MAAgB;IAAA,8CAN3F,kBAM2F;IAAA,qDALpF,8CAKoF;IAAA,6DAJ3E,GAAE,IAAAC,yBAAA,EAAa,QAAb,CAAuB,EAIkD;IAAA,+CAH1F,aAG0F;IAAA,iDAFxF,CAAC,CAAC,GAAD,EAAM,MAAN,EAAc,0CAAd,CAAD,CAEwF;EAAE;;EAExF,MAANC,MAAM,CAAC,CAACC,OAAD,CAAD,EAAY;IACtB,MAAMC,OAAO,GAAG,MAAM,KAAKC,UAAL,CAAgB,CAACF,OAAD,CAAhB,CAAtB;IACA,OAAOC,OAAO,CAACE,GAAR,CAAaR,MAAD,IAAYA,MAAM,CAACS,eAAP,EAAxB,EAAkDC,IAAlD,CAAuD,QAAvD,CAAP;EACD;;EAES,MAAJC,IAAI,CAAC,CAACN,OAAD,CAAD,EAAY;IACpB,MAAMC,OAAO,GAAG,MAAM,KAAKC,UAAL,CAAgB,CAACF,OAAD,CAAhB,CAAtB;IACA,OAAOC,OAAO,CAACE,GAAR,CAAaR,MAAD,IAAYA,MAAM,CAACY,QAAP,EAAxB,CAAP;EACD;;EAEuB,MAAVL,UAAU,CAAC,CAACF,OAAD,CAAD,EAAkC;IACxD,MAAMQ,IAAI,GAAG,KAAKZ,SAAL,CAAea,OAAf,EAAb;IACA,MAAMC,GAAG,GAAG,MAAMF,IAAI,CAACG,YAAL,CAAkBX,OAAlB,EAA2B,IAA3B,CAAlB;IACA,MAAMY,UAAU,GAAG,MAAMJ,IAAI,CAACK,OAAL,CAAaH,GAAb,CAAzB;IACA,MAAMI,cAAc,GAAG,KAAKjB,MAAL,CAAYkB,uBAAZ,CAAoC,mBAApC,EAAyDL,GAAG,CAACM,MAA7D,CAAvB;IACA,MAAMC,OAAO,GAAG,MAAM,IAAAC,qBAAA,EAAWN,UAAX,EAAwBhB,SAAD,IAAe;MAC1DkB,cAAc,CAACK,WAAf,CAA2BvB,SAAS,CAACwB,EAAV,CAAaC,QAAb,EAA3B;MACA,OAAO,KAAK1B,MAAL,CAAY2B,SAAZ,CAAsB1B,SAAtB,CAAP;IACD,CAHqB,CAAtB;IAIAkB,cAAc,CAACS,GAAf;IACA,OAAON,OAAP;EACD;;AA9B2C"}
1
+ {"version":3,"names":["SchemaCommand","constructor","schema","component","logger","PATTERN_HELP","report","pattern","schemas","getSchemas","map","toStringPerType","join","json","toObject","host","getHost","ids","idsByPattern","components","getMany","longRunningLog","createLongProcessLogger","length","results","pMapSeries","logProgress","id","toString","getSchema","end"],"sources":["schema.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentMain } from '@teambit/component';\nimport pMapSeries from 'p-map-series';\nimport { Logger } from '@teambit/logger';\nimport { APISchema } from '@teambit/semantics.entities.semantic-schema';\nimport { PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport type { SchemaMain } from './schema.main.runtime';\n\nexport class SchemaCommand implements Command {\n name = 'schema <pattern>';\n description = 'shows the API schema of a certain component.';\n extendedDescription = `${PATTERN_HELP('schema')}`;\n group = 'development';\n options = [['j', 'json', 'return the component data in json format']] as CommandOptions;\n\n constructor(private schema: SchemaMain, private component: ComponentMain, private logger: Logger) {}\n\n async report([pattern]) {\n const schemas = await this.getSchemas([pattern]);\n return schemas.map((schema) => schema.toStringPerType()).join('\\n\\n\\n');\n }\n\n async json([pattern]) {\n const schemas = await this.getSchemas([pattern]);\n return schemas.map((schema) => schema.toObject());\n }\n\n private async getSchemas([pattern]): Promise<APISchema[]> {\n const host = this.component.getHost();\n const ids = await host.idsByPattern(pattern, true);\n const components = await host.getMany(ids);\n const longRunningLog = this.logger.createLongProcessLogger('generating schema', ids.length);\n const results = await pMapSeries(components, (component) => {\n longRunningLog.logProgress(component.id.toString());\n return this.schema.getSchema(component);\n });\n longRunningLog.end();\n return results;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,aAAa,CAAoB;EAO5CC,WAAW,CAASC,MAAkB,EAAUC,SAAwB,EAAUC,MAAc,EAAE;IAAA,KAA9EF,MAAkB,GAAlBA,MAAkB;IAAA,KAAUC,SAAwB,GAAxBA,SAAwB;IAAA,KAAUC,MAAc,GAAdA,MAAc;IAAA,8CANzF,kBAAkB;IAAA,qDACX,8CAA8C;IAAA,6DACrC,GAAE,IAAAC,yBAAY,EAAC,QAAQ,CAAE,EAAC;IAAA,+CACzC,aAAa;IAAA,iDACX,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,0CAA0C,CAAC,CAAC;EAE8B;EAEnG,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