@teambit/typescript 1.0.281 → 1.0.283
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.
- package/artifacts/__bit_junit.xml +12 -12
- package/artifacts/preview/teambit_typescript_typescript-preview.js +1 -1
- package/artifacts/schema.json +3 -3
- package/dist/cmds/check-types.cmd.js +2 -2
- package/dist/cmds/check-types.cmd.js.map +1 -1
- package/dist/exceptions/transformer-not-found.js +1 -1
- package/dist/exceptions/transformer-not-found.js.map +1 -1
- package/dist/export-identifier.js +1 -1
- package/dist/export-identifier.js.map +1 -1
- package/dist/{preview-1716434516635.js → preview-1716607230882.js} +2 -2
- package/dist/remove-types-task.js +2 -2
- package/dist/remove-types-task.js.map +1 -1
- package/dist/schema-extractor-context.js +2 -2
- package/dist/schema-extractor-context.js.map +1 -1
- package/dist/schema-transformer.plugin.js +1 -1
- package/dist/sourceFileTransformers/class.js +1 -1
- package/dist/sourceFileTransformers/class.js.map +1 -1
- package/dist/sourceFileTransformers/empty-line-encoder.js +2 -2
- package/dist/sourceFileTransformers/empty-line-encoder.js.map +1 -1
- package/dist/sourceFileTransformers/export.js +1 -1
- package/dist/sourceFileTransformers/export.js.map +1 -1
- package/dist/sourceFileTransformers/expression-statement.js +1 -1
- package/dist/sourceFileTransformers/expression-statement.js.map +1 -1
- package/dist/sourceFileTransformers/function.js +1 -1
- package/dist/sourceFileTransformers/function.js.map +1 -1
- package/dist/sourceFileTransformers/import.js +1 -1
- package/dist/sourceFileTransformers/import.js.map +1 -1
- package/dist/sourceFileTransformers/interface.js +1 -1
- package/dist/sourceFileTransformers/interface.js.map +1 -1
- package/dist/sourceFileTransformers/replaceName.js.map +1 -1
- package/dist/sourceFileTransformers/transform.js +1 -1
- package/dist/sourceFileTransformers/transform.js.map +1 -1
- package/dist/sourceFileTransformers/type-reference.js +1 -1
- package/dist/sourceFileTransformers/type-reference.js.map +1 -1
- package/dist/sourceFileTransformers/typeAlias.js +1 -1
- package/dist/sourceFileTransformers/typeAlias.js.map +1 -1
- package/dist/sourceFileTransformers/variable.js +1 -1
- package/dist/sourceFileTransformers/variable.js.map +1 -1
- package/dist/transform-source-file.spec.js +1 -1
- package/dist/transform-source-file.spec.js.map +1 -1
- package/dist/transformers/array-literal-expression.js +1 -1
- package/dist/transformers/array-literal-expression.js.map +1 -1
- package/dist/transformers/array-type.js +1 -1
- package/dist/transformers/array-type.js.map +1 -1
- package/dist/transformers/binding-element.js +1 -1
- package/dist/transformers/binding-element.js.map +1 -1
- package/dist/transformers/class-declaration.js +2 -2
- package/dist/transformers/class-declaration.js.map +1 -1
- package/dist/transformers/constructor.js +1 -1
- package/dist/transformers/constructor.js.map +1 -1
- package/dist/transformers/decorator.js +1 -1
- package/dist/transformers/decorator.js.map +1 -1
- package/dist/transformers/enum-declaration.js +1 -1
- package/dist/transformers/enum-declaration.js.map +1 -1
- package/dist/transformers/export-declaration.js.map +1 -1
- package/dist/transformers/expression-statement.js +1 -1
- package/dist/transformers/expression-statement.js.map +1 -1
- package/dist/transformers/function-like.js +1 -1
- package/dist/transformers/function-like.js.map +1 -1
- package/dist/transformers/get-accessor.js +1 -1
- package/dist/transformers/get-accessor.js.map +1 -1
- package/dist/transformers/index-signature.js +1 -1
- package/dist/transformers/index-signature.js.map +1 -1
- package/dist/transformers/interface-declaration.js +2 -2
- package/dist/transformers/interface-declaration.js.map +1 -1
- package/dist/transformers/intersection-type.js +1 -1
- package/dist/transformers/intersection-type.js.map +1 -1
- package/dist/transformers/literal-type.js +1 -1
- package/dist/transformers/literal-type.js.map +1 -1
- package/dist/transformers/literal-value.js +1 -1
- package/dist/transformers/literal-value.js.map +1 -1
- package/dist/transformers/module-declaration.js +1 -1
- package/dist/transformers/module-declaration.js.map +1 -1
- package/dist/transformers/object-literal-expression.js +1 -1
- package/dist/transformers/object-literal-expression.js.map +1 -1
- package/dist/transformers/parameter.js +1 -1
- package/dist/transformers/parameter.js.map +1 -1
- package/dist/transformers/property-assignment.js +1 -1
- package/dist/transformers/property-assignment.js.map +1 -1
- package/dist/transformers/set-accessor.js +1 -1
- package/dist/transformers/set-accessor.js.map +1 -1
- package/dist/transformers/source-file-transformer.js +1 -1
- package/dist/transformers/source-file-transformer.js.map +1 -1
- package/dist/transformers/template-literal-type.js +1 -1
- package/dist/transformers/template-literal-type.js.map +1 -1
- package/dist/transformers/tuple-type.js +1 -1
- package/dist/transformers/tuple-type.js.map +1 -1
- package/dist/transformers/type-alias.js +1 -1
- package/dist/transformers/type-alias.js.map +1 -1
- package/dist/transformers/type-literal.js +1 -1
- package/dist/transformers/type-literal.js.map +1 -1
- package/dist/transformers/type-operator.js.map +1 -1
- package/dist/transformers/type-query.js +1 -1
- package/dist/transformers/type-query.js.map +1 -1
- package/dist/transformers/type-reference.js +1 -1
- package/dist/transformers/type-reference.js.map +1 -1
- package/dist/transformers/union-type.js +1 -1
- package/dist/transformers/union-type.js.map +1 -1
- package/dist/transformers/utils/parse-type-from-quick-info.js.map +1 -1
- package/dist/transformers/variable-declaration.js +1 -1
- package/dist/transformers/variable-declaration.js.map +1 -1
- package/dist/transformers/variable-statement.js +1 -1
- package/dist/transformers/variable-statement.js.map +1 -1
- package/dist/typescript.composition.js +1 -1
- package/dist/typescript.composition.js.map +1 -1
- package/dist/typescript.extractor.js +2 -2
- package/dist/typescript.extractor.js.map +1 -1
- package/dist/typescript.main.runtime.js +2 -2
- package/dist/typescript.main.runtime.js.map +1 -1
- package/dist/typescript.parser.js +2 -2
- package/dist/typescript.parser.js.map +1 -1
- package/dist/typescript.parser.spec.js +1 -1
- package/dist/typescript.parser.spec.js.map +1 -1
- package/package.json +15 -15
|
@@ -1,37 +1,37 @@
|
|
|
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.
|
|
3
|
+
<testsuite name="teambit.typescript/typescript@1.0.283" tests="32" failures="0" errors="0" skipped="0">
|
|
4
4
|
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.005"/>
|
|
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.003"/>
|
|
7
|
-
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with interfaceNamesTransformer" time="0.
|
|
8
|
-
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with typeAliasNamesTransformer" time="0.
|
|
7
|
+
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with interfaceNamesTransformer" time="0.001"/>
|
|
8
|
+
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with typeAliasNamesTransformer" time="0.001"/>
|
|
9
9
|
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with variableNamesTransformer" time="0.002"/>
|
|
10
|
-
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.
|
|
10
|
+
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.001"/>
|
|
11
11
|
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.001"/>
|
|
12
12
|
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with expressionStatementTransformer" time="0.002"/>
|
|
13
|
-
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with expressionStatementTransformer" time="0.
|
|
13
|
+
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with expressionStatementTransformer" time="0.002"/>
|
|
14
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.
|
|
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"/>
|
|
17
18
|
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with exportTransformer"/>
|
|
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
20
|
<testcase classname="dist/transform-source-file.spec.js" name="should handle multiple transformers" time="0.002"/>
|
|
21
|
-
<testcase classname="dist/typescript.parser.spec.js" name="should parse arrowFunctions" time="0.
|
|
21
|
+
<testcase classname="dist/typescript.parser.spec.js" name="should parse arrowFunctions" time="0.003"/>
|
|
22
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" time="0.001"/>
|
|
24
24
|
<testcase classname="dist/typescript.parser.spec.js" name="should parse declarations"/>
|
|
25
|
-
<testcase classname="dist/typescript.parser.spec.js" name="should parse renamed declarations"
|
|
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"/>
|
|
27
27
|
<testcase classname="dist/typescript.parser.spec.js" name="should parse re-exports with default"/>
|
|
28
|
-
<testcase classname="dist/typescript.parser.spec.js" name="should parse renamed re-exports all"
|
|
28
|
+
<testcase classname="dist/typescript.parser.spec.js" name="should parse renamed re-exports all"/>
|
|
29
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"/>
|
|
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" time="0.001"/>
|
|
33
33
|
<testcase classname="dist/typescript.parser.spec.js" name="should parse all primitive values" time="0.001"/>
|
|
34
34
|
<testcase classname="dist/typescript.parser.spec.js" name="should skip non primitive values" time="0.001"/>
|
|
35
|
-
<testcase classname="dist/typescript.parser.spec.js" name="should skip non assignment statements"
|
|
35
|
+
<testcase classname="dist/typescript.parser.spec.js" name="should skip non assignment statements"/>
|
|
36
36
|
</testsuite>
|
|
37
37
|
</testsuites>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.typescript/typescript-preview"]=t():e["teambit.typescript/typescript-preview"]=t()}(self,(()=>(()=>{"use strict";var e={60399:(e,t,n)=>{Object.defineProperty(t,"S",{enumerable:!0,get:function(){return o.default}});var o=r(n(31145));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}},31145:(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)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={};for(var o in e)if(Object.prototype.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 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},
|
|
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={60399:(e,t,n)=>{Object.defineProperty(t,"S",{enumerable:!0,get:function(){return o.default}});var o=r(n(31145));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}},31145:(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)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={};for(var o in e)if(Object.prototype.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 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},41272:(e,t,n)=>{var o={id:"teambit.typescript/typescript@1.0.283",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(41272),r=(n(41594),n(5016));const i=TeambitMdxUiMdxScopeContext;var p=n(60399),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)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a.apply(null,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={};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,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})()));
|
package/artifacts/schema.json
CHANGED
|
@@ -1052,7 +1052,7 @@
|
|
|
1052
1052
|
"_legacy": {
|
|
1053
1053
|
"scope": "teambit.typescript",
|
|
1054
1054
|
"name": "typescript",
|
|
1055
|
-
"version": "1.0.
|
|
1055
|
+
"version": "1.0.283"
|
|
1056
1056
|
},
|
|
1057
1057
|
"_scope": "teambit.typescript"
|
|
1058
1058
|
}
|
|
@@ -8653,7 +8653,7 @@
|
|
|
8653
8653
|
"_legacy": {
|
|
8654
8654
|
"scope": "teambit.typescript",
|
|
8655
8655
|
"name": "typescript",
|
|
8656
|
-
"version": "1.0.
|
|
8656
|
+
"version": "1.0.283"
|
|
8657
8657
|
},
|
|
8658
8658
|
"_scope": "teambit.typescript"
|
|
8659
8659
|
}
|
|
@@ -14991,7 +14991,7 @@
|
|
|
14991
14991
|
"componentId": {
|
|
14992
14992
|
"scope": "teambit.typescript",
|
|
14993
14993
|
"name": "typescript",
|
|
14994
|
-
"version": "1.0.
|
|
14994
|
+
"version": "1.0.283"
|
|
14995
14995
|
},
|
|
14996
14996
|
"taggedModuleExports": []
|
|
14997
14997
|
}
|
|
@@ -25,8 +25,8 @@ function _constants() {
|
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
|
-
function _interopRequireDefault(
|
|
29
|
-
function _defineProperty(
|
|
28
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
|
+
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; }
|
|
30
30
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
31
31
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
32
32
|
class CheckTypesCmd {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_workspace","data","require","_chalk","_interopRequireDefault","_constants","
|
|
1
|
+
{"version":3,"names":["_workspace","data","require","_chalk","_interopRequireDefault","_constants","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CheckTypesCmd","constructor","typescript","workspace","logger","name","description","COMPONENT_PATTERN_HELP","report","pattern","all","strict","OutsideWorkspaceError","components","getComponentsByUserInput","setStatusLine","length","files","getSupportedFilesForTsserver","initTsserverClientFromWorkspace","printTypeErrors","tsserver","getTsserverClient","Error","start","Date","now","getDiagnostic","end","msg","killTsServer","lastDiagnostics","code","chalk","red","green","exports"],"sources":["check-types.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { Logger } from '@teambit/logger';\nimport { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport chalk from 'chalk';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { TypescriptMain } from '../typescript.main.runtime';\n\nexport class CheckTypesCmd implements Command {\n name = 'check-types [component-pattern]';\n description = 'check typescript types';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n alias = '';\n group = 'development';\n options = [\n ['a', 'all', 'check-types for all components, not only modified and new'],\n ['', 'strict', 'in case issues found, exit with code 1'],\n ] as CommandOptions;\n\n constructor(private typescript: TypescriptMain, private workspace: Workspace, private logger: Logger) {}\n\n async report([pattern]: [string], { all = false, strict = false }: { all: boolean; strict: boolean }) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const components = await this.workspace.getComponentsByUserInput(all, pattern);\n this.logger.setStatusLine(`checking types for ${components.length} components`);\n const files = this.typescript.getSupportedFilesForTsserver(components);\n await this.typescript.initTsserverClientFromWorkspace({ printTypeErrors: true }, files);\n const tsserver = this.typescript.getTsserverClient();\n if (!tsserver) throw new Error(`unable to start tsserver`);\n const start = Date.now();\n await tsserver.getDiagnostic(files);\n const end = Date.now() - start;\n const msg = `completed type checking (${end / 1000} sec)`;\n tsserver.killTsServer();\n if (tsserver.lastDiagnostics.length) {\n return {\n code: strict ? 1 : 0,\n data: chalk.red(`${msg}. found errors in ${tsserver.lastDiagnostics.length} files.`),\n };\n }\n return {\n code: 0,\n data: chalk.green(`${msg}. no errors were found.`),\n };\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAwE,SAAAG,uBAAAE,CAAA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GAAG,qBAAqBR,QAAQ,CAACU,eAAe,CAACf,MAAM,SAAS;MACrF,CAAC;IACH;IACA,OAAO;MACLgB,IAAI,EAAE,CAAC;MACP1D,IAAI,EAAE2D,gBAAK,CAACE,KAAK,CAAC,GAAGN,GAAG,yBAAyB;IACnD,CAAC;EACH;AACF;AAACO,OAAA,CAAApC,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ function _typescript() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function _interopRequireDefault(
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
class TransformerNotFound extends Error {
|
|
16
16
|
constructor(node, component, location) {
|
|
17
17
|
super(`typescript: could not find schema transformer for node of kind ${node.kind} (${_typescript().default.SyntaxKind[node.kind]}) in component ${component.id.toString()}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_typescript","data","_interopRequireDefault","require","
|
|
1
|
+
{"version":3,"names":["_typescript","data","_interopRequireDefault","require","e","__esModule","default","TransformerNotFound","Error","constructor","node","component","location","kind","ts","SyntaxKind","id","toString","getSourceFile","fileName","line","character","getFullText","exports"],"sources":["transformer-not-found.ts"],"sourcesContent":["import ts, { Node } from 'typescript';\nimport { Component } from '@teambit/component';\nimport { Location } from '@teambit/semantics.entities.semantic-schema';\n\nexport class TransformerNotFound extends Error {\n constructor(readonly node: Node, readonly component: Component, location: Location) {\n super(\n `typescript: could not find schema transformer for node of kind ${node.kind} (${\n ts.SyntaxKind[node.kind]\n }) in component ${component.id.toString()}.\nlocation: ${node.getSourceFile().fileName}, line: ${location.line}, character: ${location.character}.\nnode-text: ${node.getFullText()}`\n );\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsC,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI/B,MAAMG,mBAAmB,SAASC,KAAK,CAAC;EAC7CC,WAAWA,CAAUC,IAAU,EAAWC,SAAoB,EAAEC,QAAkB,EAAE;IAClF,KAAK,CACH,kEAAkEF,IAAI,CAACG,IAAI,KACzEC,qBAAE,CAACC,UAAU,CAACL,IAAI,CAACG,IAAI,CAAC,kBACRF,SAAS,CAACK,EAAE,CAACC,QAAQ,CAAC,CAAC;AAC/C,aAAaP,IAAI,CAACQ,aAAa,CAAC,CAAC,CAACC,QAAQ,WAAWP,QAAQ,CAACQ,IAAI,gBAAgBR,QAAQ,CAACS,SAAS;AACpG,aAAaX,IAAI,CAACY,WAAW,CAAC,CAAC,EAC3B,CAAC;IAAC,KAPiBZ,IAAU,GAAVA,IAAU;IAAA,KAAWC,SAAoB,GAApBA,SAAoB;EAQ9D;AACF;AAACY,OAAA,CAAAhB,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ function _identifier() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function _defineProperty(
|
|
14
|
+
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; }
|
|
15
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
16
16
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
17
|
class ExportIdentifier extends _identifier().Identifier {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_identifier","data","require","_defineProperty","
|
|
1
|
+
{"version":3,"names":["_identifier","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ExportIdentifier","Identifier","constructor","id","filePath","aliasId","sourceFilePath","exported","isExportIdentifier","identifier","exports"],"sources":["export-identifier.ts"],"sourcesContent":["import { Identifier } from './identifier';\n\nexport class ExportIdentifier extends Identifier {\n exported: true;\n\n constructor(id: string, filePath: string, aliasId?: string, sourceFilePath?: string) {\n super(id, filePath, aliasId, sourceFilePath);\n this.exported = true;\n }\n\n static isExportIdentifier(identifier: Identifier): identifier is ExportIdentifier {\n return 'exported' in identifier;\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0C,SAAAE,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;AAEnC,MAAMgB,gBAAgB,SAASC,wBAAU,CAAC;EAG/CC,WAAWA,CAACC,EAAU,EAAEC,QAAgB,EAAEC,OAAgB,EAAEC,cAAuB,EAAE;IACnF,KAAK,CAACH,EAAE,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,cAAc,CAAC;IAACzB,eAAA;IAC7C,IAAI,CAAC0B,QAAQ,GAAG,IAAI;EACtB;EAEA,OAAOC,kBAAkBA,CAACC,UAAsB,EAAkC;IAChF,OAAO,UAAU,IAAIA,UAAU;EACjC;AACF;AAACC,OAAA,CAAAV,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.283/dist/typescript.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.283/dist/typescript.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -18,8 +18,8 @@ function _typescript() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
-
function _interopRequireDefault(
|
|
22
|
-
function _defineProperty(
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
+
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
23
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
24
24
|
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); }
|
|
25
25
|
class RemoveTypesTask {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_packageJsonFile","data","_interopRequireDefault","require","_typescript","
|
|
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;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAuD,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,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,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,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;IAAAnB,eAAA,mBAC5BoB,8BAAgB,CAACC,EAAE;IAAArB,eAAA,eACvB,iBAAiB;IAAAA,eAAA,sBACV,yCAAyC;EAAA;EAChE,MAAMsB,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,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":[]}
|
|
@@ -95,10 +95,10 @@ function _exportIdentifier() {
|
|
|
95
95
|
};
|
|
96
96
|
return data;
|
|
97
97
|
}
|
|
98
|
-
function _interopRequireDefault(
|
|
98
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
99
99
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
100
100
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
101
|
-
function _defineProperty(
|
|
101
|
+
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; }
|
|
102
102
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
103
103
|
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); } // @ts-ignore david we should figure fix this.
|
|
104
104
|
// eslint-disable-next-line import/no-unresolved
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_tsutils","data","require","_typescript","_interopRequireWildcard","_lodash","_utils","_path","_semanticsEntities","_isRelativeImport","_interopRequireDefault","_pMapSeries","_identifierList","_parseTypeFromQuickInfo","_jsdocToDocSchema","_identifier","_exportIdentifier","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_defineProperty","key","value","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","SchemaExtractorContext","mainFile","pathNormalizeToLinux","getPathRelativeToComponent","component","path","identifiers","_identifiers","internalIdentifiers","_internalIdentifiers","computed","_computed","mainFileIdentifierKey","getIdentifierKey","mainModuleIdentifiers","constructor","tsserver","extractor","componentDeps","componentRootPath","hostRootPath","formatter","Map","getComputedNodeKey","filePath","line","character","schema","getIdentifierKeyForNode","node","getSourceFile","fileName","setComputed","location","__schema","setIdentifiers","setInternalIdentifiers","existing","uniqueIdentifiers","uniqBy","concat","k","aliasId","id","IdentifierList","findComputedSchemaByName","name","Array","from","values","filter","computeSchema","getLocation","SyntaxKind","kind","existingComputedSchema","computedSchema","transformSchemaNode","transformAPI","targetSourceFile","absolutePath","sourceFile","position","getLineAndCharacterOfPosition","getStart","getLocationAsString","basePath","filesystem","files","base","relative","getSignature","getSignatureHelp","getPath","getPosition","offset","getPositionOfLineAndCharacter","startsWith","join","getQuickInfo","err","message","Error","getQuickInfoDisplayString","quickInfo","body","displayString","typeDefinition","getTypeDefinition","visitTypeDefinition","getPathWithoutExtension","knownExtensions","fileExtension","extname","substring","filePathWithoutExtension","includes","replace","RegExp","isAbsolute","isIndexFile","currentFilePath","indexFilePath","findFileInComponent","normalizedFilePath","pathToCompareWithoutExtension","matchingFile","find","file","currentFilePathWithoutExtension","isSameFilePath","matches","parsePackageNameFromPath","parts","split","length","lastPart","sep","pkgParts","pkgName","getSourceFileInsideComponent","parseSourceFile","getSourceFileFromNode","getFilePathByNode","undefined","def","getDefinition","firstDef","head","definitionInfo","definition","startPosition","start","pos","nodeAtPos","getTokenAtPosition","visitDefinition","getTypeRefForExternalNode","visit","parent","Identifier","SourceFile","references","isExported","isFromComponent","getFileIdentifiers","exportDec","specifierPathStr","ExportDeclaration","moduleSpecifier","getText","specifierPath","absPath","resolve","getIdentifiers","getFileExports","identifier","ExportIdentifier","isExportIdentifier","getFileInternals","computeIdentifiers","headTypeDefinition","headDefinition","unknownExactType","typeStr","isTypeStrFromQuickInfo","InferenceTypeSchema","info","type","parseTypeFromQuickInfo","isDefInSameLocation","loc","resolveType","internalRef","getTypeRef","ts","isTypeNode","definitionNode","definitionNodeName","definitionInternalRef","transformer","getTransformer","getTypeRefForExternalPath","schemaNode","apiTransformer","getAPITransformer","transformedApi","transform","IgnoredSchema","getCompIdByPkgName","dep","packageName","componentId","nodeIdentifierKey","nodeIdentifierList","mainIdentifierList","nodeIdentifier","mainIdentifier","parsedNodeIdentifier","parsedMainIdentifier","isExportedFromMain","resolveTypeRef","sourceFilePath","isRelativeImport","TypeRefSchema","compIdByPkg","compIdByPath","getComponentIDByPath","relativeDir","lastIndexOf","absFilePath","compFilePath","idKey","exportedIdentifier","jsDocToDocSchema","canHaveJsDoc","jsDocs","getJsDoc","jsDoc","comment","getTextOfJSDocComment","tags","pMapSeries","tag","tagParser","DocSchema","exports"],"sources":["schema-extractor-context.ts"],"sourcesContent":["import { TsserverClient } from '@teambit/ts-server';\nimport { getTokenAtPosition, canHaveJsDoc, getJsDoc } from 'tsutils';\nimport ts, { ExportAssignment, getTextOfJSDocComment, ExportDeclaration, Node, SyntaxKind, TypeNode } from 'typescript';\nimport { head, uniqBy } from 'lodash';\n// @ts-ignore david we should figure fix this.\n// eslint-disable-next-line import/no-unresolved\nimport protocol from 'typescript/lib/protocol';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport { resolve, sep, relative, join, isAbsolute, extname } from 'path';\nimport { Component, ComponentID } from '@teambit/component';\nimport {\n TypeRefSchema,\n SchemaNode,\n InferenceTypeSchema,\n Location,\n DocSchema,\n IgnoredSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport isRelativeImport from '@teambit/legacy/dist/utils/is-relative-import';\nimport { ComponentDependency } from '@teambit/dependency-resolver';\nimport { Formatter } from '@teambit/formatter';\nimport pMapSeries from 'p-map-series';\nimport { TypeScriptExtractor } from './typescript.extractor';\nimport { IdentifierList } from './identifier-list';\nimport { parseTypeFromQuickInfo } from './transformers/utils/parse-type-from-quick-info';\nimport { tagParser } from './transformers/utils/jsdoc-to-doc-schema';\nimport { Identifier } from './identifier';\nimport { ExportIdentifier } from './export-identifier';\n\nexport class SchemaExtractorContext {\n /**\n * list of all declared identifiers (exported and internal) by filename\n */\n private _identifiers = new Map<string, IdentifierList>();\n private _internalIdentifiers = new Map<string, IdentifierList>();\n\n /**\n * computed nodes by filename and (position (line:character))\n */\n private _computed = new Map<string, SchemaNode>();\n\n get mainFile() {\n return pathNormalizeToLinux(this.getPathRelativeToComponent(this.component.mainFile.path));\n }\n\n get identifiers() {\n return this._identifiers;\n }\n\n get internalIdentifiers() {\n return this._internalIdentifiers;\n }\n\n get computed() {\n return this._computed;\n }\n\n get mainFileIdentifierKey() {\n const mainFile = this.component.mainFile;\n return this.getIdentifierKey(mainFile.path);\n }\n\n get mainModuleIdentifiers() {\n return this.identifiers.get(this.mainFileIdentifierKey);\n }\n\n constructor(\n readonly tsserver: TsserverClient,\n readonly component: Component,\n readonly extractor: TypeScriptExtractor,\n readonly componentDeps: ComponentDependency[],\n readonly componentRootPath: string,\n readonly hostRootPath: string,\n readonly formatter?: Formatter\n ) {\n this.componentRootPath = pathNormalizeToLinux(componentRootPath);\n this.hostRootPath = pathNormalizeToLinux(hostRootPath);\n }\n\n getComputedNodeKey({ filePath, line, character }: Location, schema: string) {\n return `${filePath}:${line}:${character}__${schema}`;\n }\n\n getIdentifierKeyForNode(node: Node) {\n const filePath = node.getSourceFile().fileName;\n return this.getIdentifierKey(filePath);\n }\n\n getIdentifierKey(filePath: string) {\n return pathNormalizeToLinux(filePath);\n }\n\n setComputed(node: SchemaNode) {\n const { location, __schema } = node;\n const key = this.getComputedNodeKey(location, __schema);\n this.computed.set(key, node);\n }\n\n setIdentifiers(filePath: string, identifiers: IdentifierList) {\n this._identifiers.set(this.getIdentifierKey(filePath), identifiers);\n }\n\n setInternalIdentifiers(filePath: string, identifiers: IdentifierList) {\n const existing = this._internalIdentifiers.get(filePath);\n if (!existing) {\n this._internalIdentifiers.set(filePath, identifiers);\n } else {\n const uniqueIdentifiers = uniqBy(existing.identifiers.concat(identifiers.identifiers), (k) => k.aliasId || k.id);\n this._internalIdentifiers.set(filePath, new IdentifierList(uniqueIdentifiers));\n }\n }\n\n findComputedSchemaByName(name: string) {\n const computed = Array.from(this.computed.values());\n return computed.filter((schema) => schema.name === name);\n }\n\n async computeSchema(node: Node): Promise<SchemaNode> {\n const location = this.getLocation(node);\n const key = this.getComputedNodeKey(location, SyntaxKind[node.kind]);\n const existingComputedSchema = this.computed.get(key);\n if (existingComputedSchema) {\n return existingComputedSchema;\n }\n const computedSchema = await this.extractor.computeSchema(node, this);\n this.setComputed(computedSchema);\n return computedSchema;\n }\n\n async transformSchemaNode(schema: SchemaNode) {\n return this.extractor.transformAPI(schema, this);\n }\n\n /**\n * returns the location of a node in a source file.\n */\n getLocation(node: Node, targetSourceFile?: ts.SourceFile, absolutePath = false): Location {\n const sourceFile = targetSourceFile || node.getSourceFile();\n const filePath = absolutePath ? sourceFile.fileName : this.getPathRelativeToComponent(sourceFile.fileName);\n const position = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n const line = position.line + 1;\n const character = position.character + 1;\n\n return {\n filePath: pathNormalizeToLinux(filePath),\n line,\n character,\n };\n }\n\n getLocationAsString(node: Node): string {\n const location = this.getLocation(node);\n return `${node.getSourceFile().fileName}, line: ${location.line}, character: ${location.character}`;\n }\n\n getPathRelativeToComponent(filePath: string): string {\n const basePath = this.component.filesystem.files[0].base;\n return relative(basePath, filePath);\n }\n\n /**\n * returns a signature for a node.\n */\n async getSignature(node: Node) {\n return this.tsserver.getSignatureHelp(this.getPath(node), this.getLocation(node));\n }\n\n /**\n * get the position for the tsserver.\n */\n getPosition(sourceFile: ts.SourceFile, line: number, offset: number): number {\n return sourceFile.getPositionOfLineAndCharacter(line - 1, offset - 1);\n }\n\n /**\n * get the path for a source file.\n */\n getPath(node: Node) {\n const sourceFile = node.getSourceFile();\n\n const fileName = sourceFile.fileName;\n\n if (!fileName.startsWith(this.componentRootPath) && !fileName.startsWith(this.hostRootPath)) {\n return join(this.componentRootPath, fileName);\n }\n\n return sourceFile.fileName;\n }\n\n async getQuickInfo(node: Node) {\n const location = this.getLocation(node);\n try {\n return await this.tsserver.getQuickInfo(this.getPath(node), location);\n } catch (err: any) {\n if (err.message === 'No content available.') {\n throw new Error(\n `unable to get quickinfo data from tsserver at ${this.getPath(node)}, Ln ${location.line}, Col ${\n location.character\n }`\n );\n }\n throw err;\n }\n }\n\n async getQuickInfoDisplayString(node: Node): Promise<string> {\n const quickInfo = await this.getQuickInfo(node);\n return quickInfo?.body?.displayString || '';\n }\n\n /**\n * returns the type definition for a type.\n */\n typeDefinition(node: Node) {\n return this.tsserver.getTypeDefinition(this.getPath(node), this.getLocation(node));\n }\n\n visitTypeDefinition() {}\n\n private getPathWithoutExtension(filePath: string) {\n const knownExtensions = ['ts', 'js', 'jsx', 'tsx'];\n const fileExtension = extname(filePath).substring(1);\n\n const filePathWithoutExtension = () => {\n if (knownExtensions.includes(fileExtension)) {\n return filePath.replace(new RegExp(`\\\\.${fileExtension}$`), '');\n }\n return filePath;\n };\n\n if (!isAbsolute(filePath)) {\n return filePathWithoutExtension();\n }\n\n if (filePath.startsWith(this.componentRootPath)) {\n return relative(this.componentRootPath, filePathWithoutExtension());\n }\n if (filePath.startsWith(this.hostRootPath)) {\n return relative(this.hostRootPath, filePathWithoutExtension());\n }\n return filePathWithoutExtension();\n }\n\n private isIndexFile(filePath: string, currentFilePath: string) {\n const indexFilePath = join(filePath, 'index');\n return pathNormalizeToLinux(indexFilePath) === currentFilePath;\n }\n\n findFileInComponent(filePath: string) {\n const normalizedFilePath = pathNormalizeToLinux(filePath);\n const pathToCompareWithoutExtension = this.getPathWithoutExtension(normalizedFilePath);\n\n const matchingFile = this.component.filesystem.files.find((file) => {\n const currentFilePath = pathNormalizeToLinux(file.path);\n const currentFilePathWithoutExtension = this.getPathWithoutExtension(currentFilePath);\n\n const isSameFilePath = pathToCompareWithoutExtension === currentFilePathWithoutExtension;\n\n const matches =\n isSameFilePath || this.isIndexFile(pathToCompareWithoutExtension, currentFilePathWithoutExtension);\n\n return matches;\n });\n return matchingFile;\n }\n\n private parsePackageNameFromPath(path: string) {\n const parts = path.split('node_modules');\n\n if (parts.length === 1) {\n return path;\n }\n\n const lastPart = parts[parts.length - 1].replace(sep, '');\n const pkgParts = lastPart.split('/');\n if (lastPart.startsWith('@')) {\n // scoped package\n return `${pkgParts[0]}/${pkgParts[1]}`;\n }\n const pkgName = pkgParts[0];\n if (pkgName === 'typescript') {\n // it's a built-in type, such as \"string\".\n return '';\n }\n return pkgName;\n }\n\n /**\n * return the file if part of the component.\n * otherwise, a reference to the target package and the type name.\n */\n getSourceFileInsideComponent(filePath: string) {\n const file = this.findFileInComponent(filePath);\n return file && this.extractor.parseSourceFile(file);\n }\n\n async getSourceFileFromNode(node: Node) {\n const filePath = await this.getFilePathByNode(node);\n if (!filePath) {\n return undefined;\n }\n return this.getSourceFileInsideComponent(filePath);\n }\n\n async getFilePathByNode(node: Node) {\n const def = await this.tsserver.getDefinition(this.getPath(node), this.getLocation(node));\n\n const firstDef = head(def?.body);\n return firstDef?.file;\n }\n\n async definitionInfo(node: Node): Promise<protocol.DefinitionInfo | undefined> {\n const location = this.getLocation(node);\n const filePath = this.getPath(node);\n\n const def = await this.tsserver.getDefinition(filePath, location);\n\n const firstDef = head(def?.body);\n\n return firstDef;\n }\n\n /**\n * get a definition for a given node.\n */\n async definition(definition: protocol.DefinitionInfo): Promise<Node | undefined> {\n const startPosition = definition.start;\n const sourceFile = this.getSourceFileInsideComponent(definition.file);\n if (!sourceFile) {\n // it might be an external reference, cant get the node\n return undefined;\n }\n const pos = this.getPosition(sourceFile, startPosition.line, startPosition.offset);\n const nodeAtPos = getTokenAtPosition(sourceFile, pos);\n return nodeAtPos;\n }\n\n /**\n * visit a definition for node - e.g. return it's schema.\n */\n async visitDefinition(node: Node): Promise<SchemaNode | undefined> {\n const definitionInfo = await this.definitionInfo(node);\n if (!definitionInfo) {\n return undefined;\n }\n\n const definition = await this.definition(definitionInfo);\n if (!definition) {\n return this.getTypeRefForExternalNode(node);\n }\n\n return this.visit(definition.parent);\n }\n\n async visit(node: Node): Promise<SchemaNode> {\n if (node.kind === SyntaxKind.Identifier && node.parent.parent.kind !== SyntaxKind.SourceFile) {\n return this.visit(node.parent);\n }\n return this.extractor.computeSchema(node, this);\n }\n\n references() {}\n\n isExported() {}\n\n isFromComponent() {}\n\n async getFileIdentifiers(exportDec: ExportDeclaration | ExportAssignment) {\n const file = exportDec.getSourceFile().fileName;\n const specifierPathStr =\n (exportDec.kind === SyntaxKind.ExportDeclaration && exportDec.moduleSpecifier?.getText()) || '';\n const specifierPath = specifierPathStr.substring(1, specifierPathStr.length - 1);\n const absPath = resolve(file, '..', specifierPath);\n const sourceFile = this.getSourceFileInsideComponent(absPath);\n if (!sourceFile) return [];\n return this.getIdentifiers(sourceFile);\n }\n\n async getFileExports(exportDec: ExportDeclaration | ExportAssignment) {\n const identifiers = await this.getFileIdentifiers(exportDec);\n return identifiers.filter((identifier) => ExportIdentifier.isExportIdentifier(identifier));\n }\n\n async getFileInternals(exportDec: ExportDeclaration | ExportAssignment) {\n const identifiers = await this.getFileIdentifiers(exportDec);\n return identifiers.filter((identifier) => !ExportIdentifier.isExportIdentifier(identifier));\n }\n\n getIdentifiers(node: Node) {\n return this.extractor.computeIdentifiers(node, this);\n }\n\n /**\n * tsserver has two different calls: \"definition\" and \"typeDefinition\".\n * normally, we need the \"typeDefinition\" to get the type data of a node.\n * sometimes, it has no data, for example when the node is of type TypeReference, and then using \"definition\" is\n * helpful. (couldn't find a rule when to use each one. e.g. \"VariableDeclaration\" sometimes has data only in\n * \"definition\" but it's not clear when/why).\n */\n async getDefinition(node: Node) {\n const typeDefinition = await this.typeDefinition(node);\n const headTypeDefinition = head(typeDefinition?.body);\n if (headTypeDefinition) {\n return headTypeDefinition;\n }\n\n const definition = await this.tsserver.getDefinition(node.getSourceFile().fileName, this.getLocation(node));\n const headDefinition = head(definition?.body);\n\n return headDefinition;\n }\n\n // when we can't figure out the component/package/type of this node, we'll use the typeStr as the type.\n private async unknownExactType(node: Node, location: Location, typeStr = 'any', isTypeStrFromQuickInfo = true) {\n if (isTypeStrFromQuickInfo) {\n return new InferenceTypeSchema(location, typeStr || 'any');\n }\n const info = await this.getQuickInfo(node);\n const type = parseTypeFromQuickInfo(info);\n return new InferenceTypeSchema(location, type, typeStr);\n }\n\n // the reason for this check is to avoid infinite loop when calling `this.jump` with the same file+location\n private isDefInSameLocation(node: Node, definition: protocol.FileSpanWithContext) {\n if (definition.file !== node.getSourceFile().fileName) {\n return false;\n }\n const loc = this.getLocation(node);\n\n return loc.line === definition.start.line && loc.character === definition.start.offset;\n }\n\n /**\n * resolve a type by a node and its identifier.\n */\n async resolveType(\n node: Node & { type?: TypeNode },\n typeStr: string,\n isTypeStrFromQuickInfo = true\n ): Promise<SchemaNode> {\n const location = this.getLocation(node);\n\n // check if internal ref with typeInfo\n const internalRef = await this.getTypeRef(typeStr, this.getIdentifierKeyForNode(node), location);\n\n if (internalRef) return internalRef;\n\n // if a node has \"type\" prop, it has the type data of the node. this normally happens when the code has the type\n // explicitly, e.g. `const str: string` vs implicitly `const str = 'some-string'`, which the node won't have \"type\"\n if (node.type && ts.isTypeNode(node.type)) {\n return this.computeSchema(node.type);\n }\n\n const definition = await this.getDefinition(node);\n\n if (!definition) {\n return this.unknownExactType(node, location, typeStr, isTypeStrFromQuickInfo);\n }\n\n if (this.isDefInSameLocation(node, definition)) {\n return this.unknownExactType(node, location, typeStr, isTypeStrFromQuickInfo);\n }\n\n const definitionNode = await this.definition(definition);\n\n if (!definitionNode) {\n return this.unknownExactType(node, location, typeStr, isTypeStrFromQuickInfo);\n }\n\n const definitionNodeName = definitionNode?.getText();\n\n // check if internal ref with definition info\n const definitionInternalRef = await this.getTypeRef(\n definitionNodeName,\n this.getIdentifierKeyForNode(definitionNode),\n location\n );\n\n if (definitionInternalRef) return definitionInternalRef;\n\n const transformer = this.extractor.getTransformer(definitionNode, this);\n\n if (transformer === undefined) {\n const file = this.findFileInComponent(definition.file);\n if (!file) return this.getTypeRefForExternalPath(typeStr, definition.file, location);\n return this.unknownExactType(node, location, typeStr, isTypeStrFromQuickInfo);\n }\n\n const schemaNode = await this.visit(definitionNode);\n\n if (!schemaNode) {\n return this.unknownExactType(node, location, typeStr, isTypeStrFromQuickInfo);\n }\n\n const apiTransformer = this.extractor.getAPITransformer(schemaNode);\n let transformedApi = apiTransformer ? await apiTransformer.transform(schemaNode, this) : schemaNode;\n if (!transformedApi) {\n transformedApi = new IgnoredSchema(schemaNode);\n }\n return transformedApi;\n }\n\n private getCompIdByPkgName(pkgName: string): ComponentID | undefined {\n return this.componentDeps.find((dep) => dep.packageName === pkgName)?.componentId;\n }\n\n async getTypeRef(typeStr: string, filePath: string, location: Location): Promise<TypeRefSchema | undefined> {\n const nodeIdentifierKey = this.getIdentifierKey(filePath);\n const mainFileIdentifierKey = this.mainFileIdentifierKey;\n\n const nodeIdentifierList = this.identifiers.get(nodeIdentifierKey);\n const mainIdentifierList = this.identifiers.get(mainFileIdentifierKey);\n\n const nodeIdentifier = new Identifier(typeStr, nodeIdentifierKey);\n const mainIdentifier = new Identifier(typeStr, mainFileIdentifierKey);\n\n const parsedNodeIdentifier = nodeIdentifierList?.find(nodeIdentifier);\n const parsedMainIdentifier = mainIdentifierList?.find(mainIdentifier);\n const isExportedFromMain = parsedMainIdentifier && ExportIdentifier.isExportIdentifier(parsedMainIdentifier);\n\n if (!parsedNodeIdentifier) return undefined;\n\n const internalRef = !isExportedFromMain;\n\n if (internalRef) {\n this.setInternalIdentifiers(filePath, new IdentifierList([parsedNodeIdentifier]));\n }\n\n return this.resolveTypeRef(parsedNodeIdentifier, location, isExportedFromMain);\n }\n\n async resolveTypeRef(\n identifier: Identifier,\n location: Location,\n isExportedFromMain?: boolean\n ): Promise<TypeRefSchema> {\n const sourceFilePath = identifier.sourceFilePath;\n\n if (!sourceFilePath || (isExportedFromMain && isRelativeImport(sourceFilePath))) {\n return new TypeRefSchema(\n location,\n identifier.id,\n undefined,\n undefined,\n !isExportedFromMain ? this.getPathRelativeToComponent(identifier.filePath) : undefined\n );\n }\n\n if (!isRelativeImport(sourceFilePath)) {\n const pkgName = this.parsePackageNameFromPath(sourceFilePath);\n const compIdByPkg = this.getCompIdByPkgName(pkgName);\n\n const compIdByPath = await this.extractor.getComponentIDByPath(sourceFilePath);\n\n if (compIdByPath) {\n return new TypeRefSchema(location, identifier.id, compIdByPath);\n }\n\n if (compIdByPkg) {\n return new TypeRefSchema(location, identifier.id, compIdByPkg);\n }\n\n // package without comp id\n return new TypeRefSchema(location, identifier.id, undefined, pkgName);\n }\n\n const relativeDir = identifier.filePath.substring(0, identifier.filePath.lastIndexOf('/'));\n const absFilePath = resolve(this.componentRootPath, relativeDir, sourceFilePath);\n\n const compFilePath = this.findFileInComponent(absFilePath);\n if (!compFilePath) {\n // @todo handle this better\n throw new Error(\n `cannot find file in component \\n source file path ${sourceFilePath}\\n \n identifier file path ${identifier.filePath}\\nrelative dir ${relativeDir}\\n\n absFilePath ${absFilePath}`\n );\n return new TypeRefSchema(location, identifier.id);\n }\n\n const idKey = this.getIdentifierKey(compFilePath?.path);\n\n // if re exported from a file, recurse until definition\n const exportedIdentifier = (this.identifiers.get(idKey)?.identifiers || []).find((i) => i.id === identifier.id);\n\n if (exportedIdentifier) {\n return this.resolveTypeRef(exportedIdentifier, location, isExportedFromMain);\n }\n\n return new TypeRefSchema(location, identifier.id);\n }\n\n async getTypeRefForExternalNode(node: Node): Promise<TypeRefSchema> {\n const info = await this.getQuickInfo(node);\n const typeStr = parseTypeFromQuickInfo(info);\n const location = this.getLocation(node);\n const filePath = this.getPath(node);\n return this.getTypeRefForExternalPath(typeStr, filePath, location);\n }\n\n async getTypeRefForExternalPath(typeStr: string, filePath: string, location: Location): Promise<TypeRefSchema> {\n const compIdByPath = await this.extractor.getComponentIDByPath(filePath);\n if (compIdByPath) {\n return new TypeRefSchema(location, typeStr, compIdByPath);\n }\n const pkgName = this.parsePackageNameFromPath(filePath);\n const compIdByPkg = this.getCompIdByPkgName(pkgName);\n if (compIdByPkg) {\n return new TypeRefSchema(location, typeStr, compIdByPkg);\n }\n return new TypeRefSchema(location, typeStr, undefined, pkgName);\n }\n\n async jsDocToDocSchema(node: Node): Promise<DocSchema | undefined> {\n if (!canHaveJsDoc(node)) {\n return undefined;\n }\n const jsDocs = getJsDoc(node);\n if (!jsDocs.length) {\n return undefined;\n }\n // not sure how common it is to have multiple JSDocs. never seen it before.\n // regardless, in typescript implementation of methods like `getJSDocDeprecatedTag()`, they use the first one. (`getFirstJSDocTag()`)\n const jsDoc = jsDocs[0];\n const location = this.getLocation(jsDoc);\n const comment = getTextOfJSDocComment(jsDoc.comment);\n const tags = jsDoc.tags ? await pMapSeries(jsDoc.tags, (tag) => tagParser(tag, this, this.formatter)) : undefined;\n return new DocSchema(location, jsDoc.getText(), comment, tags);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,MAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,KAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,mBAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,kBAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAQ,k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CAAa,EAAC3K,QAAQ,EAAEmI,OAAO,EAAExC,SAAS,EAAEL,OAAO,CAAC;EACjE;EAEA,MAAM+F,gBAAgBA,CAACzL,IAAU,EAAkC;IACjE,IAAI,CAAC,IAAA0L,uBAAY,EAAC1L,IAAI,CAAC,EAAE;MACvB,OAAO+F,SAAS;IAClB;IACA,MAAM4F,MAAM,GAAG,IAAAC,mBAAQ,EAAC5L,IAAI,CAAC;IAC7B,IAAI,CAAC2L,MAAM,CAACrG,MAAM,EAAE;MAClB,OAAOS,SAAS;IAClB;IACA;IACA;IACA,MAAM8F,KAAK,GAAGF,MAAM,CAAC,CAAC,CAAC;IACvB,MAAMvL,QAAQ,GAAG,IAAI,CAACmB,WAAW,CAACsK,KAAK,CAAC;IACxC,MAAMC,OAAO,GAAG,IAAAC,mCAAqB,EAACF,KAAK,CAACC,OAAO,CAAC;IACpD,MAAME,IAAI,GAAGH,KAAK,CAACG,IAAI,GAAG,MAAM,IAAAC,qBAAU,EAACJ,KAAK,CAACG,IAAI,EAAGE,GAAG,IAAK,IAAAC,6BAAS,EAACD,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC1M,SAAS,CAAC,CAAC,GAAGuG,SAAS;IACjH,OAAO,KAAIqG,8BAAS,EAAChM,QAAQ,EAAEyL,KAAK,CAACpE,OAAO,CAAC,CAAC,EAAEqE,OAAO,EAAEE,IAAI,CAAC;EAChE;AACF;AAACK,OAAA,CAAAlO,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_tsutils","data","require","_typescript","_interopRequireWildcard","_lodash","_utils","_path","_semanticsEntities","_isRelativeImport","_interopRequireDefault","_pMapSeries","_identifierList","_parseTypeFromQuickInfo","_jsdocToDocSchema","_identifier","_exportIdentifier","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","SchemaExtractorContext","mainFile","pathNormalizeToLinux","getPathRelativeToComponent","component","path","identifiers","_identifiers","internalIdentifiers","_internalIdentifiers","computed","_computed","mainFileIdentifierKey","getIdentifierKey","mainModuleIdentifiers","constructor","tsserver","extractor","componentDeps","componentRootPath","hostRootPath","formatter","Map","getComputedNodeKey","filePath","line","character","schema","getIdentifierKeyForNode","node","getSourceFile","fileName","setComputed","location","__schema","key","setIdentifiers","setInternalIdentifiers","existing","uniqueIdentifiers","uniqBy","concat","k","aliasId","id","IdentifierList","findComputedSchemaByName","name","Array","from","values","filter","computeSchema","getLocation","SyntaxKind","kind","existingComputedSchema","computedSchema","transformSchemaNode","transformAPI","targetSourceFile","absolutePath","sourceFile","position","getLineAndCharacterOfPosition","getStart","getLocationAsString","basePath","filesystem","files","base","relative","getSignature","getSignatureHelp","getPath","getPosition","offset","getPositionOfLineAndCharacter","startsWith","join","getQuickInfo","err","message","Error","getQuickInfoDisplayString","quickInfo","body","displayString","typeDefinition","getTypeDefinition","visitTypeDefinition","getPathWithoutExtension","knownExtensions","fileExtension","extname","substring","filePathWithoutExtension","includes","replace","RegExp","isAbsolute","isIndexFile","currentFilePath","indexFilePath","findFileInComponent","normalizedFilePath","pathToCompareWithoutExtension","matchingFile","find","file","currentFilePathWithoutExtension","isSameFilePath","matches","parsePackageNameFromPath","parts","split","length","lastPart","sep","pkgParts","pkgName","getSourceFileInsideComponent","parseSourceFile","getSourceFileFromNode","getFilePathByNode","undefined","def","getDefinition","firstDef","head","definitionInfo","definition","startPosition","start","pos","nodeAtPos","getTokenAtPosition","visitDefinition","getTypeRefForExternalNode","visit","parent","Identifier","SourceFile","references","isExported","isFromComponent","getFileIdentifiers","exportDec","specifierPathStr","ExportDeclaration","moduleSpecifier","getText","specifierPath","absPath","resolve","getIdentifiers","getFileExports","identifier","ExportIdentifier","isExportIdentifier","getFileInternals","computeIdentifiers","headTypeDefinition","headDefinition","unknownExactType","typeStr","isTypeStrFromQuickInfo","InferenceTypeSchema","info","type","parseTypeFromQuickInfo","isDefInSameLocation","loc","resolveType","internalRef","getTypeRef","ts","isTypeNode","definitionNode","definitionNodeName","definitionInternalRef","transformer","getTransformer","getTypeRefForExternalPath","schemaNode","apiTransformer","getAPITransformer","transformedApi","transform","IgnoredSchema","getCompIdByPkgName","dep","packageName","componentId","nodeIdentifierKey","nodeIdentifierList","mainIdentifierList","nodeIdentifier","mainIdentifier","parsedNodeIdentifier","parsedMainIdentifier","isExportedFromMain","resolveTypeRef","sourceFilePath","isRelativeImport","TypeRefSchema","compIdByPkg","compIdByPath","getComponentIDByPath","relativeDir","lastIndexOf","absFilePath","compFilePath","idKey","exportedIdentifier","jsDocToDocSchema","canHaveJsDoc","jsDocs","getJsDoc","jsDoc","comment","getTextOfJSDocComment","tags","pMapSeries","tag","tagParser","DocSchema","exports"],"sources":["schema-extractor-context.ts"],"sourcesContent":["import { TsserverClient } from '@teambit/ts-server';\nimport { getTokenAtPosition, canHaveJsDoc, getJsDoc } from 'tsutils';\nimport ts, { ExportAssignment, getTextOfJSDocComment, ExportDeclaration, Node, SyntaxKind, TypeNode } from 'typescript';\nimport { head, uniqBy } from 'lodash';\n// @ts-ignore david we should figure fix this.\n// eslint-disable-next-line import/no-unresolved\nimport protocol from 'typescript/lib/protocol';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport { resolve, sep, relative, join, isAbsolute, extname } from 'path';\nimport { Component, ComponentID } from '@teambit/component';\nimport {\n TypeRefSchema,\n SchemaNode,\n InferenceTypeSchema,\n Location,\n DocSchema,\n IgnoredSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport isRelativeImport from '@teambit/legacy/dist/utils/is-relative-import';\nimport { ComponentDependency } from '@teambit/dependency-resolver';\nimport { Formatter } from '@teambit/formatter';\nimport pMapSeries from 'p-map-series';\nimport { TypeScriptExtractor } from './typescript.extractor';\nimport { IdentifierList } from './identifier-list';\nimport { parseTypeFromQuickInfo } from './transformers/utils/parse-type-from-quick-info';\nimport { tagParser } from './transformers/utils/jsdoc-to-doc-schema';\nimport { Identifier } from './identifier';\nimport { ExportIdentifier } from './export-identifier';\n\nexport class SchemaExtractorContext {\n /**\n * list of all declared identifiers (exported and internal) by filename\n */\n private _identifiers = new Map<string, IdentifierList>();\n private _internalIdentifiers = new Map<string, IdentifierList>();\n\n /**\n * computed nodes by filename and (position (line:character))\n */\n private _computed = new Map<string, SchemaNode>();\n\n get mainFile() {\n return pathNormalizeToLinux(this.getPathRelativeToComponent(this.component.mainFile.path));\n }\n\n get identifiers() {\n return this._identifiers;\n }\n\n get internalIdentifiers() {\n return this._internalIdentifiers;\n }\n\n get computed() {\n return this._computed;\n }\n\n get mainFileIdentifierKey() {\n const mainFile = this.component.mainFile;\n return this.getIdentifierKey(mainFile.path);\n }\n\n get mainModuleIdentifiers() {\n return this.identifiers.get(this.mainFileIdentifierKey);\n }\n\n constructor(\n readonly tsserver: TsserverClient,\n readonly component: Component,\n readonly extractor: TypeScriptExtractor,\n readonly componentDeps: ComponentDependency[],\n readonly componentRootPath: string,\n readonly hostRootPath: string,\n readonly formatter?: Formatter\n ) {\n this.componentRootPath = pathNormalizeToLinux(componentRootPath);\n this.hostRootPath = pathNormalizeToLinux(hostRootPath);\n }\n\n getComputedNodeKey({ filePath, line, character }: Location, schema: string) {\n return `${filePath}:${line}:${character}__${schema}`;\n }\n\n getIdentifierKeyForNode(node: Node) {\n const filePath = node.getSourceFile().fileName;\n return this.getIdentifierKey(filePath);\n }\n\n getIdentifierKey(filePath: string) {\n return pathNormalizeToLinux(filePath);\n }\n\n setComputed(node: SchemaNode) {\n const { location, __schema } = node;\n const key = this.getComputedNodeKey(location, __schema);\n this.computed.set(key, node);\n }\n\n setIdentifiers(filePath: string, identifiers: IdentifierList) {\n this._identifiers.set(this.getIdentifierKey(filePath), identifiers);\n }\n\n setInternalIdentifiers(filePath: string, identifiers: IdentifierList) {\n const existing = this._internalIdentifiers.get(filePath);\n if (!existing) {\n this._internalIdentifiers.set(filePath, identifiers);\n } else {\n const uniqueIdentifiers = uniqBy(existing.identifiers.concat(identifiers.identifiers), (k) => k.aliasId || k.id);\n this._internalIdentifiers.set(filePath, new IdentifierList(uniqueIdentifiers));\n }\n }\n\n findComputedSchemaByName(name: string) {\n const computed = Array.from(this.computed.values());\n return computed.filter((schema) => schema.name === name);\n }\n\n async computeSchema(node: Node): Promise<SchemaNode> {\n const location = this.getLocation(node);\n const key = this.getComputedNodeKey(location, SyntaxKind[node.kind]);\n const existingComputedSchema = this.computed.get(key);\n if (existingComputedSchema) {\n return existingComputedSchema;\n }\n const computedSchema = await this.extractor.computeSchema(node, this);\n this.setComputed(computedSchema);\n return computedSchema;\n }\n\n async transformSchemaNode(schema: SchemaNode) {\n return this.extractor.transformAPI(schema, this);\n }\n\n /**\n * returns the location of a node in a source file.\n */\n getLocation(node: Node, targetSourceFile?: ts.SourceFile, absolutePath = false): Location {\n const sourceFile = targetSourceFile || node.getSourceFile();\n const filePath = absolutePath ? sourceFile.fileName : this.getPathRelativeToComponent(sourceFile.fileName);\n const position = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n const line = position.line + 1;\n const character = position.character + 1;\n\n return {\n filePath: pathNormalizeToLinux(filePath),\n line,\n character,\n };\n }\n\n getLocationAsString(node: Node): string {\n const location = this.getLocation(node);\n return `${node.getSourceFile().fileName}, line: ${location.line}, character: ${location.character}`;\n }\n\n getPathRelativeToComponent(filePath: string): string {\n const basePath = this.component.filesystem.files[0].base;\n return relative(basePath, filePath);\n }\n\n /**\n * returns a signature for a node.\n */\n async getSignature(node: Node) {\n return this.tsserver.getSignatureHelp(this.getPath(node), this.getLocation(node));\n }\n\n /**\n * get the position for the tsserver.\n */\n getPosition(sourceFile: ts.SourceFile, line: number, offset: number): number {\n return sourceFile.getPositionOfLineAndCharacter(line - 1, offset - 1);\n }\n\n /**\n * get the path for a source file.\n */\n getPath(node: Node) {\n const sourceFile = node.getSourceFile();\n\n const fileName = sourceFile.fileName;\n\n if (!fileName.startsWith(this.componentRootPath) && !fileName.startsWith(this.hostRootPath)) {\n return join(this.componentRootPath, fileName);\n }\n\n return sourceFile.fileName;\n }\n\n async getQuickInfo(node: Node) {\n const location = this.getLocation(node);\n try {\n return await this.tsserver.getQuickInfo(this.getPath(node), location);\n } catch (err: any) {\n if (err.message === 'No content available.') {\n throw new Error(\n `unable to get quickinfo data from tsserver at ${this.getPath(node)}, Ln ${location.line}, Col ${\n location.character\n }`\n );\n }\n throw err;\n }\n }\n\n async getQuickInfoDisplayString(node: Node): Promise<string> {\n const quickInfo = await this.getQuickInfo(node);\n return quickInfo?.body?.displayString || '';\n }\n\n /**\n * returns the type definition for a type.\n */\n typeDefinition(node: Node) {\n return this.tsserver.getTypeDefinition(this.getPath(node), this.getLocation(node));\n }\n\n visitTypeDefinition() {}\n\n private getPathWithoutExtension(filePath: string) {\n const knownExtensions = ['ts', 'js', 'jsx', 'tsx'];\n const fileExtension = extname(filePath).substring(1);\n\n const filePathWithoutExtension = () => {\n if (knownExtensions.includes(fileExtension)) {\n return filePath.replace(new RegExp(`\\\\.${fileExtension}$`), '');\n }\n return filePath;\n };\n\n if (!isAbsolute(filePath)) {\n return filePathWithoutExtension();\n }\n\n if (filePath.startsWith(this.componentRootPath)) {\n return relative(this.componentRootPath, filePathWithoutExtension());\n }\n if (filePath.startsWith(this.hostRootPath)) {\n return relative(this.hostRootPath, filePathWithoutExtension());\n }\n return filePathWithoutExtension();\n }\n\n private isIndexFile(filePath: string, currentFilePath: string) {\n const indexFilePath = join(filePath, 'index');\n return pathNormalizeToLinux(indexFilePath) === currentFilePath;\n }\n\n findFileInComponent(filePath: string) {\n const normalizedFilePath = pathNormalizeToLinux(filePath);\n const pathToCompareWithoutExtension = this.getPathWithoutExtension(normalizedFilePath);\n\n const matchingFile = this.component.filesystem.files.find((file) => {\n const currentFilePath = pathNormalizeToLinux(file.path);\n const currentFilePathWithoutExtension = this.getPathWithoutExtension(currentFilePath);\n\n const isSameFilePath = pathToCompareWithoutExtension === currentFilePathWithoutExtension;\n\n const matches =\n isSameFilePath || this.isIndexFile(pathToCompareWithoutExtension, currentFilePathWithoutExtension);\n\n return matches;\n });\n return matchingFile;\n }\n\n private parsePackageNameFromPath(path: string) {\n const parts = path.split('node_modules');\n\n if (parts.length === 1) {\n return path;\n }\n\n const lastPart = parts[parts.length - 1].replace(sep, '');\n const pkgParts = lastPart.split('/');\n if (lastPart.startsWith('@')) {\n // scoped package\n return `${pkgParts[0]}/${pkgParts[1]}`;\n }\n const pkgName = pkgParts[0];\n if (pkgName === 'typescript') {\n // it's a built-in type, such as \"string\".\n return '';\n }\n return pkgName;\n }\n\n /**\n * return the file if part of the component.\n * otherwise, a reference to the target package and the type name.\n */\n getSourceFileInsideComponent(filePath: string) {\n const file = this.findFileInComponent(filePath);\n return file && this.extractor.parseSourceFile(file);\n }\n\n async getSourceFileFromNode(node: Node) {\n const filePath = await this.getFilePathByNode(node);\n if (!filePath) {\n return undefined;\n }\n return this.getSourceFileInsideComponent(filePath);\n }\n\n async getFilePathByNode(node: Node) {\n const def = await this.tsserver.getDefinition(this.getPath(node), this.getLocation(node));\n\n const firstDef = head(def?.body);\n return firstDef?.file;\n }\n\n async definitionInfo(node: Node): Promise<protocol.DefinitionInfo | undefined> {\n const location = this.getLocation(node);\n const filePath = this.getPath(node);\n\n const def = await this.tsserver.getDefinition(filePath, location);\n\n const firstDef = head(def?.body);\n\n return firstDef;\n }\n\n /**\n * get a definition for a given node.\n */\n async definition(definition: protocol.DefinitionInfo): Promise<Node | undefined> {\n const startPosition = definition.start;\n const sourceFile = this.getSourceFileInsideComponent(definition.file);\n if (!sourceFile) {\n // it might be an external reference, cant get the node\n return undefined;\n }\n const pos = this.getPosition(sourceFile, startPosition.line, startPosition.offset);\n const nodeAtPos = getTokenAtPosition(sourceFile, pos);\n return nodeAtPos;\n }\n\n /**\n * visit a definition for node - e.g. return it's schema.\n */\n async visitDefinition(node: Node): Promise<SchemaNode | undefined> {\n const definitionInfo = await this.definitionInfo(node);\n if (!definitionInfo) {\n return undefined;\n }\n\n const definition = await this.definition(definitionInfo);\n if (!definition) {\n return this.getTypeRefForExternalNode(node);\n }\n\n return this.visit(definition.parent);\n }\n\n async visit(node: Node): Promise<SchemaNode> {\n if (node.kind === SyntaxKind.Identifier && node.parent.parent.kind !== SyntaxKind.SourceFile) {\n return this.visit(node.parent);\n }\n return this.extractor.computeSchema(node, this);\n }\n\n references() {}\n\n isExported() {}\n\n isFromComponent() {}\n\n async getFileIdentifiers(exportDec: ExportDeclaration | ExportAssignment) {\n const file = exportDec.getSourceFile().fileName;\n const specifierPathStr =\n (exportDec.kind === SyntaxKind.ExportDeclaration && exportDec.moduleSpecifier?.getText()) || '';\n const specifierPath = specifierPathStr.substring(1, specifierPathStr.length - 1);\n const absPath = resolve(file, '..', specifierPath);\n const sourceFile = this.getSourceFileInsideComponent(absPath);\n if (!sourceFile) return [];\n return this.getIdentifiers(sourceFile);\n }\n\n async getFileExports(exportDec: ExportDeclaration | ExportAssignment) {\n const identifiers = await this.getFileIdentifiers(exportDec);\n return identifiers.filter((identifier) => ExportIdentifier.isExportIdentifier(identifier));\n }\n\n async getFileInternals(exportDec: ExportDeclaration | ExportAssignment) {\n const identifiers = await this.getFileIdentifiers(exportDec);\n return identifiers.filter((identifier) => !ExportIdentifier.isExportIdentifier(identifier));\n }\n\n getIdentifiers(node: Node) {\n return this.extractor.computeIdentifiers(node, this);\n }\n\n /**\n * tsserver has two different calls: \"definition\" and \"typeDefinition\".\n * normally, we need the \"typeDefinition\" to get the type data of a node.\n * sometimes, it has no data, for example when the node is of type TypeReference, and then using \"definition\" is\n * helpful. (couldn't find a rule when to use each one. e.g. \"VariableDeclaration\" sometimes has data only in\n * \"definition\" but it's not clear when/why).\n */\n async getDefinition(node: Node) {\n const typeDefinition = await this.typeDefinition(node);\n const headTypeDefinition = head(typeDefinition?.body);\n if (headTypeDefinition) {\n return headTypeDefinition;\n }\n\n const definition = await this.tsserver.getDefinition(node.getSourceFile().fileName, this.getLocation(node));\n const headDefinition = head(definition?.body);\n\n return headDefinition;\n }\n\n // when we can't figure out the component/package/type of this node, we'll use the typeStr as the type.\n private async unknownExactType(node: Node, location: Location, typeStr = 'any', isTypeStrFromQuickInfo = true) {\n if (isTypeStrFromQuickInfo) {\n return new InferenceTypeSchema(location, typeStr || 'any');\n }\n const info = await this.getQuickInfo(node);\n const type = parseTypeFromQuickInfo(info);\n return new InferenceTypeSchema(location, type, typeStr);\n }\n\n // the reason for this check is to avoid infinite loop when calling `this.jump` with the same file+location\n private isDefInSameLocation(node: Node, definition: protocol.FileSpanWithContext) {\n if (definition.file !== node.getSourceFile().fileName) {\n return false;\n }\n const loc = this.getLocation(node);\n\n return loc.line === definition.start.line && loc.character === definition.start.offset;\n }\n\n /**\n * resolve a type by a node and its identifier.\n */\n async resolveType(\n node: Node & { type?: TypeNode },\n typeStr: string,\n isTypeStrFromQuickInfo = true\n ): Promise<SchemaNode> {\n const location = this.getLocation(node);\n\n // check if internal ref with typeInfo\n const internalRef = await this.getTypeRef(typeStr, this.getIdentifierKeyForNode(node), location);\n\n if (internalRef) return internalRef;\n\n // if a node has \"type\" prop, it has the type data of the node. this normally happens when the code has the type\n // explicitly, e.g. `const str: string` vs implicitly `const str = 'some-string'`, which the node won't have \"type\"\n if (node.type && ts.isTypeNode(node.type)) {\n return this.computeSchema(node.type);\n }\n\n const definition = await this.getDefinition(node);\n\n if (!definition) {\n return this.unknownExactType(node, location, typeStr, isTypeStrFromQuickInfo);\n }\n\n if (this.isDefInSameLocation(node, definition)) {\n return this.unknownExactType(node, location, typeStr, isTypeStrFromQuickInfo);\n }\n\n const definitionNode = await this.definition(definition);\n\n if (!definitionNode) {\n return this.unknownExactType(node, location, typeStr, isTypeStrFromQuickInfo);\n }\n\n const definitionNodeName = definitionNode?.getText();\n\n // check if internal ref with definition info\n const definitionInternalRef = await this.getTypeRef(\n definitionNodeName,\n this.getIdentifierKeyForNode(definitionNode),\n location\n );\n\n if (definitionInternalRef) return definitionInternalRef;\n\n const transformer = this.extractor.getTransformer(definitionNode, this);\n\n if (transformer === undefined) {\n const file = this.findFileInComponent(definition.file);\n if (!file) return this.getTypeRefForExternalPath(typeStr, definition.file, location);\n return this.unknownExactType(node, location, typeStr, isTypeStrFromQuickInfo);\n }\n\n const schemaNode = await this.visit(definitionNode);\n\n if (!schemaNode) {\n return this.unknownExactType(node, location, typeStr, isTypeStrFromQuickInfo);\n }\n\n const apiTransformer = this.extractor.getAPITransformer(schemaNode);\n let transformedApi = apiTransformer ? await apiTransformer.transform(schemaNode, this) : schemaNode;\n if (!transformedApi) {\n transformedApi = new IgnoredSchema(schemaNode);\n }\n return transformedApi;\n }\n\n private getCompIdByPkgName(pkgName: string): ComponentID | undefined {\n return this.componentDeps.find((dep) => dep.packageName === pkgName)?.componentId;\n }\n\n async getTypeRef(typeStr: string, filePath: string, location: Location): Promise<TypeRefSchema | undefined> {\n const nodeIdentifierKey = this.getIdentifierKey(filePath);\n const mainFileIdentifierKey = this.mainFileIdentifierKey;\n\n const nodeIdentifierList = this.identifiers.get(nodeIdentifierKey);\n const mainIdentifierList = this.identifiers.get(mainFileIdentifierKey);\n\n const nodeIdentifier = new Identifier(typeStr, nodeIdentifierKey);\n const mainIdentifier = new Identifier(typeStr, mainFileIdentifierKey);\n\n const parsedNodeIdentifier = nodeIdentifierList?.find(nodeIdentifier);\n const parsedMainIdentifier = mainIdentifierList?.find(mainIdentifier);\n const isExportedFromMain = parsedMainIdentifier && ExportIdentifier.isExportIdentifier(parsedMainIdentifier);\n\n if (!parsedNodeIdentifier) return undefined;\n\n const internalRef = !isExportedFromMain;\n\n if (internalRef) {\n this.setInternalIdentifiers(filePath, new IdentifierList([parsedNodeIdentifier]));\n }\n\n return this.resolveTypeRef(parsedNodeIdentifier, location, isExportedFromMain);\n }\n\n async resolveTypeRef(\n identifier: Identifier,\n location: Location,\n isExportedFromMain?: boolean\n ): Promise<TypeRefSchema> {\n const sourceFilePath = identifier.sourceFilePath;\n\n if (!sourceFilePath || (isExportedFromMain && isRelativeImport(sourceFilePath))) {\n return new TypeRefSchema(\n location,\n identifier.id,\n undefined,\n undefined,\n !isExportedFromMain ? this.getPathRelativeToComponent(identifier.filePath) : undefined\n );\n }\n\n if (!isRelativeImport(sourceFilePath)) {\n const pkgName = this.parsePackageNameFromPath(sourceFilePath);\n const compIdByPkg = this.getCompIdByPkgName(pkgName);\n\n const compIdByPath = await this.extractor.getComponentIDByPath(sourceFilePath);\n\n if (compIdByPath) {\n return new TypeRefSchema(location, identifier.id, compIdByPath);\n }\n\n if (compIdByPkg) {\n return new TypeRefSchema(location, identifier.id, compIdByPkg);\n }\n\n // package without comp id\n return new TypeRefSchema(location, identifier.id, undefined, pkgName);\n }\n\n const relativeDir = identifier.filePath.substring(0, identifier.filePath.lastIndexOf('/'));\n const absFilePath = resolve(this.componentRootPath, relativeDir, sourceFilePath);\n\n const compFilePath = this.findFileInComponent(absFilePath);\n if (!compFilePath) {\n // @todo handle this better\n throw new Error(\n `cannot find file in component \\n source file path ${sourceFilePath}\\n \n identifier file path ${identifier.filePath}\\nrelative dir ${relativeDir}\\n\n absFilePath ${absFilePath}`\n );\n return new TypeRefSchema(location, identifier.id);\n }\n\n const idKey = this.getIdentifierKey(compFilePath?.path);\n\n // if re exported from a file, recurse until definition\n const exportedIdentifier = (this.identifiers.get(idKey)?.identifiers || []).find((i) => i.id === identifier.id);\n\n if (exportedIdentifier) {\n return this.resolveTypeRef(exportedIdentifier, location, isExportedFromMain);\n }\n\n return new TypeRefSchema(location, identifier.id);\n }\n\n async getTypeRefForExternalNode(node: Node): Promise<TypeRefSchema> {\n const info = await this.getQuickInfo(node);\n const typeStr = parseTypeFromQuickInfo(info);\n const location = this.getLocation(node);\n const filePath = this.getPath(node);\n return this.getTypeRefForExternalPath(typeStr, filePath, location);\n }\n\n async getTypeRefForExternalPath(typeStr: string, filePath: string, location: Location): Promise<TypeRefSchema> {\n const compIdByPath = await this.extractor.getComponentIDByPath(filePath);\n if (compIdByPath) {\n return new TypeRefSchema(location, typeStr, compIdByPath);\n }\n const pkgName = this.parsePackageNameFromPath(filePath);\n const compIdByPkg = this.getCompIdByPkgName(pkgName);\n if (compIdByPkg) {\n return new TypeRefSchema(location, typeStr, compIdByPkg);\n }\n return new TypeRefSchema(location, typeStr, undefined, pkgName);\n }\n\n async jsDocToDocSchema(node: Node): Promise<DocSchema | undefined> {\n if (!canHaveJsDoc(node)) {\n return undefined;\n }\n const jsDocs = getJsDoc(node);\n if (!jsDocs.length) {\n return undefined;\n }\n // not sure how common it is to have multiple JSDocs. never seen it before.\n // regardless, in typescript implementation of methods like `getJSDocDeprecatedTag()`, they use the first one. (`getFirstJSDocTag()`)\n const jsDoc = jsDocs[0];\n const location = this.getLocation(jsDoc);\n const comment = getTextOfJSDocComment(jsDoc.comment);\n const tags = jsDoc.tags ? await pMapSeries(jsDoc.tags, (tag) => tagParser(tag, this, this.formatter)) : undefined;\n return new DocSchema(location, jsDoc.getText(), comment, tags);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,MAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,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formerPlugin = void 0;
|
|
7
|
-
function _defineProperty(
|
|
7
|
+
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; }
|
|
8
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
9
9
|
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); }
|
|
10
10
|
class SchemaTransformerPlugin {
|
|
@@ -18,7 +18,7 @@ function _replaceName() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
-
function _interopRequireDefault(
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
22
|
function classNamesTransformer(nameMapping) {
|
|
23
23
|
return context => {
|
|
24
24
|
const {
|