From 653068eff04cc055ddde62150a90460f87d6a88f Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 25 Apr 2018 15:27:04 -0700 Subject: [PATCH] Use travis-fold --- package-lock.json | 71 ++++++++++++++++++++------------------ package.json | 1 + src/check-parse-results.ts | 4 +++ src/tester/test-runner.ts | 3 ++ src/types/travis-fold.d.ts | 8 +++++ 5 files changed, 54 insertions(+), 33 deletions(-) create mode 100644 src/types/travis-fold.d.ts diff --git a/package-lock.json b/package-lock.json index 5322acf1..04a043a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "integrity": "sha512-F9OalGhk60p/DnACfa1SWtmVTMni0+w9t/qfb5Bu7CsurkEjZFN7Z+ii/VGmYpaViPz7o3tBahRQae9O7skFlQ==", "dev": true, "requires": { - "@types/node": "8.10.9" + "@types/node": "8.10.10" } }, "@types/fs-extra": { @@ -19,7 +19,7 @@ "integrity": "sha512-PlKJw6ujJXLJjbvB3T0UCbY3jibKM6/Ya5cc9j1q+mYDeK3aR4Dp+20ZwxSuvJr9mIoPxp7+IL4aMOEvsscRTA==", "dev": true, "requires": { - "@types/node": "8.10.9" + "@types/node": "8.10.10" } }, "@types/mz": { @@ -28,13 +28,13 @@ "integrity": "sha1-pNgMCC/v5x5Ap8DwfR5lVbu8e1I=", "dev": true, "requires": { - "@types/node": "8.10.9" + "@types/node": "8.10.10" } }, "@types/node": { - "version": "8.10.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.9.tgz", - "integrity": "sha512-GUUTbeDaJSRaoLkqVQ5jwwKbDiLWFX3JrKLvC078q2P51Z9Dcb5F5UdnApSYqdMk4X0VrKod1gzeoX8bGl8DMg==" + "version": "8.10.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.10.tgz", + "integrity": "sha512-p3W/hFzQs76RlYRIZsZc5a9bht6m0TspmWYYbKhRswmLnwj9fsE40EbuGifeu/XWR/c0UJQ1DDbvTxIsm/OOAA==" }, "@types/oboe": { "version": "2.0.28", @@ -42,7 +42,7 @@ "integrity": "sha1-OvywzJSfzfd3hh2W6FcfO0hvD6c=", "dev": true, "requires": { - "@types/node": "8.10.9" + "@types/node": "8.10.10" } }, "@types/parsimmon": { @@ -56,7 +56,7 @@ "integrity": "sha512-9oVAi1Jlr274pbMGPEe0S3IPImV9knVNafa6E4MookD/fjOZAE6EmLkFX5ZjtZ9OXNPi2FCIZzUSMvwAUUKeSg==", "dev": true, "requires": { - "@types/node": "8.10.9" + "@types/node": "8.10.10" } }, "@types/tar": { @@ -65,7 +65,7 @@ "integrity": "sha1-qvBknYO6pE9Ji/ezVP0ECtjIubM=", "dev": true, "requires": { - "@types/node": "8.10.9" + "@types/node": "8.10.10" } }, "@types/yargs": { @@ -79,7 +79,7 @@ "resolved": "https://registry.npmjs.org/adal-node/-/adal-node-0.1.28.tgz", "integrity": "sha1-RoxLs+u9lrEnBmn0ucuk4AZepIU=", "requires": { - "@types/node": "8.10.9", + "@types/node": "8.10.10", "async": "2.6.0", "date-utils": "1.2.21", "jws": "3.1.4", @@ -155,7 +155,7 @@ "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", "requires": { - "lodash": "4.17.5" + "lodash": "4.17.10" } }, "asynckit": { @@ -237,7 +237,7 @@ "oauth-sign": "0.8.2", "performance-now": "2.1.0", "qs": "6.5.1", - "safe-buffer": "5.1.1", + "safe-buffer": "5.1.2", "stringstream": "0.0.5", "tough-cookie": "2.3.4", "tunnel-agent": "0.6.0", @@ -451,7 +451,7 @@ "inherits": "2.0.3", "isarray": "1.0.0", "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", + "safe-buffer": "5.1.2", "string_decoder": "1.1.1", "util-deprecate": "1.0.2" } @@ -461,7 +461,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } } } @@ -546,13 +546,13 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" }, "dtslint": { - "version": "github:Microsoft/dtslint#ea50267c1caff214482767ef304b4038b2b0aae6", + "version": "github:Microsoft/dtslint#887768341b08d45d1bb1edf6ae9ad5ebaa683920", "requires": { "definitelytyped-header-parser": "github:Microsoft/definitelytyped-header-parser#f074e863231ef0d79a31c0a9edaf1b82c98469ef", "fs-promise": "2.0.3", "strip-json-comments": "2.0.1", "tslint": "5.9.1", - "typescript": "2.9.0-dev.20180422" + "typescript": "2.9.0-dev.20180425" } }, "duplexer": { @@ -575,7 +575,7 @@ "integrity": "sha1-S8kmJ07Dtau1AW5+HWCSGsJisqE=", "requires": { "base64url": "2.0.0", - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "error-ex": { @@ -820,7 +820,7 @@ "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", "requires": { "inherits": "2.0.3", - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "hawk": { @@ -1026,7 +1026,7 @@ "base64url": "2.0.0", "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.9", - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "jws": { @@ -1036,7 +1036,7 @@ "requires": { "base64url": "2.0.0", "jwa": "1.1.5", - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "lcid": { @@ -1068,9 +1068,9 @@ } }, "lodash": { - "version": "4.17.5", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", - "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" }, "longjohn": { "version": "0.2.12", @@ -5214,7 +5214,7 @@ "once": "1.4.0", "request": "2.85.0", "retry": "0.10.1", - "safe-buffer": "5.1.1", + "safe-buffer": "5.1.2", "semver": "5.5.0", "slide": "1.1.6", "ssri": "5.3.0" @@ -5464,7 +5464,7 @@ "oauth-sign": "0.8.2", "performance-now": "2.1.0", "qs": "6.5.1", - "safe-buffer": "5.1.1", + "safe-buffer": "5.1.2", "stringstream": "0.0.5", "tough-cookie": "2.3.4", "tunnel-agent": "0.6.0", @@ -5503,9 +5503,9 @@ } }, "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "sax": { "version": "0.5.8", @@ -5619,7 +5619,7 @@ "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz", "integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "string-width": { @@ -5709,6 +5709,11 @@ "punycode": "1.4.1" } }, + "travis-fold": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/travis-fold/-/travis-fold-0.1.2.tgz", + "integrity": "sha1-/sAF+dyqJZo/lFnOWmkGq6TFRdo=" + }, "tslib": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz", @@ -5779,7 +5784,7 @@ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "tweetnacl": { @@ -5794,9 +5799,9 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, "typescript": { - "version": "2.9.0-dev.20180422", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.0-dev.20180422.tgz", - "integrity": "sha512-ZoshrwzODq7xGMgxo5o1NimTC3+9W+eeSdgiDY6gd8KTtzm0roLk1LlVheUrqGWmpZO8rTdP3tCKsuBIPf7R4A==" + "version": "2.9.0-dev.20180425", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.0-dev.20180425.tgz", + "integrity": "sha512-6t/l13ofVeTSJVD78b20E0rkoOcFPrst5bK9vCGDbbjzx+Ab3HoV7fSTuwB8zMEvpxHwQtR+0kR3XUy06HzwUg==" }, "underscore": { "version": "1.9.0", diff --git a/package.json b/package.json index f1a97f1b..68c223b9 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "oboe": "^2.1.3", "source-map-support": "^0.4.0", "tar": "^2.2.1", + "travis-fold": "^0.1.2", "typescript": "next", "yargs": "^8.0.2" }, diff --git a/src/check-parse-results.ts b/src/check-parse-results.ts index e0f19c7a..3e72b751 100644 --- a/src/check-parse-results.ts +++ b/src/check-parse-results.ts @@ -1,3 +1,5 @@ +import * as fold from "travis-fold"; + import { Options } from "./lib/common"; import { fetchNpmInfo, NpmInfoVersion, NpmInfoVersions } from "./lib/npm-client"; import { AllPackages, AnyPackage, TypingsData } from "./lib/packages"; @@ -18,9 +20,11 @@ export default async function main(includeNpmChecks: boolean, options: Options, checkPathMappings(allPackages); + if (fold.isTravis()) console.log(fold.start("Duplicate packages")); const packages = allPackages.allPackages(); checkForDuplicates(packages, pkg => pkg.libraryName, "Library Name", log); checkForDuplicates(packages, pkg => pkg.projectName, "Project Name", log); + if (fold.isTravis()) console.log(fold.end("Duplicate packages")); const dependedOn = new Set(); for (const pkg of packages) { diff --git a/src/tester/test-runner.ts b/src/tester/test-runner.ts index 80099187..7b04d3ee 100644 --- a/src/tester/test-runner.ts +++ b/src/tester/test-runner.ts @@ -1,4 +1,5 @@ import { pathExists } from "fs-extra"; +import * as fold from "travis-fold"; import * as yargs from "yargs"; import { Options } from "../lib/common"; @@ -86,6 +87,7 @@ async function runTests( ): Promise { const allFailures: Array<[string, string]> = []; + if (fold.isTravis()) console.log(fold.start("tests")); await runWithListeningChildProcesses({ inputs: packages.map(p => ({ path: p.subDirectoryPath, onlyTestTsNext: !changed.has(p) })), commandLineArgs: ["--listen"], @@ -103,6 +105,7 @@ async function runTests( } }, }); + if (fold.isTravis()) console.log(fold.end("tests")); if (allFailures.length === 0) { return; diff --git a/src/types/travis-fold.d.ts b/src/types/travis-fold.d.ts new file mode 100644 index 00000000..3b0c822a --- /dev/null +++ b/src/types/travis-fold.d.ts @@ -0,0 +1,8 @@ +declare module "travis-fold" { + export function start(group: string): string; + export function end(group: string): string; + export function wrap(group: string, content: string): string; + export function pushStart(ret: string[], group: string): void; + export function pushEnd(ret: string[], group: string): void; + export function isTravis(): boolean; +}