@teambit/aspect 1.0.209 → 1.0.211

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.
Files changed (28) hide show
  1. package/artifacts/__bit_junit.xml +1 -1
  2. package/artifacts/env-template/public/{310.26b43bf6f6658e87fc58.js → 310.cce1905f046ee1dd0586.js} +9 -9
  3. package/artifacts/env-template/public/{170.e2586eafaae3c27235b8.js → 441.58f47493f3e9c010f644.js} +3 -3
  4. package/artifacts/env-template/public/assets-manifest.json +12 -12
  5. package/artifacts/env-template/public/compositions.8b5a76602cc7b5244b11.js +17 -0
  6. package/artifacts/env-template/public/compositions.html +1 -1
  7. package/artifacts/env-template/public/{overview.7f2020e2faf28fb90687.js → overview.ac366c95df71b4561fed.js} +1 -1
  8. package/artifacts/env-template/public/overview.html +1 -1
  9. package/artifacts/env-template/public/{peers.580f6e41a3e1b99312b7.js → peers.98ab6662222093010856.js} +1 -1
  10. package/artifacts/env-template/public/{preview-root.1a09ddf180be0092f126.js → preview-root.78ff8f75b62ba742b433.js} +1 -1
  11. package/artifacts/preview/teambit_harmony_aspect-preview.js +1 -1
  12. package/artifacts/schema.json +7 -7
  13. package/dist/aspect.cmd.js +1 -1
  14. package/dist/aspect.cmd.js.map +1 -1
  15. package/dist/aspect.env.js +1 -1
  16. package/dist/aspect.env.js.map +1 -1
  17. package/dist/aspect.main.runtime.js +1 -1
  18. package/dist/aspect.main.runtime.js.map +1 -1
  19. package/dist/aspect.ui.runtime.js +1 -1
  20. package/dist/aspect.ui.runtime.js.map +1 -1
  21. package/dist/core-exporter.task.js +1 -1
  22. package/dist/core-exporter.task.js.map +1 -1
  23. package/dist/jest/jest.config.js +1 -1
  24. package/dist/{preview-1711509617758.js → preview-1711682321261.js} +2 -2
  25. package/package.json +25 -25
  26. package/artifacts/env-template/public/compositions.172e448288eca744944e.js +0 -17
  27. /package/{compositions-1711509617758.js → compositions-1711682321261.js} +0 -0
  28. /package/{overview-1711509617758.js → overview-1711682321261.js} +0 -0
