@teambit/typescript 1.0.632 → 1.0.634
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.
|
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.634/dist/typescript.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.634/dist/typescript.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
@@ -4,6 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.ExportAssignmentTransformer = void 0;
|
7
|
+
function _semanticsEntities() {
|
8
|
+
const data = require("@teambit/semantics.entities.semantic-schema");
|
9
|
+
_semanticsEntities = function () {
|
10
|
+
return data;
|
11
|
+
};
|
12
|
+
return data;
|
13
|
+
}
|
7
14
|
function _typescript() {
|
8
15
|
const data = require("typescript");
|
9
16
|
_typescript = function () {
|
@@ -27,12 +34,17 @@ class ExportAssignmentTransformer {
|
|
27
34
|
return node.kind === _typescript().SyntaxKind.ExportAssignment;
|
28
35
|
}
|
29
36
|
async getIdentifiers(exportDec) {
|
30
|
-
|
31
|
-
return [new (_exportIdentifier().ExportIdentifier)(specifier.getText(), exportDec.getSourceFile().fileName)];
|
37
|
+
return [new (_exportIdentifier().ExportIdentifier)('default', exportDec.getSourceFile().fileName)];
|
32
38
|
}
|
33
39
|
async transform(exportDec, context) {
|
34
40
|
const specifier = exportDec.expression;
|
35
|
-
|
41
|
+
const location = context.getLocation(exportDec);
|
42
|
+
const absoluteFilePath = exportDec.getSourceFile().fileName;
|
43
|
+
const exportNode = await context.getTypeRef(specifier.getText(), absoluteFilePath, location);
|
44
|
+
if (exportNode) {
|
45
|
+
return new (_semanticsEntities().ExportSchema)(location, 'default', exportNode);
|
46
|
+
}
|
47
|
+
return new (_semanticsEntities().ExportSchema)(location, 'default', await context.computeSchema(specifier));
|
36
48
|
}
|
37
49
|
}
|
38
50
|
exports.ExportAssignmentTransformer = ExportAssignmentTransformer;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_semanticsEntities","data","require","_typescript","_exportIdentifier","ExportAssignmentTransformer","predicate","node","kind","SyntaxKind","ExportAssignment","getIdentifiers","exportDec","ExportIdentifier","getSourceFile","fileName","transform","context","specifier","expression","location","getLocation","absoluteFilePath","exportNode","getTypeRef","getText","ExportSchema","computeSchema","exports"],"sources":["export-assignment.ts"],"sourcesContent":["import { ExportSchema, SchemaNode } from '@teambit/semantics.entities.semantic-schema';\nimport { Node, SyntaxKind, ExportAssignment as ExportAssignmentNode } from 'typescript';\nimport { ExportIdentifier } from '../export-identifier';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { SchemaTransformer } from '../schema-transformer';\n\n/**\n * This is either an export = or an export default declaration.\n * Unless isExportEquals is set, this node was parsed as an export default\n */\nexport class ExportAssignmentTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.ExportAssignment;\n }\n\n async getIdentifiers(exportDec: ExportAssignmentNode) {\n return [new ExportIdentifier('default', exportDec.getSourceFile().fileName)];\n }\n\n async transform(exportDec: ExportAssignmentNode, context: SchemaExtractorContext): Promise<SchemaNode> {\n const specifier = exportDec.expression;\n const location = context.getLocation(exportDec);\n const absoluteFilePath = exportDec.getSourceFile().fileName;\n\n const exportNode = await context.getTypeRef(specifier.getText(), absoluteFilePath, location);\n\n if (exportNode) {\n return new ExportSchema(location, 'default', exportNode);\n }\n\n return new ExportSchema(location, 'default', await context.compute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E,SAAS,EAAE,MAAMH,OAAO,CAACU,aAAa,CAACT,SAAS,CAAC,CAAC;EACtF;AACF;AAACU,OAAA,CAAAvB,2BAAA,GAAAA,2BAAA","ignoreList":[]}
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/typescript",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.634",
|
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.634"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"lodash": "4.17.21",
|
@@ -18,25 +18,25 @@
|
|
18
18
|
"chalk": "4.1.2",
|
19
19
|
"@teambit/typescript.typescript-compiler": "2.0.58",
|
20
20
|
"@teambit/harmony": "0.4.7",
|
21
|
-
"@teambit/compiler": "1.0.
|
21
|
+
"@teambit/compiler": "1.0.634",
|
22
22
|
"@teambit/typescript.modules.ts-config-mutator": "0.0.85",
|
23
|
-
"@teambit/builder": "1.0.
|
23
|
+
"@teambit/builder": "1.0.634",
|
24
24
|
"@teambit/component.sources": "0.0.104",
|
25
|
-
"@teambit/component": "1.0.
|
26
|
-
"@teambit/dependency-resolver": "1.0.
|
27
|
-
"@teambit/formatter": "1.0.
|
25
|
+
"@teambit/component": "1.0.634",
|
26
|
+
"@teambit/dependency-resolver": "1.0.634",
|
27
|
+
"@teambit/formatter": "1.0.634",
|
28
28
|
"@teambit/legacy.utils": "0.0.21",
|
29
|
-
"@teambit/semantics.entities.semantic-schema": "0.0.
|
29
|
+
"@teambit/semantics.entities.semantic-schema": "0.0.87",
|
30
30
|
"@teambit/ts-server": "0.0.63",
|
31
|
-
"@teambit/aspect-loader": "1.0.
|
32
|
-
"@teambit/envs": "1.0.
|
33
|
-
"@teambit/logger": "0.0.
|
34
|
-
"@teambit/schema": "1.0.
|
35
|
-
"@teambit/scope": "1.0.
|
36
|
-
"@teambit/workspace": "1.0.
|
37
|
-
"@teambit/cli": "0.0.
|
38
|
-
"@teambit/pkg": "1.0.
|
39
|
-
"@teambit/watcher": "1.0.
|
31
|
+
"@teambit/aspect-loader": "1.0.634",
|
32
|
+
"@teambit/envs": "1.0.634",
|
33
|
+
"@teambit/logger": "0.0.1304",
|
34
|
+
"@teambit/schema": "1.0.634",
|
35
|
+
"@teambit/scope": "1.0.634",
|
36
|
+
"@teambit/workspace": "1.0.634",
|
37
|
+
"@teambit/cli": "0.0.1211",
|
38
|
+
"@teambit/pkg": "1.0.634",
|
39
|
+
"@teambit/watcher": "1.0.634",
|
40
40
|
"@teambit/legacy.constants": "0.0.11"
|
41
41
|
},
|
42
42
|
"devDependencies": {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { SchemaNode } from '@teambit/semantics.entities.semantic-schema';
|
1
|
+
import { ExportSchema, SchemaNode } from '@teambit/semantics.entities.semantic-schema';
|
2
2
|
import { Node, SyntaxKind, ExportAssignment as ExportAssignmentNode } from 'typescript';
|
3
3
|
import { ExportIdentifier } from '../export-identifier';
|
4
4
|
import { SchemaExtractorContext } from '../schema-extractor-context';
|
@@ -14,12 +14,20 @@ export class ExportAssignmentTransformer implements SchemaTransformer {
|
|
14
14
|
}
|
15
15
|
|
16
16
|
async getIdentifiers(exportDec: ExportAssignmentNode) {
|
17
|
-
|
18
|
-
return [new ExportIdentifier(specifier.getText(), exportDec.getSourceFile().fileName)];
|
17
|
+
return [new ExportIdentifier('default', exportDec.getSourceFile().fileName)];
|
19
18
|
}
|
20
19
|
|
21
20
|
async transform(exportDec: ExportAssignmentNode, context: SchemaExtractorContext): Promise<SchemaNode> {
|
22
21
|
const specifier = exportDec.expression;
|
23
|
-
|
22
|
+
const location = context.getLocation(exportDec);
|
23
|
+
const absoluteFilePath = exportDec.getSourceFile().fileName;
|
24
|
+
|
25
|
+
const exportNode = await context.getTypeRef(specifier.getText(), absoluteFilePath, location);
|
26
|
+
|
27
|
+
if (exportNode) {
|
28
|
+
return new ExportSchema(location, 'default', exportNode);
|
29
|
+
}
|
30
|
+
|
31
|
+
return new ExportSchema(location, 'default', await context.computeSchema(specifier));
|
24
32
|
}
|
25
33
|
}
|