@lerna/profiler
Advanced tools
Comparing version 3.20.0 to 4.0.0
@@ -6,2 +6,31 @@ # Change Log | ||
# [4.0.0](https://github.com/lerna/lerna/compare/v3.22.1...v4.0.0) (2021-02-10) | ||
### Features | ||
* **deps:** Bump dependencies ([affed1c](https://github.com/lerna/lerna/commit/affed1ce0fce91f01b0a9eafe357db2d985b974f)) | ||
* Expose named export ([c1303f1](https://github.com/lerna/lerna/commit/c1303f13adc4cf15f96ff25889b52149f8224c0e)) | ||
* Remove default export ([e2f1ec3](https://github.com/lerna/lerna/commit/e2f1ec3dd049d2a89880029908a2aa7c66f15082)) | ||
* **deps:** fs-extra@^9.0.1 ([2f6f4e0](https://github.com/lerna/lerna/commit/2f6f4e066d5a41b4cd508b3405ac1d0a342932dc)) | ||
* **deps:** upath@^2.0.1 ([28ecc48](https://github.com/lerna/lerna/commit/28ecc48aa9f0de6073f0bc534071e2697d8bef98)) | ||
* **profiler:** Remove figgy-pudding ([69d4704](https://github.com/lerna/lerna/commit/69d47041e83138869404c131adda3fc3122bf2d9)) | ||
* Drop support for Node v6.x & v8.x ([ff4bb4d](https://github.com/lerna/lerna/commit/ff4bb4da215555e3bb136f5af09b5cbc631e57bb)) | ||
### BREAKING CHANGES | ||
* The default export has been removed, please use a named export instead. | ||
* Node v6.x & v8.x are no longer supported. Please upgrade to the latest LTS release. | ||
Here's the gnarly one-liner I used to make these changes: | ||
``` | ||
npx lerna exec --concurrency 1 --stream -- 'json -I -f package.json -e '"'"'this.engines=this.engines||{};this.engines.node=">= 10.18.0"'"'" | ||
``` | ||
(requires `npm i -g json` beforehand) | ||
# [3.20.0](https://github.com/lerna/lerna/compare/v3.19.0...v3.20.0) (2019-12-27) | ||
@@ -8,0 +37,0 @@ |
{ | ||
"name": "@lerna/profiler", | ||
"version": "3.20.0", | ||
"version": "4.0.0", | ||
"description": "An internal Lerna tool", | ||
@@ -20,3 +20,3 @@ "keywords": [ | ||
"engines": { | ||
"node": ">= 6.9.0" | ||
"node": ">= 10.18.0" | ||
}, | ||
@@ -35,8 +35,7 @@ "publishConfig": { | ||
"dependencies": { | ||
"figgy-pudding": "^3.5.1", | ||
"fs-extra": "^8.1.0", | ||
"fs-extra": "^9.1.0", | ||
"npmlog": "^4.1.2", | ||
"upath": "^1.2.0" | ||
"upath": "^2.0.1" | ||
}, | ||
"gitHead": "b90f4d3618b2327716840aa2a2619497c793c8aa" | ||
"gitHead": "4582c476e07dddddd6b2e3ab6e7f52c1f9eed59a" | ||
} |
"use strict"; | ||
const figgyPudding = require("figgy-pudding"); | ||
const fs = require("fs-extra"); | ||
@@ -8,7 +7,7 @@ const npmlog = require("npmlog"); | ||
const hrtimeToMicroseconds = hrtime => { | ||
const hrtimeToMicroseconds = (hrtime) => { | ||
return (hrtime[0] * 1e9 + hrtime[1]) / 1000; | ||
}; | ||
const range = len => { | ||
const range = (len) => { | ||
return Array(len) | ||
@@ -26,12 +25,17 @@ .fill() | ||
const ProfilerConfig = figgyPudding({ | ||
concurrency: {}, | ||
log: { default: npmlog }, | ||
outputDirectory: {}, | ||
}); | ||
/** | ||
* @typedef {object} ProfilerConfig | ||
* @property {number} concurrency | ||
* @property {typeof npmlog} [log] | ||
* @property {string} [outputDirectory] | ||
*/ | ||
/** | ||
* A profiler to trace execution times across multiple concurrent calls. | ||
*/ | ||
class Profiler { | ||
constructor(opts) { | ||
const { concurrency, log, outputDirectory } = ProfilerConfig(opts); | ||
/** | ||
* @param {ProfilerConfig} options | ||
*/ | ||
constructor({ concurrency, log = npmlog, outputDirectory }) { | ||
this.events = []; | ||
@@ -53,3 +57,3 @@ this.logger = log; | ||
.then(() => fn()) | ||
.then(value => { | ||
.then((value) => { | ||
const duration = process.hrtime(startTime); | ||
@@ -84,2 +88,2 @@ | ||
module.exports = Profiler; | ||
module.exports.Profiler = Profiler; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6119
3
71
+ Addedat-least-node@1.0.0(transitive)
+ Addedfs-extra@9.1.0(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addeduniversalify@2.0.1(transitive)
+ Addedupath@2.0.1(transitive)
- Removedfiggy-pudding@^3.5.1
- Removedfiggy-pudding@3.5.2(transitive)
- Removedfs-extra@8.1.0(transitive)
- Removedjsonfile@4.0.0(transitive)
- Removeduniversalify@0.1.2(transitive)
- Removedupath@1.2.0(transitive)
Updatedfs-extra@^9.1.0
Updatedupath@^2.0.1