@clerc/plugin-friendly-error
Advanced tools
Comparing version 0.42.1 to 0.42.2
import * as _clerc_core from '@clerc/core'; | ||
declare const friendlyErrorPlugin: () => _clerc_core.Plugin<_clerc_core.Clerc<{}, {}>, _clerc_core.Clerc<{}, {}>>; | ||
interface FriendlyErrorPluginOptions { | ||
target?: (str: string) => void; | ||
} | ||
declare const friendlyErrorPlugin: ({ target, }?: FriendlyErrorPluginOptions) => _clerc_core.Plugin<_clerc_core.Clerc<{}, {}>, _clerc_core.Clerc<{}, {}>>; | ||
export { friendlyErrorPlugin }; | ||
export { FriendlyErrorPluginOptions, friendlyErrorPlugin }; |
import { definePlugin } from '@clerc/core'; | ||
import * as kons from 'kons'; | ||
const friendlyErrorPlugin = () => definePlugin({ | ||
const friendlyErrorPlugin = ({ | ||
target = kons.error | ||
} = {}) => definePlugin({ | ||
setup: (cli) => cli.errorHandler((err) => { | ||
kons.error(err.message); | ||
target(err.message); | ||
process.exit(1); | ||
@@ -8,0 +10,0 @@ }) |
{ | ||
"name": "@clerc/plugin-friendly-error", | ||
"version": "0.42.1", | ||
"version": "0.42.2", | ||
"author": "Ray <i@mk1.io> (https://github.com/so1ve)", | ||
@@ -5,0 +5,0 @@ "type": "module", |
3411
17