@sketch-hq/sketch-assistant-utils
Advanced tools
Comparing version 5.0.0-next.4 to 5.0.0-next.5
# @sketch-hq/sketch-assistant-utils | ||
## 5.0.0-next.5 | ||
### Patch Changes | ||
- 9212903: Handle Assistants exported as ESM default exports | ||
## 5.0.0-next.4 | ||
@@ -4,0 +10,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { AssistantDefinition, Assistant, AssistantEnv, Maybe, RuleDefinition, ESModuleInterop } from '@sketch-hq/sketch-assistant-types'; | ||
import { AssistantDefinition, Assistant, AssistantEnv, Maybe, RuleDefinition } from '@sketch-hq/sketch-assistant-types'; | ||
/** | ||
@@ -24,3 +24,3 @@ * Merge assistant definitions together to form a single assistant definition, with a syntax similar | ||
*/ | ||
declare const prepare: (source: import("@sketch-hq/sketch-assistant-types").ValueOrArray<Assistant | ESModuleInterop<Assistant>>, env: AssistantEnv) => Promise<AssistantDefinition>; | ||
declare const prepare: (pkgExport: import("@sketch-hq/sketch-assistant-types").MaybeESModule<import("@sketch-hq/sketch-assistant-types").ValueOrArray<import("@sketch-hq/sketch-assistant-types").MaybeESModule<Assistant>>>, env: AssistantEnv) => Promise<AssistantDefinition>; | ||
/** | ||
@@ -27,0 +27,0 @@ * Lookup a rule definition by rule name. |
@@ -45,4 +45,5 @@ "use strict"; | ||
*/ | ||
const prepare = (source, env) => __awaiter(void 0, void 0, void 0, function* () { | ||
const definitions = yield Promise.all((Array.isArray(source) ? source : [source]) | ||
const prepare = (pkgExport, env) => __awaiter(void 0, void 0, void 0, function* () { | ||
const assistant = '__esModule' in pkgExport ? pkgExport.default : pkgExport; | ||
const definitions = yield Promise.all((Array.isArray(assistant) ? assistant : [assistant]) | ||
.flat(Infinity) | ||
@@ -49,0 +50,0 @@ .map((item) => { |
@@ -44,4 +44,4 @@ import { FileFormat, Assistant, RuleOptionsCreator, RuleFunction, RuleDefinition, AssistantDefinition, AssistantConfig, ViolationSeverity, RuleConfigGroup, AssistantEnv, AssistantResult, RuleConfig } from '@sketch-hq/sketch-assistant-types'; | ||
}; | ||
export declare const testRule: (filepath: string, assistant: import("@sketch-hq/sketch-assistant-types").ValueOrArray<Assistant | import("@sketch-hq/sketch-assistant-types").ESModuleInterop<Assistant>>, ruleName: string, ruleConfig?: RuleConfig, env?: AssistantEnv) => Promise<AssistantResult>; | ||
export declare const testRule: (filepath: string, assistant: import("@sketch-hq/sketch-assistant-types").MaybeESModule<import("@sketch-hq/sketch-assistant-types").ValueOrArray<import("@sketch-hq/sketch-assistant-types").MaybeESModule<Assistant>>>, ruleName: string, ruleConfig?: RuleConfig, env?: AssistantEnv) => Promise<AssistantResult>; | ||
export { createRule, createDummyRectNode, createAssistantConfig, createAssistant, createAssistantDefinition, }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { AssistantDefinition, Assistant, AssistantEnv, Maybe, RuleDefinition, ESModuleInterop } from '@sketch-hq/sketch-assistant-types'; | ||
import { AssistantDefinition, Assistant, AssistantEnv, Maybe, RuleDefinition } from '@sketch-hq/sketch-assistant-types'; | ||
/** | ||
@@ -24,3 +24,3 @@ * Merge assistant definitions together to form a single assistant definition, with a syntax similar | ||
*/ | ||
declare const prepare: (source: import("@sketch-hq/sketch-assistant-types").ValueOrArray<Assistant | ESModuleInterop<Assistant>>, env: AssistantEnv) => Promise<AssistantDefinition>; | ||
declare const prepare: (pkgExport: import("@sketch-hq/sketch-assistant-types").MaybeESModule<import("@sketch-hq/sketch-assistant-types").ValueOrArray<import("@sketch-hq/sketch-assistant-types").MaybeESModule<Assistant>>>, env: AssistantEnv) => Promise<AssistantDefinition>; | ||
/** | ||
@@ -27,0 +27,0 @@ * Lookup a rule definition by rule name. |
@@ -42,4 +42,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
*/ | ||
const prepare = (source, env) => __awaiter(void 0, void 0, void 0, function* () { | ||
const definitions = yield Promise.all((Array.isArray(source) ? source : [source]) | ||
const prepare = (pkgExport, env) => __awaiter(void 0, void 0, void 0, function* () { | ||
const assistant = '__esModule' in pkgExport ? pkgExport.default : pkgExport; | ||
const definitions = yield Promise.all((Array.isArray(assistant) ? assistant : [assistant]) | ||
.flat(Infinity) | ||
@@ -46,0 +47,0 @@ .map((item) => { |
@@ -44,4 +44,4 @@ import { FileFormat, Assistant, RuleOptionsCreator, RuleFunction, RuleDefinition, AssistantDefinition, AssistantConfig, ViolationSeverity, RuleConfigGroup, AssistantEnv, AssistantResult, RuleConfig } from '@sketch-hq/sketch-assistant-types'; | ||
}; | ||
export declare const testRule: (filepath: string, assistant: import("@sketch-hq/sketch-assistant-types").ValueOrArray<Assistant | import("@sketch-hq/sketch-assistant-types").ESModuleInterop<Assistant>>, ruleName: string, ruleConfig?: RuleConfig, env?: AssistantEnv) => Promise<AssistantResult>; | ||
export declare const testRule: (filepath: string, assistant: import("@sketch-hq/sketch-assistant-types").MaybeESModule<import("@sketch-hq/sketch-assistant-types").ValueOrArray<import("@sketch-hq/sketch-assistant-types").MaybeESModule<Assistant>>>, ruleName: string, ruleConfig?: RuleConfig, env?: AssistantEnv) => Promise<AssistantResult>; | ||
export { createRule, createDummyRectNode, createAssistantConfig, createAssistant, createAssistantDefinition, }; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@sketch-hq/sketch-assistant-utils", | ||
"version": "5.0.0-next.4", | ||
"version": "5.0.0-next.5", | ||
"module": "dist/esm/index", | ||
@@ -30,3 +30,3 @@ "main": "dist/cjs/index", | ||
"@json-schema-spec/json-pointer": "0.1.2", | ||
"@sketch-hq/sketch-assistant-types": "3.0.0-next.3", | ||
"@sketch-hq/sketch-assistant-types": "3.0.0-next.4", | ||
"ajv": "6.12.0", | ||
@@ -33,0 +33,0 @@ "humps": "2.0.1", |
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
164057
2166
+ Added@sketch-hq/sketch-assistant-types@3.0.0-next.4(transitive)
- Removed@sketch-hq/sketch-assistant-types@3.0.0-next.3(transitive)