@electron-forge/async-ora
Advanced tools
Comparing version 6.0.0-beta.18 to 6.0.0-beta.19
@@ -16,2 +16,4 @@ "use strict"; | ||
var _prettyMs = _interopRequireDefault(require("pretty-ms")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -28,4 +30,12 @@ | ||
let oraName = name; | ||
let startTime = null; | ||
const timing = () => { | ||
if (!startTime) return; | ||
return `-- after ${`${(0, _prettyMs.default)(Date.now() - startTime)}`.cyan}`; | ||
}; | ||
const fake = { | ||
start: () => { | ||
startTime = Date.now(); | ||
d('Process Started:', fake.text); | ||
@@ -35,15 +45,15 @@ return fake; | ||
fail: () => { | ||
d(`Process Failed: ${fake.text}`.red); | ||
d(`Process Failed: ${fake.text}`.red, timing); | ||
return fake; | ||
}, | ||
succeed: () => { | ||
d('Process Succeeded:', fake.text); | ||
d('Process Succeeded:', fake.text, timing()); | ||
return fake; | ||
}, | ||
stop: () => { | ||
d('Process Stopped:', fake.text); | ||
d('Process Stopped:', fake.text, timing()); | ||
return fake; | ||
}, | ||
warn: warning => { | ||
d('Process Warned:', warning); | ||
d('Process Warned:', warning, timing()); | ||
return fake; | ||
@@ -70,2 +80,2 @@ }, | ||
exports.default = _default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9vcmEudHMiXSwibmFtZXMiOlsiZCIsInVzZUZha2VPcmEiLCJCb29sZWFuIiwicHJvY2VzcyIsImVudiIsIkRFQlVHIiwiaW5jbHVkZXMiLCJjb25zb2xlIiwid2FybiIsInJlZCIsImZha2VPcmEiLCJuYW1lIiwib3JhTmFtZSIsImZha2UiLCJzdGFydCIsInRleHQiLCJmYWlsIiwic3VjY2VlZCIsInN0b3AiLCJ3YXJuaW5nIiwibmV3TmFtZSIsInJlYWxPcmEiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUFBOztBQUNBOztBQUVBOzs7O0FBR0EsT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HQpO1xuICAgICAgcmV0dXJuIGZha2U7XG4gICAgfSxcbiAgICBmYWlsOiAoKSA9PiB7XG4gICAgICBkKGBQcm9jZXNzIEZhaWxlZDogJHtmYWtlLnRleHR9YC5yZWQpO1xuICAgICAgcmV0dXJuIGZha2U7XG4gICAgfSxcbiAgICBzdWNjZWVkOiAoKSA9PiB7XG4gICAgICBkKCdQcm9jZXNzIFN1Y2NlZWRlZDonLCBmYWtlLnRleHQpO1xuICAgICAgcmV0dXJuIGZha2U7XG4gICAgfSxcbiAgICBzdG9wOiAoKSA9PiB7XG4gICAgICBkKCdQcm9jZXNzIFN0b3BwZWQ6JywgZmFrZS50ZXh0KTtcbiAgICAgIHJldHVybiBmYWtlO1xuICAgIH0sXG4gICAgd2FybjogKHdhcm5pbmc6IHN0cmluZykgPT4ge1xuICAgICAgZCgnUHJvY2VzcyBXYXJuZWQ6Jywgd2FybmluZyk7XG4gICAgICByZXR1cm4gZmFrZTtcbiAgICB9LFxuICAgIGdldCB0ZXh0KCkge1xuICAgICAgcmV0dXJuIG9yYU5hbWU7XG4gICAgfSxcbiAgICBzZXQgdGV4dChuZXdOYW1lOiBzdHJpbmcpIHtcbiAgICAgIGQoJ1Byb2Nlc3MgUmVuYW1lZDonLCBvcmFOYW1lLCAnIC0tPiAnLCBuZXdOYW1lKTtcbiAgICAgIG9yYU5hbWUgPSBuZXdOYW1lO1xuICAgIH0sXG4gIH07XG4gIHJldHVybiBmYWtlO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgdXNlRmFrZU9yYSA/IGZha2VPcmEgOiByZWFsT3JhO1xuIl19 | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9vcmEudHMiXSwibmFtZXMiOlsiZCIsInVzZUZha2VPcmEiLCJCb29sZWFuIiwicHJvY2VzcyIsImVudiIsIkRFQlVHIiwiaW5jbHVkZXMiLCJjb25zb2xlIiwid2FybiIsInJlZCIs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SxcbiAgICBzdWNjZWVkOiAoKSA9PiB7XG4gICAgICBkKCdQcm9jZXNzIFN1Y2NlZWRlZDonLCBmYWtlLnRleHQsIHRpbWluZygpKTtcbiAgICAgIHJldHVybiBmYWtlO1xuICAgIH0sXG4gICAgc3RvcDogKCkgPT4ge1xuICAgICAgZCgnUHJvY2VzcyBTdG9wcGVkOicsIGZha2UudGV4dCwgdGltaW5nKCkpO1xuICAgICAgcmV0dXJuIGZha2U7XG4gICAgfSxcbiAgICB3YXJuOiAod2FybmluZzogc3RyaW5nKSA9PiB7XG4gICAgICBkKCdQcm9jZXNzIFdhcm5lZDonLCB3YXJuaW5nLCB0aW1pbmcoKSk7XG4gICAgICByZXR1cm4gZmFrZTtcbiAgICB9LFxuICAgIGdldCB0ZXh0KCkge1xuICAgICAgcmV0dXJuIG9yYU5hbWU7XG4gICAgfSxcbiAgICBzZXQgdGV4dChuZXdOYW1lOiBzdHJpbmcpIHtcbiAgICAgIGQoJ1Byb2Nlc3MgUmVuYW1lZDonLCBvcmFOYW1lLCAnIC0tPiAnLCBuZXdOYW1lKTtcbiAgICAgIG9yYU5hbWUgPSBuZXdOYW1lO1xuICAgIH0sXG4gIH07XG4gIHJldHVybiBmYWtlO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgdXNlRmFrZU9yYSA/IGZha2VPcmEgOiByZWFsT3JhO1xuIl19 |
{ | ||
"name": "@electron-forge/async-ora", | ||
"version": "6.0.0-beta.18", | ||
"version": "6.0.0-beta.19", | ||
"description": "A helper utility for wrapping async functions in an ora", | ||
@@ -14,2 +14,3 @@ "repository": "https://github.com/electron-userland/electron-forge", | ||
"devDependencies": { | ||
"@types/pretty-ms": "^3.0.0", | ||
"chai": "^4.0.0", | ||
@@ -24,3 +25,4 @@ "mocha": "^5.0.0", | ||
"log-symbols": "^2.0.0", | ||
"ora": "^2.0.0" | ||
"ora": "^2.0.0", | ||
"pretty-ms": "^3.2.0" | ||
}, | ||
@@ -27,0 +29,0 @@ "engines": { |
@@ -6,2 +6,3 @@ import 'colors'; | ||
import { OraImpl } from './ora-handler'; | ||
import prettyMs from 'pretty-ms'; | ||
@@ -18,4 +19,10 @@ const d = debug('electron-forge:async-ora'); | ||
let oraName = name; | ||
let startTime: number | null = null; | ||
const timing = () => { | ||
if (!startTime) return; | ||
return `-- after ${`${prettyMs(Date.now() - startTime)}`.cyan}`; | ||
}; | ||
const fake: OraImpl = { | ||
start: () => { | ||
startTime = Date.now(); | ||
d('Process Started:', fake.text); | ||
@@ -25,15 +32,15 @@ return fake; | ||
fail: () => { | ||
d(`Process Failed: ${fake.text}`.red); | ||
d(`Process Failed: ${fake.text}`.red, timing); | ||
return fake; | ||
}, | ||
succeed: () => { | ||
d('Process Succeeded:', fake.text); | ||
d('Process Succeeded:', fake.text, timing()); | ||
return fake; | ||
}, | ||
stop: () => { | ||
d('Process Stopped:', fake.text); | ||
d('Process Stopped:', fake.text, timing()); | ||
return fake; | ||
}, | ||
warn: (warning: string) => { | ||
d('Process Warned:', warning); | ||
d('Process Warned:', warning, timing()); | ||
return fake; | ||
@@ -40,0 +47,0 @@ }, |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
380675
1646
3
5
5
+ Addedpretty-ms@^3.2.0
+ Addedparse-ms@1.0.1(transitive)
+ Addedpretty-ms@3.2.0(transitive)