@sketch-hq/sketch-assistant-utils
Advanced tools
Comparing version 3.0.0 to 3.0.1
# @sketch-hq/sketch-assistant-utils | ||
## 3.0.1 | ||
### Patch Changes | ||
- 97d2d36: Map rule errors into plain objects with type PlainRuleError | ||
- 97d2d36: Fix `createRule` test helper to create dummy rules with an undefined platform by default | ||
## 3.0.0 | ||
@@ -4,0 +11,0 @@ |
@@ -78,3 +78,8 @@ "use strict"; | ||
violations, | ||
errors: Array.from(error), | ||
errors: Array.from(error).map(error => ({ | ||
assistantName: error.assistantName, | ||
ruleName: error.ruleName, | ||
message: error.cause.message, | ||
stack: error.cause.stack || '', | ||
})), | ||
metadata, | ||
@@ -81,0 +86,0 @@ }; |
@@ -27,3 +27,3 @@ "use strict"; | ||
debug, | ||
platform: platform !== null && platform !== void 0 ? platform : 'node', | ||
platform, | ||
}); | ||
@@ -30,0 +30,0 @@ exports.createRule = createRule; |
@@ -103,2 +103,11 @@ import { FileFormat3 } from '@sketch-hq/sketch-file-format-ts'; | ||
/** | ||
* JavaScript errors encountered during rule invocation normalised into plain objects. | ||
*/ | ||
export declare type PlainRuleError = { | ||
assistantName: string; | ||
ruleName: string; | ||
message: string; | ||
stack: string; | ||
}; | ||
/** | ||
* The result of running an assistant. One or more `violations` implies the assistant's rules found | ||
@@ -111,3 +120,3 @@ * issues with the Sketch document. One or more `errors` implies that some rules didn't run because | ||
violations: Violation[]; | ||
errors: Error[]; | ||
errors: PlainRuleError[]; | ||
metadata: { | ||
@@ -114,0 +123,0 @@ assistant: Omit<AssistantDefinition, 'rules'>; |
@@ -72,3 +72,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
violations, | ||
errors: Array.from(error), | ||
errors: Array.from(error).map(error => ({ | ||
assistantName: error.assistantName, | ||
ruleName: error.ruleName, | ||
message: error.cause.message, | ||
stack: error.cause.stack || '', | ||
})), | ||
metadata, | ||
@@ -75,0 +80,0 @@ }; |
@@ -25,3 +25,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
debug, | ||
platform: platform !== null && platform !== void 0 ? platform : 'node', | ||
platform, | ||
}); | ||
@@ -28,0 +28,0 @@ /** |
@@ -103,2 +103,11 @@ import { FileFormat3 } from '@sketch-hq/sketch-file-format-ts'; | ||
/** | ||
* JavaScript errors encountered during rule invocation normalised into plain objects. | ||
*/ | ||
export declare type PlainRuleError = { | ||
assistantName: string; | ||
ruleName: string; | ||
message: string; | ||
stack: string; | ||
}; | ||
/** | ||
* The result of running an assistant. One or more `violations` implies the assistant's rules found | ||
@@ -111,3 +120,3 @@ * issues with the Sketch document. One or more `errors` implies that some rules didn't run because | ||
violations: Violation[]; | ||
errors: Error[]; | ||
errors: PlainRuleError[]; | ||
metadata: { | ||
@@ -114,0 +123,0 @@ assistant: Omit<AssistantDefinition, 'rules'>; |
{ | ||
"name": "@sketch-hq/sketch-assistant-utils", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"module": "dist/esm/index", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index", |
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
220726
3309