@teambit/compiler 1.0.203 → 1.0.204

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.
@@ -1,4 +1,4 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="0" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.compilation/compiler@1.0.203" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.compilation/compiler@1.0.204" tests="0" failures="0" errors="0" skipped="0"/>
4
4
  </testsuites>
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["teambit.compilation/compiler-preview"]=n():e["teambit.compilation/compiler-preview"]=n()}(self,(()=>(()=>{"use strict";var e={73077:(e,n,t)=>{var o={id:"teambit.compilation/content/compiler-overview@1.95.0",homepage:"https://bit.dev/teambit/compilation/content/compiler-overview",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=u,p(t(41594));var i=t(5016),r=t(65682),a=["components"];function p(e){return e&&e.__esModule?e:{default:e}}function m(){return m=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},m.apply(this,arguments)}function l(e,n){if(null==e)return{};var t,o,i=d(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function d(e,n){if(null==e)return{};var t,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||(i[t]=e[t]);return i}p.__bit_component=o,m.__bit_component=o,l.__bit_component=o,d.__bit_component=o;var c={},s="wrapper";function u(e){var n=e.components,t=l(e,a);return(0,i.mdx)(s,m({},c,t,{components:n,mdxType:"MDXLayout"}),(0,i.mdx)(r.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,i.mdx)("h1",null,"Compiler overview"),(0,i.mdx)("p",null,"The Compiler aspect provides a single interface for Component compilation, ",(0,i.mdx)("a",{parentName:"p",href:"/"},"during development")," and ",(0,i.mdx)("a",{parentName:"p",href:"/"},"during build"),".\nIt enables you to use the same commands and APIs to compile any Component, regardless of the specific compiler it uses."),(0,i.mdx)("div",{className:"admonition admonition-info alert alert--info"},(0,i.mdx)("div",{parentName:"div",className:"admonition-heading"},(0,i.mdx)("h5",{parentName:"div"},(0,i.mdx)("span",{parentName:"h5",className:"admonition-icon"},(0,i.mdx)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,i.mdx)("path",{parentName:"svg",fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))),"info")),(0,i.mdx)("div",{parentName:"div",className:"admonition-content"},(0,i.mdx)("p",{parentName:"div"},"The specific compiler used by a Component (",(0,i.mdx)("a",{parentName:"p",href:"/"},"Babel"),", ",(0,i.mdx)("a",{parentName:"p",href:"/"},"TypeScript"),", and so on) is set by the Component's Env."))),(0,i.mdx)("h2",null,"Compiling during development"),(0,i.mdx)("p",null,"Run the following to compile all your Workspace Components:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-bash"},"bit compile\n")),(0,i.mdx)("p",null,"The following output lists the compilation results in a single format:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-bash"}," STATUS COMPONENT ID\n✔ SUCCESS apps/bit-dev\n✔ SUCCESS blocks/component/architecture-breakdown\n✔ SUCCESS blocks/footer\n✔ SUCCESS blocks/header\n✔ SUCCESS buttons/button\n✔ SUCCESS content/adding-components\n")),(0,i.mdx)("p",null,"To 'watch' Components for changes, and to auto-compile modified Components, run:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre"},"bit watch\n")),(0,i.mdx)("p",null,"The compiled code is written into each Component's corresponding package, in the ",(0,i.mdx)("a",{parentName:"p",href:"/dependencies/node-modules"},(0,i.mdx)("inlineCode",{parentName:"a"},"node_modules")," directory")," of your workspace.\nFor example, the compiled code for ",(0,i.mdx)("inlineCode",{parentName:"p"},"company.scope/ui/text")," will be found in the ",(0,i.mdx)("inlineCode",{parentName:"p"},"./node_modules/@company/scope.ui.text/dist")," directory (inside your workspace)."),(0,i.mdx)("p",null,"To learn more about compilation in the Workspace, see ",(0,i.mdx)("a",{parentName:"p",href:"/"},"'Compiling during development'"),"."),(0,i.mdx)("h2",null,"Compiling during build"),(0,i.mdx)("p",null,"Run the following to compile Components as part of the ",(0,i.mdx)("a",{parentName:"p",href:"/"},"build pipeline")," (which prepares Components for distribution):"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-bash"},"bit build\n")),(0,i.mdx)("p",null,"The output to the terminal details the specific compilers being used, as well as the Envs that use them:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-bash"},'...\n✔ env "teambit.harmony/aspect", task "teambit.compilation/compiler:BabelCompiler (compile components for artifact dist)" has completed successfully in 363ms\n✔ env "teambit.react/react", task "teambit.compilation/compiler:TSCompiler (compile components for artifact dist)" has completed successfully in 1s\n✔ env "teambit.mdx/mdx", task "teambit.compilation/compiler:MDXCompiler (compile components)" has completed successfully in 879ms\n...\nthe build has been completed. total: 19 tasks\n')),(0,i.mdx)("p",null,"The compiled code is written into the ",(0,i.mdx)("a",{parentName:"p",href:"/"},"Component's Capsule"),". Run ",(0,i.mdx)("a",{parentName:"p",href:"/"},(0,i.mdx)("inlineCode",{parentName:"a"},"bit snap"))," or ",(0,i.mdx)("a",{parentName:"p",href:"/"},(0,i.mdx)("inlineCode",{parentName:"a"},"bit tag"))," to execute the build pipeline (as well as other pipelines), and have the compiled code persisted in the ",(0,i.mdx)("a",{parentName:"p",href:"/"},"Component version"),", and included in the ",(0,i.mdx)("a",{parentName:"p",href:"/"},"Component's package"),"."),(0,i.mdx)("p",null,"To learn more about compilation in the Workspace, see ",(0,i.mdx)("a",{parentName:"p",href:"/"},"'Compiling during build'"),"."),(0,i.mdx)("h2",null,"Compilation strategies and standards"),(0,i.mdx)("p",null,"The Compiler aspect does not set specific compilation strategies as these are defined by the ",(0,i.mdx)("a",{parentName:"p",href:"/"},"specific compilers")," themselves (and are often configurable by the Envs that use them)."),(0,i.mdx)("p",null,"However, all official Bit compilers are configured to favor dev experience when compiling during development, and to favor runtime performance and code universality, when compiling for distribution (during build)."),(0,i.mdx)("p",null,"For example, Bit's ",(0,i.mdx)("a",{parentName:"p",href:"/"},"TypeScript compiler")," performs type-checking when compiling during build but skips it when compiling during development.\nThis enables faster compilation and better dev experience."),(0,i.mdx)("p",null,"To examine a Component's specific compiler config, run the following:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre"},"bit env get COMPONENT_ID\n")),(0,i.mdx)("p",null,"For example:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre"},"bit env get company.demo/ui/card\n")),(0,i.mdx)("p",null,"The output details the Component's env config which includes the compiler config:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-bash"},'Environment: teambit.react/react\n...\nteambit.compilation/compiler\n\nconfigured compiler: teambit.typescript/typescript (TypeScript @ 4.4.2)\ncompiler config:\n{\n "compilerOptions": {\n "lib": [\n "es2019",\n "DOM",\n "ES6",\n "DOM.Iterable"\n ],\n "target": "es2015",\n "module": "commonjs",\n "jsx": "react",\n "declaration": true,\n "sourceMap": true,\n "skipLibCheck": true,\n "moduleResolution": "node",\n "esModuleInterop": true,\n "resolveJsonModule": true,\n "outDir": "dist"\n },\n "exclude": [\n "dist"\n ]\n}\n\n')),(0,i.mdx)("h2",null,"Setting a Component with a specific compiler"),(0,i.mdx)("p",null,"Specific compilers are applied on Components via the Components' Envs. For example, the ",(0,i.mdx)("inlineCode",{parentName:"p"},"company.demo/ui/card")," Component examined earlier, is applied with\nthe ",(0,i.mdx)("a",{parentName:"p",href:"/"},"TypeScript")," compiler by its Env, the React Env."),(0,i.mdx)("p",null,"To learn how to use a specific compiler, see ",(0,i.mdx)("a",{parentName:"p",href:"/"},"'Using compilers'"),".")))}u.__bit_component=o,u.isMDXComponent=!0},39379:(e,n,t)=>{Object.defineProperty(n,"Ay",{enumerable:!0,get:function(){return o.default}});var o=i(t(73077));function i(e){return e&&e.__esModule?e:{default:e}}i.__bit_component={id:"teambit.compilation/content/compiler-overview@1.95.0",homepage:"https://bit.dev/teambit/compilation/content/compiler-overview",exported:!0}},5037:(e,n,t)=>{var o={id:"teambit.compilation/compiler@1.0.203",homepage:"https://bit.cloud/teambit/compilation/compiler",exported:!0};function i(){const e=r(t(41594));return i=function(){return e},e}function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.Logo=void 0,i.__bit_component=o,r.__bit_component=o;const a=()=>i().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},i().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/compiler.svg"}));a.__bit_component=o,n.Logo=a},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React},65682:e=>{e.exports=TeambitMdxUiMdxScopeContext}},n={};function t(o){var i=n[o];if(void 0!==i)return i.exports;var r=n[o]={exports:{}};return e[o](r,r.exports,t),r.exports}t.d=(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{t.r(o),t.d(o,{compositions:()=>s,compositions_metadata:()=>f,overview:()=>u});var e={};t.r(e),t.d(e,{default:()=>c});var n=t(5037),i=(t(41594),t(5016)),r=t(65682),a=t(39379),p=["components"];function m(){return m=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},m.apply(this,arguments)}var l={},d="wrapper";function c(e){var n=e.components,t=function(e,n){if(null==e)return{};var t,o,i=function(e,n){if(null==e)return{};var t,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(e,p);return(0,i.mdx)(d,m({},l,t,{components:n,mdxType:"MDXLayout"}),(0,i.mdx)(r.MDXScopeProvider,{components:{CompilerOverview:a.Ay},mdxType:"MDXScopeProvider"},(0,i.mdx)(a.Ay,{mdxType:"CompilerOverview"})))}c.isMDXComponent=!0;const s=[n],u=[e],f={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),o})()));
1
+ !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["teambit.compilation/compiler-preview"]=n():e["teambit.compilation/compiler-preview"]=n()}(self,(()=>(()=>{"use strict";var e={73077:(e,n,t)=>{var o={id:"teambit.compilation/content/compiler-overview@1.95.0",homepage:"https://bit.dev/teambit/compilation/content/compiler-overview",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=u,p(t(41594));var i=t(5016),r=t(65682),a=["components"];function p(e){return e&&e.__esModule?e:{default:e}}function m(){return m=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},m.apply(this,arguments)}function l(e,n){if(null==e)return{};var t,o,i=d(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function d(e,n){if(null==e)return{};var t,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||(i[t]=e[t]);return i}p.__bit_component=o,m.__bit_component=o,l.__bit_component=o,d.__bit_component=o;var c={},s="wrapper";function u(e){var n=e.components,t=l(e,a);return(0,i.mdx)(s,m({},c,t,{components:n,mdxType:"MDXLayout"}),(0,i.mdx)(r.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"},(0,i.mdx)("h1",null,"Compiler overview"),(0,i.mdx)("p",null,"The Compiler aspect provides a single interface for Component compilation, ",(0,i.mdx)("a",{parentName:"p",href:"/"},"during development")," and ",(0,i.mdx)("a",{parentName:"p",href:"/"},"during build"),".\nIt enables you to use the same commands and APIs to compile any Component, regardless of the specific compiler it uses."),(0,i.mdx)("div",{className:"admonition admonition-info alert alert--info"},(0,i.mdx)("div",{parentName:"div",className:"admonition-heading"},(0,i.mdx)("h5",{parentName:"div"},(0,i.mdx)("span",{parentName:"h5",className:"admonition-icon"},(0,i.mdx)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,i.mdx)("path",{parentName:"svg",fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))),"info")),(0,i.mdx)("div",{parentName:"div",className:"admonition-content"},(0,i.mdx)("p",{parentName:"div"},"The specific compiler used by a Component (",(0,i.mdx)("a",{parentName:"p",href:"/"},"Babel"),", ",(0,i.mdx)("a",{parentName:"p",href:"/"},"TypeScript"),", and so on) is set by the Component's Env."))),(0,i.mdx)("h2",null,"Compiling during development"),(0,i.mdx)("p",null,"Run the following to compile all your Workspace Components:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-bash"},"bit compile\n")),(0,i.mdx)("p",null,"The following output lists the compilation results in a single format:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-bash"}," STATUS COMPONENT ID\n✔ SUCCESS apps/bit-dev\n✔ SUCCESS blocks/component/architecture-breakdown\n✔ SUCCESS blocks/footer\n✔ SUCCESS blocks/header\n✔ SUCCESS buttons/button\n✔ SUCCESS content/adding-components\n")),(0,i.mdx)("p",null,"To 'watch' Components for changes, and to auto-compile modified Components, run:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre"},"bit watch\n")),(0,i.mdx)("p",null,"The compiled code is written into each Component's corresponding package, in the ",(0,i.mdx)("a",{parentName:"p",href:"/dependencies/node-modules"},(0,i.mdx)("inlineCode",{parentName:"a"},"node_modules")," directory")," of your workspace.\nFor example, the compiled code for ",(0,i.mdx)("inlineCode",{parentName:"p"},"company.scope/ui/text")," will be found in the ",(0,i.mdx)("inlineCode",{parentName:"p"},"./node_modules/@company/scope.ui.text/dist")," directory (inside your workspace)."),(0,i.mdx)("p",null,"To learn more about compilation in the Workspace, see ",(0,i.mdx)("a",{parentName:"p",href:"/"},"'Compiling during development'"),"."),(0,i.mdx)("h2",null,"Compiling during build"),(0,i.mdx)("p",null,"Run the following to compile Components as part of the ",(0,i.mdx)("a",{parentName:"p",href:"/"},"build pipeline")," (which prepares Components for distribution):"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-bash"},"bit build\n")),(0,i.mdx)("p",null,"The output to the terminal details the specific compilers being used, as well as the Envs that use them:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-bash"},'...\n✔ env "teambit.harmony/aspect", task "teambit.compilation/compiler:BabelCompiler (compile components for artifact dist)" has completed successfully in 363ms\n✔ env "teambit.react/react", task "teambit.compilation/compiler:TSCompiler (compile components for artifact dist)" has completed successfully in 1s\n✔ env "teambit.mdx/mdx", task "teambit.compilation/compiler:MDXCompiler (compile components)" has completed successfully in 879ms\n...\nthe build has been completed. total: 19 tasks\n')),(0,i.mdx)("p",null,"The compiled code is written into the ",(0,i.mdx)("a",{parentName:"p",href:"/"},"Component's Capsule"),". Run ",(0,i.mdx)("a",{parentName:"p",href:"/"},(0,i.mdx)("inlineCode",{parentName:"a"},"bit snap"))," or ",(0,i.mdx)("a",{parentName:"p",href:"/"},(0,i.mdx)("inlineCode",{parentName:"a"},"bit tag"))," to execute the build pipeline (as well as other pipelines), and have the compiled code persisted in the ",(0,i.mdx)("a",{parentName:"p",href:"/"},"Component version"),", and included in the ",(0,i.mdx)("a",{parentName:"p",href:"/"},"Component's package"),"."),(0,i.mdx)("p",null,"To learn more about compilation in the Workspace, see ",(0,i.mdx)("a",{parentName:"p",href:"/"},"'Compiling during build'"),"."),(0,i.mdx)("h2",null,"Compilation strategies and standards"),(0,i.mdx)("p",null,"The Compiler aspect does not set specific compilation strategies as these are defined by the ",(0,i.mdx)("a",{parentName:"p",href:"/"},"specific compilers")," themselves (and are often configurable by the Envs that use them)."),(0,i.mdx)("p",null,"However, all official Bit compilers are configured to favor dev experience when compiling during development, and to favor runtime performance and code universality, when compiling for distribution (during build)."),(0,i.mdx)("p",null,"For example, Bit's ",(0,i.mdx)("a",{parentName:"p",href:"/"},"TypeScript compiler")," performs type-checking when compiling during build but skips it when compiling during development.\nThis enables faster compilation and better dev experience."),(0,i.mdx)("p",null,"To examine a Component's specific compiler config, run the following:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre"},"bit env get COMPONENT_ID\n")),(0,i.mdx)("p",null,"For example:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre"},"bit env get company.demo/ui/card\n")),(0,i.mdx)("p",null,"The output details the Component's env config which includes the compiler config:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-bash"},'Environment: teambit.react/react\n...\nteambit.compilation/compiler\n\nconfigured compiler: teambit.typescript/typescript (TypeScript @ 4.4.2)\ncompiler config:\n{\n "compilerOptions": {\n "lib": [\n "es2019",\n "DOM",\n "ES6",\n "DOM.Iterable"\n ],\n "target": "es2015",\n "module": "commonjs",\n "jsx": "react",\n "declaration": true,\n "sourceMap": true,\n "skipLibCheck": true,\n "moduleResolution": "node",\n "esModuleInterop": true,\n "resolveJsonModule": true,\n "outDir": "dist"\n },\n "exclude": [\n "dist"\n ]\n}\n\n')),(0,i.mdx)("h2",null,"Setting a Component with a specific compiler"),(0,i.mdx)("p",null,"Specific compilers are applied on Components via the Components' Envs. For example, the ",(0,i.mdx)("inlineCode",{parentName:"p"},"company.demo/ui/card")," Component examined earlier, is applied with\nthe ",(0,i.mdx)("a",{parentName:"p",href:"/"},"TypeScript")," compiler by its Env, the React Env."),(0,i.mdx)("p",null,"To learn how to use a specific compiler, see ",(0,i.mdx)("a",{parentName:"p",href:"/"},"'Using compilers'"),".")))}u.__bit_component=o,u.isMDXComponent=!0},39379:(e,n,t)=>{Object.defineProperty(n,"Ay",{enumerable:!0,get:function(){return o.default}});var o=i(t(73077));function i(e){return e&&e.__esModule?e:{default:e}}i.__bit_component={id:"teambit.compilation/content/compiler-overview@1.95.0",homepage:"https://bit.dev/teambit/compilation/content/compiler-overview",exported:!0}},59608:(e,n,t)=>{var o={id:"teambit.compilation/compiler@1.0.204",homepage:"https://bit.cloud/teambit/compilation/compiler",exported:!0};function i(){const e=r(t(41594));return i=function(){return e},e}function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.Logo=void 0,i.__bit_component=o,r.__bit_component=o;const a=()=>i().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},i().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/compiler.svg"}));a.__bit_component=o,n.Logo=a},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React},65682:e=>{e.exports=TeambitMdxUiMdxScopeContext}},n={};function t(o){var i=n[o];if(void 0!==i)return i.exports;var r=n[o]={exports:{}};return e[o](r,r.exports,t),r.exports}t.d=(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{t.r(o),t.d(o,{compositions:()=>s,compositions_metadata:()=>f,overview:()=>u});var e={};t.r(e),t.d(e,{default:()=>c});var n=t(59608),i=(t(41594),t(5016)),r=t(65682),a=t(39379),p=["components"];function m(){return m=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},m.apply(this,arguments)}var l={},d="wrapper";function c(e){var n=e.components,t=function(e,n){if(null==e)return{};var t,o,i=function(e,n){if(null==e)return{};var t,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)t=r[o],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(e,p);return(0,i.mdx)(d,m({},l,t,{components:n,mdxType:"MDXLayout"}),(0,i.mdx)(r.MDXScopeProvider,{components:{CompilerOverview:a.Ay},mdxType:"MDXScopeProvider"},(0,i.mdx)(a.Ay,{mdxType:"CompilerOverview"})))}c.isMDXComponent=!0;const s=[n],u=[e],f={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),o})()));
@@ -1678,7 +1678,7 @@
1678
1678
  "_legacy": {
1679
1679
  "scope": "teambit.compilation",
1680
1680
  "name": "compiler",
1681
- "version": "1.0.203"
1681
+ "version": "1.0.204"
1682
1682
  },
