Comparing version 3.9.0 to 3.10.0
@@ -0,1 +1,8 @@ | ||
# [3.10.0](https://github.com/cenk1cenk2/listr2/compare/v3.9.0...v3.10.0) (2021-06-07) | ||
### Features | ||
* add context to the class itself for outside access ([98ea144](https://github.com/cenk1cenk2/listr2/commit/98ea14453257f9aec93932890e4c8c8d8ac53ead)) | ||
# [3.9.0](https://github.com/cenk1cenk2/listr2/compare/v3.8.6...v3.9.0) (2021-05-27) | ||
@@ -2,0 +9,0 @@ |
@@ -13,2 +13,3 @@ import { ListrError } from './interfaces/listr-error.interface'; | ||
err: ListrError[]; | ||
ctx: Ctx; | ||
rendererClass: ListrRendererFactory; | ||
@@ -15,0 +16,0 @@ rendererClassOptions: ListrGetRendererOptions<ListrRendererFactory>; |
@@ -87,7 +87,7 @@ "use strict"; | ||
// create a new context | ||
context = context || ((_a = this.options) === null || _a === void 0 ? void 0 : _a.ctx) || Object.create({}); | ||
this.ctx = context || ((_a = this.options) === null || _a === void 0 ? void 0 : _a.ctx) || Object.create({}); | ||
// create new error queue | ||
const errors = []; | ||
// check if the items are enabled | ||
await this.checkAll(context); | ||
await this.checkAll(this.ctx); | ||
// run tasks | ||
@@ -97,8 +97,8 @@ try { | ||
// check this item is enabled, conditions may change depending on context | ||
await task.check(context); | ||
return this.runTask(task, context, errors); | ||
await task.check(this.ctx); | ||
return this.runTask(task, this.ctx, errors); | ||
}, { concurrency: this.concurrency }); | ||
// catch errors do which do not crash through exitOnError: false | ||
if (errors.length > 0) { | ||
this.err.push(new listr_error_interface_1.ListrError('Task failed without crashing.', errors, context)); | ||
this.err.push(new listr_error_interface_1.ListrError('Task failed without crashing.', errors, this.ctx)); | ||
} | ||
@@ -108,3 +108,3 @@ this.renderer.end(); | ||
catch (error) { | ||
this.err.push(new listr_error_interface_1.ListrError(typeof (error === null || error === void 0 ? void 0 : error.message) === 'string' ? error.message : error, [error], context)); | ||
this.err.push(new listr_error_interface_1.ListrError(typeof (error === null || error === void 0 ? void 0 : error.message) === 'string' ? error.message : error, [error], this.ctx)); | ||
if (this.options.exitOnError !== false) { | ||
@@ -116,3 +116,3 @@ this.renderer.end(error); | ||
} | ||
return context; | ||
return this.ctx; | ||
} | ||
@@ -119,0 +119,0 @@ checkAll(context) { |
{ | ||
"name": "listr2", | ||
"version": "3.9.0", | ||
"version": "3.10.0", | ||
"description": "Terminal task list reborn! Create beautiful CLI interfaces via easy and logical to implement task lists that feel alive and interactive.", | ||
@@ -77,3 +77,3 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@cenk1cenk2/cz-cc": "^1.3.21", | ||
"@cenk1cenk2/cz-cc": "^1.3.25", | ||
"@cenk1cenk2/eslint-config": "^0.4.38", | ||
@@ -93,3 +93,3 @@ "@microsoft/api-extractor": "^7.15.2", | ||
"lint-staged": "^11.0.0", | ||
"prettier": "^2.2.1", | ||
"prettier": "^2.3.0", | ||
"rewire": "^5.0.0", | ||
@@ -99,8 +99,8 @@ "rimraf": "^3.0.2", | ||
"ts-node": "^10.0.0", | ||
"tsc-watch": "^4.2.9", | ||
"tsc-watch": "^4.4.0", | ||
"tsconfig-paths": "^3.9.0", | ||
"tscpaths": "^0.0.9", | ||
"typedoc": "^0.20.36", | ||
"typedoc-plugin-markdown": "^3.8.1", | ||
"typescript": "^4.2.4" | ||
"typedoc-plugin-markdown": "^3.8.2", | ||
"typescript": "^4.3.2" | ||
}, | ||
@@ -107,0 +107,0 @@ "peerDependencies": { |
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
151573
2502