@@ -1,25 +1,25 @@
1
1
  {
2
- "170.e2586eafaae3c27235b8.js": "170.e2586eafaae3c27235b8.js",
3
- "310.26b43bf6f6658e87fc58.js": "310.26b43bf6f6658e87fc58.js",
2
+ "310.cce1905f046ee1dd0586.js": "310.cce1905f046ee1dd0586.js",
3
+ "441.58f47493f3e9c010f644.js": "441.58f47493f3e9c010f644.js",
4
4
  "700.f5fce5db582bd65bc0df.js": "700.f5fce5db582bd65bc0df.js",
5
5
  "851.d2664a57f5d46b636e5f.js": "851.d2664a57f5d46b636e5f.js",
6
6
  "compositions.css": "static/css/compositions.2a7f63f9.css",
7
7
  "compositions.html": "compositions.html",
8
- "compositions.js": "compositions.172e448288eca744944e.js",
8
+ "compositions.js": "compositions.8b5a76602cc7b5244b11.js",
9
9
  "entrypoints": {
10
10
  "peers": {
11
11
  "assets": {
12
12
  "js": [
13
13
  "851.d2664a57f5d46b636e5f.js",
14
- "peers.580f6e41a3e1b99312b7.js"
14
+ "peers.98ab6662222093010856.js"
15
15
  ]
16
16
  }
17
17
  },
18
18
  "preview-root": {
19
19
  "assets": {
20
20
  "js": [
21
- "170.e2586eafaae3c27235b8.js",
22
- "preview-root.1a09ddf180be0092f126.js"
21
+ "441.58f47493f3e9c010f644.js",
22
+ "preview-root.78ff8f75b62ba742b433.js"
23
23
  ],
24
24
  "css": [
25
25
  "static/css/preview-root.5fd7d59d.css"
@@ -30,7 +30,7 @@
30
30
  "assets": {
31
31
  "js": [
32
32
  "700.f5fce5db582bd65bc0df.js",
33
- "compositions.172e448288eca744944e.js"
33
+ "compositions.8b5a76602cc7b5244b11.js"
34
34
  ],
35
35
  "css": [
36
36
  "static/css/compositions.2a7f63f9.css"
@@ -40,8 +40,8 @@
40
40
  "overview": {
41
41
  "assets": {
42
42
  "js": [
43
- "310.26b43bf6f6658e87fc58.js",
44
- "overview.7f2020e2faf28fb90687.js"
43
+ "310.cce1905f046ee1dd0586.js",
44
+ "overview.ac366c95df71b4561fed.js"
45
45
  ],
46
46
  "css": [
47
47
  "static/css/310.cdd78dee.css"
@@ -50,9 +50,9 @@
50
50
  }
51
51
  },
52
52
  "overview.html": "overview.html",
53
- "overview.js": "overview.7f2020e2faf28fb90687.js",
54
- "peers.js": "peers.580f6e41a3e1b99312b7.js",
53
+ "overview.js": "overview.ac366c95df71b4561fed.js",
54
+ "peers.js": "peers.98ab6662222093010856.js",
55
55
  "preview-root.css": "static/css/preview-root.5fd7d59d.css",
56
- "preview-root.js": "preview-root.1a09ddf180be0092f126.js",
56
+ "preview-root.js": "preview-root.78ff8f75b62ba742b433.js",
57
57
  "static/css/310.cdd78dee.css": "static/css/310.cdd78dee.css"
58
58
  }
@@ -0,0 +1,17 @@
1
+ "use strict";(self.__loadChunks_EnvTemplate=self.__loadChunks_EnvTemplate||[]).push([[384],{72067:(__unused_webpack_module,exports)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.BitBaseEvent=void 0;class BitBaseEvent{constructor(type,version,timestamp,data){this.type=type,this.version=version,this.timestamp=timestamp,this.data=data}}exports.BitBaseEvent=BitBaseEvent},24605:(__unused_webpack_module,exports,__webpack_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"BitBaseEvent",{enumerable:!0,get:function(){return _bitBaseEvent().BitBaseEvent}}),Object.defineProperty(exports,"PubsubAspect",{enumerable:!0,get:function(){return _pubsub().PubsubAspect}}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return _pubsub().PubsubAspect}}),Object.defineProperty(exports,"usePubSub",{enumerable:!0,get:function(){return _pubsubContext().usePubSub}}),Object.defineProperty(exports,"usePubSubIframe",{enumerable:!0,get:function(){return _pubsubContext().usePubSubIframe}});function _pubsub(){const data=__webpack_require__(66053);return _pubsub=function(){return data},data}function _bitBaseEvent(){const data=__webpack_require__(72067);return _bitBaseEvent=function(){return data},data}function _pubsubContext(){const data=__webpack_require__(68543);return _pubsubContext=function(){return data},data}},68543:(__unused_webpack_module,exports,__webpack_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.createProvider=createProvider,exports.pubsubRegistry=void 0,exports.usePubSub=usePubSub,exports.usePubSubIframe=usePubSubIframe;function _react(){const data=_interopRequireWildcard(__webpack_require__(59496));return _react=function(){return data},data}function _getRequireWildcardCache(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function(e2){return e2?t:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(u!=="default"&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}const pubsubRegistry=exports.pubsubRegistry=(0,_react().createContext)(void 0);function createProvider(pubSubContext){return({children})=>_react().default.createElement(pubsubRegistry.Provider,{value:pubSubContext},children)}function usePubSub(){return(0,_react().useContext)(pubsubRegistry)}function usePubSubIframe(ref){const pubSub=usePubSub();(0,_react().useEffect)(()=>{if(!ref?.current||!pubSub)return()=>{};const destroyConnection=pubSub.connect(ref.current);return()=>destroyConnection()},[ref?.current,pubSub])}},66053:(__unused_webpack_module,exports,__webpack_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.PubsubAspect=void 0;function _harmony(){const data=__webpack_require__(25217);return _harmony=function(){return data},data}const PubsubAspect=exports.PubsubAspect=_harmony().Aspect.create({id:"teambit.harmony/pubsub",dependencies:[]});var _default=exports.default=PubsubAspect},61178:(__unused_webpack_module,exports,__webpack_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.ClickInsideAnIframeEvent=void 0;function _pubsub(){const data=__webpack_require__(24605);return _pubsub=function(){return data},data}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return typeof i=="symbol"?i:i+""}function _toPrimitive(t,r){if(typeof t!="object"||!t)return t;var e=t[Symbol.toPrimitive];if(e!==void 0){var i=e.call(t,r||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}class ClickInsideAnIframeEventData{constructor(clickEvent){this.clickEvent=clickEvent}}class ClickInsideAnIframeEvent extends _pubsub().BitBaseEvent{constructor(timestamp=Date.now(),clickEvent){super(ClickInsideAnIframeEvent.TYPE,"0.0.1",timestamp,new ClickInsideAnIframeEventData(clickEvent));this.timestamp=timestamp,this.clickEvent=clickEvent}}exports.ClickInsideAnIframeEvent=ClickInsideAnIframeEvent,_defineProperty(ClickInsideAnIframeEvent,"TYPE","click-inside-an-iframe")},32521:(__unused_webpack_module,exports,__webpack_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0});var _clickInsideAnIframe=__webpack_require__(61178);Object.keys(_clickInsideAnIframe).forEach(function(key){key==="default"||key==="__esModule"||key in exports&&exports[key]===_clickInsideAnIframe[key]||Object.defineProperty(exports,key,{enumerable:!0,get:function(){return _clickInsideAnIframe[key]}})})},55993:(__unused_webpack_module,exports)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.BundlingStrategyNotFound=void 0;class BundlingStrategyNotFound extends Error{constructor(strategyName){super(`bundling strategy with name ${strategyName} was not found`);this.strategyName=strategyName}}exports.BundlingStrategyNotFound=BundlingStrategyNotFound},95066:(__unused_webpack_module,exports,__webpack_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"BundlingStrategyNotFound",{enumerable:!0,get:function(){return _bundlingStrategyNotFound().BundlingStrategyNotFound}}),Object.defineProperty(exports,"PreviewArtifactNotFound",{enumerable:!0,get:function(){return _previewArtifactNotFound().PreviewArtifactNotFound}}),Object.defineProperty(exports,"PreviewNotFound",{enumerable:!0,get:function(){return _previewNotFound().PreviewNotFound}}),Object.defineProperty(exports,"PreviewOutputFileNotFound",{enumerable:!0,get:function(){return _previewOutputFileNotFound().PreviewOutputFileNotFound}});function _previewNotFound(){const data=__webpack_require__(62062);return _previewNotFound=function(){return data},data}function _previewArtifactNotFound(){const data=__webpack_require__(7116);return _previewArtifactNotFound=function(){return data},data}function _bundlingStrategyNotFound(){const data=__webpack_require__(55993);return _bundlingStrategyNotFound=function(){return data},data}function _previewOutputFileNotFound(){const data=__webpack_require__(18722);return _previewOutputFileNotFound=function(){return data},data}},7116:(__unused_webpack_module,exports,__webpack_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.PreviewArtifactNotFound=void 0;function _bitError(){const data=__webpack_require__(75345);return _bitError=function(){return data},data}class PreviewArtifactNotFound extends _bitError().BitError{constructor(componentId){super(`preview for component ${componentId.toString()} was not found`)}}exports.PreviewArtifactNotFound=PreviewArtifactNotFound},62062:(__unused_webpack_module,exports)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.PreviewNotFound=void 0;class PreviewNotFound extends Error{constructor(name){super(`Preview for name: ${name} was not found`)}}exports.PreviewNotFound=PreviewNotFound},18722:(__unused_webpack_module,exports,__webpack_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.PreviewOutputFileNotFound=void 0;function _bitError(){const data=__webpack_require__(75345);return _bitError=function(){return data},data}class PreviewOutputFileNotFound extends _bitError().BitError{constructor(componentId,filePath){super(`preview output file for component: "${componentId.toString()}" was not found in the path: "${filePath}".
2
+
3
+ This is usually a result of an error during the bundling process.
4
+ The error might be an error of another component that uses the same env.
5
+ Run "bit build" with "--dev" to see more info.
6
+ Run "bit envs" to see other components that uses the same env`)}}exports.PreviewOutputFileNotFound=PreviewOutputFileNotFound},47517:(__unused_webpack_module,exports,__webpack_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.fetchComponentAspects=fetchComponentAspects;function _graphqlRequest(){const data=__webpack_require__(80507);return _graphqlRequest=function(){return data},data}const GQL_SERVER="/graphql",GET_COMPONENT_ASPECTS=(0,_graphqlRequest().gql)`
7
+ query getComponentAspects($id: String!) {
8
+ getHost {
9
+ id
10
+ get(id: $id) {
11
+ aspects {
12
+ id
13
+ }
14
+ }
15
+ }
16
+ }
17
+ `;async function fetchComponentAspects(componentId){try{return(await(0,_graphqlRequest().request)(GQL_SERVER,GET_COMPONENT_ASPECTS,{id:componentId.toString()})).getHost.get.aspects.map(x=>x.id)}catch(err){console.error(`[gql] error on "getComponentAspects" - "${err.toString()}"`);return}}},60511:(__unused_webpack_module,exports)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.loadLink=loadLink,exports.loadScript=loadScript;function loadScript({src}){return new Promise((resolve,reject)=>{const script=document.createElement("script");script.setAttribute("defer","defer"),script.src=src,script.onload=()=>resolve(),script.onerror=(message,_,_1,_2,error)=>reject(error||new Error(`[preview.preview] failed to load script: ${message}`)),document.head.appendChild(script)})}function loadLink({href}){return new Promise((resolve,reject)=>{const link=document.createElement("link");href.endsWith(".css")&&link.setAttribute("rel","stylesheet"),link.setAttribute("href",href),link.onload=()=>resolve(),link.onerror=(message,_,_1,_2,error)=>reject(error||new Error(`[preview.preview] failed to load link: ${message}`)),document.head.appendChild(link)})}},38502:(__unused_webpack_module,exports,__webpack_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"PREVIEW_MODULES",{enumerable:!0,get:function(){return _previewModules().PREVIEW_MODULES}}),Object.defineProperty(exports,"PreviewModules",{enumerable:!0,get:function(){return _previewModules().PreviewModules}}),Object.defineProperty(exports,"linkModules",{enumerable:!0,get:function(){return _previewModules().linkModules}});function _previewModules(){const data=__webpack_require__(54710);return _previewModules=function(){return data},data}},96347:(__unused_webpack_module,exports,__webpack_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.PreviewRuntime=exports.PreviewAspect=void 0;function _harmony(){const data=__webpack_require__(25217);return _harmony=function(){return data},data}const PreviewRuntime=exports.PreviewRuntime=new(_harmony()).RuntimeDefinition("preview"),PreviewAspect=exports.PreviewAspect=_harmony().Aspect.create({id:"teambit.preview/preview",dependencies:[],defaultConfig:{},declareRuntime:PreviewRuntime});var _default=exports.default=PreviewAspect},62598:(__unused_webpack_module,exports,__webpack_require__)=>{var __webpack_unused_export__;__webpack_unused_export__={value:!0},__webpack_unused_export__=void 0,Object.defineProperty(exports,"Bu",{enumerable:!0,get:function(){return _previewModules().linkModules}});function _pubsub(){const data=__webpack_require__(24605);return _pubsub=function(){return data},data}function _harmony(){const data=__webpack_require__(25217);return _harmony=function(){return data},data}function _componentId(){const data=__webpack_require__(83947);return _componentId=function(){return data},data}function _crossFetch(){const data=_interopRequireDefault(__webpack_require__(6));return _crossFetch=function(){return data},data}function _memoizee(){const data=_interopRequireDefault(__webpack_require__(94300));return _memoizee=function(){return data},data}function _lodash(){const data=__webpack_require__(58822);return _lodash=function(){return data},data}function _exceptions(){const data=__webpack_require__(95066);return _exceptions=function(){return data},data}function _preview(){const data=__webpack_require__(96347);return _preview=function(){return data},data}function _events(){const data=__webpack_require__(32521);return _events=function(){return data},data}function _renderingContext(){const data=__webpack_require__(99017);return _renderingContext=function(){return data},data}function _fetchComponentAspects(){const data=__webpack_require__(47517);return _fetchComponentAspects=function(){return data},data}function _previewModules(){const data=__webpack_require__(38502);return _previewModules=function(){return data},data}function _htmlUtils(){const data=__webpack_require__(60511);return _htmlUtils=function(){return data},data}function _sizeEvent(){const data=__webpack_require__(80230);return _sizeEvent=function(){return data},data}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return typeof i=="symbol"?i:i+""}function _toPrimitive(t,r){if(typeof t!="object"||!t)return t;var e=t[Symbol.toPrimitive];if(e!==void 0){var i=e.call(t,r||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}class PreviewPreview{constructor(pubsub,previewSlot,renderingContextSlot){this.pubsub=pubsub,this.previewSlot=previewSlot,this.renderingContextSlot=renderingContextSlot,_defineProperty(this,"isDev",!1),_defineProperty(this,"_setupPromise",void 0),_defineProperty(this,"setup",()=>this.isReady()?Promise.resolve():(this._setupPromise??=new Promise(resolve=>{_previewModules().PREVIEW_MODULES.onSet.add(()=>{this.isReady()&&resolve()})}),this._setupPromise)),_defineProperty(this,"render",async rootExt=>{window.document.body.style.width="fit-content";const{previewName,componentId,envId}=this.getLocation(),name=previewName||this.getDefault();rootExt&&(this.isDev=rootExt==="teambit.workspace/workspace");const preview=this.getPreview(name);if(!preview||!componentId)throw new(_exceptions()).PreviewNotFound(previewName);const includesAll=await Promise.all((preview.include||[]).map(async inclPreviewName=>{const includedPreview=this.getPreview(inclPreviewName);if(!includedPreview)return;const inclPreviewModule=await this.getPreviewModule(inclPreviewName,componentId);return includedPreview.selectPreviewModel?.(componentId.fullName,inclPreviewModule)})),query=this.getQuery(),includes=this.getParam(query,"onlyOverview")==="true"?[]:includesAll.filter(module=>!!module).map(module=>{if(!module.default||!(0,_lodash().isObject)(module.default))return module;const keysWithoutDefault=Object.keys(module).filter(key=>key!=="default"),defaultKeys=Object.keys(module.default);return(0,_lodash().intersection)(keysWithoutDefault,defaultKeys).length===defaultKeys.length?module.default:module}),componentAspects=this.isDev?await this.getComponentAspects(componentId.toString()):void 0,previewModule=await this.getPreviewModule(name,componentId),render=preview.render(componentId,envId||"",previewModule,includes,this.getRenderingContext(componentAspects));return this.reportSize(),this.setViewport(),this.setFullScreen(),render}),_defineProperty(this,"getComponentAspects",(0,_memoizee().default)(_fetchComponentAspects().fetchComponentAspects,{max:100,maxAge:12*60*60*1e3})),this.registerClickPubSub()}registerClickPubSub(){window.addEventListener("click",e=>{const timestamp=Date.now(),clickEvent=Object.assign({},e);this.pubsub.pub(_preview().PreviewAspect.id,new(_events()).ClickInsideAnIframeEvent(timestamp,clickEvent))})}isReady(){const{previewName}=this.getLocation(),name=previewName||this.getDefault();if(!_previewModules().PREVIEW_MODULES.has(name))return!1;const preview=this.getPreview(name);return!(!preview||!(preview.include?.every(included=>_previewModules().PREVIEW_MODULES.has(included))??!0))}setFullScreen(){const query=this.getQuery();if(!this.getParam(query,"fullscreen"))return;const root=window.document.getElementById("root");root&&(root.style.height="100vh")}setViewport(){const query=this.getQuery(),viewPort=this.getParam(query,"viewport");if(!viewPort){window.document.body.style.width="100%";return}window.document.body.style.maxWidth=`${viewPort}px`}reportSize(){if(!window?.parent||!window?.document)return;const sendPubsubEvent=()=>{this.pubsub.pub(_preview().PreviewAspect.id,new(_sizeEvent()).SizeEvent({width:window.document.body.offsetWidth,height:window.document.body.offsetHeight}))};window.document.body.addEventListener("resize",(0,_lodash().debounce)(sendPubsubEvent,300));let counter=0;const interval=setInterval(()=>{if(counter+=1,counter>10){clearInterval(interval);return}this.pubsub.pub(_preview().PreviewAspect.id,new(_sizeEvent()).SizeEvent({width:window.document.body.offsetWidth,height:window.document.body.offsetHeight}))},200)}async getPreviewModule(previewName,id){const compShortId=id.fullName,relevantModel=_previewModules().PREVIEW_MODULES.get(previewName);if(!relevantModel)throw new Error(`[preview.preview] missing preview "${previewName}"`);if(relevantModel.componentMap[compShortId])return relevantModel;const componentPreviews=await this.fetchComponentPreview(id,previewName);_previewModules().PREVIEW_MODULES.loadComponentPreviews(compShortId,componentPreviews);const component=componentPreviews[previewName],metadata=componentPreviews[`${previewName}_metadata`];return{modulesMap:relevantModel.modulesMap,componentMap:{[id.fullName]:component},componentMapMetadata:{[id.fullName]:metadata}}}async fetchComponentPreview(id,name){let previewFile;const allFiles=await this.fetchComponentPreviewFiles(id,name);return allFiles===null?{}:(await Promise.all(allFiles.map(file=>{if(file.endsWith("-preview.js")){previewFile=file;return}return this.addComponentFileElement(id,file)})),previewFile?this.loadPreviewScript(id,name,previewFile):{})}addComponentFileElement(id,previewBundleFileName){if(previewBundleFileName.endsWith(".js"))return this.addComponentFileScriptElement(id,previewBundleFileName);this.addComponentFileLinkElement(id,previewBundleFileName).catch(err=>{throw new Error(`[preview.preview] failed loading asset "${previewBundleFileName}". Error - "${err?.toString()}"`)})}async fetchComponentPreviewFiles(id,previewName){const previewAssetsRoute="~aspect/preview-assets",url=`/api/${id.toString()}/${previewAssetsRoute}`,res=await(0,_crossFetch().default)(url);if(res.status>=400)throw new(_exceptions()).PreviewNotFound(previewName);const parsed=await res.json();if(parsed.isBundledWithEnv)return null;if(!parsed.files||!parsed.files.length)throw new(_exceptions()).PreviewNotFound(previewName);return parsed.files}addComponentFileScriptElement(id,previewBundleFileName){const previewRoute="~aspect/component-preview",src=`/api/${id.toString()}/${previewRoute}/${previewBundleFileName}`;return(0,_htmlUtils().loadScript)({src})}addComponentFileLinkElement(id,previewBundleFileName){const href=`/api/${id.toString()}/~aspect/component-preview/${previewBundleFileName}`;return(0,_htmlUtils().loadLink)({href})}async loadPreviewScript(id,previewName,previewBundleFileName){const previewRoute="~aspect/component-preview",src=`/api/${id.toString()}/${previewRoute}/${previewBundleFileName}`;await(0,_htmlUtils().loadScript)({src});const globalId=`${id.toStringWithoutVersion()}-preview`,componentPreview=window[globalId];if(!componentPreview)throw new(_exceptions()).PreviewNotFound(previewName);return componentPreview}registerPreview(preview){return this.previewSlot.register(preview),this}getRenderingContext(aspectsFilter){return new(_renderingContext()).RenderingContext(this.renderingContextSlot,{aspectsFilter})}registerRenderContext(renderContext){return this.renderingContextSlot.register(renderContext),this}getDefault(){const previews=this.previewSlot.values();return previews.find(previewCandidate=>previewCandidate.default)?.name||previews[0].name}getPreview(previewName){return this.previewSlot.values().find(previewCandidate=>previewCandidate.name===previewName)}getParam(query,param){return new URLSearchParams(query).get(param)}getQuery(){const withoutHash=window.location.hash.substring(1),[,after]=withoutHash.split("?");return after}getLocation(){const withoutHash=window.location.hash.substring(1),[before,after]=withoutHash.split("?");return{previewName:this.getParam(after,"preview"),envId:this.getParam(after,"env"),componentId:_componentId().ComponentID.tryFromString(before)}}static async provider([pubsub],config,[previewSlot,renderingContextSlot]){const preview=new PreviewPreview(pubsub,previewSlot,renderingContextSlot);return window.addEventListener("hashchange",()=>{preview.render()}),preview}}__webpack_unused_export__=PreviewPreview,_defineProperty(PreviewPreview,"runtime",_preview().PreviewRuntime),_defineProperty(PreviewPreview,"dependencies",[_pubsub().PubsubAspect]),_defineProperty(PreviewPreview,"slots",[_harmony().Slot.withType(),_harmony().Slot.withType()]),_preview().PreviewAspect.addRuntime(PreviewPreview)},99017:(__unused_webpack_module,exports)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderingContext=void 0;class RenderingContext{constructor(contexts,options={}){this.contexts=contexts,this.options=options}get(aspectId){return this.contexts.get(aspectId)?.(this.options)}}exports.RenderingContext=RenderingContext},80230:(__unused_webpack_module,exports,__webpack_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.SizeEvent=void 0;function _pubsub(){const data=__webpack_require__(24605);return _pubsub=function(){return data},data}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return typeof i=="symbol"?i:i+""}function _toPrimitive(t,r){if(typeof t!="object"||!t)return t;var e=t[Symbol.toPrimitive];if(e!==void 0){var i=e.call(t,r||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}class SizeEvent extends _pubsub().BitBaseEvent{constructor(sizeEvent){super(SizeEvent.TYPE,"0.0.1",new Date().getTime(),sizeEvent)}}exports.SizeEvent=SizeEvent,_defineProperty(SizeEvent,"TYPE","preview-size")},97844:(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{var _teambit_preview_dist_preview_preview_runtime_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(62598),_home_circleci_bit_bit_node_modules_teambit_react_ui_compositions_app_dist_index_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(5659),_home_circleci_bit_bit_node_modules_teambit_react_ui_compositions_app_dist_index_js__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_home_circleci_bit_bit_node_modules_teambit_react_ui_compositions_app_dist_index_js__WEBPACK_IMPORTED_MODULE_1__);(0,_teambit_preview_dist_preview_preview_runtime_js__WEBPACK_IMPORTED_MODULE_0__.Bu)("compositions",{modulesMap:{default:_home_circleci_bit_bit_node_modules_teambit_react_ui_compositions_app_dist_index_js__WEBPACK_IMPORTED_MODULE_1__},isSplitComponentBundle:!1,componentMap:{}})}},__webpack_require__=>{var __webpack_exec__=moduleId=>__webpack_require__(__webpack_require__.s=moduleId);__webpack_require__.O(0,[700,851,441,629],()=>__webpack_exec__(97844));var __webpack_exports__=__webpack_require__.O()}]);
@@ -1,2 +1,2 @@
1
1
  <!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Preview</title><script>// Allow to use react dev-tools inside the examples
