@gunshi/plugin-global 0.29.2 → 0.29.4
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/lib/index.js +3 -22
- package/package.json +9 -9
package/lib/index.js
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
import { plugin } from "@gunshi/plugin";
|
|
2
|
-
|
|
3
|
-
//#region ../shared/src/constants.ts
|
|
4
|
-
/**
|
|
5
|
-
* @author kazuya kawaguchi (a.k.a. kazupon)
|
|
6
|
-
* @license MIT
|
|
7
|
-
*/
|
|
8
|
-
const BUILT_IN_PREFIX = "_";
|
|
9
|
-
const PLUGIN_PREFIX = "g";
|
|
10
|
-
const ARG_PREFIX = "arg";
|
|
11
|
-
const BUILT_IN_KEY_SEPARATOR = ":";
|
|
12
|
-
const BUILD_IN_PREFIX_AND_KEY_SEPARATOR = `${BUILT_IN_PREFIX}${BUILT_IN_KEY_SEPARATOR}`;
|
|
13
|
-
const ARG_PREFIX_AND_KEY_SEPARATOR = `${ARG_PREFIX}${BUILT_IN_KEY_SEPARATOR}`;
|
|
14
2
|
const COMMON_ARGS = {
|
|
15
3
|
help: {
|
|
16
4
|
type: "boolean",
|
|
@@ -23,7 +11,6 @@ const COMMON_ARGS = {
|
|
|
23
11
|
description: "Display this version"
|
|
24
12
|
}
|
|
25
13
|
};
|
|
26
|
-
|
|
27
14
|
//#endregion
|
|
28
15
|
//#region ../shared/src/utils.ts
|
|
29
16
|
/**
|
|
@@ -35,9 +22,8 @@ const COMMON_ARGS = {
|
|
|
35
22
|
* @returns A namespaced key for the plugin.
|
|
36
23
|
*/
|
|
37
24
|
function namespacedId(id) {
|
|
38
|
-
return
|
|
25
|
+
return `g:${id}`;
|
|
39
26
|
}
|
|
40
|
-
|
|
41
27
|
//#endregion
|
|
42
28
|
//#region src/types.ts
|
|
43
29
|
/**
|
|
@@ -48,7 +34,6 @@ function namespacedId(id) {
|
|
|
48
34
|
* The unique identifier for the global options plugin.
|
|
49
35
|
*/
|
|
50
36
|
const pluginId = namespacedId("global");
|
|
51
|
-
|
|
52
37
|
//#endregion
|
|
53
38
|
//#region src/decorator.ts
|
|
54
39
|
/**
|
|
@@ -78,8 +63,6 @@ const decorator = (baseRunner) => async (ctx) => {
|
|
|
78
63
|
if (validationError) return await showValidationErrors(validationError);
|
|
79
64
|
return baseRunner(ctx);
|
|
80
65
|
};
|
|
81
|
-
var decorator_default = decorator;
|
|
82
|
-
|
|
83
66
|
//#endregion
|
|
84
67
|
//#region src/extension.ts
|
|
85
68
|
/**
|
|
@@ -125,7 +108,6 @@ function extension(ctx) {
|
|
|
125
108
|
}
|
|
126
109
|
};
|
|
127
110
|
}
|
|
128
|
-
|
|
129
111
|
//#endregion
|
|
130
112
|
//#region src/index.ts
|
|
131
113
|
/**
|
|
@@ -169,10 +151,9 @@ function global() {
|
|
|
169
151
|
extension,
|
|
170
152
|
setup(ctx) {
|
|
171
153
|
for (const [name, schema] of Object.entries(COMMON_ARGS)) ctx.addGlobalOption(name, schema);
|
|
172
|
-
ctx.decorateCommand(
|
|
154
|
+
ctx.decorateCommand(decorator);
|
|
173
155
|
}
|
|
174
156
|
});
|
|
175
157
|
}
|
|
176
|
-
|
|
177
158
|
//#endregion
|
|
178
|
-
export { global as default, pluginId };
|
|
159
|
+
export { global as default, pluginId };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gunshi/plugin-global",
|
|
3
3
|
"description": "global options plugin for gunshi",
|
|
4
|
-
"version": "0.29.
|
|
4
|
+
"version": "0.29.4",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "kazuya kawaguchi",
|
|
7
7
|
"email": "kawakazu80@gmail.com"
|
|
@@ -51,17 +51,17 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@gunshi/plugin": "0.29.
|
|
54
|
+
"@gunshi/plugin": "0.29.4"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"deno": "^2.
|
|
58
|
-
"jsr": "^0.
|
|
59
|
-
"jsr-exports-lint": "^0.4.
|
|
60
|
-
"publint": "^0.3.
|
|
57
|
+
"deno": "^2.7.11",
|
|
58
|
+
"jsr": "^0.14.3",
|
|
59
|
+
"jsr-exports-lint": "^0.4.2",
|
|
60
|
+
"publint": "^0.3.18",
|
|
61
61
|
"tsdown": "0.15.12",
|
|
62
|
-
"typedoc": "^0.28.
|
|
63
|
-
"typedoc-plugin-markdown": "^4.
|
|
64
|
-
"@gunshi/shared": "0.29.
|
|
62
|
+
"typedoc": "^0.28.18",
|
|
63
|
+
"typedoc-plugin-markdown": "^4.11.0",
|
|
64
|
+
"@gunshi/shared": "0.29.4"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "tsdown",
|