@teambit/multi-compiler 1.0.209 → 1.0.211

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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/multi-compiler@1.0.209" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.compilation/multi-compiler@1.0.211" tests="0" failures="0" errors="0" skipped="0"/>
4
4
  </testsuites>
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.compilation/multi-compiler-preview"]=t():e["teambit.compilation/multi-compiler-preview"]=t()}(self,(()=>(()=>{"use strict";var e={90563:(e,t,o)=>{Object.defineProperty(t,"b",{enumerable:!0,get:function(){return n.default}});var n=r(o(30127));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.compilation/aspect-docs/multi-compiler@0.0.169",homepage:"https://bit.cloud/teambit/compilation/aspect-docs/multi-compiler",exported:!0}},30127:(e,t,o)=>{var n={id:"teambit.compilation/aspect-docs/multi-compiler@0.0.169",homepage:"https://bit.cloud/teambit/compilation/aspect-docs/multi-compiler",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=s,p(o(41594));var r=o(5016),i=["components"];function p(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},l.apply(this,arguments)}function a(e,t){if(null==e)return{};var o,n,r=c(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function c(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}p.__bit_component=n,l.__bit_component=n,a.__bit_component=n,c.__bit_component=n;var m={},u="wrapper";function s(e){var t=e.components,o=a(e,i);return(0,r.mdx)(u,l({},m,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"The multi-compiler aspect allows the configuration of multiple compilers on a component. This determines which compiler to apply on a component file using the ",(0,r.mdx)("inlineCode",{parentName:"p"},"isFileSupported()")," compiler API."),(0,r.mdx)("ul",null,(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("inlineCode",{parentName:"li"},"createCompiler(compilers: Compiler[], options: CompilerOptions)")," API to support the creation a Multi-compiler instance which can be used in the Env API (the ",(0,r.mdx)("inlineCode",{parentName:"li"},"overrideCompiler")," and ",(0,r.mdx)("inlineCode",{parentName:"li"},"getCompiler")," APIs)."),(0,r.mdx)("li",{parentName:"ul"},"Supports the creation of a multi-compiler build tasks.")),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"// create a multi compiler instance.\nconst compiler = multiCompiler.createCompiler([createBabelCompiler(), createTsCompiler()]);\n\n// create a multi-compiler build task.\ncompiler.createTask('MultiCompiler', compiler);\n")))}s.__bit_component=n,s.isMDXComponent=!0},27071:(e,t,o)=>{var n={id:"teambit.compilation/multi-compiler@1.0.209",homepage:"https://bit.cloud/teambit/compilation/multi-compiler",exported:!0};function r(){const e=i(o(41594));return r=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=n,i.__bit_component=n;const p=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/multi-complier.svg"}));p.__bit_component=n,t.Logo=p},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{o.r(n),o.d(n,{compositions:()=>s,compositions_metadata:()=>f,overview:()=>d});var e={};o.r(e),o.d(e,{default:()=>u});var t=o(27071),r=(o(41594),o(5016));const i=TeambitMdxUiMdxScopeContext;var p=o(90563),l=["components"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},a.apply(this,arguments)}var c={},m="wrapper";function u(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,l);return(0,r.mdx)(m,a({},c,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{MultiCompiler:p.b},mdxType:"MDXScopeProvider"},(0,r.mdx)(p.b,{mdxType:"MultiCompiler"})))}u.isMDXComponent=!0;const s=[t],d=[e],f={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),n})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.compilation/multi-compiler-preview"]=t():e["teambit.compilation/multi-compiler-preview"]=t()}(self,(()=>(()=>{"use strict";var e={96761:(e,t,o)=>{Object.defineProperty(t,"b",{enumerable:!0,get:function(){return n.default}});var n=r(o(44109));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.compilation/aspect-docs/multi-compiler@0.0.169",homepage:"https://bit.cloud/teambit/compilation/aspect-docs/multi-compiler",exported:!0}},44109:(e,t,o)=>{var n={id:"teambit.compilation/aspect-docs/multi-compiler@0.0.169",homepage:"https://bit.cloud/teambit/compilation/aspect-docs/multi-compiler",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=s,p(o(41594));var r=o(5016),i=["components"];function p(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},l.apply(this,arguments)}function a(e,t){if(null==e)return{};var o,n,r=c(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function c(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}p.__bit_component=n,l.__bit_component=n,a.__bit_component=n,c.__bit_component=n;var m={},u="wrapper";function s(e){var t=e.components,o=a(e,i);return(0,r.mdx)(u,l({},m,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"The multi-compiler aspect allows the configuration of multiple compilers on a component. This determines which compiler to apply on a component file using the ",(0,r.mdx)("inlineCode",{parentName:"p"},"isFileSupported()")," compiler API."),(0,r.mdx)("ul",null,(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("inlineCode",{parentName:"li"},"createCompiler(compilers: Compiler[], options: CompilerOptions)")," API to support the creation a Multi-compiler instance which can be used in the Env API (the ",(0,r.mdx)("inlineCode",{parentName:"li"},"overrideCompiler")," and ",(0,r.mdx)("inlineCode",{parentName:"li"},"getCompiler")," APIs)."),(0,r.mdx)("li",{parentName:"ul"},"Supports the creation of a multi-compiler build tasks.")),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"// create a multi compiler instance.\nconst compiler = multiCompiler.createCompiler([createBabelCompiler(), createTsCompiler()]);\n\n// create a multi-compiler build task.\ncompiler.createTask('MultiCompiler', compiler);\n")))}s.__bit_component=n,s.isMDXComponent=!0},66960:(e,t,o)=>{var n={id:"teambit.compilation/multi-compiler@1.0.211",homepage:"https://bit.cloud/teambit/compilation/multi-compiler",exported:!0};function r(){const e=i(o(41594));return r=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=n,i.__bit_component=n;const p=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/multi-complier.svg"}));p.__bit_component=n,t.Logo=p},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{o.r(n),o.d(n,{compositions:()=>s,compositions_metadata:()=>f,overview:()=>d});var e={};o.r(e),o.d(e,{default:()=>u});var t=o(66960),r=(o(41594),o(5016));const i=TeambitMdxUiMdxScopeContext;var p=o(96761),l=["components"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},a.apply(this,arguments)}var c={},m="wrapper";function u(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,l);return(0,r.mdx)(m,a({},c,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{MultiCompiler:p.b},mdxType:"MDXScopeProvider"},(0,r.mdx)(p.b,{mdxType:"MultiCompiler"})))}u.isMDXComponent=!0;const s=[t],d=[e],f={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),n})()));
@@ -1019,7 +1019,7 @@
1019
1019
  "_legacy": {
1020
1020
  "scope": "teambit.compilation",
1021
1021
  "name": "multi-compiler",
1022
- "version": "1.0.209"
1022
+ "version": "1.0.211"
1023
1023
  },
1024
1024
  "_scope": "teambit.compilation"
1025
1025
  }
@@ -2128,7 +2128,7 @@
2128
2128
  "_legacy": {
2129
2129
  "scope": "teambit.compilation",
2130
2130
  "name": "multi-compiler",
2131
- "version": "1.0.209"
2131
+ "version": "1.0.211"
2132
2132
  },
2133
2133
  "_scope": "teambit.compilation"
2134
2134
  }
@@ -2143,7 +2143,7 @@
2143
2143
  "componentId": {
2144
2144
  "scope": "teambit.compilation",
2145
2145
  "name": "multi-compiler",
2146
- "version": "1.0.209"
2146
+ "version": "1.0.211"
2147
2147
  },
2148
2148
  "taggedModuleExports": []
2149
2149
  }
@@ -27,7 +27,7 @@ function _pipelinesModules() {
27
27
  }
28
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
29
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
30
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
30
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
31
31
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
32
32
  class MultiCompiler {
33
33
  constructor(id, compilers, compilerOptions = {}, options = {}) {
@@ -1 +1 @@
1
- {"version":3,"names":["_path","data","require","_pMapSeries","_interopRequireDefault","_pipelinesModules","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","MultiCompiler","constructor","id","compilers","compilerOptions","options","shouldCopyNonSupportedFiles","getDistDir","distDir","getArtifactDefinition","generatedBy","name","artifactName","globPatterns","distGlobPatterns","getOptions","defaultOpts","targetExtension","assign","displayConfig","map","compiler","displayName","join","transpileFile","fileContent","outputs","reduce","files","filesToTranspile","flatMap","pMapSeries","file","isFileSupported","outputPath","params","filePath","compiledContent","outputText","flat","Promise","resolve","transpileComponent","all","build","context","builds","buildResult","componentsResults","mergeComponentResults","artifacts","preBuild","postBuild","taskResults","firstMatchedCompiler","find","getPreviewComponentRootPath","component","matchedCompiler","getDistPathBySrcPath","srcPath","version","exports"],"sources":["multi-compiler.compiler.ts"],"sourcesContent":["import { join } from 'path';\nimport pMapSeries from 'p-map-series';\nimport {\n Compiler,\n CompilerOptions,\n TranspileComponentParams,\n TranspileFileOutput,\n TranspileFileParams,\n} from '@teambit/compiler';\nimport { BuiltTaskResult, BuildContext, TaskResultsList } from '@teambit/builder';\nimport { mergeComponentResults } from '@teambit/pipelines.modules.merge-component-results';\nimport { Component } from '@teambit/component';\n\nexport type MultiCompilerOptions = {\n targetExtension?: string;\n};\n\nexport class MultiCompiler implements Compiler {\n displayName = 'Multi compiler';\n\n shouldCopyNonSupportedFiles =\n typeof this.compilerOptions.shouldCopyNonSupportedFiles === 'boolean'\n ? this.compilerOptions.shouldCopyNonSupportedFiles\n : true;\n distDir = 'dist';\n\n constructor(\n readonly id: string,\n readonly compilers: Compiler[],\n readonly compilerOptions: Partial<CompilerOptions> = {},\n readonly options: MultiCompilerOptions = {}\n ) {}\n\n getDistDir() {\n return this.distDir;\n }\n\n getArtifactDefinition() {\n return [\n {\n generatedBy: this.id,\n name: this.compilerOptions.artifactName || 'dist',\n globPatterns: this.compilerOptions.distGlobPatterns || [\n `${this.distDir}/**`,\n `!${this.distDir}/tsconfig.tsbuildinfo`,\n ],\n },\n ];\n }\n\n private getOptions() {\n const defaultOpts = {\n targetExtension: '.js',\n };\n\n return Object.assign(defaultOpts, this.options);\n }\n\n displayConfig() {\n return this.compilers\n .map((compiler) => {\n return `${compiler.displayName}\\n${compiler.displayConfig}\\n`;\n })\n .join('\\n');\n }\n\n /**\n * the multi-compiler applies all applicable defined compilers on given content.\n */\n async transpileFile(fileContent: string, options: TranspileFileParams): Promise<TranspileFileOutput> {\n const outputs: TranspileFileOutput = await this.compilers.reduce<Promise<TranspileFileOutput>>(\n async (files: Promise<TranspileFileOutput>, compiler: Compiler) => {\n if (!compiler.transpileFile) {\n return files;\n }\n const filesToTranspile = await files;\n if (!filesToTranspile) return null;\n const flatMap = (\n await pMapSeries(filesToTranspile, async (file) => {\n if (!compiler.isFileSupported(file?.outputPath)) return [file];\n if (!compiler.transpileFile) return [];\n const params = Object.assign({}, options, {\n filePath: file.outputPath,\n });\n const compiledContent = await compiler.transpileFile(file.outputText, params);\n if (compiledContent) {\n return compiledContent;\n }\n return [];\n })\n ).flat();\n return flatMap;\n },\n Promise.resolve([{ outputText: fileContent, outputPath: options.filePath }] as TranspileFileOutput)\n );\n return outputs;\n }\n\n async transpileComponent(params: TranspileComponentParams): Promise<void> {\n await Promise.all(\n this.compilers.map((compiler) => {\n return compiler.transpileComponent?.(params);\n })\n );\n }\n\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n const builds = await pMapSeries(this.compilers, async (compiler) => {\n const buildResult = await compiler.build(context);\n return buildResult.componentsResults;\n });\n\n return {\n componentsResults: mergeComponentResults(builds),\n artifacts: this.getArtifactDefinition(),\n };\n }\n\n async preBuild(context: BuildContext) {\n await Promise.all(\n this.compilers.map(async (compiler) => {\n if (!compiler.preBuild) return;\n await compiler.preBuild(context);\n })\n );\n }\n\n async postBuild(context: BuildContext, taskResults: TaskResultsList) {\n await Promise.all(\n this.compilers.map(async (compiler) => {\n if (!compiler.postBuild) return;\n await compiler.postBuild(context, taskResults);\n })\n );\n }\n\n private firstMatchedCompiler(filePath: string): Compiler | undefined {\n return this.compilers.find((compiler) => compiler.isFileSupported(filePath));\n }\n\n getPreviewComponentRootPath(component: Component): string {\n const matchedCompiler = this.compilers.find(\n (compiler) => typeof compiler.getPreviewComponentRootPath !== 'undefined'\n );\n if (!matchedCompiler) {\n return '';\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return matchedCompiler.getPreviewComponentRootPath!(component);\n }\n\n /**\n * given a source file, return its parallel in the dists. e.g. \"index.ts\" => \"dist/index.js\"\n * both, the return path and the given path are relative paths.\n */\n getDistPathBySrcPath(srcPath: string): string {\n const matchedCompiler = this.firstMatchedCompiler(srcPath);\n if (!matchedCompiler) {\n return join(this.distDir, srcPath);\n }\n\n return matchedCompiler.getDistPathBySrcPath(srcPath);\n }\n\n /**\n * only supported files matching get compiled. others, are copied to the dist dir.\n */\n isFileSupported(filePath: string): boolean {\n return !!this.firstMatchedCompiler(filePath);\n }\n\n /**\n * returns the version of the current compiler instance (e.g. '4.0.1').\n */\n version(): string {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AAQ,CAACY,eAAe,CAACG,QAAQ,CAAC,CAAC;EAC9E;EAEAoB,2BAA2BA,CAACC,SAAoB,EAAU;IACxD,MAAMC,eAAe,GAAG,IAAI,CAACvD,SAAS,CAACoD,IAAI,CACxClC,QAAQ,IAAK,OAAOA,QAAQ,CAACmC,2BAA2B,KAAK,WAChE,CAAC;IACD,IAAI,CAACE,eAAe,EAAE;MACpB,OAAO,EAAE;IACX;;IAEA;IACA,OAAOA,eAAe,CAACF,2BAA2B,CAAEC,SAAS,CAAC;EAChE;;EAEA;AACF;AACA;AACA;EACEE,oBAAoBA,CAACC,OAAe,EAAU;IAC5C,MAAMF,eAAe,GAAG,IAAI,CAACJ,oBAAoB,CAACM,OAAO,CAAC;IAC1D,IAAI,CAACF,eAAe,EAAE;MACpB,OAAO,IAAAnC,YAAI,EAAC,IAAI,CAACf,OAAO,EAAEoD,OAAO,CAAC;IACpC;IAEA,OAAOF,eAAe,CAACC,oBAAoB,CAACC,OAAO,CAAC;EACtD;;EAEA;AACF;AACA;EACE3B,eAAeA,CAACG,QAAgB,EAAW;IACzC,OAAO,CAAC,CAAC,IAAI,CAACkB,oBAAoB,CAAClB,QAAQ,CAAC;EAC9C;;EAEA;AACF;AACA;EACEyB,OAAOA,CAAA,EAAW;IAChB,OAAO,IAAI,CAAC1D,SAAS,CAClBiB,GAAG,CAAEC,QAAQ,IAAK;MACjB,OAAQ,GAAEA,QAAQ,CAACC,WAAY,IAAGD,QAAQ,CAACwC,OAAO,CAAC,CAAE,EAAC;IACxD,CAAC,CAAC,CACDtC,IAAI,CAAC,IAAI,CAAC;EACf;AACF;AAACuC,OAAA,CAAA9D,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["_path","data","require","_pMapSeries","_interopRequireDefault","_pipelinesModules","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","MultiCompiler","constructor","id","compilers","compilerOptions","options","shouldCopyNonSupportedFiles","getDistDir","distDir","getArtifactDefinition","generatedBy","name","artifactName","globPatterns","distGlobPatterns","getOptions","defaultOpts","targetExtension","assign","displayConfig","map","compiler","displayName","join","transpileFile","fileContent","outputs","reduce","files","filesToTranspile","flatMap","pMapSeries","file","isFileSupported","outputPath","params","filePath","compiledContent","outputText","flat","Promise","resolve","transpileComponent","all","build","context","builds","buildResult","componentsResults","mergeComponentResults","artifacts","preBuild","postBuild","taskResults","firstMatchedCompiler","find","getPreviewComponentRootPath","component","matchedCompiler","getDistPathBySrcPath","srcPath","version","exports"],"sources":["multi-compiler.compiler.ts"],"sourcesContent":["import { join } from 'path';\nimport pMapSeries from 'p-map-series';\nimport {\n Compiler,\n CompilerOptions,\n TranspileComponentParams,\n TranspileFileOutput,\n TranspileFileParams,\n} from '@teambit/compiler';\nimport { BuiltTaskResult, BuildContext, TaskResultsList } from '@teambit/builder';\nimport { mergeComponentResults } from '@teambit/pipelines.modules.merge-component-results';\nimport { Component } from '@teambit/component';\n\nexport type MultiCompilerOptions = {\n targetExtension?: string;\n};\n\nexport class MultiCompiler implements Compiler {\n displayName = 'Multi compiler';\n\n shouldCopyNonSupportedFiles =\n typeof this.compilerOptions.shouldCopyNonSupportedFiles === 'boolean'\n ? this.compilerOptions.shouldCopyNonSupportedFiles\n : true;\n distDir = 'dist';\n\n constructor(\n readonly id: string,\n readonly compilers: Compiler[],\n readonly compilerOptions: Partial<CompilerOptions> = {},\n readonly options: MultiCompilerOptions = {}\n ) {}\n\n getDistDir() {\n return this.distDir;\n }\n\n getArtifactDefinition() {\n return [\n {\n generatedBy: this.id,\n name: this.compilerOptions.artifactName || 'dist',\n globPatterns: this.compilerOptions.distGlobPatterns || [\n `${this.distDir}/**`,\n `!${this.distDir}/tsconfig.tsbuildinfo`,\n ],\n },\n ];\n }\n\n private getOptions() {\n const defaultOpts = {\n targetExtension: '.js',\n };\n\n return Object.assign(defaultOpts, this.options);\n }\n\n displayConfig() {\n return this.compilers\n .map((compiler) => {\n return `${compiler.displayName}\\n${compiler.displayConfig}\\n`;\n })\n .join('\\n');\n }\n\n /**\n * the multi-compiler applies all applicable defined compilers on given content.\n */\n async transpileFile(fileContent: string, options: TranspileFileParams): Promise<TranspileFileOutput> {\n const outputs: TranspileFileOutput = await this.compilers.reduce<Promise<TranspileFileOutput>>(\n async (files: Promise<TranspileFileOutput>, compiler: Compiler) => {\n if (!compiler.transpileFile) {\n return files;\n }\n const filesToTranspile = await files;\n if (!filesToTranspile) return null;\n const flatMap = (\n await pMapSeries(filesToTranspile, async (file) => {\n if (!compiler.isFileSupported(file?.outputPath)) return [file];\n if (!compiler.transpileFile) return [];\n const params = Object.assign({}, options, {\n filePath: file.outputPath,\n });\n const compiledContent = await compiler.transpileFile(file.outputText, params);\n if (compiledContent) {\n return compiledContent;\n }\n return [];\n })\n ).flat();\n return flatMap;\n },\n Promise.resolve([{ outputText: fileContent, outputPath: options.filePath }] as TranspileFileOutput)\n );\n return outputs;\n }\n\n async transpileComponent(params: TranspileComponentParams): Promise<void> {\n await Promise.all(\n this.compilers.map((compiler) => {\n return compiler.transpileComponent?.(params);\n })\n );\n }\n\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n const builds = await pMapSeries(this.compilers, async (compiler) => {\n const buildResult = await compiler.build(context);\n return buildResult.componentsResults;\n });\n\n return {\n componentsResults: mergeComponentResults(builds),\n artifacts: this.getArtifactDefinition(),\n };\n }\n\n async preBuild(context: BuildContext) {\n await Promise.all(\n this.compilers.map(async (compiler) => {\n if (!compiler.preBuild) return;\n await compiler.preBuild(context);\n })\n );\n }\n\n async postBuild(context: BuildContext, taskResults: TaskResultsList) {\n await Promise.all(\n this.compilers.map(async (compiler) => {\n if (!compiler.postBuild) return;\n await compiler.postBuild(context, taskResults);\n })\n );\n }\n\n private firstMatchedCompiler(filePath: string): Compiler | undefined {\n return this.compilers.find((compiler) => compiler.isFileSupported(filePath));\n }\n\n getPreviewComponentRootPath(component: Component): string {\n const matchedCompiler = this.compilers.find(\n (compiler) => typeof compiler.getPreviewComponentRootPath !== 'undefined'\n );\n if (!matchedCompiler) {\n return '';\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return matchedCompiler.getPreviewComponentRootPath!(component);\n }\n\n /**\n * given a source file, return its parallel in the dists. e.g. \"index.ts\" => \"dist/index.js\"\n * both, the return path and the given path are relative paths.\n */\n getDistPathBySrcPath(srcPath: string): string {\n const matchedCompiler = this.firstMatchedCompiler(srcPath);\n if (!matchedCompiler) {\n return join(this.distDir, srcPath);\n }\n\n return matchedCompiler.getDistPathBySrcPath(srcPath);\n }\n\n /**\n * only supported files matching get compiled. others, are copied to the dist dir.\n */\n isFileSupported(filePath: string): boolean {\n return !!this.firstMatchedCompiler(filePath);\n }\n\n /**\n * returns the version of the current compiler instance (e.g. '4.0.1').\n */\n version(): string {\n return this.compilers\n .map((compiler) => {\n return `${compiler.displayName}@${compiler.version()}`;\n })\n .join('\\n');\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AASA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2F,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,G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BAAoB,CAAClB,QAAQ,CAAC;EAC9C;;EAEA;AACF;AACA;EACEyB,OAAOA,CAAA,EAAW;IAChB,OAAO,IAAI,CAAC1D,SAAS,CAClBiB,GAAG,CAAEC,QAAQ,IAAK;MACjB,OAAQ,GAAEA,QAAQ,CAACC,WAAY,IAAGD,QAAQ,CAACwC,OAAO,CAAC,CAAE,EAAC;IACxD,CAAC,CAAC,CACDtC,IAAI,CAAC,IAAI,CAAC;EACf;AACF;AAACuC,OAAA,CAAA9D,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -26,7 +26,7 @@ function _multiCompiler2() {
26
26
  return data;
27
27
  }
28
28
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
29
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
30
30
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
31
31
  class MultiCompilerMain {
32
32
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_multiCompiler","_multiCompiler2","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","MultiCompilerMain","createCompiler","compilers","options","MultiCompiler","MultiCompilerAspect","id","provider","exports","MainRuntime","addRuntime"],"sources":["multi-compiler.main.runtime.ts"],"sourcesContent":["import { MainRuntime } from '@teambit/cli';\nimport { Compiler, CompilerOptions } from '@teambit/compiler';\nimport { MultiCompilerAspect } from './multi-compiler.aspect';\nimport { MultiCompiler } from './multi-compiler.compiler';\n\nexport class MultiCompilerMain {\n /**\n * create a multi-compiler `Compiler` instance.\n * @param compilers list of compilers to include.\n */\n createCompiler(compilers: Compiler[], options: Partial<CompilerOptions> = {}) {\n return new MultiCompiler(MultiCompilerAspect.id, compilers, options, {});\n }\n\n static runtime = MainRuntime;\n\n static async provider() {\n return new MultiCompilerMain();\n }\n}\n\nMultiCompilerAspect.addRuntime(MultiCompilerMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,eAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,cAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,gBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,eAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0D,SAAAI,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAE,MAAA,CAAAF,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAI,CAAA,2BAAAJ,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAK,CAAA,GAAAL,CAAA,CAAAM,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAJ,CAAA,GAAAI,CAAA,CAAAG,IAAA,CAAAR,CAAA,EAAAI,CAAA,uCAAAH,CAAA,SAAAA,CAAA,YAAAQ,SAAA,yEAAAL,CAAA,GAAAD,MAAA,GAAAO,MAAA,EAAAV,CAAA;AAEnD,MAAMW,iBAAiB,CAAC;EAC7B;AACF;AACA;AACA;EACEC,cAAcA,CAACC,SAAqB,EAAEC,OAAiC,GAAG,CAAC,CAAC,EAAE;IAC5E,OAAO,KAAIC,+BAAa,EAACC,oCAAmB,CAACC,EAAE,EAAEJ,SAAS,EAAEC,OAAO,EAAE,CAAC,CAAC,CAAC;EAC1E;EAIA,aAAaI,QAAQA,CAAA,EAAG;IACtB,OAAO,IAAIP,iBAAiB,CAAC,CAAC;EAChC;AACF;AAACQ,OAAA,CAAAR,iBAAA,GAAAA,iBAAA;AAAArB,eAAA,CAdYqB,iBAAiB,aASXS,kBAAW;AAO9BJ,oCAAmB,CAACK,UAAU,CAACV,iBAAiB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_multiCompiler","_multiCompiler2","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","MultiCompilerMain","createCompiler","compilers","options","MultiCompiler","MultiCompilerAspect","id","provider","exports","MainRuntime","addRuntime"],"sources":["multi-compiler.main.runtime.ts"],"sourcesContent":["import { MainRuntime } from '@teambit/cli';\nimport { Compiler, CompilerOptions } from '@teambit/compiler';\nimport { MultiCompilerAspect } from './multi-compiler.aspect';\nimport { MultiCompiler } from './multi-compiler.compiler';\n\nexport class MultiCompilerMain {\n /**\n * create a multi-compiler `Compiler` instance.\n * @param compilers list of compilers to include.\n */\n createCompiler(compilers: Compiler[], options: Partial<CompilerOptions> = {}) {\n return new MultiCompiler(MultiCompilerAspect.id, compilers, options, {});\n }\n\n static runtime = MainRuntime;\n\n static async provider() {\n return new MultiCompilerMain();\n }\n}\n\nMultiC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iC,GAAG,CAAC,CAAC,EAAE;IAC5E,OAAO,KAAIC,+BAAa,EAACC,oCAAmB,CAACC,EAAE,EAAEJ,SAAS,EAAEC,OAAO,EAAE,CAAC,CAAC,CAAC;EAC1E;EAIA,aAAaI,QAAQA,CAAA,EAAG;IACtB,OAAO,IAAIP,iBAAiB,CAAC,CAAC;EAChC;AACF;AAACQ,OAAA,CAAAR,iBAAA,GAAAA,iBAAA;AAAArB,eAAA,CAdYqB,iBAAiB,aASXS,kBAAW;AAO9BJ,oCAAmB,CAACK,UAAU,CAACV,iBAAiB,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_multi-compiler@1.0.209/dist/multi-compiler.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_multi-compiler@1.0.209/dist/multi-compiler.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_multi-compiler@1.0.211/dist/multi-compiler.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_multi-compiler@1.0.211/dist/multi-compiler.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@teambit/multi-compiler",
3
- "version": "1.0.209",
3
+ "version": "1.0.211",
4
4
  "homepage": "https://bit.cloud/teambit/compilation/multi-compiler",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.compilation",
8
8
  "name": "multi-compiler",
9
- "version": "1.0.209"
9
+ "version": "1.0.211"
10
10
  },
11
11
  "dependencies": {
12
12
  "p-map-series": "2.1.0",
13
13
  "@teambit/harmony": "0.4.6",
14
- "@teambit/builder": "1.0.209",
15
- "@teambit/compiler": "1.0.209",
16
- "@teambit/component": "1.0.209",
14
+ "@teambit/builder": "1.0.211",
15
+ "@teambit/compiler": "1.0.211",
16
+ "@teambit/component": "1.0.211",
17
17
  "@teambit/pipelines.modules.merge-component-results": "0.0.498",
18
18
  "@teambit/cli": "0.0.858"
19
19
  },