2
- try { window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__; } catch {}</script><style>body { margin: 0; }</style><script defer="defer" src="851.d2664a57f5d46b636e5f.js"></script><script defer="defer" src="peers.580f6e41a3e1b99312b7.js"></script><script defer="defer" src="170.e2586eafaae3c27235b8.js"></script><script defer="defer" src="preview-root.1a09ddf180be0092f126.js"></script><script defer="defer" src="700.f5fce5db582bd65bc0df.js"></script><script defer="defer" src="compositions.172e448288eca744944e.js"></script><link href="static/css/preview-root.5fd7d59d.css" rel="stylesheet"><link href="static/css/compositions.2a7f63f9.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
2
+ try { window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__; } catch {}</script><style>body { margin: 0; }</style><script defer="defer" src="851.d2664a57f5d46b636e5f.js"></script><script defer="defer" src="peers.98ab6662222093010856.js"></script><script defer="defer" src="441.58f47493f3e9c010f644.js"></script><script defer="defer" src="preview-root.78ff8f75b62ba742b433.js"></script><script defer="defer" src="700.f5fce5db582bd65bc0df.js"></script><script defer="defer" src="compositions.8b5a76602cc7b5244b11.js"></script><link href="static/css/preview-root.5fd7d59d.css" rel="stylesheet"><link href="static/css/compositions.2a7f63f9.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
@@ -2,4 +2,4 @@
2
2
  `:`
3
3
  `,newline=/\r\n|\r|\n/g;function converts(text,to){if(Buffer.isBuffer(text)){if((0,_isbinaryfile().isBinaryFileSync)(text))return text;const str=text.toString(),strReplaced=str.replace(newline,to);return str!==strReplaced?Buffer.from(strReplaced):text}return text.toString().replace(newline,to)}function lf(text){return converts(text,`
4
4
  `)}function auto(text){return converts(text,lineBreak)}function cr(text){return converts(text,"\r")}function crlf(text){return converts(text,`\r
