@teambit/typescript 1.0.184 → 1.0.185

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,48 +1,48 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="44" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.typescript/typescript@1.0.184" tests="44" failures="0" errors="0" skipped="0">
4
- <testcase classname="dist/dedupe-path.spec.js" name="should return the root-dir if there is only one env involved" time="0.019"/>
3
+ <testsuite name="teambit.typescript/typescript@1.0.185" tests="44" failures="0" errors="0" skipped="0">
4
+ <testcase classname="dist/dedupe-path.spec.js" name="should return the root-dir if there is only one env involved" time="0.003"/>
5
5
  <testcase classname="dist/dedupe-path.spec.js" name="should set the env with the most components"/>
6
- <testcase classname="dist/dedupe-path.spec.js" name="should not set any env to a shared dir if it no env has max components"/>
7
- <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.283"/>
6
+ <testcase classname="dist/dedupe-path.spec.js" name="should not set any env to a shared dir if it no env has max components" time="0.001"/>
7
+ <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.286"/>
8
8
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with functionNamesTransformer" time="0.004"/>
9
9
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with importTransformer" time="0.004"/>
10
10
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with interfaceNamesTransformer" time="0.002"/>
11
11
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with typeAliasNamesTransformer" time="0.002"/>
12
- <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with variableNamesTransformer" time="0.003"/>
13
- <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.001"/>
14
- <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.001"/>
12
+ <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with variableNamesTransformer" time="0.002"/>
13
+ <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.002"/>
14
+ <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.002"/>
15
+ <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with expressionStatementTransformer" time="0.002"/>
15
16
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with expressionStatementTransformer" time="0.002"/>
16
- <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with expressionStatementTransformer" time="0.003"/>
17
17
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with interfaceNamesTransformer" time="0.001"/>
18
18
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with importTransformer" time="0.002"/>
19
- <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with exportTransformer" time="0.002"/>
20
- <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with exportTransformer"/>
19
+ <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with exportTransformer" time="0.001"/>
20
+ <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with exportTransformer" time="0.001"/>
21
21
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with exportTransformer" time="0.001"/>
22
22
  <testcase classname="dist/transform-source-file.spec.js" name="should return original source code if no transformations are applied" time="0.001"/>
23
- <testcase classname="dist/transform-source-file.spec.js" name="should handle multiple transformers" time="0.002"/>
24
- <testcase classname="dist/typescript.compiler.spec.js" name="should replace the extension with .js and prepend the dist dir" time="0.032"/>
23
+ <testcase classname="dist/transform-source-file.spec.js" name="should handle multiple transformers" time="0.001"/>
24
+ <testcase classname="dist/typescript.compiler.spec.js" name="should replace the extension with .js and prepend the dist dir" time="0.003"/>
25
25
  <testcase classname="dist/typescript.compiler.spec.js" name="should not replace the extension if the file is not supported"/>
26
26
  <testcase classname="dist/typescript.compiler.spec.js" name="should support .ts files"/>
27
- <testcase classname="dist/typescript.compiler.spec.js" name="should support .tsx files" time="0.001"/>
27
+ <testcase classname="dist/typescript.compiler.spec.js" name="should support .tsx files"/>
28
28
  <testcase classname="dist/typescript.compiler.spec.js" name="should not support .jsx files by default"/>
29
29
  <testcase classname="dist/typescript.compiler.spec.js" name="should not support .js files by default"/>
30
30
  <testcase classname="dist/typescript.compiler.spec.js" name="should support .jsx files when passing compileJsx"/>
31
31
  <testcase classname="dist/typescript.compiler.spec.js" name="should support .js files when passing compileJs"/>
32
- <testcase classname="dist/typescript.compiler.spec.js" name="should not support .d.ts files" time="0.001"/>
33
- <testcase classname="dist/typescript.parser.spec.js" name="should parse arrowFunctions" time="0.111"/>
34
- <testcase classname="dist/typescript.parser.spec.js" name="should parse function exports"/>
35
- <testcase classname="dist/typescript.parser.spec.js" name="should parse classes"/>
36
- <testcase classname="dist/typescript.parser.spec.js" name="should parse declarations"/>
37
- <testcase classname="dist/typescript.parser.spec.js" name="should parse renamed declarations"/>
32
+ <testcase classname="dist/typescript.compiler.spec.js" name="should not support .d.ts files"/>
33
+ <testcase classname="dist/typescript.parser.spec.js" name="should parse arrowFunctions" time="0.098"/>
34
+ <testcase classname="dist/typescript.parser.spec.js" name="should parse function exports" time="0.001"/>
35
+ <testcase classname="dist/typescript.parser.spec.js" name="should parse classes" time="0.001"/>
36
+ <testcase classname="dist/typescript.parser.spec.js" name="should parse declarations" time="0.001"/>
37
+ <testcase classname="dist/typescript.parser.spec.js" name="should parse renamed declarations" time="0.001"/>
38
38
  <testcase classname="dist/typescript.parser.spec.js" name="should parse re-exports"/>
39
39
  <testcase classname="dist/typescript.parser.spec.js" name="should parse re-exports with default" time="0.001"/>
40
- <testcase classname="dist/typescript.parser.spec.js" name="should parse renamed re-exports all"/>
40
+ <testcase classname="dist/typescript.parser.spec.js" name="should parse renamed re-exports all" time="0.001"/>
41
41
  <testcase classname="dist/typescript.parser.spec.js" name="should parse default exports" time="0.001"/>
42
- <testcase classname="dist/typescript.parser.spec.js" name="should include staticProperties, when on arrowFunctions"/>
43
- <testcase classname="dist/typescript.parser.spec.js" name="should include staticProperties, when on regular functions" time="0.001"/>
42
+ <testcase classname="dist/typescript.parser.spec.js" name="should include staticProperties, when on arrowFunctions" time="0.001"/>
43
+ <testcase classname="dist/typescript.parser.spec.js" name="should include staticProperties, when on regular functions"/>
44
44
  <testcase classname="dist/typescript.parser.spec.js" name="should include staticProperties, when on classes"/>
45
- <testcase classname="dist/typescript.parser.spec.js" name="should parse all primitive values" time="0.001"/>
45
+ <testcase classname="dist/typescript.parser.spec.js" name="should parse all primitive values" time="0.002"/>
46
46
  <testcase classname="dist/typescript.parser.spec.js" name="should skip non primitive values" time="0.001"/>
47
47
  <testcase classname="dist/typescript.parser.spec.js" name="should skip non assignment statements" time="0.001"/>
48
48
  </testsuite>
