Skip to content

Commit a9fa085

Browse files
committed
Fix definition files installation.
1 parent fc28a04 commit a9fa085

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

compilers/basic_compiler.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,17 @@ TsBasicCompiler = class TsBasicCompiler {
152152
// then standardized path will be typings/foo/foo.d.ts.
153153
_getStandardTypingsFilePath(file) {
154154
let filePath = file.getPathInPackage();
155-
let dirPath = ts.getDirectoryPath(ts.normalizePath(filePath));
155+
let dirPath = ts.getDirectoryPath(
156+
ts.normalizePath(filePath)).replace(/^typings\/?/, '');
156157
let pkgName = file.getPackageName();
157158
if (pkgName.indexOf(':') != -1) {
158159
pkgName = pkgName.split(':')[1];
159160
}
160-
let pkgTest = new RegExp(`.*\/${pkgName}(\/.+|$)`);
161+
let pkgTest = new RegExp(`^\/?${pkgName}(\/.+|$)`);
162+
// Check if the path starts with the package name.
161163
if (pkgTest.test(dirPath) === false) {
162-
let pkgDirPath = ts.combinePaths(dirPath, pkgName);
164+
let pkgDirPath = ts.combinePaths(
165+
ts.combinePaths('typings', pkgName), dirPath);
163166
let fileName = ts.getBaseFileName(filePath);
164167
filePath = ts.combinePaths(pkgDirPath, fileName);
165168
}

package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package.describe({
22
name: 'barbatus:ts-compilers',
3-
version: '0.2.7',
3+
version: '0.2.8',
44
summary: 'TypeScript Compilers for Meteor',
55
git: 'https://github.com/barbatus/ts-compilers',
66
documentation: 'README.md'

0 commit comments

Comments
 (0)