5
- `)}},30755:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getLatestVersion=getLatestVersion,exports.getValidVersionOrReleaseType=getValidVersionOrReleaseType,exports.isReleaseTypeSupported=isReleaseTypeSupported,exports.isStrReleaseType=isStrReleaseType,exports.throwForUnsupportedReleaseType=throwForUnsupportedReleaseType,exports.validateVersion=validateVersion;function _semver(){const data=__webpack_require__(9131);return _semver=function(){return data},data}function _componentVersion(){const data=__webpack_require__(22670);return _componentVersion=function(){return data},data}function isStrReleaseType(str){return["major","premajor","minor","preminor","patch","prepatch","prerelease"].includes(str)}function isReleaseTypeSupported(str){return["patch","minor","major","prerelease"].includes(str)}function throwForUnsupportedReleaseType(str){if(!isReleaseTypeSupported(str))throw new Error(`the release-type "${str}" is not supported`)}function validateVersion(version){if(version){const validVersion=(0,_semver().valid)(version);if(!validVersion)throw new(_componentVersion()).InvalidVersion(version);return validVersion}}function getValidVersionOrReleaseType(str){if(isStrReleaseType(str)){const releaseType=str;return throwForUnsupportedReleaseType(releaseType),{releaseType}}return{exactVersion:validateVersion(str)}}function getLatestVersion(versions){const max=(0,_semver().maxSatisfying)(versions,"*",{includePrerelease:!0});if(!max)throw new Error(`unable to find the latest version from ${versions.join(", ")}`);return max}},26752:(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";var _teambit_preview_dist_preview_preview_runtime_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(3767),_home_circleci_bit_bit_node_modules_teambit_react_ui_docs_app_dist_index_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(79022),_home_circleci_bit_bit_node_modules_teambit_react_ui_docs_app_dist_index_js__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_home_circleci_bit_bit_node_modules_teambit_react_ui_docs_app_dist_index_js__WEBPACK_IMPORTED_MODULE_1__);(0,_teambit_preview_dist_preview_preview_runtime_js__WEBPACK_IMPORTED_MODULE_0__.Bu)("overview",{modulesMap:{default:_home_circleci_bit_bit_node_modules_teambit_react_ui_docs_app_dist_index_js__WEBPACK_IMPORTED_MODULE_1__},isSplitComponentBundle:!1,componentMap:{}})},27127:()=>{},5010:()=>{},65660:()=>{},87942:()=>{},82880:()=>{}},__webpack_require__=>{var __webpack_exec__=moduleId=>__webpack_require__(__webpack_require__.s=moduleId);__webpack_require__.O(0,[310,851,170,629,700,384],()=>__webpack_exec__(26752));var __webpack_exports__=__webpack_require__.O()}]);
5
+ `)}},30755:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getLatestVersion=getLatestVersion,exports.getValidVersionOrReleaseType=getValidVersionOrReleaseType,exports.isReleaseTypeSupported=isReleaseTypeSupported,exports.isStrReleaseType=isStrReleaseType,exports.throwForUnsupportedReleaseType=throwForUnsupportedReleaseType,exports.validateVersion=validateVersion;function _semver(){const data=__webpack_require__(9131);return _semver=function(){return data},data}function _componentVersion(){const data=__webpack_require__(22670);return _componentVersion=function(){return data},data}function isStrReleaseType(str){return["major","premajor","minor","preminor","patch","prepatch","prerelease"].includes(str)}function isReleaseTypeSupported(str){return["patch","minor","major","prerelease"].includes(str)}function throwForUnsupportedReleaseType(str){if(!isReleaseTypeSupported(str))throw new Error(`the release-type "${str}" is not supported`)}function validateVersion(version){if(version){const validVersion=(0,_semver().valid)(version);if(!validVersion)throw new(_componentVersion()).InvalidVersion(version);return validVersion}}function getValidVersionOrReleaseType(str){if(isStrReleaseType(str)){const releaseType=str;return throwForUnsupportedReleaseType(releaseType),{releaseType}}return{exactVersion:validateVersion(str)}}function getLatestVersion(versions){const max=(0,_semver().maxSatisfying)(versions,"*",{includePrerelease:!0});if(!max)throw new Error(`unable to find the latest version from ${versions.join(", ")}`);return max}},31886:(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";var _teambit_preview_dist_preview_preview_runtime_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(62598),_home_circleci_bit_bit_node_modules_teambit_react_ui_docs_app_dist_index_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(79022),_home_circleci_bit_bit_node_modules_teambit_react_ui_docs_app_dist_index_js__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_home_circleci_bit_bit_node_modules_teambit_react_ui_docs_app_dist_index_js__WEBPACK_IMPORTED_MODULE_1__);(0,_teambit_preview_dist_preview_preview_runtime_js__WEBPACK_IMPORTED_MODULE_0__.Bu)("overview",{modulesMap:{default:_home_circleci_bit_bit_node_modules_teambit_react_ui_docs_app_dist_index_js__WEBPACK_IMPORTED_MODULE_1__},isSplitComponentBundle:!1,componentMap:{}})},27127:()=>{},5010:()=>{},65660:()=>{},87942:()=>{},82880:()=>{}},__webpack_require__=>{var __webpack_exec__=moduleId=>__webpack_require__(__webpack_require__.s=moduleId);__webpack_require__.O(0,[310,851,441,629,700,384],()=>__webpack_exec__(31886));var __webpack_exports__=__webpack_require__.O()}]);
@@ -1,2 +1,2 @@
1
1
  <!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Preview</title><script>// Allow to use react dev-tools inside the examples
2
- try { window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__; } catch {}</script><style>body { margin: 0; }</style><script defer="defer" src="851.d2664a57f5d46b636e5f.js"></script><script defer="defer" src="peers.580f6e41a3e1b99312b7.js"></script><script defer="defer" src="170.e2586eafaae3c27235b8.js"></script><script defer="defer" src="preview-root.1a09ddf180be0092f126.js"></script><script defer="defer" src="700.f5fce5db582bd65bc0df.js"></script><script defer="defer" src="compositions.172e448288eca744944e.js"></script><script defer="defer" src="310.26b43bf6f6658e87fc58.js"></script><script defer="defer" src="overview.7f2020e2faf28fb90687.js"></script><link href="static/css/preview-root.5fd7d59d.css" rel="stylesheet"><link href="static/css/compositions.2a7f63f9.css" rel="stylesheet"><link href="static/css/310.cdd78dee.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
2
+ try { window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__; } catch {}</script><style>body { margin: 0; }</style><script defer="defer" src="851.d2664a57f5d46b636e5f.js"></script><script defer="defer" src="peers.98ab6662222093010856.js"></script><script defer="defer" src="441.58f47493f3e9c010f644.js"></script><script defer="defer" src="preview-root.78ff8f75b62ba742b433.js"></script><script defer="defer" src="700.f5fce5db582bd65bc0df.js"></script><script defer="defer" src="compositions.8b5a76602cc7b5244b11.js"></script><script defer="defer" src="310.cce1905f046ee1dd0586.js"></script><script defer="defer" src="overview.ac366c95df71b4561fed.js"></script><link href="static/css/preview-root.5fd7d59d.css" rel="stylesheet"><link href="static/css/compositions.2a7f63f9.css" rel="stylesheet"><link href="static/css/310.cdd78dee.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
@@ -1 +1 @@
1
- (()=>{"use strict";var __webpack_modules__={96670:(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__2)=>{var react__WEBPACK_IMPORTED_MODULE_2___namespace_cache,react_dom__WEBPACK_IMPORTED_MODULE_3___namespace_cache,_teambit_mdx_ui_mdx_scope_context__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__2(81846),_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__2(49613),react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__2(59496),react_dom__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__2(87995),globalObj=window;guard("TeambitMdxUiMdxScopeContext",_teambit_mdx_ui_mdx_scope_context__WEBPACK_IMPORTED_MODULE_0__),guard("MdxJsReact",_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__),guard("React",react__WEBPACK_IMPORTED_MODULE_2___namespace_cache||(react__WEBPACK_IMPORTED_MODULE_2___namespace_cache=__webpack_require__2.t(react__WEBPACK_IMPORTED_MODULE_2__,2))),guard("ReactDom",react_dom__WEBPACK_IMPORTED_MODULE_3___namespace_cache||(react_dom__WEBPACK_IMPORTED_MODULE_3___namespace_cache=__webpack_require__2.t(react_dom__WEBPACK_IMPORTED_MODULE_3__,2))),globalObj.TeambitMdxUiMdxScopeContext=_teambit_mdx_ui_mdx_scope_context__WEBPACK_IMPORTED_MODULE_0__,globalObj.MdxJsReact=_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__,globalObj.React=react__WEBPACK_IMPORTED_MODULE_2___namespace_cache||(react__WEBPACK_IMPORTED_MODULE_2___namespace_cache=__webpack_require__2.t(react__WEBPACK_IMPORTED_MODULE_2__,2)),globalObj.ReactDom=react_dom__WEBPACK_IMPORTED_MODULE_3___namespace_cache||(react_dom__WEBPACK_IMPORTED_MODULE_3___namespace_cache=__webpack_require__2.t(react_dom__WEBPACK_IMPORTED_MODULE_3__,2));function guard(property,expected){var existing=globalObj[property];if(existing===expected&&expected!==void 0)console.warn('[expose-peers] "'+property+'" already exists in global scope, but with correct value');else if(existing!==void 0)throw new Error('[expose-peers] "'+property+'" already exists in the global scope, cannot overwrite')}}},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(cachedModule!==void 0)return cachedModule.exports;var module=__webpack_module_cache__[moduleId]={id:moduleId,loaded:!1,exports:{}};return __webpack_modules__[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}__webpack_require__.m=__webpack_modules__,(()=>{var deferred=[];__webpack_require__.O=(result,chunkIds,fn,priority)=>{if(chunkIds){priority=priority||0;for(var i=deferred.length;i>0&&deferred[i-1][2]>priority;i--)deferred[i]=deferred[i-1];deferred[i]=[chunkIds,fn,priority];return}for(var notFulfilled=1/0,i=0;i<deferred.length;i++){for(var[chunkIds,fn,priority]=deferred[i],fulfilled=!0,j=0;j<chunkIds.length;j++)(priority&!1||notFulfilled>=priority)&&Object.keys(__webpack_require__.O).every(key=>__webpack_require__.O[key](chunkIds[j]))?chunkIds.splice(j--,1):(fulfilled=!1,priority<notFulfilled&&(notFulfilled=priority));if(fulfilled){deferred.splice(i--,1);var r=fn();r!==void 0&&(result=r)}}return result}})(),__webpack_require__.n=module=>{var getter=module&&module.__esModule?()=>module.default:()=>module;return __webpack_require__.d(getter,{a:getter}),getter},(()=>{var getProto=Object.getPrototypeOf?obj=>Object.getPrototypeOf(obj):obj=>obj.__proto__,leafPrototypes;__webpack_require__.t=function(value,mode){if(mode&1&&(value=this(value)),mode&8||typeof value=="object"&&value&&(mode&4&&value.__esModule||mode&16&&typeof value.then=="function"))return value;var ns=Object.create(null);__webpack_require__.r(ns);var def={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var current=mode&2&&value;typeof current=="object"&&!~leafPrototypes.indexOf(current);current=getProto(current))Object.getOwnPropertyNames(current).forEach(key=>def[key]=()=>value[key]);return def.default=()=>value,__webpack_require__.d(ns,def),ns}})(),__webpack_require__.d=(exports,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},__webpack_require__.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),__webpack_require__.r=exports=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.nmd=module=>(module.paths=[],module.children||(module.children=[]),module),(()=>{var installedChunks={703:0};__webpack_require__.O.j=chunkId=>installedChunks[chunkId]===0;var webpackJsonpCallback=(parentChunkLoadingFunction,data)=>{var[chunkIds,moreModules,runtime]=data,moduleId,chunkId,i=0;if(chunkIds.some(id=>installedChunks[id]!==0)){for(moduleId in moreModules)__webpack_require__.o(moreModules,moduleId)&&(__webpack_require__.m[moduleId]=moreModules[moduleId]);if(runtime)var result=runtime(__webpack_require__)}for(parentChunkLoadingFunction&&parentChunkLoadingFunction(data);i<chunkIds.length;i++)chunkId=chunkIds[i],__webpack_require__.o(installedChunks,chunkId)&&installedChunks[chunkId]&&installedChunks[chunkId][0](),installedChunks[chunkId]=0;return __webpack_require__.O(result)},chunkLoadingGlobal=self.__loadChunks_EnvTemplate=self.__loadChunks_EnvTemplate||[];chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null,0)),chunkLoadingGlobal.push=webpackJsonpCallback.bind(null,chunkLoadingGlobal.push.bind(chunkLoadingGlobal))})();var __webpack_exports__=__webpack_require__.O(void 0,[851],()=>__webpack_require__(96670));__webpack_exports__=__webpack_require__.O(__webpack_exports__)})();
1
+ (()=>{"use strict";var __webpack_modules__={51669:(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__2)=>{var react__WEBPACK_IMPORTED_MODULE_2___namespace_cache,react_dom__WEBPACK_IMPORTED_MODULE_3___namespace_cache,_teambit_mdx_ui_mdx_scope_context__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__2(81846),_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__2(49613),react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__2(59496),react_dom__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__2(87995),globalObj=window;guard("TeambitMdxUiMdxScopeContext",_teambit_mdx_ui_mdx_scope_context__WEBPACK_IMPORTED_MODULE_0__),guard("MdxJsReact",_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__),guard("React",react__WEBPACK_IMPORTED_MODULE_2___namespace_cache||(react__WEBPACK_IMPORTED_MODULE_2___namespace_cache=__webpack_require__2.t(react__WEBPACK_IMPORTED_MODULE_2__,2))),guard("ReactDom",react_dom__WEBPACK_IMPORTED_MODULE_3___namespace_cache||(react_dom__WEBPACK_IMPORTED_MODULE_3___namespace_cache=__webpack_require__2.t(react_dom__WEBPACK_IMPORTED_MODULE_3__,2))),globalObj.TeambitMdxUiMdxScopeContext=_teambit_mdx_ui_mdx_scope_context__WEBPACK_IMPORTED_MODULE_0__,globalObj.MdxJsReact=_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__,globalObj.React=react__WEBPACK_IMPORTED_MODULE_2___namespace_cache||(react__WEBPACK_IMPORTED_MODULE_2___namespace_cache=__webpack_require__2.t(react__WEBPACK_IMPORTED_MODULE_2__,2)),globalObj.ReactDom=react_dom__WEBPACK_IMPORTED_MODULE_3___namespace_cache||(react_dom__WEBPACK_IMPORTED_MODULE_3___namespace_cache=__webpack_require__2.t(react_dom__WEBPACK_IMPORTED_MODULE_3__,2));function guard(property,expected){var existing=globalObj[property];if(existing===expected&&expected!==void 0)console.warn('[expose-peers] "'+property+'" already exists in global scope, but with correct value');else if(existing!==void 0)throw new Error('[expose-peers] "'+property+'" already exists in the global scope, cannot overwrite')}}},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(cachedModule!==void 0)return cachedModule.exports;var module=__webpack_module_cache__[moduleId]={id:moduleId,loaded:!1,exports:{}};return __webpack_modules__[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}__webpack_require__.m=__webpack_modules__,(()=>{var deferred=[];__webpack_require__.O=(result,chunkIds,fn,priority)=>{if(chunkIds){priority=priority||0;for(var i=deferred.length;i>0&&deferred[i-1][2]>priority;i--)deferred[i]=deferred[i-1];deferred[i]=[chunkIds,fn,priority];return}for(var notFulfilled=1/0,i=0;i<deferred.length;i++){for(var[chunkIds,fn,priority]=deferred[i],fulfilled=!0,j=0;j<chunkIds.length;j++)(priority&!1||notFulfilled>=priority)&&Object.keys(__webpack_require__.O).every(key=>__webpack_require__.O[key](chunkIds[j]))?chunkIds.splice(j--,1):(fulfilled=!1,priority<notFulfilled&&(notFulfilled=priority));if(fulfilled){deferred.splice(i--,1);var r=fn();r!==void 0&&(result=r)}}return result}})(),__webpack_require__.n=module=>{var getter=module&&module.__esModule?()=>module.default:()=>module;return __webpack_require__.d(getter,{a:getter}),getter},(()=>{var getProto=Object.getPrototypeOf?obj=>Object.getPrototypeOf(obj):obj=>obj.__proto__,leafPrototypes;__webpack_require__.t=function(value,mode){if(mode&1&&(value=this(value)),mode&8||typeof value=="object"&&value&&(mode&4&&value.__esModule||mode&16&&typeof value.then=="function"))return value;var ns=Object.create(null);__webpack_require__.r(ns);var def={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var current=mode&2&&value;typeof current=="object"&&!~leafPrototypes.indexOf(current);current=getProto(current))Object.getOwnPropertyNames(current).forEach(key=>def[key]=()=>value[key]);return def.default=()=>value,__webpack_require__.d(ns,def),ns}})(),__webpack_require__.d=(exports,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},__webpack_require__.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),__webpack_require__.r=exports=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.nmd=module=>(module.paths=[],module.children||(module.children=[]),module),(()=>{var installedChunks={703:0};__webpack_require__.O.j=chunkId=>installedChunks[chunkId]===0;var webpackJsonpCallback=(parentChunkLoadingFunction,data)=>{var[chunkIds,moreModules,runtime]=data,moduleId,chunkId,i=0;if(chunkIds.some(id=>installedChunks[id]!==0)){for(moduleId in moreModules)__webpack_require__.o(moreModules,moduleId)&&(__webpack_require__.m[moduleId]=moreModules[moduleId]);if(runtime)var result=runtime(__webpack_require__)}for(parentChunkLoadingFunction&&parentChunkLoadingFunction(data);i<chunkIds.length;i++)chunkId=chunkIds[i],__webpack_require__.o(installedChunks,chunkId)&&installedChunks[chunkId]&&installedChunks[chunkId][0](),installedChunks[chunkId]=0;return __webpack_require__.O(result)},chunkLoadingGlobal=self.__loadChunks_EnvTemplate=self.__loadChunks_EnvTemplate||[];chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null,0)),chunkLoadingGlobal.push=webpackJsonpCallback.bind(null,chunkLoadingGlobal.push.bind(chunkLoadingGlobal))})();var __webpack_exports__=__webpack_require__.O(void 0,[851],()=>__webpack_require__(51669));__webpack_exports__=__webpack_require__.O(__webpack_exports__)})();
@@ -1 +1 @@
1
- "use strict";(self.__loadChunks_EnvTemplate=self.__loadChunks_EnvTemplate||[]).push([[629],{},__webpack_require__=>{var __webpack_exec__=moduleId=>__webpack_require__(__webpack_require__.s=moduleId);__webpack_require__.O(0,[170,851],()=>__webpack_exec__(16170));var __webpack_exports__=__webpack_require__.O()}]);
1
+ "use strict";(self.__loadChunks_EnvTemplate=self.__loadChunks_EnvTemplate||[]).push([[629],{},__webpack_require__=>{var __webpack_exec__=moduleId=>__webpack_require__(__webpack_require__.s=moduleId);__webpack_require__.O(0,[441,851],()=>__webpack_exec__(12441));var __webpack_exports__=__webpack_require__.O()}]);
@@ -1 +1 @@
1
- !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/aspect-preview"]=t():e["teambit.harmony/aspect-preview"]=t()}(self,(()=>(()=>{"use strict";var e={71308:(e,t,o)=>{var n={id:"teambit.harmony/aspect@1.0.209",homepage:"https://bit.cloud/teambit/harmony/aspect",exported:!0};function r(){const e=a(o(41594));return r=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=n,a.__bit_component=n;const s=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/aspect.svg"}));s.__bit_component=n,t.Logo=s},41594:e=>{e.exports=React}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,o),a.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{o.r(n),o.d(n,{compositions:()=>d,compositions_metadata:()=>m,overview:()=>u});var e={};o.r(e),o.d(e,{default:()=>l});var t=o(71308);o(41594);const r=MdxJsReact,a=TeambitMdxUiMdxScopeContext;var s=["components"];function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},i.apply(this,arguments)}var p={},c="wrapper";function l(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},a=Object.keys(e);for(n=0;n<a.length;n++)o=a[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)o=a[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,s);return(0,r.mdx)(c,i({},p,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(a.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,r.mdx)("h2",null,"Overview"),(0,r.mdx)("p",null,"Aspects can be configured on a component is various ways, some more general and some more specific. Once a component is loaded, Bit calculates all the sources and comes up with the final list of aspects. Each aspect has its config and data.\nConfig is what the user entered, Data is a result of the aspect process."),(0,r.mdx)("h2",null,"Debugging aspects"),(0,r.mdx)("p",null,"To help understanding why a component has these specific aspects, ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit aspect get --debug")," shows each one of the sources, from the more specific one to the general one. At the end, it shows the merged result of all sources.\nThe various sources are as follows:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"'BitmapFile'\n'Model'\n'WorkspaceVariants'\n'ComponentJsonFile'\n")),(0,r.mdx)("p",null,"Since the list of all the config+data can be very long and hard to follow, the flag ",(0,r.mdx)("inlineCode",{parentName:"p"},"--json")," is very helpful.\nThis with help of ",(0,r.mdx)("a",{parentName:"p",href:"https://github.com/antonmedv/fx"},"fx"),", it's easy to extract the data needed."),(0,r.mdx)("p",null,"If for example, we're interested in one source only, we can run the following:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"bit aspect get ui/text --debug --json | fx .BitmapFile\n")),(0,r.mdx)("p",null,"It's possible to run any arbitrary javascript code with fx, so for example, if you want to debug just one specific aspect, and see its config/data per each one of the source, you can do something like this:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"bit aspect get ui/text --debug --json | fx 'Object.keys(this).map(origin => ({ origin, value: this[origin].extensions[\"teambit.pkg/pkg\"] }))'\n")),(0,r.mdx)("p",null,"Another data shown with the ",(0,r.mdx)("inlineCode",{parentName:"p"},"--debug")," flag is the rules in the workspace.jsonc#variants applied to this component. It shows the list of these rules sorted with the data about the specifity.")))}l.isMDXComponent=!0;const d=[t],u=[e],m={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),n})()));
1
+ !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/aspect-preview"]=t():e["teambit.harmony/aspect-preview"]=t()}(self,(()=>(()=>{"use strict";var e={86747:(e,t,o)=>{var n={id:"teambit.harmony/aspect@1.0.211",homepage:"https://bit.cloud/teambit/harmony/aspect",exported:!0};function r(){const e=a(o(41594));return r=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=n,a.__bit_component=n;const s=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/aspect.svg"}));s.__bit_component=n,t.Logo=s},41594:e=>{e.exports=React}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,o),a.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{o.r(n),o.d(n,{compositions:()=>d,compositions_metadata:()=>m,overview:()=>u});var e={};o.r(e),o.d(e,{default:()=>l});var t=o(86747);o(41594);const r=MdxJsReact,a=TeambitMdxUiMdxScopeContext;var s=["components"];function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},i.apply(this,arguments)}var p={},c="wrapper";function l(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},a=Object.keys(e);for(n=0;n<a.length;n++)o=a[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)o=a[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,s);return(0,r.mdx)(c,i({},p,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(a.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,r.mdx)("h2",null,"Overview"),(0,r.mdx)("p",null,"Aspects can be configured on a component is various ways, some more general and some more specific. Once a component is loaded, Bit calculates all the sources and comes up with the final list of aspects. Each aspect has its config and data.\nConfig is what the user entered, Data is a result of the aspect process."),(0,r.mdx)("h2",null,"Debugging aspects"),(0,r.mdx)("p",null,"To help understanding why a component has these specific aspects, ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit aspect get --debug")," shows each one of the sources, from the more specific one to the general one. At the end, it shows the merged result of all sources.\nThe various sources are as follows:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"'BitmapFile'\n'Model'\n'WorkspaceVariants'\n'ComponentJsonFile'\n")),(0,r.mdx)("p",null,"Since the list of all the config+data can be very long and hard to follow, the flag ",(0,r.mdx)("inlineCode",{parentName:"p"},"--json")," is very helpful.\nThis with help of ",(0,r.mdx)("a",{parentName:"p",href:"https://github.com/antonmedv/fx"},"fx"),", it's easy to extract the data needed."),(0,r.mdx)("p",null,"If for example, we're interested in one source only, we can run the following:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"bit aspect get ui/text --debug --json | fx .BitmapFile\n")),(0,r.mdx)("p",null,"It's possible to run any arbitrary javascript code with fx, so for example, if you want to debug just one specific aspect, and see its config/data per each one of the source, you can do something like this:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"bit aspect get ui/text --debug --json | fx 'Object.keys(this).map(origin => ({ origin, value: this[origin].extensions[\"teambit.pkg/pkg\"] }))'\n")),(0,r.mdx)("p",null,"Another data shown with the ",(0,r.mdx)("inlineCode",{parentName:"p"},"--debug")," flag is the rules in the workspace.jsonc#variants applied to this component. It shows the list of these rules sorted with the data about the specifity.")))}l.isMDXComponent=!0;const d=[t],u=[e],m={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),n})()));
@@ -1980,7 +1980,7 @@
1980
1980
  "_legacy": {
1981
1981
  "scope": "teambit.harmony",
1982
1982
  "name": "aspect",
1983
- "version": "1.0.209"
1983
+ "version": "1.0.211"
1984
1984
  },
