Skip to content

Commit

Permalink
Update meteor-typescript, minor re-factoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
barbatus committed Mar 10, 2016
1 parent 444fa37 commit 9049191
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
11 changes: 10 additions & 1 deletion file-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@ FileMixin = {
return fileOptions && fileOptions.bare;
},

// Get root app config.
isConfig() {
return this.getBasename() === 'tsconfig.json';
return this.getPathInPackage() === 'tsconfig.json';
},

isDeclaration() {
return TypeScript.isDeclarationFile(this.getBasename());
},

// Get path with package prefix if any.
getPackagedPath() {
let packageName = this.getPackageName();
packageName = packageName ? packageName + '/' : '';
let inputFilePath = this.getPathInPackage();
return packageName + inputFilePath;
}
};
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Package.describe({
});

Npm.depends({
'meteor-typescript': 'https://github.com/barbatus/meteor-typescript/tarball/c4b62ae8a5cd7ecdd634cbffa287d53a9dbe6220',
'meteor-typescript': 'https://github.com/barbatus/meteor-typescript/tarball/bb7cebc98d34ee606c7b0be428dde6aeb9e086bf',
'async': '1.4.0'
});

Expand Down
5 changes: 4 additions & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
#!/bin/sh
VELOCITY_TEST_PACKAGES=1 TYPESCRIPT_LOG=1 meteor test-packages --driver-package=velocity:html-reporter ./

rm -fr "~/.cache"

VELOCITY_TEST_PACKAGES=1 TYPESCRIPT_LOG=1 TYPESCRIPT_CACHE_DIR="~/.cache" meteor test-packages --driver-package=velocity:html-reporter ./
5 changes: 4 additions & 1 deletion run_tests_ci.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
#!/bin/sh
VELOCITY_TEST_PACKAGES=1 meteor test-packages --velocity ./

rm -fr "~/.cache"

VELOCITY_TEST_PACKAGES=1 TYPESCRIPT_CACHE_DIR="~/.cache" meteor test-packages --velocity ./
14 changes: 6 additions & 8 deletions typescript-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ TypeScriptCompiler = class TypeScriptCompiler {
let compilerOptions = this.tsconfig.compilerOptions;
compilerOptions = TypeScript.getCompilerOptions(
compilerOptions, this.extraOptions);
let buildOptions = { compilerOptions, typings };
let useCache = this.tsconfig.useCache;
let buildOptions = { compilerOptions, typings, useCache };

let dcompile = Logger.newDebug('compilation');
const future = new Future;
Expand Down Expand Up @@ -132,21 +133,18 @@ TypeScriptCompiler = class TypeScriptCompiler {

getExtendedPath(inputFile, noExt) {
let packageName = inputFile.getPackageName();
let inputFilePath = inputFile.getPathInPackage();
let packagedPath = inputFile.getPackagedPath();

let filePath = packageName ?
('packages/' + packageName + '/' + inputFilePath) : inputFilePath;
('packages/' + packagedPath) : packagedPath;

return noExt ? removeTsExt(filePath) : filePath;
}

getFileModuleName(inputFile, options) {
return options.module !== 'none' ?
this.getExtendedPath(inputFile, true): null;
}
if (options.module === 'none') return null;

isDeclarationFile(inputFile) {
return TypeScript.isDeclarationFile(inputFile.getBasename());
return removeTsExt(inputFile.getPackagedPath());
}

processConfig(inputFiles) {
Expand Down

0 comments on commit 9049191

Please sign in to comment.