mirror of
https://github.com/chenasraf/DefinitelyTyped-tools.git
synced 2026-05-18 01:49:03 +00:00
Log suggestions (#748)
* print suggestions * Add package-lock * Clean suggestions directory before running * Print single json for suggestions * Print single suggestions json
This commit is contained in:
committed by
Andrew Branch
parent
b8c010f0ce
commit
a6ea7167bf
2668
packages/types-publisher/package-lock.json
generated
2668
packages/types-publisher/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
import assert = require("assert");
|
||||
import { existsSync, readFileSync } from "fs";
|
||||
import { pathExists } from "fs-extra";
|
||||
import { pathExists, remove } from "fs-extra";
|
||||
import os = require("os");
|
||||
import * as fold from "travis-fold";
|
||||
import * as yargs from "yargs";
|
||||
@@ -30,6 +30,7 @@ import {
|
||||
import { allDependencies, getAffectedPackages } from "./get-affected-packages";
|
||||
|
||||
const perfDir = joinPaths(os.homedir(), ".dts", "perf");
|
||||
const suggestionsDir = joinPaths(os.homedir(), ".dts", "suggestions");
|
||||
|
||||
if (!module.parent) {
|
||||
if (yargs.argv.affected) {
|
||||
@@ -189,6 +190,7 @@ async function doRunTests(
|
||||
typesPath: string,
|
||||
nProcesses: number,
|
||||
): Promise<void> {
|
||||
await remove(suggestionsDir);
|
||||
const allFailures: Array<[string, string]> = [];
|
||||
if (fold.isTravis()) { console.log(fold.start("tests")); }
|
||||
await runWithListeningChildProcesses({
|
||||
@@ -233,6 +235,18 @@ async function doRunTests(
|
||||
});
|
||||
if (fold.isTravis()) { console.log(fold.end("tests")); }
|
||||
|
||||
console.log("\n\n=== SUGGESTIONS ===\n");
|
||||
const suggestionLines: string[] = [];
|
||||
for (const change of changed) {
|
||||
const pkgPath = change.versionDirectoryName ? change.name + change.versionDirectoryName : change.name;
|
||||
const path = joinPaths(suggestionsDir, pkgPath + ".txt");
|
||||
if (existsSync(path)) {
|
||||
const suggestions = readFileSync(path, "utf8").split("\n");
|
||||
suggestionLines.push(`"${change.subDirectoryPath}": [${suggestions.join(",")}]`);
|
||||
}
|
||||
}
|
||||
console.log(`{${suggestionLines.join(",")}}`);
|
||||
|
||||
console.log("\n\n=== PERFORMANCE ===\n");
|
||||
console.log("{");
|
||||
for (const change of changed) {
|
||||
|
||||
Reference in New Issue
Block a user