1985
1985
  "_scope": "teambit.harmony"
1986
1986
  }
@@ -2007,7 +2007,7 @@
2007
2007
  "_legacy": {
2008
2008
  "scope": "teambit.harmony",
2009
2009
  "name": "aspect",
2010
- "version": "1.0.209"
2010
+ "version": "1.0.211"
2011
2011
  },
2012
2012
  "_scope": "teambit.harmony"
2013
2013
  }
@@ -2034,7 +2034,7 @@
2034
2034
  "_legacy": {
2035
2035
  "scope": "teambit.harmony",
2036
2036
  "name": "aspect",
2037
- "version": "1.0.209"
2037
+ "version": "1.0.211"
2038
2038
  },
2039
2039
  "_scope": "teambit.harmony"
2040
2040
  }
@@ -4171,7 +4171,7 @@
4171
4171
  "_legacy": {
4172
4172
  "scope": "teambit.harmony",
4173
4173
  "name": "aspect",
4174
- "version": "1.0.209"
4174
+ "version": "1.0.211"
4175
4175
  },
4176
4176
  "_scope": "teambit.harmony"
4177
4177
  }
@@ -4198,7 +4198,7 @@
4198
4198
  "_legacy": {
4199
4199
  "scope": "teambit.harmony",
4200
4200
  "name": "aspect",
4201
- "version": "1.0.209"
4201
+ "version": "1.0.211"
4202
4202
  },
4203
4203
  "_scope": "teambit.harmony"
4204
4204
  }
@@ -4225,7 +4225,7 @@
4225
4225
  "_legacy": {
4226
4226
  "scope": "teambit.harmony",
4227
4227
  "name": "aspect",
4228
- "version": "1.0.209"
4228
+ "version": "1.0.211"
4229
4229
  },
4230
4230
  "_scope": "teambit.harmony"
4231
4231
  }
@@ -4273,7 +4273,7 @@
4273
4273
  "componentId": {
4274
4274
  "scope": "teambit.harmony",
4275
4275
  "name": "aspect",
4276
- "version": "1.0.209"
4276
+ "version": "1.0.211"
4277
4277
  },
4278
4278
  "taggedModuleExports": []
4279
4279
  }
@@ -27,7 +27,7 @@ function _constants() {
27
27
  }