1683
1683
  "_scope": "teambit.compilation"
1684
1684
  }
@@ -2902,7 +2902,7 @@
2902
2902
  "_legacy": {
2903
2903
  "scope": "teambit.compilation",
2904
2904
  "name": "compiler",
2905
- "version": "1.0.203"
2905
+ "version": "1.0.204"
2906
2906
  },
2907
2907
  "_scope": "teambit.compilation"
2908
2908
  }
@@ -3479,208 +3479,7 @@
3479
3479
  "_legacy": {
3480
3480
  "scope": "teambit.compilation",
3481
3481
  "name": "compiler",
3482
- "version": "1.0.203"
3483
- },
3484
- "_scope": "teambit.compilation"
3485
- }
3486
- }
3487
- }
3488
- ],
3489
- "implementNodes": []
3490
- },
3491
- {
3492
- "__schema": "ClassSchema",
3493
- "location": {
3494
- "filePath": "events/component-compilation-on-done.ts",
3495
- "line": 10,
3496
- "character": 1
3497
- },
3498
- "signature": "class ComponentCompilationOnDoneEvent",
3499
- "name": "ComponentCompilationOnDoneEvent",
3500
- "members": [
3501
- {
3502
- "__schema": "VariableLikeSchema",
3503
- "location": {
3504
- "filePath": "events/component-compilation-on-done.ts",
3505
- "line": 11,
3506
- "character": 3
3507
- },
3508
- "signature": "(property) ComponentCompilationOnDoneEvent.TYPE: \"component-compilation-on-done\"",
3509
- "name": "TYPE",
3510
- "type": {
3511
- "__schema": "InferenceTypeSchema",
3512
- "location": {
3513
- "filePath": "events/component-compilation-on-done.ts",
3514
- "line": 11,
3515
- "character": 3
3516
- },
3517
- "type": "\"component-compilation-on-done\""
3518
- },
3519
- "isOptional": true,
3520
- "defaultValue": "'component-compilation-on-done'"
3521
- },
3522
- {
3523
- "__schema": "ConstructorSchema",
3524
- "location": {
3525
- "filePath": "events/component-compilation-on-done.ts",
3526
- "line": 13,
3527
- "character": 3
3528
- },
3529
- "signature": "constructor ComponentCompilationOnDoneEvent(errors: Array<CompileError>, component: Component, buildResults: string[], timestamp?: number): ComponentCompilationOnDoneEvent",
3530
- "name": "constructor",
3531
- "params": [
3532
- {
3533
- "__schema": "ParameterSchema",
3534
- "location": {
3535
- "filePath": "events/component-compilation-on-done.ts",
3536
- "line": 14,
3537
- "character": 5
3538
- },
3539
- "name": "errors",
3540
- "type": {
3541
- "__schema": "TypeRefSchema",
3542
- "location": {
3543
- "filePath": "events/component-compilation-on-done.ts",
3544
- "line": 14,
3545
- "character": 22
3546
- },
3547
- "name": "Array",
3548
- "typeArgs": [
3549
- {
3550
- "__schema": "TypeRefSchema",
3551
- "location": {
3552
- "filePath": "events/component-compilation-on-done.ts",
3553
- "line": 14,
3554
- "character": 28
3555
- },
3556
- "name": "CompileError",
3557
- "internalFilePath": "workspace-compiler.ts"
3558
- }
3559
- ]
3560
- },
3561
- "isOptional": false,
3562
- "isSpread": false
3563
- },
3564
- {
3565
- "__schema": "ParameterSchema",
3566
- "location": {
3567
- "filePath": "events/component-compilation-on-done.ts",
3568
- "line": 15,
3569
- "character": 5
3570
- },
3571
- "name": "component",
3572
- "type": {
3573
- "__schema": "TypeRefSchema",
3574
- "location": {
3575
- "filePath": "events/component-compilation-on-done.ts",
3576
- "line": 15,
3577
- "character": 25
3578
- },
3579
- "name": "Component",
3580
- "componentId": {
3581
- "scope": "teambit.component",
3582
- "name": "component"
3583
- }
3584
- },
3585
- "isOptional": false,
3586
- "isSpread": false
3587
- },
3588
- {
3589
- "__schema": "ParameterSchema",
3590
- "location": {
3591
- "filePath": "events/component-compilation-on-done.ts",
3592
- "line": 16,
3593
- "character": 5
3594
- },
3595
- "name": "buildResults",
3596
- "type": {
3597
- "__schema": "TypeArraySchema",
3598
- "location": {
3599
- "filePath": "events/component-compilation-on-done.ts",
3600
- "line": 16,
3601
- "character": 28
3602
- },
3603
- "type": {
3604
- "__schema": "KeywordTypeSchema",
3605
- "location": {
3606
- "filePath": "events/component-compilation-on-done.ts",
3607
- "line": 16,
3608
- "character": 28
3609
- },
3610
- "name": "string"
3611
- }
3612
- },
3613
- "isOptional": false,
3614
- "isSpread": false
3615
- },
3616
- {
3617
- "__schema": "ParameterSchema",
3618
- "location": {
3619
- "filePath": "events/component-compilation-on-done.ts",
3620
- "line": 17,
3621
- "character": 5
3622
- },
3623
- "name": "timestamp",
3624
- "type": {
3625
- "__schema": "InferenceTypeSchema",
3626
- "location": {
3627
- "filePath": "events/component-compilation-on-done.ts",
3628
- "line": 17,
3629
- "character": 5
3630
- },
3631
- "type": "number"
3632
- },
3633
- "isOptional": true,
3634
- "defaultValue": "Date.now()",
3635
- "isSpread": false
3636
- }
3637
- ],
3638
- "returnType": {
3639
- "__schema": "ThisTypeSchema",
3640
- "location": {
3641
- "filePath": "events/component-compilation-on-done.ts",
3642
- "line": 10,
3643
- "character": 1
3644
- },
3645
- "name": "ComponentCompilationOnDoneEvent"
3646
- },
3647
- "modifiers": []
3648
- }
3649
- ],
3650
- "extendsNodes": [
3651
- {
3652
- "__schema": "ExpressionWithTypeArgumentsSchema",
3653
- "location": {
3654
- "filePath": "events/component-compilation-on-done.ts",
3655
- "line": 10,
3656
- "character": 54
3657
- },
3658
- "name": "extends BitBaseEvent<ComponentCompilationOnDoneEventData>",
3659
- "typeArgs": [
3660
- {
3661
- "__schema": "TypeRefSchema",
3662
- "location": {
3663
- "filePath": "events/component-compilation-on-done.ts",
3664
- "line": 10,
3665
- "character": 67
3666
- },
3667
- "name": "ComponentCompilationOnDoneEventData",
3668
- "internalFilePath": "events/component-compilation-on-done.ts"
3669
- }
3670
- ],
3671
- "expression": {
3672
- "__schema": "TypeRefSchema",
3673
- "location": {
3674
- "filePath": "events/component-compilation-on-done.ts",
3675
- "line": 10,
3676
- "character": 54
3677
- },
3678
- "name": "BitBaseEvent<T>",
3679
- "componentId": {
3680
- "_legacy": {
3681
- "scope": "teambit.compilation",
3682
- "name": "compiler",
3683
- "version": "1.0.203"
3482
+ "version": "1.0.204"
3684
3483
  },
3685
3484
  "_scope": "teambit.compilation"
3686
3485
  }
@@ -5398,7 +5197,7 @@
5398
5197
  "_legacy": {
5399
5198
  "scope": "teambit.compilation",
5400
5199
  "name": "compiler",
5401
- "version": "1.0.203"
5200
+ "version": "1.0.204"
5402
5201
  },
5403
5202
  "_scope": "teambit.compilation"
5404
5203
  }
@@ -7096,7 +6895,7 @@
7096
6895
  "_legacy": {
7097
6896
  "scope": "teambit.compilation",
7098
6897
  "name": "compiler",
7099
- "version": "1.0.203"
6898
+ "version": "1.0.204"
7100
6899
  },
7101
6900
  "_scope": "teambit.compilation"
7102
6901
  }
@@ -7243,7 +7042,7 @@
7243
7042
  "_legacy": {
7244
7043
  "scope": "teambit.compilation",
7245
7044
  "name": "compiler",
7246
- "version": "1.0.203"
7045
+ "version": "1.0.204"
7247
7046
  },
7248
7047
  "_scope": "teambit.compilation"
7249
7048
  }
@@ -7311,345 +7110,12 @@
7311
7110
  "implementNodes": []
7312
7111
  }