@@ -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.typescript/typescript-preview"]=t():e["teambit.typescript/typescript-preview"]=t()}(self,(()=>(()=>{"use strict";var e={65457:(e,t,n)=>{Object.defineProperty(t,"S",{enumerable:!0,get:function(){return o.default}});var o=r(n(39051));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.typescript/aspect-docs/typescript@0.0.167",homepage:"https://bit.cloud/teambit/typescript/aspect-docs/typescript",exported:!0}},39051:(e,t,n)=>{var o={id:"teambit.typescript/aspect-docs/typescript@0.0.167",homepage:"https://bit.cloud/teambit/typescript/aspect-docs/typescript",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=m,p(n(41594));var r=n(5016),i=["components"];function p(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}function a(e,t){if(null==e)return{};var n,o,r=c(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}p.__bit_component=o,s.__bit_component=o,a.__bit_component=o,c.__bit_component=o;var d={},l="wrapper";function m(e){var t=e.components,n=a(e,i);return(0,r.mdx)(l,s({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"Typescript aspect implements the ",(0,r.mdx)("inlineCode",{parentName:"p"},"Compiler")," interface and provides the ability to transpile files on the workspace and build components in the isolated capsules."),(0,r.mdx)("h2",null,"Configuration - tsconfig.json"),(0,r.mdx)("p",null,"An env that uses typescript compiler can have two tsconfig.json files, one for the workspace and one for the build process."),(0,r.mdx)("p",null,"On the workspace, the following two configurations are overridden:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"compilerOptions.sourceRoot = <componentDir>;\ncompilerOptions.rootDir = '.';\n")),(0,r.mdx)("p",null,"The reason to override them is to make the source-map working on the workspace."),(0,r.mdx)("p",null,"As a reminder, the ",(0,r.mdx)("inlineCode",{parentName:"p"},"dists")," are written into the node_modules and not in the component-dir, without the configuration above, the source-map won't have the correct ",(0,r.mdx)("inlineCode",{parentName:"p"},"sourceRoot")," and ",(0,r.mdx)("inlineCode",{parentName:"p"},"sources")," values, and as a result, the debugger won't work."),(0,r.mdx)("p",null,"On the capsules, the following configurion is overridden:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"compilerOptions.outDir = <CompilerOptions.distDir>\n")),(0,r.mdx)("p",null,"This is done to avoid confusion when the distDir is ",(0,r.mdx)("inlineCode",{parentName:"p"},"x")," and ts-config outDir is ",(0,r.mdx)("inlineCode",{parentName:"p"},"y"),",\nin which case, the dists in the capsule are written into ",(0,r.mdx)("inlineCode",{parentName:"p"},"y"),", but other bit processes expect to find them in ",(0,r.mdx)("inlineCode",{parentName:"p"},"x"),"."),(0,r.mdx)("h1",null,"Override typescript configuration in a custom env:"),(0,r.mdx)("p",null,"When creating a new custom environment, use the following API to change the typescript compiler config."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"useTypescript(modifiers?: UseTypescriptModifiers, tsModule: any = ts)\n")),(0,r.mdx)("p",null,"The modifiers are:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"type UseTypescriptModifiers = {\n buildConfig?: TsConfigTransformer[];\n devConfig?: TsConfigTransformer[];\n};\n")),(0,r.mdx)("p",null,"As you can see, you can customize the configuration for both: the build process and for the compilation on the workspace."),(0,r.mdx)("p",null,"An example of a TsConfigTransformer used by ",(0,r.mdx)("inlineCode",{parentName:"p"},"teambit/aspect")," for the build process, which uses the typescript compiler only for generating the types:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"const tsconfig = require(\"./tsconfig.json\");\n\nconst transformer: TsConfigTransformer = (config: TypescriptConfigMutator) => {\n config\n .mergeTsConfig(tsconfig)\n .setArtifactName('declaration')\n .setDistGlobPatterns([`dist/**/*.d.ts`])\n .setShouldCopyNonSupportedFiles(false);\n return config;\n };\n")),(0,r.mdx)("p",null,"In the last example, a custom tsconfig.json was merged to the builtin tsconfig.json."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},'{\n "compilerOptions": {\n ...\n "emitDeclarationOnly": true,\n ...\n },\n}\n')),(0,r.mdx)("p",null,"Some more props were changed as well to accomodate this env"))}m.__bit_component=o,m.isMDXComponent=!0},32223:(e,t,n)=>{var o={id:"teambit.typescript/typescript@1.0.184",homepage:"https://bit.cloud/teambit/typescript/typescript",exported:!0};function r(){const e=i(n(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=o,i.__bit_component=o;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/brands/logo-typescript.svg"}));p.__bit_component=o,t.Logo=p},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{compositions:()=>m,compositions_metadata:()=>f,overview:()=>u});var e={};n.r(e),n.d(e,{default:()=>l});var t=n(32223),r=(n(41594),n(5016));const i=TeambitMdxUiMdxScopeContext;var p=n(65457),s=["components"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a.apply(this,arguments)}var c={},d="wrapper";function l(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,s);return(0,r.mdx)(d,a({},c,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{Typescript:p.S},mdxType:"MDXScopeProvider"},(0,r.mdx)(p.S,{mdxType:"Typescript"})))}l.isMDXComponent=!0;const m=[t],u=[e],f={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),o})()));
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.typescript/typescript-preview"]=t():e["teambit.typescript/typescript-preview"]=t()}(self,(()=>(()=>{"use strict";var e={65457:(e,t,n)=>{Object.defineProperty(t,"S",{enumerable:!0,get:function(){return o.default}});var o=r(n(39051));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.typescript/aspect-docs/typescript@0.0.167",homepage:"https://bit.cloud/teambit/typescript/aspect-docs/typescript",exported:!0}},39051:(e,t,n)=>{var o={id:"teambit.typescript/aspect-docs/typescript@0.0.167",homepage:"https://bit.cloud/teambit/typescript/aspect-docs/typescript",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=m,p(n(41594));var r=n(5016),i=["components"];function p(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}function a(e,t){if(null==e)return{};var n,o,r=c(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}p.__bit_component=o,s.__bit_component=o,a.__bit_component=o,c.__bit_component=o;var d={},l="wrapper";function m(e){var t=e.components,n=a(e,i);return(0,r.mdx)(l,s({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"Typescript aspect implements the ",(0,r.mdx)("inlineCode",{parentName:"p"},"Compiler")," interface and provides the ability to transpile files on the workspace and build components in the isolated capsules."),(0,r.mdx)("h2",null,"Configuration - tsconfig.json"),(0,r.mdx)("p",null,"An env that uses typescript compiler can have two tsconfig.json files, one for the workspace and one for the build process."),(0,r.mdx)("p",null,"On the workspace, the following two configurations are overridden:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"compilerOptions.sourceRoot = <componentDir>;\ncompilerOptions.rootDir = '.';\n")),(0,r.mdx)("p",null,"The reason to override them is to make the source-map working on the workspace."),(0,r.mdx)("p",null,"As a reminder, the ",(0,r.mdx)("inlineCode",{parentName:"p"},"dists")," are written into the node_modules and not in the component-dir, without the configuration above, the source-map won't have the correct ",(0,r.mdx)("inlineCode",{parentName:"p"},"sourceRoot")," and ",(0,r.mdx)("inlineCode",{parentName:"p"},"sources")," values, and as a result, the debugger won't work."),(0,r.mdx)("p",null,"On the capsules, the following configurion is overridden:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"compilerOptions.outDir = <CompilerOptions.distDir>\n")),(0,r.mdx)("p",null,"This is done to avoid confusion when the distDir is ",(0,r.mdx)("inlineCode",{parentName:"p"},"x")," and ts-config outDir is ",(0,r.mdx)("inlineCode",{parentName:"p"},"y"),",\nin which case, the dists in the capsule are written into ",(0,r.mdx)("inlineCode",{parentName:"p"},"y"),", but other bit processes expect to find them in ",(0,r.mdx)("inlineCode",{parentName:"p"},"x"),"."),(0,r.mdx)("h1",null,"Override typescript configuration in a custom env:"),(0,r.mdx)("p",null,"When creating a new custom environment, use the following API to change the typescript compiler config."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"useTypescript(modifiers?: UseTypescriptModifiers, tsModule: any = ts)\n")),(0,r.mdx)("p",null,"The modifiers are:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"type UseTypescriptModifiers = {\n buildConfig?: TsConfigTransformer[];\n devConfig?: TsConfigTransformer[];\n};\n")),(0,r.mdx)("p",null,"As you can see, you can customize the configuration for both: the build process and for the compilation on the workspace."),(0,r.mdx)("p",null,"An example of a TsConfigTransformer used by ",(0,r.mdx)("inlineCode",{parentName:"p"},"teambit/aspect")," for the build process, which uses the typescript compiler only for generating the types:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"const tsconfig = require(\"./tsconfig.json\");\n\nconst transformer: TsConfigTransformer = (config: TypescriptConfigMutator) => {\n config\n .mergeTsConfig(tsconfig)\n .setArtifactName('declaration')\n .setDistGlobPatterns([`dist/**/*.d.ts`])\n .setShouldCopyNonSupportedFiles(false);\n return config;\n };\n")),(0,r.mdx)("p",null,"In the last example, a custom tsconfig.json was merged to the builtin tsconfig.json."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},'{\n "compilerOptions": {\n ...\n "emitDeclarationOnly": true,\n ...\n },\n}\n')),(0,r.mdx)("p",null,"Some more props were changed as well to accomodate this env"))}m.__bit_component=o,m.isMDXComponent=!0},12196:(e,t,n)=>{var o={id:"teambit.typescript/typescript@1.0.185",homepage:"https://bit.cloud/teambit/typescript/typescript",exported:!0};function r(){const e=i(n(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=o,i.__bit_component=o;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/brands/logo-typescript.svg"}));p.__bit_component=o,t.Logo=p},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{compositions:()=>m,compositions_metadata:()=>f,overview:()=>u});var e={};n.r(e),n.d(e,{default:()=>l});var t=n(12196),r=(n(41594),n(5016));const i=TeambitMdxUiMdxScopeContext;var p=n(65457),s=["components"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a.apply(this,arguments)}var c={},d="wrapper";function l(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,s);return(0,r.mdx)(d,a({},c,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{Typescript:p.S},mdxType:"MDXScopeProvider"},(0,r.mdx)(p.S,{mdxType:"Typescript"})))}l.isMDXComponent=!0;const m=[t],u=[e],f={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),o})()));
@@ -976,7 +976,7 @@
976
976
  "_legacy": {
977
977
  "scope": "teambit.typescript",
978
978
  "name": "typescript",
979
- "version": "1.0.184"
979
+ "version": "1.0.185"
980
980
  },
981
981
  "_scope": "teambit.typescript"
982
982
  }
@@ -1592,7 +1592,7 @@
1592
1592
  "__schema": "FunctionLikeSchema",
1593
1593
  "location": {
1594
1594
  "filePath": "typescript.compiler.ts",
1595
- "line": 283,
1595
+ "line": 287,
1596
1596
  "character": 3
1597
1597
  },
1598
1598
  "signature": "(method) TypescriptCompiler.version(): string",
@@ -1602,7 +1602,7 @@
1602
1602
  "__schema": "InferenceTypeSchema",
1603
1603
  "location": {
1604
1604
  "filePath": "typescript.compiler.ts",
1605
- "line": 283,
1605
+ "line": 287,
1606
1606
  "character": 3
1607
1607
  },
1608
1608
  "type": "string"
@@ -1633,7 +1633,7 @@
1633
1633
  "_legacy": {
1634
1634
  "scope": "teambit.typescript",
1635
1635
  "name": "typescript",
1636
- "version": "1.0.184"
1636
+ "version": "1.0.185"
1637
1637
  },
1638
1638
  "_scope": "teambit.typescript"
1639
1639
  }
@@ -8851,7 +8851,7 @@
8851
8851
  "_legacy": {
8852
8852
  "scope": "teambit.typescript",
8853
8853
  "name": "typescript",
8854
- "version": "1.0.184"
8854
+ "version": "1.0.185"
8855
8855
  },
8856
8856
  "_scope": "teambit.typescript"
8857
8857
  }
@@ -9478,7 +9478,7 @@
9478
9478
  "__schema": "FunctionLikeSchema",
9479
9479
  "location": {
9480
9480
  "filePath": "typescript.compiler.ts",
9481
- "line": 283,
9481
+ "line": 287,
9482
9482
  "character": 3
9483
9483
  },
9484
9484
  "signature": "(method) TypescriptCompiler.version(): string",
@@ -9488,7 +9488,7 @@
9488
9488
  "__schema": "InferenceTypeSchema",
9489
9489
  "location": {
9490
9490
  "filePath": "typescript.compiler.ts",
9491
- "line": 283,
9491
+ "line": 287,
9492
9492
  "character": 3
9493
9493
  },
9494
9494
  "type": "string"
@@ -9519,7 +9519,7 @@
9519
9519
  "_legacy": {
9520
9520
  "scope": "teambit.typescript",
9521
9521
  "name": "typescript",
9522
- "version": "1.0.184"
9522
+ "version": "1.0.185"
9523
9523
  },
9524
9524
  "_scope": "teambit.typescript"
9525
9525
  }
