@clerc/plugin-not-found 0.6.0 → 0.6.1

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.cjs CHANGED
@@ -4,6 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var clerc = require('clerc');
6
6
  var fastestLevenshtein = require('fastest-levenshtein');
7
+ var pc = require('picocolors');
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var pc__default = /*#__PURE__*/_interopDefaultLegacy(pc);
7
12
 
8
13
  const notFoundPlugin = () => clerc.definePlugin({
9
14
  setup(cli) {
@@ -16,13 +21,13 @@ const notFoundPlugin = () => clerc.definePlugin({
16
21
  }
17
22
  if (ctx.parameters.length === 0) {
18
23
  console.log("No command given.");
19
- console.log(`Possible commands: ${Object.keys(cli._commands).join(", ")}.`);
24
+ console.log(`Possible commands: ${pc__default["default"].bold(Object.keys(cli._commands).join(", "))}.`);
20
25
  return;
21
26
  }
22
27
  const calledCommandName = e.message.replace("No such command: ", "");
23
28
  const closestCommandName = fastestLevenshtein.closest(calledCommandName, Object.keys(cli._commands));
24
- console.log(`Command "${calledCommandName}" not found.`);
25
- console.log(`Did you mean "${closestCommandName}"?`);
29
+ console.log(`Command "${pc__default["default"].strikethrough(calledCommandName)}" not found.`);
30
+ console.log(`Did you mean "${pc__default["default"].bold(closestCommandName)}"?`);
26
31
  }
27
32
  });
28
33
  }
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { definePlugin, NoSuchCommandError } from 'clerc';
2
2
  import { closest } from 'fastest-levenshtein';
3
+ import pc from 'picocolors';
3
4
 
4
5
  const notFoundPlugin = () => definePlugin({
5
6
  setup(cli) {
@@ -12,13 +13,13 @@ const notFoundPlugin = () => definePlugin({
12
13
  }
13
14
  if (ctx.parameters.length === 0) {
14
15
  console.log("No command given.");
15
- console.log(`Possible commands: ${Object.keys(cli._commands).join(", ")}.`);
16
+ console.log(`Possible commands: ${pc.bold(Object.keys(cli._commands).join(", "))}.`);
16
17
  return;
17
18
  }
18
19
  const calledCommandName = e.message.replace("No such command: ", "");
19
20
  const closestCommandName = closest(calledCommandName, Object.keys(cli._commands));
20
- console.log(`Command "${calledCommandName}" not found.`);
21
- console.log(`Did you mean "${closestCommandName}"?`);
21
+ console.log(`Command "${pc.strikethrough(calledCommandName)}" not found.`);
22
+ console.log(`Did you mean "${pc.bold(closestCommandName)}"?`);
22
23
  }
23
24
  });
24
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerc/plugin-not-found",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "author": "Ray <nn_201312@163.com> (https://github.com/so1ve)",
5
5
  "description": "Clerc plugin not found (did you mean)",
6
6
  "keywords": [
@@ -43,8 +43,8 @@
43
43
  "clerc": "*"
44
44
  },
45
45
  "dependencies": {
46
- "@clerc/utils": "0.6.0",
47
- "clerc": "0.6.0",
46
+ "@clerc/utils": "0.6.1",
47
+ "clerc": "0.6.1",
48
48
  "fastest-levenshtein": "^1.0.16",
49
49
  "picocolors": "^1.0.0"
50
50
  },