@teambit/typescript 1.0.329 → 1.0.331
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 +16 -16
- package/artifacts/preview/teambit_typescript_typescript-preview.js +1 -1
- package/artifacts/schema.json +746 -1418
- package/dist/{preview-1720427783719.js → preview-1720667996237.js} +2 -2
- package/dist/schema-extractor-context.js +14 -21
- package/dist/schema-extractor-context.js.map +1 -1
- package/package.json +20 -19
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.331/dist/typescript.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.331/dist/typescript.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -25,9 +25,9 @@ function _lodash() {
|
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
const data = require("@teambit/legacy
|
|
30
|
-
|
|
28
|
+
function _legacy() {
|
|
29
|
+
const data = require("@teambit/legacy.utils");
|
|
30
|
+
_legacy = function () {
|
|
31
31
|
return data;
|
|
32
32
|
};
|
|
33
33
|
return data;
|
|
@@ -46,13 +46,6 @@ function _semanticsEntities() {
|
|
|
46
46
|
};
|
|
47
47
|
return data;
|
|
48
48
|
}
|
|
49
|
-
function _isRelativeImport() {
|
|
50
|
-
const data = _interopRequireDefault(require("@teambit/legacy/dist/utils/is-relative-import"));
|
|
51
|
-
_isRelativeImport = function () {
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
54
|
-
return data;
|
|
55
|
-
}
|
|
56
49
|
function _pMapSeries() {
|
|
57
50
|
const data = _interopRequireDefault(require("p-map-series"));
|
|
58
51
|
_pMapSeries = function () {
|
|
@@ -104,7 +97,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
104
97
|
// eslint-disable-next-line import/no-unresolved
|
|
105
98
|
class SchemaExtractorContext {
|
|
106
99
|
get mainFile() {
|
|
107
|
-
return (0,
|
|
100
|
+
return (0, _legacy().pathNormalizeToLinux)(this.getPathRelativeToComponent(this.component.mainFile.path));
|
|
108
101
|
}
|
|
109
102
|
get identifiers() {
|
|
110
103
|
return this._identifiers;
|
|
@@ -139,8 +132,8 @@ class SchemaExtractorContext {
|
|
|
139
132
|
* computed nodes by filename and (position (line:character))
|
|
140
133
|
*/
|
|
141
134
|
_defineProperty(this, "_computed", new Map());
|
|
142
|
-
this.componentRootPath = (0,
|
|
143
|
-
this.hostRootPath = (0,
|
|
135
|
+
this.componentRootPath = (0, _legacy().pathNormalizeToLinux)(componentRootPath);
|
|
136
|
+
this.hostRootPath = (0, _legacy().pathNormalizeToLinux)(hostRootPath);
|
|
144
137
|
}
|
|
145
138
|
getComputedNodeKey({
|
|
146
139
|
filePath,
|
|
@@ -154,7 +147,7 @@ class SchemaExtractorContext {
|
|
|
154
147
|
return this.getIdentifierKey(filePath);
|
|
155
148
|
}
|
|
156
149
|
getIdentifierKey(filePath) {
|
|
157
|
-
return (0,
|
|
150
|
+
return (0, _legacy().pathNormalizeToLinux)(filePath);
|
|
158
151
|
}
|
|
159
152
|
setComputed(node) {
|
|
160
153
|
const {
|
|
@@ -205,7 +198,7 @@ class SchemaExtractorContext {
|
|
|
205
198
|
const line = position.line + 1;
|
|
206
199
|
const character = position.character + 1;
|
|
207
200
|
return {
|
|
208
|
-
filePath: (0,
|
|
201
|
+
filePath: (0, _legacy().pathNormalizeToLinux)(filePath),
|
|
209
202
|
line,
|
|
210
203
|
character
|
|
211
204
|
};
|
|
@@ -289,13 +282,13 @@ class SchemaExtractorContext {
|
|
|
289
282
|
}
|
|
290
283
|
isIndexFile(filePath, currentFilePath) {
|
|
291
284
|
const indexFilePath = (0, _path().join)(filePath, 'index');
|
|
292
|
-
return (0,
|
|
285
|
+
return (0, _legacy().pathNormalizeToLinux)(indexFilePath) === currentFilePath;
|
|
293
286
|
}
|
|
294
287
|
findFileInComponent(filePath) {
|
|
295
|
-
const normalizedFilePath = (0,
|
|
288
|
+
const normalizedFilePath = (0, _legacy().pathNormalizeToLinux)(filePath);
|
|
296
289
|
const pathToCompareWithoutExtension = this.getPathWithoutExtension(normalizedFilePath);
|
|
297
290
|
const matchingFile = this.component.filesystem.files.find(file => {
|
|
298
|
-
const currentFilePath = (0,
|
|
291
|
+
const currentFilePath = (0, _legacy().pathNormalizeToLinux)(file.path);
|
|
299
292
|
const currentFilePathWithoutExtension = this.getPathWithoutExtension(currentFilePath);
|
|
300
293
|
const isSameFilePath = pathToCompareWithoutExtension === currentFilePathWithoutExtension;
|
|
301
294
|
const matches = isSameFilePath || this.isIndexFile(pathToCompareWithoutExtension, currentFilePathWithoutExtension);
|
|
@@ -516,10 +509,10 @@ class SchemaExtractorContext {
|
|
|
516
509
|
}
|
|
517
510
|
async resolveTypeRef(identifier, location, isExportedFromMain) {
|
|
518
511
|
const sourceFilePath = identifier.sourceFilePath;
|
|
519
|
-
if (!sourceFilePath || isExportedFromMain && (0,
|
|
512
|
+
if (!sourceFilePath || isExportedFromMain && (0, _legacy().isRelativeImport)(sourceFilePath)) {
|
|
520
513
|
return new (_semanticsEntities().TypeRefSchema)(location, identifier.id, undefined, undefined, !isExportedFromMain ? this.getPathRelativeToComponent(identifier.filePath) : undefined);
|
|
521
514
|
}
|
|
522
|
-
if (!(0,
|
|
515
|
+
if (!(0, _legacy().isRelativeImport)(sourceFilePath)) {
|
|
523
516
|
const pkgName = this.parsePackageNameFromPath(sourceFilePath);
|
|
524
517
|
const compIdByPkg = this.getCompIdByPkgName(pkgName);
|
|
525
518
|
const compIdByPath = await this.extractor.getComponentIDByPath(sourceFilePath);
|
|
@@ -538,7 +531,7 @@ class SchemaExtractorContext {
|
|
|
538
531
|
const compFilePath = this.findFileInComponent(absFilePath);
|
|
539
532
|
if (!compFilePath) {
|
|
540
533
|
// @todo handle this better
|
|
541
|
-
throw new Error(`cannot find file in component \n source file path ${sourceFilePath}\n
|
|
534
|
+
throw new Error(`cannot find file in component \n source file path ${sourceFilePath}\n
|
|
542
535
|
identifier file path ${identifier.filePath}\nrelative dir ${relativeDir}\n
|
|
543
536
|
absFilePath ${absFilePath}`);
|
|
544
537
|
return new (_semanticsEntities().TypeRefSchema)(location, identifier.id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_tsutils","data","require","_typescript","_interopRequireWildcard","_lodash","_utils","_path","_semanticsEntities","_isRelativeImport","_interopRequireDefault","_pMapSeries","_identifierList","_parseTypeFromQuickInfo","_jsdocToDocSchema","_identifier","_exportIdentifier","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","SchemaExtractorContext","mainFile","pathNormalizeToLinux","getPathRelativeToComponent","component","path","identifiers","_identifiers","internalIdentifiers","_internalIdentifiers","computed","_computed","mainFileIdentifierKey","getIdentifierKey","mainModuleIdentifiers","constructor","tsserver","extractor","componentDeps","componentRootPath","hostRootPath","formatter","Map","getComputedNodeKey","filePath","line","character","schema","getIdentifierKeyForNode","node","getSourceFile","fileName","setComputed","location","__schema","key","setIdentifiers","setInternalIdentifiers","existing","uniqueIdentifiers","uniqBy","concat","k","aliasId","id","IdentifierList","findComputedSchemaByName","name","Array","from","values","filter","computeSchema","getLocation","SyntaxKind","kind","existingComputedSchema","computedSchema","transformSchemaNode","transformAPI","targetSourceFile","absolutePath","sourceFile","position","getLineAndCharacterOfPosition","getStart","getLocationAsString","basePath","filesystem","files","base","relative","getSignature","getSignatureHelp","getPath","getPosition","offset","getPositionOfLineAndCharacter","startsWith","join","getQuickInfo","err","message","Error","getQuickInfoDisplayString","quickInfo","body","displayString","typeDefinition","getTypeDefinition","visitTypeDefinition","getPathWithoutExtension","knownExtensions","fileExtension","extname","substring","filePathWithoutExtension","includes","replace","RegExp","isAbsolute","isIndexFile","currentFilePath","indexFilePath","findFileInComponent","normalizedFilePath","pathToCompareWithoutExtension","matchingFile","find","file","currentFilePathWithoutExtension","isSameFilePath","matches","parsePackageNameFromPath","parts","split","length","lastPart","sep","pkgParts","pkgName","getSourceFileInsideComponent","parseSourceFile","getSourceFileFromNode","getFilePathByNode","undefined","def","getDefinition","firstDef","head","definitionInfo","definition","startPosition","start","pos","nodeAtPos","getTokenAtPosition","visitDefinition","getTypeRefForExternalNode","visit","parent","Identifier","SourceFile","references","isExported","isFromComponent","getFileIdentifiers","exportDec","specifierPathStr","ExportDeclaration","moduleSpecifier","getText","specifierPath","absPath","resolve","getIdentifiers","getFileExports","identifier","ExportIdentifier","isExportIdentifier","getFileInternals","computeIdentifiers","headTypeDefinition","headDefinition","unknownExactType","typeStr","isTypeStrFromQuickInfo","InferenceTypeSchema","info","type","parseTypeFromQuickInfo","isDefInSameLocation","loc","resolveType","internalRef","getTypeRef","ts","isTypeNode","definitionNode","definitionNodeName","definitionInternalRef","transformer","getTransformer","getTypeRefForExternalPath","schemaNode","apiTransformer","getAPITransformer","transformedApi","transform","IgnoredSchema","getCompIdByPkgName","dep","packageName","componentId","nodeIdentifierKey","nodeIdentifierList","mainIdentifierList","nodeIdentifier","mainIdentifier","parsedNodeIdentifier","parsedMainIdentifier","isExportedFromMain","resolveTypeRef","sourceFilePath","isRelativeImport","TypeRefSchema","compIdByPkg","compIdByPath","getComponentIDByPath","relativeDir","lastIndexOf","absFilePath","compFilePath","idKey","exportedIdentifier","jsDocToDocSchema","canHaveJsDoc","jsDocs","getJsDoc","jsDoc","linkComments","comment","c","JSDocLink","linkTags","map","linkComment","tagName","tagText","text","tagLocation","TagSchema","commentsWithoutLink","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 TagSchema,\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\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\n const location = this.getLocation(jsDoc);\n // Extract link comments and filter them out from the main comment\n const linkComments = (\n typeof jsDoc.comment !== 'string' ? jsDoc.comment?.filter((c) => c.kind === ts.SyntaxKind.JSDocLink) ?? [] : []\n ) as ts.JSDocLink[];\n const linkTags = linkComments.map((linkComment) => {\n const tagName = 'link';\n const tagText = `${linkComment.name?.getText() ?? ''}${linkComment.text ?? ''}`;\n const tagLocation = this.getLocation(linkComment);\n return new TagSchema(tagLocation, tagName, tagText);\n });\n\n const commentsWithoutLink = (typeof jsDoc.comment !== 'string'\n ? jsDoc.comment?.filter((c) => c.kind !== ts.SyntaxKind.JSDocLink) ?? ''\n : jsDoc.comment) as unknown as ts.NodeArray<ts.JSDocComment>;\n\n const comment = getTextOfJSDocComment(commentsWithoutLink);\n\n const tags = (jsDoc.tags ? await pMapSeries(jsDoc.tags, (tag) => tagParser(tag, this, this.formatter)) : []).concat(\n linkTags\n );\n\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,OA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,CAACjL,WAAW,CAAC6K,WAAW,CAAC;MACjD,OAAO,KAAIK,8BAAS,EAACD,WAAW,EAAEH,OAAO,EAAEC,OAAO,CAAC;IACrD,CAAC,CAAC;IAEF,MAAMI,mBAAmB,GAAI,OAAOb,KAAK,CAACE,OAAO,KAAK,QAAQ,GAC1DF,KAAK,CAACE,OAAO,EAAE1K,MAAM,CAAE2K,CAAC,IAAKA,CAAC,CAACvK,IAAI,KAAKyH,qBAAE,CAAC1H,UAAU,CAACyK,SAAS,CAAC,IAAI,EAAE,GACtEJ,KAAK,CAACE,OAAoD;IAE9D,MAAMA,OAAO,GAAG,IAAAY,mCAAqB,EAACD,mBAAmB,CAAC;IAE1D,MAAME,IAAI,GAAG,CAACf,KAAK,CAACe,IAAI,GAAG,MAAM,IAAAC,qBAAU,EAAChB,KAAK,CAACe,IAAI,EAAGE,GAAG,IAAK,IAAAC,6BAAS,EAACD,GAAG,EAAE,IAAI,EAAE,IAAI,CAACvN,SAAS,CAAC,CAAC,GAAG,EAAE,EAAEoB,MAAM,CACjHuL,QACF,CAAC;IAED,OAAO,KAAIc,8BAAS,EAAC7M,QAAQ,EAAE0L,KAAK,CAACpE,OAAO,CAAC,CAAC,EAAEsE,OAAO,EAAEa,IAAI,CAAC;EAChE;AACF;AAACK,OAAA,CAAA/O,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_tsutils","data","require","_typescript","_interopRequireWildcard","_lodash","_legacy","_path","_semanticsEntities","_pMapSeries","_interopRequireDefault","_identifierList","_parseTypeFromQuickInfo","_jsdocToDocSchema","_identifier","_exportIdentifier","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","SchemaExtractorContext","mainFile","pathNormalizeToLinux","getPathRelativeToComponent","component","path","identifiers","_identifiers","internalIdentifiers","_internalIdentifiers","computed","_computed","mainFileIdentifierKey","getIdentifierKey","mainModuleIdentifiers","constructor","tsserver","extractor","componentDeps","componentRootPath","hostRootPath","formatter","Map","getComputedNodeKey","filePath","line","character","schema","getIdentifierKeyForNode","node","getSourceFile","fileName","setComputed","location","__schema","key","setIdentifiers","setInternalIdentifiers","existing","uniqueIdentifiers","uniqBy","concat","k","aliasId","id","IdentifierList","findComputedSchemaByName","name","Array","from","values","filter","computeSchema","getLocation","SyntaxKind","kind","existingComputedSchema","computedSchema","transformSchemaNode","transformAPI","targetSourceFile","absolutePath","sourceFile","position","getLineAndCharacterOfPosition","getStart","getLocationAsString","basePath","filesystem","files","base","relative","getSignature","getSignatureHelp","getPath","getPosition","offset","getPositionOfLineAndCharacter","startsWith","join","getQuickInfo","err","message","Error","getQuickInfoDisplayString","quickInfo","body","displayString","typeDefinition","getTypeDefinition","visitTypeDefinition","getPathWithoutExtension","knownExtensions","fileExtension","extname","substring","filePathWithoutExtension","includes","replace","RegExp","isAbsolute","isIndexFile","currentFilePath","indexFilePath","findFileInComponent","normalizedFilePath","pathToCompareWithoutExtension","matchingFile","find","file","currentFilePathWithoutExtension","isSameFilePath","matches","parsePackageNameFromPath","parts","split","length","lastPart","sep","pkgParts","pkgName","getSourceFileInsideComponent","parseSourceFile","getSourceFileFromNode","getFilePathByNode","undefined","def","getDefinition","firstDef","head","definitionInfo","definition","startPosition","start","pos","nodeAtPos","getTokenAtPosition","visitDefinition","getTypeRefForExternalNode","visit","parent","Identifier","SourceFile","references","isExported","isFromComponent","getFileIdentifiers","exportDec","specifierPathStr","ExportDeclaration","moduleSpecifier","getText","specifierPath","absPath","resolve","getIdentifiers","getFileExports","identifier","ExportIdentifier","isExportIdentifier","getFileInternals","computeIdentifiers","headTypeDefinition","headDefinition","unknownExactType","typeStr","isTypeStrFromQuickInfo","InferenceTypeSchema","info","type","parseTypeFromQuickInfo","isDefInSameLocation","loc","resolveType","internalRef","getTypeRef","ts","isTypeNode","definitionNode","definitionNodeName","definitionInternalRef","transformer","getTransformer","getTypeRefForExternalPath","schemaNode","apiTransformer","getAPITransformer","transformedApi","transform","IgnoredSchema","getCompIdByPkgName","dep","packageName","componentId","nodeIdentifierKey","nodeIdentifierList","mainIdentifierList","nodeIdentifier","mainIdentifier","parsedNodeIdentifier","parsedMainIdentifier","isExportedFromMain","resolveTypeRef","sourceFilePath","isRelativeImport","TypeRefSchema","compIdByPkg","compIdByPath","getComponentIDByPath","relativeDir","lastIndexOf","absFilePath","compFilePath","idKey","exportedIdentifier","jsDocToDocSchema","canHaveJsDoc","jsDocs","getJsDoc","jsDoc","linkComments","comment","c","JSDocLink","linkTags","map","linkComment","tagName","tagText","text","tagLocation","TagSchema","commentsWithoutLink","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, isRelativeImport } from '@teambit/legacy.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 TagSchema,\n} from '@teambit/semantics.entities.semantic-schema';\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\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\n const location = this.getLocation(jsDoc);\n // Extract link comments and filter them out from the main comment\n const linkComments = (\n typeof jsDoc.comment !== 'string' ? jsDoc.comment?.filter((c) => c.kind === ts.SyntaxKind.JSDocLink) ?? [] : []\n ) as ts.JSDocLink[];\n const linkTags = linkComments.map((linkComment) => {\n const tagName = 'link';\n const tagText = `${linkComment.name?.getText() ?? ''}${linkComment.text ?? ''}`;\n const tagLocation = this.getLocation(linkComment);\n return new TagSchema(tagLocation, tagName, tagText);\n });\n\n const commentsWithoutLink = (typeof jsDoc.comment !== 'string'\n ? jsDoc.comment?.filter((c) => c.kind !== ts.SyntaxKind.JSDocLink) ?? ''\n : jsDoc.comment) as unknown as ts.NodeArray<ts.JSDocComment>;\n\n const comment = getTextOfJSDocComment(commentsWithoutLink);\n\n const tags = (jsDoc.tags ? await pMapSeries(jsDoc.tags, (tag) => tagParser(tag, this, this.formatter)) : []).concat(\n linkTags\n );\n\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,C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MC,OAAO,GAAG,MAAM;MACtB,MAAMC,OAAO,GAAG,GAAGF,WAAW,CAACnL,IAAI,EAAEwG,OAAO,CAAC,CAAC,IAAI,EAAE,GAAG2E,WAAW,CAACG,IAAI,IAAI,EAAE,EAAE;MAC/E,MAAMC,WAAW,GAAG,IAAI,CAACjL,WAAW,CAAC6K,WAAW,CAAC;MACjD,OAAO,KAAIK,8BAAS,EAACD,WAAW,EAAEH,OAAO,EAAEC,OAAO,CAAC;IACrD,CAAC,CAAC;IAEF,MAAMI,mBAAmB,GAAI,OAAOb,KAAK,CAACE,OAAO,KAAK,QAAQ,GAC1DF,KAAK,CAACE,OAAO,EAAE1K,MAAM,CAAE2K,CAAC,IAAKA,CAAC,CAACvK,IAAI,KAAKyH,qBAAE,CAAC1H,UAAU,CAACyK,SAAS,CAAC,IAAI,EAAE,GACtEJ,KAAK,CAACE,OAAoD;IAE9D,MAAMA,OAAO,GAAG,IAAAY,mCAAqB,EAACD,mBAAmB,CAAC;IAE1D,MAAME,IAAI,GAAG,CAACf,KAAK,CAACe,IAAI,GAAG,MAAM,IAAAC,qBAAU,EAAChB,KAAK,CAACe,IAAI,EAAGE,GAAG,IAAK,IAAAC,6BAAS,EAACD,GAAG,EAAE,IAAI,EAAE,IAAI,CAACvN,SAAS,CAAC,CAAC,GAAG,EAAE,EAAEoB,MAAM,CACjHuL,QACF,CAAC;IAED,OAAO,KAAIc,8BAAS,EAAC7M,QAAQ,EAAE0L,KAAK,CAACpE,OAAO,CAAC,CAAC,EAAEsE,OAAO,EAAEa,IAAI,CAAC;EAChE;AACF;AAACK,OAAA,CAAA/O,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/typescript",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.331",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/typescript/typescript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.typescript",
|
|
8
8
|
"name": "typescript",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.331"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -16,26 +16,27 @@
|
|
|
16
16
|
"get-tsconfig": "4.2.0",
|
|
17
17
|
"fs-extra": "10.0.0",
|
|
18
18
|
"chalk": "2.4.2",
|
|
19
|
-
"@teambit/typescript.typescript-compiler": "2.0.
|
|
19
|
+
"@teambit/typescript.typescript-compiler": "2.0.41",
|
|
20
20
|
"@teambit/harmony": "0.4.6",
|
|
21
|
-
"@teambit/compiler": "1.0.
|
|
21
|
+
"@teambit/compiler": "1.0.331",
|
|
22
22
|
"@teambit/typescript.modules.ts-config-mutator": "0.0.83",
|
|
23
|
-
"@teambit/builder": "1.0.
|
|
24
|
-
"@teambit/isolator": "1.0.
|
|
25
|
-
"@teambit/component": "1.0.
|
|
26
|
-
"@teambit/dependency-resolver": "1.0.
|
|
27
|
-
"@teambit/formatter": "1.0.
|
|
23
|
+
"@teambit/builder": "1.0.331",
|
|
24
|
+
"@teambit/isolator": "1.0.331",
|
|
25
|
+
"@teambit/component": "1.0.331",
|
|
26
|
+
"@teambit/dependency-resolver": "1.0.331",
|
|
27
|
+
"@teambit/formatter": "1.0.331",
|
|
28
|
+
"@teambit/legacy.utils": "0.0.3",
|
|
28
29
|
"@teambit/semantics.entities.semantic-schema": "0.0.70",
|
|
29
30
|
"@teambit/ts-server": "0.0.56",
|
|
30
|
-
"@teambit/aspect-loader": "1.0.
|
|
31
|
-
"@teambit/envs": "1.0.
|
|
32
|
-
"@teambit/logger": "0.0.
|
|
33
|
-
"@teambit/schema": "1.0.
|
|
34
|
-
"@teambit/scope": "1.0.
|
|
35
|
-
"@teambit/workspace": "1.0.
|
|
36
|
-
"@teambit/cli": "0.0.
|
|
37
|
-
"@teambit/pkg": "1.0.
|
|
38
|
-
"@teambit/watcher": "1.0.
|
|
31
|
+
"@teambit/aspect-loader": "1.0.331",
|
|
32
|
+
"@teambit/envs": "1.0.331",
|
|
33
|
+
"@teambit/logger": "0.0.1001",
|
|
34
|
+
"@teambit/schema": "1.0.331",
|
|
35
|
+
"@teambit/scope": "1.0.331",
|
|
36
|
+
"@teambit/workspace": "1.0.331",
|
|
37
|
+
"@teambit/cli": "0.0.908",
|
|
38
|
+
"@teambit/pkg": "1.0.331",
|
|
39
|
+
"@teambit/watcher": "1.0.331"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
42
|
"@types/lodash": "4.14.165",
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
"chai": "4.3.0",
|
|
44
45
|
"@types/fs-extra": "9.0.7",
|
|
45
46
|
"@types/mocha": "9.1.0",
|
|
46
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.
|
|
47
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.42",
|
|
47
48
|
"@teambit/typescript.aspect-docs.typescript": "0.0.168"
|
|
48
49
|
},
|
|
49
50
|
"peerDependencies": {
|