@teambit/typescript 1.0.209 → 1.0.210
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 +17 -17
- package/artifacts/preview/teambit_typescript_typescript-preview.js +1 -1
- package/artifacts/schema.json +3 -3
- package/dist/cmds/check-types.cmd.js +1 -1
- package/dist/cmds/check-types.cmd.js.map +1 -1
- package/dist/cmds/write-tsconfig.cmd.js +1 -1
- package/dist/cmds/write-tsconfig.cmd.js.map +1 -1
- package/dist/export-identifier.js +1 -1
- package/dist/export-identifier.js.map +1 -1
- package/dist/{preview-1711509617758.js → preview-1711617900376.js} +2 -2
- package/dist/remove-types-task.js +1 -1
- 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/empty-line-encoder.js +1 -1
- package/dist/sourceFileTransformers/empty-line-encoder.js.map +1 -1
- package/dist/sourceFileTransformers/transform.js +1 -1
- package/dist/sourceFileTransformers/transform.js.map +1 -1
- package/dist/transformers/class-declaration.js +1 -1
- package/dist/transformers/class-declaration.js.map +1 -1
- package/dist/transformers/export-declaration.js +1 -1
- package/dist/transformers/export-declaration.js.map +1 -1
- package/dist/transformers/interface-declaration.js +1 -1
- package/dist/transformers/interface-declaration.js.map +1 -1
- package/dist/transformers/parameter.js +1 -1
- package/dist/transformers/parameter.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 +1 -1
- package/dist/typescript.main.runtime.js.map +1 -1
- package/dist/typescript.parser.js +1 -1
- package/dist/typescript.parser.js.map +1 -1
- package/package.json +15 -15
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites tests="35" failures="0" errors="0" skipped="0">
|
|
3
|
-
<testsuite name="teambit.typescript/typescript@1.0.
|
|
4
|
-
<testcase classname="dist/dedupe-path.spec.js" name="should return the root-dir if there is only one env involved" time="0.
|
|
3
|
+
<testsuite name="teambit.typescript/typescript@1.0.210" tests="35" failures="0" errors="0" skipped="0">
|
|
4
|
+
<testcase classname="dist/dedupe-path.spec.js" name="should return the root-dir if there is only one env involved" time="0.018"/>
|
|
5
5
|
<testcase classname="dist/dedupe-path.spec.js" name="should set the env with the most components"/>
|
|
6
6
|
<testcase classname="dist/dedupe-path.spec.js" name="should not set any env to a shared dir if it no env has max components"/>
|
|
7
|
-
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.
|
|
7
|
+
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.297"/>
|
|
8
8
|
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with functionNamesTransformer" time="0.004"/>
|
|
9
9
|
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with importTransformer" time="0.004"/>
|
|
10
10
|
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with interfaceNamesTransformer" time="0.002"/>
|
|
11
11
|
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with typeAliasNamesTransformer" time="0.002"/>
|
|
12
|
-
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with variableNamesTransformer" time="0.
|
|
12
|
+
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with variableNamesTransformer" time="0.002"/>
|
|
13
|
+
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.001"/>
|
|
13
14
|
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.002"/>
|
|
14
|
-
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with classNamesTransformer" time="0.002"/>
|
|
15
|
-
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with expressionStatementTransformer" time="0.004"/>
|
|
16
15
|
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with expressionStatementTransformer" time="0.003"/>
|
|
17
|
-
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with
|
|
16
|
+
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with expressionStatementTransformer" time="0.002"/>
|
|
17
|
+
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with interfaceNamesTransformer" time="0.002"/>
|
|
18
18
|
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with importTransformer" time="0.001"/>
|
|
19
|
+
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with exportTransformer" time="0.002"/>
|
|
19
20
|
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with exportTransformer" time="0.001"/>
|
|
20
21
|
<testcase classname="dist/transform-source-file.spec.js" name="should correctly transform source code with exportTransformer"/>
|
|
21
|
-
<testcase classname="dist/transform-source-file.spec.js" name="should
|
|
22
|
-
<testcase classname="dist/transform-source-file.spec.js" name="should
|
|
23
|
-
<testcase classname="dist/
|
|
24
|
-
<testcase classname="dist/typescript.parser.spec.js" name="should parse
|
|
25
|
-
<testcase classname="dist/typescript.parser.spec.js" name="should parse
|
|
26
|
-
<testcase classname="dist/typescript.parser.spec.js" name="should parse
|
|
27
|
-
<testcase classname="dist/typescript.parser.spec.js" name="should parse declarations"
|
|
28
|
-
<testcase classname="dist/typescript.parser.spec.js" name="should parse renamed declarations" time="0.001"/>
|
|
22
|
+
<testcase classname="dist/transform-source-file.spec.js" name="should return original source code if no transformations are applied"/>
|
|
23
|
+
<testcase classname="dist/transform-source-file.spec.js" name="should handle multiple transformers" time="0.002"/>
|
|
24
|
+
<testcase classname="dist/typescript.parser.spec.js" name="should parse arrowFunctions" time="0.244"/>
|
|
25
|
+
<testcase classname="dist/typescript.parser.spec.js" name="should parse function exports"/>
|
|
26
|
+
<testcase classname="dist/typescript.parser.spec.js" name="should parse classes" time="0.001"/>
|
|
27
|
+
<testcase classname="dist/typescript.parser.spec.js" name="should parse declarations"/>
|
|
28
|
+
<testcase classname="dist/typescript.parser.spec.js" name="should parse renamed declarations"/>
|
|
29
29
|
<testcase classname="dist/typescript.parser.spec.js" name="should parse re-exports"/>
|
|
30
30
|
<testcase classname="dist/typescript.parser.spec.js" name="should parse re-exports with default" time="0.001"/>
|
|
31
31
|
<testcase classname="dist/typescript.parser.spec.js" name="should parse renamed re-exports all"/>
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<testcase classname="dist/typescript.parser.spec.js" name="should include staticProperties, when on regular functions" time="0.001"/>
|
|
35
35
|
<testcase classname="dist/typescript.parser.spec.js" name="should include staticProperties, when on classes"/>
|
|
36
36
|
<testcase classname="dist/typescript.parser.spec.js" name="should parse all primitive values" time="0.001"/>
|
|
37
|
-
<testcase classname="dist/typescript.parser.spec.js" name="should skip non primitive values"
|
|
38
|
-
<testcase classname="dist/typescript.parser.spec.js" name="should skip non assignment statements"/>
|
|
37
|
+
<testcase classname="dist/typescript.parser.spec.js" name="should skip non primitive values"/>
|
|
38
|
+
<testcase classname="dist/typescript.parser.spec.js" name="should skip non assignment statements" time="0.001"/>
|
|
39
39
|
</testsuite>
|
|
40
40
|
</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={
|
|
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={75993:(e,t,n)=>{Object.defineProperty(t,"S",{enumerable:!0,get:function(){return o.default}});var o=r(n(40035));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.typescript/aspect-docs/typescript@0.0.167",homepage:"https://bit.cloud/teambit/typescript/aspect-docs/typescript",exported:!0}},40035:(e,t,n)=>{var o={id:"teambit.typescript/aspect-docs/typescript@0.0.167",homepage:"https://bit.cloud/teambit/typescript/aspect-docs/typescript",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=m,p(n(41594));var r=n(5016),i=["components"];function p(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}function a(e,t){if(null==e)return{};var n,o,r=c(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}p.__bit_component=o,s.__bit_component=o,a.__bit_component=o,c.__bit_component=o;var d={},l="wrapper";function m(e){var t=e.components,n=a(e,i);return(0,r.mdx)(l,s({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"Typescript aspect implements the ",(0,r.mdx)("inlineCode",{parentName:"p"},"Compiler")," interface and provides the ability to transpile files on the workspace and build components in the isolated capsules."),(0,r.mdx)("h2",null,"Configuration - tsconfig.json"),(0,r.mdx)("p",null,"An env that uses typescript compiler can have two tsconfig.json files, one for the workspace and one for the build process."),(0,r.mdx)("p",null,"On the workspace, the following two configurations are overridden:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"compilerOptions.sourceRoot = <componentDir>;\ncompilerOptions.rootDir = '.';\n")),(0,r.mdx)("p",null,"The reason to override them is to make the source-map working on the workspace."),(0,r.mdx)("p",null,"As a reminder, the ",(0,r.mdx)("inlineCode",{parentName:"p"},"dists")," are written into the node_modules and not in the component-dir, without the configuration above, the source-map won't have the correct ",(0,r.mdx)("inlineCode",{parentName:"p"},"sourceRoot")," and ",(0,r.mdx)("inlineCode",{parentName:"p"},"sources")," values, and as a result, the debugger won't work."),(0,r.mdx)("p",null,"On the capsules, the following configurion is overridden:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"compilerOptions.outDir = <CompilerOptions.distDir>\n")),(0,r.mdx)("p",null,"This is done to avoid confusion when the distDir is ",(0,r.mdx)("inlineCode",{parentName:"p"},"x")," and ts-config outDir is ",(0,r.mdx)("inlineCode",{parentName:"p"},"y"),",\nin which case, the dists in the capsule are written into ",(0,r.mdx)("inlineCode",{parentName:"p"},"y"),", but other bit processes expect to find them in ",(0,r.mdx)("inlineCode",{parentName:"p"},"x"),"."),(0,r.mdx)("h1",null,"Override typescript configuration in a custom env:"),(0,r.mdx)("p",null,"When creating a new custom environment, use the following API to change the typescript compiler config."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"useTypescript(modifiers?: UseTypescriptModifiers, tsModule: any = ts)\n")),(0,r.mdx)("p",null,"The modifiers are:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"type UseTypescriptModifiers = {\n buildConfig?: TsConfigTransformer[];\n devConfig?: TsConfigTransformer[];\n};\n")),(0,r.mdx)("p",null,"As you can see, you can customize the configuration for both: the build process and for the compilation on the workspace."),(0,r.mdx)("p",null,"An example of a TsConfigTransformer used by ",(0,r.mdx)("inlineCode",{parentName:"p"},"teambit/aspect")," for the build process, which uses the typescript compiler only for generating the types:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"const tsconfig = require(\"./tsconfig.json\");\n\nconst transformer: TsConfigTransformer = (config: TypescriptConfigMutator) => {\n config\n .mergeTsConfig(tsconfig)\n .setArtifactName('declaration')\n .setDistGlobPatterns([`dist/**/*.d.ts`])\n .setShouldCopyNonSupportedFiles(false);\n return config;\n };\n")),(0,r.mdx)("p",null,"In the last example, a custom tsconfig.json was merged to the builtin tsconfig.json."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},'{\n "compilerOptions": {\n ...\n "emitDeclarationOnly": true,\n ...\n },\n}\n')),(0,r.mdx)("p",null,"Some more props were changed as well to accomodate this env"))}m.__bit_component=o,m.isMDXComponent=!0},47131:(e,t,n)=>{var o={id:"teambit.typescript/typescript@1.0.210",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(47131),r=(n(41594),n(5016));const i=TeambitMdxUiMdxScopeContext;var p=n(75993),s=["components"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a.apply(this,arguments)}var c={},d="wrapper";function l(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,s);return(0,r.mdx)(d,a({},c,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{Typescript:p.S},mdxType:"MDXScopeProvider"},(0,r.mdx)(p.S,{mdxType:"Typescript"})))}l.isMDXComponent=!0;const m=[t],u=[e],f={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),o})()));
|
package/artifacts/schema.json
CHANGED
|
@@ -1035,7 +1035,7 @@
|
|
|
1035
1035
|
"_legacy": {
|
|
1036
1036
|
"scope": "teambit.typescript",
|
|
1037
1037
|
"name": "typescript",
|
|
1038
|
-
"version": "1.0.
|
|
1038
|
+
"version": "1.0.210"
|
|
1039
1039
|
},
|
|
1040
1040
|
"_scope": "teambit.typescript"
|
|
1041
1041
|
}
|
|
@@ -8628,7 +8628,7 @@
|
|
|
8628
8628
|
"_legacy": {
|
|
8629
8629
|
"scope": "teambit.typescript",
|
|
8630
8630
|
"name": "typescript",
|
|
8631
|
-
"version": "1.0.
|
|
8631
|
+
"version": "1.0.210"
|
|
8632
8632
|
},
|
|
8633
8633
|
"_scope": "teambit.typescript"
|
|
8634
8634
|
}
|
|
@@ -15148,7 +15148,7 @@
|
|
|
15148
15148
|
"componentId": {
|
|
15149
15149
|
"scope": "teambit.typescript",
|
|
15150
15150
|
"name": "typescript",
|
|
15151
|
-
"version": "1.0.
|
|
15151
|
+
"version": "1.0.210"
|
|
15152
15152
|
},
|
|
15153
15153
|
"taggedModuleExports": []
|
|
15154
15154
|
}
|
|
@@ -27,7 +27,7 @@ function _constants() {
|
|
|
27
27
|
}
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
29
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
30
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
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 {
|
|
33
33
|
constructor(typescript, workspace, logger) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_workspace","data","require","_chalk","_interopRequireDefault","_constants","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
|
1
|
+
{"version":3,"names":["_workspace","data","require","_chalk","_interopRequireDefault","_constants","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","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;EA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,eAAe,CAACf,MAAM,EAAE;MACnC,OAAO;QACLgB,IAAI,EAAErB,MAAM,GAAG,CAAC,GAAG,CAAC;QACpBvC,IAAI,EAAE6D,gBAAK,CAACC,GAAG,CAAE,GAAEL,GAAI,qBAAoBR,QAAQ,CAACU,eAAe,CAACf,MAAO,SAAQ;MACrF,CAAC;IACH;IACA,OAAO;MACLgB,IAAI,EAAE,CAAC;MACP5D,IAAI,EAAE6D,gBAAK,CAACE,KAAK,CAAE,GAAEN,GAAI,yBAAwB;IACnD,CAAC;EACH;AACF;AAACO,OAAA,CAAApC,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -27,7 +27,7 @@ function _chalk() {
|
|
|
27
27
|
}
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
29
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
30
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
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 WriteTsconfigCmd {
|
|
33
33
|
constructor(tsMain) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_path","data","_interopRequireDefault","require","_lodash","_chalk","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
|
1
|
+
{"version":3,"names":["_path","data","_interopRequireDefault","require","_lodash","_chalk","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","WriteTsconfigCmd","constructor","tsMain","report","_args","flags","cleanResults","writeResults","json","dryRunWithTsconfig","Error","isDryRun","dryRun","cleanResultsOutput","chalk","green","join","totalFiles","map","paths","length","reduce","acc","current","writeTitle","writeOutput","result","p","path","str","bold","envIds","clean","silent","noDedupe","writeTsconfigJson","dedupe","writeJson","s","omit","exports"],"sources":["write-tsconfig.cmd.ts"],"sourcesContent":["import path from 'path';\nimport { omit } from 'lodash';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { TypescriptMain } from '../typescript.main.runtime';\n\ntype Flags = { dryRun?: boolean; noDedupe?: boolean; dryRunWithTsconfig?: boolean; clean?: boolean; silent?: boolean };\n\nexport default class WriteTsconfigCmd implements Command {\n name = 'write-tsconfig';\n // description = 'EXPERIMENTAL. write tsconfig.json files in the component directories';\n description = 'DEPRECATED. use bit ws-config write instead';\n alias = '';\n group = 'development';\n private = true;\n options = [\n ['c', 'clean', 'delete tsconfig files from the workspace. highly recommended to run it with \"--dry-run\" first'],\n ['s', 'silent', 'do not prompt for confirmation'],\n ['', 'no-dedupe', \"write tsconfig.json inside each one of the component's dir, avoid deduping\"],\n ['', 'dry-run', 'show the paths that tsconfig will be written per env'],\n [\n '',\n 'dry-run-with-tsconfig',\n 'use with --json flag. show the tsconfig.json content and the paths it will be written per env',\n ],\n ['j', 'json', 'json format'],\n ] as CommandOptions;\n\n constructor(private tsMain: TypescriptMain) {}\n\n async report(_args, flags: Flags) {\n const { cleanResults, writeResults } = await this.json(_args, flags);\n if (flags.dryRunWithTsconfig) {\n throw new Error(`use --json flag along with --dry-run-with-tsconfig`);\n }\n const isDryRun = flags.dryRun;\n const cleanResultsOutput = cleanResults\n ? `${chalk.green(`the following paths ${isDryRun ? 'will be' : 'were'} deleted`)}\\n${cleanResults.join('\\n')}\\n\\n`\n : '';\n\n const totalFiles = writeResults.map((r) => r.paths.length).reduce((acc, current) => acc + current);\n const writeTitle = isDryRun\n ? chalk.green(`${totalFiles} files will be written`)\n : chalk.green(`${totalFiles} files have been written successfully`);\n const writeOutput = writeResults\n .map((result) => {\n const paths = result.paths\n .map((p) => path.join(p, 'tsconfig.json'))\n .map((str) => ` ${str}`)\n .join('\\n');\n return `The following paths are according to env(s) ${chalk.bold(result.envIds.join(', '))}\\n${paths}`;\n })\n .join('\\n\\n');\n return `${cleanResultsOutput}${writeTitle}\\n${writeOutput}`;\n }\n\n async json(_args, flags: Flags) {\n const { clean, silent, noDedupe, dryRunWithTsconfig } = flags;\n const dryRun = dryRunWithTsconfig ? true : flags.dryRun;\n const { cleanResults, writeResults } = await this.tsMain.writeTsconfigJson({\n clean,\n dedupe: !noDedupe,\n dryRun,\n dryRunWithTsconfig,\n silent,\n });\n\n if (dryRun) {\n const writeJson = dryRunWithTsconfig ? writeResults : writeResults.map((s) => omit(s, ['tsconfig']));\n // return JSON.stringify({ cleanResults, writeResults: writeJson }, undefined, 2);\n return { cleanResults, writeResults: writeJson };\n }\n return { cleanResults, writeResults };\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,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AACJ,MAAM,CAACK,MAAM,CAACf,IAAI,CAAC,IAAI,CAAC,CAAE,KAAIG,KAAM,EAAC;IACxG,CAAC,CAAC,CACDH,IAAI,CAAC,MAAM,CAAC;IACf,OAAQ,GAAEH,kBAAmB,GAAEW,UAAW,KAAIC,WAAY,EAAC;EAC7D;EAEA,MAAMjB,IAAIA,CAACJ,KAAK,EAAEC,KAAY,EAAE;IAC9B,MAAM;MAAE2B,KAAK;MAAEC,MAAM;MAAEC,QAAQ;MAAEzB;IAAmB,CAAC,GAAGJ,KAAK;IAC7D,MAAMO,MAAM,GAAGH,kBAAkB,GAAG,IAAI,GAAGJ,KAAK,CAACO,MAAM;IACvD,MAAM;MAAEN,YAAY;MAAEC;IAAa,CAAC,GAAG,MAAM,IAAI,CAACL,MAAM,CAACiC,iBAAiB,CAAC;MACzEH,KAAK;MACLI,MAAM,EAAE,CAACF,QAAQ;MACjBtB,MAAM;MACNH,kBAAkB;MAClBwB;IACF,CAAC,CAAC;IAEF,IAAIrB,MAAM,EAAE;MACV,MAAMyB,SAAS,GAAG5B,kBAAkB,GAAGF,YAAY,GAAGA,YAAY,CAACW,GAAG,CAAEoB,CAAC,IAAK,IAAAC,cAAI,EAACD,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;MACpG;MACA,OAAO;QAAEhC,YAAY;QAAEC,YAAY,EAAE8B;MAAU,CAAC;IAClD;IACA,OAAO;MAAE/B,YAAY;MAAEC;IAAa,CAAC;EACvC;AACF;AAACiC,OAAA,CAAA7D,OAAA,GAAAqB,gBAAA","ignoreList":[]}
|
|
@@ -12,7 +12,7 @@ function _identifier() {
|
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
14
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
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 {
|
|
18
18
|
constructor(id, filePath, aliasId, sourceFilePath) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_identifier","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
|
1
|
+
{"version":3,"names":["_identifier","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","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,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,YAAAO,SAAA,yEAAAL,CAAA,GAAAM,MAAA,GAAAC,MAAA,EAAAV,CAAA;AAEnC,MAAMW,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;IAAC3B,eAAA;IAC7C,IAAI,CAAC4B,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/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.typescript_typescript@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.typescript_typescript@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.typescript_typescript@1.0.210/dist/typescript.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.typescript_typescript@1.0.210/dist/typescript.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -20,7 +20,7 @@ function _typescript() {
|
|
|
20
20
|
}
|
|
21
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
22
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
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 {
|
|
26
26
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_packageJsonFile","data","_interopRequireDefault","require","_typescript","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
|
1
|
+
{"version":3,"names":["_packageJsonFile","data","_interopRequireDefault","require","_typescript","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","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,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,E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ACA;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":[]}
|
|
@@ -97,9 +97,9 @@ function _exportIdentifier() {
|
|
|
97
97
|
}
|
|
98
98
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
-
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 &&
|
|
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
101
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
102
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
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
|
|
105
105
|
class SchemaExtractorContext {
|
|
@@ -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","prototype","hasOwnProperty","call","i","set","_defineProperty","key","value","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","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)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,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","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,kBAAA;EAAA,MAAAR,IAAA,GAAAS,sBAAA,CAAAR,OAAA;EAAAO,iBAAA,YAAAA,CAAA;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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":[]}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.SchemaTransformerPlugin = void 0;
|
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
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 {
|
|
11
11
|
constructor(schemaTransformerSlot) {
|