@clerc/plugin-completions 0.19.0 → 0.20.0
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 +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { definePlugin } from '@clerc/core';
|
|
2
|
-
import { gracefulFlagName } from '@clerc/utils';
|
|
2
|
+
import { gracefulFlagName, kebabCase } from '@clerc/utils';
|
|
3
3
|
|
|
4
4
|
const generateCommandCompletion = (name) => `
|
|
5
5
|
${name})
|
|
@@ -37,7 +37,7 @@ const NO_DESCRIPTION = "(No Description)";
|
|
|
37
37
|
const getCompletionValue = (command) => `[CompletionResult]::new('${command.name}', '${command.name}', [CompletionResultType]::ParameterValue, '${command.description}')`;
|
|
38
38
|
const getCompletionFlag = (command) => {
|
|
39
39
|
return Object.entries(command.flags || {}).map(([flagName, flag]) => {
|
|
40
|
-
const gen = [`[CompletionResult]::new('${gracefulFlagName(flagName)}', '${flagName}', [CompletionResultType]::ParameterName, '${command.flags[flagName].description || NO_DESCRIPTION}')`];
|
|
40
|
+
const gen = [`[CompletionResult]::new('${gracefulFlagName(flagName)}', '${kebabCase(flagName)}', [CompletionResultType]::ParameterName, '${command.flags[flagName].description || NO_DESCRIPTION}')`];
|
|
41
41
|
if (flag == null ? void 0 : flag.alias) {
|
|
42
42
|
gen.push(
|
|
43
43
|
`[CompletionResult]::new('${gracefulFlagName(flag.alias)}', '${flag.alias}', [CompletionResultType]::ParameterName, '${command.flags[flagName].description || NO_DESCRIPTION}')`
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { definePlugin } from '@clerc/core';
|
|
2
|
-
import { gracefulFlagName } from '@clerc/utils';
|
|
2
|
+
import { gracefulFlagName, kebabCase } from '@clerc/utils';
|
|
3
3
|
|
|
4
4
|
const generateCommandCompletion = (name) => `
|
|
5
5
|
${name})
|
|
@@ -37,7 +37,7 @@ const NO_DESCRIPTION = "(No Description)";
|
|
|
37
37
|
const getCompletionValue = (command) => `[CompletionResult]::new('${command.name}', '${command.name}', [CompletionResultType]::ParameterValue, '${command.description}')`;
|
|
38
38
|
const getCompletionFlag = (command) => {
|
|
39
39
|
return Object.entries(command.flags || {}).map(([flagName, flag]) => {
|
|
40
|
-
const gen = [`[CompletionResult]::new('${gracefulFlagName(flagName)}', '${flagName}', [CompletionResultType]::ParameterName, '${command.flags[flagName].description || NO_DESCRIPTION}')`];
|
|
40
|
+
const gen = [`[CompletionResult]::new('${gracefulFlagName(flagName)}', '${kebabCase(flagName)}', [CompletionResultType]::ParameterName, '${command.flags[flagName].description || NO_DESCRIPTION}')`];
|
|
41
41
|
if (flag == null ? void 0 : flag.alias) {
|
|
42
42
|
gen.push(
|
|
43
43
|
`[CompletionResult]::new('${gracefulFlagName(flag.alias)}', '${flag.alias}', [CompletionResultType]::ParameterName, '${command.flags[flagName].description || NO_DESCRIPTION}')`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerc/plugin-completions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"author": "Ray <nn_201312@163.com> (https://github.com/so1ve)",
|
|
5
5
|
"description": "Clerc plugin completions",
|
|
6
6
|
"keywords": [
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"@clerc/core": "*"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@clerc/utils": "0.
|
|
54
|
+
"@clerc/utils": "0.20.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@clerc/core": "0.
|
|
57
|
+
"@clerc/core": "0.20.0"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "puild",
|