28
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
29
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
30
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
30
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
31
31
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // eslint-disable-next-line max-classes-per-file
32
32
  class ListAspectCmd {
33
33
  constructor(aspect) {
@@ -1 +1 @@
1
- {"version":3,"names":["_cliTable","data","require","_chalk","_interopRequireDefault","_constants","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","ListAspectCmd","constructor","aspect","name","description","COMPONENT_PATTERN_HELP","report","debug","listAspectsResults","listAspectsOfComponent","rows","keys","map","componentId","longestAspectName","Math","max","_","aspectName","length","aspects","aspectSource","origin","source","padEnd","level","join","table","CLITable","render","exports","SetAspectCmd","pattern","aspectId","config","options","configParsed","JSON","parse","results","setAspectsToComponents","chalk","yellow","bold","green","UpdateAspectCmd","cmd","updated","alreadyUpToDate","updateAspectsToComponents","UnsetAspectCmd","unsetAspectsFromComponents","GetAspectCmd","componentName","extensionsDetailsToString","extensions","extensionId","toComponentObject","toString","stringify","undefined","mergedExtensions","beforeMerge","getAspectsOfComponentForDebugging","beforeMergeOutput","extraData","title","details","moreData","afterMergeTitle","afterMergeOutput","afterFinalMergeTitle","afterFinalMergeOutput","toLegacy","getAspectsOfComponent","extensionDataList","json","extensionsDetailsToObject","reduce","acc","current","jsonObj","forEach","AfterMerge","FinalAfterMergeIncludeLoad","AspectCmd","unrecognizedSubcommand","red"],"sources":["aspect.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { CLITable } from '@teambit/cli-table';\nimport chalk from 'chalk';\nimport { ExtensionDataList } from '@teambit/legacy/dist/consumer/config';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { AspectMain } from './aspect.main.runtime';\n\nexport class ListAspectCmd implements Command {\n name = 'list [pattern]';\n description = 'list all aspects configured on component(s)';\n arguments = [\n {\n name: 'pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n options = [['d', 'debug', 'show the origins where the aspects were taken from']] as CommandOptions;\n group = 'development';\n\n constructor(private aspect: AspectMain) {}\n\n async report([name]: [string], { debug }: { debug: boolean }) {\n const listAspectsResults = await this.aspect.listAspectsOfComponent(name);\n const rows = Object.keys(listAspectsResults).map((componentId) => {\n const longestAspectName = Math.max(...listAspectsResults[componentId].map((_) => _.aspectName.length));\n const aspects = listAspectsResults[componentId]\n .map((aspectSource) => {\n const origin = debug ? ` (origin: ${aspectSource.source})` : '';\n const aspectName = aspectSource.aspectName.padEnd(longestAspectName);\n return `${aspectName} (level: ${aspectSource.level})${origin}`;\n })\n .join('\\n');\n\n return [componentId, aspects];\n });\n const table = new CLITable([], rows);\n return table.render();\n }\n}\n\nexport type SetAspectOptions = { merge?: boolean };\n\nexport class SetAspectCmd implements Command {\n name = 'set <pattern> <aspect-id> [config]';\n description = 'set components with an aspect to extend their development tools, metadata and (possibly) artifacts';\n arguments = [\n {\n name: 'pattern',\n description: `the components to extend. ${COMPONENT_PATTERN_HELP}`,\n },\n {\n name: 'aspect-id',\n description: \"the aspect's component id\",\n },\n {\n name: 'config',\n description: `the aspect config. enter the config as a stringified JSON (e.g. '{\"foo\":\"bar\"}' ). when no config is provided, an aspect is set with an empty config ({}).`,\n },\n ];\n options = [\n ['m', 'merge', 'merge with an existing config if exits. (by default, it replaces overlapping existing configs)'],\n ] as CommandOptions;\n group = 'development';\n\n constructor(private aspect: AspectMain) {}\n\n async report([pattern, aspectId, config]: [string, string, string], options: SetAspectOptions) {\n const configParsed = config ? JSON.parse(config) : {};\n const results = await this.aspect.setAspectsToComponents(pattern, aspectId, configParsed, options);\n if (!results.length)\n return chalk.yellow(`unable to find any matching components for ${chalk.bold(pattern)} pattern`);\n return chalk.green(`the following component(s) have been successfully updated:\\n${results.join('\\n')}`);\n }\n}\n\nexport class UpdateAspectCmd implements Command {\n name = 'update <aspect-id> [pattern]';\n description = 'update a version of an aspect for all or specified components';\n arguments = [\n {\n name: 'aspect-id',\n description:\n \"the aspect's component id. optionally, add a version (id@version), otherwise will use the latest version from the remote\",\n },\n {\n name: 'pattern',\n description: `the components to update (defaults to all components). ${COMPONENT_PATTERN_HELP}`,\n },\n ];\n examples = [\n {\n cmd: \"bit aspect update scope.org/aspect '**/ui/**'\",\n description: 'update all components with the \"ui\" namespace that use scope.org/aspect, to use its latest version',\n },\n {\n cmd: 'bit aspect update scope.org/aspect@2.0.0',\n description:\n 'update version of scope.org/aspect to version 2.0.0 for all components configured with that aspect.',\n },\n ];\n options = [];\n group = 'development';\n\n constructor(private aspect: AspectMain) {}\n\n async report([aspectId, pattern]: [string, string]) {\n const { updated, alreadyUpToDate } = await this.aspect.updateAspectsToComponents(aspectId, pattern);\n if (updated.length) {\n return chalk.green(`the following component(s) have been successfully updated:\\n${updated.join('\\n')}`);\n }\n if (alreadyUpToDate.length) {\n return chalk.green(\n `all ${alreadyUpToDate.length} component(s) that use this aspect are already up to date. nothing to update`\n );\n }\n return chalk.yellow(`unable to find any components in this workspace that use ${chalk.bold(aspectId)}`);\n }\n}\n\nexport class UnsetAspectCmd implements Command {\n name = 'unset <pattern> <aspect-id>';\n description = `unset an aspect from component(s).`;\n arguments = [\n {\n name: 'pattern',\n description: `the components to target. ${COMPONENT_PATTERN_HELP}`,\n },\n {\n name: 'aspect-id',\n description: \"the aspect's component id\",\n },\n ];\n options = [];\n group = 'development';\n\n constructor(private aspect: AspectMain) {}\n\n async report([pattern, aspectId]: [string, string]) {\n const results = await this.aspect.unsetAspectsFromComponents(pattern, aspectId);\n if (!results.length)\n return chalk.yellow(`unable to find any matching components for ${chalk.bold(pattern)} pattern`);\n return chalk.green(`the following component(s) have been successfully updated:\\n${results.join('\\n')}`);\n }\n}\n\nexport class GetAspectCmd implements Command {\n name = 'get <component-name>';\n description = 'list the aspects set on a component, as well as their configs and data';\n arguments = [\n {\n name: 'component-name',\n description: 'the component name or component id to fetch aspects for',\n },\n ];\n options = [\n ['d', 'debug', 'show the origins where the aspects were taken from'],\n ['j', 'json', 'format as json'],\n ] as CommandOptions;\n group = 'development';\n\n constructor(private aspect: AspectMain) {}\n\n async report([componentName]: [string], { debug }: { debug: boolean }) {\n const extensionsDetailsToString = (extensions: ExtensionDataList) =>\n extensions\n .map((e) => {\n const { name, data, config, extensionId } = e.toComponentObject();\n return `${chalk.bold('name:')} ${name || extensionId?.toString()}\n${chalk.bold('config:')} ${JSON.stringify(config, undefined, 2)}\n${chalk.bold('data:')} ${JSON.stringify(data, undefined, 2)}\n`;\n })\n .join('\\n');\n\n if (debug) {\n const {\n aspects,\n extensions: mergedExtensions,\n beforeMerge,\n } = await this.aspect.getAspectsOfComponentForDebugging(componentName);\n const beforeMergeOutput = beforeMerge\n .map(({ origin, extensions, extraData }) => {\n const title = chalk.green.bold(`Origin: ${origin}`);\n const details = extensionsDetailsToString(extensions);\n const moreData = extraData ? `\\n${chalk.bold('Extra Data:')} ${JSON.stringify(extraData, undefined, 2)}` : '';\n return `${title}\\n${details}${moreData}`;\n })\n .join('\\n\\n');\n\n const afterMergeTitle = chalk.green.bold('After merging the origins above');\n const afterMergeOutput = `${afterMergeTitle}\\n${extensionsDetailsToString(mergedExtensions)}`;\n\n const afterFinalMergeTitle = chalk.green.bold('Final - After merging the origins above and the loaded data');\n const afterFinalMergeOutput = `${afterFinalMergeTitle}\\n${extensionsDetailsToString(aspects.toLegacy())}`;\n\n return `${beforeMergeOutput}\\n\\n${afterMergeOutput}\\n\\n\\n${afterFinalMergeOutput}`;\n }\n const aspects = await this.aspect.getAspectsOfComponent(componentName);\n const extensionDataList = aspects.toLegacy();\n return extensionsDetailsToString(extensionDataList);\n }\n\n async json([componentName]: [string], { debug }: { debug: boolean }) {\n const extensionsDetailsToObject = (extensions: ExtensionDataList) =>\n extensions.reduce((acc, current) => {\n const { name, data, config, extensionId } = current.toComponentObject();\n const aspectName = name || extensionId?.toString() || '<no-name>';\n acc[aspectName] = {\n name: aspectName,\n config,\n data,\n };\n return acc;\n }, {});\n\n if (debug) {\n const {\n aspects,\n extensions: mergedExtensions,\n beforeMerge,\n } = await this.aspect.getAspectsOfComponentForDebugging(componentName);\n const jsonObj: Record<string, any> = {};\n beforeMerge.forEach(({ origin, extensions, extraData }) => {\n jsonObj[origin] = {\n extensions: extensionsDetailsToObject(extensions),\n extraData,\n };\n });\n\n jsonObj.AfterMerge = { extensions: extensionsDetailsToObject(mergedExtensions) };\n jsonObj.FinalAfterMergeIncludeLoad = { extensions: extensionsDetailsToObject(aspects.toLegacy()) };\n return jsonObj;\n }\n\n const aspects = await this.aspect.getAspectsOfComponent(componentName);\n\n return extensionsDetailsToObject(aspects.toLegacy());\n }\n}\n\nexport class AspectCmd implements Command {\n name = 'aspect <sub-command>';\n alias = '';\n description = 'manage aspects';\n options = [];\n group = 'development';\n commands: Command[] = [];\n\n async report([unrecognizedSubcommand]: [string]) {\n return chalk.red(\n `\"${unrecognizedSubcommand}\" is not a subcommand of \"aspect\", please run \"bit aspect --help\" to list the subcommands`\n );\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAwE,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAAM,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAE,MAAA,CAAAF,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAI,CAAA,2BAAAJ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;IAAArB,eAAA,eACjC,sBAAsB;IAAAA,eAAA,gBACrB,EAAE;IAAAA,eAAA,sBACI,gBAAgB;IAAAA,eAAA,kBACpB,EAAE;IAAAA,eAAA,gBACJ,aAAa;IAAAA,eAAA,mBACC,EAAE;EAAA;EAExB,MAAM0B,MAAMA,CAAC,CAACgF,sBAAsB,CAAW,EAAE;IAC/C,OAAO7C,gBAAK,CAAC8C,GAAG,CACb,IAAGD,sBAAuB,2FAC7B,CAAC;EACH;AACF;AAACxD,OAAA,CAAAuD,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["_cliTable","data","require","_chalk","_interopRequireDefault","_constants","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","ListAspectCmd","constructor","aspect","name","description","COMPONENT_PATTERN_HELP","report","debug","listAspectsResults","listAspectsOfComponent","rows","keys","map","componentId","longestAspectName","Math","max","_","aspectName","length","aspects","aspectSource","origin","source","padEnd","level","join","table","CLITable","render","exports","SetAspectCmd","pattern","aspectId","config","options","configParsed","JSON","parse","results","setAspectsToComponents","chalk","yellow","bold","green","UpdateAspectCmd","cmd","updated","alreadyUpToDate","updateAspectsToComponents","UnsetAspectCmd","unsetAspectsFromComponents","GetAspectCmd","componentName","extensionsDetailsToString","extensions","extensionId","toComponentObject","toString","stringify","undefined","mergedExtensions","beforeMerge","getAspectsOfComponentForDebugging","beforeMergeOutput","extraData","title","details","moreData","afterMergeTitle","afterMergeOutput","afterFinalMergeTitle","afterFinalMergeOutput","toLegacy","getAspectsOfComponent","extensionDataList","json","extensionsDetailsToObject","reduce","acc","current","jsonObj","forEach","AfterMerge","FinalAfterMergeIncludeLoad","AspectCmd","unrecognizedSubcommand","red"],"sources":["aspect.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { CLITable } from '@teambit/cli-table';\nimport chalk from 'chalk';\nimport { ExtensionDataList } from '@teambit/legacy/dist/consumer/config';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { AspectMain } from './aspect.main.runtime';\n\nexport class ListAspectCmd implements Command {\n name = 'list [pattern]';\n description = 'list all aspects configured on component(s)';\n arguments = [\n {\n name: 'pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n options = [['d', 'debug', 'show the origins where the aspects were taken from']] as CommandOptions;\n group = 'development';\n\n constructor(private aspect: AspectMain) {}\n\n async report([name]: [string], { debug }: { debug: boolean }) {\n const listAspectsResults = await this.aspect.listAspectsOfComponent(name);\n const rows = Object.keys(listAspectsResults).map((componentId) => {\n const longestAspectName = Math.max(...listAspectsResults[componentId].map((_) => _.aspectName.length));\n const aspects = listAspectsResults[componentId]\n .map((aspectSource) => {\n const origin = debug ? ` (origin: ${aspectSource.source})` : '';\n const aspectName = aspectSource.aspectName.padEnd(longestAspectName);\n return `${aspectName} (level: ${aspectSource.level})${origin}`;\n })\n .join('\\n');\n\n return [componentId, aspects];\n });\n const table = new CLITable([], rows);\n return table.render();\n }\n}\n\nexport type SetAspectOptions = { merge?: boolean };\n\nexport class SetAspectCmd implements Command {\n name = 'set <pattern> <aspect-id> [config]';\n description = 'set components with an aspect to extend their development tools, metadata and (possibly) artifacts';\n arguments = [\n {\n name: 'pattern',\n description: `the components to extend. ${COMPONENT_PATTERN_HELP}`,\n },\n {\n name: 'aspect-id',\n description: \"the aspect's component id\",\n },\n {\n name: 'config',\n description: `the aspect config. enter the config as a stringified JSON (e.g. '{\"foo\":\"bar\"}' ). when no config is provided, an aspect is set with an empty config ({}).`,\n },\n ];\n options = [\n ['m', 'merge', 'merge with an existing config if exits. (by default, it replaces overlapping existing configs)'],\n ] as CommandOptions;\n group = 'development';\n\n constructor(private aspect: AspectMain) {}\n\n async report([pattern, aspectId, config]: [string, string, string], options: SetAspectOptions) {\n const configParsed = config ? JSON.parse(config) : {};\n const results = await this.aspect.setAspectsToComponents(pattern, aspectId, configParsed, options);\n if (!results.length)\n return chalk.yellow(`unable to find any matching components for ${chalk.bold(pattern)} pattern`);\n return chalk.green(`the following component(s) have been successfully updated:\\n${results.join('\\n')}`);\n }\n}\n\nexport class UpdateAspectCmd implements Command {\n name = 'update <aspect-id> [pattern]';\n description = 'update a version of an aspect for all or specified components';\n arguments = [\n {\n name: 'aspect-id',\n description:\n \"the aspect's component id. optionally, add a version (id@version), otherwise will use the latest version from the remote\",\n },\n {\n name: 'pattern',\n description: `the components to update (defaults to all components). ${COMPONENT_PATTERN_HELP}`,\n },\n ];\n examples = [\n {\n cmd: \"bit aspect update scope.org/aspect '**/ui/**'\",\n description: 'update all components with the \"ui\" namespace that use scope.org/aspect, to use its latest version',\n },\n {\n cmd: 'bit aspect update scope.org/aspect@2.0.0',\n description:\n 'update version of scope.org/aspect to version 2.0.0 for all components configured with that aspect.',\n },\n ];\n options = [];\n group = 'development';\n\n constructor(private aspect: AspectMain) {}\n\n async report([aspectId, pattern]: [string, string]) {\n const { updated, alreadyUpToDate } = await this.aspect.updateAspectsToComponents(aspectId, pattern);\n if (updated.length) {\n return chalk.green(`the following component(s) have been successfully updated:\\n${updated.join('\\n')}`);\n }\n if (alreadyUpToDate.length) {\n return chalk.green(\n `all ${alreadyUpToDate.length} component(s) that use this aspect are already up to date. nothing to update`\n );\n }\n return chalk.yellow(`unable to find any components in this workspace that use ${chalk.bold(aspectId)}`);\n }\n}\n\nexport class UnsetAspectCmd implements Command {\n name = 'unset <pattern> <aspect-id>';\n description = `unset an aspect from component(s).`;\n arguments = [\n {\n name: 'pattern',\n description: `the components to target. ${COMPONENT_PATTERN_HELP}`,\n },\n {\n name: 'aspect-id',\n description: \"the aspect's component id\",\n },\n ];\n options = [];\n group = 'development';\n\n constructor(private aspect: AspectMain) {}\n\n async report([pattern, aspectId]: [string, string]) {\n const results = await this.aspect.unsetAspectsFromComponents(pattern, aspectId);\n if (!results.length)\n return chalk.yellow(`unable to find any matching components for ${chalk.bold(pattern)} pattern`);\n return chalk.green(`the following component(s) have been successfully updated:\\n${results.join('\\n')}`);\n }\n}\n\nexport class GetAspectCmd implements Command {\n name = 'get <component-name>';\n description = 'list the aspects set on a component, as well as their configs and data';\n arguments = [\n {\n name: 'component-name',\n description: 'the component name or component id to fetch aspects for',\n },\n ];\n options = [\n ['d', 'debug', 'show the origins where the aspects were taken from'],\n ['j', 'json', 'format as json'],\n ] as CommandOptions;\n group = 'development';\n\n constructor(private aspect: AspectMain) {}\n\n async report([componentName]: [string], { debug }: { debug: boolean }) {\n const extensionsDetailsToString = (extensions: ExtensionDataList) =>\n extensions\n .map((e) => {\n const { name, data, config, extensionId } = e.toComponentObject();\n return `${chalk.bold('name:')} ${name || extensionId?.toString()}\n${chalk.bold('config:')} ${JSON.stringify(config, undefined, 2)}\n${chalk.bold('data:')} ${JSON.stringify(data, undefined, 2)}\n`;\n })\n .join('\\n');\n\n if (debug) {\n const {\n aspects,\n extensions: mergedExtensions,\n beforeMerge,\n } = await this.aspect.getAspectsOfComponentForDebugging(componentName);\n const beforeMergeOutput = beforeMerge\n .map(({ origin, extensions, extraData }) => {\n const title = chalk.green.bold(`Origin: ${origin}`);\n const details = extensionsDetailsToString(extensions);\n const moreData = extraData ? `\\n${chalk.bold('Extra Data:')} ${JSON.stringify(extraData, undefined, 2)}` : '';\n return `${title}\\n${details}${moreData}`;\n })\n .join('\\n\\n');\n\n const afterMergeTitle = chalk.green.bold('After merging the origins above');\n const afterMergeOutput = `${afterMergeTitle}\\n${extensionsDetailsToString(mergedExtensions)}`;\n\n const afterFinalMergeTitle = chalk.green.bold('Final - After merging the origins above and the loaded data');\n const afterFinalMergeOutput = `${afterFinalMergeTitle}\\n${extensionsDetailsToString(aspects.toLegacy())}`;\n\n return `${beforeMergeOutput}\\n\\n${afterMergeOutput}\\n\\n\\n${afterFinalMergeOutput}`;\n }\n const aspects = await this.aspect.getAspectsOfComponent(componentName);\n const extensionDataList = aspects.toLegacy();\n return extensionsDetailsToString(extensionDataList);\n }\n\n async json([componentName]: [string], { debug }: { debug: boolean }) {\n const extensionsDetailsToObject = (extensions: ExtensionDataList) =>\n extensions.reduce((acc, current) => {\n const { name, data, config, extensionId } = current.toComponentObject();\n const aspectName = name || extensionId?.toString() || '<no-name>';\n acc[aspectName] = {\n name: aspectName,\n config,\n data,\n };\n return acc;\n }, {});\n\n if (debug) {\n const {\n aspects,\n extensions: mergedExtensions,\n beforeMerge,\n } = await this.aspect.getAspectsOfComponentForDebugging(componentName);\n const jsonObj: Record<string, any> = {};\n beforeMerge.forEach(({ origin, extensions, extraData }) => {\n jsonObj[origin] = {\n extensions: extensionsDetailsToObject(extensions),\n extraData,\n };\n });\n\n jsonObj.AfterMerge = { extensions: extensionsDetailsToObject(mergedExtensions) };\n jsonObj.FinalAfterMergeIncludeLoad = { extensions: extensionsDetailsToObject(aspects.toLegacy()) };\n return jsonObj;\n }\n\n const aspects = await this.aspect.getAspectsOfComponent(componentName);\n\n return extensionsDetailsToObject(aspects.toLegacy());\n }\n}\n\nexport class AspectCmd implements Command {\n name = 'aspect <sub-command>';\n alias = '';\n description = 'manage aspects';\n options = [];\n group = 'development';\n commands: Command[] = [];\n\n async report([unrecognizedSubcommand]: [string]) {\n return chalk.red(\n `\"${unrecognizedSubcommand}\" is not a subcommand of \"aspect\", please run \"bit aspect --help\" to list the subcommands`\n );\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,O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AAO,CAAC3D,MAAM,CAAC,GAAG;UAChBiC,UAAU,EAAEsB,yBAAyB,CAACtB,UAAU,CAAC;UACjDU;QACF,CAAC;MACH,CAAC,CAAC;MAEFgB,OAAO,CAACE,UAAU,GAAG;QAAE5B,UAAU,EAAEsB,yBAAyB,CAAChB,gBAAgB;MAAE,CAAC;MAChFoB,OAAO,CAACG,0BAA0B,GAAG;QAAE7B,UAAU,EAAEsB,yBAAyB,CAACzD,OAAO,CAACqD,QAAQ,CAAC,CAAC;MAAE,CAAC;MAClG,OAAOQ,OAAO;IAChB;IAEA,MAAM7D,OAAO,GAAG,MAAM,IAAI,CAAClB,MAAM,CAACwE,qBAAqB,CAACrB,aAAa,CAAC;IAEtE,OAAOwB,yBAAyB,CAACzD,OAAO,CAACqD,QAAQ,CAAC,CAAC,CAAC;EACtD;AACF;AAAC3C,OAAA,CAAAsB,YAAA,GAAAA,YAAA;AAEM,MAAMiC,SAAS,CAAoB;EAAApF,YAAA;IAAArB,eAAA,eACjC,sBAAsB;IAAAA,eAAA,gBACrB,EAAE;IAAAA,eAAA,sBACI,gBAAgB;IAAAA,eAAA,kBACpB,EAAE;IAAAA,eAAA,gBACJ,aAAa;IAAAA,eAAA,mBACC,EAAE;EAAA;EAExB,MAAM0B,MAAMA,CAAC,CAACgF,sBAAsB,CAAW,EAAE;IAC/C,OAAO7C,gBAAK,CAAC8C,GAAG,CACb,IAAGD,sBAAuB,2FAC7B,CAAC;EACH;AACF;AAACxD,OAAA,CAAAuD,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -56,7 +56,7 @@ function _defender2() {
56
56
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
57
57
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
58
58
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
59
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
59
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
60
60
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
61
61
  const tsconfig = require('./typescript/tsconfig.json');
62
62
  const AspectEnvType = exports.AspectEnvType = 'aspect';
@@ -1 +1 @@
1
- {"version":3,"names":["_lodash","data","require","_builder","_preview","_ui","_defender","_typescript","_defender2","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","tsconfig","AspectEnvType","exports","AspectEnv","constructor","reactEnv","aspectLoader","logger","__getDescriptor","type","getTsConfig","tsConfig","targetConf","merge","createTsCompiler","getTsCjsCompiler","getTester","jestConfigPath","jestModulePath","config","resolve","getCjsJestTester","getTemplateBundler","context","transformers","createTemplateWebpackBundler","getPackageJsonProps","getCjsPackageJsonProps","node","import","default","getNpmIgnore","patterns","CAPSULE_ARTIFACTS_DIR","isCoreEnv","component","id","toStringWithoutVersion","isCoreAspect","BUNDLE_UI_DIR","getPreviewConfig","strategyName","COMPONENT_PREVIEW_STRATEGY_NAME","splitComponentBundle","getDependencies","dependencies","react","devDependencies","peerDependencies","workspaceConfig","TypescriptConfigWriter","create","EslintConfigWriter","configPath","PrettierConfigWriter"],"sources":["aspect.env.ts"],"sourcesContent":["import { Compiler } from '@teambit/compiler';\nimport type { DependenciesEnv, PackageEnv, GetNpmIgnoreContext, PreviewEnv } from '@teambit/envs';\nimport { merge } from 'lodash';\nimport { PackageJsonProps } from '@teambit/pkg';\nimport { TsConfigSourceFile } from 'typescript';\nimport { ReactEnv } from '@teambit/react';\nimport { CAPSULE_ARTIFACTS_DIR } from '@teambit/builder';\nimport type { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { Bundler, BundlerContext } from '@teambit/bundler';\nimport { WebpackConfigTransformer } from '@teambit/webpack';\nimport { Tester } from '@teambit/tester';\nimport { COMPONENT_PREVIEW_STRATEGY_NAME, PreviewStrategyName } from '@teambit/preview';\nimport { BUNDLE_UI_DIR } from '@teambit/ui';\nimport { ConfigWriterEntry } from '@teambit/workspace-config-files';\nimport { PrettierConfigWriter } from '@teambit/defender.prettier-formatter';\nimport { TypescriptConfigWriter } from '@teambit/typescript.typescript-compiler';\nimport { EslintConfigWriter } from '@teambit/defender.eslint-linter';\nimport { Logger } from '@teambit/logger';\n\nconst tsconfig = require('./typescript/tsconfig.json');\n\nexport const AspectEnvType = 'aspect';\n\n/**\n * a component environment built for Aspects .\n */\nexport class AspectEnv implements DependenciesEnv, PackageEnv, PreviewEnv {\n constructor(private reactEnv: ReactEnv, private aspectLoader: AspectLoaderMain, private logger: Logger) {}\n\n icon = 'https://static.bit.dev/extensions-icons/default.svg';\n\n async __getDescriptor() {\n return {\n type: AspectEnvType,\n };\n }\n\n getTsConfig(tsConfig: TsConfigSourceFile) {\n const targetConf = merge(tsconfig, tsConfig);\n return targetConf;\n }\n\n // TODO: should probably use the transformer from the main runtime?\n // TODO: this doesn't seems to work as expected, the getTsConfig is not a transformer and the react env API expect a transformers array not an object\n createTsCompiler(tsConfig: TsConfigSourceFile): Compiler {\n return this.reactEnv.getTsCjsCompiler(this.getTsConfig(tsConfig));\n }\n\n /**\n * returns a component tester.\n */\n getTester(jestConfigPath: string, jestModulePath?: string): Tester {\n const config = jestConfigPath || require.resolve('./jest/jest.config');\n return this.reactEnv.getCjsJestTester(config, jestModulePath);\n }\n\n async getTemplateBundler(context: BundlerContext, transformers: WebpackConfigTransformer[] = []): Promise<Bundler> {\n return this.createTemplateWebpackBundler(context, transformers);\n }\n\n async createTemplateWebpackBundler(\n context: BundlerContext,\n transformers: WebpackConfigTransformer[] = []\n ): Promise<Bundler> {\n return this.reactEnv.createTemplateWebpackBundler(context, transformers);\n }\n\n getPackageJsonProps(): PackageJsonProps {\n return {\n ...this.reactEnv.getCjsPackageJsonProps(),\n exports: {\n node: {\n require: './dist/{main}.js',\n import: './dist/esm.mjs',\n },\n default: './dist/{main}.js',\n },\n };\n }\n\n getNpmIgnore(context?: GetNpmIgnoreContext) {\n // ignores only .ts files in the root directory, so d.ts files inside dists are unaffected.\n // without this change, the package has \"index.ts\" file in the root, causing typescript to parse it instead of the\n // d.ts files. (changing the \"types\" prop in the package.json file doesn't help).\n\n // Ignores all the contents inside the artifacts directory.\n // Asterisk (*) is needed in order to ignore all other contents of the artifacts directory,\n // especially when specific folders are excluded from the ignore e.g. in combination with `!artifacts/ui-bundle`.\n const patterns = ['/*.ts', `${CAPSULE_ARTIFACTS_DIR}/*`];\n\n // In order to load the env preview template from core aspects we need it to be in the package of the core envs\n // This is because we don't have the core envs in the local scope so we load it from the package itself in the bvm installation\n // as this will be excluded from the package tar by default (as it's under the CAPSULE_ARTIFACTS_DIR)\n // we want to make sure to add it for the core envs\n if (context && this.aspectLoader.isCoreEnv(context.component.id.toStringWithoutVersion())) {\n patterns.push(`!${CAPSULE_ARTIFACTS_DIR}/env-template`);\n }\n if (context && this.aspectLoader.isCoreAspect(context.component.id.toStringWithoutVersion())) {\n patterns.push(`!${CAPSULE_ARTIFACTS_DIR}/${BUNDLE_UI_DIR}`);\n }\n return patterns;\n }\n\n getPreviewConfig() {\n return {\n strategyName: COMPONENT_PREVIEW_STRATEGY_NAME as PreviewStrategyName,\n splitComponentBundle: false,\n };\n }\n\n async getDependencies() {\n return {\n dependencies: {\n react: '-',\n 'react-dom': '-',\n 'core-js': '^3.0.0',\n // For aspects the babel runtime should be a runtime dep not only dev as they are compiled by babel\n '@babel/runtime': '7.20.0',\n },\n // TODO: add this only if using ts\n devDependencies: {\n react: '-',\n 'react-dom': '-',\n '@types/mocha': '-',\n '@types/node': '12.20.4',\n '@types/react': '^17.0.8',\n '@types/react-dom': '^17.0.5',\n '@types/jest': '^26.0.0',\n '@types/testing-library__jest-dom': '5.9.5',\n },\n peerDependencies: {\n // TODO: check if we really need react for aspects (maybe for ink support)\n react: '^16.8.0 || ^17.0.0',\n 'react-dom': '^16.8.0 || ^17.0.0',\n },\n };\n }\n\n workspaceConfig(): ConfigWriterEntry[] {\n return [\n TypescriptConfigWriter.create(\n {\n tsconfig: require.resolve('./typescript/tsconfig.json'),\n // types: resolveTypes(__dirname, [\"./types\"]),\n },\n this.logger\n ),\n EslintConfigWriter.create(\n {\n configPath: require.resolve('./eslint/eslintrc.js'),\n tsconfig: require.resolve('./typescript/tsconfig.json'),\n },\n this.logger\n ),\n PrettierConfigWriter.create(\n {\n configPath: require.resolve('./prettier/prettier.config.js'),\n },\n this.logger\n ),\n ];\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAG,SAAA;EAAA,MAAAH,IAAA,G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S;QACxB,kCAAkC,EAAE;MACtC,CAAC;MACDE,gBAAgB,EAAE;QAChB;QACAF,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE;MACf;IACF,CAAC;EACH;EAEAG,eAAeA,CAAA,EAAwB;IACrC,OAAO,CACLC,oCAAsB,CAACC,MAAM,CAC3B;MACEnD,QAAQ,EAAE1C,OAAO,CAAC8D,OAAO,CAAC,4BAA4B;MACtD;IACF,CAAC,EACD,IAAI,CAACb,MACP,CAAC,EACD6C,+BAAkB,CAACD,MAAM,CACvB;MACEE,UAAU,EAAE/F,OAAO,CAAC8D,OAAO,CAAC,sBAAsB,CAAC;MACnDpB,QAAQ,EAAE1C,OAAO,CAAC8D,OAAO,CAAC,4BAA4B;IACxD,CAAC,EACD,IAAI,CAACb,MACP,CAAC,EACD+C,gCAAoB,CAACH,MAAM,CACzB;MACEE,UAAU,EAAE/F,OAAO,CAAC8D,OAAO,CAAC,+BAA+B;IAC7D,CAAC,EACD,IAAI,CAACb,MACP,CAAC,CACF;EACH;AACF;AAACL,OAAA,CAAAC,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["_lodash","data","require","_builder","_preview","_ui","_defender","_typescript","_defender2","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","tsconfig","AspectEnvType","exports","AspectEnv","constructor","reactEnv","aspectLoader","logger","__getDescriptor","type","getTsConfig","tsConfig","targetConf","merge","createTsCompiler","getTsCjsCompiler","getTester","jestConfigPath","jestModulePath","config","resolve","getCjsJestTester","getTemplateBundler","context","transformers","createTemplateWebpackBundler","getPackageJsonProps","getCjsPackageJsonProps","node","import","default","getNpmIgnore","patterns","CAPSULE_ARTIFACTS_DIR","isCoreEnv","component","id","toStringWithoutVersion","isCoreAspect","BUNDLE_UI_DIR","getPreviewConfig","strategyName","COMPONENT_PREVIEW_STRATEGY_NAME","splitComponentBundle","getDependencies","dependencies","react","devDependencies","peerDependencies","workspaceConfig","TypescriptConfigWriter","create","EslintConfigWriter","configPath","PrettierConfigWriter"],"sources":["aspect.env.ts"],"sourcesContent":["import { Compiler } from '@teambit/compiler';\nimport type { DependenciesEnv, PackageEnv, GetNpmIgnoreContext, PreviewEnv } from '@teambit/envs';\nimport { merge } from 'lodash';\nimport { PackageJsonProps } from '@teambit/pkg';\nimport { TsConfigSourceFile } from 'typescript';\nimport { ReactEnv } from '@teambit/react';\nimport { CAPSULE_ARTIFACTS_DIR } from '@teambit/builder';\nimport type { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { Bundler, BundlerContext } from '@teambit/bundler';\nimport { WebpackConfigTransformer } from '@teambit/webpack';\nimport { Tester } from '@teambit/tester';\nimport { COMPONENT_PREVIEW_STRATEGY_NAME, PreviewStrategyName } from '@teambit/preview';\nimport { BUNDLE_UI_DIR } from '@teambit/ui';\nimport { ConfigWriterEntry } from '@teambit/workspace-config-files';\nimport { PrettierConfigWriter } from '@teambit/defender.prettier-formatter';\nimport { TypescriptConfigWriter } from '@teambit/typescript.typescript-compiler';\nimport { EslintConfigWriter } from '@teambit/defender.eslint-linter';\nimport { Logger } from '@teambit/logger';\n\nconst tsconfig = require('./typescript/tsconfig.json');\n\nexport const AspectEnvType = 'aspect';\n\n/**\n * a component environment built for Aspects .\n */\nexport class AspectEnv implements DependenciesEnv, PackageEnv, PreviewEnv {\n constructor(private reactEnv: ReactEnv, private aspectLoader: AspectLoaderMain, private logger: Logger) {}\n\n icon = 'https://static.bit.dev/extensions-icons/default.svg';\n\n async __getDescriptor() {\n return {\n type: AspectEnvType,\n };\n }\n\n getTsConfig(tsConfig: TsConfigSourceFile) {\n const targetConf = merge(tsconfig, tsConfig);\n return targetConf;\n }\n\n // TODO: should probably use the transformer from the main runtime?\n // TODO: this doesn't seems to work as expected, the getTsConfig is not a transformer and the react env API expect a transformers array not an object\n createTsCompiler(tsConfig: TsConfigSourceFile): Compiler {\n return this.reactEnv.getTsCjsCompiler(this.getTsConfig(tsConfig));\n }\n\n /**\n * returns a component tester.\n */\n getTester(jestConfigPath: string, jestModulePath?: string): Tester {\n const config = jestConfigPath || require.resolve('./jest/jest.config');\n return this.reactEnv.getCjsJestTester(config, jestModulePath);\n }\n\n async getTemplateBundler(context: BundlerContext, transformers: WebpackConfigTransformer[] = []): Promise<Bundler> {\n return this.createTemplateWebpackBundler(context, transformers);\n }\n\n async createTemplateWebpackBundler(\n context: BundlerContext,\n transformers: WebpackConfigTransformer[] = []\n ): Promise<Bundler> {\n return this.reactEnv.createTemplateWebpackBundler(context, transformers);\n }\n\n getPackageJsonProps(): PackageJsonProps {\n return {\n ...this.reactEnv.getCjsPackageJsonProps(),\n exports: {\n node: {\n require: './dist/{main}.js',\n import: './dist/esm.mjs',\n },\n default: './dist/{main}.js',\n },\n };\n }\n\n getNpmIgnore(context?: GetNpmIgnoreContext) {\n // ignores only .ts files in the root directory, so d.ts files inside dists are unaffected.\n // without this change, the package has \"index.ts\" file in the root, causing typescript to parse it instead of the\n // d.ts files. (changing the \"types\" prop in the package.json file doesn't help).\n\n // Ignores all the contents inside the artifacts directory.\n // Asterisk (*) is needed in order to ignore all other contents of the artifacts directory,\n // especially when specific folders are excluded from the ignore e.g. in combination with `!artifacts/ui-bundle`.\n const patterns = ['/*.ts', `${CAPSULE_ARTIFACTS_DIR}/*`];\n\n // In order to load the env preview template from core aspects we need it to be in the package of the core envs\n // This is because we don't have the core envs in the local scope so we load it from the package itself in the bvm installation\n // as this will be excluded from the package tar by default (as it's under the CAPSULE_ARTIFACTS_DIR)\n // we want to make sure to add it for the core envs\n if (context && this.aspectLoader.isCoreEnv(context.component.id.toStringWithoutVersion())) {\n patterns.push(`!${CAPSULE_ARTIFACTS_DIR}/env-template`);\n }\n if (context && this.aspectLoader.isCoreAspect(context.component.id.toStringWithoutVersion())) {\n patterns.push(`!${CAPSULE_ARTIFACTS_DIR}/${BUNDLE_UI_DIR}`);\n }\n return patterns;\n }\n\n getPreviewConfig() {\n return {\n strategyName: COMPONENT_PREVIEW_STRATEGY_NAME as PreviewStrategyName,\n splitComponentBundle: false,\n };\n }\n\n async getDependencies() {\n return {\n dependencies: {\n react: '-',\n 'react-dom': '-',\n 'core-js': '^3.0.0',\n // For aspects the babel runtime should be a runtime dep not only dev as they are compiled by babel\n '@babel/runtime': '7.20.0',\n },\n // TODO: add this only if using ts\n devDependencies: {\n react: '-',\n 'react-dom': '-',\n '@types/mocha': '-',\n '@types/node': '12.20.4',\n '@types/react': '^17.0.8',\n '@types/react-dom': '^17.0.5',\n '@types/jest': '^26.0.0',\n '@types/testing-library__jest-dom': '5.9.5',\n },\n peerDependencies: {\n // TODO: check if we really need react for aspects (maybe for ink support)\n react: '^16.8.0 || ^17.0.0',\n 'react-dom': '^16.8.0 || ^17.0.0',\n },\n };\n }\n\n workspaceConfig(): ConfigWriterEntry[] {\n return [\n TypescriptConfigWriter.create(\n {\n tsconfig: require.resolve('./typescript/tsconfig.json'),\n // types: resolveTypes(__dirname, [\"./types\"]),\n },\n this.logger\n ),\n EslintConfigWriter.create(\n {\n configPath: require.resolve('./eslint/eslintrc.js'),\n tsconfig: require.resolve('./typescript/tsconfig.json'),\n },\n this.logger\n ),\n PrettierConfigWriter.create(\n {\n configPath: require.resolve('./prettier/prettier.config.js'),\n },\n this.logger\n ),\n ];\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAG,SAAA;EAAA,M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S;QACxB,kCAAkC,EAAE;MACtC,CAAC;MACDE,gBAAgB,EAAE;QAChB;QACAF,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE;MACf;IACF,CAAC;EACH;EAEAG,eAAeA,CAAA,EAAwB;IACrC,OAAO,CACLC,oCAAsB,CAACC,MAAM,CAC3B;MACEnD,QAAQ,EAAE1C,OAAO,CAAC8D,OAAO,CAAC,4BAA4B;MACtD;IACF,CAAC,EACD,IAAI,CAACb,MACP,CAAC,EACD6C,+BAAkB,CAACD,MAAM,CACvB;MACEE,UAAU,EAAE/F,OAAO,CAAC8D,OAAO,CAAC,sBAAsB,CAAC;MACnDpB,QAAQ,EAAE1C,OAAO,CAAC8D,OAAO,CAAC,4BAA4B;IACxD,CAAC,EACD,IAAI,CAACb,MACP,CAAC,EACD+C,gCAAoB,CAACH,MAAM,CACzB;MACEE,UAAU,EAAE/F,OAAO,CAAC8D,OAAO,CAAC,+BAA+B;IAC7D,CAAC,EACD,IAAI,CAACb,MACP,CAAC,CACF;EACH;AACF;AAACL,OAAA,CAAAC,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -145,7 +145,7 @@ function _aspect4() {
145
145
  return data;
146
146
  }
147
147
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
148
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
148
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
149
149
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
150
150
  const tsconfig = require('./typescript/tsconfig.json');
151
151
  class AspectMain {