@teambit/aspect 0.0.881 → 0.0.882
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/env-template/public/{238.2ddc5a20aad2fef149e6.js → 700.fcb0085dcdf160cc65c9.js} +15 -15
- package/artifacts/env-template/public/assets-manifest.json +16 -16
- package/artifacts/env-template/public/{compositions.e8ddc91452b356e56302.js → compositions.3570b4161030637817a4.js} +1 -1
- package/artifacts/env-template/public/compositions.html +1 -1
- package/artifacts/env-template/public/overview.9ce4acb865e3903586e9.js +1 -0
- package/artifacts/env-template/public/overview.html +1 -1
- package/artifacts/env-template/public/{peers.c8034486e942b3532a50.js → peers.acafb9d260b35c89ab74.js} +1 -1
- package/artifacts/env-template/public/{preview-root.b9ea187989f25bad7bf4.js → preview-root.a829360e0cc95e341dfd.js} +1 -1
- package/artifacts/env-template/public/static/css/700.bd8655a5.css +1 -0
- package/artifacts/env-template/public/static/css/compositions.e163efe5.css +1 -0
- package/artifacts/env-template/public/static/css/{overview.367aeb5b.css → overview.18adf1ee.css} +1 -1
- package/artifacts/preview/teambit_harmony_aspect-preview.js +1 -1
- package/{compositions-1666409808293.js → compositions-1666496165706.js} +0 -0
- package/dist/aspect.aspect.js +0 -5
- package/dist/aspect.aspect.js.map +1 -1
- package/dist/aspect.cmd.js +1 -49
- package/dist/aspect.cmd.js.map +1 -1
- package/dist/aspect.composition.js +0 -6
- package/dist/aspect.composition.js.map +1 -1
- package/dist/aspect.env.js +8 -34
- package/dist/aspect.env.js.map +1 -1
- package/dist/aspect.main.runtime.js +6 -96
- package/dist/aspect.main.runtime.js.map +1 -1
- package/dist/aspect.ui.runtime.js +4 -33
- package/dist/aspect.ui.runtime.js.map +1 -1
- package/dist/babel/babel-config.js.map +1 -1
- package/dist/core-exporter.task.js +0 -29
- package/dist/core-exporter.task.js.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/templates/aspect/files/aspect-file.js +0 -1
- package/dist/templates/aspect/files/aspect-file.js.map +1 -1
- package/dist/templates/aspect/files/config-file.js +0 -1
- package/dist/templates/aspect/files/config-file.js.map +1 -1
- package/dist/templates/aspect/files/index.js +0 -1
- package/dist/templates/aspect/files/index.js.map +1 -1
- package/dist/templates/aspect/files/main-runtime.js +0 -1
- package/dist/templates/aspect/files/main-runtime.js.map +1 -1
- package/dist/templates/aspect/index.js +0 -10
- package/dist/templates/aspect/index.js.map +1 -1
- package/{overview-1666409808293.js → overview-1666496165706.js} +0 -0
- package/package-tar/teambit-aspect-0.0.882.tgz +0 -0
- package/package.json +19 -19
- package/{preview-1666409808293.js → preview-1666496165706.js} +2 -2
- package/artifacts/env-template/public/overview.055fb4d6ca88597765cd.js +0 -1
- package/artifacts/env-template/public/static/css/238.a0238c25.css +0 -1
- package/artifacts/env-template/public/static/css/compositions.6d8c7702.css +0 -1
- package/package-tar/teambit-aspect-0.0.881.tgz +0 -0
package/artifacts/env-template/public/static/css/{overview.367aeb5b.css → overview.18adf1ee.css}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
.circular-font_circularFont__2U4VL{font-family:"CircularXX","Gill Sans","Gill Sans MT","Helvetica Neue",Helvetica,Arial,sans-serif}@font-face{font-family:"CircularXX";src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Regular.woff2)}@font-face{font-family:"CircularXX";font-weight:700;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Bold.woff2)}@font-face{font-family:"CircularXX";font-weight:800;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Black.woff2)}@font-face{font-family:"CircularXX";font-style:italic;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Italic.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:700;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-BoldItalic.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:800;src:url(https://static.bit.dev/circular-xx/CirculrXXWeb-BlackItalic.woff2)}@font-face{font-family:"CircularXX";font-weight:300;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-light.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:300;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-lightItalic.woff2)}@font-face{font-family:"CircularXX";font-weight:500;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Medium.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:500;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-MediumItalic.woff2)}.base-theme_theme__20K5p{background:var(--background-color);color:var(--on-background-color);min-height:100%}.theme-toggler_toggler__10ZbF{background:#fff;background:var(--surface-color,#fff);border-radius:8px;cursor:pointer;padding:.5em;transition:color .18s,background-color .18s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.theme-toggler_toggler__10ZbF:hover{background:#edebfc;background:var(--surface-hover-color,#edebfc)}.theme-toggler_toggler__10ZbF:active{background:#dcd8f9;background:var(--surface-active-color,#dcd8f9)}.docs-app_compositionSection__2rAWY{margin-top:40px}.docs-app_compositionCard__2BFqj{max-height:500px;max-width:100%;overflow:hidden}.docs-app_docsMainBlock__1Vyyg{box-sizing:border-box;margin:0 0 150px;max-width:1440px;padding:20px 40px 10px;width:100%}.docs-app_docsMainBlock__1Vyyg .docs-app_heading__25cfc{margin-bottom:unset}.docs-app_mdx__WbON7{font-size:16px}.heading-sizes_xxs__sqY6F{font-size:16px;font-size:var(--bit-h-xxs,16px)}.heading-sizes_xs__2vIO-{font-size:18px;font-size:var(--bit-h-xs,18px)}.heading-sizes_sm__SWCg7{font-size:24px;font-size:var(--bit-h-sm,24px)}.heading-sizes_md__1VfRy{font-size:26px;font-size:var(--bit-h-md,26px)}.heading-sizes_lg__12r2v{font-size:36px;font-size:var(--bit-h-lg,36px)}.heading-sizes_xl__18vfm{font-size:40px;font-size:var(--bit-h-xl,40px)}.heading-sizes_xxl__1XBq0{font-size:50px;font-size:var(--bit-h-xxl,50px)}.heading_h1__18YHt,.heading_h2__1ja7_,.heading_h3__3SLRc,.heading_h4__uSuLS,.heading_h5__30dq2,.heading_h6__2CGfq{font-weight:700;margin:0}.heading_h1__18YHt{margin-bottom:20px}.anchor_anchor__3Kymc{align-items:center;display:flex;text-decoration:none}.anchor_anchorIcon__osznX{color:var(--bit-text-color-light);font-size:18px}.linked-heading_linkedHeading__1exDt{align-items:center;display:flex;margin-bottom:16px;width:-
|
|
1
|
+
.circular-font_circularFont__2U4VL{font-family:"CircularXX","Gill Sans","Gill Sans MT","Helvetica Neue",Helvetica,Arial,sans-serif}@font-face{font-family:"CircularXX";src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Regular.woff2)}@font-face{font-family:"CircularXX";font-weight:700;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Bold.woff2)}@font-face{font-family:"CircularXX";font-weight:800;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Black.woff2)}@font-face{font-family:"CircularXX";font-style:italic;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Italic.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:700;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-BoldItalic.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:800;src:url(https://static.bit.dev/circular-xx/CirculrXXWeb-BlackItalic.woff2)}@font-face{font-family:"CircularXX";font-weight:300;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-light.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:300;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-lightItalic.woff2)}@font-face{font-family:"CircularXX";font-weight:500;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Medium.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:500;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-MediumItalic.woff2)}.base-theme_theme__20K5p{background:var(--background-color);color:var(--on-background-color);min-height:100%}.theme-toggler_toggler__10ZbF{background:#fff;background:var(--surface-color,#fff);border-radius:8px;cursor:pointer;padding:.5em;transition:color .18s,background-color .18s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.theme-toggler_toggler__10ZbF:hover{background:#edebfc;background:var(--surface-hover-color,#edebfc)}.theme-toggler_toggler__10ZbF:active{background:#dcd8f9;background:var(--surface-active-color,#dcd8f9)}.docs-app_compositionSection__2rAWY{margin-top:40px}.docs-app_compositionCard__2BFqj{max-height:500px;max-width:100%;overflow:hidden}.docs-app_docsMainBlock__1Vyyg{box-sizing:border-box;margin:0 0 150px;max-width:1440px;padding:20px 40px 10px;width:100%}.docs-app_docsMainBlock__1Vyyg .docs-app_heading__25cfc{margin-bottom:unset}.docs-app_mdx__WbON7{font-size:16px}.heading-sizes_xxs__sqY6F{font-size:16px;font-size:var(--bit-h-xxs,16px)}.heading-sizes_xs__2vIO-{font-size:18px;font-size:var(--bit-h-xs,18px)}.heading-sizes_sm__SWCg7{font-size:24px;font-size:var(--bit-h-sm,24px)}.heading-sizes_md__1VfRy{font-size:26px;font-size:var(--bit-h-md,26px)}.heading-sizes_lg__12r2v{font-size:36px;font-size:var(--bit-h-lg,36px)}.heading-sizes_xl__18vfm{font-size:40px;font-size:var(--bit-h-xl,40px)}.heading-sizes_xxl__1XBq0{font-size:50px;font-size:var(--bit-h-xxl,50px)}.heading_h1__18YHt,.heading_h2__1ja7_,.heading_h3__3SLRc,.heading_h4__uSuLS,.heading_h5__30dq2,.heading_h6__2CGfq{font-weight:700;margin:0}.heading_h1__18YHt{margin-bottom:20px}.anchor_anchor__3Kymc{align-items:center;display:flex;text-decoration:none}.anchor_anchorIcon__osznX{color:var(--bit-text-color-light);font-size:18px}.linked-heading_linkedHeading__1exDt{align-items:center;display:flex;margin-bottom:16px;width:-moz-fit-content;width:fit-content}.linked-heading_linkedHeading__1exDt:hover .linked-heading_anchor__3xkqo{opacity:1;visibility:unset}.linked-heading_heading__28Zmh{margin-bottom:0;margin-right:8px}.linked-heading_anchor__3xkqo{opacity:0;transform:translateY(4px);transition:visibility .3s,opacity .3s ease-in-out;visibility:hidden}.error_error__Aedkj{color:#e62e5c;color:var(--bit-error-color,#e62e5c)}.react-playground_error__1zi13{background-color:var(--bit-bg-color);border:1px solid var(--bit-error-color);border-bottom-right-radius:6px;border-left:none;border-top-right-radius:6px;bottom:0;box-sizing:border-box;color:var(--bit-error-color);font-family:Roboto mono;font-size:11px;left:0;overflow:auto;padding:8px;position:absolute;right:0;top:0;transition:all 1s ease-in-out;width:100%}.react-playground_error__1zi13.react-playground_column__1Kovw{border:1px solid var(--bit-error-color);border-bottom:none;border-bottom-right-radius:0;border-top-left-radius:6px}.react-playground_editorWrapper__1wY8s{max-height:450px;overflow:auto!important}.react-playground_codePane__19Xda{background-color:#282c34;max-width:-moz-fit-content;max-width:fit-content;max-width:90%;min-width:150px}.react-playground_codePane__19Xda.react-playground_column__1Kovw,.react-playground_codePane__19Xda.react-playground_column__1Kovw .react-playground_editorWrapper__1wY8s{height:220px;max-width:100%}.react-playground_editor__1LFjB{border-bottom-left-radius:6px;border-top-left-radius:6px;box-sizing:border-box;font-family:Roboto mono!important;font-size:11px;min-height:100px;width:-moz-fit-content;width:fit-content}.react-playground_editor__1LFjB>textarea{outline:none;white-space:pre!important;width:100%!important}.react-playground_editor__1LFjB>pre{white-space:pre!important;width:-moz-fit-content!important;width:fit-content!important}.react-playground_splitter__R480r{background-color:#282c34}.react-playground_splitter__R480r>div{border:none;border-radius:0}.react-playground_previewPane__1Rkn-{border:1px solid var(--bit-border-color-lightest);border-bottom-right-radius:6px;border-left:none;border-top-right-radius:6px;min-height:100px;overflow:auto;position:relative}.react-playground_previewPane__1Rkn-.react-playground_column__1Kovw{border:1px solid var(--bit-border-color-lightest);border-bottom:none;border-bottom-right-radius:0;border-top-left-radius:6px;min-height:220px}.react-playground_previewPane__1Rkn-.react-playground_column__1Kovw .react-playground_editorWrapper__1wY8s{max-height:220px}.react-playground_previewBox__1quIl{bottom:0;left:0;position:absolute;right:0;top:0}.react-playground_preview__1LvFd{border-left:none;box-sizing:border-box;height:100%;width:100%}.react-playground_playground__1mVdr{border-radius:6px;display:flex;max-height:450px;overflow:hidden;width:100%}.react-playground_playground__1mVdr>div{width:100%}.examples-overview_exampleSection__1OdhX>:not(:last-child){margin-bottom:8px}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(root,factory){typeof exports=="object"&&typeof module=="object"?module.exports=factory():typeof define=="function"&&define.amd?define([],factory):typeof exports=="object"?exports["teambit.harmony/aspect-preview"]=factory():root["teambit.harmony/aspect-preview"]=factory()})(self,function(){return(()=>{var __webpack_modules__={88244:module2=>{function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}module2.exports=_interopRequireDefault},
|
|
1
|
+
(function(root,factory){typeof exports=="object"&&typeof module=="object"?module.exports=factory():typeof define=="function"&&define.amd?define([],factory):typeof exports=="object"?exports["teambit.harmony/aspect-preview"]=factory():root["teambit.harmony/aspect-preview"]=factory()})(self,function(){return(()=>{var __webpack_modules__={88244:module2=>{function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}module2.exports=_interopRequireDefault},41131:(__unused_webpack_module,exports2,__webpack_require__2)=>{"use strict";var __bit_component={id:"teambit.harmony/aspect@0.0.882",homepage:"https://bit.dev/teambit/harmony/aspect",exported:!0},_interopRequireDefault=__webpack_require__2(88244);Object.defineProperty(exports2,"__esModule",{value:!0}),exports2.Logo=void 0;function _react(){const data=_interopRequireDefault(__webpack_require__2(63804));return _react=function(){return data},data}_react.__bit_component=__bit_component;const Logo=()=>_react().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},_react().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/aspect.svg"}));Logo.__bit_component=__bit_component,exports2.Logo=Logo},63804:module2=>{"use strict";module2.exports=React}},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(cachedModule!==void 0)return cachedModule.exports;var module2=__webpack_module_cache__[moduleId]={exports:{}};return __webpack_modules__[moduleId](module2,module2.exports,__webpack_require__),module2.exports}__webpack_require__.d=(exports2,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports2,key)&&Object.defineProperty(exports2,key,{enumerable:!0,get:definition[key]})},__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),__webpack_require__.r=exports2=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports2,"__esModule",{value:!0})};var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{compositions:()=>compositions,compositions_metadata:()=>compositions_metadata,overview:()=>overview});var aspect_docs_namespaceObject={};__webpack_require__.r(aspect_docs_namespaceObject),__webpack_require__.d(aspect_docs_namespaceObject,{default:()=>MDXContent});var aspect_composition=__webpack_require__(41131),external_React_=__webpack_require__(63804);const external_MdxJsReact_namespaceObject=MdxJsReact,external_TeambitMdxUiMdxScopeContext_namespaceObject=TeambitMdxUiMdxScopeContext;var _excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded),key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&(!Object.prototype.propertyIsEnumerable.call(source,key)||(target[key]=source[key]))}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.keys(source),key,i;for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],!(excluded.indexOf(key)>=0)&&(target[key]=source[key]);return target}var layoutProps={},MDXLayout="wrapper";function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,external_MdxJsReact_namespaceObject.mdx)(MDXLayout,_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,external_MdxJsReact_namespaceObject.mdx)(external_TeambitMdxUiMdxScopeContext_namespaceObject.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,external_MdxJsReact_namespaceObject.mdx)("h2",null,"Overview"),(0,external_MdxJsReact_namespaceObject.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.
|
|
2
2
|
Config is what the user entered, Data is a result of the aspect process.`),(0,external_MdxJsReact_namespaceObject.mdx)("h2",null,"Debugging aspects"),(0,external_MdxJsReact_namespaceObject.mdx)("p",null,"To help understanding why a component has these specific aspects, ",(0,external_MdxJsReact_namespaceObject.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.
|
|
3
3
|
The various sources are as follows:`),(0,external_MdxJsReact_namespaceObject.mdx)("pre",null,(0,external_MdxJsReact_namespaceObject.mdx)("code",{parentName:"pre"},`'BitmapFile'
|
|
4
4
|
'Model'
|
|
File without changes
|
package/dist/aspect.aspect.js
CHANGED
|
@@ -4,21 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.AspectAspect = void 0;
|
|
7
|
-
|
|
8
7
|
function _harmony() {
|
|
9
8
|
const data = require("@teambit/harmony");
|
|
10
|
-
|
|
11
9
|
_harmony = function () {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
const AspectAspect = _harmony().Aspect.create({
|
|
19
15
|
id: 'teambit.harmony/aspect'
|
|
20
16
|
});
|
|
21
|
-
|
|
22
17
|
exports.AspectAspect = AspectAspect;
|
|
23
18
|
|
|
24
19
|
//# sourceMappingURL=aspect.aspect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AspectAspect","Aspect","create","id"],"sources":["aspect.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const AspectAspect = Aspect.create({\n id: 'teambit.harmony/aspect',\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["AspectAspect","Aspect","create","id"],"sources":["aspect.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const AspectAspect = Aspect.create({\n id: 'teambit.harmony/aspect',\n});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,YAAY,GAAGC,iBAAM,CAACC,MAAM,CAAC;EACxCC,EAAE,EAAE;AACN,CAAC,CAAC;AAAC"}
|
package/dist/aspect.cmd.js
CHANGED
|
@@ -1,47 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.array.iterator.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.promise.js");
|
|
8
|
-
|
|
9
6
|
Object.defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
9
|
exports.UpdateAspectCmd = exports.UnsetAspectCmd = exports.SetAspectCmd = exports.ListAspectCmd = exports.GetAspectCmd = exports.AspectCmd = void 0;
|
|
13
|
-
|
|
14
10
|
function _defineProperty2() {
|
|
15
11
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
|
|
17
12
|
_defineProperty2 = function () {
|
|
18
13
|
return data;
|
|
19
14
|
};
|
|
20
|
-
|
|
21
15
|
return data;
|
|
22
16
|
}
|
|
23
|
-
|
|
24
17
|
function _cliTable() {
|
|
25
18
|
const data = require("@teambit/cli-table");
|
|
26
|
-
|
|
27
19
|
_cliTable = function () {
|
|
28
20
|
return data;
|
|
29
21
|
};
|
|
30
|
-
|
|
31
22
|
return data;
|
|
32
23
|
}
|
|
33
|
-
|
|
34
24
|
function _chalk() {
|
|
35
25
|
const data = _interopRequireDefault(require("chalk"));
|
|
36
|
-
|
|
37
26
|
_chalk = function () {
|
|
38
27
|
return data;
|
|
39
28
|
};
|
|
40
|
-
|
|
41
29
|
return data;
|
|
42
30
|
}
|
|
43
|
-
|
|
44
31
|
// eslint-disable-next-line max-classes-per-file
|
|
32
|
+
|
|
45
33
|
class ListAspectCmd {
|
|
46
34
|
constructor(aspect) {
|
|
47
35
|
this.aspect = aspect;
|
|
@@ -54,7 +42,6 @@ class ListAspectCmd {
|
|
|
54
42
|
(0, _defineProperty2().default)(this, "options", [['d', 'debug', 'show the origins were the aspects were taken from']]);
|
|
55
43
|
(0, _defineProperty2().default)(this, "group", 'development');
|
|
56
44
|
}
|
|
57
|
-
|
|
58
45
|
async report([name], {
|
|
59
46
|
debug
|
|
60
47
|
}) {
|
|
@@ -71,11 +58,8 @@ class ListAspectCmd {
|
|
|
71
58
|
const table = new (_cliTable().CLITable)([], rows);
|
|
72
59
|
return table.render();
|
|
73
60
|
}
|
|
74
|
-
|
|
75
61
|
}
|
|
76
|
-
|
|
77
62
|
exports.ListAspectCmd = ListAspectCmd;
|
|
78
|
-
|
|
79
63
|
class SetAspectCmd {
|
|
80
64
|
constructor(aspect) {
|
|
81
65
|
this.aspect = aspect;
|
|
@@ -94,18 +78,14 @@ class SetAspectCmd {
|
|
|
94
78
|
(0, _defineProperty2().default)(this, "options", [['m', 'merge', 'merge with an existing config if exits. (by default, it replaces the config)']]);
|
|
95
79
|
(0, _defineProperty2().default)(this, "group", 'development');
|
|
96
80
|
}
|
|
97
|
-
|
|
98
81
|
async report([pattern, aspectId, config], options) {
|
|
99
82
|
const configParsed = config ? JSON.parse(config) : {};
|
|
100
83
|
const results = await this.aspect.setAspectsToComponents(pattern, aspectId, configParsed, options);
|
|
101
84
|
if (!results.length) return _chalk().default.yellow(`unable to find any matching for ${_chalk().default.bold(pattern)} pattern`);
|
|
102
85
|
return _chalk().default.green(`the following component(s) have been successfully updated:\n${results.join('\n')}`);
|
|
103
86
|
}
|
|
104
|
-
|
|
105
87
|
}
|
|
106
|
-
|
|
107
88
|
exports.SetAspectCmd = SetAspectCmd;
|
|
108
|
-
|
|
109
89
|
class UpdateAspectCmd {
|
|
110
90
|
constructor(aspect) {
|
|
111
91
|
this.aspect = aspect;
|
|
@@ -128,28 +108,21 @@ class UpdateAspectCmd {
|
|
|
128
108
|
(0, _defineProperty2().default)(this, "options", []);
|
|
129
109
|
(0, _defineProperty2().default)(this, "group", 'development');
|
|
130
110
|
}
|
|
131
|
-
|
|
132
111
|
async report([aspectId, pattern]) {
|
|
133
112
|
const {
|
|
134
113
|
updated,
|
|
135
114
|
alreadyUpToDate
|
|
136
115
|
} = await this.aspect.updateAspectsToComponents(aspectId, pattern);
|
|
137
|
-
|
|
138
116
|
if (updated.length) {
|
|
139
117
|
return _chalk().default.green(`the following component(s) have been successfully updated:\n${updated.join('\n')}`);
|
|
140
118
|
}
|
|
141
|
-
|
|
142
119
|
if (alreadyUpToDate.length) {
|
|
143
120
|
return _chalk().default.green(`all ${alreadyUpToDate.length} component(s) that use this aspect are already up to date. nothing to update`);
|
|
144
121
|
}
|
|
145
|
-
|
|
146
122
|
return _chalk().default.yellow(`unable to find any component that use ${_chalk().default.bold(aspectId)}`);
|
|
147
123
|
}
|
|
148
|
-
|
|
149
124
|
}
|
|
150
|
-
|
|
151
125
|
exports.UpdateAspectCmd = UpdateAspectCmd;
|
|
152
|
-
|
|
153
126
|
class UnsetAspectCmd {
|
|
154
127
|
constructor(aspect) {
|
|
155
128
|
this.aspect = aspect;
|
|
@@ -165,17 +138,13 @@ class UnsetAspectCmd {
|
|
|
165
138
|
(0, _defineProperty2().default)(this, "options", []);
|
|
166
139
|
(0, _defineProperty2().default)(this, "group", 'development');
|
|
167
140
|
}
|
|
168
|
-
|
|
169
141
|
async report([pattern, aspectId]) {
|
|
170
142
|
const results = await this.aspect.unsetAspectsFromComponents(pattern, aspectId);
|
|
171
143
|
if (!results.length) return _chalk().default.yellow(`unable to find any matching for ${_chalk().default.bold(pattern)} pattern`);
|
|
172
144
|
return _chalk().default.green(`the following component(s) have been successfully updated:\n${results.join('\n')}`);
|
|
173
145
|
}
|
|
174
|
-
|
|
175
146
|
}
|
|
176
|
-
|
|
177
147
|
exports.UnsetAspectCmd = UnsetAspectCmd;
|
|
178
|
-
|
|
179
148
|
class GetAspectCmd {
|
|
180
149
|
constructor(aspect) {
|
|
181
150
|
this.aspect = aspect;
|
|
@@ -188,7 +157,6 @@ class GetAspectCmd {
|
|
|
188
157
|
(0, _defineProperty2().default)(this, "options", [['d', 'debug', 'show the origins were the aspects were taken from'], ['j', 'json', 'format as json']]);
|
|
189
158
|
(0, _defineProperty2().default)(this, "group", 'development');
|
|
190
159
|
}
|
|
191
|
-
|
|
192
160
|
async report([componentName], {
|
|
193
161
|
debug
|
|
194
162
|
}) {
|
|
@@ -204,7 +172,6 @@ ${_chalk().default.bold('config:')} ${JSON.stringify(config, undefined, 2)}
|
|
|
204
172
|
${_chalk().default.bold('data:')} ${JSON.stringify(data, undefined, 2)}
|
|
205
173
|
`;
|
|
206
174
|
}).join('\n');
|
|
207
|
-
|
|
208
175
|
if (debug) {
|
|
209
176
|
const {
|
|
210
177
|
aspects,
|
|
@@ -217,27 +184,20 @@ ${_chalk().default.bold('data:')} ${JSON.stringify(data, undefined, 2)}
|
|
|
217
184
|
extraData
|
|
218
185
|
}) => {
|
|
219
186
|
const title = _chalk().default.green.bold(`Origin: ${origin}`);
|
|
220
|
-
|
|
221
187
|
const details = extensionsDetailsToString(extensions);
|
|
222
188
|
const moreData = extraData ? `\n${_chalk().default.bold('Extra Data:')} ${JSON.stringify(extraData, undefined, 2)}` : '';
|
|
223
189
|
return `${title}\n${details}${moreData}`;
|
|
224
190
|
}).join('\n\n');
|
|
225
|
-
|
|
226
191
|
const afterMergeTitle = _chalk().default.green.bold('After merging the origins above');
|
|
227
|
-
|
|
228
192
|
const afterMergeOutput = `${afterMergeTitle}\n${extensionsDetailsToString(mergedExtensions)}`;
|
|
229
|
-
|
|
230
193
|
const afterFinalMergeTitle = _chalk().default.green.bold('Final - After merging the origin above and the loaded data');
|
|
231
|
-
|
|
232
194
|
const afterFinalMergeOutput = `${afterFinalMergeTitle}\n${extensionsDetailsToString(aspects.toLegacy())}`;
|
|
233
195
|
return `${beforeMergeOutput}\n\n${afterMergeOutput}\n\n\n${afterFinalMergeOutput}`;
|
|
234
196
|
}
|
|
235
|
-
|
|
236
197
|
const aspects = await this.aspect.getAspectsOfComponent(componentName);
|
|
237
198
|
const extensionDataList = aspects.toLegacy();
|
|
238
199
|
return extensionsDetailsToString(extensionDataList);
|
|
239
200
|
}
|
|
240
|
-
|
|
241
201
|
async json([componentName], {
|
|
242
202
|
debug
|
|
243
203
|
}) {
|
|
@@ -256,7 +216,6 @@ ${_chalk().default.bold('data:')} ${JSON.stringify(data, undefined, 2)}
|
|
|
256
216
|
};
|
|
257
217
|
return acc;
|
|
258
218
|
}, {});
|
|
259
|
-
|
|
260
219
|
if (debug) {
|
|
261
220
|
const {
|
|
262
221
|
aspects,
|
|
@@ -282,15 +241,11 @@ ${_chalk().default.bold('data:')} ${JSON.stringify(data, undefined, 2)}
|
|
|
282
241
|
};
|
|
283
242
|
return jsonObj;
|
|
284
243
|
}
|
|
285
|
-
|
|
286
244
|
const aspects = await this.aspect.getAspectsOfComponent(componentName);
|
|
287
245
|
return extensionsDetailsToObject(aspects.toLegacy());
|
|
288
246
|
}
|
|
289
|
-
|
|
290
247
|
}
|
|
291
|
-
|
|
292
248
|
exports.GetAspectCmd = GetAspectCmd;
|
|
293
|
-
|
|
294
249
|
class AspectCmd {
|
|
295
250
|
constructor() {
|
|
296
251
|
(0, _defineProperty2().default)(this, "name", 'aspect <sub-command>');
|
|
@@ -300,13 +255,10 @@ class AspectCmd {
|
|
|
300
255
|
(0, _defineProperty2().default)(this, "group", 'development');
|
|
301
256
|
(0, _defineProperty2().default)(this, "commands", []);
|
|
302
257
|
}
|
|
303
|
-
|
|
304
258
|
async report([unrecognizedSubcommand]) {
|
|
305
259
|
return _chalk().default.red(`"${unrecognizedSubcommand}" is not a subcommand of "aspect", please run "bit aspect --help" to list the subcommands`);
|
|
306
260
|
}
|
|
307
|
-
|
|
308
261
|
}
|
|
309
|
-
|
|
310
262
|
exports.AspectCmd = AspectCmd;
|
|
311
263
|
|
|
312
264
|
//# sourceMappingURL=aspect.cmd.js.map
|
package/dist/aspect.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ListAspectCmd","constructor","aspect","name","description","report","debug","listAspectsResults","listAspectsOfComponent","rows","Object","keys","map","componentId","longestAspectName","Math","max","_","aspectName","length","aspects","aspectSource","origin","source","padEnd","level","join","table","CLITable","render","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","e","data","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 { 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:\n 'component name, component id, or component pattern. use component pattern to select multiple components. \\nuse comma to separate patterns and \"!\" to exclude. e.g. \"ui/**, !ui/button\"\\nwrap the pattern with quotes',\n },\n ];\n options = [['d', 'debug', 'show the origins were 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:\n 'the components to extend. use component name, component id, or component pattern. use component pattern to select multiple components. use comma to separate patterns and \"!\" to exclude. e.g. \"ui/**, !ui/button\". wrap the pattern with quotes',\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 the config)'],\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) return chalk.yellow(`unable to find any matching 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';\n arguments = [\n {\n name: 'aspect-id',\n description:\n \"the aspect's component id. optionally, add a version (id@version), otherwise, it finds the latest version on the remote\",\n },\n {\n name: 'pattern',\n description:\n 'the components to update (defaults to all components). use component name, component id, or component pattern. use component pattern to select multiple components. use comma to separate patterns and \"!\" to exclude. e.g. \"ui/**, !ui/button\". wrap the pattern with quotes',\n },\n ];\n examples = [\n {\n cmd: \"update scope.org/aspect '**/ui/**'\",\n description: 'update \"ui\" components 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: 'update all components that use scope.org/aspect to version 2.0.0 (of this 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 component 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:\n 'the components to target. use component name, component id, or component pattern. use component pattern to select multiple components. use comma to separate patterns and \"!\" to exclude. e.g. \"ui/**, !ui/button\". wrap the pattern with quotes',\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) return chalk.yellow(`unable to find any matching 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 config and data';\n arguments = [\n {\n name: 'component-name',\n description: 'the component name or component id',\n },\n ];\n options = [\n ['d', 'debug', 'show the origins were 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 origin 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 = 'EXPERIMENTAL. 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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAHA;AAOO,MAAMA,aAAN,CAAuC;EAa5CC,WAAW,CAASC,MAAT,EAA6B;IAAA,KAApBA,MAAoB,GAApBA,MAAoB;IAAA,8CAZjC,gBAYiC;IAAA,qDAX1B,6CAW0B;IAAA,mDAV5B,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AEwB,yBAAyB,CAACxB,UAAD,CADrB;UAEhBY;QAFgB,CAAlB;MAID,CALD;MAOAgB,OAAO,CAACE,UAAR,GAAqB;QAAE9B,UAAU,EAAEwB,yBAAyB,CAAChB,gBAAD;MAAvC,CAArB;MACAoB,OAAO,CAACG,0BAAR,GAAqC;QAAE/B,UAAU,EAAEwB,yBAAyB,CAAC1D,OAAO,CAACsD,QAAR,EAAD;MAAvC,CAArC;MACA,OAAOQ,OAAP;IACD;;IAED,MAAM9D,OAAO,GAAG,MAAM,KAAKlB,MAAL,CAAYyE,qBAAZ,CAAkCvB,aAAlC,CAAtB;IAEA,OAAO0B,yBAAyB,CAAC1D,OAAO,CAACsD,QAAR,EAAD,CAAhC;EACD;;AA5F0C;;;;AA+FtC,MAAMY,SAAN,CAAmC;EAAA;IAAA,8CACjC,sBADiC;IAAA,+CAEhC,EAFgC;IAAA,qDAG1B,8BAH0B;IAAA,iDAI9B,EAJ8B;IAAA,+CAKhC,aALgC;IAAA,kDAMlB,EANkB;EAAA;;EAQ5B,MAANjF,MAAM,CAAC,CAACkF,sBAAD,CAAD,EAAqC;IAC/C,OAAO/C,gBAAA,CAAMgD,GAAN,CACJ,IAAGD,sBAAuB,2FADtB,CAAP;EAGD;;AAZuC"}
|
|
1
|
+
{"version":3,"names":["ListAspectCmd","constructor","aspect","name","description","report","debug","listAspectsResults","listAspectsOfComponent","rows","Object","keys","map","componentId","longestAspectName","Math","max","_","aspectName","length","aspects","aspectSource","origin","source","padEnd","level","join","table","CLITable","render","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","e","data","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 { 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:\n 'component name, component id, or component pattern. use component pattern to select multiple components. \\nuse comma to separate patterns and \"!\" to exclude. e.g. \"ui/**, !ui/button\"\\nwrap the pattern with quotes',\n },\n ];\n options = [['d', 'debug', 'show the origins were 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:\n 'the components to extend. use component name, component id, or component pattern. use component pattern to select multiple components. use comma to separate patterns and \"!\" to exclude. e.g. \"ui/**, !ui/button\". wrap the pattern with quotes',\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 the config)'],\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) return chalk.yellow(`unable to find any matching 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';\n arguments = [\n {\n name: 'aspect-id',\n description:\n \"the aspect's component id. optionally, add a version (id@version), otherwise, it finds the latest version on the remote\",\n },\n {\n name: 'pattern',\n description:\n 'the components to update (defaults to all components). use component name, component id, or component pattern. use component pattern to select multiple components. use comma to separate patterns and \"!\" to exclude. e.g. \"ui/**, !ui/button\". wrap the pattern with quotes',\n },\n ];\n examples = [\n {\n cmd: \"update scope.org/aspect '**/ui/**'\",\n description: 'update \"ui\" components 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: 'update all components that use scope.org/aspect to version 2.0.0 (of this 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 component 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:\n 'the components to target. use component name, component id, or component pattern. use component pattern to select multiple components. use comma to separate patterns and \"!\" to exclude. e.g. \"ui/**, !ui/button\". wrap the pattern with quotes',\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) return chalk.yellow(`unable to find any matching 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 config and data';\n arguments = [\n {\n name: 'component-name',\n description: 'the component name or component id',\n },\n ];\n options = [\n ['d', 'debug', 'show the origins were 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 origin 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 = 'EXPERIMENTAL. 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;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAHA;;AAOO,MAAMA,aAAa,CAAoB;EAa5CC,WAAW,CAASC,MAAkB,EAAE;IAAA,KAApBA,MAAkB,GAAlBA,MAAkB;IAAA,8CAZ/B,gBAAgB;IAAA,qDACT,6CAA6C;IAAA,mDAC/C,CACV;MACEC,IAAI,EAAE,SAAS;MACfC,WAAW,EACT;IACJ,CAAC,CACF;IAAA,iDACS,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,mDAAmD,CAAC,CAAC;IAAA,+CACvE,aAAa;EAEoB;EAEzC,MAAMC,MAAM,CAAC,CAACF,IAAI,CAAW,EAAE;IAAEG;EAA0B,CAAC,EAAE;IAC5D,MAAMC,kBAAkB,GAAG,MAAM,IAAI,CAACL,MAAM,CAACM,sBAAsB,CAACL,IAAI,CAAC;IACzE,MAAMM,IAAI,GAAGC,MAAM,CAACC,IAAI,CAACJ,kBAAkB,CAAC,CAACK,GAAG,CAAEC,WAAW,IAAK;MAChE,MAAMC,iBAAiB,GAAGC,IAAI,CAACC,GAAG,CAAC,GAAGT,kBAAkB,CAACM,WAAW,CAAC,CAACD,GAAG,CAAEK,CAAC,IAAKA,CAAC,CAACC,UAAU,CAACC,MAAM,CAAC,CAAC;MACtG,MAAMC,OAAO,GAAGb,kBAAkB,CAACM,WAAW,CAAC,CAC5CD,GAAG,CAAES,YAAY,IAAK;QACrB,MAAMC,MAAM,GAAGhB,KAAK,GAAI,aAAYe,YAAY,CAACE,MAAO,GAAE,GAAG,EAAE;QAC/D,MAAML,UAAU,GAAGG,YAAY,CAACH,UAAU,CAACM,MAAM,CAACV,iBAAiB,CAAC;QACpE,OAAQ,GAAEI,UAAW,YAAWG,YAAY,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I,CAAC7D,MAAM,CAAC8D,iCAAiC,CAACZ,aAAa,CAAC;MACtE,MAAM8B,OAA4B,GAAG,CAAC,CAAC;MACvCnB,WAAW,CAACoB,OAAO,CAAC,CAAC;QAAE7D,MAAM;QAAEgC,UAAU;QAAEY;MAAU,CAAC,KAAK;QACzDgB,OAAO,CAAC5D,MAAM,CAAC,GAAG;UAChBgC,UAAU,EAAEwB,yBAAyB,CAACxB,UAAU,CAAC;UACjDY;QACF,CAAC;MACH,CAAC,CAAC;MAEFgB,OAAO,CAACE,UAAU,GAAG;QAAE9B,UAAU,EAAEwB,yBAAyB,CAAChB,gBAAgB;MAAE,CAAC;MAChFoB,OAAO,CAACG,0BAA0B,GAAG;QAAE/B,UAAU,EAAEwB,yBAAyB,CAAC1D,OAAO,CAACsD,QAAQ,EAAE;MAAE,CAAC;MAClG,OAAOQ,OAAO;IAChB;IAEA,MAAM9D,OAAO,GAAG,MAAM,IAAI,CAAClB,MAAM,CAACyE,qBAAqB,CAACvB,aAAa,CAAC;IAEtE,OAAO0B,yBAAyB,CAAC1D,OAAO,CAACsD,QAAQ,EAAE,CAAC;EACtD;AACF;AAAC;AAEM,MAAMY,SAAS,CAAoB;EAAA;IAAA,8CACjC,sBAAsB;IAAA,+CACrB,EAAE;IAAA,qDACI,8BAA8B;IAAA,iDAClC,EAAE;IAAA,+CACJ,aAAa;IAAA,kDACC,EAAE;EAAA;EAExB,MAAMjF,MAAM,CAAC,CAACkF,sBAAsB,CAAW,EAAE;IAC/C,OAAO/C,gBAAK,CAACgD,GAAG,CACb,IAAGD,sBAAuB,2FAA0F,CACtH;EACH;AACF;AAAC"}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.Logo = void 0;
|
|
9
|
-
|
|
10
8
|
function _react() {
|
|
11
9
|
const data = _interopRequireDefault(require("react"));
|
|
12
|
-
|
|
13
10
|
_react = function () {
|
|
14
11
|
return data;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
return data;
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
|
|
21
16
|
style: {
|
|
22
17
|
height: '100%',
|
|
@@ -29,7 +24,6 @@ const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
|
|
|
29
24
|
},
|
|
30
25
|
src: "https://static.bit.dev/extensions-icons/aspect.svg"
|
|
31
26
|
}));
|
|
32
|
-
|
|
33
27
|
exports.Logo = Logo;
|
|
34
28
|
|
|
35
29
|
//# sourceMappingURL=aspect.composition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Logo","height","display","justifyContent","width"],"sources":["aspect.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/aspect.svg\" />\n </div>\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["Logo","height","display","justifyContent","width"],"sources":["aspect.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/aspect.svg\" />\n </div>\n);\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,IAAI,GAAG,mBAClB;EAAK,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxE;EAAK,KAAK,EAAE;IAAEC,KAAK,EAAE;EAAG,CAAE;EAAC,GAAG,EAAC;AAAoD,EAAG,CAEzF;AAAC"}
|
package/dist/aspect.env.js
CHANGED
|
@@ -1,122 +1,98 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.promise.js");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.AspectEnvType = exports.AspectEnv = void 0;
|
|
11
|
-
|
|
12
9
|
function _defineProperty2() {
|
|
13
10
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
-
|
|
15
11
|
_defineProperty2 = function () {
|
|
16
12
|
return data;
|
|
17
13
|
};
|
|
18
|
-
|
|
19
14
|
return data;
|
|
20
15
|
}
|
|
21
|
-
|
|
22
16
|
function _lodash() {
|
|
23
17
|
const data = require("lodash");
|
|
24
|
-
|
|
25
18
|
_lodash = function () {
|
|
26
19
|
return data;
|
|
27
20
|
};
|
|
28
|
-
|
|
29
21
|
return data;
|
|
30
22
|
}
|
|
31
|
-
|
|
32
23
|
function _builder() {
|
|
33
24
|
const data = require("@teambit/builder");
|
|
34
|
-
|
|
35
25
|
_builder = function () {
|
|
36
26
|
return data;
|
|
37
27
|
};
|
|
38
|
-
|
|
39
28
|
return data;
|
|
40
29
|
}
|
|
41
|
-
|
|
42
30
|
const tsconfig = require('./typescript/tsconfig.json');
|
|
43
|
-
|
|
44
31
|
const AspectEnvType = 'aspect';
|
|
32
|
+
|
|
45
33
|
/**
|
|
46
34
|
* a component environment built for Aspects .
|
|
47
35
|
*/
|
|
48
|
-
|
|
49
36
|
exports.AspectEnvType = AspectEnvType;
|
|
50
|
-
|
|
51
37
|
class AspectEnv {
|
|
52
38
|
constructor(reactEnv, aspectLoader) {
|
|
53
39
|
this.reactEnv = reactEnv;
|
|
54
40
|
this.aspectLoader = aspectLoader;
|
|
55
41
|
(0, _defineProperty2().default)(this, "icon", 'https://static.bit.dev/extensions-icons/default.svg');
|
|
56
42
|
}
|
|
57
|
-
|
|
58
43
|
async __getDescriptor() {
|
|
59
44
|
return {
|
|
60
45
|
type: AspectEnvType
|
|
61
46
|
};
|
|
62
47
|
}
|
|
63
|
-
|
|
64
48
|
getTsConfig(tsConfig) {
|
|
65
49
|
const targetConf = (0, _lodash().merge)(tsconfig, tsConfig);
|
|
66
50
|
return targetConf;
|
|
67
|
-
}
|
|
68
|
-
// 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
|
|
69
|
-
|
|
51
|
+
}
|
|
70
52
|
|
|
53
|
+
// TODO: should probably use the transformer from the main runtime?
|
|
54
|
+
// 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
|
|
71
55
|
createTsCompiler(tsConfig) {
|
|
72
56
|
return this.reactEnv.getTsCjsCompiler(this.getTsConfig(tsConfig));
|
|
73
57
|
}
|
|
58
|
+
|
|
74
59
|
/**
|
|
75
60
|
* returns a component tester.
|
|
76
61
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
62
|
getTester(jestConfigPath, jestModulePath) {
|
|
80
63
|
const config = jestConfigPath || require.resolve('@teambit/node/jest/jest.config');
|
|
81
|
-
|
|
82
64
|
return this.reactEnv.getCjsJestTester(config, jestModulePath);
|
|
83
65
|
}
|
|
84
|
-
|
|
85
66
|
async getTemplateBundler(context, transformers = []) {
|
|
86
67
|
return this.createTemplateWebpackBundler(context, transformers);
|
|
87
68
|
}
|
|
88
|
-
|
|
89
69
|
async createTemplateWebpackBundler(context, transformers = []) {
|
|
90
70
|
return this.reactEnv.createTemplateWebpackBundler(context, transformers);
|
|
91
71
|
}
|
|
92
|
-
|
|
93
72
|
getPackageJsonProps() {
|
|
94
73
|
return this.reactEnv.getCjsPackageJsonProps();
|
|
95
74
|
}
|
|
96
|
-
|
|
97
75
|
getNpmIgnore(context) {
|
|
98
76
|
// ignores only .ts files in the root directory, so d.ts files inside dists are unaffected.
|
|
99
77
|
// without this change, the package has "index.ts" file in the root, causing typescript to parse it instead of the
|
|
100
78
|
// d.ts files. (changing the "types" prop in the package.json file doesn't help).
|
|
101
|
-
const patterns = ['/*.ts', `${_builder().CAPSULE_ARTIFACTS_DIR}/`];
|
|
79
|
+
const patterns = ['/*.ts', `${_builder().CAPSULE_ARTIFACTS_DIR}/`];
|
|
80
|
+
|
|
81
|
+
// In order to load the env preview template from core aspects we need it to be in the package of the core envs
|
|
102
82
|
// 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
|
|
103
83
|
// as this will be excluded from the package tar by default (as it's under the CAPSULE_ARTIFACTS_DIR)
|
|
104
84
|
// we want to make sure to add it for the core envs
|
|
105
|
-
|
|
106
85
|
if (context && this.aspectLoader.isCoreEnv(context.component.id.toStringWithoutVersion())) {
|
|
107
86
|
patterns.push(`!${_builder().CAPSULE_ARTIFACTS_DIR}/env-template`);
|
|
108
87
|
}
|
|
109
|
-
|
|
110
88
|
return patterns;
|
|
111
89
|
}
|
|
112
|
-
|
|
113
90
|
getPreviewConfig() {
|
|
114
91
|
return {
|
|
115
92
|
strategyName: 'component',
|
|
116
93
|
splitComponentBundle: false
|
|
117
94
|
};
|
|
118
95
|
}
|
|
119
|
-
|
|
120
96
|
async getDependencies() {
|
|
121
97
|
return {
|
|
122
98
|
dependencies: {
|
|
@@ -144,9 +120,7 @@ class AspectEnv {
|
|
|
144
120
|
}
|
|
145
121
|
};
|
|
146
122
|
}
|
|
147
|
-
|
|
148
123
|
}
|
|
149
|
-
|
|
150
124
|
exports.AspectEnv = AspectEnv;
|
|
151
125
|
|
|
152
126
|
//# sourceMappingURL=aspect.env.js.map
|
package/dist/aspect.env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["tsconfig","require","AspectEnvType","AspectEnv","constructor","reactEnv","aspectLoader","__getDescriptor","type","getTsConfig","tsConfig","targetConf","merge","createTsCompiler","getTsCjsCompiler","getTester","jestConfigPath","jestModulePath","config","resolve","getCjsJestTester","getTemplateBundler","context","transformers","createTemplateWebpackBundler","getPackageJsonProps","getCjsPackageJsonProps","getNpmIgnore","patterns","CAPSULE_ARTIFACTS_DIR","isCoreEnv","component","id","toStringWithoutVersion","push","getPreviewConfig","strategyName","splitComponentBundle","getDependencies","dependencies","react","devDependencies","peerDependencies"],"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';\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) {}\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('@teambit/node/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 this.reactEnv.getCjsPackageJsonProps();\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 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 return patterns;\n }\n\n getPreviewConfig() {\n return {\n strategyName: 'component',\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.12.18',\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"],"mappings":"
|
|
1
|
+
{"version":3,"names":["tsconfig","require","AspectEnvType","AspectEnv","constructor","reactEnv","aspectLoader","__getDescriptor","type","getTsConfig","tsConfig","targetConf","merge","createTsCompiler","getTsCjsCompiler","getTester","jestConfigPath","jestModulePath","config","resolve","getCjsJestTester","getTemplateBundler","context","transformers","createTemplateWebpackBundler","getPackageJsonProps","getCjsPackageJsonProps","getNpmIgnore","patterns","CAPSULE_ARTIFACTS_DIR","isCoreEnv","component","id","toStringWithoutVersion","push","getPreviewConfig","strategyName","splitComponentBundle","getDependencies","dependencies","react","devDependencies","peerDependencies"],"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';\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) {}\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('@teambit/node/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 this.reactEnv.getCjsPackageJsonProps();\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 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 return patterns;\n }\n\n getPreviewConfig() {\n return {\n strategyName: 'component',\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.12.18',\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"],"mappings":";;;;;;;;;;;;;;;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAMA,MAAMA,QAAQ,GAAGC,OAAO,CAAC,4BAA4B,CAAC;AAE/C,MAAMC,aAAa,GAAG,QAAQ;;AAErC;AACA;AACA;AAFA;AAGO,MAAMC,SAAS,CAAoD;EACxEC,WAAW,CAASC,QAAkB,EAAUC,YAA8B,EAAE;IAAA,KAA5DD,QAAkB,GAAlBA,QAAkB;IAAA,KAAUC,YAA8B,GAA9BA,YAA8B;IAAA,8CAEvE,qDAAqD;EAFqB;EAIjF,MAAMC,eAAe,GAAG;IACtB,OAAO;MACLC,IAAI,EAAEN;IACR,CAAC;EACH;EAEAO,WAAW,CAACC,QAA4B,EAAE;IACxC,MAAMC,UAAU,GAAG,IAAAC,eAAK,EAACZ,QAAQ,EAAEU,QAAQ,CAAC;IAC5C,OAAOC,UAAU;EACnB;;EAEA;EACA;EACAE,gBAAgB,CAACH,QAA4B,EAAY;IACvD,OAAO,IAAI,CAACL,QAAQ,CAACS,gBAAgB,CAAC,IAAI,CAACL,WAAW,CAACC,QAAQ,CAAC,CAAC;EACnE;;EAEA;AACF;AACA;EACEK,SAAS,CAACC,cAAsB,EAAEC,cAAuB,EAAU;IACjE,MAAMC,MAAM,GAAGF,cAAc,IAAIf,OAAO,CAACkB,OAAO,CAAC,gCAAgC,CAAC;IAClF,OAAO,IAAI,CAACd,QAAQ,CAACe,gBAAgB,CAACF,MAAM,EAAED,cAAc,CAAC;EAC/D;EAEA,MAAMI,kBAAkB,CAACC,OAAuB,EAAEC,YAAwC,GAAG,EAA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