7313
7112
  ]
7314
- },
7315
- {
7316
- "__schema": "ModuleSchema",
7317
- "location": {
7318
- "filePath": "events/component-compilation-on-done.ts",
7319
- "line": 2,
7320
- "character": 1
7321
- },
7322
- "exports": [
7323
- {
7324
- "__schema": "ClassSchema",
7325
- "location": {
7326
- "filePath": "events/component-compilation-on-done.ts",
7327
- "line": 10,
7328
- "character": 1
7329
- },
7330
- "signature": "class ComponentCompilationOnDoneEvent",
7331
- "name": "ComponentCompilationOnDoneEvent",
7332
- "members": [
7333
- {
7334
- "__schema": "VariableLikeSchema",
7335
- "location": {
7336
- "filePath": "events/component-compilation-on-done.ts",
7337
- "line": 11,
7338
- "character": 3
7339
- },
7340
- "signature": "(property) ComponentCompilationOnDoneEvent.TYPE: \"component-compilation-on-done\"",
7341
- "name": "TYPE",
7342
- "type": {
7343
- "__schema": "InferenceTypeSchema",
7344
- "location": {
7345
- "filePath": "events/component-compilation-on-done.ts",
7346
- "line": 11,
7347
- "character": 3
7348
- },
7349
- "type": "\"component-compilation-on-done\""
7350
- },
7351
- "isOptional": true,
7352
- "defaultValue": "'component-compilation-on-done'"
7353
- },
7354
- {
7355
- "__schema": "ConstructorSchema",
7356
- "location": {
7357
- "filePath": "events/component-compilation-on-done.ts",
7358
- "line": 13,
7359
- "character": 3
7360
- },
7361
- "signature": "constructor ComponentCompilationOnDoneEvent(errors: Array<CompileError>, component: Component, buildResults: string[], timestamp?: number): ComponentCompilationOnDoneEvent",
7362
- "name": "constructor",
7363
- "params": [
7364
- {
7365
- "__schema": "ParameterSchema",
7366
- "location": {
7367
- "filePath": "events/component-compilation-on-done.ts",
7368
- "line": 14,
7369
- "character": 5
7370
- },
7371
- "name": "errors",
7372
- "type": {
7373
- "__schema": "TypeRefSchema",
7374
- "location": {
7375
- "filePath": "events/component-compilation-on-done.ts",
7376
- "line": 14,
7377
- "character": 22
7378
- },
7379
- "name": "Array",
7380
- "typeArgs": [
7381
- {
7382
- "__schema": "TypeRefSchema",
7383
- "location": {
7384
- "filePath": "events/component-compilation-on-done.ts",
7385
- "line": 14,
7386
- "character": 28
7387
- },
7388
- "name": "CompileError",
7389
- "internalFilePath": "workspace-compiler.ts"
7390
- }
7391
- ]
7392
- },
7393
- "isOptional": false,
7394
- "isSpread": false
7395
- },
7396
- {
7397
- "__schema": "ParameterSchema",
7398
- "location": {
7399
- "filePath": "events/component-compilation-on-done.ts",
7400
- "line": 15,
7401
- "character": 5
7402
- },
7403
- "name": "component",
7404
- "type": {
7405
- "__schema": "TypeRefSchema",
7406
- "location": {
7407
- "filePath": "events/component-compilation-on-done.ts",
7408
- "line": 15,
7409
- "character": 25
7410
- },
7411
- "name": "Component",
7412
- "componentId": {
7413
- "scope": "teambit.component",
7414
- "name": "component"
7415
- }
7416
- },
7417
- "isOptional": false,
7418
- "isSpread": false
7419
- },
7420
- {
7421
- "__schema": "ParameterSchema",
7422
- "location": {
7423
- "filePath": "events/component-compilation-on-done.ts",
7424
- "line": 16,
7425
- "character": 5
7426
- },
7427
- "name": "buildResults",
7428
- "type": {
7429
- "__schema": "TypeArraySchema",
7430
- "location": {
7431
- "filePath": "events/component-compilation-on-done.ts",
7432
- "line": 16,
7433
- "character": 28
7434
- },
7435
- "type": {
7436
- "__schema": "KeywordTypeSchema",
7437
- "location": {
7438
- "filePath": "events/component-compilation-on-done.ts",
7439
- "line": 16,
7440
- "character": 28
7441
- },
7442
- "name": "string"
7443
- }
7444
- },
7445
- "isOptional": false,
7446
- "isSpread": false
7447
- },
7448
- {
7449
- "__schema": "ParameterSchema",
7450
- "location": {
7451
- "filePath": "events/component-compilation-on-done.ts",
7452
- "line": 17,
7453
- "character": 5
7454
- },
7455
- "name": "timestamp",
7456
- "type": {
7457
- "__schema": "InferenceTypeSchema",
7458
- "location": {
7459
- "filePath": "events/component-compilation-on-done.ts",
7460
- "line": 17,
7461
- "character": 5
7462
- },
7463
- "type": "number"
7464
- },
7465
- "isOptional": true,
7466
- "defaultValue": "Date.now()",
7467
- "isSpread": false
7468
- }
7469
- ],
7470
- "returnType": {
7471
- "__schema": "ThisTypeSchema",
7472
- "location": {
7473
- "filePath": "events/component-compilation-on-done.ts",
7474
- "line": 10,
7475
- "character": 1
7476
- },
7477
- "name": "ComponentCompilationOnDoneEvent"
7478
- },
7479
- "modifiers": []
7480
- }
7481
- ],
7482
- "extendsNodes": [
7483
- {
7484
- "__schema": "ExpressionWithTypeArgumentsSchema",
7485
- "location": {
7486
- "filePath": "events/component-compilation-on-done.ts",
7487
- "line": 10,
7488
- "character": 54
7489
- },
7490
- "name": "extends BitBaseEvent<ComponentCompilationOnDoneEventData>",
7491
- "typeArgs": [
7492
- {
7493
- "__schema": "TypeRefSchema",
7494
- "location": {
7495
- "filePath": "events/component-compilation-on-done.ts",
7496
- "line": 10,
7497
- "character": 67
7498
- },
7499
- "name": "ComponentCompilationOnDoneEventData",
7500
- "internalFilePath": "events/component-compilation-on-done.ts"
7501
- }
7502
- ],
7503
- "expression": {
7504
- "__schema": "TypeRefSchema",
7505
- "location": {
7506
- "filePath": "events/component-compilation-on-done.ts",
7507
- "line": 10,
7508
- "character": 54
7509
- },
7510
- "name": "BitBaseEvent<T>",
7511
- "componentId": {
7512
- "_legacy": {
7513
- "scope": "teambit.compilation",
7514
- "name": "compiler",
7515
- "version": "1.0.203"
7516
- },
7517
- "_scope": "teambit.compilation"
7518
- }
7519
- }
7520
- }
7521
- ],
7522
- "implementNodes": []
7523
- }
7524
- ],
7525
- "internals": [
7526
- {
7527
- "__schema": "ClassSchema",
7528
- "location": {
7529
- "filePath": "events/component-compilation-on-done.ts",
7530
- "line": 6,
7531
- "character": 1
7532
- },
7533
- "signature": "class ComponentCompilationOnDoneEventData",
7534
- "name": "ComponentCompilationOnDoneEventData",
7535
- "members": [
7536
- {
7537
- "__schema": "ConstructorSchema",
7538
- "location": {
7539
- "filePath": "events/component-compilation-on-done.ts",
7540
- "line": 7,
7541
- "character": 3
7542
- },
7543
- "signature": "constructor ComponentCompilationOnDoneEventData(errors: Array<CompileError>, component: Component, buildResults: string[]): ComponentCompilationOnDoneEventData",
7544
- "name": "constructor",
7545
- "params": [
7546
- {
7547
- "__schema": "ParameterSchema",
7548
- "location": {
7549
- "filePath": "events/component-compilation-on-done.ts",
7550
- "line": 7,
7551
- "character": 15
7552
- },
7553
- "name": "errors",
7554
- "type": {
7555
- "__schema": "TypeRefSchema",
7556
- "location": {
7557
- "filePath": "events/component-compilation-on-done.ts",
7558
- "line": 7,
7559
- "character": 32
7560
- },
7561
- "name": "Array",
7562
- "typeArgs": [
7563
- {
7564
- "__schema": "TypeRefSchema",
7565
- "location": {
7566
- "filePath": "events/component-compilation-on-done.ts",
7567
- "line": 7,
7568
- "character": 38
7569
- },
7570
- "name": "CompileError",
7571
- "internalFilePath": "workspace-compiler.ts"
7572
- }
7573
- ]
7574
- },
7575
- "isOptional": false,
7576
- "isSpread": false
7577
- },
7578
- {
7579
- "__schema": "ParameterSchema",
7580
- "location": {
7581
- "filePath": "events/component-compilation-on-done.ts",
7582
- "line": 7,
7583
- "character": 53
7584
- },
7585
- "name": "component",
7586
- "type": {
7587
- "__schema": "TypeRefSchema",
7588
- "location": {
7589
- "filePath": "events/component-compilation-on-done.ts",
7590
- "line": 7,
7591
- "character": 73
7592
- },
7593
- "name": "Component",
7594
- "componentId": {
7595
- "scope": "teambit.component",
7596
- "name": "component"
7597
- }
7598
- },
7599
- "isOptional": false,
7600
- "isSpread": false
7601
- },
7602
- {
7603
- "__schema": "ParameterSchema",
7604
- "location": {
7605
- "filePath": "events/component-compilation-on-done.ts",
7606
- "line": 7,
7607
- "character": 84
7608
- },
7609
- "name": "buildResults",
7610
- "type": {
7611
- "__schema": "TypeArraySchema",
7612
- "location": {
7613
- "filePath": "events/component-compilation-on-done.ts",
7614
- "line": 7,
7615
- "character": 107
7616
- },
7617
- "type": {
7618
- "__schema": "KeywordTypeSchema",
7619
- "location": {
7620
- "filePath": "events/component-compilation-on-done.ts",
7621
- "line": 7,
7622
- "character": 107
7623
- },
7624
- "name": "string"
7625
- }
7626
- },
7627
- "isOptional": false,
7628
- "isSpread": false
7629
- }
7630
- ],
7631
- "returnType": {
7632
- "__schema": "ThisTypeSchema",
7633
- "location": {
7634
- "filePath": "events/component-compilation-on-done.ts",
7635
- "line": 6,
7636
- "character": 1
7637
- },
7638
- "name": "ComponentCompilationOnDoneEventData"
7639
- },
7640
- "modifiers": []
7641
- }
7642
- ],
7643
- "extendsNodes": [],
7644
- "implementNodes": []
7645
- }
7646
- ]
7647
7113
  }
7648
7114
  ],
7649
7115
  "componentId": {
7650
7116
  "scope": "teambit.compilation",
7651
7117
  "name": "compiler",
7652
- "version": "1.0.203"
7118
+ "version": "1.0.204"
7653
7119
  },
7654
7120
  "taggedModuleExports": []
7655
7121
  }
@@ -1,18 +1,11 @@
1
1
  import { Command, CommandOptions } from '@teambit/cli';
2
2
  import { Logger } from '@teambit/logger';
3
3
  import type { PubsubMain } from '@teambit/pubsub';
4
- import { Component } from '@teambit/component';
5
- import { CompileError, WorkspaceCompiler, CompileOptions } from './workspace-compiler';
6
- export type ComponentsStatus = {
7
- buildResults: string[];
8
- component: Component;
9
- errors: CompileError[];
10
- };
4
+ import { WorkspaceCompiler, CompileOptions, BuildResult } from './workspace-compiler';
11
5
  export declare class CompileCmd implements Command {
12
6
  private compile;
13
7
  private logger;
14
8
  private pubsub;
15
- componentsStatus: ComponentsStatus[];
16
9
  name: string;
17
10
  description: string;
18
11
  helpUrl: string;
@@ -29,12 +22,11 @@ export declare class CompileCmd implements Command {
29
22
  code: number;
30
23
  }>;
31
24
  json([components]: [string[]], compilerOptions: CompileOptions): Promise<{
32
- data: import("./workspace-compiler").BuildResult[];
25
+ data: BuildResult[];
33
26
  code: number;
34
27
  }>;
35
28
  private failedComponents;
36
29
  private getSummaryIcon;
37
30
  private getExitCode;
38
31
  private getStatusLine;
39
- private onComponentCompilationDone;
40
32
  }
@@ -39,32 +39,17 @@ function _types() {
39
39
  };
40
40
  return data;
41
41
  }
42
- function _compiler() {
43
- const data = require("./compiler.aspect");
44
- _compiler = function () {
45
- return data;
46
- };
47
- return data;
48
- }
49
- function _events() {
50
- const data = require("./events");
51
- _events = function () {
52
- return data;
53
- };
54
- return data;
55
- }
56
42
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
57
43
  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; }
58
44
  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; }
59
45
  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; }
