Skip to content

Commit bf9f704

Browse files
committed
feat(tsfmt): add support for filesGlob
2 parents d618ee8 + d748dc5 commit bf9f704

File tree

5 files changed

+410
-177
lines changed

5 files changed

+410
-177
lines changed

dtsm.json

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
},
2222
"power-assert/power-assert.d.ts": {
2323
"ref": "09e37435ffb2c56a6f908081194a74756f24f99d"
24+
},
25+
"glob-expand/glob-expand.d.ts": {
26+
"ref": "eab2e0487e9685952db58e487d484a1c342ec670"
2427
}
2528
}
2629
}

lib/cli.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import * as fs from "fs";
44
import * as commandpost from "commandpost";
55
import * as path from "path";
66

7+
import * as expand from "glob-expand";
8+
79
import * as lib from "./";
810
import {getConfigFileName} from "./utils";
911

@@ -166,7 +168,9 @@ function readFilesFromTsconfig(configPath: string) {
166168
if (tsconfig.files) {
167169
let files: string[] = tsconfig.files;
168170
return files.map(filePath => path.resolve(tsconfigDir, filePath));
171+
} else if (tsconfig.filesGlob) {
172+
return expand({ filter: "isFile", cwd: tsconfigDir }, tsconfig.filesGlob);
169173
} else {
170-
throw new Error(`No "files" section present in tsconfig.json`);
174+
throw new Error(`No "files" or "filesGlob" section present in tsconfig.json`);
171175
}
172176
}

0 commit comments

Comments
 (0)