@teambit/compiler 1.0.487 → 1.0.488

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.487" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.compilation/compiler@1.0.488" 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={78089:(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},35327:(e,n,t)=>{Object.defineProperty(n,"Ay",{enumerable:!0,get:function(){return o.default}});var o=i(t(78089));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}},38845:(e,n,t)=>{var o={id:"teambit.compilation/compiler@1.0.487",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={};t.r(o),t.d(o,{compositions:()=>f,compositions_metadata:()=>x,overview:()=>h});var i={};t.r(i),t.d(i,{default:()=>u});var r=t(38845),a=(t(41594),t(5016)),p=t(65682),m=t(35327),l=["components"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},d.apply(null,arguments)}var c={},s="wrapper";function u(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={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(n.includes(o))continue;t[o]=e[o]}return t}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)t=r[o],n.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(e,l);return(0,a.mdx)(s,d({},c,t,{components:n,mdxType:"MDXLayout"}),(0,a.mdx)(p.MDXScopeProvider,{components:{CompilerOverview:m.Ay},mdxType:"MDXScopeProvider"},(0,a.mdx)(m.Ay,{mdxType:"CompilerOverview"})))}u.isMDXComponent=!0;const f=[r],h=[i],x={compositions:[{displayName:"Logo",identifier:"Logo"}]};return 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={93428:(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},53398:(e,n,t)=>{Object.defineProperty(n,"Ay",{enumerable:!0,get:function(){return o.default}});var o=i(t(93428));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}},90707:(e,n,t)=>{var o={id:"teambit.compilation/compiler@1.0.488",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={};t.r(o),t.d(o,{compositions:()=>f,compositions_metadata:()=>x,overview:()=>h});var i={};t.r(i),t.d(i,{default:()=>u});var r=t(90707),a=(t(41594),t(5016)),p=t(65682),m=t(53398),l=["components"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},d.apply(null,arguments)}var c={},s="wrapper";function u(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={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(n.includes(o))continue;t[o]=e[o]}return t}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)t=r[o],n.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(e,l);return(0,a.mdx)(s,d({},c,t,{components:n,mdxType:"MDXLayout"}),(0,a.mdx)(p.MDXScopeProvider,{components:{CompilerOverview:m.Ay},mdxType:"MDXScopeProvider"},(0,a.mdx)(m.Ay,{mdxType:"CompilerOverview"})))}u.isMDXComponent=!0;const f=[r],h=[i],x={compositions:[{displayName:"Logo",identifier:"Logo"}]};return o})()));
@@ -1617,7 +1617,7 @@
1617
1617
  "_legacy": {
1618
1618
  "scope": "teambit.compilation",
1619
1619
  "name": "compiler",
1620
- "version": "1.0.487"
1620
+ "version": "1.0.488"
1621
1621
  },
1622
1622
  "_scope": "teambit.compilation"
1623
1623
  }
@@ -3058,7 +3058,7 @@
3058
3058
  "_legacy": {
3059
3059
  "scope": "teambit.compilation",
3060
3060
  "name": "compiler",
3061
- "version": "1.0.487"
3061
+ "version": "1.0.488"
3062
3062
  },
3063
3063
  "_scope": "teambit.compilation"
3064
3064
  }
@@ -3764,7 +3764,7 @@
3764
3764
  "_legacy": {
3765
3765
  "scope": "teambit.compilation",
3766
3766
  "name": "compiler",
3767
- "version": "1.0.487"
3767
+ "version": "1.0.488"
3768
3768
  },
3769
3769
  "_scope": "teambit.compilation"
3770
3770
  }
@@ -5392,7 +5392,7 @@
5392
5392
  "_legacy": {
5393
5393
  "scope": "teambit.compilation",
5394
5394
  "name": "compiler",
5395
- "version": "1.0.487"
5395
+ "version": "1.0.488"
5396
5396
  },
5397
5397
  "_scope": "teambit.compilation"
5398
5398
  }
@@ -7336,7 +7336,7 @@
7336
7336
  "_legacy": {
7337
7337
  "scope": "teambit.compilation",
7338
7338
  "name": "compiler",
7339
- "version": "1.0.487"
7339
+ "version": "1.0.488"
7340
7340
  },
7341
7341
  "_scope": "teambit.compilation"
7342
7342
  }
@@ -7482,7 +7482,7 @@
7482
7482
  "_legacy": {
7483
7483
  "scope": "teambit.compilation",
7484
7484
  "name": "compiler",
7485
- "version": "1.0.487"
7485
+ "version": "1.0.488"
7486
7486
  },
7487
7487
  "_scope": "teambit.compilation"
7488
7488
  }
@@ -7555,7 +7555,7 @@
7555
7555
  "componentId": {
7556
7556
  "scope": "teambit.compilation",
7557
7557
  "name": "compiler",
7558
- "version": "1.0.487"
7558
+ "version": "1.0.488"
7559
7559
  },
7560
7560
  "taggedModuleExports": []
7561
7561
  }
@@ -53,9 +53,9 @@ function _issues() {
53
53
  };
54
54
  return data;
55
55
  }
