@teambit/typescript 1.0.533 → 1.0.535

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.533/dist/typescript.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.533/dist/typescript.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.535/dist/typescript.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.535/dist/typescript.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -98,10 +98,10 @@ async function namedExport(exportClause, context) {
98
98
  }
99
99
  async function exportSpecifierToSchemaNode(element, context) {
100
100
  try {
101
- const definitionInfo = await context.definitionInfo(element);
102
101
  const name = element.propertyName?.getText() || element.name.getText();
103
102
  const alias = element.propertyName ? element.name.getText() : undefined;
104
103
  const location = context.getLocation(element.name);
104
+ const definitionInfo = element.isTypeOnly ? await context.definitionInfo(element.name) : await context.definitionInfo(element);
105
105
  if (!definitionInfo) {
106
106
  const exportNode = new (_semanticsEntities().UnresolvedSchema)(location, element.name.getText());
107
107
  // happens for example when the main index.ts file exports variable from an mdx file.
@@ -1 +1 @@
1
- {"version":3,"names":["_semanticsEntities","data","require","_typescript","_interopRequireWildcard","_exportIdentifier","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ExportDeclarationTransformer","predicate","node","kind","SyntaxKind","ExportDeclaration","getIdentifiers","exportDec","context","rawSourceFilePath","moduleSpecifier","getText","sourceFilePath","substring","length","exportClause","ts","NamedExports","elements","map","elm","alias","propertyName","name","undefined","id","fileName","getSourceFile","ExportIdentifier","NamespaceExport","getFileExports","transform","specifier","Error","sourceFile","getSourceFileFromNode","UnImplementedSchema","getLocation","computeSchema","schemas","namedExport","ModuleSchema","namespaceExport","exports","isSameNode","nodeA","nodeB","pos","end","Promise","all","element","exportSpecifierToSchemaNode","definitionInfo","location","exportNode","UnresolvedSchema","ExportSchema","definitionNode","definition","resolveType","parent","getLocationAsString","ExportSpecifier","namespace","filePath","getFilePathByNode","getSourceFileInsideComponent","getTypeRefForExternalPath","result"],"sources":["export-declaration.ts"],"sourcesContent":["import {\n SchemaNode,\n ModuleSchema,\n UnresolvedSchema,\n UnImplementedSchema,\n ExportSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport ts, {\n Node,\n SyntaxKind,\n ExportDeclaration as ExportDeclarationNode,\n NamedExports,\n NamespaceExport,\n ExportSpecifier,\n} from 'typescript';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { ExportIdentifier } from '../export-identifier';\n\nexport class ExportDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.ExportDeclaration;\n }\n\n async getIdentifiers(exportDec: ExportDeclarationNode, context: SchemaExtractorContext) {\n // e.g. `export { button1, button2 } as Composition from './button';\n const rawSourceFilePath = exportDec.moduleSpecifier?.getText();\n\n // strip off quotes ''\n const sourceFilePath = rawSourceFilePath && rawSourceFilePath.substring(1, rawSourceFilePath?.length - 1);\n\n if (exportDec.exportClause?.kind === ts.SyntaxKind.NamedExports) {\n return exportDec.exportClause.elements.map((elm) => {\n const alias = (elm.propertyName && elm.name.getText()) || undefined;\n const id = elm.propertyName?.getText() || elm.name.getText();\n const fileName = elm.getSourceFile().fileName;\n\n return new ExportIdentifier(id, fileName, alias, sourceFilePath);\n });\n }\n\n // e.g. `export * as Composition from './button';\n if (exportDec.exportClause?.kind === ts.SyntaxKind.NamespaceExport) {\n return [\n new ExportIdentifier(\n exportDec.exportClause.name.getText(),\n exportDec.getSourceFile().fileName,\n undefined,\n sourceFilePath\n ),\n ];\n }\n\n if (exportDec.moduleSpecifier) {\n return context.getFileExports(exportDec);\n }\n\n return [];\n }\n\n async transform(exportDec: ExportDeclarationNode, context: SchemaExtractorContext): Promise<SchemaNode> {\n const exportClause = exportDec.exportClause;\n\n // it's export-all, e.g. `export * from './button'`;\n if (!exportClause) {\n const specifier = exportDec.moduleSpecifier;\n if (!specifier) {\n throw new Error(`fatal: no specifier`);\n }\n const sourceFile = await context.getSourceFileFromNode(specifier);\n // export * from 'webpack', export-all from a package\n if (!sourceFile) {\n return new UnImplementedSchema(\n context.getLocation(exportDec),\n exportDec.getText(),\n SyntaxKind[SyntaxKind.ExportDeclaration]\n );\n }\n return context.computeSchema(sourceFile);\n }\n\n // e.g. `export { button1, button2 } as Composition from './button';\n if (exportClause.kind === SyntaxKind.NamedExports) {\n const schemas = await namedExport(exportClause, context);\n return new ModuleSchema(context.getLocation(exportDec), schemas, []);\n }\n // e.g. `export * as Composition from './button';\n if (exportClause.kind === SyntaxKind.NamespaceExport) {\n return namespaceExport(exportClause, exportDec, context);\n }\n\n // should never reach here. exportClause can be either NamespaceExport or NamedExports\n throw new Error(`unrecognized exportClause type`);\n }\n}\n\nfunction isSameNode(nodeA: Node, nodeB: Node): boolean {\n return nodeA.kind === nodeB.kind && nodeA.pos === nodeB.pos && nodeA.end === nodeB.end;\n}\n\nasync function namedExport(exportClause: NamedExports, context: SchemaExtractorContext): Promise<ExportSchema[]> {\n const schemas = await Promise.all(\n exportClause.elements.map(async (element) => {\n return exportSpecifierToSchemaNode(element, context);\n })\n );\n\n return schemas;\n}\n\nasync function exportSpecifierToSchemaNode(\n element: ExportSpecifier,\n context: SchemaExtractorContext\n): Promise<ExportSchema> {\n try {\n const definitionInfo = await context.definitionInfo(element);\n const name = element.propertyName?.getText() || element.name.getText();\n const alias = element.propertyName ? element.name.getText() : undefined;\n const location = context.getLocation(element.name);\n\n if (!definitionInfo) {\n const exportNode = new UnresolvedSchema(location, element.name.getText());\n // happens for example when the main index.ts file exports variable from an mdx file.\n // tsserver is unable to get the definition node because it doesn't know to parse mdx files.\n // return new UnresolvedSchema(context.getLocation(element.name), element.name.getText());\n return new ExportSchema(location, name, exportNode, alias);\n }\n\n const definitionNode = await context.definition(definitionInfo);\n\n if (!definitionNode) {\n const exportNode = await context.resolveType(element, name, false);\n return new ExportSchema(location, name, exportNode, alias);\n }\n\n // if it is reexported from another export\n if (isSameNode(element, definitionNode.parent)) {\n // the definition node is the same node as element.name. tsserver wasn't able to find the source for it\n // normally, \"bit install\" should fix it. another option is to open vscode and look for errors.\n throw new Error(`error: tsserver is unable to locate the identifier \"${element.name.getText()}\" at ${context.getLocationAsString(\n element.name\n )}.\nmake sure \"bit status\" is clean and there are no errors about missing packages/links.\nalso, make sure the tsconfig.json in the root has the \"jsx\" setting defined.`);\n }\n\n if (definitionNode.parent.kind === SyntaxKind.ExportSpecifier) {\n return await exportSpecifierToSchemaNode(definitionNode.parent as ExportSpecifier, context);\n }\n\n const exportNode = await context.computeSchema(definitionNode.parent);\n return new ExportSchema(location, name, exportNode, alias);\n } catch {\n const exportNode = new UnresolvedSchema(context.getLocation(element.name), element.name.getText());\n return new ExportSchema(context.getLocation(element.name), element.name.getText(), exportNode);\n }\n}\n\nasync function namespaceExport(\n exportClause: NamespaceExport,\n exportDec: ExportDeclarationNode,\n context: SchemaExtractorContext\n) {\n const namespace = exportClause.name.getText();\n const filePath = await context.getFilePathByNode(exportClause.name);\n if (!filePath) {\n throw new Error(`unable to find the file-path for \"${namespace}\"`);\n }\n const sourceFile = context.getSourceFileInsideComponent(filePath);\n if (!sourceFile) {\n // it's a namespace from another component or an external package.\n return context.getTypeRefForExternalPath(namespace, filePath, context.getLocation(exportDec));\n }\n const result = await context.computeSchema(sourceFile);\n if (!(result instanceof ModuleSchema)) {\n throw new Error(`expect result to be instance of Module`);\n }\n result.namespace = namespace;\n return result;\n}\n"],"mappings":";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UAAU,GAAG,KAAIC,qCAAgB,EAAChD,OAAO,CAAC6B,WAAW,CAACc,OAAO,CAAC5B,IAAI,CAAC,EAAE4B,OAAO,CAAC5B,IAAI,CAACZ,OAAO,CAAC,CAAC,CAAC;IAClG,OAAO,KAAI8C,iCAAY,EAACjD,OAAO,CAAC6B,WAAW,CAACc,OAAO,CAAC5B,IAAI,CAAC,EAAE4B,OAAO,CAAC5B,IAAI,CAACZ,OAAO,CAAC,CAAC,EAAE4C,UAAU,CAAC;EAChG;AACF;AAEA,eAAeb,eAAeA,CAC5B3B,YAA6B,EAC7BR,SAAgC,EAChCC,OAA+B,EAC/B;EACA,MAAMwD,SAAS,GAAGjD,YAAY,CAACQ,IAAI,CAACZ,OAAO,CAAC,CAAC;EAC7C,MAAMsD,QAAQ,GAAG,MAAMzD,OAAO,CAAC0D,iBAAiB,CAACnD,YAAY,CAACQ,IAAI,CAAC;EACnE,IAAI,CAAC0C,QAAQ,EAAE;IACb,MAAM,IAAIhC,KAAK,CAAC,qCAAqC+B,SAAS,GAAG,CAAC;EACpE;EACA,MAAM9B,UAAU,GAAG1B,OAAO,CAAC2D,4BAA4B,CAACF,QAAQ,CAAC;EACjE,IAAI,CAAC/B,UAAU,EAAE;IACf;IACA,OAAO1B,OAAO,CAAC4D,yBAAyB,CAACJ,SAAS,EAAEC,QAAQ,EAAEzD,OAAO,CAAC6B,WAAW,CAAC9B,SAAS,CAAC,CAAC;EAC/F;EACA,MAAM8D,MAAM,GAAG,MAAM7D,OAAO,CAAC8B,aAAa,CAACJ,UAAU,CAAC;EACtD,IAAI,EAAEmC,MAAM,YAAY5B,iCAAY,CAAC,EAAE;IACrC,MAAM,IAAIR,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EACAoC,MAAM,CAACL,SAAS,GAAGA,SAAS;EAC5B,OAAOK,MAAM;AACf","ignoreList":[]}
1
+ {"version":3,"names":["_semanticsEntities","data","require","_typescript","_interopRequireWildcard","_exportIdentifier","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ExportDeclarationTransformer","predicate","node","kind","SyntaxKind","ExportDeclaration","getIdentifiers","exportDec","context","rawSourceFilePath","moduleSpecifier","getText","sourceFilePath","substring","length","exportClause","ts","NamedExports","elements","map","elm","alias","propertyName","name","undefined","id","fileName","getSourceFile","ExportIdentifier","NamespaceExport","getFileExports","transform","specifier","Error","sourceFile","getSourceFileFromNode","UnImplementedSchema","getLocation","computeSchema","schemas","namedExport","ModuleSchema","namespaceExport","exports","isSameNode","nodeA","nodeB","pos","end","Promise","all","element","exportSpecifierToSchemaNode","location","definitionInfo","isTypeOnly","exportNode","UnresolvedSchema","ExportSchema","definitionNode","definition","resolveType","parent","getLocationAsString","ExportSpecifier","namespace","filePath","getFilePathByNode","getSourceFileInsideComponent","getTypeRefForExternalPath","result"],"sources":["export-declaration.ts"],"sourcesContent":["import {\n SchemaNode,\n ModuleSchema,\n UnresolvedSchema,\n UnImplementedSchema,\n ExportSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport ts, {\n Node,\n SyntaxKind,\n ExportDeclaration as ExportDeclarationNode,\n NamedExports,\n NamespaceExport,\n ExportSpecifier,\n} from 'typescript';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { ExportIdentifier } from '../export-identifier';\n\nexport class ExportDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.ExportDeclaration;\n }\n\n async getIdentifiers(exportDec: ExportDeclarationNode, context: SchemaExtractorContext) {\n // e.g. `export { button1, button2 } as Composition from './button';\n const rawSourceFilePath = exportDec.moduleSpecifier?.getText();\n\n // strip off quotes ''\n const sourceFilePath = rawSourceFilePath && rawSourceFilePath.substring(1, rawSourceFilePath?.length - 1);\n\n if (exportDec.exportClause?.kind === ts.SyntaxKind.NamedExports) {\n return exportDec.exportClause.elements.map((elm) => {\n const alias = (elm.propertyName && elm.name.getText()) || undefined;\n const id = elm.propertyName?.getText() || elm.name.getText();\n const fileName = elm.getSourceFile().fileName;\n\n return new ExportIdentifier(id, fileName, alias, sourceFilePath);\n });\n }\n\n // e.g. `export * as Composition from './button';\n if (exportDec.exportClause?.kind === ts.SyntaxKind.NamespaceExport) {\n return [\n new ExportIdentifier(\n exportDec.exportClause.name.getText(),\n exportDec.getSourceFile().fileName,\n undefined,\n sourceFilePath\n ),\n ];\n }\n\n if (exportDec.moduleSpecifier) {\n return context.getFileExports(exportDec);\n }\n\n return [];\n }\n\n async transform(exportDec: ExportDeclarationNode, context: SchemaExtractorContext): Promise<SchemaNode> {\n const exportClause = exportDec.exportClause;\n\n // it's export-all, e.g. `export * from './button'`;\n if (!exportClause) {\n const specifier = exportDec.moduleSpecifier;\n if (!specifier) {\n throw new Error(`fatal: no specifier`);\n }\n const sourceFile = await context.getSourceFileFromNode(specifier);\n // export * from 'webpack', export-all from a package\n if (!sourceFile) {\n return new UnImplementedSchema(\n context.getLocation(exportDec),\n exportDec.getText(),\n SyntaxKind[SyntaxKind.ExportDeclaration]\n );\n }\n return context.computeSchema(sourceFile);\n }\n\n // e.g. `export { button1, button2 } as Composition from './button';\n if (exportClause.kind === SyntaxKind.NamedExports) {\n const schemas = await namedExport(exportClause, context);\n return new ModuleSchema(context.getLocation(exportDec), schemas, []);\n }\n // e.g. `export * as Composition from './button';\n if (exportClause.kind === SyntaxKind.NamespaceExport) {\n return namespaceExport(exportClause, exportDec, context);\n }\n\n // should never reach here. exportClause can be either NamespaceExport or NamedExports\n throw new Error(`unrecognized exportClause type`);\n }\n}\n\nfunction isSameNode(nodeA: Node, nodeB: Node): boolean {\n return nodeA.kind === nodeB.kind && nodeA.pos === nodeB.pos && nodeA.end === nodeB.end;\n}\n\nasync function namedExport(exportClause: NamedExports, context: SchemaExtractorContext): Promise<ExportSchema[]> {\n const schemas = await Promise.all(\n exportClause.elements.map(async (element) => {\n return exportSpecifierToSchemaNode(element, context);\n })\n );\n\n return schemas;\n}\n\nasync function exportSpecifierToSchemaNode(\n element: ExportSpecifier,\n context: SchemaExtractorContext\n): Promise<ExportSchema> {\n try {\n const name = element.propertyName?.getText() || element.name.getText();\n const alias = element.propertyName ? element.name.getText() : undefined;\n const location = context.getLocation(element.name);\n const definitionInfo = element.isTypeOnly\n ? await context.definitionInfo(element.name)\n : await context.definitionInfo(element);\n\n if (!definitionInfo) {\n const exportNode = new UnresolvedSchema(location, element.name.getText());\n // happens for example when the main index.ts file exports variable from an mdx file.\n // tsserver is unable to get the definition node because it doesn't know to parse mdx files.\n // return new UnresolvedSchema(context.getLocation(element.name), element.name.getText());\n return new ExportSchema(location, name, exportNode, alias);\n }\n\n const definitionNode = await context.definition(definitionInfo);\n\n if (!definitionNode) {\n const exportNode = await context.resolveType(element, name, false);\n return new ExportSchema(location, name, exportNode, alias);\n }\n\n // if it is reexported from another export\n if (isSameNode(element, definitionNode.parent)) {\n // the definition node is the same node as element.name. tsserver wasn't able to find the source for it\n // normally, \"bit install\" should fix it. another option is to open vscode and look for errors.\n throw new Error(`error: tsserver is unable to locate the identifier \"${element.name.getText()}\" at ${context.getLocationAsString(\n element.name\n )}.\nmake sure \"bit status\" is clean and there are no errors about missing packages/links.\nalso, make sure the tsconfig.json in the root has the \"jsx\" setting defined.`);\n }\n\n if (definitionNode.parent.kind === SyntaxKind.ExportSpecifier) {\n return await exportSpecifierToSchemaNode(definitionNode.parent as ExportSpecifier, context);\n }\n\n const exportNode = await context.computeSchema(definitionNode.parent);\n return new ExportSchema(location, name, exportNode, alias);\n } catch {\n const exportNode = new UnresolvedSchema(context.getLocation(element.name), element.name.getText());\n return new ExportSchema(context.getLocation(element.name), element.name.getText(), exportNode);\n }\n}\n\nasync function namespaceExport(\n exportClause: NamespaceExport,\n exportDec: ExportDeclarationNode,\n context: SchemaExtractorContext\n) {\n const namespace = exportClause.name.getText();\n const filePath = await context.getFilePathByNode(exportClause.name);\n if (!filePath) {\n throw new Error(`unable to find the file-path for \"${namespace}\"`);\n }\n const sourceFile = context.getSourceFileInsideComponent(filePath);\n if (!sourceFile) {\n // it's a namespace from another component or an external package.\n return context.getTypeRefForExternalPath(namespace, filePath, context.getLocation(exportDec));\n }\n const result = await context.computeSchema(sourceFile);\n if (!(result instanceof ModuleSchema)) {\n throw new Error(`expect result to be instance of Module`);\n }\n result.namespace = namespace;\n return result;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAUA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAwD,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,c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C,CAAC;EAC/F;EACA,MAAM+D,MAAM,GAAG,MAAM9D,OAAO,CAAC8B,aAAa,CAACJ,UAAU,CAAC;EACtD,IAAI,EAAEoC,MAAM,YAAY7B,iCAAY,CAAC,EAAE;IACrC,MAAM,IAAIR,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EACAqC,MAAM,CAACL,SAAS,GAAGA,SAAS;EAC5B,OAAOK,MAAM;AACf","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/typescript",
3
- "version": "1.0.533",
3
+ "version": "1.0.535",
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.533"
9
+ "version": "1.0.535"
10
10
  },
11
11
  "dependencies": {
12
12
  "lodash": "4.17.21",
@@ -18,26 +18,26 @@
18
18
  "chalk": "2.4.2",
19
19
  "@teambit/typescript.typescript-compiler": "2.0.46",
20
20
  "@teambit/harmony": "0.4.6",
21
- "@teambit/compiler": "1.0.533",
21
+ "@teambit/compiler": "1.0.535",
22
22
  "@teambit/typescript.modules.ts-config-mutator": "0.0.85",
23
- "@teambit/builder": "1.0.533",
24
- "@teambit/component.sources": "0.0.78",
25
- "@teambit/component": "1.0.533",
26
- "@teambit/dependency-resolver": "1.0.533",
27
- "@teambit/formatter": "1.0.533",
28
- "@teambit/legacy.utils": "0.0.15",
29
- "@teambit/semantics.entities.semantic-schema": "0.0.78",
30
- "@teambit/ts-server": "0.0.60",
31
- "@teambit/aspect-loader": "1.0.533",
32
- "@teambit/envs": "1.0.533",
33
- "@teambit/logger": "0.0.1203",
34
- "@teambit/schema": "1.0.533",
35
- "@teambit/scope": "1.0.533",
36
- "@teambit/workspace": "1.0.533",
37
- "@teambit/cli": "0.0.1110",
38
- "@teambit/pkg": "1.0.533",
39
- "@teambit/watcher": "1.0.533",
40
- "@teambit/legacy.constants": "0.0.8"
23
+ "@teambit/builder": "1.0.535",
24
+ "@teambit/component.sources": "0.0.79",
25
+ "@teambit/component": "1.0.535",
26
+ "@teambit/dependency-resolver": "1.0.535",
27
+ "@teambit/formatter": "1.0.535",
28
+ "@teambit/legacy.utils": "0.0.16",
29
+ "@teambit/semantics.entities.semantic-schema": "0.0.79",
30
+ "@teambit/ts-server": "0.0.61",
31
+ "@teambit/aspect-loader": "1.0.535",
32
+ "@teambit/envs": "1.0.535",
33
+ "@teambit/logger": "0.0.1205",
34
+ "@teambit/schema": "1.0.535",
35
+ "@teambit/scope": "1.0.535",
36
+ "@teambit/workspace": "1.0.535",
37
+ "@teambit/cli": "0.0.1112",
38
+ "@teambit/pkg": "1.0.535",
39
+ "@teambit/watcher": "1.0.535",
40
+ "@teambit/legacy.constants": "0.0.9"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/lodash": "4.14.165",
@@ -113,10 +113,12 @@ async function exportSpecifierToSchemaNode(
113
113
  context: SchemaExtractorContext
114
114
  ): Promise<ExportSchema> {
115
115
  try {
116
- const definitionInfo = await context.definitionInfo(element);
117
116
  const name = element.propertyName?.getText() || element.name.getText();
118
117
  const alias = element.propertyName ? element.name.getText() : undefined;
119
118
  const location = context.getLocation(element.name);
119
+ const definitionInfo = element.isTypeOnly
120
+ ? await context.definitionInfo(element.name)
121
+ : await context.definitionInfo(element);
120
122
 
121
123
  if (!definitionInfo) {
122
124
  const exportNode = new UnresolvedSchema(location, element.name.getText());