@@ -15731,7 +15731,7 @@
15731
15731
  "componentId": {
15732
15732
  "scope": "teambit.typescript",
15733
15733
  "name": "typescript",
15734
- "version": "1.0.184"
15734
+ "version": "1.0.185"
15735
15735
  },
15736
15736
  "taggedModuleExports": []
15737
15737
  }
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.typescript_typescript@1.0.184/dist/typescript.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.typescript_typescript@1.0.184/dist/typescript.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.typescript_typescript@1.0.185/dist/typescript.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.typescript_typescript@1.0.185/dist/typescript.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -140,7 +140,7 @@ class TypescriptCompiler {
140
140
  isFileSupported(filePath) {
141
141
  const isJsAndCompile = !!this.options.compileJs && filePath.endsWith('.js');
142
142
  const isJsxAndCompile = !!this.options.compileJsx && filePath.endsWith('.jsx');
143
- return (filePath.endsWith('.ts') || filePath.endsWith('.tsx') || isJsAndCompile || isJsxAndCompile) && !filePath.endsWith('.d.ts');
143
+ return (['.ts', '.tsx', '.mts', '.cts', '.mtsx', '.ctsx'].some(ext => filePath.endsWith(ext)) || isJsAndCompile || isJsxAndCompile) && !filePath.endsWith('.d.ts');
144
144
  }
145
145
 
146
146
  /**
@@ -271,7 +271,9 @@ class TypescriptCompiler {
271
271
  replaceFileExtToJs(filePath) {
272
272
  if (!this.isFileSupported(filePath)) return filePath;
273
273
  const fileExtension = _path().default.extname(filePath);
274
- return filePath.replace(new RegExp(`${fileExtension}$`), '.js'); // makes sure it's the last occurrence
274
+ // take into account mts, cts, mtsx, ctsx, etc.
275
+ const replacement = fileExtension.replace(/([tj]sx?)$/, 'js');
276
+ return filePath.replace(new RegExp(`${fileExtension}$`), replacement); // makes sure it's the last occurrence
275
277
  }
276
278
  version() {
277
279
  return this.tsModule.version;
@@ -1 +1 @@
1
- {"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_bitError","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","TypescriptCompiler","constructor","id","logger","options","tsModule","distDir","distGlobPatterns","shouldCopyNonSupportedFiles","artifactName","tsconfig","compilerOptions","outDir","displayConfig","stringifyTsconfig","getDistDir","transpileFile","fileContent","isFileSupported","filePath","compilerOptionsFromTsconfig","convertCompilerOptionsFromJson","errors","formattedErrors","formatDiagnosticsWithColorAndContext","getFormatDiagnosticsHost","Error","sourceRoot","componentDir","rootDir","result","transpileModule","fileName","reportDiagnostics","diagnostics","formatHost","error","outputPath","replaceFileExtToJs","outputFiles","outputText","sourceMapText","preBuild","context","capsules","capsuleNetwork","seedersCapsules","capsuleDirs","map","capsule","path","writeTsConfig","writeTypes","writeNpmIgnore","build","componentsResults","runTscBuild","artifacts","getArtifactDefinition","generatedBy","name","globPatterns","getDistPathBySrcPath","srcPath","fileWithJSExtIfNeeded","join","isJsAndCompile","compileJs","endsWith","isJsxAndCompile","compileJsx","network","capsulesRootDir","getCapsulesToCompile","getAllCapsuleDirs","getCanonicalFileName","p","getCurrentDirectory","getNewLine","sys","newLine","currentComponentResult","reportDiagnostic","diagnostic","errorStr","process","stdout","isTTY","formatDiagnostic","file","BitError","consoleFailure","component","reportSolutionBuilderStatus","diag","msg","messageText","debug","errorCounter","errorCount","info","host","createSolutionBuilderHost","undefined","writeProjectReferencesTsConfig","solutionBuilder","createSolutionBuilder","verbose","nextProject","longProcessLogger","createLongProcessLogger","getNextInvalidatedProject","capsulePath","project","replace","currentComponentId","getIdByPathInCapsule","logProgress","toString","getCapsule","startTime","Date","now","done","endTime","end","dirs","Promise","all","types","typePath","contents","fs","readFile","filename","basename","dir","pathExists","outputFile","NPM_IGNORE_FILE","npmIgnorePath","npmIgnoreEntriesStr","appendFile","projects","files","references","tsconfigStr","writeFile","JSON","stringify","fileExtension","extname","RegExp","version","exports"],"sources":["typescript.compiler.ts"],"sourcesContent":["import { BuildContext, BuiltTaskResult, ComponentResult } from '@teambit/builder';\nimport { Compiler, TranspileFileParams, TranspileFileOutput } from '@teambit/compiler';\nimport { Network } from '@teambit/isolator';\nimport { Logger } from '@teambit/logger';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport ts from 'typescript';\nimport { BitError } from '@teambit/bit-error';\nimport { TypeScriptCompilerOptions } from './compiler-options';\n\nexport class TypescriptCompiler implements Compiler {\n distDir: string;\n distGlobPatterns: string[];\n shouldCopyNonSupportedFiles: boolean;\n artifactName: string;\n constructor(\n readonly id: string,\n private logger: Logger,\n private options: TypeScriptCompilerOptions,\n private tsModule: typeof ts\n ) {\n this.distDir = options.distDir || 'dist';\n this.distGlobPatterns = options.distGlobPatterns || [`${this.distDir}/**`, `!${this.distDir}/tsconfig.tsbuildinfo`];\n this.shouldCopyNonSupportedFiles =\n typeof options.shouldCopyNonSupportedFiles === 'boolean' ? options.shouldCopyNonSupportedFiles : true;\n this.artifactName = options.artifactName || 'dist';\n this.options.tsconfig ||= {};\n this.options.tsconfig.compilerOptions ||= {};\n // mutate the outDir, otherwise, on capsules, the dists might be written to a different directory and make confusion\n this.options.tsconfig.compilerOptions.outDir = this.distDir;\n }\n\n displayName = 'TypeScript';\n deleteDistDir = false;\n\n displayConfig() {\n return this.stringifyTsconfig(this.options.tsconfig);\n }\n\n getDistDir() {\n return this.distDir;\n }\n\n /**\n * compile one file on the workspace\n */\n transpileFile(fileContent: string, options: TranspileFileParams): TranspileFileOutput {\n if (!this.isFileSupported(options.filePath)) {\n return null; // file is not supported\n }\n const compilerOptionsFromTsconfig = this.tsModule.convertCompilerOptionsFromJson(\n this.options.tsconfig.compilerOptions,\n '.'\n );\n if (compilerOptionsFromTsconfig.errors.length) {\n // :TODO @david replace to a more concrete error type and put in 'exceptions' directory here.\n const formattedErrors = this.tsModule.formatDiagnosticsWithColorAndContext(\n compilerOptionsFromTsconfig.errors,\n this.getFormatDiagnosticsHost()\n );\n throw new Error(`failed parsing the tsconfig.json.\\n${formattedErrors}`);\n }\n\n const compilerOptions = compilerOptionsFromTsconfig.options;\n compilerOptions.sourceRoot = options.componentDir;\n compilerOptions.rootDir = '.';\n const result = this.tsModule.transpileModule(fileContent, {\n compilerOptions,\n fileName: options.filePath,\n reportDiagnostics: true,\n });\n\n if (result.diagnostics && result.diagnostics.length) {\n const formatHost = this.getFormatDiagnosticsHost();\n const error = this.tsModule.formatDiagnosticsWithColorAndContext(result.diagnostics, formatHost);\n\n // :TODO @david please replace to a more concrete error type and put in 'exceptions' directory here.\n throw new Error(error);\n }\n\n const outputPath = this.replaceFileExtToJs(options.filePath);\n const outputFiles = [{ outputText: result.outputText, outputPath }];\n if (result.sourceMapText) {\n outputFiles.push({\n outputText: result.sourceMapText,\n outputPath: `${outputPath}.map`,\n });\n }\n return outputFiles;\n }\n\n async preBuild(context: BuildContext) {\n const capsules = context.capsuleNetwork.seedersCapsules;\n const capsuleDirs = capsules.map((capsule) => capsule.path);\n await this.writeTsConfig(capsuleDirs);\n await this.writeTypes(capsuleDirs);\n await this.writeNpmIgnore(capsuleDirs);\n }\n\n /**\n * compile multiple components on the capsules\n */\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n const componentsResults = await this.runTscBuild(context.capsuleNetwork);\n\n return {\n artifacts: this.getArtifactDefinition(),\n componentsResults,\n };\n }\n\n getArtifactDefinition() {\n return [\n {\n generatedBy: this.id,\n name: this.artifactName,\n globPatterns: this.distGlobPatterns,\n },\n ];\n }\n\n /**\n * given a source file, return its parallel in the dists. e.g. index.ts => dist/index.js\n */\n getDistPathBySrcPath(srcPath: string) {\n const fileWithJSExtIfNeeded = this.replaceFileExtToJs(srcPath);\n return path.join(this.distDir, fileWithJSExtIfNeeded);\n }\n\n /**\n * whether typescript is able to compile the given path\n */\n isFileSupported(filePath: string): boolean {\n const isJsAndCompile = !!this.options.compileJs && filePath.endsWith('.js');\n const isJsxAndCompile = !!this.options.compileJsx && filePath.endsWith('.jsx');\n return (\n (filePath.endsWith('.ts') || filePath.endsWith('.tsx') || isJsAndCompile || isJsxAndCompile) &&\n !filePath.endsWith('.d.ts')\n );\n }\n\n /**\n * we have two options here:\n * 1. pass all capsules-dir at the second parameter of createSolutionBuilder and then no\n * need to write the main tsconfig.json with all the references.\n * 2. write main tsconfig.json and pass the capsules root-dir.\n * we went with option #2 because it'll be easier for users to go to the capsule-root and run\n * `tsc --build` to debug issues.\n */\n private async runTscBuild(network: Network): Promise<ComponentResult[]> {\n const rootDir = network.capsulesRootDir;\n const capsules = await network.getCapsulesToCompile();\n if (!capsules.length) {\n return [];\n }\n const capsuleDirs = capsules.getAllCapsuleDirs();\n const formatHost = {\n getCanonicalFileName: (p) => p,\n getCurrentDirectory: () => '', // it helps to get the files with absolute paths\n getNewLine: () => this.tsModule.sys.newLine,\n };\n const componentsResults: ComponentResult[] = [];\n let currentComponentResult: Partial<ComponentResult> = { errors: [] };\n const reportDiagnostic = (diagnostic: ts.Diagnostic) => {\n const errorStr = process.stdout.isTTY\n ? this.tsModule.formatDiagnosticsWithColorAndContext([diagnostic], formatHost)\n : this.tsModule.formatDiagnostic(diagnostic, formatHost);\n if (!diagnostic.file) {\n // the error is general and not related to a specific file. e.g. tsconfig is missing.\n throw new BitError(errorStr);\n }\n this.logger.consoleFailure(errorStr);\n if (!currentComponentResult.component || !currentComponentResult.errors) {\n throw new Error(`currentComponentResult is not defined yet for ${diagnostic.file}`);\n }\n currentComponentResult.errors.push(errorStr);\n };\n // this only works when `verbose` is `true` in the `ts.createSolutionBuilder` function.\n const reportSolutionBuilderStatus = (diag: ts.Diagnostic) => {\n const msg = diag.messageText as string;\n this.logger.debug(msg);\n };\n const errorCounter = (errorCount: number) => {\n this.logger.info(`total error found: ${errorCount}`);\n };\n const host = this.tsModule.createSolutionBuilderHost(\n undefined,\n undefined,\n reportDiagnostic,\n reportSolutionBuilderStatus,\n errorCounter\n );\n await this.writeProjectReferencesTsConfig(rootDir, capsuleDirs);\n const solutionBuilder = this.tsModule.createSolutionBuilder(host, [rootDir], { verbose: true });\n let nextProject;\n const longProcessLogger = this.logger.createLongProcessLogger('compile typescript components', capsules.length);\n // eslint-disable-next-line no-cond-assign\n while ((nextProject = solutionBuilder.getNextInvalidatedProject())) {\n // regex to make sure it will work correctly for both linux and windows\n // it replaces both /tsconfig.json and \\tsocnfig.json\n const capsulePath = nextProject.project.replace(/[/\\\\]tsconfig.json/, '');\n const currentComponentId = capsules.getIdByPathInCapsule(capsulePath);\n if (!currentComponentId) throw new Error(`unable to find component for ${capsulePath}`);\n longProcessLogger.logProgress(currentComponentId.toString());\n const capsule = capsules.getCapsule(currentComponentId);\n if (!capsule) throw new Error(`unable to find capsule for ${currentComponentId.toString()}`);\n currentComponentResult.component = capsule.component;\n currentComponentResult.startTime = Date.now();\n nextProject.done();\n currentComponentResult.endTime = Date.now();\n componentsResults.push({ ...currentComponentResult } as ComponentResult);\n currentComponentResult = { errors: [] };\n }\n longProcessLogger.end();\n\n return componentsResults;\n }\n\n private getFormatDiagnosticsHost(): ts.FormatDiagnosticsHost {\n return {\n getCanonicalFileName: (p) => p,\n getCurrentDirectory: this.tsModule.sys.getCurrentDirectory,\n getNewLine: () => this.tsModule.sys.newLine,\n };\n }\n\n private async writeTypes(dirs: string[]) {\n await Promise.all(\n this.options.types.map(async (typePath) => {\n const contents = await fs.readFile(typePath, 'utf8');\n const filename = path.basename(typePath);\n\n await Promise.all(\n dirs.map(async (dir) => {\n const filePath = path.join(dir, 'types', filename);\n if (!(await fs.pathExists(filePath))) {\n await fs.outputFile(filePath, contents);\n }\n })\n );\n })\n );\n }\n\n /**\n * when using project-references, typescript adds a file \"tsconfig.tsbuildinfo\" which is not\n * needed for the package.\n */\n private async writeNpmIgnore(dirs: string[]) {\n const NPM_IGNORE_FILE = '.npmignore';\n await Promise.all(\n dirs.map(async (dir) => {\n const npmIgnorePath = path.join(dir, NPM_IGNORE_FILE);\n const npmIgnoreEntriesStr = `\\n${this.distDir}/tsconfig.tsbuildinfo\\n`;\n await fs.appendFile(npmIgnorePath, npmIgnoreEntriesStr);\n })\n );\n }\n\n private async writeProjectReferencesTsConfig(rootDir: string, projects: string[]) {\n const files = [];\n const references = projects.map((project) => ({ path: project }));\n const tsconfig = { files, references };\n const tsconfigStr = this.stringifyTsconfig(tsconfig);\n await fs.writeFile(path.join(rootDir, 'tsconfig.json'), tsconfigStr);\n }\n\n private async writeTsConfig(dirs: string[]) {\n const tsconfigStr = this.stringifyTsconfig(this.options.tsconfig);\n await Promise.all(dirs.map((dir) => fs.writeFile(path.join(dir, 'tsconfig.json'), tsconfigStr)));\n }\n\n private stringifyTsconfig(tsconfig) {\n return JSON.stringify(tsconfig, undefined, 2);\n }\n\n private replaceFileExtToJs(filePath: string): string {\n if (!this.isFileSupported(filePath)) return filePath;\n const fileExtension = path.extname(filePath);\n return filePath.replace(new RegExp(`${fileExtension}$`), '.js'); // makes sure it's the last occurrence\n }\n\n version() {\n return this.tsModule.version;\n }\n}\n"],"mappings":";;;;;;AAIA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,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E,GAAG,EAAE,eAAe,CAAC,EAAEU,WAAW,CAAC,CAAC,CAAC;EAClG;EAEQpI,iBAAiBA,CAACJ,QAAQ,EAAE;IAClC,OAAO0I,IAAI,CAACC,SAAS,CAAC3I,QAAQ,EAAE6F,SAAS,EAAE,CAAC,CAAC;EAC/C;EAEQjE,kBAAkBA,CAACnB,QAAgB,EAAU;IACnD,IAAI,CAAC,IAAI,CAACD,eAAe,CAACC,QAAQ,CAAC,EAAE,OAAOA,QAAQ;IACpD,MAAMmI,aAAa,GAAGpG,eAAI,CAACqG,OAAO,CAACpI,QAAQ,CAAC;IAC5C,OAAOA,QAAQ,CAAC+F,OAAO,CAAC,IAAIsC,MAAM,CAAE,GAAEF,aAAc,GAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;EACnE;EAEAG,OAAOA,CAAA,EAAG;IACR,OAAO,IAAI,CAACpJ,QAAQ,CAACoJ,OAAO;EAC9B;AACF;AAACC,OAAA,CAAA1J,kBAAA,GAAAA,kBAAA"}
1
+ {"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_bitError","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","TypescriptCompiler","constructor","id","logger","options","tsModule","distDir","distGlobPatterns","shouldCopyNonSupportedFiles","artifactName","tsconfig","compilerOptions","outDir","displayConfig","stringifyTsconfig","getDistDir","transpileFile","fileContent","isFileSupported","filePath","compilerOptionsFromTsconfig","convertCompilerOptionsFromJson","errors","formattedErrors","formatDiagnosticsWithColorAndContext","getFormatDiagnosticsHost","Error","sourceRoot","componentDir","rootDir","result","transpileModule","fileName","reportDiagnostics","diagnostics","formatHost","error","outputPath","replaceFileExtToJs","outputFiles","outputText","sourceMapText","preBuild","context","capsules","capsuleNetwork","seedersCapsules","capsuleDirs","map","capsule","path","writeTsConfig","writeTypes","writeNpmIgnore","build","componentsResults","runTscBuild","artifacts","getArtifactDefinition","generatedBy","name","globPatterns","getDistPathBySrcPath","srcPath","fileWithJSExtIfNeeded","join","isJsAndCompile","compileJs","endsWith","isJsxAndCompile","compileJsx","some","ext","network","capsulesRootDir","getCapsulesToCompile","getAllCapsuleDirs","getCanonicalFileName","p","getCurrentDirectory","getNewLine","sys","newLine","currentComponentResult","reportDiagnostic","diagnostic","errorStr","process","stdout","isTTY","formatDiagnostic","file","BitError","consoleFailure","component","reportSolutionBuilderStatus","diag","msg","messageText","debug","errorCounter","errorCount","info","host","createSolutionBuilderHost","undefined","writeProjectReferencesTsConfig","solutionBuilder","createSolutionBuilder","verbose","nextProject","longProcessLogger","createLongProcessLogger","getNextInvalidatedProject","capsulePath","project","replace","currentComponentId","getIdByPathInCapsule","logProgress","toString","getCapsule","startTime","Date","now","done","endTime","end","dirs","Promise","all","types","typePath","contents","fs","readFile","filename","basename","dir","pathExists","outputFile","NPM_IGNORE_FILE","npmIgnorePath","npmIgnoreEntriesStr","appendFile","projects","files","references","tsconfigStr","writeFile","JSON","stringify","fileExtension","extname","replacement","RegExp","version","exports"],"sources":["typescript.compiler.ts"],"sourcesContent":["import { BuildContext, BuiltTaskResult, ComponentResult } from '@teambit/builder';\nimport { Compiler, TranspileFileParams, TranspileFileOutput } from '@teambit/compiler';\nimport { Network } from '@teambit/isolator';\nimport { Logger } from '@teambit/logger';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport ts from 'typescript';\nimport { BitError } from '@teambit/bit-error';\nimport { TypeScriptCompilerOptions } from './compiler-options';\n\nexport class TypescriptCompiler implements Compiler {\n distDir: string;\n distGlobPatterns: string[];\n shouldCopyNonSupportedFiles: boolean;\n artifactName: string;\n constructor(\n readonly id: string,\n private logger: Logger,\n private options: TypeScriptCompilerOptions,\n private tsModule: typeof ts\n ) {\n this.distDir = options.distDir || 'dist';\n this.distGlobPatterns = options.distGlobPatterns || [`${this.distDir}/**`, `!${this.distDir}/tsconfig.tsbuildinfo`];\n this.shouldCopyNonSupportedFiles =\n typeof options.shouldCopyNonSupportedFiles === 'boolean' ? options.shouldCopyNonSupportedFiles : true;\n this.artifactName = options.artifactName || 'dist';\n this.options.tsconfig ||= {};\n this.options.tsconfig.compilerOptions ||= {};\n // mutate the outDir, otherwise, on capsules, the dists might be written to a different directory and make confusion\n this.options.tsconfig.compilerOptions.outDir = this.distDir;\n }\n\n displayName = 'TypeScript';\n deleteDistDir = false;\n\n displayConfig() {\n return this.stringifyTsconfig(this.options.tsconfig);\n }\n\n getDistDir() {\n return this.distDir;\n }\n\n /**\n * compile one file on the workspace\n */\n transpileFile(fileContent: string, options: TranspileFileParams): TranspileFileOutput {\n if (!this.isFileSupported(options.filePath)) {\n return null; // file is not supported\n }\n const compilerOptionsFromTsconfig = this.tsModule.convertCompilerOptionsFromJson(\n this.options.tsconfig.compilerOptions,\n '.'\n );\n if (compilerOptionsFromTsconfig.errors.length) {\n // :TODO @david replace to a more concrete error type and put in 'exceptions' directory here.\n const formattedErrors = this.tsModule.formatDiagnosticsWithColorAndContext(\n compilerOptionsFromTsconfig.errors,\n this.getFormatDiagnosticsHost()\n );\n throw new Error(`failed parsing the tsconfig.json.\\n${formattedErrors}`);\n }\n\n const compilerOptions = compilerOptionsFromTsconfig.options;\n compilerOptions.sourceRoot = options.componentDir;\n compilerOptions.rootDir = '.';\n const result = this.tsModule.transpileModule(fileContent, {\n compilerOptions,\n fileName: options.filePath,\n reportDiagnostics: true,\n });\n\n if (result.diagnostics && result.diagnostics.length) {\n const formatHost = this.getFormatDiagnosticsHost();\n const error = this.tsModule.formatDiagnosticsWithColorAndContext(result.diagnostics, formatHost);\n\n // :TODO @david please replace to a more concrete error type and put in 'exceptions' directory here.\n throw new Error(error);\n }\n\n const outputPath = this.replaceFileExtToJs(options.filePath);\n const outputFiles = [{ outputText: result.outputText, outputPath }];\n if (result.sourceMapText) {\n outputFiles.push({\n outputText: result.sourceMapText,\n outputPath: `${outputPath}.map`,\n });\n }\n return outputFiles;\n }\n\n async preBuild(context: BuildContext) {\n const capsules = context.capsuleNetwork.seedersCapsules;\n const capsuleDirs = capsules.map((capsule) => capsule.path);\n await this.writeTsConfig(capsuleDirs);\n await this.writeTypes(capsuleDirs);\n await this.writeNpmIgnore(capsuleDirs);\n }\n\n /**\n * compile multiple components on the capsules\n */\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n const componentsResults = await this.runTscBuild(context.capsuleNetwork);\n\n return {\n artifacts: this.getArtifactDefinition(),\n componentsResults,\n };\n }\n\n getArtifactDefinition() {\n return [\n {\n generatedBy: this.id,\n name: this.artifactName,\n globPatterns: this.distGlobPatterns,\n },\n ];\n }\n\n /**\n * given a source file, return its parallel in the dists. e.g. index.ts => dist/index.js\n */\n getDistPathBySrcPath(srcPath: string) {\n const fileWithJSExtIfNeeded = this.replaceFileExtToJs(srcPath);\n return path.join(this.distDir, fileWithJSExtIfNeeded);\n }\n\n /**\n * whether typescript is able to compile the given path\n */\n isFileSupported(filePath: string): boolean {\n const isJsAndCompile = !!this.options.compileJs && filePath.endsWith('.js');\n const isJsxAndCompile = !!this.options.compileJsx && filePath.endsWith('.jsx');\n return (\n (['.ts', '.tsx', '.mts', '.cts', '.mtsx', '.ctsx'].some((ext) => filePath.endsWith(ext)) ||\n isJsAndCompile ||\n isJsxAndCompile) &&\n !filePath.endsWith('.d.ts')\n );\n }\n\n /**\n * we have two options here:\n * 1. pass all capsules-dir at the second parameter of createSolutionBuilder and then no\n * need to write the main tsconfig.json with all the references.\n * 2. write main tsconfig.json and pass the capsules root-dir.\n * we went with option #2 because it'll be easier for users to go to the capsule-root and run\n * `tsc --build` to debug issues.\n */\n private async runTscBuild(network: Network): Promise<ComponentResult[]> {\n const rootDir = network.capsulesRootDir;\n const capsules = await network.getCapsulesToCompile();\n if (!capsules.length) {\n return [];\n }\n const capsuleDirs = capsules.getAllCapsuleDirs();\n const formatHost = {\n getCanonicalFileName: (p) => p,\n getCurrentDirectory: () => '', // it helps to get the files with absolute paths\n getNewLine: () => this.tsModule.sys.newLine,\n };\n const componentsResults: ComponentResult[] = [];\n let currentComponentResult: Partial<ComponentResult> = { errors: [] };\n const reportDiagnostic = (diagnostic: ts.Diagnostic) => {\n const errorStr = process.stdout.isTTY\n ? this.tsModule.formatDiagnosticsWithColorAndContext([diagnostic], formatHost)\n : this.tsModule.formatDiagnostic(diagnostic, formatHost);\n if (!diagnostic.file) {\n // the error is general and not related to a specific file. e.g. tsconfig is missing.\n throw new BitError(errorStr);\n }\n this.logger.consoleFailure(errorStr);\n if (!currentComponentResult.component || !currentComponentResult.errors) {\n throw new Error(`currentComponentResult is not defined yet for ${diagnostic.file}`);\n }\n currentComponentResult.errors.push(errorStr);\n };\n // this only works when `verbose` is `true` in the `ts.createSolutionBuilder` function.\n const reportSolutionBuilderStatus = (diag: ts.Diagnostic) => {\n const msg = diag.messageText as string;\n this.logger.debug(msg);\n };\n const errorCounter = (errorCount: number) => {\n this.logger.info(`total error found: ${errorCount}`);\n };\n const host = this.tsModule.createSolutionBuilderHost(\n undefined,\n undefined,\n reportDiagnostic,\n reportSolutionBuilderStatus,\n errorCounter\n );\n await this.writeProjectReferencesTsConfig(rootDir, capsuleDirs);\n const solutionBuilder = this.tsModule.createSolutionBuilder(host, [rootDir], { verbose: true });\n let nextProject;\n const longProcessLogger = this.logger.createLongProcessLogger('compile typescript components', capsules.length);\n // eslint-disable-next-line no-cond-assign\n while ((nextProject = solutionBuilder.getNextInvalidatedProject())) {\n // regex to make sure it will work correctly for both linux and windows\n // it replaces both /tsconfig.json and \\tsocnfig.json\n const capsulePath = nextProject.project.replace(/[/\\\\]tsconfig.json/, '');\n const currentComponentId = capsules.getIdByPathInCapsule(capsulePath);\n if (!currentComponentId) throw new Error(`unable to find component for ${capsulePath}`);\n longProcessLogger.logProgress(currentComponentId.toString());\n const capsule = capsules.getCapsule(currentComponentId);\n if (!capsule) throw new Error(`unable to find capsule for ${currentComponentId.toString()}`);\n currentComponentResult.component = capsule.component;\n currentComponentResult.startTime = Date.now();\n nextProject.done();\n currentComponentResult.endTime = Date.now();\n componentsResults.push({ ...currentComponentResult } as ComponentResult);\n currentComponentResult = { errors: [] };\n }\n longProcessLogger.end();\n\n return componentsResults;\n }\n\n private getFormatDiagnosticsHost(): ts.FormatDiagnosticsHost {\n return {\n getCanonicalFileName: (p) => p,\n getCurrentDirectory: this.tsModule.sys.getCurrentDirectory,\n getNewLine: () => this.tsModule.sys.newLine,\n };\n }\n\n private async writeTypes(dirs: string[]) {\n await Promise.all(\n this.options.types.map(async (typePath) => {\n const contents = await fs.readFile(typePath, 'utf8');\n const filename = path.basename(typePath);\n\n await Promise.all(\n dirs.map(async (dir) => {\n const filePath = path.join(dir, 'types', filename);\n if (!(await fs.pathExists(filePath))) {\n await fs.outputFile(filePath, contents);\n }\n })\n );\n })\n );\n }\n\n /**\n * when using project-references, typescript adds a file \"tsconfig.tsbuildinfo\" which is not\n * needed for the package.\n */\n private async writeNpmIgnore(dirs: string[]) {\n const NPM_IGNORE_FILE = '.npmignore';\n await Promise.all(\n dirs.map(async (dir) => {\n const npmIgnorePath = path.join(dir, NPM_IGNORE_FILE);\n const npmIgnoreEntriesStr = `\\n${this.distDir}/tsconfig.tsbuildinfo\\n`;\n await fs.appendFile(npmIgnorePath, npmIgnoreEntriesStr);\n })\n );\n }\n\n private async writeProjectReferencesTsConfig(rootDir: string, projects: string[]) {\n const files = [];\n const references = projects.map((project) => ({ path: project }));\n const tsconfig = { files, references };\n const tsconfigStr = this.stringifyTsconfig(tsconfig);\n await fs.writeFile(path.join(rootDir, 'tsconfig.json'), tsconfigStr);\n }\n\n private async writeTsConfig(dirs: string[]) {\n const tsconfigStr = this.stringifyTsconfig(this.options.tsconfig);\n await Promise.all(dirs.map((dir) => fs.writeFile(path.join(dir, 'tsconfig.json'), tsconfigStr)));\n }\n\n private stringifyTsconfig(tsconfig) {\n return JSON.stringify(tsconfig, undefined, 2);\n }\n\n private replaceFileExtToJs(filePath: string): string {\n if (!this.isFileSupported(filePath)) return filePath;\n const fileExtension = path.extname(filePath);\n // take into account mts, cts, mtsx, ctsx, etc.\n const replacement = fileExtension.replace(/([tj]sx?)$/, 'js');\n return filePath.replace(new RegExp(`${fileExtension}$`), replacement); // makes sure it's the last occurrence\n }\n\n version() {\n return this.tsModule.version;\n }\n}\n"],"mappings":";;;;;;AAIA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,M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AO,CAAC,YAAY,EAAE,IAAI,CAAC;IAC7D,OAAOjG,QAAQ,CAACiG,OAAO,CAAC,IAAIuC,MAAM,CAAE,GAAEH,aAAc,GAAE,CAAC,EAAEE,WAAW,CAAC,CAAC,CAAC;EACzE;EAEAE,OAAOA,CAAA,EAAG;IACR,OAAO,IAAI,CAACvJ,QAAQ,CAACuJ,OAAO;EAC9B;AACF;AAACC,OAAA,CAAA7J,kBAAA,GAAAA,kBAAA"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/typescript",
3
- "version": "1.0.184",
3
+ "version": "1.0.185",
4
4
  "homepage": "https://bit.cloud/teambit/typescript/typescript",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.typescript",
8
8
  "name": "typescript",
9
- "version": "1.0.184"
9
+ "version": "1.0.185"
10
10
  },
11
11
  "dependencies": {
12
12
  "lodash": "4.17.21",
@@ -19,24 +19,24 @@
19
19
  "get-tsconfig": "4.2.0",
20
20
  "@teambit/harmony": "0.4.6",
21
21
  "@teambit/bit-error": "0.0.404",
22
- "@teambit/compiler": "1.0.184",
22
+ "@teambit/compiler": "1.0.185",
23
23
  "@teambit/typescript.modules.ts-config-mutator": "0.0.82",
24
- "@teambit/builder": "1.0.184",
25
- "@teambit/isolator": "1.0.184",
26
- "@teambit/component": "1.0.184",
27
- "@teambit/dependency-resolver": "1.0.184",
28
- "@teambit/formatter": "1.0.184",
24
+ "@teambit/builder": "1.0.185",
25
+ "@teambit/isolator": "1.0.185",
26
+ "@teambit/component": "1.0.185",
27
+ "@teambit/dependency-resolver": "1.0.185",
28
+ "@teambit/formatter": "1.0.185",
29
29
  "@teambit/semantics.entities.semantic-schema": "0.0.68",
30
30
  "@teambit/ts-server": "0.0.55",
31
- "@teambit/aspect-loader": "1.0.184",
32
- "@teambit/envs": "1.0.184",
33
- "@teambit/logger": "0.0.945",
34
- "@teambit/workspace": "1.0.184",
35
- "@teambit/schema": "1.0.184",
36
- "@teambit/scope": "1.0.184",
37
- "@teambit/cli": "0.0.852",
38
- "@teambit/pkg": "1.0.184",
39
- "@teambit/watcher": "1.0.184"
31
+ "@teambit/aspect-loader": "1.0.185",
32
+ "@teambit/envs": "1.0.185",
33
+ "@teambit/logger": "0.0.946",
34
+ "@teambit/workspace": "1.0.185",
35
+ "@teambit/schema": "1.0.185",
36
+ "@teambit/scope": "1.0.185",
37
+ "@teambit/cli": "0.0.853",
38
+ "@teambit/pkg": "1.0.185",
39
+ "@teambit/watcher": "1.0.185"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/chai": "4.2.15",