56
- function _constants() {
57
- const data = require("@teambit/legacy/dist/constants");
58
- _constants = function () {
56
+ function _legacy() {
57
+ const data = require("@teambit/legacy.constants");
58
+ _legacy = function () {
59
59
  return data;
60
60
  };
61
61
  return data;
@@ -233,7 +233,7 @@ class CompilerMain {
233
233
  getRelativeDistFolder(component) {
234
234
  const environment = this.envs.getOrCalculateEnv(component).env;
235
235
  const compilerInstance = environment.getCompiler?.();
236
- if (!compilerInstance || !compilerInstance.getDistDir) return _constants().DEFAULT_DIST_DIRNAME;
236
+ if (!compilerInstance || !compilerInstance.getDistDir) return _legacy().DEFAULT_DIST_DIRNAME;
237
237
  return compilerInstance.getDistDir();
238
238
  }
239
239
 
@@ -1 +1 @@
1
- {"version":3,"names":["path","data","_interopRequireWildcard","require","_fsExtra","_interopRequireDefault","_aspectLoader","_builder","_cli","_componentIssues","_issues","_constants","_watcher","_envs","_dependencyResolver","_logger","_generator","_pubsub","_ui","_workspace","_compiler","_compiler2","_compiler3","_compiler4","_distArtifact","_exceptions","_types","_workspaceCompiler","_compiler5","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","CompilerMain","constructor","pubsub","workspaceCompiler","envs","builder","workspace","dependencyResolver","compilerService","getCompiler","context","compileOnWorkspace","componentsIds","options","initiator","CompilationInitiator","ComponentAdded","noThrow","componentLoadOptions","compileComponents","createTask","name","compiler","CompilerTask","CompilerAspect","id","getDistPathBySrcPath","component","srcPath","environment","getEnv","env","compilerInstance","getRelativeDistFolder","getOrCalculateEnv","getDistDir","DEFAULT_DIST_DIRNAME","isDistDirExists","packageDir","getComponentPackagePath","distDir","pathToCheck","join","fs","existsSync","getDistsFiles","artifacts","getArtifactsVinylByAspect","length","DistArtifactNotFound","DistArtifact","addMissingDistsIssue","components","issuesToIgnore","includes","IssuesClasses","MissingDists","Promise","all","map","exist","state","issues","getOrCreate","provider","cli","loggerMain","aspectLoader","ui","generator","watcher","logger","createLogger","CompilerService","WorkspaceCompiler","registerService","compilerMain","register","CompileCmd","registerAddComponentsIssues","bind","registerComponentTemplate","compilerTemplate","exports","MainRuntime","CLIAspect","WorkspaceAspect","EnvsAspect","LoggerAspect","PubsubAspect","AspectLoaderAspect","BuilderAspect","UIAspect","GeneratorAspect","DependencyResolverAspect","WatcherAspect","IssuesAspect","addRuntime","_default"],"sources":["compiler.main.runtime.ts"],"sourcesContent":["import * as path from 'path';\nimport fs from 'fs-extra';\nimport { AspectLoaderAspect, AspectLoaderMain } from '@teambit/aspect-loader';\nimport { BuilderAspect, BuilderMain } from '@teambit/builder';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport { Component } from '@teambit/component';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy/dist/constants';\nimport { WatcherAspect, WatcherMain } from '@teambit/watcher';\nimport { EnvsAspect, EnvsMain, ExecutionContext } from '@teambit/envs';\nimport { ComponentID } from '@teambit/component-id';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { PubsubAspect, PubsubMain } from '@teambit/pubsub';\nimport { UIAspect, UiMain } from '@teambit/ui';\nimport { Workspace, WorkspaceAspect, WorkspaceComponentLoadOptions } from '@teambit/workspace';\nimport { CompilerAspect } from './compiler.aspect';\nimport { CompileCmd } from './compiler.cmd';\nimport { CompilerService } from './compiler.service';\nimport { CompilerTask } from './compiler.task';\nimport { DistArtifact } from './dist-artifact';\nimport { DistArtifactNotFound } from './exceptions';\nimport { CompilationInitiator, Compiler } from './types';\nimport { CompileOptions, WorkspaceCompiler } from './workspace-compiler';\nimport { compilerTemplate } from './templates/compiler';\n\nexport class CompilerMain {\n constructor(\n private pubsub: PubsubMain,\n private workspaceCompiler: WorkspaceCompiler,\n private envs: EnvsMain,\n private builder: BuilderMain,\n private workspace: Workspace,\n private dependencyResolver: DependencyResolverMain,\n private compilerService: CompilerService\n ) {}\n\n getCompiler(context: ExecutionContext): Compiler {\n return this.compilerService.getCompiler(context);\n }\n\n /**\n * Run compilation on `bit new` and when new components are imported\n */\n compileOnWorkspace(\n componentsIds: string[] | ComponentID[] | ComponentID[] = [], // when empty, it compiles all\n options: CompileOptions = { initiator: CompilationInitiator.ComponentAdded },\n noThrow?: boolean,\n componentLoadOptions: WorkspaceComponentLoadOptions = {}\n ) {\n return this.workspaceCompiler.compileComponents(componentsIds, options, noThrow, componentLoadOptions);\n }\n /**\n * API to create a new compiler task, it facilitates the usage of multiple compilers.\n * with this method you can create any number of compilers and add them to the buildPipeline.\n */\n createTask(name: string, compiler: Compiler): CompilerTask {\n return new CompilerTask(CompilerAspect.id, name, compiler, this.dependencyResolver);\n }\n\n /**\n * find the compiler configured on the workspace and ask for the dist path.\n */\n getDistPathBySrcPath(component: Component, srcPath: string): string | null {\n const environment = this.envs.getEnv(component).env;\n const compilerInstance = environment.getCompiler?.();\n if (!compilerInstance) return null;\n return compilerInstance.getDistPathBySrcPath(srcPath);\n }\n\n /**\n * find the compiler configured on the workspace and ask for the dist folder path.\n */\n getRelativeDistFolder(component: Component): string {\n const environment = this.envs.getOrCalculateEnv(component).env;\n const compilerInstance: Compiler | undefined = environment.getCompiler?.();\n if (!compilerInstance || !compilerInstance.getDistDir) return DEFAULT_DIST_DIRNAME;\n return compilerInstance.getDistDir();\n }\n\n /**\n * Check if the dist folder (in the component package under node_modules) exist\n * @param component\n * @returns\n */\n async isDistDirExists(component: Component): Promise<boolean> {\n const packageDir = await this.workspace.getComponentPackagePath(component);\n const distDir = this.getRelativeDistFolder(component);\n const pathToCheck = path.join(packageDir, distDir);\n return fs.existsSync(pathToCheck);\n }\n\n async getDistsFiles(component: Component): Promise<DistArtifact> {\n const artifacts = await this.builder.getArtifactsVinylByAspect(component, CompilerAspect.id);\n if (!artifacts.length) throw new DistArtifactNotFound(component.id);\n\n return new DistArtifact(artifacts);\n }\n\n async addMissingDistsIssue(components: Component[], issuesToIgnore: string[]): Promise<void> {\n if (issuesToIgnore.includes(IssuesClasses.MissingDists.name)) return;\n await Promise.all(\n components.map(async (component) => {\n const exist = await this.isDistDirExists(component);\n if (!exist) {\n component.state.issues.getOrCreate(IssuesClasses.MissingDists).data = true;\n }\n })\n );\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n EnvsAspect,\n LoggerAspect,\n PubsubAspect,\n AspectLoaderAspect,\n BuilderAspect,\n UIAspect,\n GeneratorAspect,\n DependencyResolverAspect,\n WatcherAspect,\n IssuesAspect,\n ];\n\n static async provider([\n cli,\n workspace,\n envs,\n loggerMain,\n pubsub,\n aspectLoader,\n builder,\n ui,\n generator,\n dependencyResolver,\n watcher,\n issues,\n ]: [\n CLIMain,\n Workspace,\n EnvsMain,\n LoggerMain,\n PubsubMain,\n AspectLoaderMain,\n BuilderMain,\n UiMain,\n GeneratorMain,\n DependencyResolverMain,\n WatcherMain,\n IssuesMain,\n ]) {\n const logger = loggerMain.createLogger(CompilerAspect.id);\n const compilerService = new CompilerService();\n\n const workspaceCompiler = new WorkspaceCompiler(\n workspace,\n envs,\n pubsub,\n aspectLoader,\n ui,\n logger,\n dependencyResolver,\n watcher\n );\n envs.registerService(compilerService);\n const compilerMain = new CompilerMain(\n pubsub,\n workspaceCompiler,\n envs,\n builder,\n workspace,\n dependencyResolver,\n compilerService\n );\n cli.register(new CompileCmd(workspaceCompiler, logger, pubsub));\n if (issues) {\n issues.registerAddComponentsIssues(compilerMain.addMissingDistsIssue.bind(compilerMain));\n }\n if (generator) generator.registerComponentTemplate([compilerTemplate]);\n\n return compilerMain;\n }\n}\n\nCompilerAsp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NC,iBAAiB,EACjBC,IAAI,EACJC,OAAO,EACPC,SAAS,EACTC,kBAAkB,EAClBC,eACF,CAAC;IACDyD,GAAG,CAACY,QAAQ,CAAC,KAAIC,uBAAU,EAAC3E,iBAAiB,EAAEoE,MAAM,EAAErE,MAAM,CAAC,CAAC;IAC/D,IAAI4D,MAAM,EAAE;MACVA,MAAM,CAACiB,2BAA2B,CAACH,YAAY,CAACzB,oBAAoB,CAAC6B,IAAI,CAACJ,YAAY,CAAC,CAAC;IAC1F;IACA,IAAIP,SAAS,EAAEA,SAAS,CAACY,yBAAyB,CAAC,CAACC,6BAAgB,CAAC,CAAC;IAEtE,OAAON,YAAY;EACrB;AACF;AAACO,OAAA,CAAAnF,YAAA,GAAAA,YAAA;AAAAZ,eAAA,CAhKYY,YAAY,aAqFNoF,kBAAW;AAAAhG,eAAA,CArFjBY,YAAY,kBAuFD,CACpBqF,gBAAS,EACTC,4BAAe,EACfC,kBAAU,EACVC,sBAAY,EACZC,sBAAY,EACZC,kCAAkB,EAClBC,wBAAa,EACbC,cAAQ,EACRC,4BAAe,EACfC,8CAAwB,EACxBC,wBAAa,EACbC,sBAAY,CACb;AA8DHxE,0BAAc,CAACyE,UAAU,CAACjG,YAAY,CAAC;AAAC,IAAAkG,QAAA,GAAAf,OAAA,CAAAjH,OAAA,GAEzB8B,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["path","data","_interopRequireWildcard","require","_fsExtra","_interopRequireDefault","_aspectLoader","_builder","_cli","_componentIssues","_issues","_legacy","_watcher","_envs","_dependencyResolver","_logger","_generator","_pubsub","_ui","_workspace","_compiler","_compiler2","_compiler3","_compiler4","_distArtifact","_exceptions","_types","_workspaceCompiler","_compiler5","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","CompilerMain","constructor","pubsub","workspaceCompiler","envs","builder","workspace","dependencyResolver","compilerService","getCompiler","context","compileOnWorkspace","componentsIds","options","initiator","CompilationInitiator","ComponentAdded","noThrow","componentLoadOptions","compileComponents","createTask","name","compiler","CompilerTask","CompilerAspect","id","getDistPathBySrcPath","component","srcPath","environment","getEnv","env","compilerInstance","getRelativeDistFolder","getOrCalculateEnv","getDistDir","DEFAULT_DIST_DIRNAME","isDistDirExists","packageDir","getComponentPackagePath","distDir","pathToCheck","join","fs","existsSync","getDistsFiles","artifacts","getArtifactsVinylByAspect","length","DistArtifactNotFound","DistArtifact","addMissingDistsIssue","components","issuesToIgnore","includes","IssuesClasses","MissingDists","Promise","all","map","exist","state","issues","getOrCreate","provider","cli","loggerMain","aspectLoader","ui","generator","watcher","logger","createLogger","CompilerService","WorkspaceCompiler","registerService","compilerMain","register","CompileCmd","registerAddComponentsIssues","bind","registerComponentTemplate","compilerTemplate","exports","MainRuntime","CLIAspect","WorkspaceAspect","EnvsAspect","LoggerAspect","PubsubAspect","AspectLoaderAspect","BuilderAspect","UIAspect","GeneratorAspect","DependencyResolverAspect","WatcherAspect","IssuesAspect","addRuntime","_default"],"sources":["compiler.main.runtime.ts"],"sourcesContent":["import * as path from 'path';\nimport fs from 'fs-extra';\nimport { AspectLoaderAspect, AspectLoaderMain } from '@teambit/aspect-loader';\nimport { BuilderAspect, BuilderMain } from '@teambit/builder';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport { Component } from '@teambit/component';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy.constants';\nimport { WatcherAspect, WatcherMain } from '@teambit/watcher';\nimport { EnvsAspect, EnvsMain, ExecutionContext } from '@teambit/envs';\nimport { ComponentID } from '@teambit/component-id';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { PubsubAspect, PubsubMain } from '@teambit/pubsub';\nimport { UIAspect, UiMain } from '@teambit/ui';\nimport { Workspace, WorkspaceAspect, WorkspaceComponentLoadOptions } from '@teambit/workspace';\nimport { CompilerAspect } from './compiler.aspect';\nimport { CompileCmd } from './compiler.cmd';\nimport { CompilerService } from './compiler.service';\nimport { CompilerTask } from './compiler.task';\nimport { DistArtifact } from './dist-artifact';\nimport { DistArtifactNotFound } from './exceptions';\nimport { CompilationInitiator, Compiler } from './types';\nimport { CompileOptions, WorkspaceCompiler } from './workspace-compiler';\nimport { compilerTemplate } from './templates/compiler';\n\nexport class CompilerMain {\n constructor(\n private pubsub: PubsubMain,\n private workspaceCompiler: WorkspaceCompiler,\n private envs: EnvsMain,\n private builder: BuilderMain,\n private workspace: Workspace,\n private dependencyResolver: DependencyResolverMain,\n private compilerService: CompilerService\n ) {}\n\n getCompiler(context: ExecutionContext): Compiler {\n return this.compilerService.getCompiler(context);\n }\n\n /**\n * Run compilation on `bit new` and when new components are imported\n */\n compileOnWorkspace(\n componentsIds: string[] | ComponentID[] | ComponentID[] = [], // when empty, it compiles all\n options: CompileOptions = { initiator: CompilationInitiator.ComponentAdded },\n noThrow?: boolean,\n componentLoadOptions: WorkspaceComponentLoadOptions = {}\n ) {\n return this.workspaceCompiler.compileComponents(componentsIds, options, noThrow, componentLoadOptions);\n }\n /**\n * API to create a new compiler task, it facilitates the usage of multiple compilers.\n * with this method you can create any number of compilers and add them to the buildPipeline.\n */\n createTask(name: string, compiler: Compiler): CompilerTask {\n return new CompilerTask(CompilerAspect.id, name, compiler, this.dependencyResolver);\n }\n\n /**\n * find the compiler configured on the workspace and ask for the dist path.\n */\n getDistPathBySrcPath(component: Component, srcPath: string): string | null {\n const environment = this.envs.getEnv(component).env;\n const compilerInstance = environment.getCompiler?.();\n if (!compilerInstance) return null;\n return compilerInstance.getDistPathBySrcPath(srcPath);\n }\n\n /**\n * find the compiler configured on the workspace and ask for the dist folder path.\n */\n getRelativeDistFolder(component: Component): string {\n const environment = this.envs.getOrCalculateEnv(component).env;\n const compilerInstance: Compiler | undefined = environment.getCompiler?.();\n if (!compilerInstance || !compilerInstance.getDistDir) return DEFAULT_DIST_DIRNAME;\n return compilerInstance.getDistDir();\n }\n\n /**\n * Check if the dist folder (in the component package under node_modules) exist\n * @param component\n * @returns\n */\n async isDistDirExists(component: Component): Promise<boolean> {\n const packageDir = await this.workspace.getComponentPackagePath(component);\n const distDir = this.getRelativeDistFolder(component);\n const pathToCheck = path.join(packageDir, distDir);\n return fs.existsSync(pathToCheck);\n }\n\n async getDistsFiles(component: Component): Promise<DistArtifact> {\n const artifacts = await this.builder.getArtifactsVinylByAspect(component, CompilerAspect.id);\n if (!artifacts.length) throw new DistArtifactNotFound(component.id);\n\n return new DistArtifact(artifacts);\n }\n\n async addMissingDistsIssue(components: Component[], issuesToIgnore: string[]): Promise<void> {\n if (issuesToIgnore.includes(IssuesClasses.MissingDists.name)) return;\n await Promise.all(\n components.map(async (component) => {\n const exist = await this.isDistDirExists(component);\n if (!exist) {\n component.state.issues.getOrCreate(IssuesClasses.MissingDists).data = true;\n }\n })\n );\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n EnvsAspect,\n LoggerAspect,\n PubsubAspect,\n AspectLoaderAspect,\n BuilderAspect,\n UIAspect,\n GeneratorAspect,\n DependencyResolverAspect,\n WatcherAspect,\n IssuesAspect,\n ];\n\n static async provider([\n cli,\n workspace,\n envs,\n loggerMain,\n pubsub,\n aspectLoader,\n builder,\n ui,\n generator,\n dependencyResolver,\n watcher,\n issues,\n ]: [\n CLIMain,\n Workspace,\n EnvsMain,\n LoggerMain,\n PubsubMain,\n AspectLoaderMain,\n BuilderMain,\n UiMain,\n GeneratorMain,\n DependencyResolverMain,\n WatcherMain,\n IssuesMain,\n ]) {\n const logger = loggerMain.createLogger(CompilerAspect.id);\n const compilerService = new CompilerService();\n\n const workspaceCompiler = new WorkspaceCompiler(\n workspace,\n envs,\n pubsub,\n aspectLoader,\n ui,\n logger,\n dependencyResolver,\n watcher\n );\n envs.registerService(compilerService);\n const compilerMain = new CompilerMain(\n pubsub,\n workspaceCompiler,\n envs,\n builder,\n workspace,\n dependencyResolver,\n compilerService\n );\n cli.register(new CompileCmd(workspaceCompiler, logger, pubsub));\n if (issues) {\n issues.registerAddComponentsIssues(compilerMain.addMissingDistsIssue.bind(compilerMain));\n }\n if (generator) generator.registerComponentTemplate([compilerTemplate]);\n\n return compilerMain;\n }\n}\n\nCompilerAspect.addRuntime(CompilerMain);\n\nexport default CompilerMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,cAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,KAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,IAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,iBAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,gBAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SA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@
1
+ import * as compositions_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec3/teambit.compilation_compiler@1.0.488/dist/compiler.composition.js';
2
+ import * as overview_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec3/teambit.compilation_compiler@1.0.488/dist/compiler.docs.mdx';
3
+
4
+ export const compositions = [compositions_0];
5
+ export const overview = [overview_0];
6
+
7
+ export const compositions_metadata = {"compositions":[{"displayName":"Logo","identifier":"Logo"}]};
@@ -53,9 +53,9 @@ function _logger() {
53
53
  };
54
54
  return data;
55
55
  }
56
- function _constants() {
57
- const data = require("@teambit/legacy/dist/constants");
58
- _constants = function () {
56
+ function _legacy() {
57
+ const data = require("@teambit/legacy.constants");
58
+ _legacy = function () {
59
59
  return data;
60
60
  };
61
61
  return data;
@@ -201,7 +201,7 @@ ${this.compileErrors.map(formatError).join('\n')}`);
201
201
  async distDirs() {
202
202
  const packageName = (0, _pkgModules().componentIdToPackageName)(this.component.state._consumer);
203
203
  const packageDir = _path().default.join('node_modules', packageName);
204
- const distDirName = this.compilerInstance.getDistDir?.() || _constants().DEFAULT_DIST_DIRNAME;
204
+ const distDirName = this.compilerInstance.getDistDir?.() || _legacy().DEFAULT_DIST_DIRNAME;
205
205
  const injectedDirs = await this.getInjectedDirs(packageName);
206
206
  return [packageDir, ...injectedDirs].map(dist => _path().default.join(dist, distDirName));
207
207
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_globby","_fsExtra","_workspace","_path","_chalk","_logger","_constants","_component","_workspaceModules","_dependencyResolver","_pkgModules","_workspace2","_lodash","_compiler","_events","_types","e","__esModule","default","ComponentCompiler","constructor","pubsub","workspace","component","compilerInstance","compilerId","logger","env","dists","compileErrors","compile","noThrow","options","dataToPersist","deleteDistDir","distDirs","DataToPersist","distDir","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","buildResults","distFile","state","_consumer","compiler","consoleSuccess","id","errors","getPackageDir","packageName","componentIdToPackageName","join","length","forEach","errorItem","error","formatError","err","pub","CompilerAspect","CompilerErrorEvent","console","message","packageDir","distDirName","getDistDir","DEFAULT_DIST_DIRNAME","injectedDirs","getInjectedDirs","dist","rootDirs","readRootComponentsDir","rootComponentsPath","rootDir","relative","componentDir","copyTypesToOtherDists","packageDistDir","otherDirs","slice","packageDistDirAbs","matches","globby","cwd","onlyFiles","ignore","distDirAbs","match","source","dest","fs","copyFile","filePath","isFileSupported","compileResults","contents","push","base","result","Dist","outputPath","Buffer","from","outputText","shouldCopyNonSupportedFiles","filesToCompile","outputDir","getComponentPackagePath","exports","WorkspaceCompiler","envs","aspectLoader","ui","dependencyResolver","watcher","registerOnComponentChange","onComponentChange","bind","registerOnComponentAdd","onComponentAdd","registerOnPreWatch","onPreWatch","registerPreStart","onPreStart","registerOnAspectLoadErrorSlot","onAspectLoadFail","preStartOpts","skipCompilation","compileComponents","changed","verbose","CompilationInitiator","PreStart","watchScopeInternalFiles","deps","getDependencies","depsIds","getComponentDependencies","dep","code","includes","AspectLoadFail","watchOpts","undefined","removedFiles","Boolean","removeLinksFromNodeModules","ComponentChanged","generateTypes","results","formatCompileResults","componentIds","preCompile","start","Date","now","PreWatch","end","componentsIds","componentLoadOptions","OutsideWorkspaceError","getIdsToCompile","loadSeedersAsAspects","components","getMany","grouped","buildGroupsToCompile","mapSeries","group","runCompileComponents","linkComponents","linkToNodeModulesByComponents","flat","componentsCompilers","getEnv","environment","getCompiler","compilerName","name","warn","typeGeneratorParamsPerEnv","getTypesCompilerPerEnv","preGenerateTypesOnWorkspace","resultOnWorkspace","componentCompiler","generateTypesOnWorkspace","envsMap","envId","Object","keys","componentCompilers","compParams","typeCompiler","buildPipe","getBuildPipe","compilerTasks","filter","task","aspectId","tsTask","displayName","compact","typesGeneratorParamsPerEnv","envCompIds","calculateEnvId","envsIds","uniq","groupedByIsEnv","groupBy","isEnv","envsOfEnvsCompIds","groupedByEnvsOfEnvs","depsOfEnvsOfEnvsCompLists","envsOfEnvs","envComp","depsOfEnvsOfEnvsCompIds","DependencyList","merge","groupedByIsDepsOfEnvsOfEnvs","other","depsOfEnvsCompLists","otherEnvs","depsOfEnvsOfCompIds","groupedByIsDepsOfEnvs","depsOfEnvsOfEnvs","depsOfEnvs","resolveMultipleComponentIds","filterIds","getNewAndModifiedIds","listIds","buildResult","title","chalk","underline","verboseComponentFilesArrayToString","Logger","successSymbol"],"sources":["workspace-compiler.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport mapSeries from 'p-map-series';\nimport globby from 'globby';\nimport fs from 'fs-extra';\nimport { Component } from '@teambit/component';\nimport { EnvDefinition, EnvsMain } from '@teambit/envs';\nimport type { PubsubMain } from '@teambit/pubsub';\nimport { SerializableResults, Workspace, OutsideWorkspaceError } from '@teambit/workspace';\nimport type { WorkspaceComponentLoadOptions } from '@teambit/workspace';\nimport { WatcherMain, WatchOptions } from '@teambit/watcher';\nimport path from 'path';\nimport chalk from 'chalk';\nimport { ComponentID } from '@teambit/component-id';\nimport { Logger } from '@teambit/logger';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy/dist/constants';\nimport { AbstractVinyl, Dist, DataToPersist, RemovePath } from '@teambit/component.sources';\nimport {\n linkToNodeModulesByComponents,\n removeLinksFromNodeModules,\n} from '@teambit/workspace.modules.node-modules-linker';\nimport { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { DependencyList, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { PathOsBasedAbsolute, PathOsBasedRelative } from '@teambit/toolbox.path.path';\nimport { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';\nimport { UiMain } from '@teambit/ui';\nimport { readRootComponentsDir } from '@teambit/workspace.root-components';\nimport { compact, groupBy, uniq } from 'lodash';\nimport type { PreStartOpts } from '@teambit/ui';\nimport { MultiCompiler } from '@teambit/multi-compiler';\nimport { CompilerAspect } from './compiler.aspect';\nimport { CompilerErrorEvent } from './events';\nimport { Compiler, CompilationInitiator, TypeGeneratorCompParams } 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 * whether to generate types after the compilation, default = false.\n * keep in mind that it's a heavy operation, and hurts the performance.\n */\n generateTypes?: 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 readonly component: Component,\n readonly compilerInstance: Compiler,\n private compilerId: string,\n private logger: Logger,\n readonly env: EnvDefinition,\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 const distDirs = await this.distDirs();\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 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) =>\n this.compileOneFile(file, options.initiator, distDirs)\n )\n );\n }\n\n if (canTranspileComponent) {\n await this.compileAllFiles(options.initiator, distDirs);\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 buildResults = this.dists.map((distFile) => distFile.path);\n if (this.component.state._consumer.compiler) this.logger.consoleSuccess();\n\n return { component: this.component.id.toString(), buildResults, errors: this.compileErrors };\n }\n\n getPackageDir() {\n const packageName = componentIdToPackageName(this.component.state._consumer);\n return path.join('node_modules', packageName);\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 readRootComponentsDir(this.workspace.rootComponentsPath);\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 async copyTypesToOtherDists() {\n const distDirs = await this.distDirs();\n if (distDirs.length <= 1) return;\n const packageDistDir = distDirs[0];\n const otherDirs = distDirs.slice(1);\n const packageDistDirAbs = path.join(this.workspace.path, packageDistDir);\n const matches = await globby(`**/*.d.ts`, {\n cwd: packageDistDirAbs,\n onlyFiles: true,\n ignore: [`${packageDistDir}/node_modules/`],\n });\n if (!matches.length) return;\n await Promise.all(\n otherDirs.map(async (distDir) => {\n const distDirAbs = path.join(this.workspace.path, distDir);\n await Promise.all(\n matches.map(async (match) => {\n const source = path.join(packageDistDirAbs, match);\n const dest = path.join(distDirAbs, match);\n await fs.copyFile(source, dest);\n })\n );\n })\n );\n }\n\n private async compileOneFile(\n file: AbstractVinyl,\n initiator: CompilationInitiator,\n distDirs: PathOsBasedRelative[]\n ): 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 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(initiator: CompilationInitiator, distDirs: PathOsBasedRelative[]): Promise<void> {\n const filesToCompile: AbstractVinyl[] = [];\n for (const base of distDirs) {\n this.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: this.component,\n componentDir: this.componentDir,\n outputDir: await this.workspace.getComponentPackagePath(this.component),\n initiator,\n });\n } catch (error: any) {\n this.compileErrors.push({ path: this.componentDir, error });\n }\n }\n }\n}\n\ntype TypeGeneratorParamsPerEnv = { envId: string; compParams: TypeGeneratorCompParams[]; typeCompiler: Compiler };\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 }, component: Component): Promise<boolean> {\n const id = component.id;\n const deps = this.dependencyResolver.getDependencies(component);\n const depsIds = deps.getComponentDependencies().map((dep) => {\n return dep.id.toString();\n });\n if (\n ((err.code && (err.code === 'MODULE_NOT_FOUND' || err.code === 'ERR_REQUIRE_ESM')) ||\n err.message.includes('import.meta')) &&\n this.workspace\n ) {\n await this.compileComponents(\n [id.toString(), ...depsIds],\n { initiator: CompilationInitiator.AspectLoadFail },\n true\n );\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 {\n initiator: watchOpts.initiator || CompilationInitiator.ComponentChanged,\n deleteDistDir,\n generateTypes: watchOpts.generateTypes,\n },\n true\n );\n return {\n results: buildResults,\n toString() {\n return formatCompileResults(buildResults, watchOpts.verbose);\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, generateTypes: watchOpts.generateTypes }\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 componentLoadOptions: WorkspaceComponentLoadOptions = {}\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 if (options.initiator === CompilationInitiator.AspectLoadFail) {\n componentLoadOptions.loadSeedersAsAspects = false;\n }\n const components = await this.workspace.getMany(componentIds, componentLoadOptions);\n const grouped = await this.buildGroupsToCompile(components);\n\n const results = await mapSeries(grouped, async (group) => {\n return this.runCompileComponents(group.components, options, noThrow);\n });\n const linkComponents = options.linkComponents ?? true;\n if (linkComponents) {\n await linkToNodeModulesByComponents(components, this.workspace);\n }\n return results.flat();\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 env = this.envs.getEnv(c);\n const environment = env.env;\n const compilerInstance = environment.getCompiler?.();\n\n if (compilerInstance) {\n const compilerName = compilerInstance.constructor.name || 'compiler';\n componentsCompilers.push(\n new ComponentCompiler(this.pubsub, this.workspace, c, compilerInstance, compilerName, this.logger, env)\n );\n } else {\n this.logger.warn(`unable to find a compiler instance for ${c.id.toString()}`);\n }\n });\n\n const typeGeneratorParamsPerEnv = options.generateTypes\n ? await this.getTypesCompilerPerEnv(componentsCompilers)\n : undefined;\n\n if (typeGeneratorParamsPerEnv) {\n await this.preGenerateTypesOnWorkspace(typeGeneratorParamsPerEnv);\n }\n\n const resultOnWorkspace = await mapSeries(componentsCompilers, (componentCompiler) =>\n componentCompiler.compile(noThrow, options)\n );\n\n if (typeGeneratorParamsPerEnv) {\n await this.generateTypesOnWorkspace(typeGeneratorParamsPerEnv, componentsCompilers);\n }\n\n return resultOnWorkspace;\n }\n\n private async getTypesCompilerPerEnv(componentsCompilers: ComponentCompiler[]): Promise<TypeGeneratorParamsPerEnv[]> {\n const envsMap: { [envId: string]: ComponentCompiler[] } = {};\n componentsCompilers.forEach((componentCompiler) => {\n const envId = componentCompiler.env.id;\n if (!envsMap[envId]) envsMap[envId] = [];\n envsMap[envId].push(componentCompiler);\n });\n\n const results = await mapSeries(Object.keys(envsMap), async (envId) => {\n const componentCompilers = envsMap[envId];\n const compParams = await Promise.all(\n componentCompilers.map(async (componentCompiler) => {\n return {\n component: componentCompiler.component,\n packageDir: path.join(this.workspace.path, componentCompiler.getPackageDir()),\n };\n })\n );\n\n let typeCompiler = componentCompilers[0].compilerInstance;\n if (!typeCompiler.preGenerateTypesOnWorkspace) {\n const buildPipe = componentCompilers[0].env.env.getBuildPipe();\n const compilerTasks = buildPipe.filter((task) => task.aspectId === CompilerAspect.id);\n const tsTask = compilerTasks.find(\n (task) => task.compilerInstance && task.compilerInstance.displayName === 'TypeScript'\n );\n if (!tsTask) return;\n typeCompiler = tsTask.compilerInstance;\n if (!typeCompiler.preGenerateTypesOnWorkspace) return;\n }\n return { envId, compParams, typeCompiler };\n });\n return compact(results);\n }\n\n private async preGenerateTypesOnWorkspace(typesGeneratorParamsPerEnv: TypeGeneratorParamsPerEnv[]) {\n await mapSeries(typesGeneratorParamsPerEnv, async ({ envId, compParams, typeCompiler }) => {\n await typeCompiler.preGenerateTypesOnWorkspace!(compParams, envId);\n });\n }\n\n private async generateTypesOnWorkspace(\n typesGeneratorParamsPerEnv: TypeGeneratorParamsPerEnv[],\n componentsCompilers: ComponentCompiler[]\n ) {\n await mapSeries(typesGeneratorParamsPerEnv, async ({ compParams, typeCompiler }) => {\n await typeCompiler.generateTypesOnWorkspace!(path.join(this.workspace.path, 'node_modules'), compParams);\n });\n await Promise.all(componentsCompilers.map((componentCompiler) => componentCompiler.copyTypesToOtherDists()));\n }\n\n /**\n * This function groups the components to compile into groups by their environment and dependencies.\n * The order of the groups is important, the first group should be compiled first.\n * The order inside the group is not important.\n * The groups are:\n * 1. dependencies of envs of envs.\n * 2. envs of envs.\n * 3. dependencies of envs.\n * 4. envs.\n * 5. the rest.\n * @param ids\n */\n async buildGroupsToCompile(components: Component[]): Promise<\n Array<{\n components: Component[];\n envsOfEnvs?: boolean;\n envs?: boolean;\n depsOfEnvsOfEnvs?: boolean;\n depsOfEnvs?: boolean;\n other?: boolean;\n }>\n > {\n const envCompIds = await Promise.all(\n components\n // .map((component) => this.envs.getEnvId(component))\n .map(async (component) => {\n const envId = await this.envs.calculateEnvId(component);\n return envId.toString();\n })\n );\n const envsIds = uniq(envCompIds);\n const groupedByIsEnv = groupBy(components, (component) => {\n if (envsIds.includes(component.id.toString())) return 'envs';\n if (this.envs.isEnv(component)) return 'envs';\n return 'other';\n });\n const envsOfEnvsCompIds = await Promise.all(\n (groupedByIsEnv.envs || [])\n // .map((component) => this.envs.getEnvId(component))\n .map(async (component) => (await this.envs.calculateEnvId(component)).toString())\n );\n const groupedByEnvsOfEnvs = groupBy(groupedByIsEnv.envs, (component) => {\n if (envsOfEnvsCompIds.includes(component.id.toString())) return 'envsOfEnvs';\n return 'otherEnvs';\n });\n const depsOfEnvsOfEnvsCompLists = (groupedByEnvsOfEnvs.envsOfEnvs || []).map((envComp) =>\n this.dependencyResolver.getDependencies(envComp)\n );\n const depsOfEnvsOfEnvsCompIds = DependencyList.merge(depsOfEnvsOfEnvsCompLists)\n .getComponentDependencies()\n .map((dep) => dep.id.toString());\n const groupedByIsDepsOfEnvsOfEnvs = groupBy(groupedByIsEnv.other, (component) => {\n if (depsOfEnvsOfEnvsCompIds.includes(component.id.toString())) return 'depsOfEnvsOfEnvs';\n return 'other';\n });\n const depsOfEnvsCompLists = (groupedByEnvsOfEnvs.otherEnvs || []).map((envComp) =>\n this.dependencyResolver.getDependencies(envComp)\n );\n const depsOfEnvsOfCompIds = DependencyList.merge(depsOfEnvsCompLists)\n .getComponentDependencies()\n .map((dep) => dep.id.toString());\n const groupedByIsDepsOfEnvs = groupBy(groupedByIsDepsOfEnvsOfEnvs.other, (component) => {\n if (depsOfEnvsOfCompIds.includes(component.id.toString())) return 'depsOfEnvs';\n return 'other';\n });\n return [\n {\n components: groupedByIsDepsOfEnvsOfEnvs.depsOfEnvsOfEnvs || [],\n depsOfEnvsOfEnvs: true,\n },\n {\n components: groupedByEnvsOfEnvs.envsOfEnvs || [],\n envsOfEnvs: true,\n },\n {\n components: groupedByIsDepsOfEnvs.depsOfEnvs || [],\n depsOfEnvs: true,\n },\n {\n components: groupedByEnvsOfEnvs.otherEnvs || [],\n envs: true,\n },\n {\n components: groupedByIsDepsOfEnvs.other || [],\n other: true,\n },\n ];\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\nfunction formatCompileResults(buildResults: BuildResult[], verbose?: boolean) {\n if (!buildResults.length) return '';\n // this gets called when a file is changed, so the buildResults array always has only one item\n const buildResult = buildResults[0];\n const title = ` ${chalk.underline('STATUS\\tCOMPONENT ID')}`;\n const verboseComponentFilesArrayToString = () => {\n return buildResult.buildResults.map((filePath) => ` \\t - ${filePath}`).join('\\n');\n };\n\n return `${title}\n ${Logger.successSymbol()}SUCCESS\\t${buildResult.component}\\n\n ${verbose ? `${verboseComponentFilesArrayToString()}\\n` : ''}`;\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAK,WAAA;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OAAO,IAAI,CAACrO,SAAS,CAACsO,OAAO,CAAC,CAAC;EACjC;AACF;AAACzH,OAAA,CAAAC,iBAAA,GAAAA,iBAAA;AAED,SAASyC,oBAAoBA,CAAC9G,YAA2B,EAAE0F,OAAiB,EAAE;EAC5E,IAAI,CAAC1F,YAAY,CAACY,MAAM,EAAE,OAAO,EAAE;EACnC;EACA,MAAMkL,WAAW,GAAG9L,YAAY,CAAC,CAAC,CAAC;EACnC,MAAM+L,KAAK,GAAG,IAAIC,gBAAK,CAACC,SAAS,CAAC,sBAAsB,CAAC,EAAE;EAC3D,MAAMC,kCAAkC,GAAGA,CAAA,KAAM;IAC/C,OAAOJ,WAAW,CAAC9L,YAAY,CAACT,GAAG,CAAE6D,QAAQ,IAAK,SAASA,QAAQ,EAAE,CAAC,CAACzC,IAAI,CAAC,IAAI,CAAC;EACnF,CAAC;EAED,OAAO,GAAGoL,KAAK;AACjB,IAAII,gBAAM,CAACC,aAAa,CAAC,CAAC,YAAYN,WAAW,CAACtO,SAAS;AAC3D,IAAIkI,OAAO,GAAG,GAAGwG,kCAAkC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE;AAChE","ignoreList":[]}
1
+ {"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_globby","_fsExtra","_workspace","_path","_chalk","_logger","_legacy","_component","_workspaceModules","_dependencyResolver","_pkgModules","_workspace2","_lodash","_compiler","_events","_types","e","__esModule","default","ComponentCompiler","constructor","pubsub","workspace","component","compilerInstance","compilerId","logger","env","dists","compileErrors","compile","noThrow","options","dataToPersist","deleteDistDir","distDirs","DataToPersist","distDir","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","buildResults","distFile","state","_consumer","compiler","consoleSuccess","id","errors","getPackageDir","packageName","componentIdToPackageName","join","length","forEach","errorItem","error","formatError","err","pub","CompilerAspect","CompilerErrorEvent","console","message","packageDir","distDirName","getDistDir","DEFAULT_DIST_DIRNAME","injectedDirs","getInjectedDirs","dist","rootDirs","readRootComponentsDir","rootComponentsPath","rootDir","relative","componentDir","copyTypesToOtherDists","packageDistDir","otherDirs","slice","packageDistDirAbs","matches","globby","cwd","onlyFiles","ignore","distDirAbs","match","source","dest","fs","copyFile","filePath","isFileSupported","compileResults","contents","push","base","result","Dist","outputPath","Buffer","from","outputText","shouldCopyNonSupportedFiles","filesToCompile","outputDir","getComponentPackagePath","exports","WorkspaceCompiler","envs","aspectLoader","ui","dependencyResolver","watcher","registerOnComponentChange","onComponentChange","bind","registerOnComponentAdd","onComponentAdd","registerOnPreWatch","onPreWatch","registerPreStart","onPreStart","registerOnAspectLoadErrorSlot","onAspectLoadFail","preStartOpts","skipCompilation","compileComponents","changed","verbose","CompilationInitiator","PreStart","watchScopeInternalFiles","deps","getDependencies","depsIds","getComponentDependencies","dep","code","includes","AspectLoadFail","watchOpts","undefined","removedFiles","Boolean","removeLinksFromNodeModules","ComponentChanged","generateTypes","results","formatCompileResults","componentIds","preCompile","start","Date","now","PreWatch","end","componentsIds","componentLoadOptions","OutsideWorkspaceError","getIdsToCompile","loadSeedersAsAspects","components","getMany","grouped","buildGroupsToCompile","mapSeries","group","runCompileComponents","linkComponents","linkToNodeModulesByComponents","flat","componentsCompilers","getEnv","environment","getCompiler","compilerName","name","warn","typeGeneratorParamsPerEnv","getTypesCompilerPerEnv","preGenerateTypesOnWorkspace","resultOnWorkspace","componentCompiler","generateTypesOnWorkspace","envsMap","envId","Object","keys","componentCompilers","compParams","typeCompiler","buildPipe","getBuildPipe","compilerTasks","filter","task","aspectId","tsTask","displayName","compact","typesGeneratorParamsPerEnv","envCompIds","calculateEnvId","envsIds","uniq","groupedByIsEnv","groupBy","isEnv","envsOfEnvsCompIds","groupedByEnvsOfEnvs","depsOfEnvsOfEnvsCompLists","envsOfEnvs","envComp","depsOfEnvsOfEnvsCompIds","DependencyList","merge","groupedByIsDepsOfEnvsOfEnvs","other","depsOfEnvsCompLists","otherEnvs","depsOfEnvsOfCompIds","groupedByIsDepsOfEnvs","depsOfEnvsOfEnvs","depsOfEnvs","resolveMultipleComponentIds","filterIds","getNewAndModifiedIds","listIds","buildResult","title","chalk","underline","verboseComponentFilesArrayToString","Logger","successSymbol"],"sources":["workspace-compiler.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport mapSeries from 'p-map-series';\nimport globby from 'globby';\nimport fs from 'fs-extra';\nimport { Component } from '@teambit/component';\nimport { EnvDefinition, EnvsMain } from '@teambit/envs';\nimport type { PubsubMain } from '@teambit/pubsub';\nimport { SerializableResults, Workspace, OutsideWorkspaceError } from '@teambit/workspace';\nimport type { WorkspaceComponentLoadOptions } from '@teambit/workspace';\nimport { WatcherMain, WatchOptions } from '@teambit/watcher';\nimport path from 'path';\nimport chalk from 'chalk';\nimport { ComponentID } from '@teambit/component-id';\nimport { Logger } from '@teambit/logger';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy.constants';\nimport { AbstractVinyl, Dist, DataToPersist, RemovePath } from '@teambit/component.sources';\nimport {\n linkToNodeModulesByComponents,\n removeLinksFromNodeModules,\n} from '@teambit/workspace.modules.node-modules-linker';\nimport { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { DependencyList, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { PathOsBasedAbsolute, PathOsBasedRelative } from '@teambit/toolbox.path.path';\nimport { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';\nimport { UiMain } from '@teambit/ui';\nimport { readRootComponentsDir } from '@teambit/workspace.root-components';\nimport { compact, groupBy, uniq } from 'lodash';\nimport type { PreStartOpts } from '@teambit/ui';\nimport { MultiCompiler } from '@teambit/multi-compiler';\nimport { CompilerAspect } from './compiler.aspect';\nimport { CompilerErrorEvent } from './events';\nimport { Compiler, CompilationInitiator, TypeGeneratorCompParams } 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 * whether to generate types after the compilation, default = false.\n * keep in mind that it's a heavy operation, and hurts the performance.\n */\n generateTypes?: 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 readonly component: Component,\n readonly compilerInstance: Compiler,\n private compilerId: string,\n private logger: Logger,\n readonly env: EnvDefinition,\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 const distDirs = await this.distDirs();\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 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) =>\n this.compileOneFile(file, options.initiator, distDirs)\n )\n );\n }\n\n if (canTranspileComponent) {\n await this.compileAllFiles(options.initiator, distDirs);\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 buildResults = this.dists.map((distFile) => distFile.path);\n if (this.component.state._consumer.compiler) this.logger.consoleSuccess();\n\n return { component: this.component.id.toString(), buildResults, errors: this.compileErrors };\n }\n\n getPackageDir() {\n const packageName = componentIdToPackageName(this.component.state._consumer);\n return path.join('node_modules', packageName);\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 readRootComponentsDir(this.workspace.rootComponentsPath);\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 async copyTypesToOtherDists() {\n const distDirs = await this.distDirs();\n if (distDirs.length <= 1) return;\n const packageDistDir = distDirs[0];\n const otherDirs = distDirs.slice(1);\n const packageDistDirAbs = path.join(this.workspace.path, packageDistDir);\n const matches = await globby(`**/*.d.ts`, {\n cwd: packageDistDirAbs,\n onlyFiles: true,\n ignore: [`${packageDistDir}/node_modules/`],\n });\n if (!matches.length) return;\n await Promise.all(\n otherDirs.map(async (distDir) => {\n const distDirAbs = path.join(this.workspace.path, distDir);\n await Promise.all(\n matches.map(async (match) => {\n const source = path.join(packageDistDirAbs, match);\n const dest = path.join(distDirAbs, match);\n await fs.copyFile(source, dest);\n })\n );\n })\n );\n }\n\n private async compileOneFile(\n file: AbstractVinyl,\n initiator: CompilationInitiator,\n distDirs: PathOsBasedRelative[]\n ): 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 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(initiator: CompilationInitiator, distDirs: PathOsBasedRelative[]): Promise<void> {\n const filesToCompile: AbstractVinyl[] = [];\n for (const base of distDirs) {\n this.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: this.component,\n componentDir: this.componentDir,\n outputDir: await this.workspace.getComponentPackagePath(this.component),\n initiator,\n });\n } catch (error: any) {\n this.compileErrors.push({ path: this.componentDir, error });\n }\n }\n }\n}\n\ntype TypeGeneratorParamsPerEnv = { envId: string; compParams: TypeGeneratorCompParams[]; typeCompiler: Compiler };\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 }, component: Component): Promise<boolean> {\n const id = component.id;\n const deps = this.dependencyResolver.getDependencies(component);\n const depsIds = deps.getComponentDependencies().map((dep) => {\n return dep.id.toString();\n });\n if (\n ((err.code && (err.code === 'MODULE_NOT_FOUND' || err.code === 'ERR_REQUIRE_ESM')) ||\n err.message.includes('import.meta')) &&\n this.workspace\n ) {\n await this.compileComponents(\n [id.toString(), ...depsIds],\n { initiator: CompilationInitiator.AspectLoadFail },\n true\n );\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 {\n initiator: watchOpts.initiator || CompilationInitiator.ComponentChanged,\n deleteDistDir,\n generateTypes: watchOpts.generateTypes,\n },\n true\n );\n return {\n results: buildResults,\n toString() {\n return formatCompileResults(buildResults, watchOpts.verbose);\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, generateTypes: watchOpts.generateTypes }\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 componentLoadOptions: WorkspaceComponentLoadOptions = {}\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 if (options.initiator === CompilationInitiator.AspectLoadFail) {\n componentLoadOptions.loadSeedersAsAspects = false;\n }\n const components = await this.workspace.getMany(componentIds, componentLoadOptions);\n const grouped = await this.buildGroupsToCompile(components);\n\n const results = await mapSeries(grouped, async (group) => {\n return this.runCompileComponents(group.components, options, noThrow);\n });\n const linkComponents = options.linkComponents ?? true;\n if (linkComponents) {\n await linkToNodeModulesByComponents(components, this.workspace);\n }\n return results.flat();\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 env = this.envs.getEnv(c);\n const environment = env.env;\n const compilerInstance = environment.getCompiler?.();\n\n if (compilerInstance) {\n const compilerName = compilerInstance.constructor.name || 'compiler';\n componentsCompilers.push(\n new ComponentCompiler(this.pubsub, this.workspace, c, compilerInstance, compilerName, this.logger, env)\n );\n } else {\n this.logger.warn(`unable to find a compiler instance for ${c.id.toString()}`);\n }\n });\n\n const typeGeneratorParamsPerEnv = options.generateTypes\n ? await this.getTypesCompilerPerEnv(componentsCompilers)\n : undefined;\n\n if (typeGeneratorParamsPerEnv) {\n await this.preGenerateTypesOnWorkspace(typeGeneratorParamsPerEnv);\n }\n\n const resultOnWorkspace = await mapSeries(componentsCompilers, (componentCompiler) =>\n componentCompiler.compile(noThrow, options)\n );\n\n if (typeGeneratorParamsPerEnv) {\n await this.generateTypesOnWorkspace(typeGeneratorParamsPerEnv, componentsCompilers);\n }\n\n return resultOnWorkspace;\n }\n\n private async getTypesCompilerPerEnv(componentsCompilers: ComponentCompiler[]): Promise<TypeGeneratorParamsPerEnv[]> {\n const envsMap: { [envId: string]: ComponentCompiler[] } = {};\n componentsCompilers.forEach((componentCompiler) => {\n const envId = componentCompiler.env.id;\n if (!envsMap[envId]) envsMap[envId] = [];\n envsMap[envId].push(componentCompiler);\n });\n\n const results = await mapSeries(Object.keys(envsMap), async (envId) => {\n const componentCompilers = envsMap[envId];\n const compParams = await Promise.all(\n componentCompilers.map(async (componentCompiler) => {\n return {\n component: componentCompiler.component,\n packageDir: path.join(this.workspace.path, componentCompiler.getPackageDir()),\n };\n })\n );\n\n let typeCompiler = componentCompilers[0].compilerInstance;\n if (!typeCompiler.preGenerateTypesOnWorkspace) {\n const buildPipe = componentCompilers[0].env.env.getBuildPipe();\n const compilerTasks = buildPipe.filter((task) => task.aspectId === CompilerAspect.id);\n const tsTask = compilerTasks.find(\n (task) => task.compilerInstance && task.compilerInstance.displayName === 'TypeScript'\n );\n if (!tsTask) return;\n typeCompiler = tsTask.compilerInstance;\n if (!typeCompiler.preGenerateTypesOnWorkspace) return;\n }\n return { envId, compParams, typeCompiler };\n });\n return compact(results);\n }\n\n private async preGenerateTypesOnWorkspace(typesGeneratorParamsPerEnv: TypeGeneratorParamsPerEnv[]) {\n await mapSeries(typesGeneratorParamsPerEnv, async ({ envId, compParams, typeCompiler }) => {\n await typeCompiler.preGenerateTypesOnWorkspace!(compParams, envId);\n });\n }\n\n private async generateTypesOnWorkspace(\n typesGeneratorParamsPerEnv: TypeGeneratorParamsPerEnv[],\n componentsCompilers: ComponentCompiler[]\n ) {\n await mapSeries(typesGeneratorParamsPerEnv, async ({ compParams, typeCompiler }) => {\n await typeCompiler.generateTypesOnWorkspace!(path.join(this.workspace.path, 'node_modules'), compParams);\n });\n await Promise.all(componentsCompilers.map((componentCompiler) => componentCompiler.copyTypesToOtherDists()));\n }\n\n /**\n * This function groups the components to compile into groups by their environment and dependencies.\n * The order of the groups is important, the first group should be compiled first.\n * The order inside the group is not important.\n * The groups are:\n * 1. dependencies of envs of envs.\n * 2. envs of envs.\n * 3. dependencies of envs.\n * 4. envs.\n * 5. the rest.\n * @param ids\n */\n async buildGroupsToCompile(components: Component[]): Promise<\n Array<{\n components: Component[];\n envsOfEnvs?: boolean;\n envs?: boolean;\n depsOfEnvsOfEnvs?: boolean;\n depsOfEnvs?: boolean;\n other?: boolean;\n }>\n > {\n const envCompIds = await Promise.all(\n components\n // .map((component) => this.envs.getEnvId(component))\n .map(async (component) => {\n const envId = await this.envs.calculateEnvId(component);\n return envId.toString();\n })\n );\n const envsIds = uniq(envCompIds);\n const groupedByIsEnv = groupBy(components, (component) => {\n if (envsIds.includes(component.id.toString())) return 'envs';\n if (this.envs.isEnv(component)) return 'envs';\n return 'other';\n });\n const envsOfEnvsCompIds = await Promise.all(\n (groupedByIsEnv.envs || [])\n // .map((component) => this.envs.getEnvId(component))\n .map(async (component) => (await this.envs.calculateEnvId(component)).toString())\n );\n const groupedByEnvsOfEnvs = groupBy(groupedByIsEnv.envs, (component) => {\n if (envsOfEnvsCompIds.includes(component.id.toString())) return 'envsOfEnvs';\n return 'otherEnvs';\n });\n const depsOfEnvsOfEnvsCompLists = (groupedByEnvsOfEnvs.envsOfEnvs || []).map((envComp) =>\n this.dependencyResolver.getDependencies(envComp)\n );\n const depsOfEnvsOfEnvsCompIds = DependencyList.merge(depsOfEnvsOfEnvsCompLists)\n .getComponentDependencies()\n .map((dep) => dep.id.toString());\n const groupedByIsDepsOfEnvsOfEnvs = groupBy(groupedByIsEnv.other, (component) => {\n if (depsOfEnvsOfEnvsCompIds.includes(component.id.toString())) return 'depsOfEnvsOfEnvs';\n return 'other';\n });\n const depsOfEnvsCompLists = (groupedByEnvsOfEnvs.otherEnvs || []).map((envComp) =>\n this.dependencyResolver.getDependencies(envComp)\n );\n const depsOfEnvsOfCompIds = DependencyList.merge(depsOfEnvsCompLists)\n .getComponentDependencies()\n .map((dep) => dep.id.toString());\n const groupedByIsDepsOfEnvs = groupBy(groupedByIsDepsOfEnvsOfEnvs.other, (component) => {\n if (depsOfEnvsOfCompIds.includes(component.id.toString())) return 'depsOfEnvs';\n return 'other';\n });\n return [\n {\n components: groupedByIsDepsOfEnvsOfEnvs.depsOfEnvsOfEnvs || [],\n depsOfEnvsOfEnvs: true,\n },\n {\n components: groupedByEnvsOfEnvs.envsOfEnvs || [],\n envsOfEnvs: true,\n },\n {\n components: groupedByIsDepsOfEnvs.depsOfEnvs || [],\n depsOfEnvs: true,\n },\n {\n components: groupedByEnvsOfEnvs.otherEnvs || [],\n envs: true,\n },\n {\n components: groupedByIsDepsOfEnvs.other || [],\n other: true,\n },\n ];\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\nfunction formatCompileResults(buildResults: BuildResult[], verbose?: boolean) {\n if (!buildResults.length) return '';\n // this gets called when a file is changed, so the buildResults array always has only one item\n const buildResult = buildResults[0];\n const title = ` ${chalk.underline('STATUS\\tCOMPONENT ID')}`;\n const verboseComponentFilesArrayToString = () => {\n return buildResult.buildResults.map((filePath) => ` \\t - ${filePath}`).join('\\n');\n };\n\n return `${title}\n ${Logger.successSymbol()}SUCCESS\\t${buildResult.component}\\n\n ${verbose ? `${verboseComponentFilesArrayToString()}\\n` : ''}`;\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAM,MAAA;EAAA,MAAAN,IAAA,GAAA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iB,EAAE;EAC5E,IAAI,CAAC1F,YAAY,CAACY,MAAM,EAAE,OAAO,EAAE;EACnC;EACA,MAAMkL,WAAW,GAAG9L,YAAY,CAAC,CAAC,CAAC;EACnC,MAAM+L,KAAK,GAAG,IAAIC,gBAAK,CAACC,SAAS,CAAC,sBAAsB,CAAC,EAAE;EAC3D,MAAMC,kCAAkC,GAAGA,CAAA,KAAM;IAC/C,OAAOJ,WAAW,CAAC9L,YAAY,CAACT,GAAG,CAAE6D,QAAQ,IAAK,SAASA,QAAQ,EAAE,CAAC,CAACzC,IAAI,CAAC,IAAI,CAAC;EACnF,CAAC;EAED,OAAO,GAAGoL,KAAK;AACjB,IAAII,gBAAM,CAACC,aAAa,CAAC,CAAC,YAAYN,WAAW,CAACtO,SAAS;AAC3D,IAAIkI,OAAO,GAAG,GAAGwG,kCAAkC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE;AAChE","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/compiler",
3
- "version": "1.0.487",
3
+ "version": "1.0.488",
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.487"
9
+ "version": "1.0.488"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -20,27 +20,28 @@
20
20
  "@teambit/component-id": "1.2.2",
21
21
  "@teambit/workspace.root-components": "1.0.0",
22
22
  "@teambit/bit-error": "0.0.404",
23
- "@teambit/envs": "1.0.487",
24
- "@teambit/cli": "0.0.1064",
25
- "@teambit/logger": "0.0.1157",
26
- "@teambit/pubsub": "1.0.487",
27
- "@teambit/aspect-loader": "1.0.487",
28
- "@teambit/builder": "1.0.487",
23
+ "@teambit/envs": "1.0.488",
24
+ "@teambit/cli": "0.0.1065",
25
+ "@teambit/logger": "0.0.1158",
26
+ "@teambit/pubsub": "1.0.488",
27
+ "@teambit/aspect-loader": "1.0.488",
28
+ "@teambit/builder": "1.0.488",
29
29
  "@teambit/component-issues": "0.0.151",
30
- "@teambit/component": "1.0.487",
31
- "@teambit/dependency-resolver": "1.0.487",
32
- "@teambit/generator": "1.0.488",
33
- "@teambit/issues": "1.0.487",
34
- "@teambit/ui": "1.0.487",
35
- "@teambit/watcher": "1.0.487",
36
- "@teambit/workspace": "1.0.487",
37
- "@teambit/isolator": "1.0.487",
30
+ "@teambit/component": "1.0.488",
31
+ "@teambit/dependency-resolver": "1.0.488",
32
+ "@teambit/generator": "1.0.489",
33
+ "@teambit/issues": "1.0.488",
34
+ "@teambit/legacy.constants": "0.0.1",
35
+ "@teambit/ui": "1.0.488",
36
+ "@teambit/watcher": "1.0.488",
37
+ "@teambit/workspace": "1.0.488",
38
+ "@teambit/isolator": "1.0.488",
38
39
  "@teambit/toolbox.fs.hard-link-directory": "0.0.21",
39
- "@teambit/component.sources": "0.0.52",
40
+ "@teambit/component.sources": "0.0.53",
40
41
  "@teambit/toolbox.path.path": "0.0.4",
41
- "@teambit/multi-compiler": "1.0.487",
42
- "@teambit/pkg.modules.component-package-name": "0.0.7",
43
- "@teambit/workspace.modules.node-modules-linker": "0.0.228"
42
+ "@teambit/multi-compiler": "1.0.488",
43
+ "@teambit/pkg.modules.component-package-name": "0.0.8",
44
+ "@teambit/workspace.modules.node-modules-linker": "0.0.229"
44
45
  },
45
46
  "devDependencies": {
46
47
  "@types/pretty-time": "^1.1.5",
@@ -1,7 +0,0 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_compiler@1.0.487/dist/compiler.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_compiler@1.0.487/dist/compiler.docs.mdx';
3
-
4
- export const compositions = [compositions_0];
5
- export const overview = [overview_0];
6
-
7
- export const compositions_metadata = {"compositions":[{"displayName":"Logo","identifier":"Logo"}]};