@clerc/plugin-not-found 0.17.0 → 0.17.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.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { definePlugin, NoSuchCommandError, NoCommandGivenError } from '@clerc/core';
|
|
2
2
|
import { semanticArray } from '@clerc/utils';
|
|
3
3
|
import didyoumean from 'didyoumean2';
|
|
4
|
-
import
|
|
4
|
+
import pc from 'picocolors';
|
|
5
5
|
|
|
6
6
|
const notFoundPlugin = () => definePlugin({
|
|
7
7
|
setup: (cli) => {
|
|
@@ -19,15 +19,15 @@ const notFoundPlugin = () => definePlugin({
|
|
|
19
19
|
if (ctx.raw._.length === 0) {
|
|
20
20
|
console.log("No command given.");
|
|
21
21
|
if (hasCommands) {
|
|
22
|
-
console.log(`Possible commands: ${
|
|
22
|
+
console.log(`Possible commands: ${pc.bold(semanticArray(commandKeys))}.`);
|
|
23
23
|
}
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
const calledCommandName = e.message.replace("No such command: ", "");
|
|
27
27
|
const closestCommandName = didyoumean(calledCommandName, commandKeys);
|
|
28
|
-
console.log(`Command "${
|
|
28
|
+
console.log(`Command "${pc.strikethrough(calledCommandName)}" not found.`);
|
|
29
29
|
if (hasCommands && closestCommandName) {
|
|
30
|
-
console.log(`Did you mean "${
|
|
30
|
+
console.log(`Did you mean "${pc.bold(closestCommandName)}"?`);
|
|
31
31
|
} else if (!hasCommands) {
|
|
32
32
|
console.log("NOTE: You haven't register any command yet.");
|
|
33
33
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { definePlugin, NoSuchCommandError, NoCommandGivenError } from '@clerc/core';
|
|
2
2
|
import { semanticArray } from '@clerc/utils';
|
|
3
3
|
import didyoumean from 'didyoumean2';
|
|
4
|
-
import
|
|
4
|
+
import pc from 'picocolors';
|
|
5
5
|
|
|
6
6
|
const notFoundPlugin = () => definePlugin({
|
|
7
7
|
setup: (cli) => {
|
|
@@ -19,15 +19,15 @@ const notFoundPlugin = () => definePlugin({
|
|
|
19
19
|
if (ctx.raw._.length === 0) {
|
|
20
20
|
console.log("No command given.");
|
|
21
21
|
if (hasCommands) {
|
|
22
|
-
console.log(`Possible commands: ${
|
|
22
|
+
console.log(`Possible commands: ${pc.bold(semanticArray(commandKeys))}.`);
|
|
23
23
|
}
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
const calledCommandName = e.message.replace("No such command: ", "");
|
|
27
27
|
const closestCommandName = didyoumean(calledCommandName, commandKeys);
|
|
28
|
-
console.log(`Command "${
|
|
28
|
+
console.log(`Command "${pc.strikethrough(calledCommandName)}" not found.`);
|
|
29
29
|
if (hasCommands && closestCommandName) {
|
|
30
|
-
console.log(`Did you mean "${
|
|
30
|
+
console.log(`Did you mean "${pc.bold(closestCommandName)}"?`);
|
|
31
31
|
} else if (!hasCommands) {
|
|
32
32
|
console.log("NOTE: You haven't register any command yet.");
|
|
33
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerc/plugin-not-found",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2",
|
|
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": [
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"@clerc/core": "*"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"colorette": "^2.0.19",
|
|
55
54
|
"didyoumean2": "^5.0.0",
|
|
56
|
-
"
|
|
55
|
+
"picocolors": "^1.0.0",
|
|
56
|
+
"@clerc/utils": "0.17.2"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@clerc/core": "0.17.
|
|
59
|
+
"@clerc/core": "0.17.2"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "puild",
|