@code-to-json/core-linker
Advanced tools
Comparing version 1.0.0-rc.26 to 1.0.0-rc.27
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.0.0-rc.27](https://github.com/mike-north/code-to-json/compare/@code-to-json/core-linker@1.0.0-rc.26...@code-to-json/core-linker@1.0.0-rc.27) (2019-02-23) | ||
### Features | ||
* **core-linker:** aliased symbol support ([85329b3](https://github.com/mike-north/code-to-json/commit/85329b3)) | ||
# [1.0.0-rc.26](https://github.com/mike-north/code-to-json/compare/@code-to-json/core-linker@1.0.0-rc.25...@code-to-json/core-linker@1.0.0-rc.26) (2019-02-23) | ||
@@ -8,0 +19,0 @@ |
@@ -57,4 +57,4 @@ "use strict"; | ||
}; | ||
[type.constructorSignatures, type.callSignatures].filter(utils_1.isDefined).forEach((sigList) => { | ||
sigList.forEach((sig) => linkSignature(sig, res)); | ||
[type.constructorSignatures, type.callSignatures].filter(utils_1.isDefined).forEach(sigList => { | ||
sigList.forEach(sig => linkSignature(sig, res)); | ||
}); | ||
@@ -81,4 +81,4 @@ if (type.conditionalInfo) { | ||
.filter(utils_1.isDefined) | ||
.forEach((fileRefList) => { | ||
fileRefList.forEach((fr) => linkFileReference(fr, res)); | ||
.forEach(fileRefList => { | ||
fileRefList.forEach(fr => linkFileReference(fr, res)); | ||
}); | ||
@@ -91,3 +91,3 @@ Object.assign(sym, utils_2.pruneUndefinedValues(newData)); | ||
} | ||
const { symbolType, valueDeclaration, valueDeclarationType, exports, members, decorators, sourceFile, globalExports, relatedSymbols, heritageClauses } = sym; | ||
const { symbolType, valueDeclaration, valueDeclarationType, exports, members, decorators, sourceFile, globalExports, relatedSymbols, heritageClauses, aliasedSymbol, } = sym; | ||
const hcs = heritageClauses; | ||
@@ -104,7 +104,8 @@ const newData = { | ||
valueDeclaration: res(valueDeclaration), | ||
aliasedSymbol: res(aliasedSymbol), | ||
}; | ||
if (hcs) { | ||
newData.heritageClauses = hcs.map((hc) => ({ | ||
newData.heritageClauses = hcs.map(hc => ({ | ||
kind: hc.kind, | ||
types: ref_resolver_1.resolveRefList(hc.types, res) || [] | ||
types: ref_resolver_1.resolveRefList(hc.types, res) || [], | ||
})); | ||
@@ -119,5 +120,5 @@ } | ||
const resolver = ref_resolver_1.createLinkedRefResolver(out); | ||
Object.keys(symbols).forEach((symKey) => linkSymbol(resolver, symbols[symKey])); | ||
Object.keys(types).forEach((typeKey) => linkType(resolver, types[typeKey])); | ||
Object.keys(sourceFiles).forEach((sourceFileKey) => linkSourceFile(resolver, sourceFiles[sourceFileKey])); | ||
Object.keys(symbols).forEach(symKey => linkSymbol(resolver, symbols[symKey])); | ||
Object.keys(types).forEach(typeKey => linkType(resolver, types[typeKey])); | ||
Object.keys(sourceFiles).forEach(sourceFileKey => linkSourceFile(resolver, sourceFiles[sourceFileKey])); | ||
return out; | ||
@@ -132,2 +133,2 @@ } | ||
exports.resolveReference = resolveReference; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlua2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xpbmtlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLCtDQUFxRTtBQUVyRSxpREFBeUY7QUFFekYsbUNBQStDO0FBRS9DLFNBQVMsYUFBYSxDQUNwQixHQUFzRCxFQUN0RCxHQUFzQjtJQUV0QixJQUFJLENBQUMsR0FBRyxFQUFFO1FBQ1IsT0FBTztLQUNSO0lBQ0QsTUFBTSxPQUFPLEdBQWlDO1FBQzVDLFVBQVUsRUFBRSxHQUFHLENBQUMsR0FBRyxDQUFDLFVBQVUsQ0FBQztRQUMvQixhQUFhLEVBQUUsR0FBRyxDQUFDLEdBQUcsQ0FBQyxhQUFhLENBQUM7UUFDckMsVUFBVSxFQUFFLDZCQUFjLENBQUMsR0FBRyxDQUFDLFVBQVUsRUFBRSxHQUFHLENBQUM7UUFDL0MsY0FBYyxFQUFFLDZCQUFjLENBQUMsR0FB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xNQUFNLElBQUksR0FBRyxlQUFPLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDMUIsTUFBTSxFQUFFLEdBQUcsYUFBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDO0lBQ3RCLE9BQU8sVUFBVSxDQUFDLElBQUksQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQzlCLENBQUM7QUFQRCw0Q0FPQyJ9 |
@@ -68,2 +68,3 @@ import { AmdDependency, HasDocumentation, SerializedDeclaration, SerializedEntity, SerializedNode, SerializedSignatureAttributes, SerializedSourceFile, SerializedSourceFileAttributes, SerializedSymbol, SerializedSymbolAttributes, SerializedType, SerializedTypeAttributes } from '@code-to-json/core'; | ||
heritageClauses?: LinkedHeritageClause[]; | ||
aliasedSymbol?: LinkedSymbol; | ||
} | ||
@@ -70,0 +71,0 @@ export interface LinkedSourceFileRelationships { |
{ | ||
"name": "@code-to-json/core-linker", | ||
"version": "1.0.0-rc.26", | ||
"version": "1.0.0-rc.27", | ||
"description": "Data linker for @code-to-json/core", | ||
@@ -26,3 +26,3 @@ "main": "lib/src/index.js", | ||
"dependencies": { | ||
"@code-to-json/core": "^1.0.0-rc.35", | ||
"@code-to-json/core": "^1.0.0-rc.36", | ||
"@mike-north/types": "^1.0.7", | ||
@@ -33,4 +33,4 @@ "debug": "^4.0.0", | ||
"devDependencies": { | ||
"@code-to-json/test-helpers": "^1.0.0-rc.27", | ||
"@code-to-json/utils-node": "^1.0.0-rc.30", | ||
"@code-to-json/test-helpers": "^1.0.0-rc.28", | ||
"@code-to-json/utils-node": "^1.0.0-rc.31", | ||
"@types/chai": "4.1.7", | ||
@@ -95,3 +95,3 @@ "@typescript-eslint/eslint-plugin": "1.3.0", | ||
}, | ||
"gitHead": "bf246b797c26de00505a742962ea6c4c162aa02f" | ||
"gitHead": "5bf75038d54c5c3a783e8a9b3d06ba76d6909b34" | ||
} |
@@ -1,7 +0,31 @@ | ||
import { SerializedSourceFile, SerializedSymbol, SerializedType, WalkerOutputData } from '@code-to-json/core'; | ||
import { SerializedCodePoisition, SerializedCodeRange, SerializedFileReference, SerializedHeritageClause, SerializedSignature } from '@code-to-json/core/lib/src/types/serialized-entities'; | ||
import { | ||
SerializedSourceFile, | ||
SerializedSymbol, | ||
SerializedType, | ||
WalkerOutputData, | ||
} from '@code-to-json/core'; | ||
import { | ||
SerializedCodePoisition, | ||
SerializedCodeRange, | ||
SerializedFileReference, | ||
SerializedHeritageClause, | ||
SerializedSignature, | ||
} from '@code-to-json/core/lib/src/types/serialized-entities'; | ||
import { isDefined, Ref, refId, refType } from '@code-to-json/utils'; | ||
import { Dict } from '@mike-north/types'; | ||
import { createLinkedRefResolver, resolveRefDict, resolveRefList } from './ref-resolver'; | ||
import { LinkedFileReference, LinkedRefResolver, LinkedSignature, LinkedSignatureRelationships, LinkedSourceFile, LinkedSourceFileRelationships, LinkedSymbol, LinkedSymbolRelationships, LinkedType, LinkedTypeRelationships, LinkedWalkerOutputData, MaybeLinkedWalkerOutputData } from './types'; | ||
import { | ||
LinkedFileReference, | ||
LinkedRefResolver, | ||
LinkedSignature, | ||
LinkedSignatureRelationships, | ||
LinkedSourceFile, | ||
LinkedSourceFileRelationships, | ||
LinkedSymbol, | ||
LinkedSymbolRelationships, | ||
LinkedType, | ||
LinkedTypeRelationships, | ||
LinkedWalkerOutputData, | ||
MaybeLinkedWalkerOutputData, | ||
} from './types'; | ||
import { pruneUndefinedValues } from './utils'; | ||
@@ -74,4 +98,4 @@ | ||
}; | ||
[type.constructorSignatures, type.callSignatures].filter(isDefined).forEach((sigList) => { | ||
sigList.forEach((sig) => linkSignature(sig as LinkedSignature & SerializedSignature, res)); | ||
[type.constructorSignatures, type.callSignatures].filter(isDefined).forEach(sigList => { | ||
sigList.forEach(sig => linkSignature(sig as LinkedSignature & SerializedSignature, res)); | ||
}); | ||
@@ -103,4 +127,4 @@ if (type.conditionalInfo) { | ||
.filter(isDefined) | ||
.forEach((fileRefList) => { | ||
fileRefList.forEach((fr) => linkFileReference(fr, res)); | ||
.forEach(fileRefList => { | ||
fileRefList.forEach(fr => linkFileReference(fr, res)); | ||
}); | ||
@@ -114,3 +138,15 @@ Object.assign(sym, pruneUndefinedValues(newData)); | ||
} | ||
const { symbolType, valueDeclaration, valueDeclarationType, exports, members, decorators, sourceFile, globalExports, relatedSymbols, heritageClauses } = sym; | ||
const { | ||
symbolType, | ||
valueDeclaration, | ||
valueDeclarationType, | ||
exports, | ||
members, | ||
decorators, | ||
sourceFile, | ||
globalExports, | ||
relatedSymbols, | ||
heritageClauses, | ||
aliasedSymbol, | ||
} = sym; | ||
const hcs = heritageClauses as (undefined | SerializedHeritageClause[]); | ||
@@ -127,7 +163,8 @@ const newData: LinkedSymbolRelationships = { | ||
valueDeclaration: res(valueDeclaration), | ||
aliasedSymbol: res(aliasedSymbol), | ||
}; | ||
if (hcs) { | ||
newData.heritageClauses = hcs.map((hc) => ({ | ||
newData.heritageClauses = hcs.map(hc => ({ | ||
kind: hc.kind, | ||
types: resolveRefList(hc.types, res) ||[] | ||
types: resolveRefList(hc.types, res) || [], | ||
})); | ||
@@ -144,5 +181,5 @@ } | ||
const resolver = createLinkedRefResolver(out); | ||
Object.keys(symbols).forEach((symKey) => linkSymbol(resolver, symbols[symKey])); | ||
Object.keys(types).forEach((typeKey) => linkType(resolver, types[typeKey])); | ||
Object.keys(sourceFiles).forEach((sourceFileKey) => | ||
Object.keys(symbols).forEach(symKey => linkSymbol(resolver, symbols[symKey])); | ||
Object.keys(types).forEach(typeKey => linkType(resolver, types[typeKey])); | ||
Object.keys(sourceFiles).forEach(sourceFileKey => | ||
linkSourceFile(resolver, sourceFiles[sourceFileKey]), | ||
@@ -149,0 +186,0 @@ ); |
@@ -109,2 +109,3 @@ import { | ||
heritageClauses?: LinkedHeritageClause[]; | ||
aliasedSymbol?: LinkedSymbol; | ||
} | ||
@@ -111,0 +112,0 @@ |
@@ -56,6 +56,13 @@ import { mapDict } from '@code-to-json/utils-ts'; | ||
expect(exportSymbols.Thing!.valueDeclarationType!.text).to.eq('typeof Thing'); | ||
expect(exportSymbols.Thing!.valueDeclaration).to.have.property('syntaxKind', 'classDeclaration'); | ||
expect(exportSymbols.Thing!.valueDeclaration).to.have.property( | ||
'syntaxKind', | ||
'classDeclaration', | ||
); | ||
expect(exportSymbols.Thing!.symbolType!.text).to.eq('Thing'); | ||
expect(Object.keys(exportSymbols.Thing!.symbolType!.properties!).join(', ')).to.eq('bar, myProp, otherThing, go'); | ||
expect(exportSymbols.Thing!.symbolType!.properties!.go!.valueDeclarationType!.callSignatures!.length).to.eq(1); | ||
expect(Object.keys(exportSymbols.Thing!.symbolType!.properties!).join(', ')).to.eq( | ||
'bar, myProp, otherThing, go', | ||
); | ||
expect( | ||
exportSymbols.Thing!.symbolType!.properties!.go!.valueDeclarationType!.callSignatures!.length, | ||
).to.eq(1); | ||
expect(exportSymbols.Thing!.heritageClauses!.length).to.eq(1); | ||
@@ -65,6 +72,3 @@ expect(exportSymbols.Thing!.heritageClauses![0].kind).to.eq('implements'); | ||
expect( | ||
mapDict( | ||
exportSymbols.Thing!.symbolType!.properties!, | ||
(p) => p.valueDeclarationType!.text, | ||
), | ||
mapDict(exportSymbols.Thing!.symbolType!.properties!, p => p.valueDeclarationType!.text), | ||
).to.deep.eq({ | ||
@@ -71,0 +75,0 @@ bar: '[string, string]', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
59226
957