@teambit/bit 1.9.12 → 1.9.13
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/artifacts/preview/teambit_harmony_bit-preview.js +1 -1
- package/artifacts/schema.json +1 -1
- package/dist/{preview-1734020193676.js → preview-1734060058410.js} +2 -2
- package/dist/server-commander.d.ts +5 -4
- package/dist/server-commander.js +109 -26
- package/dist/server-commander.js.map +1 -1
- package/dist/server-forever.d.ts +1 -0
- package/dist/server-forever.js +5 -4
- package/dist/server-forever.js.map +1 -1
- package/package.json +3 -3
- package/artifacts/__bit_junit.xml +0 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see teambit_harmony_bit-preview.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.harmony/bit-preview"]=t():e["teambit.harmony/bit-preview"]=t()}(self,(()=>(()=>{var e={8443:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)&&n.length){var a=r.apply(null,n);a&&e.push(a)}else if("object"===i)for(var s in n)o.call(n,s)&&n[s]&&e.push(s)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},9685:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=r.apply(null,n);a&&e.push(a)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4949:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function r(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var o,i,a=[];for(i in"string"!=typeof t&&(t="?"),e)if(n.call(e,i)){if((o=e[i])||null!=o&&!isNaN(o)||(o=""),i=r(i),o=r(o),null===i||null===o)continue;a.push(i+"="+o)}return a.length?t+a.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,r={};t=n.exec(e);){var i=o(t[1]),a=o(t[2]);null===i||null===a||i in r||(r[i]=a)}return r}},1788:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},7114:(e,t,n)=>{"use strict";var o=n(1788),r=n(4949),i=/^[A-Za-z][A-Za-z0-9+-.]*:[\\/]+/,a=/^([a-z][a-z0-9.+-]*:)?([\\/]{1,})?([\S\s]*)/i,s=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function u(e){return(e||"").toString().replace(s,"")}var c=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};function d(e){var t,o=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},r={},a=typeof(e=e||o);if("blob:"===e.protocol)r=new f(unescape(e.pathname),{});else if("string"===a)for(t in r=new f(e,{}),l)delete r[t];else if("object"===a){for(t in e)t in l||(r[t]=e[t]);void 0===r.slashes&&(r.slashes=i.test(e.href))}return r}function p(e){e=u(e);var t=a.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!(t[2]&&t[2].length>=2),rest:t[2]&&1===t[2].length?"/"+t[3]:t[3]}}function f(e,t,n){if(e=u(e),!(this instanceof f))return new f(e,t,n);var i,a,s,l,m,b,_=c.slice(),h=typeof t,y=this,v=0;for("object"!==h&&"string"!==h&&(n=t,t=null),n&&"function"!=typeof n&&(n=r.parse),t=d(t),i=!(a=p(e||"")).protocol&&!a.slashes,y.slashes=a.slashes||i&&t.slashes,y.protocol=a.protocol||t.protocol||"",e=a.rest,a.slashes||(_[3]=[/(.*)/,"pathname"]);v<_.length;v++)"function"!=typeof(l=_[v])?(s=l[0],b=l[1],s!=s?y[b]=e:"string"==typeof s?~(m=e.indexOf(s))&&("number"==typeof l[2]?(y[b]=e.slice(0,m),e=e.slice(m+l[2])):(y[b]=e.slice(m),e=e.slice(0,m))):(m=s.exec(e))&&(y[b]=m[1],e=e.slice(0,m.index)),y[b]=y[b]||i&&l[3]&&t[b]||"",l[4]&&(y[b]=y[b].toLowerCase())):e=l(e);n&&(y.query=n(y.query)),i&&t.slashes&&"/"!==y.pathname.charAt(0)&&(""!==y.pathname||""!==t.pathname)&&(y.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=n.length,r=n[o-1],i=!1,a=0;o--;)"."===n[o]?n.splice(o,1):".."===n[o]?(n.splice(o,1),a++):a&&(0===o&&(i=!0),n.splice(o,1),a--);return i&&n.unshift(""),"."!==r&&".."!==r||n.push(""),n.join("/")}(y.pathname,t.pathname)),"/"!==y.pathname.charAt(0)&&y.hostname&&(y.pathname="/"+y.pathname),o(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(l=y.auth.split(":"),y.username=l[0]||"",y.password=l[1]||""),y.origin=y.protocol&&y.host&&"file:"!==y.protocol?y.protocol+"//"+y.host:"null",y.href=y.toString()}f.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||r.parse)(t)),i[e]=t;break;case"port":i[e]=t,o(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,/:\d+$/.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var a="pathname"===e?"/":"#";i[e]=t.charAt(0)!==a?a+t:t}else i[e]=t;break;default:i[e]=t}for(var s=0;s<c.length;s++){var u=c[s];u[4]&&(i[u[1]]=i[u[1]].toLowerCase())}return i.origin=i.protocol&&i.host&&"file:"!==i.protocol?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=r.stringify);var t,n=this,o=n.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var i=o+(n.slashes?"//":"");return n.username&&(i+=n.username,n.password&&(i+=":"+n.password),i+="@"),i+=n.host+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},f.extractProtocol=p,f.location=d,f.trimLeft=u,f.qs=r,e.exports=f},8888:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseImage=void 0;const i=r(n(1594)),a=r(n(8443)),s=r(n(4749));function u(e){var{alt:t,className:n,fullWidth:r}=e,u=o(e,["alt","className","fullWidth"]);return i.default.createElement("img",Object.assign({"data-bit-id":"teambit.base-ui/elements/image",alt:t},u,{className:a.default(s.default.image,r&&s.default.fullWidth,n)}))}u.__bit_component={id:"teambit.base-ui/elements/image@1.0.0",homepage:"https://bit.dev/teambit/base-ui/elements/image",exported:!0},t.BaseImage=u},4437:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(8888),t)},4181:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CenterColumn=void 0;const i=r(n(1594)),a=r(n(8443)),s=r(n(6169));function u(e){var{children:t,className:n}=e,r=o(e,["children","className"]);return i.default.createElement("div",Object.assign({className:(0,a.default)(s.default.centerColumn,n)},r),t)}u.__bit_component={id:"teambit.base-ui/layout/page-frame@1.0.2",homepage:"https://bit.dev/teambit/base-ui/layout/page-frame",exported:!0},t.CenterColumn=u},9743:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CenterColumn=t.WideColumn=t.textColumn=t.wideColumn=t.centerColumn=void 0;const r=o(n(6169));t.centerColumn=r.default.centerColumn,t.wideColumn=r.default.wideColumn,t.textColumn=r.default.textColumn;var i=n(1263);Object.defineProperty(t,"WideColumn",{enumerable:!0,get:function(){return i.WideColumn}});var a=n(4181);Object.defineProperty(t,"CenterColumn",{enumerable:!0,get:function(){return a.CenterColumn}})},1263:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WideColumn=void 0;const i=r(n(1594)),a=r(n(8443)),s=r(n(6169));function u(e){var{children:t,className:n}=e,r=o(e,["children","className"]);return i.default.createElement("div",Object.assign({className:(0,a.default)(s.default.wideColumn,n)},r),t)}u.__bit_component={id:"teambit.base-ui/layout/page-frame@1.0.2",homepage:"https://bit.dev/teambit/base-ui/layout/page-frame",exported:!0},t.WideColumn=u},7146:function(e,t,n){"use strict";var o={id:"teambit.base-ui/routing/compare-url@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/compare-url",exported:!0},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.compareUrl=void 0;const i=r(n(7114));function a(e,t,{exact:n,strict:o}={}){if(e===t)return!0;o||(e=e.replace(/\/(?=[?#]|$)/,""),t=t.replace(/\/(?=[?#]|$)/,""));const r=i.default(e),a=i.default(t),l=s(r,a),d=!n||u(r,a),p=!o||c(r,a);return l&&d&&p}function s(e,t){return(!t.protocol||t.protocol===e.protocol)&&(!t.hostname||t.hostname===e.hostname)&&(!t.port||t.port===e.port)&&(!t.pathname||e.pathname.startsWith(t.pathname))&&(!t.query||l(t.query,e.query))&&(!t.hash||t.hash===e.hash)&&(!t.password||t.password===e.password)&&(!t.username||t.username===e.username)}function u(e,t){return(!t.pathname||e.pathname===t.pathname)&&(!t.query||l(e.query,t.query))}function c(e,t){return!t.pathname||e.pathname.endsWith("/")===t.pathname.endsWith("/")}function l(e,t){return Object.keys(e).every((n=>e[n]===t[n]))}a.__bit_component=o,t.compareUrl=a,s.__bit_component=o,u.__bit_component=o,c.__bit_component=o,l.__bit_component=o},5749:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareUrl=void 0;var o=n(7146);Object.defineProperty(t,"compareUrl",{enumerable:!0,get:function(){return o.compareUrl}})},9249:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Link=void 0;var o=n(9725);Object.defineProperty(t,"Link",{enumerable:!0,get:function(){return o.Link}})},9725:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Link=void 0;const r=o(n(1594)),i=n(1089);function a(e){const t=i.useRouting().Link;return r.default.createElement(t,Object.assign({},e))}a.__bit_component={id:"teambit.base-ui/routing/link@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/link",exported:!0},t.Link=a},7509:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NativeLink=void 0;var o=n(6627);Object.defineProperty(t,"NativeLink",{enumerable:!0,get:function(){return o.NativeLink}})},6627:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.NativeLink=void 0;const s=i(n(1594)),u={rel:"noopener",target:"_blank"};function c(e){var{href:t="",external:n,replace:o,onClick:r}=e,i=a(e,["href","external","replace","onClick"]);const c=n?u:{},l=s.useCallback((e=>{const i=null==r?void 0:r(e);return e.defaultPrevented||!o||n||(e.preventDefault(),window.location.replace(t)),i}),[t,o,r]);return s.default.createElement("a",Object.assign({},i,c,{onClick:l,href:t}))}c.__bit_component={id:"teambit.base-ui/routing/native-link@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/native-link",exported:!0},t.NativeLink=c},9581:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NativeNavLink=void 0;var o=n(1123);Object.defineProperty(t,"NativeNavLink",{enumerable:!0,get:function(){return o.NativeNavLink}})},1123:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NativeNavLink=void 0;const u=i(n(1594)),c=s(n(8443)),l=n(7509),d=n(5749),p=n(201);function f(e){var{activeClassName:t,activeStyle:n,isActive:o,exact:r,strict:i,style:s,className:f}=e,m=a(e,["activeClassName","activeStyle","isActive","exact","strict","style","className"]);const b=p.isBrowser?window.location.href:"/",_=u.useMemo((()=>m.href&&d.compareUrl(b,m.href)),[r,i,b,m.href]),h=(null==o?void 0:o())||_,y=u.useMemo((()=>h&&n?Object.assign(Object.assign({},s),n):s),[h,s]);return u.default.createElement(l.NativeLink,Object.assign({},m,{style:y,className:c.default(f,h&&t)}))}f.__bit_component={id:"teambit.base-ui/routing/native-nav-link@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/native-nav-link",exported:!0},t.NativeNavLink=f},1089:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useLocation=t.useRouting=t.RoutingProvider=void 0;var o=n(9133);Object.defineProperty(t,"RoutingProvider",{enumerable:!0,get:function(){return o.RoutingProvider}}),Object.defineProperty(t,"useRouting",{enumerable:!0,get:function(){return o.useRouting}}),Object.defineProperty(t,"useLocation",{enumerable:!0,get:function(){return o.useLocation}})},9133:function(e,t,n){"use strict";var o={id:"teambit.base-ui/routing/routing-provider@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/routing-provider",exported:!0},r=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocation=t.useRouting=t.RoutingProvider=void 0;const s=a(n(1594)),u=n(7509),c=n(9581),l=n(201),d={pathname:"/",search:"",hash:""},p={Link:u.NativeLink,NavLink:c.NativeNavLink,useLocation:()=>l.isBrowser?window.location:d},f=s.createContext(p);function m({value:e,children:t}){return s.default.createElement(f.Provider,{value:e},t)}function b(){return s.useContext(f)}function _(){return b().useLocation()}m.__bit_component=o,t.RoutingProvider=m,b.__bit_component=o,t.useRouting=b,_.__bit_component=o,t.useLocation=_},2345:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Heading=void 0;const i=r(n(1594));function a(e){var{element:t="h1"}=e,n=o(e,["element"]);const r=t;return i.default.createElement(r,Object.assign({"data-bit-id":"teambit.base-ui/text/heading"},n))}a.__bit_component={id:"teambit.base-ui/text/heading@1.0.4",homepage:"https://bit.dev/teambit/base-ui/text/heading",exported:!0},t.Heading=a},7979:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Heading=void 0;var o=n(2345);Object.defineProperty(t,"Heading",{enumerable:!0,get:function(){return o.Heading}})},201:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=void 0;var o=n(5288);Object.defineProperty(t,"isBrowser",{enumerable:!0,get:function(){return o.isBrowser}})},5288:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=void 0,t.isBrowser="undefined"!=typeof window},3467:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.bitComponent=void 0;const r=o(n(1594)),i=n(7266),a=o(n(7358));t.bitComponent=[{id:"teambit.bit/bit",href:"https://bit.cloud/teambit/harmony/bit",description:"Bit is an open-source component for composing component driven software",envIcon:"https://static.bit.dev/extensions-icons/default.svg",preview:r.default.createElement("div",{className:a.default.logo},r.default.createElement(i.Logo,{customSize:64}))}]},5890:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WhatIsBitQuickStart=t.Size=t.WhatIsBit=t.default=t.WhatIsBitLong=void 0;var r=n(9960);Object.defineProperty(t,"WhatIsBitLong",{enumerable:!0,get:function(){return o(r).default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o(r).default}});var i=n(2337);Object.defineProperty(t,"WhatIsBit",{enumerable:!0,get:function(){return i.WhatIsBit}}),Object.defineProperty(t,"Size",{enumerable:!0,get:function(){return i.Size}});var a=n(6478);Object.defineProperty(t,"WhatIsBitQuickStart",{enumerable:!0,get:function(){return a.WhatIsBitQuickStart}})},9305:(e,t,n)=>{"use strict";var o={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=p,a(n(1594));var r=n(5016),i=["components"];function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}function u(e,t){if(null==e)return{};var n,o,r=c(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}a.__bit_component=o,s.__bit_component=o,u.__bit_component=o,c.__bit_component=o;var l={},d="wrapper";function p(e){var t=e.components,n=u(e,i);return(0,r.mdx)(d,s({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"Bit does not prescribe how to build your entire application. It helps you define and compose components and allows for every component to adopt the dev tools that best fit its nature.\nA React component is likely to be compiled, tested and perhaps even deployed using a composition of tools different than the one a backend-service component, or a generic function, may use.\nBit comes with native support in various dev tools like TypeScript, Babel, Jest, Webpack, ESLint, and ready made development environments for React, NodeJS, Angular and more. New tools can be easily integrated by adding one more component into Bit!"))}p.__bit_component=o,p.isMDXComponent=!0},2087:(e,t,n)=>{"use strict";var o={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=p,a(n(1594));var r=n(5016),i=["components"];function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}function u(e,t){if(null==e)return{};var n,o,r=c(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}a.__bit_component=o,s.__bit_component=o,u.__bit_component=o,c.__bit_component=o;var l={},d="wrapper";function p(e){var t=e.components,n=u(e,i);return(0,r.mdx)(d,s({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"Bit does not prescribe how to build your entire application. It helps you define and compose components and allows for every component to adopt the dev tools that best fit its nature.\nA React component is likely to be compiled, tested and perhaps even deployed using a composition of tools different than the one a backend-service component, or a generic function, may use.\nBit comes with native support in various dev tools like TypeScript, Babel, Jest, Webpack, ESLint, and ready made development environments for React, NodeJS, Angular and more. New tools can be easily integrated by adding one more component into Bit!"))}p.__bit_component=o,p.isMDXComponent=!0},4321:(e,t,n)=>{"use strict";var o={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=p,a(n(1594));var r=n(5016),i=["components"];function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}function u(e,t){if(null==e)return{};var n,o,r=c(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}a.__bit_component=o,s.__bit_component=o,u.__bit_component=o,c.__bit_component=o;var l={},d="wrapper";function p(e){var t=e.components,n=u(e,i);return(0,r.mdx)(d,s({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("h3",null,"What is Bit?"),(0,r.mdx)("p",null,"Bit is an open-source tool for composing component-driven software."))}p.__bit_component=o,p.isMDXComponent=!0},6478:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WhatIsBitQuickStart=void 0;const r=o(n(1594)),i=n(3824),a=n(9743),s=n(3929),u=o(n(2087)),c=o(n(9305)),l=o(n(4321)),d=n(3467),p=o(n(4147)),f=()=>r.default.createElement(a.WideColumn,null,r.default.createElement(l.default,null),r.default.createElement(i.LeftRight,{className:p.default.leftRight,left:r.default.createElement(u.default,null),right:r.default.createElement(s.ComponentCardGroup,{components:d.bitComponent})}),r.default.createElement(c.default,null));f.__bit_component={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0},t.WhatIsBitQuickStart=f},7643:(e,t,n)=>{"use strict";var o={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=_,l(n(1594));var r=n(5016),i=n(3929),a=l(n(634)),s=n(3467),u=l(n(7358)),c=["components"];function l(e){return e&&e.__esModule?e:{default:e}}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d.apply(this,arguments)}function p(e,t){if(null==e)return{};var n,o,r=f(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function f(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}l.__bit_component=o,d.__bit_component=o,p.__bit_component=o,f.__bit_component=o;var m={},b="wrapper";function _(e){var t=e.components,n=p(e,c);return(0,r.mdx)(b,d({},m,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"Bit is an open-source tool for composing component-driven software."),(0,r.mdx)(i.ComponentCardGroup,{components:s.bitComponent,className:u.default.bitCard,mdxType:"ComponentCardGroup"}),(0,r.mdx)("br",null),(0,r.mdx)(a.default,{components:s.bitComponent,mdxType:"WhatIsBitSmall"}),(0,r.mdx)("p",null,"Bit does not prescribe how to build your entire application. It helps you define and compose components and allows for every component to adopt the dev tools that best fit its nature.\nA React component is likely to be compiled, tested and perhaps even deployed using a composition of tools different than the one a backend-service component, or a generic function, may use.\nBit offers native support for various dev tools like ",(0,r.mdx)("a",{parentName:"p",href:"/tools/typescript"},"TypeScript"),", ",(0,r.mdx)("a",{parentName:"p",href:"/tools/babel"},"Babel"),", ",(0,r.mdx)("a",{parentName:"p",href:"/tools/jest"},"Jest"),", ",(0,r.mdx)("a",{parentName:"p",href:"/tools/webpack"},"Webpack"),", ",(0,r.mdx)("a",{parentName:"p",href:"/tools/eslint"},"ESLint")," and\nready made development environments for ",(0,r.mdx)("a",{parentName:"p",href:"/frameworks/react"},"React"),", ",(0,r.mdx)("a",{parentName:"p",href:"/frameworks/node"},"NodeJS"),", ",(0,r.mdx)("a",{parentName:"p",href:"/envs/angular"},"Angular")," and more. New tools can be easily integrated by\nextending Bit with one more component."))}_.__bit_component=o,_.isMDXComponent=!0},634:(e,t,n)=>{"use strict";var o={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=p,a(n(1594));var r=n(5016),i=["components"];function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}function u(e,t){if(null==e)return{};var n,o,r=c(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}a.__bit_component=o,s.__bit_component=o,u.__bit_component=o,c.__bit_component=o;var l={},d="wrapper";function p(e){var t=e.components,n=u(e,i);return(0,r.mdx)(d,s({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"Bit stands at the intersection between product and engineering. ",(0,r.mdx)("strong",{parentName:"p"},"It helps you take complex product requirements, and break them down into independent,\nand reusable pieces called")," ",(0,r.mdx)("strong",{parentName:"p"},(0,r.mdx)("em",{parentName:"strong"},'"components"')),". It allows you to create components and compose them with each other. Components are described by names and APIs, and contain source code implementation.\nThey can be of different kinds like apps, pages, UI components, backend services and even content. You can ",(0,r.mdx)("a",{parentName:"p",href:"/thinking-in-components"},"think of almost anything in components"),"."),(0,r.mdx)("p",null,'It is common to think of components that function as full applications, as "large", whereas components that function as simple elements, like a \'button\', as "small".\nFor us, both types of components are "the same size", but each has a different responsibility. An app is a very concrete component. It has many dependencies and just a few (if any) dependents.\nA button, on the other hand, is very abstract. It has just a few dependencies and many dependents. Having this sort of dependents-to-dependencies ratio indicates that a component is highly-reusable.'))}p.__bit_component=o,p.isMDXComponent=!0},2337:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WhatIsBit=t.Size=void 0;const r=o(n(1594)),i=o(n(9960)),a=o(n(7643)),s=o(n(634));var u;function c({size:e}){return e===u.SMALL?r.default.createElement(s.default,null):e===u.MEDIUM?r.default.createElement(a.default,null):r.default.createElement(i.default,null)}!function(e){e[e.SMALL=0]="SMALL",e[e.MEDIUM=1]="MEDIUM",e[e.LARGE=2]="LARGE"}(u=t.Size||(t.Size={})),c.__bit_component={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0},t.WhatIsBit=c},9960:(e,t,n)=>{"use strict";var o={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=f,s(n(1594));var r=n(5016),i=s(n(7643)),a=["components"];function s(e){return e&&e.__esModule?e:{default:e}}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},u.apply(this,arguments)}function c(e,t){if(null==e)return{};var n,o,r=l(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function l(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}s.__bit_component=o,u.__bit_component=o,c.__bit_component=o,l.__bit_component=o;var d={},p="wrapper";function f(e){var t=e.components,n=c(e,a);return(0,r.mdx)(p,u({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("h3",null,"What is Bit?"),(0,r.mdx)(i.default,{mdxType:"WhatIsBitShort"}),(0,r.mdx)("h3",null,"What can you do with Bit?"),(0,r.mdx)("p",null,"Anything is possible with Bit! We built ",(0,r.mdx)("a",{parentName:"p",href:"https://bit.dev"},"Bit")," and ",(0,r.mdx)("a",{parentName:"p",href:"https://bit.cloud"},"bit.cloud")," entirely using Bit. These are complex systems which includes infrastructure\ntools, cloud products and multiple user interfaces."),(0,r.mdx)("p",null,"People use Bit to create all kind of applications, from user interfaces with component-driven frameworks like React, Vue and Angular, to complex\nmicro-service architectures, serverless functions, CLI utilities, desktop applications, native mobile applications and even IoT. You can do with Bit about anything you can do with JS\nand even beyond."),(0,r.mdx)("h3",null,"What Bit supports?"),(0,r.mdx)("p",null,"Bit was built with TypeScript and supports it natively. It was designed to be language-agnostic, and will support other software languages in the future! For now, our development environments use TypeScript as the default compiler for JS and TS components. You can easily switch to Babel or any other compiler. Bit is completely agnostic to your tech stack."))}f.__bit_component=o,f.isMDXComponent=!0},7266:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Logo:()=>c,RecommendedSizes:()=>o});var o,r=n(1594),i=n.n(r),a=n(4437);!function(e){e[e.small=16]="small",e[e.medium=24]="medium",e[e.large=32]="large",e[e.xl=40]="xl"}(o||(o={}));const s=new URL(n(314),n.b).toString();var u=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};function c(e){var{size:t,customSize:n,alt:o}=e,r=u(e,["size","customSize","alt"]);const c=n||t;return i().createElement(a.BaseImage,Object.assign({},r,{src:s,alt:o||"",height:c,width:c}))}c.__bit_component={id:"teambit.design/ui/brand/logo@1.96.2",homepage:"https://bit.dev/teambit/design/ui/brand/logo",exported:!0},c.defaultProps={size:o.medium,alt:"Bit"}},7496:function(e,t,n){"use strict";var o={id:"teambit.design/ui/heading@1.0.16",homepage:"https://bit.dev/teambit/design/ui/heading",exported:!0},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.H6=t.H5=t.H4=t.H3=t.H2=t.H1=void 0;const i=r(n(1594)),a=r(n(8443)),s=n(7979),u=r(n(488)),c=r(n(8669)),l=r(n(4854));function d(e){return i.default.createElement(s.Heading,Object.assign({element:"h1"},e,{className:(0,a.default)(c.default.h1,l.default.h1,u.default[e.size||"lg"],e.className)}))}function p(e){return i.default.createElement(s.Heading,Object.assign({element:"h2"},e,{className:(0,a.default)(c.default.h2,u.default[e.size||"lg"],e.className)}))}function f(e){return i.default.createElement(s.Heading,Object.assign({element:"h3"},e,{className:(0,a.default)(c.default.h3,u.default[e.size||"md"],e.className)}))}function m(e){return i.default.createElement(s.Heading,Object.assign({element:"h4"},e,{className:(0,a.default)(c.default.h4,u.default[e.size||"sm"],e.className)}))}function b(e){return i.default.createElement(s.Heading,Object.assign({element:"h5"},e,{className:(0,a.default)(c.default.h5,u.default[e.size||"xs"],e.className)}))}function _(e){return i.default.createElement(s.Heading,Object.assign({element:"h6"},e,{className:(0,a.default)(c.default.h6,u.default[e.size||"xxs"],e.className)}))}d.__bit_component=o,t.H1=d,p.__bit_component=o,t.H2=p,f.__bit_component=o,t.H3=f,m.__bit_component=o,t.H4=m,b.__bit_component=o,t.H5=b,_.__bit_component=o,t.H6=_},9462:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(7496),t)},3824:(e,t,n)=>{"use strict";n.r(t),n.d(t,{LeftRight:()=>c});var o=n(1594),r=n.n(o),i=n(9685),a=n.n(i);const s={leftRight:"left-right_leftRight__Z8Yyz"};var u=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};function c(e){var{left:t,right:n}=e,o=u(e,["left","right"]);return r().createElement("section",Object.assign({},o,{className:a()(s.leftRight,o.className)}),r().createElement("div",null,t),r().createElement("div",null,n))}c.__bit_component={id:"teambit.design/ui/layouts/sections/left-right@1.96.2",homepage:"https://bit.dev/teambit/design/ui/layouts/sections/left-right",exported:!0}},3153:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Ellipsis=void 0;const r=o(n(1594)),i=o(n(8443)),a=o(n(1678));function s(e){return r.default.createElement("div",Object.assign({},e,{className:(0,i.default)(e.className,a.default.ellipsisDiv)}))}s.__bit_component={id:"teambit.design/ui/styles/ellipsis@0.0.347",homepage:"https://bit.dev/teambit/design/ui/styles/ellipsis",exported:!0},t.Ellipsis=s},396:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Ellipsis=t.ellipsis=void 0;const r=o(n(1678));t.ellipsis=r.default.ellipsis;var i=n(3153);Object.defineProperty(t,"Ellipsis",{enumerable:!0,get:function(){return i.Ellipsis}})},1073:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseComponentCard=void 0;const r=o(n(1594)),i=n(8148),a=n(7690),s=n(2672),u=n(8408);function c({id:e="",className:t,preview:n,version:o,description:c,isDeprecated:l,isVerified:d,children:p,contentClass:f}){return r.default.createElement(u.Card,{className:t},r.default.createElement(a.DeprecationSticker,{isDeprecated:l}),r.default.createElement(i.PreviewContainer,{preview:n}),r.default.createElement(s.ComponentDetails,{id:e,version:o,description:c,isVerified:d,className:f}),p)}c.__bit_component={id:"teambit.explorer/ui/gallery/base-component-card@0.0.492",homepage:"https://bit.dev/teambit/explorer/ui/gallery/base-component-card",exported:!0},t.BaseComponentCard=c},5756:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Card=void 0;const r=o(n(1594)),i=o(n(8443)),a=o(n(2385));function s({children:e,className:t}){return r.default.createElement("div",{className:(0,i.default)(a.default.componentCard,t)},e)}s.__bit_component={id:"teambit.explorer/ui/gallery/base-component-card@0.0.492",homepage:"https://bit.dev/teambit/explorer/ui/gallery/base-component-card",exported:!0},t.Card=s},8408:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Card=void 0;var o=n(5756);Object.defineProperty(t,"Card",{enumerable:!0,get:function(){return o.Card}})},3738:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DeprecationSticker=void 0;const r=o(n(1594)),i=o(n(8443)),a=o(n(3067));function s({isDeprecated:e}){return r.default.createElement("div",{className:(0,i.default)(a.default.deprecated,{[a.default.show]:e})},"deprecated")}s.__bit_component={id:"teambit.explorer/ui/gallery/base-component-card@0.0.492",homepage:"https://bit.dev/teambit/explorer/ui/gallery/base-component-card",exported:!0},t.DeprecationSticker=s},7690:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeprecationSticker=void 0;var o=n(3738);Object.defineProperty(t,"DeprecationSticker",{enumerable:!0,get:function(){return o.DeprecationSticker}})},5937:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentDetails=void 0;const i=r(n(1594)),a=r(n(8443)),s=n(6579),u=n(396),c=r(n(687));function l(e){var{id:t,version:n,description:r,isVerified:l,className:d}=e,p=o(e,["id","version","description","isVerified","className"]);const f=t.split("/"),m=f.length>1&&f.slice(0,-1).join(" / "),b=f.slice(-1);return i.default.createElement("div",Object.assign({},p,{className:(0,a.default)(c.default.content,d)}),i.default.createElement("div",null,i.default.createElement("div",{className:c.default.nameSpace},m),i.default.createElement("div",{className:c.default.name},i.default.createElement("span",null,b),i.default.createElement("div",{className:c.default.versionHolder},n&&i.default.createElement(u.Ellipsis,null,"v",n),l&&i.default.createElement("img",{src:"https://static.bit.dev/extensions-icons/verified-field-badge.svg",className:c.default.img}))),i.default.createElement("div",{className:c.default.description},(0,s.ellipsis)(r||"",50))))}l.__bit_component={id:"teambit.explorer/ui/gallery/base-component-card@0.0.492",homepage:"https://bit.dev/teambit/explorer/ui/gallery/base-component-card",exported:!0},t.ComponentDetails=l},2672:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentDetails=void 0;var o=n(5937);Object.defineProperty(t,"ComponentDetails",{enumerable:!0,get:function(){return o.ComponentDetails}})},2481:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PreviewContainer=t.ComponentDetails=t.DeprecationSticker=t.Card=t.BaseComponentCard=void 0;var o=n(1073);Object.defineProperty(t,"BaseComponentCard",{enumerable:!0,get:function(){return o.BaseComponentCard}});var r=n(8408);Object.defineProperty(t,"Card",{enumerable:!0,get:function(){return r.Card}});var i=n(7690);Object.defineProperty(t,"DeprecationSticker",{enumerable:!0,get:function(){return i.DeprecationSticker}});var a=n(2672);Object.defineProperty(t,"ComponentDetails",{enumerable:!0,get:function(){return a.ComponentDetails}});var s=n(8148);Object.defineProperty(t,"PreviewContainer",{enumerable:!0,get:function(){return s.PreviewContainer}})},8148:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PreviewContainer=void 0;var o=n(4674);Object.defineProperty(t,"PreviewContainer",{enumerable:!0,get:function(){return o.PreviewContainer}})},4674:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PreviewContainer=void 0;const i=r(n(1594)),a=r(n(8443)),s=r(n(1747));function u(e){var{preview:t,className:n}=e,r=o(e,["preview","className"]);return i.default.createElement("div",Object.assign({},r,{className:(0,a.default)(s.default.previewContainer,n)}),i.default.createElement("div",{className:(0,a.default)(s.default.preview,{[s.default.emptyPreview]:!t})},t))}u.__bit_component={id:"teambit.explorer/ui/gallery/base-component-card@0.0.492",homepage:"https://bit.dev/teambit/explorer/ui/gallery/base-component-card",exported:!0},t.PreviewContainer=u},9587:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentCardGroup=void 0;const i=r(n(1594)),a=n(9462),s=n(1962),u=n(2546);function c(e){var{title:t,components:n}=e,r=o(e,["title","components"]);return i.default.createElement("div",Object.assign({},r),t&&i.default.createElement(a.H2,null,t),i.default.createElement(s.ComponentGrid,null,n.map((e=>i.default.createElement(u.ComponentCard,Object.assign({key:e.id},e))))))}c.__bit_component={id:"teambit.explorer/ui/gallery/component-card-group@1.96.1",homepage:"https://bit.dev/teambit/explorer/ui/gallery/component-card-group",exported:!0},t.ComponentCardGroup=c},3929:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentCardGroup=void 0;var o=n(9587);Object.defineProperty(t,"ComponentCardGroup",{enumerable:!0,get:function(){return o.ComponentCardGroup}})},648:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentCard=void 0;const r=o(n(1594)),i=n(9249),a=n(2481),s=o(n(2317));function u({id:e="",className:t,preview:n,version:o,description:u,envIcon:c,isDeprecated:l=!1,href:d,external:p}){return r.default.createElement(a.Card,{className:t},r.default.createElement(i.Link,{className:s.default.componentCardLink,href:d||e,external:p},r.default.createElement(a.DeprecationSticker,{isDeprecated:l}),r.default.createElement(a.PreviewContainer,{preview:n}),r.default.createElement(a.ComponentDetails,{id:e,version:o,description:u,className:s.default.content}),r.default.createElement("div",{className:s.default.bottom},r.default.createElement("div",{className:s.default.left}),r.default.createElement("img",{src:c,className:s.default.img}))))}u.__bit_component={id:"teambit.explorer/ui/gallery/component-card@0.0.495",homepage:"https://bit.dev/teambit/explorer/ui/gallery/component-card",exported:!0},t.ComponentCard=u},2546:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(648),t)},8318:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentGrid=void 0;const i=r(n(1594)),a=r(n(8443)),s=r(n(7839));function u(e){var{children:t,className:n}=e,r=o(e,["children","className"]);return i.default.createElement("div",Object.assign({className:(0,a.default)(s.default.componentGrid,n)},r),t)}u.__bit_component={id:"teambit.explorer/ui/gallery/component-grid@0.0.486",homepage:"https://bit.dev/teambit/explorer/ui/gallery/component-grid",exported:!0},t.ComponentGrid=u},1962:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(8318),t)},7616:(e,t)=>{"use strict";function n(e,t){return e.length>t?`${e.substring(0,t)}...`:e}Object.defineProperty(t,"__esModule",{value:!0}),t.ellipsis=void 0,n.__bit_component={id:"teambit.toolbox/string/ellipsis@0.0.173",homepage:"https://bit.dev/teambit/toolbox/string/ellipsis",exported:!0},t.ellipsis=n},6579:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ellipsis=void 0;var o=n(7616);Object.defineProperty(t,"ellipsis",{enumerable:!0,get:function(){return o.ellipsis}})},90:(e,t,n)=>{"use strict";var o={id:"teambit.harmony/bit@1.9.12",homepage:"https://bit.cloud/teambit/harmony/bit",exported:!0};function r(){const e=a(n(1594));return r=function(){return e},e}function i(){const e=n(7266);return i=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.BitLogo=void 0,r.__bit_component=o,i.__bit_component=o,a.__bit_component=o;const s=()=>r().default.createElement("div",{style:{width:"50%",margin:"auto"}},r().default.createElement(i().Logo,{customSize:64}));s.__bit_component=o,t.BitLogo=s},334:(e,t,n)=>{"use strict";var o={id:"teambit.harmony/bit@1.9.12",homepage:"https://bit.cloud/teambit/harmony/bit",exported:!0};function r(){const e=a(n(1594));return r=function(){return e},e}function i(){const e=n(5890);return i=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}function s(){return r().default.createElement(i().WhatIsBit,null)}Object.defineProperty(t,"__esModule",{value:!0}),t.abstract=void 0,t.default=s,t.tags=void 0,r.__bit_component=o,i.__bit_component=o,a.__bit_component=o,t.tags=["components","software","composable","component-driven","collaboration","development","design","product","architecture","compounding"],t.abstract="Bit is an open source toolchain for component-driven software",s.__bit_component=o},4749:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={fullWidth:"image_fullWidth__sELLz"}},6169:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={centerColumn:"page-frame_centerColumn__XBa-t",wideColumn:"page-frame_wideColumn__NAkt5",textColumn:"page-frame_textColumn__UPfoU"}},4147:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={}},7358:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={bitCard:"what-is-bit_bitCard__15cjS",logo:"what-is-bit_logo__TA45T"}},488:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={xxs:"heading-sizes_xxs__SWEOY",xs:"heading-sizes_xs__Hy8ol",sm:"heading-sizes_sm__tI7SK",md:"heading-sizes_md__joonV",lg:"heading-sizes_lg__Ltd1S",xl:"heading-sizes_xl__HDfIw",xxl:"heading-sizes_xxl__cFNob"}},8669:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={h1:"heading_h1__nOnz4",h2:"heading_h2__uEyK2",h3:"heading_h3__HdM7Z",h4:"heading_h4__v8USx",h5:"heading_h5__6jcVl",h6:"heading_h6__k7dDb"}},4854:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={h1:"margins_h1__e8-sd"}},1678:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={ellipsis:"ellipsis_ellipsis__C8hJ8",ellipsisDiv:"ellipsis_ellipsisDiv__9Db5W"}},2385:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={componentCard:"card_componentCard__Ak9CZ"}},3067:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={deprecated:"deprecation-sticker_deprecated__mKzkW",show:"deprecation-sticker_show__3kEmz"}},687:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={content:"details_content__ifC+P",nameSpace:"details_nameSpace__5bRzq",name:"details_name__znUu1",versionHolder:"details_versionHolder__9dygA",img:"details_img__MjuDx",description:"details_description__PPRv6"}},1747:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={previewContainer:"preview-container_previewContainer__hrQXX",preview:"preview-container_preview__zRjHm",emptyPreview:"preview-container_emptyPreview__YnS1o"}},2317:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={componentCardLink:"component-card_componentCardLink__Q4l2Z",bottom:"component-card_bottom__kipWC",size:"component-card_size__zZUte",dot:"component-card_dot__FksAd",img:"component-card_img__l5R9+"}},7839:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={componentGrid:"component-grid_componentGrid__pGx6B"}},314:e=>{"use strict";e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzU0IiBoZWlnaHQ9IjM1NCIgdmlld0JveD0iMCAwIDM1NCAzNTQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xNzcgMzQ4QzI3MS40NDEgMzQ4IDM0OC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016:e=>{"use strict";e.exports=MdxJsReact},1594:e=>{"use strict";e.exports=React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}n.m=e,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.b=document.baseURI||self.location.href;var o={};return(()=>{"use strict";n.r(o),n.d(o,{compositions:()=>r,compositions_metadata:()=>a,overview:()=>i});var e=n(90),t=n(334);const r=[e],i=[t],a={compositions:[{displayName:"Bit logo",identifier:"BitLogo"}]}})(),o})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.harmony/bit-preview"]=t():e["teambit.harmony/bit-preview"]=t()}(self,(()=>(()=>{var e={8443:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)&&n.length){var a=r.apply(null,n);a&&e.push(a)}else if("object"===i)for(var s in n)o.call(n,s)&&n[s]&&e.push(s)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},9685:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=r.apply(null,n);a&&e.push(a)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4949:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function r(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var o,i,a=[];for(i in"string"!=typeof t&&(t="?"),e)if(n.call(e,i)){if((o=e[i])||null!=o&&!isNaN(o)||(o=""),i=r(i),o=r(o),null===i||null===o)continue;a.push(i+"="+o)}return a.length?t+a.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,r={};t=n.exec(e);){var i=o(t[1]),a=o(t[2]);null===i||null===a||i in r||(r[i]=a)}return r}},1788:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},7114:(e,t,n)=>{"use strict";var o=n(1788),r=n(4949),i=/^[A-Za-z][A-Za-z0-9+-.]*:[\\/]+/,a=/^([a-z][a-z0-9.+-]*:)?([\\/]{1,})?([\S\s]*)/i,s=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function u(e){return(e||"").toString().replace(s,"")}var c=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};function d(e){var t,o=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},r={},a=typeof(e=e||o);if("blob:"===e.protocol)r=new f(unescape(e.pathname),{});else if("string"===a)for(t in r=new f(e,{}),l)delete r[t];else if("object"===a){for(t in e)t in l||(r[t]=e[t]);void 0===r.slashes&&(r.slashes=i.test(e.href))}return r}function p(e){e=u(e);var t=a.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!(t[2]&&t[2].length>=2),rest:t[2]&&1===t[2].length?"/"+t[3]:t[3]}}function f(e,t,n){if(e=u(e),!(this instanceof f))return new f(e,t,n);var i,a,s,l,m,b,_=c.slice(),h=typeof t,y=this,v=0;for("object"!==h&&"string"!==h&&(n=t,t=null),n&&"function"!=typeof n&&(n=r.parse),t=d(t),i=!(a=p(e||"")).protocol&&!a.slashes,y.slashes=a.slashes||i&&t.slashes,y.protocol=a.protocol||t.protocol||"",e=a.rest,a.slashes||(_[3]=[/(.*)/,"pathname"]);v<_.length;v++)"function"!=typeof(l=_[v])?(s=l[0],b=l[1],s!=s?y[b]=e:"string"==typeof s?~(m=e.indexOf(s))&&("number"==typeof l[2]?(y[b]=e.slice(0,m),e=e.slice(m+l[2])):(y[b]=e.slice(m),e=e.slice(0,m))):(m=s.exec(e))&&(y[b]=m[1],e=e.slice(0,m.index)),y[b]=y[b]||i&&l[3]&&t[b]||"",l[4]&&(y[b]=y[b].toLowerCase())):e=l(e);n&&(y.query=n(y.query)),i&&t.slashes&&"/"!==y.pathname.charAt(0)&&(""!==y.pathname||""!==t.pathname)&&(y.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=n.length,r=n[o-1],i=!1,a=0;o--;)"."===n[o]?n.splice(o,1):".."===n[o]?(n.splice(o,1),a++):a&&(0===o&&(i=!0),n.splice(o,1),a--);return i&&n.unshift(""),"."!==r&&".."!==r||n.push(""),n.join("/")}(y.pathname,t.pathname)),"/"!==y.pathname.charAt(0)&&y.hostname&&(y.pathname="/"+y.pathname),o(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(l=y.auth.split(":"),y.username=l[0]||"",y.password=l[1]||""),y.origin=y.protocol&&y.host&&"file:"!==y.protocol?y.protocol+"//"+y.host:"null",y.href=y.toString()}f.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||r.parse)(t)),i[e]=t;break;case"port":i[e]=t,o(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,/:\d+$/.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var a="pathname"===e?"/":"#";i[e]=t.charAt(0)!==a?a+t:t}else i[e]=t;break;default:i[e]=t}for(var s=0;s<c.length;s++){var u=c[s];u[4]&&(i[u[1]]=i[u[1]].toLowerCase())}return i.origin=i.protocol&&i.host&&"file:"!==i.protocol?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=r.stringify);var t,n=this,o=n.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var i=o+(n.slashes?"//":"");return n.username&&(i+=n.username,n.password&&(i+=":"+n.password),i+="@"),i+=n.host+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},f.extractProtocol=p,f.location=d,f.trimLeft=u,f.qs=r,e.exports=f},8888:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseImage=void 0;const i=r(n(1594)),a=r(n(8443)),s=r(n(4749));function u(e){var{alt:t,className:n,fullWidth:r}=e,u=o(e,["alt","className","fullWidth"]);return i.default.createElement("img",Object.assign({"data-bit-id":"teambit.base-ui/elements/image",alt:t},u,{className:a.default(s.default.image,r&&s.default.fullWidth,n)}))}u.__bit_component={id:"teambit.base-ui/elements/image@1.0.0",homepage:"https://bit.dev/teambit/base-ui/elements/image",exported:!0},t.BaseImage=u},4437:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(8888),t)},4181:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CenterColumn=void 0;const i=r(n(1594)),a=r(n(8443)),s=r(n(6169));function u(e){var{children:t,className:n}=e,r=o(e,["children","className"]);return i.default.createElement("div",Object.assign({className:(0,a.default)(s.default.centerColumn,n)},r),t)}u.__bit_component={id:"teambit.base-ui/layout/page-frame@1.0.2",homepage:"https://bit.dev/teambit/base-ui/layout/page-frame",exported:!0},t.CenterColumn=u},9743:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CenterColumn=t.WideColumn=t.textColumn=t.wideColumn=t.centerColumn=void 0;const r=o(n(6169));t.centerColumn=r.default.centerColumn,t.wideColumn=r.default.wideColumn,t.textColumn=r.default.textColumn;var i=n(1263);Object.defineProperty(t,"WideColumn",{enumerable:!0,get:function(){return i.WideColumn}});var a=n(4181);Object.defineProperty(t,"CenterColumn",{enumerable:!0,get:function(){return a.CenterColumn}})},1263:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WideColumn=void 0;const i=r(n(1594)),a=r(n(8443)),s=r(n(6169));function u(e){var{children:t,className:n}=e,r=o(e,["children","className"]);return i.default.createElement("div",Object.assign({className:(0,a.default)(s.default.wideColumn,n)},r),t)}u.__bit_component={id:"teambit.base-ui/layout/page-frame@1.0.2",homepage:"https://bit.dev/teambit/base-ui/layout/page-frame",exported:!0},t.WideColumn=u},7146:function(e,t,n){"use strict";var o={id:"teambit.base-ui/routing/compare-url@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/compare-url",exported:!0},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.compareUrl=void 0;const i=r(n(7114));function a(e,t,{exact:n,strict:o}={}){if(e===t)return!0;o||(e=e.replace(/\/(?=[?#]|$)/,""),t=t.replace(/\/(?=[?#]|$)/,""));const r=i.default(e),a=i.default(t),l=s(r,a),d=!n||u(r,a),p=!o||c(r,a);return l&&d&&p}function s(e,t){return(!t.protocol||t.protocol===e.protocol)&&(!t.hostname||t.hostname===e.hostname)&&(!t.port||t.port===e.port)&&(!t.pathname||e.pathname.startsWith(t.pathname))&&(!t.query||l(t.query,e.query))&&(!t.hash||t.hash===e.hash)&&(!t.password||t.password===e.password)&&(!t.username||t.username===e.username)}function u(e,t){return(!t.pathname||e.pathname===t.pathname)&&(!t.query||l(e.query,t.query))}function c(e,t){return!t.pathname||e.pathname.endsWith("/")===t.pathname.endsWith("/")}function l(e,t){return Object.keys(e).every((n=>e[n]===t[n]))}a.__bit_component=o,t.compareUrl=a,s.__bit_component=o,u.__bit_component=o,c.__bit_component=o,l.__bit_component=o},5749:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareUrl=void 0;var o=n(7146);Object.defineProperty(t,"compareUrl",{enumerable:!0,get:function(){return o.compareUrl}})},9249:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Link=void 0;var o=n(9725);Object.defineProperty(t,"Link",{enumerable:!0,get:function(){return o.Link}})},9725:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Link=void 0;const r=o(n(1594)),i=n(1089);function a(e){const t=i.useRouting().Link;return r.default.createElement(t,Object.assign({},e))}a.__bit_component={id:"teambit.base-ui/routing/link@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/link",exported:!0},t.Link=a},7509:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NativeLink=void 0;var o=n(6627);Object.defineProperty(t,"NativeLink",{enumerable:!0,get:function(){return o.NativeLink}})},6627:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.NativeLink=void 0;const s=i(n(1594)),u={rel:"noopener",target:"_blank"};function c(e){var{href:t="",external:n,replace:o,onClick:r}=e,i=a(e,["href","external","replace","onClick"]);const c=n?u:{},l=s.useCallback((e=>{const i=null==r?void 0:r(e);return e.defaultPrevented||!o||n||(e.preventDefault(),window.location.replace(t)),i}),[t,o,r]);return s.default.createElement("a",Object.assign({},i,c,{onClick:l,href:t}))}c.__bit_component={id:"teambit.base-ui/routing/native-link@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/native-link",exported:!0},t.NativeLink=c},9581:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NativeNavLink=void 0;var o=n(1123);Object.defineProperty(t,"NativeNavLink",{enumerable:!0,get:function(){return o.NativeNavLink}})},1123:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NativeNavLink=void 0;const u=i(n(1594)),c=s(n(8443)),l=n(7509),d=n(5749),p=n(201);function f(e){var{activeClassName:t,activeStyle:n,isActive:o,exact:r,strict:i,style:s,className:f}=e,m=a(e,["activeClassName","activeStyle","isActive","exact","strict","style","className"]);const b=p.isBrowser?window.location.href:"/",_=u.useMemo((()=>m.href&&d.compareUrl(b,m.href)),[r,i,b,m.href]),h=(null==o?void 0:o())||_,y=u.useMemo((()=>h&&n?Object.assign(Object.assign({},s),n):s),[h,s]);return u.default.createElement(l.NativeLink,Object.assign({},m,{style:y,className:c.default(f,h&&t)}))}f.__bit_component={id:"teambit.base-ui/routing/native-nav-link@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/native-nav-link",exported:!0},t.NativeNavLink=f},1089:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useLocation=t.useRouting=t.RoutingProvider=void 0;var o=n(9133);Object.defineProperty(t,"RoutingProvider",{enumerable:!0,get:function(){return o.RoutingProvider}}),Object.defineProperty(t,"useRouting",{enumerable:!0,get:function(){return o.useRouting}}),Object.defineProperty(t,"useLocation",{enumerable:!0,get:function(){return o.useLocation}})},9133:function(e,t,n){"use strict";var o={id:"teambit.base-ui/routing/routing-provider@1.0.0",homepage:"https://bit.dev/teambit/base-ui/routing/routing-provider",exported:!0},r=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useLocation=t.useRouting=t.RoutingProvider=void 0;const s=a(n(1594)),u=n(7509),c=n(9581),l=n(201),d={pathname:"/",search:"",hash:""},p={Link:u.NativeLink,NavLink:c.NativeNavLink,useLocation:()=>l.isBrowser?window.location:d},f=s.createContext(p);function m({value:e,children:t}){return s.default.createElement(f.Provider,{value:e},t)}function b(){return s.useContext(f)}function _(){return b().useLocation()}m.__bit_component=o,t.RoutingProvider=m,b.__bit_component=o,t.useRouting=b,_.__bit_component=o,t.useLocation=_},2345:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Heading=void 0;const i=r(n(1594));function a(e){var{element:t="h1"}=e,n=o(e,["element"]);const r=t;return i.default.createElement(r,Object.assign({"data-bit-id":"teambit.base-ui/text/heading"},n))}a.__bit_component={id:"teambit.base-ui/text/heading@1.0.4",homepage:"https://bit.dev/teambit/base-ui/text/heading",exported:!0},t.Heading=a},7979:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Heading=void 0;var o=n(2345);Object.defineProperty(t,"Heading",{enumerable:!0,get:function(){return o.Heading}})},201:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=void 0;var o=n(5288);Object.defineProperty(t,"isBrowser",{enumerable:!0,get:function(){return o.isBrowser}})},5288:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=void 0,t.isBrowser="undefined"!=typeof window},3467:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.bitComponent=void 0;const r=o(n(1594)),i=n(7266),a=o(n(7358));t.bitComponent=[{id:"teambit.bit/bit",href:"https://bit.cloud/teambit/harmony/bit",description:"Bit is an open-source component for composing component driven software",envIcon:"https://static.bit.dev/extensions-icons/default.svg",preview:r.default.createElement("div",{className:a.default.logo},r.default.createElement(i.Logo,{customSize:64}))}]},5890:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WhatIsBitQuickStart=t.Size=t.WhatIsBit=t.default=t.WhatIsBitLong=void 0;var r=n(9960);Object.defineProperty(t,"WhatIsBitLong",{enumerable:!0,get:function(){return o(r).default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o(r).default}});var i=n(2337);Object.defineProperty(t,"WhatIsBit",{enumerable:!0,get:function(){return i.WhatIsBit}}),Object.defineProperty(t,"Size",{enumerable:!0,get:function(){return i.Size}});var a=n(6478);Object.defineProperty(t,"WhatIsBitQuickStart",{enumerable:!0,get:function(){return a.WhatIsBitQuickStart}})},9305:(e,t,n)=>{"use strict";var o={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=p,a(n(1594));var r=n(5016),i=["components"];function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}function u(e,t){if(null==e)return{};var n,o,r=c(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}a.__bit_component=o,s.__bit_component=o,u.__bit_component=o,c.__bit_component=o;var l={},d="wrapper";function p(e){var t=e.components,n=u(e,i);return(0,r.mdx)(d,s({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"Bit does not prescribe how to build your entire application. It helps you define and compose components and allows for every component to adopt the dev tools that best fit its nature.\nA React component is likely to be compiled, tested and perhaps even deployed using a composition of tools different than the one a backend-service component, or a generic function, may use.\nBit comes with native support in various dev tools like TypeScript, Babel, Jest, Webpack, ESLint, and ready made development environments for React, NodeJS, Angular and more. New tools can be easily integrated by adding one more component into Bit!"))}p.__bit_component=o,p.isMDXComponent=!0},2087:(e,t,n)=>{"use strict";var o={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=p,a(n(1594));var r=n(5016),i=["components"];function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}function u(e,t){if(null==e)return{};var n,o,r=c(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}a.__bit_component=o,s.__bit_component=o,u.__bit_component=o,c.__bit_component=o;var l={},d="wrapper";function p(e){var t=e.components,n=u(e,i);return(0,r.mdx)(d,s({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"Bit does not prescribe how to build your entire application. It helps you define and compose components and allows for every component to adopt the dev tools that best fit its nature.\nA React component is likely to be compiled, tested and perhaps even deployed using a composition of tools different than the one a backend-service component, or a generic function, may use.\nBit comes with native support in various dev tools like TypeScript, Babel, Jest, Webpack, ESLint, and ready made development environments for React, NodeJS, Angular and more. New tools can be easily integrated by adding one more component into Bit!"))}p.__bit_component=o,p.isMDXComponent=!0},4321:(e,t,n)=>{"use strict";var o={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=p,a(n(1594));var r=n(5016),i=["components"];function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}function u(e,t){if(null==e)return{};var n,o,r=c(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}a.__bit_component=o,s.__bit_component=o,u.__bit_component=o,c.__bit_component=o;var l={},d="wrapper";function p(e){var t=e.components,n=u(e,i);return(0,r.mdx)(d,s({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("h3",null,"What is Bit?"),(0,r.mdx)("p",null,"Bit is an open-source tool for composing component-driven software."))}p.__bit_component=o,p.isMDXComponent=!0},6478:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WhatIsBitQuickStart=void 0;const r=o(n(1594)),i=n(3824),a=n(9743),s=n(3929),u=o(n(2087)),c=o(n(9305)),l=o(n(4321)),d=n(3467),p=o(n(4147)),f=()=>r.default.createElement(a.WideColumn,null,r.default.createElement(l.default,null),r.default.createElement(i.LeftRight,{className:p.default.leftRight,left:r.default.createElement(u.default,null),right:r.default.createElement(s.ComponentCardGroup,{components:d.bitComponent})}),r.default.createElement(c.default,null));f.__bit_component={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0},t.WhatIsBitQuickStart=f},7643:(e,t,n)=>{"use strict";var o={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=_,l(n(1594));var r=n(5016),i=n(3929),a=l(n(634)),s=n(3467),u=l(n(7358)),c=["components"];function l(e){return e&&e.__esModule?e:{default:e}}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d.apply(this,arguments)}function p(e,t){if(null==e)return{};var n,o,r=f(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function f(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}l.__bit_component=o,d.__bit_component=o,p.__bit_component=o,f.__bit_component=o;var m={},b="wrapper";function _(e){var t=e.components,n=p(e,c);return(0,r.mdx)(b,d({},m,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"Bit is an open-source tool for composing component-driven software."),(0,r.mdx)(i.ComponentCardGroup,{components:s.bitComponent,className:u.default.bitCard,mdxType:"ComponentCardGroup"}),(0,r.mdx)("br",null),(0,r.mdx)(a.default,{components:s.bitComponent,mdxType:"WhatIsBitSmall"}),(0,r.mdx)("p",null,"Bit does not prescribe how to build your entire application. It helps you define and compose components and allows for every component to adopt the dev tools that best fit its nature.\nA React component is likely to be compiled, tested and perhaps even deployed using a composition of tools different than the one a backend-service component, or a generic function, may use.\nBit offers native support for various dev tools like ",(0,r.mdx)("a",{parentName:"p",href:"/tools/typescript"},"TypeScript"),", ",(0,r.mdx)("a",{parentName:"p",href:"/tools/babel"},"Babel"),", ",(0,r.mdx)("a",{parentName:"p",href:"/tools/jest"},"Jest"),", ",(0,r.mdx)("a",{parentName:"p",href:"/tools/webpack"},"Webpack"),", ",(0,r.mdx)("a",{parentName:"p",href:"/tools/eslint"},"ESLint")," and\nready made development environments for ",(0,r.mdx)("a",{parentName:"p",href:"/frameworks/react"},"React"),", ",(0,r.mdx)("a",{parentName:"p",href:"/frameworks/node"},"NodeJS"),", ",(0,r.mdx)("a",{parentName:"p",href:"/envs/angular"},"Angular")," and more. New tools can be easily integrated by\nextending Bit with one more component."))}_.__bit_component=o,_.isMDXComponent=!0},634:(e,t,n)=>{"use strict";var o={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=p,a(n(1594));var r=n(5016),i=["components"];function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}function u(e,t){if(null==e)return{};var n,o,r=c(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}a.__bit_component=o,s.__bit_component=o,u.__bit_component=o,c.__bit_component=o;var l={},d="wrapper";function p(e){var t=e.components,n=u(e,i);return(0,r.mdx)(d,s({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"Bit stands at the intersection between product and engineering. ",(0,r.mdx)("strong",{parentName:"p"},"It helps you take complex product requirements, and break them down into independent,\nand reusable pieces called")," ",(0,r.mdx)("strong",{parentName:"p"},(0,r.mdx)("em",{parentName:"strong"},'"components"')),". It allows you to create components and compose them with each other. Components are described by names and APIs, and contain source code implementation.\nThey can be of different kinds like apps, pages, UI components, backend services and even content. You can ",(0,r.mdx)("a",{parentName:"p",href:"/thinking-in-components"},"think of almost anything in components"),"."),(0,r.mdx)("p",null,'It is common to think of components that function as full applications, as "large", whereas components that function as simple elements, like a \'button\', as "small".\nFor us, both types of components are "the same size", but each has a different responsibility. An app is a very concrete component. It has many dependencies and just a few (if any) dependents.\nA button, on the other hand, is very abstract. It has just a few dependencies and many dependents. Having this sort of dependents-to-dependencies ratio indicates that a component is highly-reusable.'))}p.__bit_component=o,p.isMDXComponent=!0},2337:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WhatIsBit=t.Size=void 0;const r=o(n(1594)),i=o(n(9960)),a=o(n(7643)),s=o(n(634));var u;function c({size:e}){return e===u.SMALL?r.default.createElement(s.default,null):e===u.MEDIUM?r.default.createElement(a.default,null):r.default.createElement(i.default,null)}!function(e){e[e.SMALL=0]="SMALL",e[e.MEDIUM=1]="MEDIUM",e[e.LARGE=2]="LARGE"}(u=t.Size||(t.Size={})),c.__bit_component={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0},t.WhatIsBit=c},9960:(e,t,n)=>{"use strict";var o={id:"teambit.bit/content/what-is-bit@1.96.2",homepage:"https://bit.dev/teambit/bit/content/what-is-bit",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=f,s(n(1594));var r=n(5016),i=s(n(7643)),a=["components"];function s(e){return e&&e.__esModule?e:{default:e}}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},u.apply(this,arguments)}function c(e,t){if(null==e)return{};var n,o,r=l(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function l(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}s.__bit_component=o,u.__bit_component=o,c.__bit_component=o,l.__bit_component=o;var d={},p="wrapper";function f(e){var t=e.components,n=c(e,a);return(0,r.mdx)(p,u({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("h3",null,"What is Bit?"),(0,r.mdx)(i.default,{mdxType:"WhatIsBitShort"}),(0,r.mdx)("h3",null,"What can you do with Bit?"),(0,r.mdx)("p",null,"Anything is possible with Bit! We built ",(0,r.mdx)("a",{parentName:"p",href:"https://bit.dev"},"Bit")," and ",(0,r.mdx)("a",{parentName:"p",href:"https://bit.cloud"},"bit.cloud")," entirely using Bit. These are complex systems which includes infrastructure\ntools, cloud products and multiple user interfaces."),(0,r.mdx)("p",null,"People use Bit to create all kind of applications, from user interfaces with component-driven frameworks like React, Vue and Angular, to complex\nmicro-service architectures, serverless functions, CLI utilities, desktop applications, native mobile applications and even IoT. You can do with Bit about anything you can do with JS\nand even beyond."),(0,r.mdx)("h3",null,"What Bit supports?"),(0,r.mdx)("p",null,"Bit was built with TypeScript and supports it natively. It was designed to be language-agnostic, and will support other software languages in the future! For now, our development environments use TypeScript as the default compiler for JS and TS components. You can easily switch to Babel or any other compiler. Bit is completely agnostic to your tech stack."))}f.__bit_component=o,f.isMDXComponent=!0},7266:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Logo:()=>c,RecommendedSizes:()=>o});var o,r=n(1594),i=n.n(r),a=n(4437);!function(e){e[e.small=16]="small",e[e.medium=24]="medium",e[e.large=32]="large",e[e.xl=40]="xl"}(o||(o={}));const s=new URL(n(314),n.b).toString();var u=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};function c(e){var{size:t,customSize:n,alt:o}=e,r=u(e,["size","customSize","alt"]);const c=n||t;return i().createElement(a.BaseImage,Object.assign({},r,{src:s,alt:o||"",height:c,width:c}))}c.__bit_component={id:"teambit.design/ui/brand/logo@1.96.2",homepage:"https://bit.dev/teambit/design/ui/brand/logo",exported:!0},c.defaultProps={size:o.medium,alt:"Bit"}},7496:function(e,t,n){"use strict";var o={id:"teambit.design/ui/heading@1.0.16",homepage:"https://bit.dev/teambit/design/ui/heading",exported:!0},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.H6=t.H5=t.H4=t.H3=t.H2=t.H1=void 0;const i=r(n(1594)),a=r(n(8443)),s=n(7979),u=r(n(488)),c=r(n(8669)),l=r(n(4854));function d(e){return i.default.createElement(s.Heading,Object.assign({element:"h1"},e,{className:(0,a.default)(c.default.h1,l.default.h1,u.default[e.size||"lg"],e.className)}))}function p(e){return i.default.createElement(s.Heading,Object.assign({element:"h2"},e,{className:(0,a.default)(c.default.h2,u.default[e.size||"lg"],e.className)}))}function f(e){return i.default.createElement(s.Heading,Object.assign({element:"h3"},e,{className:(0,a.default)(c.default.h3,u.default[e.size||"md"],e.className)}))}function m(e){return i.default.createElement(s.Heading,Object.assign({element:"h4"},e,{className:(0,a.default)(c.default.h4,u.default[e.size||"sm"],e.className)}))}function b(e){return i.default.createElement(s.Heading,Object.assign({element:"h5"},e,{className:(0,a.default)(c.default.h5,u.default[e.size||"xs"],e.className)}))}function _(e){return i.default.createElement(s.Heading,Object.assign({element:"h6"},e,{className:(0,a.default)(c.default.h6,u.default[e.size||"xxs"],e.className)}))}d.__bit_component=o,t.H1=d,p.__bit_component=o,t.H2=p,f.__bit_component=o,t.H3=f,m.__bit_component=o,t.H4=m,b.__bit_component=o,t.H5=b,_.__bit_component=o,t.H6=_},9462:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(7496),t)},3824:(e,t,n)=>{"use strict";n.r(t),n.d(t,{LeftRight:()=>c});var o=n(1594),r=n.n(o),i=n(9685),a=n.n(i);const s={leftRight:"left-right_leftRight__Z8Yyz"};var u=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};function c(e){var{left:t,right:n}=e,o=u(e,["left","right"]);return r().createElement("section",Object.assign({},o,{className:a()(s.leftRight,o.className)}),r().createElement("div",null,t),r().createElement("div",null,n))}c.__bit_component={id:"teambit.design/ui/layouts/sections/left-right@1.96.2",homepage:"https://bit.dev/teambit/design/ui/layouts/sections/left-right",exported:!0}},3153:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Ellipsis=void 0;const r=o(n(1594)),i=o(n(8443)),a=o(n(1678));function s(e){return r.default.createElement("div",Object.assign({},e,{className:(0,i.default)(e.className,a.default.ellipsisDiv)}))}s.__bit_component={id:"teambit.design/ui/styles/ellipsis@0.0.347",homepage:"https://bit.dev/teambit/design/ui/styles/ellipsis",exported:!0},t.Ellipsis=s},396:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Ellipsis=t.ellipsis=void 0;const r=o(n(1678));t.ellipsis=r.default.ellipsis;var i=n(3153);Object.defineProperty(t,"Ellipsis",{enumerable:!0,get:function(){return i.Ellipsis}})},1073:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseComponentCard=void 0;const r=o(n(1594)),i=n(8148),a=n(7690),s=n(2672),u=n(8408);function c({id:e="",className:t,preview:n,version:o,description:c,isDeprecated:l,isVerified:d,children:p,contentClass:f}){return r.default.createElement(u.Card,{className:t},r.default.createElement(a.DeprecationSticker,{isDeprecated:l}),r.default.createElement(i.PreviewContainer,{preview:n}),r.default.createElement(s.ComponentDetails,{id:e,version:o,description:c,isVerified:d,className:f}),p)}c.__bit_component={id:"teambit.explorer/ui/gallery/base-component-card@0.0.492",homepage:"https://bit.dev/teambit/explorer/ui/gallery/base-component-card",exported:!0},t.BaseComponentCard=c},5756:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Card=void 0;const r=o(n(1594)),i=o(n(8443)),a=o(n(2385));function s({children:e,className:t}){return r.default.createElement("div",{className:(0,i.default)(a.default.componentCard,t)},e)}s.__bit_component={id:"teambit.explorer/ui/gallery/base-component-card@0.0.492",homepage:"https://bit.dev/teambit/explorer/ui/gallery/base-component-card",exported:!0},t.Card=s},8408:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Card=void 0;var o=n(5756);Object.defineProperty(t,"Card",{enumerable:!0,get:function(){return o.Card}})},3738:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DeprecationSticker=void 0;const r=o(n(1594)),i=o(n(8443)),a=o(n(3067));function s({isDeprecated:e}){return r.default.createElement("div",{className:(0,i.default)(a.default.deprecated,{[a.default.show]:e})},"deprecated")}s.__bit_component={id:"teambit.explorer/ui/gallery/base-component-card@0.0.492",homepage:"https://bit.dev/teambit/explorer/ui/gallery/base-component-card",exported:!0},t.DeprecationSticker=s},7690:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeprecationSticker=void 0;var o=n(3738);Object.defineProperty(t,"DeprecationSticker",{enumerable:!0,get:function(){return o.DeprecationSticker}})},5937:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentDetails=void 0;const i=r(n(1594)),a=r(n(8443)),s=n(6579),u=n(396),c=r(n(687));function l(e){var{id:t,version:n,description:r,isVerified:l,className:d}=e,p=o(e,["id","version","description","isVerified","className"]);const f=t.split("/"),m=f.length>1&&f.slice(0,-1).join(" / "),b=f.slice(-1);return i.default.createElement("div",Object.assign({},p,{className:(0,a.default)(c.default.content,d)}),i.default.createElement("div",null,i.default.createElement("div",{className:c.default.nameSpace},m),i.default.createElement("div",{className:c.default.name},i.default.createElement("span",null,b),i.default.createElement("div",{className:c.default.versionHolder},n&&i.default.createElement(u.Ellipsis,null,"v",n),l&&i.default.createElement("img",{src:"https://static.bit.dev/extensions-icons/verified-field-badge.svg",className:c.default.img}))),i.default.createElement("div",{className:c.default.description},(0,s.ellipsis)(r||"",50))))}l.__bit_component={id:"teambit.explorer/ui/gallery/base-component-card@0.0.492",homepage:"https://bit.dev/teambit/explorer/ui/gallery/base-component-card",exported:!0},t.ComponentDetails=l},2672:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentDetails=void 0;var o=n(5937);Object.defineProperty(t,"ComponentDetails",{enumerable:!0,get:function(){return o.ComponentDetails}})},2481:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PreviewContainer=t.ComponentDetails=t.DeprecationSticker=t.Card=t.BaseComponentCard=void 0;var o=n(1073);Object.defineProperty(t,"BaseComponentCard",{enumerable:!0,get:function(){return o.BaseComponentCard}});var r=n(8408);Object.defineProperty(t,"Card",{enumerable:!0,get:function(){return r.Card}});var i=n(7690);Object.defineProperty(t,"DeprecationSticker",{enumerable:!0,get:function(){return i.DeprecationSticker}});var a=n(2672);Object.defineProperty(t,"ComponentDetails",{enumerable:!0,get:function(){return a.ComponentDetails}});var s=n(8148);Object.defineProperty(t,"PreviewContainer",{enumerable:!0,get:function(){return s.PreviewContainer}})},8148:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PreviewContainer=void 0;var o=n(4674);Object.defineProperty(t,"PreviewContainer",{enumerable:!0,get:function(){return o.PreviewContainer}})},4674:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PreviewContainer=void 0;const i=r(n(1594)),a=r(n(8443)),s=r(n(1747));function u(e){var{preview:t,className:n}=e,r=o(e,["preview","className"]);return i.default.createElement("div",Object.assign({},r,{className:(0,a.default)(s.default.previewContainer,n)}),i.default.createElement("div",{className:(0,a.default)(s.default.preview,{[s.default.emptyPreview]:!t})},t))}u.__bit_component={id:"teambit.explorer/ui/gallery/base-component-card@0.0.492",homepage:"https://bit.dev/teambit/explorer/ui/gallery/base-component-card",exported:!0},t.PreviewContainer=u},9587:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentCardGroup=void 0;const i=r(n(1594)),a=n(9462),s=n(1962),u=n(2546);function c(e){var{title:t,components:n}=e,r=o(e,["title","components"]);return i.default.createElement("div",Object.assign({},r),t&&i.default.createElement(a.H2,null,t),i.default.createElement(s.ComponentGrid,null,n.map((e=>i.default.createElement(u.ComponentCard,Object.assign({key:e.id},e))))))}c.__bit_component={id:"teambit.explorer/ui/gallery/component-card-group@1.96.1",homepage:"https://bit.dev/teambit/explorer/ui/gallery/component-card-group",exported:!0},t.ComponentCardGroup=c},3929:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentCardGroup=void 0;var o=n(9587);Object.defineProperty(t,"ComponentCardGroup",{enumerable:!0,get:function(){return o.ComponentCardGroup}})},648:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentCard=void 0;const r=o(n(1594)),i=n(9249),a=n(2481),s=o(n(2317));function u({id:e="",className:t,preview:n,version:o,description:u,envIcon:c,isDeprecated:l=!1,href:d,external:p}){return r.default.createElement(a.Card,{className:t},r.default.createElement(i.Link,{className:s.default.componentCardLink,href:d||e,external:p},r.default.createElement(a.DeprecationSticker,{isDeprecated:l}),r.default.createElement(a.PreviewContainer,{preview:n}),r.default.createElement(a.ComponentDetails,{id:e,version:o,description:u,className:s.default.content}),r.default.createElement("div",{className:s.default.bottom},r.default.createElement("div",{className:s.default.left}),r.default.createElement("img",{src:c,className:s.default.img}))))}u.__bit_component={id:"teambit.explorer/ui/gallery/component-card@0.0.495",homepage:"https://bit.dev/teambit/explorer/ui/gallery/component-card",exported:!0},t.ComponentCard=u},2546:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(648),t)},8318:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentGrid=void 0;const i=r(n(1594)),a=r(n(8443)),s=r(n(7839));function u(e){var{children:t,className:n}=e,r=o(e,["children","className"]);return i.default.createElement("div",Object.assign({className:(0,a.default)(s.default.componentGrid,n)},r),t)}u.__bit_component={id:"teambit.explorer/ui/gallery/component-grid@0.0.486",homepage:"https://bit.dev/teambit/explorer/ui/gallery/component-grid",exported:!0},t.ComponentGrid=u},1962:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(8318),t)},7616:(e,t)=>{"use strict";function n(e,t){return e.length>t?`${e.substring(0,t)}...`:e}Object.defineProperty(t,"__esModule",{value:!0}),t.ellipsis=void 0,n.__bit_component={id:"teambit.toolbox/string/ellipsis@0.0.173",homepage:"https://bit.dev/teambit/toolbox/string/ellipsis",exported:!0},t.ellipsis=n},6579:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ellipsis=void 0;var o=n(7616);Object.defineProperty(t,"ellipsis",{enumerable:!0,get:function(){return o.ellipsis}})},7745:(e,t,n)=>{"use strict";var o={id:"teambit.harmony/bit@1.9.13",homepage:"https://bit.cloud/teambit/harmony/bit",exported:!0};function r(){const e=a(n(1594));return r=function(){return e},e}function i(){const e=n(7266);return i=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.BitLogo=void 0,r.__bit_component=o,i.__bit_component=o,a.__bit_component=o;const s=()=>r().default.createElement("div",{style:{width:"50%",margin:"auto"}},r().default.createElement(i().Logo,{customSize:64}));s.__bit_component=o,t.BitLogo=s},7005:(e,t,n)=>{"use strict";var o={id:"teambit.harmony/bit@1.9.13",homepage:"https://bit.cloud/teambit/harmony/bit",exported:!0};function r(){const e=a(n(1594));return r=function(){return e},e}function i(){const e=n(5890);return i=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}function s(){return r().default.createElement(i().WhatIsBit,null)}Object.defineProperty(t,"__esModule",{value:!0}),t.abstract=void 0,t.default=s,t.tags=void 0,r.__bit_component=o,i.__bit_component=o,a.__bit_component=o,t.tags=["components","software","composable","component-driven","collaboration","development","design","product","architecture","compounding"],t.abstract="Bit is an open source toolchain for component-driven software",s.__bit_component=o},4749:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={fullWidth:"image_fullWidth__sELLz"}},6169:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={centerColumn:"page-frame_centerColumn__XBa-t",wideColumn:"page-frame_wideColumn__NAkt5",textColumn:"page-frame_textColumn__UPfoU"}},4147:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={}},7358:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={bitCard:"what-is-bit_bitCard__15cjS",logo:"what-is-bit_logo__TA45T"}},488:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={xxs:"heading-sizes_xxs__SWEOY",xs:"heading-sizes_xs__Hy8ol",sm:"heading-sizes_sm__tI7SK",md:"heading-sizes_md__joonV",lg:"heading-sizes_lg__Ltd1S",xl:"heading-sizes_xl__HDfIw",xxl:"heading-sizes_xxl__cFNob"}},8669:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={h1:"heading_h1__nOnz4",h2:"heading_h2__uEyK2",h3:"heading_h3__HdM7Z",h4:"heading_h4__v8USx",h5:"heading_h5__6jcVl",h6:"heading_h6__k7dDb"}},4854:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={h1:"margins_h1__e8-sd"}},1678:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={ellipsis:"ellipsis_ellipsis__C8hJ8",ellipsisDiv:"ellipsis_ellipsisDiv__9Db5W"}},2385:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={componentCard:"card_componentCard__Ak9CZ"}},3067:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={deprecated:"deprecation-sticker_deprecated__mKzkW",show:"deprecation-sticker_show__3kEmz"}},687:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={content:"details_content__ifC+P",nameSpace:"details_nameSpace__5bRzq",name:"details_name__znUu1",versionHolder:"details_versionHolder__9dygA",img:"details_img__MjuDx",description:"details_description__PPRv6"}},1747:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={previewContainer:"preview-container_previewContainer__hrQXX",preview:"preview-container_preview__zRjHm",emptyPreview:"preview-container_emptyPreview__YnS1o"}},2317:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={componentCardLink:"component-card_componentCardLink__Q4l2Z",bottom:"component-card_bottom__kipWC",size:"component-card_size__zZUte",dot:"component-card_dot__FksAd",img:"component-card_img__l5R9+"}},7839:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={componentGrid:"component-grid_componentGrid__pGx6B"}},314:e=>{"use strict";e.exports="data:image/svg+xml;base64,PHN2ZyB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GllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjNzMzOThEIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzU5NEE5NSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPgo="},5016:e=>{"use strict";e.exports=MdxJsReact},1594:e=>{"use strict";e.exports=React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}n.m=e,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.b=document.baseURI||self.location.href;var o={};return(()=>{"use strict";n.r(o),n.d(o,{compositions:()=>r,compositions_metadata:()=>a,overview:()=>i});var e=n(7745),t=n(7005);const r=[e],i=[t],a={compositions:[{displayName:"Bit logo",identifier:"BitLogo"}]}})(),o})()));
|
package/artifacts/schema.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_bit@1.9.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_bit@1.9.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_bit@1.9.13/dist/bit.compositions.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_bit@1.9.13/dist/bit.docs.js';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -48,7 +48,7 @@ type CommandResult = {
|
|
|
48
48
|
export declare class ServerCommander {
|
|
49
49
|
execute(): Promise<void>;
|
|
50
50
|
private shouldUseTTYPath;
|
|
51
|
-
runCommandWithHttpServer(): Promise<CommandResult | undefined>;
|
|
51
|
+
runCommandWithHttpServer(): Promise<CommandResult | undefined | void>;
|
|
52
52
|
private connectToSocket;
|
|
53
53
|
/**
|
|
54
54
|
* Initialize the server-sent events (SSE) connection to the server.
|
|
@@ -62,10 +62,11 @@ export declare class ServerCommander {
|
|
|
62
62
|
* it didn't work well. It was printed only after the response came back from the server.
|
|
63
63
|
*/
|
|
64
64
|
private initSSE;
|
|
65
|
-
private
|
|
66
|
-
private
|
|
65
|
+
private printPortAndExit;
|
|
66
|
+
private deletePortAndExit;
|
|
67
|
+
private printSocketPortAndExit;
|
|
67
68
|
private getExistingUsedPort;
|
|
68
|
-
private
|
|
69
|
+
private isPortInUseForCurrentDir;
|
|
69
70
|
private getExistingPort;
|
|
70
71
|
private deleteServerPortFile;
|
|
71
72
|
private getServerPortFilePath;
|
package/dist/server-commander.js
CHANGED
|
@@ -40,6 +40,13 @@ function _path() {
|
|
|
40
40
|
};
|
|
41
41
|
return data;
|
|
42
42
|
}
|
|
43
|
+
function _os() {
|
|
44
|
+
const data = _interopRequireDefault(require("os"));
|
|
45
|
+
_os = function () {
|
|
46
|
+
return data;
|
|
47
|
+
};
|
|
48
|
+
return data;
|
|
49
|
+
}
|
|
43
50
|
function _eventsource() {
|
|
44
51
|
const data = _interopRequireDefault(require("eventsource"));
|
|
45
52
|
_eventsource = function () {
|
|
@@ -127,6 +134,9 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
127
134
|
* but then I wasn't able to return the prompt to the user easily. So, I decided to keep the http for the request/response part.
|
|
128
135
|
*/
|
|
129
136
|
|
|
137
|
+
const CMD_SERVER_PORT = 'cli-server-port';
|
|
138
|
+
const CMD_SERVER_PORT_DELETE = 'cli-server-port-delete';
|
|
139
|
+
const CMD_SERVER_SOCKET_PORT = 'cli-server-socket-port';
|
|
130
140
|
class ServerPortFileNotFound extends Error {
|
|
131
141
|
constructor(filePath) {
|
|
132
142
|
super(`server port file not found at ${filePath}`);
|
|
@@ -173,8 +183,9 @@ class ServerCommander {
|
|
|
173
183
|
return process.env.BIT_CLI_SERVER_TTY === 'true';
|
|
174
184
|
}
|
|
175
185
|
async runCommandWithHttpServer() {
|
|
176
|
-
|
|
177
|
-
this.
|
|
186
|
+
if (process.argv.includes(CMD_SERVER_PORT)) return this.printPortAndExit();
|
|
187
|
+
if (process.argv.includes(CMD_SERVER_SOCKET_PORT)) return this.printSocketPortAndExit();
|
|
188
|
+
if (process.argv.includes(CMD_SERVER_PORT_DELETE)) return this.deletePortAndExit();
|
|
178
189
|
(0, _bootstrap().printBitVersionIfAsked)();
|
|
179
190
|
const port = await this.getExistingUsedPort();
|
|
180
191
|
const url = `http://localhost:${port}/api`;
|
|
@@ -320,8 +331,7 @@ Please run the command "bit server-forever" first to start the server.`));
|
|
|
320
331
|
process.stdout.write(parsed.message);
|
|
321
332
|
});
|
|
322
333
|
}
|
|
323
|
-
async
|
|
324
|
-
if (!process.argv.includes('cli-server-port')) return;
|
|
334
|
+
async printPortAndExit() {
|
|
325
335
|
try {
|
|
326
336
|
const port = await this.getExistingUsedPort();
|
|
327
337
|
process.stdout.write(port.toString());
|
|
@@ -334,8 +344,16 @@ Please run the command "bit server-forever" first to start the server.`));
|
|
|
334
344
|
process.exit(1);
|
|
335
345
|
}
|
|
336
346
|
}
|
|
337
|
-
|
|
338
|
-
|
|
347
|
+
async deletePortAndExit() {
|
|
348
|
+
try {
|
|
349
|
+
await this.deleteServerPortFile();
|
|
350
|
+
process.exit(0);
|
|
351
|
+
} catch {
|
|
352
|
+
// probably file doesn't exist.
|
|
353
|
+
process.exit(0);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
printSocketPortAndExit() {
|
|
339
357
|
try {
|
|
340
358
|
const port = (0, _serverForever().getSocketPort)();
|
|
341
359
|
process.stdout.write(port.toString());
|
|
@@ -347,32 +365,25 @@ Please run the command "bit server-forever" first to start the server.`));
|
|
|
347
365
|
}
|
|
348
366
|
async getExistingUsedPort() {
|
|
349
367
|
const port = await this.getExistingPort();
|
|
350
|
-
const isPortInUse = await this.
|
|
368
|
+
const isPortInUse = await this.isPortInUseForCurrentDir(port);
|
|
351
369
|
if (!isPortInUse) {
|
|
352
370
|
await this.deleteServerPortFile();
|
|
353
371
|
throw new ServerIsNotRunning(port);
|
|
354
372
|
}
|
|
355
373
|
return port;
|
|
356
374
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
resolve(true);
|
|
370
|
-
});
|
|
371
|
-
client.connect({
|
|
372
|
-
port,
|
|
373
|
-
host: 'localhost'
|
|
374
|
-
});
|
|
375
|
-
});
|
|
375
|
+
async isPortInUseForCurrentDir(port) {
|
|
376
|
+
const pid = (0, _serverForever().getPidByPort)(port);
|
|
377
|
+
if (!pid) {
|
|
378
|
+
return false;
|
|
379
|
+
}
|
|
380
|
+
const dirUsedByPort = await getCwdByPid(pid);
|
|
381
|
+
if (!dirUsedByPort) {
|
|
382
|
+
// might not be supported by Windows. this is on-best-effort basis.
|
|
383
|
+
return true;
|
|
384
|
+
}
|
|
385
|
+
const currentDir = process.cwd();
|
|
386
|
+
return dirUsedByPort === currentDir;
|
|
376
387
|
}
|
|
377
388
|
async getExistingPort() {
|
|
378
389
|
const filePath = this.getServerPortFilePath();
|
|
@@ -407,4 +418,76 @@ function shouldUseBitServer() {
|
|
|
407
418
|
!commandsToSkip.includes(process.argv[2]);
|
|
408
419
|
}
|
|
409
420
|
|
|
421
|
+
/**
|
|
422
|
+
* Executes a command and returns stdout as a string.
|
|
423
|
+
*/
|
|
424
|
+
function execCommand(cmd) {
|
|
425
|
+
return new Promise((resolve, reject) => {
|
|
426
|
+
(0, _child_process().exec)(cmd, {
|
|
427
|
+
encoding: 'utf-8'
|
|
428
|
+
}, (error, stdout) => {
|
|
429
|
+
if (error) {
|
|
430
|
+
return reject(error);
|
|
431
|
+
}
|
|
432
|
+
resolve(stdout.trim());
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Get the CWD of a process by PID.
|
|
439
|
+
*
|
|
440
|
+
* On Linux: readlink /proc/<pid>/cwd
|
|
441
|
+
* On macOS: lsof -p <pid> and parse line with 'cwd'
|
|
442
|
+
* On Windows: Attempt with wmic (not guaranteed)
|
|
443
|
+
*/
|
|
444
|
+
async function getCwdByPid(pid) {
|
|
445
|
+
const platform = _os().default.platform();
|
|
446
|
+
try {
|
|
447
|
+
if (platform === 'linux') {
|
|
448
|
+
const cwd = await execCommand(`readlink /proc/${pid}/cwd`);
|
|
449
|
+
return cwd || null;
|
|
450
|
+
} else if (platform === 'darwin') {
|
|
451
|
+
// macOS does not have /proc, but lsof -p <pid> shows cwd line like:
|
|
452
|
+
// COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
|
|
453
|
+
// node 12345 user cwd DIR 1,2 1024 56789 /Users/username/project
|
|
454
|
+
const output = await execCommand(`lsof -p ${pid}`);
|
|
455
|
+
const line = output.split('\n').find(l => l.includes(' cwd '));
|
|
456
|
+
if (!line) return null;
|
|
457
|
+
const parts = line.trim().split(/\s+/);
|
|
458
|
+
// The last part should be the directory path
|
|
459
|
+
return parts[parts.length - 1] || null;
|
|
460
|
+
} else if (platform === 'win32') {
|
|
461
|
+
// On Windows, we can try wmic:
|
|
462
|
+
// wmic process where "ProcessId=<pid>" get CommandLine,ExecutablePath
|
|
463
|
+
// CommandLine or ExecutablePath might give hints.
|
|
464
|
+
// This is not guaranteed to give the original working directory, as Windows doesn't expose it easily.
|
|
465
|
+
const output = await execCommand(`wmic process where "ProcessId=${pid}" get ExecutablePath /format:list`);
|
|
466
|
+
// Output looks like:
|
|
467
|
+
// ExecutablePath=C:\path\to\executable.exe
|
|
468
|
+
const line = output.split('\n').find(l => l.startsWith('ExecutablePath='));
|
|
469
|
+
if (line) {
|
|
470
|
+
const exePath = line.split('=')[1].trim();
|
|
471
|
+
// Guess: the working directory might be the directory containing the executable
|
|
472
|
+
return (0, _path().dirname)(exePath);
|
|
473
|
+
}
|
|
474
|
+
// If no executable path, try CommandLine
|
|
475
|
+
const cmdOutput = await execCommand(`wmic process where "ProcessId=${pid}" get CommandLine /format:list`);
|
|
476
|
+
const cmdLine = cmdOutput.split('\n').find(l => l.startsWith('CommandLine='));
|
|
477
|
+
if (cmdLine) {
|
|
478
|
+
const command = cmdLine.split('=')[1].trim();
|
|
479
|
+
// Attempt a guess: if command is a full path, take its directory
|
|
480
|
+
if (command.includes('\\')) {
|
|
481
|
+
return (0, _path().dirname)(command.split(' ')[0]);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
return null;
|
|
485
|
+
} else {
|
|
486
|
+
throw new Error(`Platform ${platform} not supported`);
|
|
487
|
+
}
|
|
488
|
+
} catch {
|
|
489
|
+
return null;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
410
493
|
//# sourceMappingURL=server-commander.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_nodeFetch","data","_interopRequireDefault","require","_net","_fsExtra","_child_process","_path","_eventsource","_scopeModules","_chalk","_legacy","_bootstrap","_serverForever","e","__esModule","default","ServerPortFileNotFound","Error","constructor","filePath","ServerIsNotRunning","port","ScopeNotFound","scopePath","ServerCommander","execute","results","runCommandWithHttpServer","exitCode","loader","off","dataToPrint","JSON","stringify","undefined","console","log","process","exit","err","error","chalk","red","message","shouldUseTTYPath","platform","env","BIT_CLI_SERVER_TTY","printPortIfAsked","printSocketPortIfAsked","printBitVersionIfAsked","getExistingUsedPort","url","shouldUsePTY","BIT_CLI_SERVER_PTY","connectToSocket","ttyPath","execSync","encoding","stdio","trim","initSSE","args","argv","slice","includes","on","endpoint","pwd","cwd","body","command","envBitFeatures","BIT_FEATURES","isPty","res","fetch","method","headers","code","deleteServerPortFile","join","ok","json","jsonResponse","statusText","Promise","resolve","reject","socketPort","getSocketPort","socket","net","createConnection","resetStdin","stdin","setRawMode","pause","destroy","resume","write","toString","end","stdout","cleanup","eventSource","EventSource","onerror","_error","close","addEventListener","event","parsed","parse","getExistingPort","isPortInUse","client","Socket","once","connect","host","getServerPortFilePath","fileContent","fs","readFile","parseInt","remove","findScopePath","exports","shouldUseBitServer","commandsToSkip","hasFlag","BIT_CLI_SERVER","length"],"sources":["server-commander.ts"],"sourcesContent":["/**\n * This file is responsible for interacting with bit through a long-running background process \"bit-server\" rather than directly.\n * Why not directly?\n * 1. startup cost. currently it takes around 1 second to bootstrap bit.\n * 2. an experimental package-manager saves node_modules in-memory. if a client starts a new process, it won't have the node_modules in-memory.\n *\n * In this file, there are three ways to achieve this. It's outlined in the order it was evolved.\n * The big challenge here is to show the output correctly to the client even though the server is running in a different process.\n *\n * 1. process.env.BIT_CLI_SERVER === 'true'\n * This method uses SSE - Server Send Events. The server sends events to the client with the output to print. The client listens to\n * these events and prints them. It's cumbersome. For this, the logger was changed and every time the logger needs to print to the console,\n * it was using this SSE to send events. Same with the loader.\n * Cons: Other output, such as pnpm, needs an extra effort to print - for pnpm, the \"process\" object was passed to pnpm\n * and its stdout was modified to use the SSE.\n * However, other tools that print directly to the console, such as Jest, won't work.\n *\n * 2. process.env.BIT_CLI_SERVER_TTY === 'true'\n * Because the terminal - tty is a fd (file descriptor) on mac/linux, it can be passed to the server. The server can write to this\n * fd and it will be printed to the client terminal. On the server, the process.stdout.write was monkey-patched to\n * write to the tty. (see cli-raw.route.ts file).\n * It solves the problem of Jest and other tools that print directly to the console.\n * Cons:\n * A. It doesn't work on Windows. Windows doesn't treat tty as a file descriptor.\n * B. We need two ways communication. Commands such as \"bit update\", display a prompt with option to select using the arrow keys.\n * This is not possible with the tty approach. Also, if the client hits Ctrl+C, the server won't know about it and it\n * won't kill the process.\n *\n * 3. process.env.BIT_CLI_SERVER_PTY === 'true'\n * This is the most advanced approach. It spawns a pty (pseudo terminal) process to communicate between the client and the server.\n * The client connects to the server using a socket. The server writes to the socket and the client reads from it.\n * The client also writes to the socket and the server reads from it. See server-forever.ts to understand better.\n * In order to pass terminal sequences, such as arrow keys or Ctrl+C, the stdin of the client is set to raw mode.\n * In theory, this approach could work by spawning a normal process, not pty, however, then, the stdin/stdout are non-tty,\n * and as a result, loaders such as Ora and chalk won't work.\n * With this new approach, we also support terminating and reloading the server. A new command is added\n * \"bit server-forever\", which spawns the pty-process. If the client hits Ctrl+C, this server-forever process will kill\n * the pty-process and re-load it.\n * Keep in mind, that to send the command and get the results, we still using http. The usage of the pty is only for\n * the input/output during the command.\n * I was trying to avoid the http, and use only the pty, by implementing readline to get the command from the socket,\n * but then I wasn't able to return the prompt to the user easily. So, I decided to keep the http for the request/response part.\n */\n\nimport fetch from 'node-fetch';\nimport net from 'net';\nimport fs from 'fs-extra';\nimport { execSync } from 'child_process';\nimport { join } from 'path';\nimport EventSource from 'eventsource';\nimport { findScopePath } from '@teambit/scope.modules.find-scope-path';\nimport chalk from 'chalk';\nimport { loader } from '@teambit/legacy.loader';\nimport { printBitVersionIfAsked } from './bootstrap';\nimport { getSocketPort } from './server-forever';\n\nclass ServerPortFileNotFound extends Error {\n constructor(filePath: string) {\n super(`server port file not found at ${filePath}`);\n }\n}\nclass ServerIsNotRunning extends Error {\n constructor(port: number) {\n super(`bit server is not running on port ${port}`);\n }\n}\nclass ScopeNotFound extends Error {\n constructor(scopePath: string) {\n super(`scope not found at ${scopePath}`);\n }\n}\n\ntype CommandResult = { data: any; exitCode: number };\n\nexport class ServerCommander {\n async execute() {\n try {\n const results = await this.runCommandWithHttpServer();\n if (results) {\n const { data, exitCode } = results;\n loader.off();\n const dataToPrint = typeof data === 'string' ? data : JSON.stringify(data, undefined, 2);\n // eslint-disable-next-line no-console\n console.log(dataToPrint);\n process.exit(exitCode);\n }\n\n process.exit(0);\n } catch (err: any) {\n if (err instanceof ScopeNotFound || err instanceof ServerPortFileNotFound || err instanceof ServerIsNotRunning) {\n throw err;\n }\n loader.off();\n // eslint-disable-next-line no-console\n console.error(chalk.red(err.message));\n process.exit(1);\n }\n }\n\n private shouldUseTTYPath() {\n if (process.platform === 'win32') return false; // windows doesn't support tty path\n return process.env.BIT_CLI_SERVER_TTY === 'true';\n }\n\n async runCommandWithHttpServer(): Promise<CommandResult | undefined> {\n await this.printPortIfAsked();\n this.printSocketPortIfAsked();\n printBitVersionIfAsked();\n const port = await this.getExistingUsedPort();\n const url = `http://localhost:${port}/api`;\n const shouldUsePTY = process.env.BIT_CLI_SERVER_PTY === 'true';\n\n if (shouldUsePTY) {\n await this.connectToSocket();\n }\n const ttyPath = this.shouldUseTTYPath()\n ? execSync('tty', {\n encoding: 'utf8',\n stdio: ['inherit', 'pipe', 'pipe'],\n }).trim()\n : undefined;\n if (!ttyPath && !shouldUsePTY) this.initSSE(url);\n // parse the args and options from the command\n const args = process.argv.slice(2);\n if (!args.includes('--json') && !args.includes('-j')) {\n loader.on();\n }\n const endpoint = `cli-raw`;\n const pwd = process.cwd();\n const body = { command: args, pwd, envBitFeatures: process.env.BIT_FEATURES, ttyPath, isPty: shouldUsePTY };\n let res;\n try {\n res = await fetch(`${url}/${endpoint}`, {\n method: 'post',\n body: JSON.stringify(body),\n headers: { 'Content-Type': 'application/json' },\n });\n } catch (err: any) {\n if (err.code === 'ECONNREFUSED') {\n await this.deleteServerPortFile();\n throw new ServerIsNotRunning(port);\n }\n throw new Error(`failed to run command \"${args.join(' ')}\" on the server. ${err.message}`);\n }\n\n if (res.ok) {\n const results = await res.json();\n return results;\n }\n\n let jsonResponse;\n try {\n jsonResponse = await res.json();\n } catch {\n // the response is not json, ignore the body.\n }\n throw new Error(jsonResponse?.message || jsonResponse || res.statusText);\n }\n\n private async connectToSocket() {\n return new Promise<void>((resolve, reject) => {\n const socketPort = getSocketPort();\n const socket = net.createConnection({ port: socketPort });\n\n const resetStdin = () => {\n process.stdin.setRawMode(false);\n process.stdin.pause();\n };\n\n // Handle errors that occur before or after connection\n socket.on('error', (err: any) => {\n if (err.code === 'ECONNREFUSED') {\n reject(\n new Error(`Error: Unable to connect to the socket on port ${socketPort}.\nPlease run the command \"bit server-forever\" first to start the server.`)\n );\n }\n resetStdin();\n socket.destroy(); // Ensure the socket is fully closed\n reject(err);\n });\n\n // Handle successful connection\n socket.on('connect', () => {\n process.stdin.setRawMode(true);\n process.stdin.resume();\n\n // Forward stdin to the socket\n process.stdin.on('data', (data: any) => {\n socket.write(data);\n\n // Detect Ctrl+C (hex code '03')\n if (data.toString('hex') === '03') {\n // Important to write it to the socket so the server knows to kill the PTY process\n process.stdin.setRawMode(false);\n process.stdin.pause();\n socket.end();\n process.exit();\n }\n });\n\n // Forward data from the socket to stdout\n socket.on('data', (data: any) => {\n process.stdout.write(data);\n });\n\n // Handle socket close and end events\n const cleanup = () => {\n resetStdin();\n socket.destroy();\n };\n\n socket.on('close', cleanup);\n socket.on('end', cleanup);\n\n resolve(); // Connection successful, resolve the Promise\n });\n });\n }\n\n /**\n * Initialize the server-sent events (SSE) connection to the server.\n * This is used to print the logs and show the loader during the command.\n * Without this, it only shows the response from http server, but not the \"logger.console\" or \"logger.setStatusLine\" texts.\n *\n * I wasn't able to find a better way to do it. The challenge here is that the http server is running in a different\n * process, which is not connected to the current process in any way. (unlike the IDE which is its child process and\n * can access its stdout).\n * One of the attempts I made is sending the \"tty\" path to the server and let the server console log to that path, but\n * it didn't work well. It was printed only after the response came back from the server.\n */\n private initSSE(url: string) {\n const eventSource = new EventSource(`${url}/sse-events`);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n eventSource.onerror = (_error: any) => {\n // eslint-disable-next-line no-console\n // console.error('Error occurred in SSE connection:', _error);\n // probably was unable to connect to the server and will throw ServerNotFound right after. no need to show this error.\n eventSource.close();\n };\n eventSource.addEventListener('onLoader', (event: any) => {\n const parsed = JSON.parse(event.data);\n const { method, args } = parsed;\n loader[method](...(args || []));\n });\n eventSource.addEventListener('onLogWritten', (event: any) => {\n const parsed = JSON.parse(event.data);\n process.stdout.write(parsed.message);\n });\n }\n\n private async printPortIfAsked() {\n if (!process.argv.includes('cli-server-port')) return;\n try {\n const port = await this.getExistingUsedPort();\n process.stdout.write(port.toString());\n process.exit(0);\n } catch (err: any) {\n if (err instanceof ScopeNotFound || err instanceof ServerPortFileNotFound || err instanceof ServerIsNotRunning) {\n process.exit(0);\n }\n console.error(err.message); // eslint-disable-line no-console\n process.exit(1);\n }\n }\n\n private printSocketPortIfAsked() {\n if (!process.argv.includes('cli-server-socket-port')) return;\n try {\n const port = getSocketPort();\n process.stdout.write(port.toString());\n process.exit(0);\n } catch (err: any) {\n console.error(err.message); // eslint-disable-line no-console\n process.exit(1);\n }\n }\n\n private async getExistingUsedPort(): Promise<number> {\n const port = await this.getExistingPort();\n const isPortInUse = await this.isPortInUse(port);\n if (!isPortInUse) {\n await this.deleteServerPortFile();\n throw new ServerIsNotRunning(port);\n }\n\n return port;\n }\n\n private isPortInUse(port: number): Promise<boolean> {\n return new Promise((resolve, reject) => {\n const client = new net.Socket();\n\n client.once('error', (err: any) => {\n if (err.code === 'ECONNREFUSED' || err.code === 'EHOSTUNREACH') {\n resolve(false);\n } else {\n reject(err);\n }\n });\n\n client.once('connect', () => {\n client.end();\n resolve(true);\n });\n\n client.connect({ port, host: 'localhost' });\n });\n }\n\n private async getExistingPort(): Promise<number> {\n const filePath = this.getServerPortFilePath();\n try {\n const fileContent = await fs.readFile(filePath, 'utf8');\n return parseInt(fileContent, 10);\n } catch (err: any) {\n if (err.code === 'ENOENT') {\n throw new ServerPortFileNotFound(filePath);\n }\n throw err;\n }\n }\n\n private async deleteServerPortFile() {\n const filePath = this.getServerPortFilePath();\n await fs.remove(filePath);\n }\n\n private getServerPortFilePath() {\n const scopePath = findScopePath(process.cwd());\n if (!scopePath) {\n throw new ScopeNotFound(process.cwd());\n }\n return join(scopePath, 'server-port.txt');\n }\n}\n\nexport function shouldUseBitServer() {\n const commandsToSkip = ['start', 'run', 'watch', 'server'];\n const hasFlag =\n process.env.BIT_CLI_SERVER === 'true' ||\n process.env.BIT_CLI_SERVER === '1' ||\n process.env.BIT_CLI_SERVER_PTY === 'true' ||\n process.env.BIT_CLI_SERVER_TTY === 'true';\n return (\n hasFlag &&\n process.argv.length > 2 && // if it has no args, it shows the help\n !commandsToSkip.includes(process.argv[2])\n );\n}\n"],"mappings":";;;;;;;AA4CA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,KAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,eAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,cAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,MAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,KAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,aAAA;EAAA,MAAAP,IAAA,GAAAC,sBAAA,CA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MAAM7D,QAAQ,GAAG,IAAI,CAACsG,qBAAqB,CAAC,CAAC;IAC7C,MAAME,kBAAE,CAACG,MAAM,CAAC3G,QAAQ,CAAC;EAC3B;EAEQsG,qBAAqBA,CAAA,EAAG;IAC9B,MAAMlG,SAAS,GAAG,IAAAwG,6BAAa,EAAC1F,OAAO,CAACgC,GAAG,CAAC,CAAC,CAAC;IAC9C,IAAI,CAAC9C,SAAS,EAAE;MACd,MAAM,IAAID,aAAa,CAACe,OAAO,CAACgC,GAAG,CAAC,CAAC,CAAC;IACxC;IACA,OAAO,IAAAY,YAAI,EAAC1D,SAAS,EAAE,iBAAiB,CAAC;EAC3C;AACF;AAACyG,OAAA,CAAAxG,eAAA,GAAAA,eAAA;AAEM,SAASyG,kBAAkBA,CAAA,EAAG;EACnC,MAAMC,cAAc,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;EAC1D,MAAMC,OAAO,GACX9F,OAAO,CAACS,GAAG,CAACsF,cAAc,KAAK,MAAM,IACrC/F,OAAO,CAACS,GAAG,CAACsF,cAAc,KAAK,GAAG,IAClC/F,OAAO,CAACS,GAAG,CAACQ,kBAAkB,KAAK,MAAM,IACzCjB,OAAO,CAACS,GAAG,CAACC,kBAAkB,KAAK,MAAM;EAC3C,OACEoF,OAAO,IACP9F,OAAO,CAAC0B,IAAI,CAACsE,MAAM,GAAG,CAAC;EAAI;EAC3B,CAACH,cAAc,CAACjE,QAAQ,CAAC5B,OAAO,CAAC0B,IAAI,CAAC,CAAC,CAAC,CAAC;AAE7C","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_nodeFetch","data","_interopRequireDefault","require","_net","_fsExtra","_child_process","_path","_os","_eventsource","_scopeModules","_chalk","_legacy","_bootstrap","_serverForever","e","__esModule","default","CMD_SERVER_PORT","CMD_SERVER_PORT_DELETE","CMD_SERVER_SOCKET_PORT","ServerPortFileNotFound","Error","constructor","filePath","ServerIsNotRunning","port","ScopeNotFound","scopePath","ServerCommander","execute","results","runCommandWithHttpServer","exitCode","loader","off","dataToPrint","JSON","stringify","undefined","console","log","process","exit","err","error","chalk","red","message","shouldUseTTYPath","platform","env","BIT_CLI_SERVER_TTY","argv","includes","printPortAndExit","printSocketPortAndExit","deletePortAndExit","printBitVersionIfAsked","getExistingUsedPort","url","shouldUsePTY","BIT_CLI_SERVER_PTY","connectToSocket","ttyPath","execSync","encoding","stdio","trim","initSSE","args","slice","on","endpoint","pwd","cwd","body","command","envBitFeatures","BIT_FEATURES","isPty","res","fetch","method","headers","code","deleteServerPortFile","join","ok","json","jsonResponse","statusText","Promise","resolve","reject","socketPort","getSocketPort","socket","net","createConnection","resetStdin","stdin","setRawMode","pause","destroy","resume","write","toString","end","stdout","cleanup","eventSource","EventSource","onerror","_error","close","addEventListener","event","parsed","parse","getExistingPort","isPortInUse","isPortInUseForCurrentDir","pid","getPidByPort","dirUsedByPort","getCwdByPid","currentDir","getServerPortFilePath","fileContent","fs","readFile","parseInt","remove","findScopePath","exports","shouldUseBitServer","commandsToSkip","hasFlag","BIT_CLI_SERVER","length","execCommand","cmd","exec","os","output","line","split","find","l","parts","startsWith","exePath","dirname","cmdOutput","cmdLine"],"sources":["server-commander.ts"],"sourcesContent":["/**\n * This file is responsible for interacting with bit through a long-running background process \"bit-server\" rather than directly.\n * Why not directly?\n * 1. startup cost. currently it takes around 1 second to bootstrap bit.\n * 2. an experimental package-manager saves node_modules in-memory. if a client starts a new process, it won't have the node_modules in-memory.\n *\n * In this file, there are three ways to achieve this. It's outlined in the order it was evolved.\n * The big challenge here is to show the output correctly to the client even though the server is running in a different process.\n *\n * 1. process.env.BIT_CLI_SERVER === 'true'\n * This method uses SSE - Server Send Events. The server sends events to the client with the output to print. The client listens to\n * these events and prints them. It's cumbersome. For this, the logger was changed and every time the logger needs to print to the console,\n * it was using this SSE to send events. Same with the loader.\n * Cons: Other output, such as pnpm, needs an extra effort to print - for pnpm, the \"process\" object was passed to pnpm\n * and its stdout was modified to use the SSE.\n * However, other tools that print directly to the console, such as Jest, won't work.\n *\n * 2. process.env.BIT_CLI_SERVER_TTY === 'true'\n * Because the terminal - tty is a fd (file descriptor) on mac/linux, it can be passed to the server. The server can write to this\n * fd and it will be printed to the client terminal. On the server, the process.stdout.write was monkey-patched to\n * write to the tty. (see cli-raw.route.ts file).\n * It solves the problem of Jest and other tools that print directly to the console.\n * Cons:\n * A. It doesn't work on Windows. Windows doesn't treat tty as a file descriptor.\n * B. We need two ways communication. Commands such as \"bit update\", display a prompt with option to select using the arrow keys.\n * This is not possible with the tty approach. Also, if the client hits Ctrl+C, the server won't know about it and it\n * won't kill the process.\n *\n * 3. process.env.BIT_CLI_SERVER_PTY === 'true'\n * This is the most advanced approach. It spawns a pty (pseudo terminal) process to communicate between the client and the server.\n * The client connects to the server using a socket. The server writes to the socket and the client reads from it.\n * The client also writes to the socket and the server reads from it. See server-forever.ts to understand better.\n * In order to pass terminal sequences, such as arrow keys or Ctrl+C, the stdin of the client is set to raw mode.\n * In theory, this approach could work by spawning a normal process, not pty, however, then, the stdin/stdout are non-tty,\n * and as a result, loaders such as Ora and chalk won't work.\n * With this new approach, we also support terminating and reloading the server. A new command is added\n * \"bit server-forever\", which spawns the pty-process. If the client hits Ctrl+C, this server-forever process will kill\n * the pty-process and re-load it.\n * Keep in mind, that to send the command and get the results, we still using http. The usage of the pty is only for\n * the input/output during the command.\n * I was trying to avoid the http, and use only the pty, by implementing readline to get the command from the socket,\n * but then I wasn't able to return the prompt to the user easily. So, I decided to keep the http for the request/response part.\n */\n\nimport fetch from 'node-fetch';\nimport net from 'net';\nimport fs from 'fs-extra';\nimport { exec, execSync } from 'child_process';\nimport { join, dirname } from 'path';\nimport os from 'os';\nimport EventSource from 'eventsource';\nimport { findScopePath } from '@teambit/scope.modules.find-scope-path';\nimport chalk from 'chalk';\nimport { loader } from '@teambit/legacy.loader';\nimport { printBitVersionIfAsked } from './bootstrap';\nimport { getPidByPort, getSocketPort } from './server-forever';\n\nconst CMD_SERVER_PORT = 'cli-server-port';\nconst CMD_SERVER_PORT_DELETE = 'cli-server-port-delete';\nconst CMD_SERVER_SOCKET_PORT = 'cli-server-socket-port';\n\nclass ServerPortFileNotFound extends Error {\n constructor(filePath: string) {\n super(`server port file not found at ${filePath}`);\n }\n}\nclass ServerIsNotRunning extends Error {\n constructor(port: number) {\n super(`bit server is not running on port ${port}`);\n }\n}\nclass ScopeNotFound extends Error {\n constructor(scopePath: string) {\n super(`scope not found at ${scopePath}`);\n }\n}\n\ntype CommandResult = { data: any; exitCode: number };\n\nexport class ServerCommander {\n async execute() {\n try {\n const results = await this.runCommandWithHttpServer();\n if (results) {\n const { data, exitCode } = results;\n loader.off();\n const dataToPrint = typeof data === 'string' ? data : JSON.stringify(data, undefined, 2);\n // eslint-disable-next-line no-console\n console.log(dataToPrint);\n process.exit(exitCode);\n }\n\n process.exit(0);\n } catch (err: any) {\n if (err instanceof ScopeNotFound || err instanceof ServerPortFileNotFound || err instanceof ServerIsNotRunning) {\n throw err;\n }\n loader.off();\n // eslint-disable-next-line no-console\n console.error(chalk.red(err.message));\n process.exit(1);\n }\n }\n\n private shouldUseTTYPath() {\n if (process.platform === 'win32') return false; // windows doesn't support tty path\n return process.env.BIT_CLI_SERVER_TTY === 'true';\n }\n\n async runCommandWithHttpServer(): Promise<CommandResult | undefined | void> {\n if (process.argv.includes(CMD_SERVER_PORT)) return this.printPortAndExit();\n if (process.argv.includes(CMD_SERVER_SOCKET_PORT)) return this.printSocketPortAndExit();\n if (process.argv.includes(CMD_SERVER_PORT_DELETE)) return this.deletePortAndExit();\n printBitVersionIfAsked();\n const port = await this.getExistingUsedPort();\n const url = `http://localhost:${port}/api`;\n const shouldUsePTY = process.env.BIT_CLI_SERVER_PTY === 'true';\n\n if (shouldUsePTY) {\n await this.connectToSocket();\n }\n const ttyPath = this.shouldUseTTYPath()\n ? execSync('tty', {\n encoding: 'utf8',\n stdio: ['inherit', 'pipe', 'pipe'],\n }).trim()\n : undefined;\n if (!ttyPath && !shouldUsePTY) this.initSSE(url);\n // parse the args and options from the command\n const args = process.argv.slice(2);\n if (!args.includes('--json') && !args.includes('-j')) {\n loader.on();\n }\n const endpoint = `cli-raw`;\n const pwd = process.cwd();\n const body = { command: args, pwd, envBitFeatures: process.env.BIT_FEATURES, ttyPath, isPty: shouldUsePTY };\n let res;\n try {\n res = await fetch(`${url}/${endpoint}`, {\n method: 'post',\n body: JSON.stringify(body),\n headers: { 'Content-Type': 'application/json' },\n });\n } catch (err: any) {\n if (err.code === 'ECONNREFUSED') {\n await this.deleteServerPortFile();\n throw new ServerIsNotRunning(port);\n }\n throw new Error(`failed to run command \"${args.join(' ')}\" on the server. ${err.message}`);\n }\n\n if (res.ok) {\n const results = await res.json();\n return results;\n }\n\n let jsonResponse;\n try {\n jsonResponse = await res.json();\n } catch {\n // the response is not json, ignore the body.\n }\n throw new Error(jsonResponse?.message || jsonResponse || res.statusText);\n }\n\n private async connectToSocket() {\n return new Promise<void>((resolve, reject) => {\n const socketPort = getSocketPort();\n const socket = net.createConnection({ port: socketPort });\n\n const resetStdin = () => {\n process.stdin.setRawMode(false);\n process.stdin.pause();\n };\n\n // Handle errors that occur before or after connection\n socket.on('error', (err: any) => {\n if (err.code === 'ECONNREFUSED') {\n reject(\n new Error(`Error: Unable to connect to the socket on port ${socketPort}.\nPlease run the command \"bit server-forever\" first to start the server.`)\n );\n }\n resetStdin();\n socket.destroy(); // Ensure the socket is fully closed\n reject(err);\n });\n\n // Handle successful connection\n socket.on('connect', () => {\n process.stdin.setRawMode(true);\n process.stdin.resume();\n\n // Forward stdin to the socket\n process.stdin.on('data', (data: any) => {\n socket.write(data);\n\n // Detect Ctrl+C (hex code '03')\n if (data.toString('hex') === '03') {\n // Important to write it to the socket so the server knows to kill the PTY process\n process.stdin.setRawMode(false);\n process.stdin.pause();\n socket.end();\n process.exit();\n }\n });\n\n // Forward data from the socket to stdout\n socket.on('data', (data: any) => {\n process.stdout.write(data);\n });\n\n // Handle socket close and end events\n const cleanup = () => {\n resetStdin();\n socket.destroy();\n };\n\n socket.on('close', cleanup);\n socket.on('end', cleanup);\n\n resolve(); // Connection successful, resolve the Promise\n });\n });\n }\n\n /**\n * Initialize the server-sent events (SSE) connection to the server.\n * This is used to print the logs and show the loader during the command.\n * Without this, it only shows the response from http server, but not the \"logger.console\" or \"logger.setStatusLine\" texts.\n *\n * I wasn't able to find a better way to do it. The challenge here is that the http server is running in a different\n * process, which is not connected to the current process in any way. (unlike the IDE which is its child process and\n * can access its stdout).\n * One of the attempts I made is sending the \"tty\" path to the server and let the server console log to that path, but\n * it didn't work well. It was printed only after the response came back from the server.\n */\n private initSSE(url: string) {\n const eventSource = new EventSource(`${url}/sse-events`);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n eventSource.onerror = (_error: any) => {\n // eslint-disable-next-line no-console\n // console.error('Error occurred in SSE connection:', _error);\n // probably was unable to connect to the server and will throw ServerNotFound right after. no need to show this error.\n eventSource.close();\n };\n eventSource.addEventListener('onLoader', (event: any) => {\n const parsed = JSON.parse(event.data);\n const { method, args } = parsed;\n loader[method](...(args || []));\n });\n eventSource.addEventListener('onLogWritten', (event: any) => {\n const parsed = JSON.parse(event.data);\n process.stdout.write(parsed.message);\n });\n }\n\n private async printPortAndExit() {\n try {\n const port = await this.getExistingUsedPort();\n process.stdout.write(port.toString());\n process.exit(0);\n } catch (err: any) {\n if (err instanceof ScopeNotFound || err instanceof ServerPortFileNotFound || err instanceof ServerIsNotRunning) {\n process.exit(0);\n }\n console.error(err.message); // eslint-disable-line no-console\n process.exit(1);\n }\n }\n private async deletePortAndExit() {\n try {\n await this.deleteServerPortFile();\n process.exit(0);\n } catch {\n // probably file doesn't exist.\n process.exit(0);\n }\n }\n\n private printSocketPortAndExit() {\n try {\n const port = getSocketPort();\n process.stdout.write(port.toString());\n process.exit(0);\n } catch (err: any) {\n console.error(err.message); // eslint-disable-line no-console\n process.exit(1);\n }\n }\n\n private async getExistingUsedPort(): Promise<number> {\n const port = await this.getExistingPort();\n const isPortInUse = await this.isPortInUseForCurrentDir(port);\n if (!isPortInUse) {\n await this.deleteServerPortFile();\n throw new ServerIsNotRunning(port);\n }\n\n return port;\n }\n\n private async isPortInUseForCurrentDir(port: number) {\n const pid = getPidByPort(port);\n if (!pid) {\n return false;\n }\n const dirUsedByPort = await getCwdByPid(pid);\n if (!dirUsedByPort) {\n // might not be supported by Windows. this is on-best-effort basis.\n return true;\n }\n const currentDir = process.cwd();\n return dirUsedByPort === currentDir;\n }\n\n private async getExistingPort(): Promise<number> {\n const filePath = this.getServerPortFilePath();\n try {\n const fileContent = await fs.readFile(filePath, 'utf8');\n return parseInt(fileContent, 10);\n } catch (err: any) {\n if (err.code === 'ENOENT') {\n throw new ServerPortFileNotFound(filePath);\n }\n throw err;\n }\n }\n\n private async deleteServerPortFile() {\n const filePath = this.getServerPortFilePath();\n await fs.remove(filePath);\n }\n\n private getServerPortFilePath() {\n const scopePath = findScopePath(process.cwd());\n if (!scopePath) {\n throw new ScopeNotFound(process.cwd());\n }\n return join(scopePath, 'server-port.txt');\n }\n}\n\nexport function shouldUseBitServer() {\n const commandsToSkip = ['start', 'run', 'watch', 'server'];\n const hasFlag =\n process.env.BIT_CLI_SERVER === 'true' ||\n process.env.BIT_CLI_SERVER === '1' ||\n process.env.BIT_CLI_SERVER_PTY === 'true' ||\n process.env.BIT_CLI_SERVER_TTY === 'true';\n return (\n hasFlag &&\n process.argv.length > 2 && // if it has no args, it shows the help\n !commandsToSkip.includes(process.argv[2])\n );\n}\n\n/**\n * Executes a command and returns stdout as a string.\n */\nfunction execCommand(cmd: string): Promise<string> {\n return new Promise((resolve, reject) => {\n exec(cmd, { encoding: 'utf-8' }, (error, stdout) => {\n if (error) {\n return reject(error);\n }\n resolve(stdout.trim());\n });\n });\n}\n\n/**\n * Get the CWD of a process by PID.\n *\n * On Linux: readlink /proc/<pid>/cwd\n * On macOS: lsof -p <pid> and parse line with 'cwd'\n * On Windows: Attempt with wmic (not guaranteed)\n */\nasync function getCwdByPid(pid: string): Promise<string | null> {\n const platform = os.platform();\n\n try {\n if (platform === 'linux') {\n const cwd = await execCommand(`readlink /proc/${pid}/cwd`);\n return cwd || null;\n } else if (platform === 'darwin') {\n // macOS does not have /proc, but lsof -p <pid> shows cwd line like:\n // COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME\n // node 12345 user cwd DIR 1,2 1024 56789 /Users/username/project\n const output = await execCommand(`lsof -p ${pid}`);\n const line = output.split('\\n').find((l) => l.includes(' cwd '));\n if (!line) return null;\n const parts = line.trim().split(/\\s+/);\n // The last part should be the directory path\n return parts[parts.length - 1] || null;\n } else if (platform === 'win32') {\n // On Windows, we can try wmic:\n // wmic process where \"ProcessId=<pid>\" get CommandLine,ExecutablePath\n // CommandLine or ExecutablePath might give hints.\n // This is not guaranteed to give the original working directory, as Windows doesn't expose it easily.\n const output = await execCommand(`wmic process where \"ProcessId=${pid}\" get ExecutablePath /format:list`);\n // Output looks like:\n // ExecutablePath=C:\\path\\to\\executable.exe\n const line = output.split('\\n').find((l) => l.startsWith('ExecutablePath='));\n if (line) {\n const exePath = line.split('=')[1].trim();\n // Guess: the working directory might be the directory containing the executable\n return dirname(exePath);\n }\n // If no executable path, try CommandLine\n const cmdOutput = await execCommand(`wmic process where \"ProcessId=${pid}\" get CommandLine /format:list`);\n const cmdLine = cmdOutput.split('\\n').find((l) => l.startsWith('CommandLine='));\n if (cmdLine) {\n const command = cmdLine.split('=')[1].trim();\n // Attempt a guess: if command is a full path, take its directory\n if (command.includes('\\\\')) {\n return dirname(command.split(' ')[0]);\n }\n }\n return null;\n } else {\n throw new Error(`Platform ${platform} not supported`);\n }\n } catch {\n return null;\n }\n}\n"],"mappings":";;;;;;;AA4CA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,KAAA;EAAA,MAAA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C;MAC/E,IAAII,OAAO,EAAE;QACX,MAAM9E,OAAO,GAAG8E,OAAO,CAACR,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC/E,IAAI,CAAC,CAAC;QAC5C;QACA,IAAIS,OAAO,CAACvB,QAAQ,CAAC,IAAI,CAAC,EAAE;UAC1B,OAAO,IAAAmG,eAAO,EAAC5E,OAAO,CAACsE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC;MACF;MACA,OAAO,IAAI;IACb,CAAC,MAAM;MACL,MAAM,IAAI7H,KAAK,CAAC,YAAY4B,QAAQ,gBAAgB,CAAC;IACvD;EACF,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF","ignoreList":[]}
|
package/dist/server-forever.d.ts
CHANGED
|
@@ -10,3 +10,4 @@ export declare function getSocketPort(): number;
|
|
|
10
10
|
* it's easier to generate a random port based on the workspace path than to save it in a file
|
|
11
11
|
*/
|
|
12
12
|
export declare function getPortFromPath(path: string): number;
|
|
13
|
+
export declare function getPidByPort(port: number, consoleErrors?: boolean): string | null;
|
package/dist/server-forever.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.getPidByPort = getPidByPort;
|
|
6
7
|
exports.getPortFromPath = getPortFromPath;
|
|
7
8
|
exports.getSocketPort = getSocketPort;
|
|
8
9
|
exports.spawnPTY = spawnPTY;
|
|
@@ -109,7 +110,7 @@ function spawnPTY() {
|
|
|
109
110
|
const PORT = getSocketPort();
|
|
110
111
|
server.on('error', err => {
|
|
111
112
|
if (err.code === 'EADDRINUSE') {
|
|
112
|
-
const pid = getPidByPort(PORT);
|
|
113
|
+
const pid = getPidByPort(PORT, true);
|
|
113
114
|
const usedByPid = pid ? ` (used by PID ${pid})` : '';
|
|
114
115
|
const killCmd = pid ? `\nAlternatively, you can kill the process by running "kill ${pid}".` : '';
|
|
115
116
|
console.error(`Error: Port ${PORT} is already in use${usedByPid}.
|
|
@@ -167,7 +168,7 @@ function getPortFromPath(path) {
|
|
|
167
168
|
const port = hashInt % portRange + minPort;
|
|
168
169
|
return port;
|
|
169
170
|
}
|
|
170
|
-
function getPidByPort(port) {
|
|
171
|
+
function getPidByPort(port, consoleErrors = false) {
|
|
171
172
|
const platform = process.platform;
|
|
172
173
|
try {
|
|
173
174
|
if (platform === 'darwin' || platform === 'linux') {
|
|
@@ -197,10 +198,10 @@ function getPidByPort(port) {
|
|
|
197
198
|
}
|
|
198
199
|
}
|
|
199
200
|
} else {
|
|
200
|
-
console.error('Unsupported platform:', platform);
|
|
201
|
+
if (consoleErrors) console.error('Unsupported platform:', platform);
|
|
201
202
|
}
|
|
202
203
|
} catch (error) {
|
|
203
|
-
console.error('Error executing command:', error.message);
|
|
204
|
+
if (consoleErrors) console.error('Error executing command:', error.message);
|
|
204
205
|
}
|
|
205
206
|
return null;
|
|
206
207
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_net","data","_interopRequireDefault","require","_crypto","_child_process","_nodePty","e","__esModule","default","spawnPTY","flags","process","argv","slice","filter","arg","startsWith","ptyProcess","spawn","name","cols","rows","cwd","env","clients","didGetClient","outputNotForClients","on","length","toString","forEach","socket","write","server","net","createServer","console","log","push","kill","index","indexOf","splice","err","error","PORT","getSocketPort","code","pid","getPidByPort","usedByPid","killCmd","exit","listen","signal","close","setTimeout","BIT_CLI_SERVER_SOCKET_PORT","parseInt","getPortFromPath","path","hash","crypto","createHash","update","digest","hashInt","substring","minPort","maxPort","portRange","port","platform","cmd","stdout","execSync","lines","trim","split","columns","line","localAddress","endsWith","message"],"sources":["server-forever.ts"],"sourcesContent":["/**\n * see the docs of server-commander.ts for more info\n * this \"server-forever\" command is used to run the bit server in a way that it will never stop. if it gets killed,\n * it will restart itself.\n * it spawns \"bit server\" using node-pty for a pseudo-terminal (PTY) in order for libs such as inquirer/ora/chalk to work properly.\n */\n\n/* eslint-disable no-console */\n\nimport net from 'net';\nimport crypto from 'crypto';\nimport { execSync } from 'child_process';\nimport { spawn } from '@lydell/node-pty';\n\nexport function spawnPTY() {\n // Create a PTY (terminal emulation) running the 'bit server' process\n // this way, we can catch terminal sequences like arrows, ctrl+c, etc.\n const flags = process.argv.slice(2).filter((arg) => arg.startsWith('-'));\n const ptyProcess = spawn('bit', ['server', ...flags], {\n name: 'xterm-color',\n cols: 80,\n rows: 30,\n cwd: process.cwd(),\n env: process.env,\n });\n\n // Keep track of connected clients\n const clients: net.Socket[] = [];\n\n let didGetClient = false;\n let outputNotForClients = false;\n\n // @ts-ignore\n ptyProcess.on('data', (data) => {\n if (!clients.length) outputNotForClients = data.toString();\n // Forward data from the ptyProcess to connected clients\n // console.log('ptyProcess data:', data.toString());\n clients.forEach((socket) => {\n socket.write(data);\n });\n });\n\n // Create a TCP server\n const server = net.createServer((socket) => {\n console.log('Client connected.');\n didGetClient = true;\n clients.push(socket);\n\n // Forward data from the client to the ptyProcess\n socket.on('data', (data: any) => {\n // console.log('Server received data from client:', data.toString());\n if (data.toString('hex') === '03') {\n // User hit Ctrl+C\n ptyProcess.kill();\n } else {\n ptyProcess.write(data);\n }\n });\n\n // Handle client disconnect\n socket.on('end', () => {\n console.log('Client disconnected.');\n const index = clients.indexOf(socket);\n if (index !== -1) {\n clients.splice(index, 1);\n }\n });\n\n // Handle socket errors\n socket.on('error', (err) => {\n console.error('Socket error:', err);\n const index = clients.indexOf(socket);\n if (index !== -1) {\n clients.splice(index, 1);\n }\n });\n });\n\n const PORT = getSocketPort();\n\n server.on('error', (err: any) => {\n if (err.code === 'EADDRINUSE') {\n const pid = getPidByPort(PORT);\n const usedByPid = pid ? ` (used by PID ${pid})` : '';\n const killCmd = pid ? `\\nAlternatively, you can kill the process by running \"kill ${pid}\".` : '';\n console.error(`Error: Port ${PORT} is already in use${usedByPid}.\nThis port is assigned based on the workspace path: '${process.cwd()}'\nThis means another instance may already be running in this workspace.\n\\nTo resolve this issue:\n- If another instance is running, please stop it before starting a new one.\n If a vscode is open on this workspace, it might be running the server. Close it.${killCmd}\n- If no other instance is running, the port may be occupied by another application.\n You can override the default port by setting the 'BIT_CLI_SERVER_SOCKET_PORT' environment variable.\n`);\n process.exit(1); // Exit the process with an error code\n } else {\n console.error('Server encountered an error:', err);\n process.exit(1);\n }\n });\n\n server.listen(PORT, () => {\n console.log(`Socket listening on port ${PORT}`);\n });\n\n // @ts-ignore\n ptyProcess.on('exit', (code, signal) => {\n server.close();\n if (didGetClient) {\n console.log(`PTY exited with code ${code} and signal ${signal}`);\n setTimeout(() => {\n console.log('Restarting the PTY process...');\n spawnPTY(); // Restart the PTY process\n }, 100);\n } else {\n console.error(`Failed to start the PTY Process. Error: ${outputNotForClients}`);\n }\n });\n}\n\nexport function getSocketPort(): number {\n return process.env.BIT_CLI_SERVER_SOCKET_PORT\n ? parseInt(process.env.BIT_CLI_SERVER_SOCKET_PORT)\n : getPortFromPath(process.cwd());\n}\n\n/**\n * it's easier to generate a random port based on the workspace path than to save it in a file\n */\nexport function getPortFromPath(path: string): number {\n // Step 1: Hash the workspace path using MD5\n const hash = crypto.createHash('md5').update(path).digest('hex');\n\n // Step 2: Convert a portion of the hash to an integer\n // We'll use the first 8 characters (32 bits)\n const hashInt = parseInt(hash.substring(0, 8), 16);\n\n // Step 3: Map the integer to the port range 49152 to 65535 (these are dynamic ports not assigned by IANA)\n const minPort = 49152;\n const maxPort = 65535;\n const portRange = maxPort - minPort + 1;\n\n const port = (hashInt % portRange) + minPort;\n\n return port;\n}\n\nfunction getPidByPort(port: number): string | null {\n const platform = process.platform;\n try {\n if (platform === 'darwin' || platform === 'linux') {\n // For macOS and Linux\n const cmd = `lsof -iTCP:${port} -sTCP:LISTEN -n -P`;\n const stdout = execSync(cmd).toString();\n const lines = stdout.trim().split('\\n');\n\n if (lines.length > 1) {\n // Skip the header line and parse the first result\n const columns = lines[1].split(/\\s+/);\n const pid = columns[1];\n return pid;\n }\n } else if (platform === 'win32') {\n // For Windows\n const cmd = `netstat -ano -p tcp`;\n const stdout = execSync(cmd).toString();\n const lines = stdout.trim().split('\\n');\n\n for (const line of lines) {\n if (line.trim().startsWith('TCP')) {\n const columns = line.trim().split(/\\s+/);\n const localAddress = columns[1];\n const pid = columns[4];\n\n if (localAddress.endsWith(`:${port}`)) {\n return pid;\n }\n }\n }\n } else {\n console.error('Unsupported platform:', platform);\n }\n } catch (error: any) {\n console.error('Error executing command:', error.message);\n }\n return null;\n}\n"],"mappings":";;;;;;;;AASA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,eAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,cAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyC,SAAAC,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAZzC;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAOO,SAASG,QAAQA,CAAA,EAAG;EACzB;EACA;EACA,MAAMC,KAAK,GAAGC,OAAO,CAACC,IAAI,CAACC,KAAK,CAAC,CAAC,CAAC,CAACC,MAAM,CAAEC,GAAG,IAAKA,GAAG,CAACC,UAAU,CAAC,GAAG,CAAC,CAAC;EACxE,MAAMC,UAAU,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,CAAC,CAAC;UAC/B,MAAM/B,GAAG,GAAG+B,OAAO,CAAC,CAAC,CAAC;UAEtB,IAAIE,YAAY,CAACC,QAAQ,CAAC,IAAIX,IAAI,EAAE,CAAC,EAAE;YACrC,OAAOvB,GAAG;UACZ;QACF;MACF;IACF,CAAC,MAAM;MACLZ,OAAO,CAACQ,KAAK,CAAC,uBAAuB,EAAE4B,QAAQ,CAAC;IAClD;EACF,CAAC,CAAC,OAAO5B,KAAU,EAAE;IACnBR,OAAO,CAACQ,KAAK,CAAC,0BAA0B,EAAEA,KAAK,CAACuC,OAAO,CAAC;EAC1D;EACA,OAAO,IAAI;AACb","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_net","data","_interopRequireDefault","require","_crypto","_child_process","_nodePty","e","__esModule","default","spawnPTY","flags","process","argv","slice","filter","arg","startsWith","ptyProcess","spawn","name","cols","rows","cwd","env","clients","didGetClient","outputNotForClients","on","length","toString","forEach","socket","write","server","net","createServer","console","log","push","kill","index","indexOf","splice","err","error","PORT","getSocketPort","code","pid","getPidByPort","usedByPid","killCmd","exit","listen","signal","close","setTimeout","BIT_CLI_SERVER_SOCKET_PORT","parseInt","getPortFromPath","path","hash","crypto","createHash","update","digest","hashInt","substring","minPort","maxPort","portRange","port","consoleErrors","platform","cmd","stdout","execSync","lines","trim","split","columns","line","localAddress","endsWith","message"],"sources":["server-forever.ts"],"sourcesContent":["/**\n * see the docs of server-commander.ts for more info\n * this \"server-forever\" command is used to run the bit server in a way that it will never stop. if it gets killed,\n * it will restart itself.\n * it spawns \"bit server\" using node-pty for a pseudo-terminal (PTY) in order for libs such as inquirer/ora/chalk to work properly.\n */\n\n/* eslint-disable no-console */\n\nimport net from 'net';\nimport crypto from 'crypto';\nimport { execSync } from 'child_process';\nimport { spawn } from '@lydell/node-pty';\n\nexport function spawnPTY() {\n // Create a PTY (terminal emulation) running the 'bit server' process\n // this way, we can catch terminal sequences like arrows, ctrl+c, etc.\n const flags = process.argv.slice(2).filter((arg) => arg.startsWith('-'));\n const ptyProcess = spawn('bit', ['server', ...flags], {\n name: 'xterm-color',\n cols: 80,\n rows: 30,\n cwd: process.cwd(),\n env: process.env,\n });\n\n // Keep track of connected clients\n const clients: net.Socket[] = [];\n\n let didGetClient = false;\n let outputNotForClients = false;\n\n // @ts-ignore\n ptyProcess.on('data', (data) => {\n if (!clients.length) outputNotForClients = data.toString();\n // Forward data from the ptyProcess to connected clients\n // console.log('ptyProcess data:', data.toString());\n clients.forEach((socket) => {\n socket.write(data);\n });\n });\n\n // Create a TCP server\n const server = net.createServer((socket) => {\n console.log('Client connected.');\n didGetClient = true;\n clients.push(socket);\n\n // Forward data from the client to the ptyProcess\n socket.on('data', (data: any) => {\n // console.log('Server received data from client:', data.toString());\n if (data.toString('hex') === '03') {\n // User hit Ctrl+C\n ptyProcess.kill();\n } else {\n ptyProcess.write(data);\n }\n });\n\n // Handle client disconnect\n socket.on('end', () => {\n console.log('Client disconnected.');\n const index = clients.indexOf(socket);\n if (index !== -1) {\n clients.splice(index, 1);\n }\n });\n\n // Handle socket errors\n socket.on('error', (err) => {\n console.error('Socket error:', err);\n const index = clients.indexOf(socket);\n if (index !== -1) {\n clients.splice(index, 1);\n }\n });\n });\n\n const PORT = getSocketPort();\n\n server.on('error', (err: any) => {\n if (err.code === 'EADDRINUSE') {\n const pid = getPidByPort(PORT, true);\n const usedByPid = pid ? ` (used by PID ${pid})` : '';\n const killCmd = pid ? `\\nAlternatively, you can kill the process by running \"kill ${pid}\".` : '';\n console.error(`Error: Port ${PORT} is already in use${usedByPid}.\nThis port is assigned based on the workspace path: '${process.cwd()}'\nThis means another instance may already be running in this workspace.\n\\nTo resolve this issue:\n- If another instance is running, please stop it before starting a new one.\n If a vscode is open on this workspace, it might be running the server. Close it.${killCmd}\n- If no other instance is running, the port may be occupied by another application.\n You can override the default port by setting the 'BIT_CLI_SERVER_SOCKET_PORT' environment variable.\n`);\n process.exit(1); // Exit the process with an error code\n } else {\n console.error('Server encountered an error:', err);\n process.exit(1);\n }\n });\n\n server.listen(PORT, () => {\n console.log(`Socket listening on port ${PORT}`);\n });\n\n // @ts-ignore\n ptyProcess.on('exit', (code, signal) => {\n server.close();\n if (didGetClient) {\n console.log(`PTY exited with code ${code} and signal ${signal}`);\n setTimeout(() => {\n console.log('Restarting the PTY process...');\n spawnPTY(); // Restart the PTY process\n }, 100);\n } else {\n console.error(`Failed to start the PTY Process. Error: ${outputNotForClients}`);\n }\n });\n}\n\nexport function getSocketPort(): number {\n return process.env.BIT_CLI_SERVER_SOCKET_PORT\n ? parseInt(process.env.BIT_CLI_SERVER_SOCKET_PORT)\n : getPortFromPath(process.cwd());\n}\n\n/**\n * it's easier to generate a random port based on the workspace path than to save it in a file\n */\nexport function getPortFromPath(path: string): number {\n // Step 1: Hash the workspace path using MD5\n const hash = crypto.createHash('md5').update(path).digest('hex');\n\n // Step 2: Convert a portion of the hash to an integer\n // We'll use the first 8 characters (32 bits)\n const hashInt = parseInt(hash.substring(0, 8), 16);\n\n // Step 3: Map the integer to the port range 49152 to 65535 (these are dynamic ports not assigned by IANA)\n const minPort = 49152;\n const maxPort = 65535;\n const portRange = maxPort - minPort + 1;\n\n const port = (hashInt % portRange) + minPort;\n\n return port;\n}\n\nexport function getPidByPort(port: number, consoleErrors = false): string | null {\n const platform = process.platform;\n try {\n if (platform === 'darwin' || platform === 'linux') {\n // For macOS and Linux\n const cmd = `lsof -iTCP:${port} -sTCP:LISTEN -n -P`;\n const stdout = execSync(cmd).toString();\n const lines = stdout.trim().split('\\n');\n\n if (lines.length > 1) {\n // Skip the header line and parse the first result\n const columns = lines[1].split(/\\s+/);\n const pid = columns[1];\n return pid;\n }\n } else if (platform === 'win32') {\n // For Windows\n const cmd = `netstat -ano -p tcp`;\n const stdout = execSync(cmd).toString();\n const lines = stdout.trim().split('\\n');\n\n for (const line of lines) {\n if (line.trim().startsWith('TCP')) {\n const columns = line.trim().split(/\\s+/);\n const localAddress = columns[1];\n const pid = columns[4];\n\n if (localAddress.endsWith(`:${port}`)) {\n return pid;\n }\n }\n }\n } else {\n if (consoleErrors) console.error('Unsupported platform:', platform);\n }\n } catch (error: any) {\n if (consoleErrors) console.error('Error executing command:', error.message);\n }\n return null;\n}\n"],"mappings":";;;;;;;;;AASA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,eAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,cAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyC,SAAAC,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAZzC;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAOO,SAASG,QAAQA,CAAA,EAAG;EACzB;EACA;EACA,MAAMC,KAAK,GAAGC,OAAO,CAACC,IAAI,CAACC,KAAK,CAAC,CAAC,CAAC,CAACC,MAAM,CAAEC,GAAG,IAAKA,GAAG,CAACC,UAAU,CAAC,GAAG,CAAC,CAAC;EACxE,MAAMC,UAAU,GAAG,IAAAC,gBAAK,EAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,GAAGR,KAAK,CAAC,EAAE;IACpDS,IAAI,EAAE,aAAa;IACnBC,IAAI,EAAE,EAAE;IACRC,IAAI,EAAE,EAAE;IACRC,GAAG,EAAEX,OAA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C,OAAOvB,GAAG;UACZ;QACF;MACF;IACF,CAAC,MAAM;MACL,IAAIwB,aAAa,EAAEpC,OAAO,CAACQ,KAAK,CAAC,uBAAuB,EAAE6B,QAAQ,CAAC;IACrE;EACF,CAAC,CAAC,OAAO7B,KAAU,EAAE;IACnB,IAAI4B,aAAa,EAAEpC,OAAO,CAACQ,KAAK,CAAC,0BAA0B,EAAEA,KAAK,CAACwC,OAAO,CAAC;EAC7E;EACA,OAAO,IAAI;AACb","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/bit",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.13",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/harmony/bit",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.harmony",
|
|
8
8
|
"name": "bit",
|
|
9
|
-
"version": "1.9.
|
|
9
|
+
"version": "1.9.13"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"graceful-fs": "4.2.10",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@teambit/ui-foundation.ui.navigation.react-router-adapter": "6.1.1",
|
|
51
51
|
"@teambit/base-react.navigation.link": "2.0.31",
|
|
52
52
|
"@teambit/cli": "0.0.1070",
|
|
53
|
-
"@teambit/harmony.content.cli-reference": "2.0.
|
|
53
|
+
"@teambit/harmony.content.cli-reference": "2.0.499",
|
|
54
54
|
"@teambit/legacy.extension-data": "0.0.7",
|
|
55
55
|
"@teambit/bit.get-bit-version": "0.0.2",
|
|
56
56
|
"@teambit/legacy.analytics": "0.0.61",
|