Skip to content

Commit

Permalink
Update release
Browse files Browse the repository at this point in the history
  • Loading branch information
ivogabe committed Sep 20, 2016
1 parent 00504ba commit e5f959c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions release/host.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ export declare class Host implements ts.CompilerHost {
readFile(fileName: string): string;
getSourceFile: (fileName: string, languageVersion: ts.ScriptTarget, onError?: (message: string) => void) => ts.SourceFile;
realpath: any;
getDirectories: any;
}
4 changes: 3 additions & 1 deletion release/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ var Host = (function () {
this.input = input;
this.externalResolve = externalResolve;
this.libFileName = libFileName;
this.realpath = typescript.createCompilerHost({})['realpath'];
var fallback = typescript.createCompilerHost({});
this.realpath = fallback['realpath'];
this.getDirectories = fallback['getDirectories'];
this.reset();
}
Host.getLibDefault = function (typescript, libFileName, originalFileName) {
Expand Down
20 changes: 20 additions & 0 deletions release/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@ var Project = (function () {
if (this.options["rootDir"]) {
base = path.resolve(configPath, this.options["rootDir"]);
}
if (this.typescript.parseJsonConfigFileContent && this.typescript.sys) {
var content = {};
if (this.config.include)
content.include = this.config.include;
if (this.config.exclude)
content.exclude = this.config.exclude;
if (this.config.files)
content.files = this.config.files;
if (this.options['allowJs'])
content.compilerOptions = { allowJs: true };
var _a = this.typescript.parseJsonConfigFileContent(content, this.typescript.sys, this.projectDirectory), fileNames = _a.fileNames, errors = _a.errors;
for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) {
var error = errors_1[_i];
console.log(error.messageText);
}
if (base === undefined)
base = utils.getCommonBasePathOfArray(fileNames.map(function (file) { return path.dirname(file); }));
var vinylOptions_1 = { base: base, allowEmpty: true };
return vfs.src(fileNames, vinylOptions_1);
}
if (!this.config.files) {
var files_1 = [];
//If neither 'files' nor 'include' option is defined,
Expand Down
2 changes: 2 additions & 0 deletions release/tsapi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export interface TypeScript {
options: ts.CompilerOptions;
errors: ts.Diagnostic[];
};
parseJsonConfigFileContent?: (json: any, host: any, basePath: string) => any;
sys?: any;
}
export interface TypeScript14 {
createSourceFile(filename: string, content: string, target: ts.ScriptTarget, version: string): any;
Expand Down

0 comments on commit e5f959c

Please sign in to comment.