chore(doc-gen): upgrade to use TypeScript 1.7.3
This commit is contained in:
parent
46735ad925
commit
326e1f7395
@ -59,7 +59,7 @@
|
|||||||
"path": "^0.11.14",
|
"path": "^0.11.14",
|
||||||
"prompt": "^0.2.14",
|
"prompt": "^0.2.14",
|
||||||
"q": "^1.4.1",
|
"q": "^1.4.1",
|
||||||
"typescript": "~1.5.3",
|
"typescript": "1.7.3",
|
||||||
"yargs": "^3.23.0"
|
"yargs": "^3.23.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
{% extends 'var.template.html' -%}
|
@ -22,6 +22,7 @@ module.exports = new Package('typescript-parsing', [basePackage])
|
|||||||
'function',
|
'function',
|
||||||
'var',
|
'var',
|
||||||
'const',
|
'const',
|
||||||
|
'let',
|
||||||
'enum',
|
'enum',
|
||||||
'type-alias'
|
'type-alias'
|
||||||
];
|
];
|
||||||
|
@ -1 +1,3 @@
|
|||||||
export { x as y} from './privateModule';
|
export { x as y} from './privateModule';
|
||||||
|
|
||||||
|
export abstract class AbstractClass {}
|
@ -214,7 +214,7 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo,
|
|||||||
location: getLocation(exportSymbol)
|
location: getLocation(exportSymbol)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (exportDoc.docType === 'var' || exportDoc.docType === 'const') {
|
if (exportDoc.docType === 'var' || exportDoc.docType === 'const' || exportDoc.docType === 'let') {
|
||||||
exportDoc.symbolTypeName = exportSymbol.valueDeclaration.type &&
|
exportDoc.symbolTypeName = exportSymbol.valueDeclaration.type &&
|
||||||
exportSymbol.valueDeclaration.type.typeName &&
|
exportSymbol.valueDeclaration.type.typeName &&
|
||||||
exportSymbol.valueDeclaration.type.typeName.text;
|
exportSymbol.valueDeclaration.type.typeName.text;
|
||||||
|
@ -22,6 +22,16 @@ describe('readTypeScriptModules', function() {
|
|||||||
var exportedDoc = docs[1];
|
var exportedDoc = docs[1];
|
||||||
expect(exportedDoc.originalModule).toEqual('privateModule');
|
expect(exportedDoc.originalModule).toEqual('privateModule');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should include exported abstract classes', function() {
|
||||||
|
processor.sourceFiles = [ 'publicModule.ts' ];
|
||||||
|
var docs = [];
|
||||||
|
processor.$process(docs);
|
||||||
|
|
||||||
|
var exportedDoc = docs[2];
|
||||||
|
expect(exportedDoc.name).toEqual('AbstractClass');
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,6 +56,24 @@ module.exports = function createCompilerHost(log) {
|
|||||||
},
|
},
|
||||||
getNewLine: function() {
|
getNewLine: function() {
|
||||||
return ts.sys.newLine;
|
return ts.sys.newLine;
|
||||||
|
},
|
||||||
|
fileExists(fileName) {
|
||||||
|
var text, resolvedPath, resolvedPathWithExt;
|
||||||
|
|
||||||
|
// Strip off the extension and resolve relative to the baseDir
|
||||||
|
baseFilePath = fileName.replace(/\.[^.]+$/, '');
|
||||||
|
resolvedPath = path.resolve(baseDir, baseFilePath);
|
||||||
|
|
||||||
|
// Iterate through each possible extension and return the first source file that is actually found
|
||||||
|
for(var i=0; i<extensions.length; i++) {
|
||||||
|
// Try reading the content from files using each of the given extensions
|
||||||
|
resolvedPathWithExt = resolvedPath + extensions[i];
|
||||||
|
if (fs.existsSync(resolvedPathWithExt)) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
readFile(fileName) {
|
||||||
|
console.log('readFile - NOT IMPLEMENTED', fileName);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -38,7 +38,7 @@ describe('createCompilerHost', function() {
|
|||||||
|
|
||||||
describe('getDefaultLibFileName', function() {
|
describe('getDefaultLibFileName', function() {
|
||||||
it('should return a path to the default library', function() {
|
it('should return a path to the default library', function() {
|
||||||
expect(host.getDefaultLibFileName(options)).toContain('typescript/bin/lib.d.ts');
|
expect(host.getDefaultLibFileName(options)).toContain('typescript/lib/lib.d.ts');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user