@microsoft/rush
Advanced tools
Comparing version 3.0.16 to 3.0.17
@@ -5,2 +5,19 @@ { | ||
{ | ||
"version": "3.0.17", | ||
"tag": "@microsoft/rush_v3.0.17", | ||
"date": "Thu, 14 Sep 2017 18:51:05 GMT", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "Fix some issues in rush telemetry collection" | ||
} | ||
], | ||
"dependency": [ | ||
{ | ||
"comment": "Updating dependency \"@microsoft/rush-lib\" from `3.0.16` to `3.0.17`" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"version": "3.0.16", | ||
@@ -7,0 +24,0 @@ "tag": "@microsoft/rush_v3.0.16", |
# Change Log - @microsoft/rush | ||
This log was last generated on Thu, 07 Sep 2017 00:16:44 GMT and should not be manually modified. | ||
This log was last generated on Thu, 14 Sep 2017 18:51:05 GMT and should not be manually modified. | ||
## 3.0.17 | ||
Thu, 14 Sep 2017 18:51:05 GMT | ||
### Patches | ||
- Fix some issues in rush telemetry collection | ||
## 3.0.16 | ||
@@ -6,0 +13,0 @@ Wed, 6 Sep 2017 18:24:39 GMT |
@@ -110,2 +110,4 @@ "use strict"; | ||
_this._collectTelemetry(stopwatch, true); | ||
_this._parser.flushTelemetry(); | ||
_this.eventHooksManager.handle(rush_lib_1.Event.postRushBuild, _this._parser.isDebug); | ||
}, function () { | ||
@@ -115,6 +117,5 @@ stopwatch.stop(); | ||
_this._collectTelemetry(stopwatch, false); | ||
_this._parser.flushTelemetry(); | ||
_this.eventHooksManager.handle(rush_lib_1.Event.postRushBuild, _this._parser.isDebug); | ||
_this._parser.exitWithError(); | ||
}) | ||
.then(function () { | ||
_this.eventHooksManager.handle(rush_lib_1.Event.postRushBuild); | ||
}); | ||
@@ -204,3 +205,6 @@ }; | ||
var _this = this; | ||
var deps = new Set(this._dependentList.get(project)); | ||
var deps = new Set(); | ||
this._dependentList.get(project).forEach(function (dep) { | ||
deps.add(dep); | ||
}); | ||
deps.forEach(function (dep) { return _this._collectAllDependents(dep).forEach(function (innerDep) { return deps.add(innerDep); }); }); | ||
@@ -207,0 +211,0 @@ return deps; |
@@ -9,8 +9,9 @@ import { CommandLineParser } from '@microsoft/ts-command-line'; | ||
exitWithError(): void; | ||
readonly isDebug: boolean; | ||
flushTelemetry(): void; | ||
protected onDefineParameters(): void; | ||
protected onExecute(): void; | ||
private _execute(); | ||
private _flushTelemetry(); | ||
private _populateActions(); | ||
private _exitAndReportError(error); | ||
} |
@@ -55,3 +55,3 @@ "use strict"; | ||
try { | ||
this._flushTelemetry(); | ||
this.flushTelemetry(); | ||
} | ||
@@ -62,2 +62,14 @@ finally { | ||
}; | ||
Object.defineProperty(RushCommandLineParser.prototype, "isDebug", { | ||
get: function () { | ||
return this._debugParameter.value; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
RushCommandLineParser.prototype.flushTelemetry = function () { | ||
if (this.telemetry) { | ||
this.telemetry.flush(); | ||
} | ||
}; | ||
RushCommandLineParser.prototype.onDefineParameters = function () { | ||
@@ -87,9 +99,4 @@ this._debugParameter = this.defineFlagParameter({ | ||
_super.prototype.onExecute.call(this); | ||
this._flushTelemetry(); | ||
this.flushTelemetry(); | ||
}; | ||
RushCommandLineParser.prototype._flushTelemetry = function () { | ||
if (this.telemetry) { | ||
this.telemetry.flush(); | ||
} | ||
}; | ||
RushCommandLineParser.prototype._populateActions = function () { | ||
@@ -96,0 +103,0 @@ try { |
@@ -5,3 +5,3 @@ import { EventHooks, Event } from '@microsoft/rush-lib'; | ||
constructor(_eventHooks: EventHooks); | ||
handle(event: Event): void; | ||
handle(event: Event, isDebug?: boolean): void; | ||
} |
@@ -12,3 +12,4 @@ "use strict"; | ||
} | ||
EventHooksManager.prototype.handle = function (event) { | ||
EventHooksManager.prototype.handle = function (event, isDebug) { | ||
if (isDebug === void 0) { isDebug = false; } | ||
if (!this._eventHooks) { | ||
@@ -19,7 +20,18 @@ return; | ||
if (scripts.length > 0) { | ||
var stopwatch = rush_lib_1.Stopwatch.start(); | ||
console.log(os.EOL + colors.green("Executing event hooks for " + rush_lib_1.Event[event])); | ||
scripts.forEach(function (script) { | ||
rush_lib_1.Utilities.executeShellCommand(script, process.cwd(), process.env); | ||
try { | ||
rush_lib_1.Utilities.executeShellCommand(script, process.cwd(), process.env, true); | ||
} | ||
catch (error) { | ||
console.error(os.EOL + " Event hook \"" + script + "\" failed. Run \"rush\" with --debug" + | ||
" to see detailed error information."); | ||
if (isDebug) { | ||
console.error(os.EOL + error.message); | ||
} | ||
} | ||
}); | ||
console.log(os.EOL + colors.green("Event hooks finished successfully")); | ||
stopwatch.stop(); | ||
console.log(os.EOL + colors.green("Event hooks finished. (" + stopwatch.toString() + ")")); | ||
} | ||
@@ -26,0 +38,0 @@ }; |
@@ -22,3 +22,7 @@ import { RushConfiguration } from '@microsoft/rush-lib'; | ||
readonly store: ITelemetryData[]; | ||
/** | ||
* When there are too many log files, delete the old ones. | ||
*/ | ||
private _cleanUp(); | ||
private _getFilePath(); | ||
} |
@@ -9,2 +9,3 @@ "use strict"; | ||
var rush_lib_1 = require("@microsoft/rush-lib"); | ||
var MAX_FILE_COUNT = 100; | ||
var Telemetry = (function () { | ||
@@ -30,3 +31,3 @@ function Telemetry(_rushConfiguration) { | ||
if (writeFile === void 0) { writeFile = fsx.writeFileSync; } | ||
if (!this._enabled) { | ||
if (!this._enabled || this._store.length === 0) { | ||
return; | ||
@@ -38,2 +39,3 @@ } | ||
this._store = []; | ||
this._cleanUp(); | ||
}; | ||
@@ -47,2 +49,36 @@ Object.defineProperty(Telemetry.prototype, "store", { | ||
}); | ||
/** | ||
* When there are too many log files, delete the old ones. | ||
*/ | ||
Telemetry.prototype._cleanUp = function () { | ||
var _this = this; | ||
if (fsx.existsSync(this._dataFolder)) { | ||
var files = fsx.readdirSync(this._dataFolder); | ||
if (files.length > MAX_FILE_COUNT) { | ||
var sortedFiles = files.map(function (fileName) { | ||
var filePath = path.join(_this._dataFolder, fileName); | ||
var stats = fsx.statSync(filePath); | ||
return { | ||
filePath: filePath, | ||
modifiedTime: stats.mtime.getTime(), | ||
isFile: stats.isFile() | ||
}; | ||
}) | ||
.filter(function (value) { | ||
// Only delete files | ||
return value.isFile; | ||
}) | ||
.sort(function (a, b) { | ||
return a.modifiedTime - b.modifiedTime; | ||
}) | ||
.map(function (s) { | ||
return s.filePath; | ||
}); | ||
var filesToDelete = sortedFiles.length - MAX_FILE_COUNT; | ||
for (var i = 0; i < filesToDelete; i++) { | ||
fsx.unlinkSync(sortedFiles[i]); | ||
} | ||
} | ||
} | ||
}; | ||
Telemetry.prototype._getFilePath = function () { | ||
@@ -49,0 +85,0 @@ var fileName = "telemetry_" + new Date().toISOString(); |
{ | ||
"name": "@microsoft/rush", | ||
"version": "3.0.16", | ||
"version": "3.0.17", | ||
"description": "The professional solution for consolidating all your JavaScript projects in one Git repo", | ||
@@ -31,7 +31,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@microsoft/node-core-library": "~0.2.6", | ||
"@microsoft/package-deps-hash": "~2.0.8", | ||
"@microsoft/rush-lib": "3.0.16", | ||
"@microsoft/stream-collator": "~2.0.6", | ||
"@microsoft/ts-command-line": "~2.0.6", | ||
"@microsoft/node-core-library": "~0.2.10", | ||
"@microsoft/package-deps-hash": "~2.0.9", | ||
"@microsoft/rush-lib": "3.0.17", | ||
"@microsoft/stream-collator": "~2.0.7", | ||
"@microsoft/ts-command-line": "~2.0.7", | ||
"builtins": "~1.0.3", | ||
@@ -52,9 +52,8 @@ "colors": "~1.1.2", | ||
"devDependencies": { | ||
"@microsoft/node-library-build": "~4.0.4", | ||
"@microsoft/node-library-build": "~4.0.7", | ||
"@types/chai": "3.4.34", | ||
"@types/colors": "1.1.3", | ||
"@types/es6-collections": "0.5.29", | ||
"@types/fs-extra": "0.0.37", | ||
"@types/glob": "5.0.30", | ||
"@types/lodash": "4.14.52", | ||
"@types/lodash": "4.14.74", | ||
"@types/minimatch": "2.0.29", | ||
@@ -61,0 +60,0 @@ "@types/mocha": "2.2.38", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
741049
12
6933
+ Added@microsoft/rush-lib@3.0.17(transitive)
- Removed@microsoft/rush-lib@3.0.16(transitive)
- Removed@types/es6-collections@0.5.29(transitive)
Updated@microsoft/rush-lib@3.0.17