60
46
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
61
- 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); } // IDs & events
47
+ 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); }
62
48
  class CompileCmd {
63
49
  constructor(compile, logger, pubsub) {
64
50
  this.compile = compile;
65
51
  this.logger = logger;
66
52
  this.pubsub = pubsub;
67
- _defineProperty(this, "componentsStatus", []);
68
53
  _defineProperty(this, "name", 'compile [component-names...]');
69
54
  _defineProperty(this, "description", 'compile components in the workspace');
70
55
  _defineProperty(this, "helpUrl", 'reference/compiling/compiler-overview');
@@ -79,21 +64,20 @@ class CompileCmd {
79
64
  async report([components = []], compilerOptions) {
80
65
  const startTimestamp = process.hrtime();
81
66
  this.logger.setStatusLine('Compiling your components, hold tight.');
82
- this.pubsub.sub(_compiler().CompilerAspect.id, this.onComponentCompilationDone.bind(this));
83
67
  let outputString = '';
84
- await this.compile.compileComponents(components, _objectSpread(_objectSpread({}, compilerOptions), {}, {
68
+ const results = await this.compile.compileComponents(components, _objectSpread(_objectSpread({}, compilerOptions), {}, {
85
69
  initiator: _types().CompilationInitiator.CmdReport
86
70
  }));
87
71
  const compileTimeLength = process.hrtime(startTimestamp);
88
72
  outputString += '\n';
89
73
  outputString += ` ${_chalk().default.underline('STATUS')}\t${_chalk().default.underline('COMPONENT ID')}\n`;
90
- outputString += (0, _outputFormatter().formatCompileResults)(this.componentsStatus, !!compilerOptions.verbose);
74
+ outputString += (0, _outputFormatter().formatCompileResults)(results, !!compilerOptions.verbose);
91
75
  outputString += '\n';
92
- outputString += this.getStatusLine(this.componentsStatus, compileTimeLength);
76
+ outputString += this.getStatusLine(results, compileTimeLength);
93
77
  this.logger.clearStatusLine();
94
78
  return {
95
79
  data: outputString,
96
- code: this.getExitCode(this.componentsStatus)
80
+ code: this.getExitCode(results)
97
81
  };
98
82
  }
99
83
  async json([components], compilerOptions) {
@@ -132,11 +116,6 @@ class CompileCmd {
132
116
  const summaryLine = numberOfFailingComponents ? `${icon} ${numberOfFailingComponents}/${numberOfComponents} components failed to compile.` : `${icon} ${numberOfSuccessfulComponents}/${numberOfComponents} components compiled successfully.`;
133
117
  return `${summaryLine}\nFinished. (${(0, _prettyTime().default)(compileTimeLength)})`;
134
118
  }
135
- onComponentCompilationDone(event) {
136
- if (event.type === _events().ComponentCompilationOnDoneEvent.TYPE) {
137
- this.componentsStatus.push(event.data);
138
- }
139
- }
140
119
  }
141
120
  exports.CompileCmd = CompileCmd;
142
121
 
@@ -1 +1 @@
1
- {"version":3,"names":["_logger","data","require","_chalk","_interopRequireDefault","_prettyTime","_outputFormatter","_types","_compiler","_events","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","CompileCmd","constructor","compile","logger","pubsub","name","description","report","components","compilerOptions","startTimestamp","process","hrtime","setStatusLine","sub","CompilerAspect","id","onComponentCompilationDone","bind","outputString","compileComponents","initiator","CompilationInitiator","CmdReport","compileTimeLength","chalk","underline","formatCompileResults","componentsStatus","verbose","getStatusLine","clearStatusLine","code","getExitCode","json","deleteDistDir","compileResults","CmdJson","failedComponents","component","errors","getSummaryIcon","Logger","successSymbol","red","yellow","numberOfComponents","numberOfFailingComponents","numberOfSuccessfulComponents","icon","summaryLine","prettyTime","event","type","ComponentCompilationOnDoneEvent","TYPE","exports"],"sources":["compiler.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { Logger } from '@teambit/logger';\nimport type { PubsubMain, BitBaseEvent } from '@teambit/pubsub';\nimport chalk from 'chalk';\nimport prettyTime from 'pretty-time';\nimport { Component } from '@teambit/component';\nimport { formatCompileResults } from './output-formatter';\nimport { CompileError, WorkspaceCompiler, CompileOptions } from './workspace-compiler';\nimport { CompilationInitiator } from './types';\n\n// IDs & events\nimport { CompilerAspect } from './compiler.aspect';\nimport { ComponentCompilationOnDoneEvent } from './events';\n\nexport type ComponentsStatus = {\n buildResults: string[];\n component: Component;\n errors: CompileError[];\n};\n\nexport class CompileCmd implements Command {\n componentsStatus: ComponentsStatus[] = [];\n name = 'compile [component-names...]';\n description = 'compile components in the workspace';\n helpUrl = 'reference/compiling/compiler-overview';\n arguments = [\n {\n name: 'component-names...',\n description: 'a list of component names or component IDs (defaults to all components)',\n },\n ];\n alias = '';\n group = 'development';\n options = [\n ['c', 'changed', 'compile only new and modified components'],\n ['v', 'verbose', 'show more data, such as, dist paths'],\n ['j', 'json', 'return the compile results in json format'],\n ['d', 'delete-dist-dir', 'delete existing dist folder before writing new compiled files'],\n ] as CommandOptions;\n\n constructor(private compile: WorkspaceCompiler, private logger: Logger, private pubsub: PubsubMain) {}\n\n async report([components = []]: [string[]], compilerOptions: CompileOptions) {\n const startTimestamp = process.hrtime();\n this.logger.setStatusLine('Compiling your components, hold tight.');\n this.pubsub.sub(CompilerAspect.id, this.onComponentCompilationDone.bind(this));\n\n let outputString = '';\n await this.compile.compileComponents(components, {\n ...compilerOptions,\n initiator: CompilationInitiator.CmdReport,\n });\n const compileTimeLength = process.hrtime(startTimestamp);\n\n outputString += '\\n';\n outputString += ` ${chalk.underline('STATUS')}\\t${chalk.underline('COMPONENT ID')}\\n`;\n outputString += formatCompileResults(this.componentsStatus, !!compilerOptions.verbose);\n outputString += '\\n';\n\n outputString += this.getStatusLine(this.componentsStatus, compileTimeLength);\n\n this.logger.clearStatusLine();\n\n return {\n data: outputString,\n code: this.getExitCode(this.componentsStatus),\n };\n }\n\n async json([components]: [string[]], compilerOptions: CompileOptions) {\n compilerOptions.deleteDistDir = true;\n // @ts-ignore\n const compileResults = await this.compile.compileComponents(components, {\n ...compilerOptions,\n initiator: CompilationInitiator.CmdJson,\n });\n return {\n data: compileResults,\n // @todo: fix the code once compile is ready.\n code: 0,\n };\n }\n\n private failedComponents(componentsStatus: ComponentsStatus[]): ComponentsStatus[] {\n return componentsStatus.filter((component) => component.errors.length);\n }\n\n private getSummaryIcon(componentsStatus: ComponentsStatus[]) {\n switch (this.failedComponents(componentsStatus).length) {\n case 0:\n return Logger.successSymbol();\n case componentsStatus.length:\n return chalk.red('✗');\n default:\n return chalk.yellow('⍻');\n }\n }\n\n private getExitCode(componentsStatus: ComponentsStatus[]) {\n return this.failedComponents(componentsStatus).length ? 1 : 0;\n }\n\n private getStatusLine(componentsStatus: ComponentsStatus[], compileTimeLength) {\n const numberOfComponents = componentsStatus.length;\n const numberOfFailingComponents = this.failedComponents(componentsStatus).length;\n const numberOfSuccessfulComponents = componentsStatus.filter((component) => !component.errors.length).length;\n\n const icon = this.getSummaryIcon(componentsStatus);\n const summaryLine = numberOfFailingComponents\n ? `${icon} ${numberOfFailingComponents}/${numberOfComponents} components failed to compile.`\n : `${icon} ${numberOfSuccessfulComponents}/${numberOfComponents} components compiled successfully.`;\n\n return `${summaryLine}\\nFinished. (${prettyTime(compileTimeLength)})`;\n }\n\n private onComponentCompilationDone(event: BitBaseEvent<any>) {\n if (event.type === ComponentCompilationOnDoneEvent.TYPE) {\n this.componentsStatus.push(event.data);\n }\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,G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EAEQP,0BAA0BA,CAACmC,KAAwB,EAAE;IAC3D,IAAIA,KAAK,CAACC,IAAI,KAAKC,yCAA+B,CAACC,IAAI,EAAE;MACvD,IAAI,CAAC3B,gBAAgB,CAACnD,IAAI,CAAC2E,KAAK,CAAClG,IAAI,CAAC;IACxC;EACF;AACF;AAACsG,OAAA,CAAAxD,UAAA,GAAAA,UAAA","ignoreList":[]}
1
+ {"version":3,"names":["_logger","data","require","_chalk","_interopRequireDefault","_prettyTime","_outputFormatter","_types","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","CompileCmd","constructor","compile","logger","pubsub","name","description","report","components","compilerOptions","startTimestamp","process","hrtime","setStatusLine","outputString","results","compileComponents","initiator","CompilationInitiator","CmdReport","compileTimeLength","chalk","underline","formatCompileResults","verbose","getStatusLine","clearStatusLine","code","getExitCode","json","deleteDistDir","compileResults","CmdJson","failedComponents","componentsStatus","component","errors","getSummaryIcon","Logger","successSymbol","red","yellow","numberOfComponents","numberOfFailingComponents","numberOfSuccessfulComponents","icon","summaryLine","prettyTime","exports"],"sources":["compiler.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { Logger } from '@teambit/logger';\nimport type { PubsubMain } from '@teambit/pubsub';\nimport chalk from 'chalk';\nimport prettyTime from 'pretty-time';\nimport { formatCompileResults } from './output-formatter';\nimport { WorkspaceCompiler, CompileOptions, BuildResult } from './workspace-compiler';\nimport { CompilationInitiator } from './types';\n\nexport class CompileCmd implements Command {\n name = 'compile [component-names...]';\n description = 'compile components in the workspace';\n helpUrl = 'reference/compiling/compiler-overview';\n arguments = [\n {\n name: 'component-names...',\n description: 'a list of component names or component IDs (defaults to all components)',\n },\n ];\n alias = '';\n group = 'development';\n options = [\n ['c', 'changed', 'compile only new and modified components'],\n ['v', 'verbose', 'show more data, such as, dist paths'],\n ['j', 'json', 'return the compile results in json format'],\n ['d', 'delete-dist-dir', 'delete existing dist folder before writing new compiled files'],\n ] as CommandOptions;\n\n constructor(private compile: WorkspaceCompiler, private logger: Logger, private pubsub: PubsubMain) {}\n\n async report([components = []]: [string[]], compilerOptions: CompileOptions) {\n const startTimestamp = process.hrtime();\n this.logger.setStatusLine('Compiling your components, hold tight.');\n\n let outputString = '';\n const results = await this.compile.compileComponents(components, {\n ...compilerOptions,\n initiator: CompilationInitiator.CmdReport,\n });\n const compileTimeLength = process.hrtime(startTimestamp);\n\n outputString += '\\n';\n outputString += ` ${chalk.underline('STATUS')}\\t${chalk.underline('COMPONENT ID')}\\n`;\n outputString += formatCompileResults(results, !!compilerOptions.verbose);\n outputString += '\\n';\n\n outputString += this.getStatusLine(results, compileTimeLength);\n\n this.logger.clearStatusLine();\n\n return {\n data: outputString,\n code: this.getExitCode(results),\n };\n }\n\n async json([components]: [string[]], compilerOptions: CompileOptions) {\n compilerOptions.deleteDistDir = true;\n // @ts-ignore\n const compileResults = await this.compile.compileComponents(components, {\n ...compilerOptions,\n initiator: CompilationInitiator.CmdJson,\n });\n return {\n data: compileResults,\n // @todo: fix the code once compile is ready.\n code: 0,\n };\n }\n\n private failedComponents(componentsStatus: BuildResult[]): BuildResult[] {\n return componentsStatus.filter((component) => component.errors.length);\n }\n\n private getSummaryIcon(componentsStatus: BuildResult[]) {\n switch (this.failedComponents(componentsStatus).length) {\n case 0:\n return Logger.successSymbol();\n case componentsStatus.length:\n return chalk.red('✗');\n default:\n return chalk.yellow('⍻');\n }\n }\n\n private getExitCode(componentsStatus: BuildResult[]) {\n return this.failedComponents(componentsStatus).length ? 1 : 0;\n }\n\n private getStatusLine(componentsStatus: BuildResult[], compileTimeLength) {\n const numberOfComponents = componentsStatus.length;\n const numberOfFailingComponents = this.failedComponents(componentsStatus).length;\n const numberOfSuccessfulComponents = componentsStatus.filter((component) => !component.errors.length).length;\n\n const icon = this.getSummaryIcon(componentsStatus);\n const summaryLine = numberOfFailingComponents\n ? `${icon} ${numberOfFailingComponents}/${numberOfComponents} components failed to compile.`\n : `${icon} ${numberOfSuccessfulComponents}/${numberOfComponents} components compiled successfully.`;\n\n return `${summaryLine}\\nFinished. (${prettyTime(compileTimeLength)})`;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,iBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,gBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,MAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA+C,SAAAG,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,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A,CAACH,gBAA+B,EAAE;IACtD,QAAQ,IAAI,CAACD,gBAAgB,CAACC,gBAAgB,CAAC,CAACrD,MAAM;MACpD,KAAK,CAAC;QACJ,OAAOyD,gBAAM,CAACC,aAAa,CAAC,CAAC;MAC/B,KAAKL,gBAAgB,CAACrD,MAAM;QAC1B,OAAOwC,gBAAK,CAACmB,GAAG,CAAC,GAAG,CAAC;MACvB;QACE,OAAOnB,gBAAK,CAACoB,MAAM,CAAC,GAAG,CAAC;IAC5B;EACF;EAEQb,WAAWA,CAACM,gBAA+B,EAAE;IACnD,OAAO,IAAI,CAACD,gBAAgB,CAACC,gBAAgB,CAAC,CAACrD,MAAM,GAAG,CAAC,GAAG,CAAC;EAC/D;EAEQ4C,aAAaA,CAACS,gBAA+B,EAAEd,iBAAiB,EAAE;IACxE,MAAMsB,kBAAkB,GAAGR,gBAAgB,CAACrD,MAAM;IAClD,MAAM8D,yBAAyB,GAAG,IAAI,CAACV,gBAAgB,CAACC,gBAAgB,CAAC,CAACrD,MAAM;IAChF,MAAM+D,4BAA4B,GAAGV,gBAAgB,CAAC5D,MAAM,CAAE6D,SAAS,IAAK,CAACA,SAAS,CAACC,MAAM,CAACvD,MAAM,CAAC,CAACA,MAAM;IAE5G,MAAMgE,IAAI,GAAG,IAAI,CAACR,cAAc,CAACH,gBAAgB,CAAC;IAClD,MAAMY,WAAW,GAAGH,yBAAyB,GACxC,GAAEE,IAAK,IAAGF,yBAA0B,IAAGD,kBAAmB,gCAA+B,GACzF,GAAEG,IAAK,IAAGD,4BAA6B,IAAGF,kBAAmB,oCAAmC;IAErG,OAAQ,GAAEI,WAAY,gBAAe,IAAAC,qBAAU,EAAC3B,iBAAiB,CAAE,GAAE;EACvE;AACF;AAAC4B,OAAA,CAAAhD,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -1,2 +1 @@
1
1
  export * from './compiler-error';
2
- export * from './component-compilation-on-done';
@@ -14,16 +14,5 @@ Object.keys(_compilerError).forEach(function (key) {
14
14
  }
15
15
  });
16
16
  });
17
- var _componentCompilationOnDone = require("./component-compilation-on-done");
18
- Object.keys(_componentCompilationOnDone).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _componentCompilationOnDone[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _componentCompilationOnDone[key];
25
- }
26
- });
27
- });
28
17
 
29
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_compilerError","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_componentCompilationOnDone"],"sources":["index.ts"],"sourcesContent":["export * from './compiler-error';\nexport * from './component-compilation-on-done';\n"],"mappings":";;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,cAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,2BAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,2BAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,2BAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,2BAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_compilerError","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["export * from './compiler-error';\n"],"mappings":";;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,cAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentsStatus } from './compiler.cmd';
2
- export declare const formatCompileResults: (compileResults: ComponentsStatus[], verbose: boolean) => string;
1
+ import { BuildResult } from './workspace-compiler';
2
+ export declare const formatCompileResults: (compileResults: BuildResult[], verbose: boolean) => string;
@@ -20,7 +20,7 @@ function _logger() {
20
20
  }
21
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
22
  const formatCompileResults = (compileResults, verbose) => compileResults.map(componentResult => ({
23
- componentId: componentResult.component.id.fullName,
23
+ componentId: componentResult.component,
24
24
  files: componentResult.buildResults,
25
25
  status: componentResult.errors.length ? 'FAILURE' : 'SUCCESS',
26
26
  icon: componentResult.errors.length ? _chalk().default.red('✗') : _logger().Logger.successSymbol()
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_logger","obj","__esModule","default","formatCompileResults","compileResults","verbose","map","componentResult","componentId","component","id","fullName","files","buildResults","status","errors","length","icon","chalk","red","Logger","successSymbol","reduce","outputString","result","fileList","file","exports"],"sources":["output-formatter.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Logger } from '@teambit/logger';\nimport { ComponentsStatus } from './compiler.cmd';\n\nexport const formatCompileResults = (compileResults: ComponentsStatus[], verbose: boolean) =>\n compileResults\n .map((componentResult: ComponentsStatus) => ({\n componentId: componentResult.component.id.fullName,\n files: componentResult.buildResults,\n status: componentResult.errors.length ? 'FAILURE' : 'SUCCESS',\n icon: componentResult.errors.length ? chalk.red('✗') : Logger.successSymbol(),\n }))\n .reduce((outputString, result) => {\n outputString += `${result.icon} ${result.status}\\t${result.componentId}`;\n if (verbose) {\n outputString += ':';\n outputString += result?.files?.reduce((fileList, file) => `${fileList}\\t\\t - ${file}\\n`, '\\n');\n }\n outputString += '\\n';\n return outputString;\n }, '');\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyC,SAAAC,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGlC,MAAMG,oBAAoB,GAAGA,CAACC,cAAkC,EAAEC,OAAgB,KACvFD,cAAc,CACXE,GAAG,CAAEC,eAAiC,KAAM;EAC3CC,WAAW,EAAED,eAAe,CAACE,SAAS,CAACC,EAAE,CAACC,QAAQ;EAClDC,KAAK,EAAEL,eAAe,CAACM,YAAY;EACnCC,MAAM,EAAEP,eAAe,CAACQ,MAAM,CAACC,MAAM,GAAG,SAAS,GAAG,SAAS;EAC7DC,IAAI,EAAEV,eAAe,CAACQ,MAAM,CAACC,MAAM,GAAGE,gBAAK,CAACC,GAAG,CAAC,GAAG,CAAC,GAAGC,gBAAM,CAACC,aAAa,CAAC;AAC9E,CAAC,CAAC,CAAC,CACFC,MAAM,CAAC,CAACC,YAAY,EAAEC,MAAM,KAAK;EAChCD,YAAY,IAAK,GAAEC,MAAM,CAACP,IAAK,IAAGO,MAAM,CAACV,MAAO,KAAIU,MAAM,CAAChB,WAAY,EAAC;EACxE,IAAIH,OAAO,EAAE;IACXkB,YAAY,IAAI,GAAG;IACnBA,YAAY,IAAIC,MAAM,EAAEZ,KAAK,EAAEU,MAAM,CAAC,CAACG,QAAQ,EAAEC,IAAI,KAAM,GAAED,QAAS,UAASC,IAAK,IAAG,EAAE,IAAI,CAAC;EAChG;EACAH,YAAY,IAAI,IAAI;EACpB,OAAOA,YAAY;AACrB,CAAC,EAAE,EAAE,CAAC;AAACI,OAAA,CAAAxB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_logger","obj","__esModule","default","formatCompileResults","compileResults","verbose","map","componentResult","componentId","component","files","buildResults","status","errors","length","icon","chalk","red","Logger","successSymbol","reduce","outputString","result","fileList","file","exports"],"sources":["output-formatter.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Logger } from '@teambit/logger';\nimport { BuildResult } from './workspace-compiler';\n\nexport const formatCompileResults = (compileResults: BuildResult[], verbose: boolean) =>\n compileResults\n .map((componentResult: BuildResult) => ({\n componentId: componentResult.component,\n files: componentResult.buildResults,\n status: componentResult.errors.length ? 'FAILURE' : 'SUCCESS',\n icon: componentResult.errors.length ? chalk.red('✗') : Logger.successSymbol(),\n }))\n .reduce((outputString, result) => {\n outputString += `${result.icon} ${result.status}\\t${result.componentId}`;\n if (verbose) {\n outputString += ':';\n outputString += result?.files?.reduce((fileList, file) => `${fileList}\\t\\t - ${file}\\n`, '\\n');\n }\n outputString += '\\n';\n return outputString;\n }, '');\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyC,SAAAC,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGlC,MAAMG,oBAAoB,GAAGA,CAACC,cAA6B,EAAEC,OAAgB,KAClFD,cAAc,CACXE,GAAG,CAAEC,eAA4B,KAAM;EACtCC,WAAW,EAAED,eAAe,CAACE,SAAS;EACtCC,KAAK,EAAEH,eAAe,CAACI,YAAY;EACnCC,MAAM,EAAEL,eAAe,CAACM,MAAM,CAACC,MAAM,GAAG,SAAS,GAAG,SAAS;EAC7DC,IAAI,EAAER,eAAe,CAACM,MAAM,CAACC,MAAM,GAAGE,gBAAK,CAACC,GAAG,CAAC,GAAG,CAAC,GAAGC,gBAAM,CAACC,aAAa,CAAC;AAC9E,CAAC,CAAC,CAAC,CACFC,MAAM,CAAC,CAACC,YAAY,EAAEC,MAAM,KAAK;EAChCD,YAAY,IAAK,GAAEC,MAAM,CAACP,IAAK,IAAGO,MAAM,CAACV,MAAO,KAAIU,MAAM,CAACd,WAAY,EAAC;EACxE,IAAIH,OAAO,EAAE;IACXgB,YAAY,IAAI,GAAG;IACnBA,YAAY,IAAIC,MAAM,EAAEZ,KAAK,EAAEU,MAAM,CAAC,CAACG,QAAQ,EAAEC,IAAI,KAAM,GAAED,QAAS,UAASC,IAAK,IAAG,EAAE,IAAI,CAAC;EAChG;EACAH,YAAY,IAAI,IAAI;EACpB,OAAOA,YAAY;AACrB,CAAC,EAAE,EAAE,CAAC;AAACI,OAAA,CAAAtB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@1.0.203/dist/compiler.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@1.0.203/dist/compiler.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@1.0.204/dist/compiler.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@1.0.204/dist/compiler.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -13,7 +13,8 @@ import type { PreStartOpts } from '@teambit/ui';
13
13
  import { Compiler, CompilationInitiator } from './types';
14
14
  export type BuildResult = {
15
15
  component: string;
16
- buildResults: string[] | null | undefined;
16
+ buildResults: string[];
17
+ errors: CompileError[];
17
18
  };
18
19
  export type CompileOptions = {
19
20
  changed?: boolean;
@@ -162,10 +162,10 @@ class ComponentCompiler {
162
162
  }
163
163
  const buildResults = this.dists.map(distFile => distFile.path);
164
164
  if (this.component.state._consumer.compiler) _loader().default.succeed();
165
- this.pubsub.pub(_compiler().CompilerAspect.id, new (_events().ComponentCompilationOnDoneEvent)(this.compileErrors, this.component, buildResults));
166
165
  return {
167
166
  component: this.component.id.toString(),
168
- buildResults
167
+ buildResults,
168
+ errors: this.compileErrors
169
169
  };
170
170
  }
171
171
  throwOnCompileErrors(noThrow = true) {
@@ -1 +1 @@
1
- {"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_workspace","_path","_loader","_constants","_sources","_dataToPersist","_workspaceModules","_componentIdToPackageName","_removePath","_bitRoots","_lodash","_compiler","_events","_types","obj","__esModule","default","ComponentCompiler","constructor","pubsub","workspace","component","compilerInstance","compilerId","logger","dependencyResolver","dists","compileErrors","compile","noThrow","options","dataToPersist","deleteDistDir","DataToPersist","distDir","distDirs","removePath","RemovePath","addBasePath","path","persistAllToFS","compilers","canTranspileFile","find","c","transpileFile","canTranspileComponent","transpileComponent","Promise","all","filesystem","files","map","file","compileOneFile","initiator","compileAllFiles","Error","toString","throwOnCompileErrors","addManyFiles","linkComponents","linkToNodeModulesByComponents","buildResults","distFile","state","_consumer","compiler","loader","succeed","pub","CompilerAspect","id","ComponentCompilationOnDoneEvent","length","forEach","errorItem","error","formatError","err","join","CompilerErrorEvent","console","message","packageName","componentIdToPackageName","packageDir","distDirName","getDistDir","DEFAULT_DIST_DIRNAME","injectedDirs","getInjectedDirs","dist","rootDirs","readBitRootsDir","rootDir","relative","componentDir","filePath","isFileSupported","compileResults","contents","push","base","result","Dist","outputPath","Buffer","from","outputText","shouldCopyNonSupportedFiles","filesToCompile","outputDir","getComponentPackagePath","exports","WorkspaceCompiler","envs","aspectLoader","ui","watcher","registerOnComponentChange","onComponentChange","bind","registerOnComponentAdd","onComponentAdd","registerOnPreWatch","onPreWatch","registerPreStart","onPreStart","registerOnAspectLoadErrorSlot","onAspectLoadFail","preStartOpts","skipCompilation","compileComponents","changed","verbose","CompilationInitiator","PreStart","watchScopeInternalFiles","code","AspectLoadFail","watchOpts","undefined","removedFiles","Boolean","removeLinksFromNodeModules","ComponentChanged","results","componentIds","preCompile","start","Date","now","PreWatch","end","consoleSuccess","componentsIds","OutsideWorkspaceError","getIdsToCompile","getManyOpts","loadSeedersAsAspects","components","getMany","grouped","groupByIsEnv","envsResults","runCompileComponents","otherResults","other","componentsCompilers","environment","getEnv","env","getCompiler","compilerName","name","warn","resultOnWorkspace","mapSeries","componentCompiler","envsIds","uniq","getEnvId","filter","envId","isCoreEnv","groupBy","includes","resolveMultipleComponentIds","filterIds","getNewAndModifiedIds","listIds"],"sources":["workspace-compiler.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport mapSeries from 'p-map-series';\nimport { Component } from '@teambit/component';\nimport { EnvsMain } from '@teambit/envs';\nimport type { PubsubMain } from '@teambit/pubsub';\nimport { SerializableResults, Workspace, OutsideWorkspaceError } from '@teambit/workspace';\nimport { WatcherMain, WatchOptions } from '@teambit/watcher';\nimport path from 'path';\nimport { ComponentID } from '@teambit/component-id';\nimport { Logger } from '@teambit/logger';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy/dist/constants';\nimport { AbstractVinyl, Dist } from '@teambit/legacy/dist/consumer/component/sources';\nimport DataToPersist from '@teambit/legacy/dist/consumer/component/sources/data-to-persist';\nimport {\n linkToNodeModulesByComponents,\n removeLinksFromNodeModules,\n} from '@teambit/workspace.modules.node-modules-linker';\nimport { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport componentIdToPackageName from '@teambit/legacy/dist/utils/bit/component-id-to-package-name';\nimport RemovePath from '@teambit/legacy/dist/consumer/component/sources/remove-path';\nimport { UiMain } from '@teambit/ui';\nimport { readBitRootsDir } from '@teambit/bit-roots';\nimport { groupBy, uniq } from 'lodash';\nimport type { PreStartOpts } from '@teambit/ui';\nimport { PathOsBasedAbsolute, PathOsBasedRelative } from '@teambit/legacy/dist/utils/path';\nimport { MultiCompiler } from '@teambit/multi-compiler';\nimport { CompilerAspect } from './compiler.aspect';\nimport { CompilerErrorEvent, ComponentCompilationOnDoneEvent } from './events';\nimport { Compiler, CompilationInitiator } from './types';\n\nexport type BuildResult = { component: string; buildResults: string[] | null | undefined };\n\nexport type CompileOptions = {\n changed?: boolean; // compile only new and modified components\n verbose?: boolean; // show more data, such as, dist paths\n /**\n * whether the dist root dir should be deleted before writing new dists.\n * defaults to true for `bit compile` and false everywhere else, such as `bit watch` and `bit\n * start` to avoid webpack \"EINTR\" error.\n */\n deleteDistDir?: boolean;\n initiator: CompilationInitiator; // describes where the compilation is coming from\n // should we create links in node_modules for the compiled components (default = true)\n // this will link the source files, and create the package.json\n linkComponents?: boolean;\n};\n\nexport type CompileError = { path: string; error: Error };\n\nexport class ComponentCompiler {\n constructor(\n private pubsub: PubsubMain,\n private workspace: Workspace,\n private component: Component,\n private compilerInstance: Compiler,\n private compilerId: string,\n private logger: Logger,\n private dependencyResolver: DependencyResolverMain,\n private dists: Dist[] = [],\n private compileErrors: CompileError[] = []\n ) {}\n\n async compile(noThrow = true, options: CompileOptions): Promise<BuildResult> {\n let dataToPersist;\n const deleteDistDir = options.deleteDistDir ?? this.compilerInstance.deleteDistDir;\n // delete dist folder before transpilation (because some compilers (like ngPackagr) can generate files there during the compilation process)\n if (deleteDistDir) {\n dataToPersist = new DataToPersist();\n for (const distDir of await this.distDirs()) {\n dataToPersist.removePath(new RemovePath(distDir));\n }\n dataToPersist.addBasePath(this.workspace.path);\n await dataToPersist.persistAllToFS();\n }\n\n const compilers: Compiler[] = (this.compilerInstance as MultiCompiler).compilers\n ? (this.compilerInstance as MultiCompiler).compilers\n : [this.compilerInstance];\n const canTranspileFile = compilers.find((c) => c.transpileFile);\n const canTranspileComponent = compilers.find((c) => c.transpileComponent);\n\n if (canTranspileFile) {\n await Promise.all(\n this.component.filesystem.files.map((file: AbstractVinyl) => this.compileOneFile(file, options.initiator))\n );\n }\n\n if (canTranspileComponent) {\n await this.compileAllFiles(this.component, options.initiator);\n }\n\n if (!canTranspileFile && !canTranspileComponent) {\n throw new Error(\n `compiler ${this.compilerId.toString()} doesn't implement either \"transpileFile\" or \"transpileComponent\" methods`\n );\n }\n this.throwOnCompileErrors(noThrow);\n\n // writing the dists with `component.setDists(dists); component.dists.writeDists` is tricky\n // as it uses other base-paths and doesn't respect the new node-modules base path.\n dataToPersist = new DataToPersist();\n dataToPersist.addManyFiles(this.dists);\n dataToPersist.addBasePath(this.workspace.path);\n await dataToPersist.persistAllToFS();\n const linkComponents = options.linkComponents ?? true;\n if (linkComponents) {\n await linkToNodeModulesByComponents([this.component], this.workspace);\n }\n const buildResults = this.dists.map((distFile) => distFile.path);\n if (this.component.state._consumer.compiler) loader.succeed();\n this.pubsub.pub(\n CompilerAspect.id,\n new ComponentCompilationOnDoneEvent(this.compileErrors, this.component, buildResults)\n );\n return { component: this.component.id.toString(), buildResults };\n }\n\n private throwOnCompileErrors(noThrow = true) {\n if (this.compileErrors.length) {\n this.compileErrors.forEach((errorItem) => {\n this.logger.error(`compilation error at ${errorItem.path}`, errorItem.error);\n });\n const formatError = (errorItem) => `${errorItem.path}\\n${errorItem.error}`;\n const err = new Error(`compilation failed. see the following errors from the compiler\n${this.compileErrors.map(formatError).join('\\n')}`);\n\n this.pubsub.pub(CompilerAspect.id, new CompilerErrorEvent(err));\n\n if (!noThrow) {\n throw err;\n }\n\n this.logger.console(err.message);\n }\n }\n\n private async distDirs(): Promise<PathOsBasedRelative[]> {\n const packageName = componentIdToPackageName(this.component.state._consumer);\n const packageDir = path.join('node_modules', packageName);\n const distDirName = this.compilerInstance.getDistDir?.() || DEFAULT_DIST_DIRNAME;\n const injectedDirs = await this.getInjectedDirs(packageName);\n return [packageDir, ...injectedDirs].map((dist) => path.join(dist, distDirName));\n }\n\n private async getInjectedDirs(packageName: string): Promise<string[]> {\n const injectedDirs = await this.workspace.getInjectedDirs(this.component);\n if (injectedDirs.length > 0) return injectedDirs;\n\n const rootDirs = await readBitRootsDir(this.workspace.path);\n return rootDirs.map((rootDir) => path.relative(this.workspace.path, path.join(rootDir, packageName)));\n }\n\n private get componentDir(): PathOsBasedAbsolute {\n return this.workspace.componentDir(this.component.id);\n }\n\n private async compileOneFile(file: AbstractVinyl, initiator: CompilationInitiator): Promise<void> {\n const options = { componentDir: this.componentDir, filePath: file.relative, initiator };\n const isFileSupported = this.compilerInstance.isFileSupported(file.path);\n let compileResults;\n if (isFileSupported) {\n try {\n compileResults = await this.compilerInstance.transpileFile?.(file.contents.toString(), options);\n } catch (error: any) {\n this.compileErrors.push({ path: file.path, error });\n return;\n }\n }\n for (const base of await this.distDirs()) {\n if (isFileSupported && compileResults) {\n this.dists.push(\n ...compileResults.map(\n (result) =>\n new Dist({\n base,\n path: path.join(base, result.outputPath),\n contents: Buffer.from(result.outputText),\n })\n )\n );\n } else if (this.compilerInstance.shouldCopyNonSupportedFiles) {\n // compiler doesn't support this file type. copy the file as is to the dist dir.\n this.dists.push(new Dist({ base, path: path.join(base, file.relative), contents: file.contents }));\n }\n }\n }\n\n private async compileAllFiles(component: Component, initiator: CompilationInitiator): Promise<void> {\n const filesToCompile: AbstractVinyl[] = [];\n for (const base of await this.distDirs()) {\n component.filesystem.files.forEach((file: AbstractVinyl) => {\n const isFileSupported = this.compilerInstance.isFileSupported(file.path);\n if (isFileSupported) {\n filesToCompile.push(file);\n } else if (this.compilerInstance.shouldCopyNonSupportedFiles) {\n // compiler doesn't support this file type. copy the file as is to the dist dir.\n this.dists.push(\n new Dist({\n base,\n path: path.join(base, file.relative),\n contents: file.contents,\n })\n );\n }\n });\n }\n\n if (filesToCompile.length) {\n try {\n await this.compilerInstance.transpileComponent?.({\n component,\n componentDir: this.componentDir,\n outputDir: await this.workspace.getComponentPackagePath(component),\n initiator,\n });\n } catch (error: any) {\n this.compileErrors.push({ path: this.componentDir, error });\n }\n }\n }\n}\n\nexport class WorkspaceCompiler {\n constructor(\n private workspace: Workspace,\n private envs: EnvsMain,\n private pubsub: PubsubMain,\n private aspectLoader: AspectLoaderMain,\n private ui: UiMain,\n private logger: Logger,\n private dependencyResolver: DependencyResolverMain,\n private watcher: WatcherMain\n ) {\n if (this.workspace) {\n this.workspace.registerOnComponentChange(this.onComponentChange.bind(this));\n this.workspace.registerOnComponentAdd(this.onComponentAdd.bind(this));\n this.watcher.registerOnPreWatch(this.onPreWatch.bind(this));\n }\n this.ui.registerPreStart(this.onPreStart.bind(this));\n if (this.aspectLoader) {\n this.aspectLoader.registerOnAspectLoadErrorSlot(this.onAspectLoadFail.bind(this));\n }\n }\n\n async onPreStart(preStartOpts: PreStartOpts): Promise<void> {\n if (this.workspace) {\n if (preStartOpts.skipCompilation) {\n return;\n }\n await this.compileComponents([], {\n changed: true,\n verbose: false,\n deleteDistDir: false,\n initiator: CompilationInitiator.PreStart,\n });\n } else {\n await this.watcher.watchScopeInternalFiles();\n }\n }\n\n async onAspectLoadFail(err: Error & { code?: string }, id: ComponentID): Promise<boolean> {\n if (err.code && err.code === 'MODULE_NOT_FOUND' && this.workspace) {\n await this.compileComponents([id.toString()], { initiator: CompilationInitiator.AspectLoadFail }, true);\n return true;\n }\n return false;\n }\n\n async onComponentAdd(component: Component, files: string[], watchOpts: WatchOptions) {\n return this.onComponentChange(component, files, undefined, watchOpts);\n }\n\n async onComponentChange(\n component: Component,\n files: string[],\n removedFiles: string[] = [],\n watchOpts: WatchOptions\n ): Promise<SerializableResults | void> {\n if (!watchOpts.compile) return undefined;\n // when files are removed, we need to remove the dist directories and the old symlinks, otherwise, it has\n // symlinks to non-exist files and the dist has stale files\n const deleteDistDir = Boolean(removedFiles?.length);\n if (removedFiles?.length) {\n await removeLinksFromNodeModules(component, this.workspace, removedFiles);\n }\n const buildResults = await this.compileComponents(\n [component.id.toString()],\n { initiator: watchOpts.initiator || CompilationInitiator.ComponentChanged, deleteDistDir },\n true\n );\n // await linkToNodeModulesByComponents([component], this.workspace);\n return {\n results: buildResults,\n toString() {\n return `${buildResults[0]?.buildResults?.join('\\n\\t')}`;\n },\n };\n }\n\n async onPreWatch(componentIds: ComponentID[], watchOpts: WatchOptions) {\n if (watchOpts.preCompile) {\n const start = Date.now();\n this.logger.console(`compiling ${componentIds.length} components`);\n await this.compileComponents(\n componentIds.map((id) => id),\n { initiator: CompilationInitiator.PreWatch }\n );\n const end = Date.now() - start;\n this.logger.consoleSuccess(`compiled ${componentIds.length} components successfully (${end / 1000} sec)`);\n }\n }\n\n async compileComponents(\n componentsIds: string[] | ComponentID[] | ComponentID[], // when empty, it compiles new+modified (unless options.all is set),\n options: CompileOptions,\n noThrow?: boolean\n ): Promise<BuildResult[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const componentIds = await this.getIdsToCompile(componentsIds, options.changed);\n // In case the aspect failed to load, we want to compile it without try to re-load it again\n const getManyOpts =\n options.initiator === CompilationInitiator.AspectLoadFail ? { loadSeedersAsAspects: false } : undefined;\n const components = await this.workspace.getMany(componentIds, getManyOpts);\n\n const grouped = this.groupByIsEnv(components);\n const envsResults = grouped.envs ? await this.runCompileComponents(grouped.envs, options, noThrow) : [];\n const otherResults = grouped.other ? await this.runCompileComponents(grouped.other, options, noThrow) : [];\n return [...envsResults, ...otherResults];\n }\n\n private async runCompileComponents(\n components: Component[],\n options: CompileOptions,\n noThrow?: boolean\n ): Promise<BuildResult[]> {\n const componentsCompilers: ComponentCompiler[] = [];\n\n components.forEach((c) => {\n const environment = this.envs.getEnv(c).env;\n const compilerInstance = environment.getCompiler?.();\n\n if (compilerInstance) {\n const compilerName = compilerInstance.constructor.name || 'compiler';\n componentsCompilers.push(\n new ComponentCompiler(\n this.pubsub,\n this.workspace,\n c,\n compilerInstance,\n compilerName,\n this.logger,\n this.dependencyResolver\n )\n );\n } else {\n this.logger.warn(`unable to find a compiler instance for ${c.id.toString()}`);\n }\n });\n const resultOnWorkspace = await mapSeries(componentsCompilers, (componentCompiler) =>\n componentCompiler.compile(noThrow, options)\n );\n\n return resultOnWorkspace;\n }\n\n /**\n * This function get's a list of aspect ids and return them grouped by whether any of them is the env of other from the list\n * @param ids\n */\n groupByIsEnv(components: Component[]): { envs?: Component[]; other?: Component[] } {\n const envsIds = uniq(\n components\n .map((component) => this.envs.getEnvId(component))\n .filter((envId) => !this.aspectLoader.isCoreEnv(envId))\n );\n const grouped = groupBy(components, (component) => {\n if (envsIds.includes(component.id.toString())) return 'envs';\n return 'other';\n });\n return grouped as { envs: Component[]; other: Component[] };\n }\n\n private async getIdsToCompile(componentsIds: Array<string | ComponentID>, changed = false): Promise<ComponentID[]> {\n if (componentsIds.length) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(componentsIds);\n return this.workspace.filterIds(componentIds);\n }\n if (changed) {\n return this.workspace.getNewAndModifiedIds();\n }\n return this.workspace.listIds();\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAA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,GAAG,IAAAC,cAAI,EAClBpB,UAAU,CACP7G,GAAG,CAAE/B,SAAS,IAAK,IAAI,CAAC+F,IAAI,CAACkE,QAAQ,CAACjK,SAAS,CAAC,CAAC,CACjDkK,MAAM,CAAEC,KAAK,IAAK,CAAC,IAAI,CAACnE,YAAY,CAACoE,SAAS,CAACD,KAAK,CAAC,CAC1D,CAAC;IACD,MAAMrB,OAAO,GAAG,IAAAuB,iBAAO,EAACzB,UAAU,EAAG5I,SAAS,IAAK;MACjD,IAAI+J,OAAO,CAACO,QAAQ,CAACtK,SAAS,CAACmD,EAAE,CAACd,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,MAAM;MAC5D,OAAO,OAAO;IAChB,CAAC,CAAC;IACF,OAAOyG,OAAO;EAChB;EAEA,MAAcL,eAAeA,CAACF,aAA0C,EAAEtB,OAAO,GAAG,KAAK,EAA0B;IACjH,IAAIsB,aAAa,CAAClF,MAAM,EAAE;MACxB,MAAM0E,YAAY,GAAG,MAAM,IAAI,CAAChI,SAAS,CAACwK,2BAA2B,CAAChC,aAAa,CAAC;MACpF,OAAO,IAAI,CAACxI,SAAS,CAACyK,SAAS,CAACzC,YAAY,CAAC;IAC/C;IACA,IAAId,OAAO,EAAE;MACX,OAAO,IAAI,CAAClH,SAAS,CAAC0K,oBAAoB,CAAC,CAAC;IAC9C;IACA,OAAO,IAAI,CAAC1K,SAAS,CAAC2K,OAAO,CAAC,CAAC;EACjC;AACF;AAAC7E,OAAA,CAAAC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_workspace","_path","_loader","_constants","_sources","_dataToPersist","_workspaceModules","_componentIdToPackageName","_removePath","_bitRoots","_lodash","_compiler","_events","_types","obj","__esModule","default","ComponentCompiler","constructor","pubsub","workspace","component","compilerInstance","compilerId","logger","dependencyResolver","dists","compileErrors","compile","noThrow","options","dataToPersist","deleteDistDir","DataToPersist","distDir","distDirs","removePath","RemovePath","addBasePath","path","persistAllToFS","compilers","canTranspileFile","find","c","transpileFile","canTranspileComponent","transpileComponent","Promise","all","filesystem","files","map","file","compileOneFile","initiator","compileAllFiles","Error","toString","throwOnCompileErrors","addManyFiles","linkComponents","linkToNodeModulesByComponents","buildResults","distFile","state","_consumer","compiler","loader","succeed","id","errors","length","forEach","errorItem","error","formatError","err","join","pub","CompilerAspect","CompilerErrorEvent","console","message","packageName","componentIdToPackageName","packageDir","distDirName","getDistDir","DEFAULT_DIST_DIRNAME","injectedDirs","getInjectedDirs","dist","rootDirs","readBitRootsDir","rootDir","relative","componentDir","filePath","isFileSupported","compileResults","contents","push","base","result","Dist","outputPath","Buffer","from","outputText","shouldCopyNonSupportedFiles","filesToCompile","outputDir","getComponentPackagePath","exports","WorkspaceCompiler","envs","aspectLoader","ui","watcher","registerOnComponentChange","onComponentChange","bind","registerOnComponentAdd","onComponentAdd","registerOnPreWatch","onPreWatch","registerPreStart","onPreStart","registerOnAspectLoadErrorSlot","onAspectLoadFail","preStartOpts","skipCompilation","compileComponents","changed","verbose","CompilationInitiator","PreStart","watchScopeInternalFiles","code","AspectLoadFail","watchOpts","undefined","removedFiles","Boolean","removeLinksFromNodeModules","ComponentChanged","results","componentIds","preCompile","start","Date","now","PreWatch","end","consoleSuccess","componentsIds","OutsideWorkspaceError","getIdsToCompile","getManyOpts","loadSeedersAsAspects","components","getMany","grouped","groupByIsEnv","envsResults","runCompileComponents","otherResults","other","componentsCompilers","environment","getEnv","env","getCompiler","compilerName","name","warn","resultOnWorkspace","mapSeries","componentCompiler","envsIds","uniq","getEnvId","filter","envId","isCoreEnv","groupBy","includes","resolveMultipleComponentIds","filterIds","getNewAndModifiedIds","listIds"],"sources":["workspace-compiler.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport mapSeries from 'p-map-series';\nimport { Component } from '@teambit/component';\nimport { EnvsMain } from '@teambit/envs';\nimport type { PubsubMain } from '@teambit/pubsub';\nimport { SerializableResults, Workspace, OutsideWorkspaceError } from '@teambit/workspace';\nimport { WatcherMain, WatchOptions } from '@teambit/watcher';\nimport path from 'path';\nimport { ComponentID } from '@teambit/component-id';\nimport { Logger } from '@teambit/logger';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy/dist/constants';\nimport { AbstractVinyl, Dist } from '@teambit/legacy/dist/consumer/component/sources';\nimport DataToPersist from '@teambit/legacy/dist/consumer/component/sources/data-to-persist';\nimport {\n linkToNodeModulesByComponents,\n removeLinksFromNodeModules,\n} from '@teambit/workspace.modules.node-modules-linker';\nimport { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport componentIdToPackageName from '@teambit/legacy/dist/utils/bit/component-id-to-package-name';\nimport RemovePath from '@teambit/legacy/dist/consumer/component/sources/remove-path';\nimport { UiMain } from '@teambit/ui';\nimport { readBitRootsDir } from '@teambit/bit-roots';\nimport { groupBy, uniq } from 'lodash';\nimport type { PreStartOpts } from '@teambit/ui';\nimport { PathOsBasedAbsolute, PathOsBasedRelative } from '@teambit/legacy/dist/utils/path';\nimport { MultiCompiler } from '@teambit/multi-compiler';\nimport { CompilerAspect } from './compiler.aspect';\nimport { CompilerErrorEvent } from './events';\nimport { Compiler, CompilationInitiator } from './types';\n\nexport type BuildResult = {\n component: string;\n buildResults: string[];\n errors: CompileError[];\n};\n\nexport type CompileOptions = {\n changed?: boolean; // compile only new and modified components\n verbose?: boolean; // show more data, such as, dist paths\n /**\n * whether the dist root dir should be deleted before writing new dists.\n * defaults to true for `bit compile` and false everywhere else, such as `bit watch` and `bit\n * start` to avoid webpack \"EINTR\" error.\n */\n deleteDistDir?: boolean;\n initiator: CompilationInitiator; // describes where the compilation is coming from\n // should we create links in node_modules for the compiled components (default = true)\n // this will link the source files, and create the package.json\n linkComponents?: boolean;\n};\n\nexport type CompileError = { path: string; error: Error };\n\nexport class ComponentCompiler {\n constructor(\n private pubsub: PubsubMain,\n private workspace: Workspace,\n private component: Component,\n private compilerInstance: Compiler,\n private compilerId: string,\n private logger: Logger,\n private dependencyResolver: DependencyResolverMain,\n private dists: Dist[] = [],\n private compileErrors: CompileError[] = []\n ) {}\n\n async compile(noThrow = true, options: CompileOptions): Promise<BuildResult> {\n let dataToPersist;\n const deleteDistDir = options.deleteDistDir ?? this.compilerInstance.deleteDistDir;\n // delete dist folder before transpilation (because some compilers (like ngPackagr) can generate files there during the compilation process)\n if (deleteDistDir) {\n dataToPersist = new DataToPersist();\n for (const distDir of await this.distDirs()) {\n dataToPersist.removePath(new RemovePath(distDir));\n }\n dataToPersist.addBasePath(this.workspace.path);\n await dataToPersist.persistAllToFS();\n }\n\n const compilers: Compiler[] = (this.compilerInstance as MultiCompiler).compilers\n ? (this.compilerInstance as MultiCompiler).compilers\n : [this.compilerInstance];\n const canTranspileFile = compilers.find((c) => c.transpileFile);\n const canTranspileComponent = compilers.find((c) => c.transpileComponent);\n\n if (canTranspileFile) {\n await Promise.all(\n this.component.filesystem.files.map((file: AbstractVinyl) => this.compileOneFile(file, options.initiator))\n );\n }\n\n if (canTranspileComponent) {\n await this.compileAllFiles(this.component, options.initiator);\n }\n\n if (!canTranspileFile && !canTranspileComponent) {\n throw new Error(\n `compiler ${this.compilerId.toString()} doesn't implement either \"transpileFile\" or \"transpileComponent\" methods`\n );\n }\n this.throwOnCompileErrors(noThrow);\n\n // writing the dists with `component.setDists(dists); component.dists.writeDists` is tricky\n // as it uses other base-paths and doesn't respect the new node-modules base path.\n dataToPersist = new DataToPersist();\n dataToPersist.addManyFiles(this.dists);\n dataToPersist.addBasePath(this.workspace.path);\n await dataToPersist.persistAllToFS();\n const linkComponents = options.linkComponents ?? true;\n if (linkComponents) {\n await linkToNodeModulesByComponents([this.component], this.workspace);\n }\n const buildResults = this.dists.map((distFile) => distFile.path);\n if (this.component.state._consumer.compiler) loader.succeed();\n\n return { component: this.component.id.toString(), buildResults, errors: this.compileErrors };\n }\n\n private throwOnCompileErrors(noThrow = true) {\n if (this.compileErrors.length) {\n this.compileErrors.forEach((errorItem) => {\n this.logger.error(`compilation error at ${errorItem.path}`, errorItem.error);\n });\n const formatError = (errorItem) => `${errorItem.path}\\n${errorItem.error}`;\n const err = new Error(`compilation failed. see the following errors from the compiler\n${this.compileErrors.map(formatError).join('\\n')}`);\n\n this.pubsub.pub(CompilerAspect.id, new CompilerErrorEvent(err));\n\n if (!noThrow) {\n throw err;\n }\n\n this.logger.console(err.message);\n }\n }\n\n private async distDirs(): Promise<PathOsBasedRelative[]> {\n const packageName = componentIdToPackageName(this.component.state._consumer);\n const packageDir = path.join('node_modules', packageName);\n const distDirName = this.compilerInstance.getDistDir?.() || DEFAULT_DIST_DIRNAME;\n const injectedDirs = await this.getInjectedDirs(packageName);\n return [packageDir, ...injectedDirs].map((dist) => path.join(dist, distDirName));\n }\n\n private async getInjectedDirs(packageName: string): Promise<string[]> {\n const injectedDirs = await this.workspace.getInjectedDirs(this.component);\n if (injectedDirs.length > 0) return injectedDirs;\n\n const rootDirs = await readBitRootsDir(this.workspace.path);\n return rootDirs.map((rootDir) => path.relative(this.workspace.path, path.join(rootDir, packageName)));\n }\n\n private get componentDir(): PathOsBasedAbsolute {\n return this.workspace.componentDir(this.component.id);\n }\n\n private async compileOneFile(file: AbstractVinyl, initiator: CompilationInitiator): Promise<void> {\n const options = { componentDir: this.componentDir, filePath: file.relative, initiator };\n const isFileSupported = this.compilerInstance.isFileSupported(file.path);\n let compileResults;\n if (isFileSupported) {\n try {\n compileResults = await this.compilerInstance.transpileFile?.(file.contents.toString(), options);\n } catch (error: any) {\n this.compileErrors.push({ path: file.path, error });\n return;\n }\n }\n for (const base of await this.distDirs()) {\n if (isFileSupported && compileResults) {\n this.dists.push(\n ...compileResults.map(\n (result) =>\n new Dist({\n base,\n path: path.join(base, result.outputPath),\n contents: Buffer.from(result.outputText),\n })\n )\n );\n } else if (this.compilerInstance.shouldCopyNonSupportedFiles) {\n // compiler doesn't support this file type. copy the file as is to the dist dir.\n this.dists.push(new Dist({ base, path: path.join(base, file.relative), contents: file.contents }));\n }\n }\n }\n\n private async compileAllFiles(component: Component, initiator: CompilationInitiator): Promise<void> {\n const filesToCompile: AbstractVinyl[] = [];\n for (const base of await this.distDirs()) {\n component.filesystem.files.forEach((file: AbstractVinyl) => {\n const isFileSupported = this.compilerInstance.isFileSupported(file.path);\n if (isFileSupported) {\n filesToCompile.push(file);\n } else if (this.compilerInstance.shouldCopyNonSupportedFiles) {\n // compiler doesn't support this file type. copy the file as is to the dist dir.\n this.dists.push(\n new Dist({\n base,\n path: path.join(base, file.relative),\n contents: file.contents,\n })\n );\n }\n });\n }\n\n if (filesToCompile.length) {\n try {\n await this.compilerInstance.transpileComponent?.({\n component,\n componentDir: this.componentDir,\n outputDir: await this.workspace.getComponentPackagePath(component),\n initiator,\n });\n } catch (error: any) {\n this.compileErrors.push({ path: this.componentDir, error });\n }\n }\n }\n}\n\nexport class WorkspaceCompiler {\n constructor(\n private workspace: Workspace,\n private envs: EnvsMain,\n private pubsub: PubsubMain,\n private aspectLoader: AspectLoaderMain,\n private ui: UiMain,\n private logger: Logger,\n private dependencyResolver: DependencyResolverMain,\n private watcher: WatcherMain\n ) {\n if (this.workspace) {\n this.workspace.registerOnComponentChange(this.onComponentChange.bind(this));\n this.workspace.registerOnComponentAdd(this.onComponentAdd.bind(this));\n this.watcher.registerOnPreWatch(this.onPreWatch.bind(this));\n }\n this.ui.registerPreStart(this.onPreStart.bind(this));\n if (this.aspectLoader) {\n this.aspectLoader.registerOnAspectLoadErrorSlot(this.onAspectLoadFail.bind(this));\n }\n }\n\n async onPreStart(preStartOpts: PreStartOpts): Promise<void> {\n if (this.workspace) {\n if (preStartOpts.skipCompilation) {\n return;\n }\n await this.compileComponents([], {\n changed: true,\n verbose: false,\n deleteDistDir: false,\n initiator: CompilationInitiator.PreStart,\n });\n } else {\n await this.watcher.watchScopeInternalFiles();\n }\n }\n\n async onAspectLoadFail(err: Error & { code?: string }, id: ComponentID): Promise<boolean> {\n if (err.code && err.code === 'MODULE_NOT_FOUND' && this.workspace) {\n await this.compileComponents([id.toString()], { initiator: CompilationInitiator.AspectLoadFail }, true);\n return true;\n }\n return false;\n }\n\n async onComponentAdd(component: Component, files: string[], watchOpts: WatchOptions) {\n return this.onComponentChange(component, files, undefined, watchOpts);\n }\n\n async onComponentChange(\n component: Component,\n files: string[],\n removedFiles: string[] = [],\n watchOpts: WatchOptions\n ): Promise<SerializableResults | void> {\n if (!watchOpts.compile) return undefined;\n // when files are removed, we need to remove the dist directories and the old symlinks, otherwise, it has\n // symlinks to non-exist files and the dist has stale files\n const deleteDistDir = Boolean(removedFiles?.length);\n if (removedFiles?.length) {\n await removeLinksFromNodeModules(component, this.workspace, removedFiles);\n }\n const buildResults = await this.compileComponents(\n [component.id.toString()],\n { initiator: watchOpts.initiator || CompilationInitiator.ComponentChanged, deleteDistDir },\n true\n );\n // await linkToNodeModulesByComponents([component], this.workspace);\n return {\n results: buildResults,\n toString() {\n return `${buildResults[0]?.buildResults?.join('\\n\\t')}`;\n },\n };\n }\n\n async onPreWatch(componentIds: ComponentID[], watchOpts: WatchOptions) {\n if (watchOpts.preCompile) {\n const start = Date.now();\n this.logger.console(`compiling ${componentIds.length} components`);\n await this.compileComponents(\n componentIds.map((id) => id),\n { initiator: CompilationInitiator.PreWatch }\n );\n const end = Date.now() - start;\n this.logger.consoleSuccess(`compiled ${componentIds.length} components successfully (${end / 1000} sec)`);\n }\n }\n\n async compileComponents(\n componentsIds: string[] | ComponentID[] | ComponentID[], // when empty, it compiles new+modified (unless options.all is set),\n options: CompileOptions,\n noThrow?: boolean\n ): Promise<BuildResult[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const componentIds = await this.getIdsToCompile(componentsIds, options.changed);\n // In case the aspect failed to load, we want to compile it without try to re-load it again\n const getManyOpts =\n options.initiator === CompilationInitiator.AspectLoadFail ? { loadSeedersAsAspects: false } : undefined;\n const components = await this.workspace.getMany(componentIds, getManyOpts);\n\n const grouped = this.groupByIsEnv(components);\n const envsResults = grouped.envs ? await this.runCompileComponents(grouped.envs, options, noThrow) : [];\n const otherResults = grouped.other ? await this.runCompileComponents(grouped.other, options, noThrow) : [];\n return [...envsResults, ...otherResults];\n }\n\n private async runCompileComponents(\n components: Component[],\n options: CompileOptions,\n noThrow?: boolean\n ): Promise<BuildResult[]> {\n const componentsCompilers: ComponentCompiler[] = [];\n\n components.forEach((c) => {\n const environment = this.envs.getEnv(c).env;\n const compilerInstance = environment.getCompiler?.();\n\n if (compilerInstance) {\n const compilerName = compilerInstance.constructor.name || 'compiler';\n componentsCompilers.push(\n new ComponentCompiler(\n this.pubsub,\n this.workspace,\n c,\n compilerInstance,\n compilerName,\n this.logger,\n this.dependencyResolver\n )\n );\n } else {\n this.logger.warn(`unable to find a compiler instance for ${c.id.toString()}`);\n }\n });\n const resultOnWorkspace = await mapSeries(componentsCompilers, (componentCompiler) =>\n componentCompiler.compile(noThrow, options)\n );\n\n return resultOnWorkspace;\n }\n\n /**\n * This function get's a list of aspect ids and return them grouped by whether any of them is the env of other from the list\n * @param ids\n */\n groupByIsEnv(components: Component[]): { envs?: Component[]; other?: Component[] } {\n const envsIds = uniq(\n components\n .map((component) => this.envs.getEnvId(component))\n .filter((envId) => !this.aspectLoader.isCoreEnv(envId))\n );\n const grouped = groupBy(components, (component) => {\n if (envsIds.includes(component.id.toString())) return 'envs';\n return 'other';\n });\n return grouped as { envs: Component[]; other: Component[] };\n }\n\n private async getIdsToCompile(componentsIds: Array<string | ComponentID>, changed = false): Promise<ComponentID[]> {\n if (componentsIds.length) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(componentsIds);\n return this.workspace.filterIds(componentIds);\n }\n if (changed) {\n return this.workspace.getNewAndModifiedIds();\n }\n return this.workspace.listIds();\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA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AC,IAAI,CAACnE,YAAY,CAACoE,SAAS,CAACD,KAAK,CAAC,CAC1D,CAAC;IACD,MAAMrB,OAAO,GAAG,IAAAuB,iBAAO,EAACzB,UAAU,EAAG5I,SAAS,IAAK;MACjD,IAAI+J,OAAO,CAACO,QAAQ,CAACtK,SAAS,CAACiD,EAAE,CAACZ,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,MAAM;MAC5D,OAAO,OAAO;IAChB,CAAC,CAAC;IACF,OAAOyG,OAAO;EAChB;EAEA,MAAcL,eAAeA,CAACF,aAA0C,EAAEtB,OAAO,GAAG,KAAK,EAA0B;IACjH,IAAIsB,aAAa,CAACpF,MAAM,EAAE;MACxB,MAAM4E,YAAY,GAAG,MAAM,IAAI,CAAChI,SAAS,CAACwK,2BAA2B,CAAChC,aAAa,CAAC;MACpF,OAAO,IAAI,CAACxI,SAAS,CAACyK,SAAS,CAACzC,YAAY,CAAC;IAC/C;IACA,IAAId,OAAO,EAAE;MACX,OAAO,IAAI,CAAClH,SAAS,CAAC0K,oBAAoB,CAAC,CAAC;IAC9C;IACA,OAAO,IAAI,CAAC1K,SAAS,CAAC2K,OAAO,CAAC,CAAC;EACjC;AACF;AAAC7E,OAAA,CAAAC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
package/events/index.ts CHANGED
@@ -1,2 +1 @@
1
1
  export * from './compiler-error';
2
- export * from './component-compilation-on-done';
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/compiler",
3
- "version": "1.0.203",
3
+ "version": "1.0.204",
4
4
  "homepage": "https://bit.cloud/teambit/compilation/compiler",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.compilation",
8
8
  "name": "compiler",
9
- "version": "1.0.203"
9
+ "version": "1.0.204"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -19,23 +19,23 @@
19
19
  "@teambit/component-id": "1.2.0",
20
20
  "@teambit/bit-roots": "0.0.133",
21
21
  "@teambit/bit-error": "0.0.404",
22
- "@teambit/envs": "1.0.203",
22
+ "@teambit/envs": "1.0.204",
23
23
  "@teambit/cli": "0.0.858",
24
- "@teambit/component": "1.0.203",
25
24
  "@teambit/logger": "0.0.951",
26
- "@teambit/pubsub": "1.0.203",
27
- "@teambit/aspect-loader": "1.0.203",
28
- "@teambit/builder": "1.0.203",
25
+ "@teambit/pubsub": "1.0.204",
26
+ "@teambit/aspect-loader": "1.0.204",
27
+ "@teambit/builder": "1.0.204",
29
28
  "@teambit/component-issues": "0.0.141",
30
- "@teambit/dependency-resolver": "1.0.203",
31
- "@teambit/generator": "1.0.204",
32
- "@teambit/issues": "1.0.203",
33
- "@teambit/ui": "1.0.203",
34
- "@teambit/watcher": "1.0.203",
35
- "@teambit/workspace": "1.0.203",
36
- "@teambit/isolator": "1.0.203",
29
+ "@teambit/component": "1.0.204",
30
+ "@teambit/dependency-resolver": "1.0.204",
31
+ "@teambit/generator": "1.0.205",
32
+ "@teambit/issues": "1.0.204",
33
+ "@teambit/ui": "1.0.204",
34
+ "@teambit/watcher": "1.0.204",
35
+ "@teambit/workspace": "1.0.204",
36
+ "@teambit/isolator": "1.0.204",
37
37
  "@teambit/toolbox.fs.hard-link-directory": "0.0.21",
38
- "@teambit/multi-compiler": "1.0.203",
38
+ "@teambit/multi-compiler": "1.0.204",
39
39
  "@teambit/workspace.modules.node-modules-linker": "0.0.165"
40
40
  },
41
41
  "devDependencies": {
@@ -1,18 +0,0 @@
1
- import { BitBaseEvent } from '@teambit/pubsub';
2
- import { Component } from '@teambit/component';
3
- import { CompileError } from '../workspace-compiler';
4
- declare class ComponentCompilationOnDoneEventData {
5
- readonly errors: Array<CompileError>;
6
- readonly component: Component;
7
- readonly buildResults: string[];
8
- constructor(errors: Array<CompileError>, component: Component, buildResults: string[]);
9
- }
10
- export declare class ComponentCompilationOnDoneEvent extends BitBaseEvent<ComponentCompilationOnDoneEventData> {
11
- readonly errors: Array<CompileError>;
12
- readonly component: Component;
13
- readonly buildResults: string[];
14
- readonly timestamp: number;
15
- static readonly TYPE = "component-compilation-on-done";
16
- constructor(errors: Array<CompileError>, component: Component, buildResults: string[], timestamp?: number);
17
- }
18
- export {};
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ComponentCompilationOnDoneEvent = void 0;
7
- function _pubsub() {
8
- const data = require("@teambit/pubsub");
9
- _pubsub = function () {
10
- return data;
11
- };
12
- return data;
13
- }
14
- 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; }
15
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
16
- 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 max-classes-per-file */
17
- class ComponentCompilationOnDoneEventData {
18
- constructor(errors, component, buildResults) {
19
- this.errors = errors;
20
- this.component = component;
21
- this.buildResults = buildResults;
22
- }
23
- }
24
- class ComponentCompilationOnDoneEvent extends _pubsub().BitBaseEvent {
25
- constructor(errors, component, buildResults, timestamp = Date.now()) {
26
- super(ComponentCompilationOnDoneEvent.TYPE, '0.0.1', timestamp, new ComponentCompilationOnDoneEventData(errors, component, buildResults));
27
- this.errors = errors;
28
- this.component = component;
29
- this.buildResults = buildResults;
30
- this.timestamp = timestamp;
31
- }
32
- }
33
- exports.ComponentCompilationOnDoneEvent = ComponentCompilationOnDoneEvent;
34
- _defineProperty(ComponentCompilationOnDoneEvent, "TYPE", 'component-compilation-on-done');
35
-
36
- //# sourceMappingURL=component-compilation-on-done.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_pubsub","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","ComponentCompilationOnDoneEventData","constructor","errors","component","buildResults","ComponentCompilationOnDoneEvent","BitBaseEvent","timestamp","Date","now","TYPE","exports"],"sources":["component-compilation-on-done.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport { BitBaseEvent } from '@teambit/pubsub';\nimport { Component } from '@teambit/component';\nimport { CompileError } from '../workspace-compiler';\n\nclass ComponentCompilationOnDoneEventData {\n constructor(readonly errors: Array<CompileError>, readonly component: Component, readonly buildResults: string[]) {}\n}\n\nexport class ComponentCompilationOnDoneEvent extends BitBaseEvent<ComponentCompilationOnDoneEventData> {\n static readonly TYPE = 'component-compilation-on-done';\n\n constructor(\n readonly errors: Array<CompileError>,\n readonly component: Component,\n readonly buildResults: string[],\n readonly timestamp = Date.now()\n ) {\n super(\n ComponentCompilationOnDoneEvent.TYPE,\n '0.0.1',\n timestamp,\n new ComponentCompilationOnDoneEventData(errors, component, buildResults)\n );\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA+C,SAAAE,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAE,MAAA,CAAAF,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAI,CAAA,2BAAAJ,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAK,CAAA,GAAAL,CAAA,CAAAM,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAJ,CAAA,GAAAI,CAAA,CAAAG,IAAA,CAAAR,CAAA,EAAAI,CAAA,uCAAAH,CAAA,SAAAA,CAAA,YAAAQ,SAAA,yEAAAL,CAAA,GAAAD,MAAA,GAAAO,MAAA,EAAAV,CAAA,KAD/C;AAKA,MAAMW,mCAAmC,CAAC;EACxCC,WAAWA,CAAUC,MAA2B,EAAWC,SAAoB,EAAWC,YAAsB,EAAE;IAAA,KAA7FF,MAA2B,GAA3BA,MAA2B;IAAA,KAAWC,SAAoB,GAApBA,SAAoB;IAAA,KAAWC,YAAsB,GAAtBA,YAAsB;EAAG;AACrH;AAEO,MAAMC,+BAA+B,SAASC,sBAAY,CAAsC;EAGrGL,WAAWA,CACAC,MAA2B,EAC3BC,SAAoB,EACpBC,YAAsB,EACtBG,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAC/B;IACA,KAAK,CACHJ,+BAA+B,CAACK,IAAI,EACpC,OAAO,EACPH,SAAS,EACT,IAAIP,mCAAmC,CAACE,MAAM,EAAEC,SAAS,EAAEC,YAAY,CACzE,CAAC;IAAC,KAVOF,MAA2B,GAA3BA,MAA2B;IAAA,KAC3BC,SAAoB,GAApBA,SAAoB;IAAA,KACpBC,YAAsB,GAAtBA,YAAsB;IAAA,KACtBG,SAAS,GAATA,SAAS;EAQpB;AACF;AAACI,OAAA,CAAAN,+BAAA,GAAAA,+BAAA;AAAA1B,eAAA,CAhBY0B,+BAA+B,UACnB,+BAA+B","ignoreList":[]}
@@ -1,26 +0,0 @@
1
- /* eslint-disable max-classes-per-file */
2
- import { BitBaseEvent } from '@teambit/pubsub';
3
- import { Component } from '@teambit/component';
4
- import { CompileError } from '../workspace-compiler';
5
-
6
- class ComponentCompilationOnDoneEventData {
7
- constructor(readonly errors: Array<CompileError>, readonly component: Component, readonly buildResults: string[]) {}
8
- }
9
-
10
- export class ComponentCompilationOnDoneEvent extends BitBaseEvent<ComponentCompilationOnDoneEventData> {
11
- static readonly TYPE = 'component-compilation-on-done';
12
-
13
- constructor(
14
- readonly errors: Array<CompileError>,
15
- readonly component: Component,
16
- readonly buildResults: string[],
17
- readonly timestamp = Date.now()
18
- ) {
19
- super(
20
- ComponentCompilationOnDoneEvent.TYPE,
21
- '0.0.1',
22
- timestamp,
23
- new ComponentCompilationOnDoneEventData(errors, component, buildResults)
24
- );
25
- }
26
- }