Skip to content

Commit 9049191

Browse files
committed
Update meteor-typescript, minor re-factoring.
Urigo/angular2-meteor#102
1 parent 444fa37 commit 9049191

File tree

5 files changed

+25
-12
lines changed

5 files changed

+25
-12
lines changed

file-mixin.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@ FileMixin = {
88
return fileOptions && fileOptions.bare;
99
},
1010

11+
// Get root app config.
1112
isConfig() {
12-
return this.getBasename() === 'tsconfig.json';
13+
return this.getPathInPackage() === 'tsconfig.json';
1314
},
1415

1516
isDeclaration() {
1617
return TypeScript.isDeclarationFile(this.getBasename());
18+
},
19+
20+
// Get path with package prefix if any.
21+
getPackagedPath() {
22+
let packageName = this.getPackageName();
23+
packageName = packageName ? packageName + '/' : '';
24+
let inputFilePath = this.getPathInPackage();
25+
return packageName + inputFilePath;
1726
}
1827
};

package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Package.describe({
77
});
88

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

run_tests.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
#!/bin/sh
2-
VELOCITY_TEST_PACKAGES=1 TYPESCRIPT_LOG=1 meteor test-packages --driver-package=velocity:html-reporter ./
2+
3+
rm -fr "~/.cache"
4+
5+
VELOCITY_TEST_PACKAGES=1 TYPESCRIPT_LOG=1 TYPESCRIPT_CACHE_DIR="~/.cache" meteor test-packages --driver-package=velocity:html-reporter ./

run_tests_ci.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
#!/bin/sh
2-
VELOCITY_TEST_PACKAGES=1 meteor test-packages --velocity ./
2+
3+
rm -fr "~/.cache"
4+
5+
VELOCITY_TEST_PACKAGES=1 TYPESCRIPT_CACHE_DIR="~/.cache" meteor test-packages --velocity ./

typescript-compiler.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ TypeScriptCompiler = class TypeScriptCompiler {
4444
let compilerOptions = this.tsconfig.compilerOptions;
4545
compilerOptions = TypeScript.getCompilerOptions(
4646
compilerOptions, this.extraOptions);
47-
let buildOptions = { compilerOptions, typings };
47+
let useCache = this.tsconfig.useCache;
48+
let buildOptions = { compilerOptions, typings, useCache };
4849

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

133134
getExtendedPath(inputFile, noExt) {
134135
let packageName = inputFile.getPackageName();
135-
let inputFilePath = inputFile.getPathInPackage();
136+
let packagedPath = inputFile.getPackagedPath();
136137

137138
let filePath = packageName ?
138-
('packages/' + packageName + '/' + inputFilePath) : inputFilePath;
139+
('packages/' + packagedPath) : packagedPath;
139140

140141
return noExt ? removeTsExt(filePath) : filePath;
141142
}
142143

143144
getFileModuleName(inputFile, options) {
144-
return options.module !== 'none' ?
145-
this.getExtendedPath(inputFile, true): null;
146-
}
145+
if (options.module === 'none') return null;
147146

148-
isDeclarationFile(inputFile) {
149-
return TypeScript.isDeclarationFile(inputFile.getBasename());
147+
return removeTsExt(inputFile.getPackagedPath());
150148
}
151149

152150
processConfig(inputFiles) {

0 commit comments

Comments
 (0)