Skip to content

Commit

Permalink
feat(tsfmt): remove es6-promise from dependencies. tsfmt supports aft…
Browse files Browse the repository at this point in the history
…er latest LTS of node.js
  • Loading branch information
vvakame committed Feb 6, 2016
1 parent 1d0c60b commit 19a7f44
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 23 deletions.
6 changes: 5 additions & 1 deletion lib/cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
require("es6-promise").polyfill();
try {
// cackward compatibility for node v0.12
require("es6-promise").polyfill();
} catch (e) {
}
try {
require("typescript");
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function processFiles(files: string[], opts: Options): Promise<ResultMap>
let content = fs.readFileSync(fileName).toString();
return processString(fileName, content, opts);
});
return Promise.all(promises).then(resultList=> {
return Promise.all(promises).then(resultList => {
resultList.forEach(result => {
resultMap[result.fileName] = result;
});
Expand Down
20 changes: 4 additions & 16 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"url": "https://github.com/vvakame/typescript-formatter/issues"
},
"engines": {
"node": ">= 0.12.0"
"node": ">= 4.2.0"
},
"directories": {
"example": "example",
Expand All @@ -33,7 +33,6 @@
"dependencies": {
"commandpost": "1.0.0",
"editorconfig": "0.13.2",
"es6-promise": "3.0.2",
"glob-expand": "0.1.0"
},
"peerDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions test/indexSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ describe("tsfmt test", () => {
describe("processFiles function", () => {
var fileNames = collectFileName(fixtureDir);
fileNames
.filter(fileName=> /\.ts$/.test(fileName))
.forEach(fileName=> {
.filter(fileName => /\.ts$/.test(fileName))
.forEach(fileName => {
var ignoreList = [
"./test/fixture/editorconfig/space/main.ts", // TypeScript ignore indentSize: 8
"./test/fixture/tsfmt/a/main.ts", // TypeScript ignore indentSize: 1
Expand Down Expand Up @@ -196,7 +196,7 @@ describe("tsfmt test", () => {
editorconfig: true,
tsfmt: true
})
.then(result=> {
.then(result => {
assert(result !== null);
assert(result.error === false);
assert(result.dest === "class Sample { getString(): string { return \"hi!\"; } }\r\n");
Expand Down

0 comments on commit 19a7f44

Please sign in to comment.