@teambit/typescript 1.0.331 → 1.0.333

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,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="32" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.typescript/typescript@1.0.331" tests="32" failures="0" errors="0" skipped="0">
4
- <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.006"/>
3
+ <testsuite name="teambit.typescript/typescript@1.0.333" tests="32" failures="0" errors="0" skipped="0">
4
+ <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.007"/>
5
5
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with functionNamesTransformer" time="0.003"/>
6
6
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with importTransformer" time="0.002"/>
7
7
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with interfaceNamesTransformer" time="0.001"/>
@@ -11,23 +11,23 @@
11
11
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.002"/>
12
12
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with expressionStatementTransformer" time="0.002"/>
13
13
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with expressionStatementTransformer" time="0.002"/>
14
- <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with interfaceNamesTransformer" time="0.002"/>
14
+ <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with interfaceNamesTransformer" time="0.001"/>
15
15
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with importTransformer" time="0.001"/>
16
- <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with exportTransformer" time="0.001"/>
17
- <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with exportTransformer" time="0.001"/>
16
+ <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with exportTransformer" time="0.002"/>
17
+ <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with exportTransformer"/>
18
18
  <testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with exportTransformer" time="0.001"/>
19
19
  <testcase classname="dist/transform-source-file.spec.js" name="should return original source code if no transformations are applied" time="0.001"/>
20
- <testcase classname="dist/transform-source-file.spec.js" name="should handle multiple transformers" time="0.001"/>
20
+ <testcase classname="dist/transform-source-file.spec.js" name="should handle multiple transformers" time="0.002"/>
21
21
  <testcase classname="dist/typescript.parser.spec.js" name="should parse arrowFunctions" time="0.002"/>
22
- <testcase classname="dist/typescript.parser.spec.js" name="should parse function exports" time="0.001"/>
22
+ <testcase classname="dist/typescript.parser.spec.js" name="should parse function exports"/>
23
23
  <testcase classname="dist/typescript.parser.spec.js" name="should parse classes"/>
24
- <testcase classname="dist/typescript.parser.spec.js" name="should parse declarations" time="0.001"/>
24
+ <testcase classname="dist/typescript.parser.spec.js" name="should parse declarations"/>
25
25
  <testcase classname="dist/typescript.parser.spec.js" name="should parse renamed declarations"/>
26
26
  <testcase classname="dist/typescript.parser.spec.js" name="should parse re-exports" time="0.001"/>
27
27
  <testcase classname="dist/typescript.parser.spec.js" name="should parse re-exports with default"/>
28
28
  <testcase classname="dist/typescript.parser.spec.js" name="should parse renamed re-exports all"/>
29
- <testcase classname="dist/typescript.parser.spec.js" name="should parse default exports" time="0.001"/>
30
- <testcase classname="dist/typescript.parser.spec.js" name="should include staticProperties, when on arrowFunctions"/>
29
+ <testcase classname="dist/typescript.parser.spec.js" name="should parse default exports"/>
30
+ <testcase classname="dist/typescript.parser.spec.js" name="should include staticProperties, when on arrowFunctions" time="0.001"/>
31
31
  <testcase classname="dist/typescript.parser.spec.js" name="should include staticProperties, when on regular functions"/>
32
32
  <testcase classname="dist/typescript.parser.spec.js" name="should include staticProperties, when on classes"/>
33
33
  <testcase classname="dist/typescript.parser.spec.js" name="should parse all primitive values" time="0.002"/>
@@ -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={76629:(e,t,n)=>{Object.defineProperty(t,"S",{enumerable:!0,get:function(){return o.default}});var o=r(n(40895));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.typescript/aspect-docs/typescript@0.0.168",homepage:"https://bit.cloud/teambit/typescript/aspect-docs/typescript",exported:!0}},40895:(e,t,n)=>{var o={id:"teambit.typescript/aspect-docs/typescript@0.0.168",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)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(null,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||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;n[o]=e[o]}return n}p.__bit_component=o,s.__bit_component=o,a.__bit_component=o,c.__bit_component=o;var l={},d="wrapper";function m(e){var t=e.components,n=a(e,i);return(0,r.mdx)(d,s({},l,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},7852:(e,t,n)=>{var o={id:"teambit.typescript/typescript@1.0.331",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={};n.r(o),n.d(o,{compositions:()=>f,compositions_metadata:()=>h,overview:()=>y});var r={};n.r(r),n.d(r,{default:()=>u});var i=n(7852),p=(n(41594),n(5016));const s=TeambitMdxUiMdxScopeContext;var a=n(76629),c=["components"];function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},l.apply(null,arguments)}var d={},m="wrapper";function u(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={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,c);return(0,p.mdx)(m,l({},d,n,{components:t,mdxType:"MDXLayout"}),(0,p.mdx)(s.MDXScopeProvider,{components:{Typescript:a.S},mdxType:"MDXScopeProvider"},(0,p.mdx)(a.S,{mdxType:"Typescript"})))}u.isMDXComponent=!0;const f=[i],y=[r],h={compositions:[{displayName:"Logo",identifier:"Logo"}]};return 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={76629:(e,t,n)=>{Object.defineProperty(t,"S",{enumerable:!0,get:function(){return o.default}});var o=r(n(40895));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.typescript/aspect-docs/typescript@0.0.168",homepage:"https://bit.cloud/teambit/typescript/aspect-docs/typescript",exported:!0}},40895:(e,t,n)=>{var o={id:"teambit.typescript/aspect-docs/typescript@0.0.168",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)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(null,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||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;n[o]=e[o]}return n}p.__bit_component=o,s.__bit_component=o,a.__bit_component=o,c.__bit_component=o;var l={},d="wrapper";function m(e){var t=e.components,n=a(e,i);return(0,r.mdx)(d,s({},l,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},19294:(e,t,n)=>{var o={id:"teambit.typescript/typescript@1.0.333",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={};n.r(o),n.d(o,{compositions:()=>f,compositions_metadata:()=>h,overview:()=>y});var r={};n.r(r),n.d(r,{default:()=>u});var i=n(19294),p=(n(41594),n(5016));const s=TeambitMdxUiMdxScopeContext;var a=n(76629),c=["components"];function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},l.apply(null,arguments)}var d={},m="wrapper";function u(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={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,c);return(0,p.mdx)(m,l({},d,n,{components:t,mdxType:"MDXLayout"}),(0,p.mdx)(s.MDXScopeProvider,{components:{Typescript:a.S},mdxType:"MDXScopeProvider"},(0,p.mdx)(a.S,{mdxType:"Typescript"})))}u.isMDXComponent=!0;const f=[i],y=[r],h={compositions:[{displayName:"Logo",identifier:"Logo"}]};return o})()));
@@ -995,7 +995,7 @@
995
995
  "_legacy": {
996
996
  "scope": "teambit.typescript",
997
997
  "name": "typescript",
998
- "version": "1.0.331"
998
+ "version": "1.0.333"
999
999
  },
1000
1000
  "_scope": "teambit.typescript"
1001
1001
  }
@@ -1023,7 +1023,7 @@
1023
1023
  "componentId": {
1024
1024
  "scope": "teambit.typescript",
1025
1025
  "name": "typescript-compiler",
1026
- "version": "2.0.41"
1026
+ "version": "2.0.42"
1027
1027
  }
1028
1028
  }
