Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 55fb91a

Browse files
huerlisidanbucholtz
authored andcommitted
chore(build): fix build issues with typescript 2.1 (#726)
1 parent 17ec1d8 commit 55fb91a

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

src/babili.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function babili(context: BuildContext, configFile?: string) {
2020
}
2121

2222

23-
export function babiliWorker(context: BuildContext, configFile: string): Promise<any> {
23+
export function babiliWorker(context: BuildContext, configFile: string) {
2424
const babiliConfig: BabiliConfig = fillConfigDefaults(configFile, taskInfo.defaultConfigFile);
2525
// TODO - figure out source maps??
2626
return runBabili(context, babiliConfig).then((minifiedCode: string) => {

src/minify.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function minifyWorker(context: BuildContext) {
3232
}
3333

3434

35-
export function minifyJs(context: BuildContext) {
35+
export function minifyJs(context: BuildContext): Promise<void> {
3636
return isClosureSupported(context).then((result: boolean) => {
3737
if (result) {
3838
return closure(context);

src/util/helpers.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export function titleCase(str: string) {
9595
}
9696

9797

98-
export function writeFileAsync(filePath: string, content: string): Promise<any> {
98+
export function writeFileAsync(filePath: string, content: string) {
9999
return new Promise((resolve, reject) => {
100100
writeFile(filePath, content, (err) => {
101101
if (err) {
@@ -106,8 +106,8 @@ export function writeFileAsync(filePath: string, content: string): Promise<any>
106106
});
107107
}
108108

109-
export function readFileAsync(filePath: string): Promise<string> {
110-
return new Promise((resolve, reject) => {
109+
export function readFileAsync(filePath: string) {
110+
return new Promise<string>((resolve, reject) => {
111111
readFile(filePath, 'utf-8', (err, buffer) => {
112112
if (err) {
113113
return reject(err);
@@ -128,7 +128,7 @@ export function readAndCacheFile(filePath: string, purge: boolean = false): Prom
128128
});
129129
}
130130

131-
export function unlinkAsync(filePath: string|string[]): Promise<any> {
131+
export function unlinkAsync(filePath: string|string[]) {
132132
let filePaths: string[];
133133

134134
if (typeof filePath === 'string') {
@@ -140,7 +140,7 @@ export function unlinkAsync(filePath: string|string[]): Promise<any> {
140140
}
141141

142142
let promises = filePaths.map(filePath => {
143-
return new Promise((resolve, reject) => {
143+
return new Promise<void>((resolve, reject) => {
144144
unlink(filePath, (err: Error) => {
145145
if (err) {
146146
return reject(err);
@@ -153,8 +153,8 @@ export function unlinkAsync(filePath: string|string[]): Promise<any> {
153153
return Promise.all(promises);
154154
}
155155

156-
export function rimRafAsync(directoryPath: string): Promise<null> {
157-
return new Promise((resolve, reject) => {
156+
export function rimRafAsync(directoryPath: string) {
157+
return new Promise<void>((resolve, reject) => {
158158
remove(directoryPath, (err: Error) => {
159159
if (err) {
160160
return reject(err);
@@ -164,8 +164,8 @@ export function rimRafAsync(directoryPath: string): Promise<null> {
164164
});
165165
}
166166

167-
export function copyFileAsync(srcPath: string, destPath: string): Promise<any> {
168-
return new Promise((resolve, reject) => {
167+
export function copyFileAsync(srcPath: string, destPath: string) {
168+
return new Promise<void>((resolve, reject) => {
169169
const writeStream = createWriteStream(destPath);
170170

171171
writeStream.on('error', (err: Error) => {
@@ -180,8 +180,8 @@ export function copyFileAsync(srcPath: string, destPath: string): Promise<any> {
180180
});
181181
}
182182

183-
export function readDirAsync(pathToDir: string): Promise<string[]> {
184-
return new Promise((resolve, reject) => {
183+
export function readDirAsync(pathToDir: string) {
184+
return new Promise<string[]>((resolve, reject) => {
185185
readdir(pathToDir, (err: Error, fileNames: string[]) => {
186186
if (err) {
187187
return reject(err);

src/util/source-maps.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { BuildContext } from './interfaces';
66
export function purgeSourceMapsIfNeeded(context: BuildContext): Promise<any> {
77
if (getBooleanPropertyValue(Constants.ENV_VAR_GENERATE_SOURCE_MAP)) {
88
// keep the source maps and just return
9-
return Promise.resolve();
9+
return Promise.resolve([]);
1010
}
11-
return readDirAsync(context.buildDir).then((fileNames: string[]) => {
11+
return readDirAsync(context.buildDir).then((fileNames) => {
1212
const sourceMaps = fileNames.filter(fileName => fileName.endsWith('.map'));
1313
const fullPaths = sourceMaps.map(sourceMap => join(context.buildDir, sourceMap));
14-
const promises: Promise<any>[] = [];
14+
const promises: Promise<void>[] = [];
1515
for (const fullPath of fullPaths) {
1616
promises.push(unlinkAsync(fullPath));
1717
}

0 commit comments

Comments
 (0)