@clerc/plugin-friendly-error 0.42.0 → 0.42.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  import * as _clerc_core from '@clerc/core';
2
2
 
3
- declare const friendlyErrorPlugin: () => _clerc_core.Plugin<_clerc_core.Clerc<{}, {}>, _clerc_core.Clerc<{}, {}>>;
3
+ interface FriendlyErrorPluginOptions {
4
+ target?: (str: string) => void;
5
+ }
6
+ declare const friendlyErrorPlugin: ({ target, }?: FriendlyErrorPluginOptions) => _clerc_core.Plugin<_clerc_core.Clerc<{}, {}>, _clerc_core.Clerc<{}, {}>>;
4
7
 
5
- export { friendlyErrorPlugin };
8
+ export { FriendlyErrorPluginOptions, friendlyErrorPlugin };
package/dist/index.js CHANGED
@@ -1,9 +1,11 @@
1
1
  import { definePlugin } from '@clerc/core';
2
2
  import * as kons from 'kons';
3
3
 
4
- const friendlyErrorPlugin = () => definePlugin({
5
- setup: (cli) => cli.errorHandler((error) => {
6
- kons.error(error.message);
4
+ const friendlyErrorPlugin = ({
5
+ target = kons.error
6
+ } = {}) => definePlugin({
7
+ setup: (cli) => cli.errorHandler((err) => {
8
+ target(err.message);
7
9
  process.exit(1);
8
10
  })
9
11
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerc/plugin-friendly-error",
3
- "version": "0.42.0",
3
+ "version": "0.42.2",
4
4
  "author": "Ray <i@mk1.io> (https://github.com/so1ve)",
5
5
  "type": "module",
6
6
  "description": "Clerc plugin friendly error",