1029
1029
  },
@@ -8284,7 +8284,7 @@
8284
8284
  "_legacy": {
8285
8285
  "scope": "teambit.typescript",
8286
8286
  "name": "typescript",
8287
- "version": "1.0.331"
8287
+ "version": "1.0.333"
8288
8288
  },
8289
8289
  "_scope": "teambit.typescript"
8290
8290
  }
@@ -14361,7 +14361,7 @@
14361
14361
  "componentId": {
14362
14362
  "scope": "teambit.typescript",
14363
14363
  "name": "typescript",
14364
- "version": "1.0.331"
14364
+ "version": "1.0.333"
14365
14365
  },
14366
14366
  "taggedModuleExports": []
14367
14367
  }
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.331/dist/typescript.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.331/dist/typescript.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.333/dist/typescript.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.333/dist/typescript.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.RemoveTypesTask = void 0;
7
- function _packageJsonFile() {
8
- const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/component/package-json-file"));
9
- _packageJsonFile = function () {
7
+ function _component() {
8
+ const data = require("@teambit/component.sources");
9
+ _component = function () {
10
10
  return data;
11
11
  };
12
12
  return data;
@@ -18,7 +18,6 @@ function _typescript() {
18
18
  };
19
19
  return data;
20
20
  }
21
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
22
21
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
23
22
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
24
23
  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); }
@@ -37,7 +36,7 @@ class RemoveTypesTask {
37
36
  }
38
37
  async removeTypesFromPkgJson(capsuleNetwork) {
39
38
  await Promise.all(capsuleNetwork.seedersCapsules.map(async capsule => {
40
- const packageJson = _packageJsonFile().default.loadFromCapsuleSync(capsule.path);
39
+ const packageJson = _component().PackageJsonFile.loadFromCapsuleSync(capsule.path);
41
40
  // the types['index.ts'] is needed only during the build to avoid errors when tsc finds the
42
41
  // same type once in the d.ts and once in the ts file.
43
42
  // the reason for `packageJson.packageJsonObject.main` is that .d.ts components don't have a main file and they do need the types prop
@@ -1 +1 @@
1
- {"version":3,"names":["_packageJsonFile","data","_interopRequireDefault","require","_typescript","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RemoveTypesTask","constructor","TypescriptAspect","id","execute","context","removeTypesFromPkgJson","capsuleNetwork","result","componentsResults","Promise","all","seedersCapsules","map","capsule","packageJson","PackageJsonFile","loadFromCapsuleSync","path","packageJsonObject","types","main","write","exports"],"sources":["remove-types-task.ts"],"sourcesContent":["import PackageJsonFile from '@teambit/legacy/dist/consumer/component/package-json-file';\nimport { Network } from '@teambit/isolator';\nimport { BuildContext, BuildTask, BuiltTaskResult } from '@teambit/builder';\nimport { TypescriptAspect } from './typescript.aspect';\n\nexport class RemoveTypesTask implements BuildTask {\n readonly aspectId = TypescriptAspect.id;\n readonly name = 'RemoveTypesProp';\n readonly description = 'remove the types prop from package.json';\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n await this.removeTypesFromPkgJson(context.capsuleNetwork);\n\n const result = {\n componentsResults: [],\n };\n\n return result;\n }\n private async removeTypesFromPkgJson(capsuleNetwork: Network) {\n await Promise.all(\n capsuleNetwork.seedersCapsules.map(async (capsule) => {\n const packageJson = PackageJsonFile.loadFromCapsuleSync(capsule.path);\n // the types['index.ts'] is needed only during the build to avoid errors when tsc finds the\n // same type once in the d.ts and once in the ts file.\n // the reason for `packageJson.packageJsonObject.main` is that .d.ts components don't have a main file and they do need the types prop\n if (packageJson.packageJsonObject.types && packageJson.packageJsonObject.main) {\n delete packageJson.packageJsonObject.types;\n await packageJson.write();\n }\n })\n );\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,iBAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,gBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;E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MG,OAAO,CAACC,GAAG,CACfJ,cAAc,CAACK,eAAe,CAACC,GAAG,CAAC,MAAOC,OAAO,IAAK;MACpD,MAAMC,WAAW,GAAGC,0BAAe,CAACC,mBAAmB,CAACH,OAAO,CAACI,IAAI,CAAC;MACrE;MACA;MACA;MACA,IAAIH,WAAW,CAACI,iBAAiB,CAACC,KAAK,IAAIL,WAAW,CAACI,iBAAiB,CAACE,IAAI,EAAE;QAC7E,OAAON,WAAW,CAACI,iBAAiB,CAACC,KAAK;QAC1C,MAAML,WAAW,CAACO,KAAK,CAAC,CAAC;MAC3B;IACF,CAAC,CACH,CAAC;EACH;AACF;AAACC,OAAA,CAAAvB,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"names":["_component","data","require","_typescript","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RemoveTypesTask","constructor","TypescriptAspect","id","execute","context","removeTypesFromPkgJson","capsuleNetwork","result","componentsResults","Promise","all","seedersCapsules","map","capsule","packageJson","PackageJsonFile","loadFromCapsuleSync","path","packageJsonObject","types","main","write","exports"],"sources":["remove-types-task.ts"],"sourcesContent":["import { PackageJsonFile } from '@teambit/component.sources';\nimport { Network } from '@teambit/isolator';\nimport { BuildContext, BuildTask, BuiltTaskResult } from '@teambit/builder';\nimport { TypescriptAspect } from './typescript.aspect';\n\nexport class RemoveTypesTask implements BuildTask {\n readonly aspectId = TypescriptAspect.id;\n readonly name = 'RemoveTypesProp';\n readonly description = 'remove the types prop from package.json';\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n await this.removeTypesFromPkgJson(context.capsuleNetwork);\n\n const result = {\n componentsResults: [],\n };\n\n return result;\n }\n private async removeTypesFromPkgJson(capsuleNetwork: Network) {\n await Promise.all(\n capsuleNetwork.seedersCapsules.map(async (capsule) => {\n const packageJson = PackageJsonFile.loadFromCapsuleSync(capsule.path);\n // the types['index.ts'] is needed only during the build to avoid errors when tsc finds the\n // same type once in the d.ts and once in the ts file.\n // the reason for `packageJson.packageJsonObject.main` is that .d.ts components don't have a main file and they do need the types prop\n if (packageJson.packageJsonObject.types && packageJson.packageJsonObject.main) {\n delete packageJson.packageJsonObject.types;\n await packageJson.write();\n }\n })\n );\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAuD,SAAAG,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAEhD,MAAMgB,eAAe,CAAsB;EAAAC,YAAA;IAAApB,eAAA,mBAC5BqB,8BAAgB,CAACC,EAAE;IAAAtB,eAAA,eACvB,iBAAiB;IAAAA,eAAA,sBACV,yCAAyC;EAAA;EAChE,MAAMuB,OAAOA,CAACC,OAAqB,EAA4B;IAC7D,MAAM,IAAI,CAACC,sBAAsB,CAACD,OAAO,CAACE,cAAc,CAAC;IAEzD,MAAMC,MAAM,GAAG;MACbC,iBAAiB,EAAE;IACrB,CAAC;IAED,OAAOD,MAAM;EACf;EACA,MAAcF,sBAAsBA,CAACC,cAAuB,EAAE;IAC5D,MAAMG,OAAO,CAACC,GAAG,CACfJ,cAAc,CAACK,eAAe,CAACC,GAAG,CAAC,MAAOC,OAAO,IAAK;MACpD,MAAMC,WAAW,GAAGC,4BAAe,CAACC,mBAAmB,CAACH,OAAO,CAACI,IAAI,CAAC;MACrE;MACA;MACA;MACA,IAAIH,WAAW,CAACI,iBAAiB,CAACC,KAAK,IAAIL,WAAW,CAACI,iBAAiB,CAACE,IAAI,EAAE;QAC7E,OAAON,WAAW,CAACI,iBAAiB,CAACC,KAAK;QAC1C,MAAML,WAAW,CAACO,KAAK,CAAC,CAAC;MAC3B;IACF,CAAC,CACH,CAAC;EACH;AACF;AAACC,OAAA,CAAAvB,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -69,7 +69,7 @@ export declare class SchemaExtractorContext {
69
69
  visitTypeDefinition(): void;
70
70
  private getPathWithoutExtension;
71
71
  private isIndexFile;
72
- findFileInComponent(filePath: string): import("@teambit/legacy/dist/consumer/component/sources").AbstractVinyl | undefined;
72
+ findFileInComponent(filePath: string): import("@teambit/component.sources").AbstractVinyl | undefined;
73
73
  private parsePackageNameFromPath;
74
74
  /**
75
75
  * return the file if part of the component.
@@ -4,7 +4,7 @@ import type { Workspace } from '@teambit/workspace';
4
4
  import { DependencyResolverMain } from '@teambit/dependency-resolver';
5
5
  import { SchemaNode, APISchema, ModuleSchema } from '@teambit/semantics.entities.semantic-schema';
6
6
  import { Component } from '@teambit/component';
7
- import { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';
7
+ import { AbstractVinyl } from '@teambit/component.sources';
8
8
  import { EnvContext } from '@teambit/envs';
9
9
  import { Logger } from '@teambit/logger';
10
10
  import { AspectLoaderMain } from '@teambit/aspect-loader';
@@ -1 +1 @@
1
- {"version":3,"names":["_typescript","data","_interopRequireWildcard","require","_getTsconfig","_semanticsEntities","_aspectLoader","_pMapSeries","_interopRequireDefault","_lodash","_exceptions","_schemaExtractorContext","_identifierList","_typescript2","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","TypeScriptExtractor","constructor","tsconfig","schemaTransformers","apiTransformers","tsMain","rootTsserverPath","rootContextPath","depResolver","workspace","scope","aspectLoader","logger","undefined","parseSourceFile","file","sourceFile","ts","createSourceFile","path","contents","toString","ScriptTarget","Latest","extract","component","options","tsserverPath","contextPath","tsserver","getTsServer","mainFile","compatibleExts","internalFiles","skipInternals","filesystem","files","filter","includes","extname","allFiles","context","createContext","formatter","pMapSeries","ast","identifiers","computeIdentifiers","cacheKey","getIdentifierKeyForNode","setIdentifiers","IdentifierList","mainAst","moduleSchema","computeSchema","flatExportsRecursively","apiScheme","internals","computeInternalModules","location","getLocation","APISchema","id","length","compact","Promise","all","internalIdentifiers","entries","map","filePath","find","internalFile","fileAst","dispose","killTsServer","node","transformer","getTransformer","getIdentifiers","debug","TransformerNotFound","componentDeps","getComponentDeps","SchemaExtractorContext","deps","getDependencies","getComponentDependencies","getTsserverClient","initTsserverClient","UnImplementedSchema","getText","SyntaxKind","kind","schemaNode","transform","transformAPI","schema","apiTransformer","getAPITransformer","transformedApi","IgnoredSchema","getComponentIDByPath","coreAspectIds","getCoreAspectIds","matchingCoreAspect","c","getCoreAspectPackageName","resolveComponentId","getComponentIdByPath","singleTransformer","predicate","from","getTsconfig","config","compilerOptions","getAspect","TypescriptAspect","aspectLoaderMain","AspectLoaderAspect","rootPath","schemaTransformersFromOptions","schemaTransformersFromAspect","flatten","Array","schemaTransformerSlot","values","apiTransformersFromOptions","apiTransformersFromAspect","apiTransformerSlot","createLogger","name","exports"],"sources":["typescript.extractor.ts"],"sourcesContent":["import ts, { Node, SourceFile, SyntaxKind } from 'typescript';\nimport { getTsconfig } from 'get-tsconfig';\nimport { SchemaExtractor, SchemaExtractorOptions } from '@teambit/schema';\nimport { TsserverClient } from '@teambit/ts-server';\nimport type { Workspace } from '@teambit/workspace';\nimport { ComponentDependency, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport {\n SchemaNode,\n APISchema,\n ModuleSchema,\n UnImplementedSchema,\n IgnoredSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport { Component } from '@teambit/component';\nimport { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';\nimport { EnvContext } from '@teambit/envs';\nimport { Formatter } from '@teambit/formatter';\nimport { Logger } from '@teambit/logger';\nimport { AspectLoaderAspect, AspectLoaderMain, getCoreAspectPackageName } from '@teambit/aspect-loader';\nimport { ScopeMain } from '@teambit/scope';\nimport pMapSeries from 'p-map-series';\nimport { compact, flatten } from 'lodash';\nimport { TypescriptMain } from './typescript.main.runtime';\nimport { TransformerNotFound } from './exceptions';\nimport { SchemaExtractorContext } from './schema-extractor-context';\nimport { Identifier } from './identifier';\nimport { IdentifierList } from './identifier-list';\nimport { ExtractorOptions } from './extractor-options';\nimport { TypescriptAspect } from './typescript.aspect';\nimport { SchemaNodeTransformer, SchemaTransformer } from './schema-transformer';\n\nexport class TypeScriptExtractor implements SchemaExtractor {\n constructor(\n private tsconfig: any,\n private schemaTransformers: SchemaTransformer[],\n private apiTransformers: SchemaNodeTransformer[],\n private tsMain: TypescriptMain,\n private rootTsserverPath: string,\n private rootContextPath: string,\n private depResolver: DependencyResolverMain,\n private workspace: Workspace | undefined,\n private scope: ScopeMain,\n private aspectLoader: AspectLoaderMain,\n private logger: Logger\n ) {}\n\n parseSourceFile(file: AbstractVinyl): SourceFile {\n const sourceFile = ts.createSourceFile(\n file.path,\n file.contents.toString('utf8'),\n ts.ScriptTarget.Latest,\n true\n /** don't pass the scriptKind, it'll be determined automatically by typescript by the filepath */\n );\n // leave this commented out, it's helpful when there are issues with ASTs. consider throwing in this case.\n // console.log(\"sourceFile Errors\", file.path, sourceFile.parseDiagnostics);\n return sourceFile;\n }\n\n /**\n * extract a component schema.\n */\n async extract(component: Component, options: SchemaExtractorOptions = {}): Promise<APISchema> {\n // override the rootTsserverPath and rootContextPath if passed via options\n if (options.tsserverPath) {\n this.rootTsserverPath = options.tsserverPath;\n }\n if (options.contextPath) {\n this.rootContextPath = options.contextPath;\n }\n const tsserver = await this.getTsServer();\n const mainFile = component.mainFile;\n const compatibleExts = ['.tsx', '.ts'];\n const internalFiles = options.skipInternals\n ? []\n : component.filesystem.files.filter(\n (file) => compatibleExts.includes(file.extname) && file.path !== mainFile.path\n );\n const allFiles = [mainFile, ...internalFiles];\n\n const context = await this.createContext(tsserver, component, options.formatter);\n\n await pMapSeries(allFiles, async (file) => {\n const ast = this.parseSourceFile(file);\n const identifiers = await this.computeIdentifiers(ast, context);\n const cacheKey = context.getIdentifierKeyForNode(ast);\n context.setIdentifiers(cacheKey, new IdentifierList(identifiers));\n });\n\n const mainAst = this.parseSourceFile(mainFile);\n const moduleSchema = (await this.computeSchema(mainAst, context)) as ModuleSchema;\n moduleSchema.flatExportsRecursively();\n const apiScheme = moduleSchema;\n const internals = await this.computeInternalModules(context, internalFiles);\n\n const location = context.getLocation(mainAst);\n\n return new APISchema(location, apiScheme, internals, component.id as any);\n }\n\n async computeInternalModules(context: SchemaExtractorContext, internalFiles: AbstractVinyl[]) {\n if (internalFiles.length === 0) return [];\n\n const internals = compact(\n await Promise.all(\n [...context.internalIdentifiers.entries()].map(async ([filePath]) => {\n const file = internalFiles.find((internalFile) => internalFile.path === filePath);\n if (!file) return undefined;\n const fileAst = this.parseSourceFile(file);\n const moduleSchema = (await this.computeSchema(fileAst, context)) as ModuleSchema;\n moduleSchema.flatExportsRecursively();\n return moduleSchema;\n })\n )\n );\n return internals;\n }\n\n dispose() {\n if (!this.tsserver) return;\n this.tsserver.killTsServer();\n }\n\n async computeIdentifiers(node: Node, context: SchemaExtractorContext) {\n const transformer = this.getTransformer(node, context);\n let identifiers: Identifier[] = [];\n if (!transformer || !transformer.getIdentifiers) {\n this.logger.debug(new TransformerNotFound(node, context.component, context.getLocation(node)).toString());\n } else {\n identifiers = await transformer.getIdentifiers(node, context);\n }\n return identifiers;\n }\n\n private async createContext(\n tsserver: TsserverClient,\n component: Component,\n formatter?: Formatter\n ): Promise<SchemaExtractorContext> {\n const componentDeps = await this.getComponentDeps(component);\n return new SchemaExtractorContext(\n tsserver,\n component,\n this,\n componentDeps,\n this.rootContextPath,\n this.workspace?.path || this.scope.path,\n formatter\n );\n }\n\n private async getComponentDeps(component: Component): Promise<ComponentDependency[]> {\n const deps = this.depResolver.getDependencies(component);\n const componentDeps = deps.getComponentDependencies();\n return componentDeps;\n }\n\n private tsserver: TsserverClient | undefined = undefined;\n\n private async getTsServer() {\n if (!this.tsserver) {\n const tsserver = this.tsMain.getTsserverClient();\n if (tsserver) {\n this.tsserver = tsserver;\n return tsserver;\n }\n\n this.tsserver = await this.tsMain.initTsserverClient(this.rootTsserverPath);\n return this.tsserver;\n }\n\n return this.tsserver;\n }\n\n async computeSchema(node: Node, context: SchemaExtractorContext): Promise<SchemaNode> {\n const transformer = this.getTransformer(node, context);\n\n if (!transformer) {\n return new UnImplementedSchema(context.getLocation(node), node.getText(), SyntaxKind[node.kind]);\n }\n\n const schemaNode = await transformer.transform(node, context);\n\n return this.transformAPI(schemaNode, context);\n }\n\n async transformAPI(schema: SchemaNode, context: SchemaExtractorContext): Promise<SchemaNode> {\n const apiTransformer = this.getAPITransformer(schema);\n const transformedApi = apiTransformer ? await apiTransformer.transform(schema, context) : schema;\n if (!transformedApi) {\n return new IgnoredSchema(schema);\n }\n return transformedApi;\n }\n\n async getComponentIDByPath(file: string) {\n const coreAspectIds = this.aspectLoader.getCoreAspectIds();\n const matchingCoreAspect = coreAspectIds.find((c) => file === getCoreAspectPackageName(c));\n\n if (matchingCoreAspect) {\n return (this.workspace || this.scope).resolveComponentId(matchingCoreAspect);\n }\n\n if (this.workspace) {\n return this.workspace.getComponentIdByPath(file);\n }\n return null;\n }\n\n /**\n * select the correct transformer for a node.\n */\n getTransformer(node: Node, context: SchemaExtractorContext) {\n const transformer = this.schemaTransformers.find((singleTransformer) => {\n return singleTransformer.predicate(node);\n });\n if (!transformer) {\n this.logger.debug(new TransformerNotFound(node, context.component, context.getLocation(node)).toString());\n return undefined;\n }\n\n return transformer;\n }\n\n getAPITransformer(node: SchemaNode) {\n const transformer = this.apiTransformers.find((singleTransformer) => {\n return singleTransformer.predicate(node);\n });\n if (!transformer) {\n return undefined;\n }\n\n return transformer;\n }\n\n static from(options: ExtractorOptions) {\n return (context: EnvContext) => {\n const tsconfig = getTsconfig(options.tsconfig)?.config || { compilerOptions: options.compilerOptions };\n const tsMain = context.getAspect<TypescriptMain>(TypescriptAspect.id);\n const aspectLoaderMain = context.getAspect<AspectLoaderMain>(AspectLoaderAspect.id);\n // When loading the env from a scope you don't have a workspace\n const rootPath = tsMain.workspace?.path || tsMain.scope.path || '';\n\n const schemaTransformersFromOptions = options.schemaTransformers || [];\n const schemaTransformersFromAspect = flatten(Array.from(tsMain.schemaTransformerSlot.values()));\n\n const apiTransformersFromOptions = options.apiTransformers || [];\n const apiTransformersFromAspect = flatten(Array.from(tsMain.apiTransformerSlot.values()));\n\n const schemaTransformers = [...schemaTransformersFromOptions, ...schemaTransformersFromAspect];\n const apiTransformers = [...apiTransformersFromOptions, ...apiTransformersFromAspect];\n\n return new TypeScriptExtractor(\n tsconfig,\n schemaTransformers,\n apiTransformers,\n tsMain,\n rootPath,\n rootPath,\n tsMain.depResolver,\n tsMain.workspace,\n tsMain.scope,\n aspectL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M,CAACwH,qBAAqB,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC;MAE/F,MAAMC,0BAA0B,GAAGrG,OAAO,CAACtB,eAAe,IAAI,EAAE;MAChE,MAAM4H,yBAAyB,GAAG,IAAAL,iBAAO,EAACC,KAAK,CAACZ,IAAI,CAAC3G,MAAM,CAAC4H,kBAAkB,CAACH,MAAM,CAAC,CAAC,CAAC,CAAC;MAEzF,MAAM3H,kBAAkB,GAAG,CAAC,GAAGsH,6BAA6B,EAAE,GAAGC,4BAA4B,CAAC;MAC9F,MAAMtH,eAAe,GAAG,CAAC,GAAG2H,0BAA0B,EAAE,GAAGC,yBAAyB,CAAC;MAErF,OAAO,IAAIhI,mBAAmB,CAC5BE,QAAQ,EACRC,kBAAkB,EAClBC,eAAe,EACfC,MAAM,EACNmH,QAAQ,EACRA,QAAQ,EACRnH,MAAM,CAACG,WAAW,EAClBH,MAAM,CAACI,SAAS,EAChBJ,MAAM,CAACK,KAAK,EACZ4G,gBAAgB,EAChB7E,OAAO,CAACyF,YAAY,CAACxG,OAAO,CAACyG,IAAI,CACnC,CAAC;IACH,CAAC;EACH;AACF;AAACC,OAAA,CAAApI,mBAAA,GAAAA,mBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_typescript","data","_interopRequireWildcard","require","_getTsconfig","_semanticsEntities","_aspectLoader","_pMapSeries","_interopRequireDefault","_lodash","_exceptions","_schemaExtractorContext","_identifierList","_typescript2","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","TypeScriptExtractor","constructor","tsconfig","schemaTransformers","apiTransformers","tsMain","rootTsserverPath","rootContextPath","depResolver","workspace","scope","aspectLoader","logger","undefined","parseSourceFile","file","sourceFile","ts","createSourceFile","path","contents","toString","ScriptTarget","Latest","extract","component","options","tsserverPath","contextPath","tsserver","getTsServer","mainFile","compatibleExts","internalFiles","skipInternals","filesystem","files","filter","includes","extname","allFiles","context","createContext","formatter","pMapSeries","ast","identifiers","computeIdentifiers","cacheKey","getIdentifierKeyForNode","setIdentifiers","IdentifierList","mainAst","moduleSchema","computeSchema","flatExportsRecursively","apiScheme","internals","computeInternalModules","location","getLocation","APISchema","id","length","compact","Promise","all","internalIdentifiers","entries","map","filePath","find","internalFile","fileAst","dispose","killTsServer","node","transformer","getTransformer","getIdentifiers","debug","TransformerNotFound","componentDeps","getComponentDeps","SchemaExtractorContext","deps","getDependencies","getComponentDependencies","getTsserverClient","initTsserverClient","UnImplementedSchema","getText","SyntaxKind","kind","schemaNode","transform","transformAPI","schema","apiTransformer","getAPITransformer","transformedApi","IgnoredSchema","getComponentIDByPath","coreAspectIds","getCoreAspectIds","matchingCoreAspect","c","getCoreAspectPackageName","resolveComponentId","getComponentIdByPath","singleTransformer","predicate","from","getTsconfig","config","compilerOptions","getAspect","TypescriptAspect","aspectLoaderMain","AspectLoaderAspect","rootPath","schemaTransformersFromOptions","schemaTransformersFromAspect","flatten","Array","schemaTransformerSlot","values","apiTransformersFromOptions","apiTransformersFromAspect","apiTransformerSlot","createLogger","name","exports"],"sources":["typescript.extractor.ts"],"sourcesContent":["import ts, { Node, SourceFile, SyntaxKind } from 'typescript';\nimport { getTsconfig } from 'get-tsconfig';\nimport { SchemaExtractor, SchemaExtractorOptions } from '@teambit/schema';\nimport { TsserverClient } from '@teambit/ts-server';\nimport type { Workspace } from '@teambit/workspace';\nimport { ComponentDependency, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport {\n SchemaNode,\n APISchema,\n ModuleSchema,\n UnImplementedSchema,\n IgnoredSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport { Component } from '@teambit/component';\nimport { AbstractVinyl } from '@teambit/component.sources';\nimport { EnvContext } from '@teambit/envs';\nimport { Formatter } from '@teambit/formatter';\nimport { Logger } from '@teambit/logger';\nimport { AspectLoaderAspect, AspectLoaderMain, getCoreAspectPackageName } from '@teambit/aspect-loader';\nimport { ScopeMain } from '@teambit/scope';\nimport pMapSeries from 'p-map-series';\nimport { compact, flatten } from 'lodash';\nimport { TypescriptMain } from './typescript.main.runtime';\nimport { TransformerNotFound } from './exceptions';\nimport { SchemaExtractorContext } from './schema-extractor-context';\nimport { Identifier } from './identifier';\nimport { IdentifierList } from './identifier-list';\nimport { ExtractorOptions } from './extractor-options';\nimport { TypescriptAspect } from './typescript.aspect';\nimport { SchemaNodeTransformer, SchemaTransformer } from './schema-transformer';\n\nexport class TypeScriptExtractor implements SchemaExtractor {\n constructor(\n private tsconfig: any,\n private schemaTransformers: SchemaTransformer[],\n private apiTransformers: SchemaNodeTransformer[],\n private tsMain: TypescriptMain,\n private rootTsserverPath: string,\n private rootContextPath: string,\n private depResolver: DependencyResolverMain,\n private workspace: Workspace | undefined,\n private scope: ScopeMain,\n private aspectLoader: AspectLoaderMain,\n private logger: Logger\n ) {}\n\n parseSourceFile(file: AbstractVinyl): SourceFile {\n const sourceFile = ts.createSourceFile(\n file.path,\n file.contents.toString('utf8'),\n ts.ScriptTarget.Latest,\n true\n /** don't pass the scriptKind, it'll be determined automatically by typescript by the filepath */\n );\n // leave this commented out, it's helpful when there are issues with ASTs. consider throwing in this case.\n // console.log(\"sourceFile Errors\", file.path, sourceFile.parseDiagnostics);\n return sourceFile;\n }\n\n /**\n * extract a component schema.\n */\n async extract(component: Component, options: SchemaExtractorOptions = {}): Promise<APISchema> {\n // override the rootTsserverPath and rootContextPath if passed via options\n if (options.tsserverPath) {\n this.rootTsserverPath = options.tsserverPath;\n }\n if (options.contextPath) {\n this.rootContextPath = options.contextPath;\n }\n const tsserver = await this.getTsServer();\n const mainFile = component.mainFile;\n const compatibleExts = ['.tsx', '.ts'];\n const internalFiles = options.skipInternals\n ? []\n : component.filesystem.files.filter(\n (file) => compatibleExts.includes(file.extname) && file.path !== mainFile.path\n );\n const allFiles = [mainFile, ...internalFiles];\n\n const context = await this.createContext(tsserver, component, options.formatter);\n\n await pMapSeries(allFiles, async (file) => {\n const ast = this.parseSourceFile(file);\n const identifiers = await this.computeIdentifiers(ast, context);\n const cacheKey = context.getIdentifierKeyForNode(ast);\n context.setIdentifiers(cacheKey, new IdentifierList(identifiers));\n });\n\n const mainAst = this.parseSourceFile(mainFile);\n const moduleSchema = (await this.computeSchema(mainAst, context)) as ModuleSchema;\n moduleSchema.flatExportsRecursively();\n const apiScheme = moduleSchema;\n const internals = await this.computeInternalModules(context, internalFiles);\n\n const location = context.getLocation(mainAst);\n\n return new APISchema(location, apiScheme, internals, component.id as any);\n }\n\n async computeInternalModules(context: SchemaExtractorContext, internalFiles: AbstractVinyl[]) {\n if (internalFiles.length === 0) return [];\n\n const internals = compact(\n await Promise.all(\n [...context.internalIdentifiers.entries()].map(async ([filePath]) => {\n const file = internalFiles.find((internalFile) => internalFile.path === filePath);\n if (!file) return undefined;\n const fileAst = this.parseSourceFile(file);\n const moduleSchema = (await this.computeSchema(fileAst, context)) as ModuleSchema;\n moduleSchema.flatExportsRecursively();\n return moduleSchema;\n })\n )\n );\n return internals;\n }\n\n dispose() {\n if (!this.tsserver) return;\n this.tsserver.killTsServer();\n }\n\n async computeIdentifiers(node: Node, context: SchemaExtractorContext) {\n const transformer = this.getTransformer(node, context);\n let identifiers: Identifier[] = [];\n if (!transformer || !transformer.getIdentifiers) {\n this.logger.debug(new TransformerNotFound(node, context.component, context.getLocation(node)).toString());\n } else {\n identifiers = await transformer.getIdentifiers(node, context);\n }\n return identifiers;\n }\n\n private async createContext(\n tsserver: TsserverClient,\n component: Component,\n formatter?: Formatter\n ): Promise<SchemaExtractorContext> {\n const componentDeps = await this.getComponentDeps(component);\n return new SchemaExtractorContext(\n tsserver,\n component,\n this,\n componentDeps,\n this.rootContextPath,\n this.workspace?.path || this.scope.path,\n formatter\n );\n }\n\n private async getComponentDeps(component: Component): Promise<ComponentDependency[]> {\n const deps = this.depResolver.getDependencies(component);\n const componentDeps = deps.getComponentDependencies();\n return componentDeps;\n }\n\n private tsserver: TsserverClient | undefined = undefined;\n\n private async getTsServer() {\n if (!this.tsserver) {\n const tsserver = this.tsMain.getTsserverClient();\n if (tsserver) {\n this.tsserver = tsserver;\n return tsserver;\n }\n\n this.tsserver = await this.tsMain.initTsserverClient(this.rootTsserverPath);\n return this.tsserver;\n }\n\n return this.tsserver;\n }\n\n async computeSchema(node: Node, context: SchemaExtractorContext): Promise<SchemaNode> {\n const transformer = this.getTransformer(node, context);\n\n if (!transformer) {\n return new UnImplementedSchema(context.getLocation(node), node.getText(), SyntaxKind[node.kind]);\n }\n\n const schemaNode = await transformer.transform(node, context);\n\n return this.transformAPI(schemaNode, context);\n }\n\n async transformAPI(schema: SchemaNode, context: SchemaExtractorContext): Promise<SchemaNode> {\n const apiTransformer = this.getAPITransformer(schema);\n const transformedApi = apiTransformer ? await apiTransformer.transform(schema, context) : schema;\n if (!transformedApi) {\n return new IgnoredSchema(schema);\n }\n return transformedApi;\n }\n\n async getComponentIDByPath(file: string) {\n const coreAspectIds = this.aspectLoader.getCoreAspectIds();\n const matchingCoreAspect = coreAspectIds.find((c) => file === getCoreAspectPackageName(c));\n\n if (matchingCoreAspect) {\n return (this.workspace || this.scope).resolveComponentId(matchingCoreAspect);\n }\n\n if (this.workspace) {\n return this.workspace.getComponentIdByPath(file);\n }\n return null;\n }\n\n /**\n * select the correct transformer for a node.\n */\n getTransformer(node: Node, context: SchemaExtractorContext) {\n const transformer = this.schemaTransformers.find((singleTransformer) => {\n return singleTransformer.predicate(node);\n });\n if (!transformer) {\n this.logger.debug(new TransformerNotFound(node, context.component, context.getLocation(node)).toString());\n return undefined;\n }\n\n return transformer;\n }\n\n getAPITransformer(node: SchemaNode) {\n const transformer = this.apiTransformers.find((singleTransformer) => {\n return singleTransformer.predicate(node);\n });\n if (!transformer) {\n return undefined;\n }\n\n return transformer;\n }\n\n static from(options: ExtractorOptions) {\n return (context: EnvContext) => {\n const tsconfig = getTsconfig(options.tsconfig)?.config || { compilerOptions: options.compilerOptions };\n const tsMain = context.getAspect<TypescriptMain>(TypescriptAspect.id);\n const aspectLoaderMain = context.getAspect<AspectLoaderMain>(AspectLoaderAspect.id);\n // When loading the env from a scope you don't have a workspace\n const rootPath = tsMain.workspace?.path || tsMain.scope.path || '';\n\n const schemaTransformersFromOptions = options.schemaTransformers || [];\n const schemaTransformersFromAspect = flatten(Array.from(tsMain.schemaTransformerSlot.values()));\n\n const apiTransformersFromOptions = options.apiTransformers || [];\n const apiTransformersFromAspect = flatten(Array.from(tsMain.apiTransformerSlot.values()));\n\n const schemaTransformers = [...schemaTransformersFromOptions, ...schemaTransformersFromAspect];\n const apiTransformers = [...apiTransformersFromOptions, ...apiTransformersFromAspect];\n\n return new TypeScriptExtractor(\n tsconfig,\n schemaTransformers,\n apiTransformers,\n tsMain,\n rootPath,\n rootPath,\n tsMain.depResolver,\n tsMain.workspace,\n tsMain.scope,\n aspectLoaderMain,\n context.createLogger(options.name)\n );\n };\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,aAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,YAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAI,mBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,kBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAYA,SAAAK,cAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,YAAA;EAAA,MAAAN,IAAA,GAAAO,sBAAA,CAAAL,OA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,OAAO,CAACyG,IAAI,CACnC,CAAC;IACH,CAAC;EACH;AACF;AAACC,OAAA,CAAApI,mBAAA,GAAAA,mBAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/typescript",
3
- "version": "1.0.331",
3
+ "version": "1.0.333",
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.331"
9
+ "version": "1.0.333"
10
10
  },
11
11
  "dependencies": {
12
12
  "lodash": "4.17.21",
@@ -16,27 +16,28 @@
16
16
  "get-tsconfig": "4.2.0",
17
17
  "fs-extra": "10.0.0",
18
18
  "chalk": "2.4.2",
19
- "@teambit/typescript.typescript-compiler": "2.0.41",
19
+ "@teambit/typescript.typescript-compiler": "2.0.42",
20
20
  "@teambit/harmony": "0.4.6",
21
- "@teambit/compiler": "1.0.331",
21
+ "@teambit/compiler": "1.0.333",
22
22
  "@teambit/typescript.modules.ts-config-mutator": "0.0.83",
23
- "@teambit/builder": "1.0.331",
24
- "@teambit/isolator": "1.0.331",
25
- "@teambit/component": "1.0.331",
26
- "@teambit/dependency-resolver": "1.0.331",
27
- "@teambit/formatter": "1.0.331",
23
+ "@teambit/builder": "1.0.333",
24
+ "@teambit/component.sources": "0.0.2",
25
+ "@teambit/isolator": "1.0.333",
26
+ "@teambit/component": "1.0.333",
27
+ "@teambit/dependency-resolver": "1.0.333",
28
+ "@teambit/formatter": "1.0.333",
28
29
  "@teambit/legacy.utils": "0.0.3",
29
30
  "@teambit/semantics.entities.semantic-schema": "0.0.70",
30
31
  "@teambit/ts-server": "0.0.56",
31
- "@teambit/aspect-loader": "1.0.331",
32
- "@teambit/envs": "1.0.331",
33
- "@teambit/logger": "0.0.1001",
34
- "@teambit/schema": "1.0.331",
35
- "@teambit/scope": "1.0.331",
36
- "@teambit/workspace": "1.0.331",
37
- "@teambit/cli": "0.0.908",
38
- "@teambit/pkg": "1.0.331",
39
- "@teambit/watcher": "1.0.331"
32
+ "@teambit/aspect-loader": "1.0.333",
33
+ "@teambit/envs": "1.0.333",
34
+ "@teambit/logger": "0.0.1003",
35
+ "@teambit/schema": "1.0.333",
36
+ "@teambit/scope": "1.0.333",
37
+ "@teambit/workspace": "1.0.333",
38
+ "@teambit/cli": "0.0.910",
39
+ "@teambit/pkg": "1.0.333",
40
+ "@teambit/watcher": "1.0.333"
40
41
  },
41
42
  "devDependencies": {
42
43
  "@types/lodash": "4.14.165",