@gunshi/plugin-i18n 0.33.0 → 0.35.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/lib/index.d.ts +32 -5
- package/package.json +11 -13
package/lib/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Args, Awaitable, Command, CommandContext, DefaultGunshiParams, ExtendContext, ExtractArgs, ExtractExtensions, GunshiParams, GunshiParamsConstraint, PluginWithExtension, Prettify } from "@gunshi/plugin";
|
|
2
2
|
|
|
3
|
-
//#region ../../node_modules/.pnpm/args-tokens@0.
|
|
3
|
+
//#region ../../node_modules/.pnpm/args-tokens@0.27.0/node_modules/args-tokens/lib/resolver.d.ts
|
|
4
4
|
|
|
5
5
|
//#region src/resolver.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* An argument schema definition for command-line argument parsing.
|
|
8
8
|
*
|
|
9
9
|
* This schema is similar to the schema of Node.js `util.parseArgs` but with extended features:
|
|
10
|
-
* - Additional `required` and `
|
|
10
|
+
* - Additional `required`, `description`, and `hidden` properties
|
|
11
11
|
* - Extended `type` support: 'string', 'boolean', 'number', 'enum', 'positional', 'custom'
|
|
12
12
|
* - Simplified `default` property (single type, not union types)
|
|
13
13
|
*
|
|
@@ -112,13 +112,35 @@ interface ArgSchema {
|
|
|
112
112
|
* ```
|
|
113
113
|
*/
|
|
114
114
|
description?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Hide the argument from generated help or usage output.
|
|
117
|
+
*
|
|
118
|
+
* This is metadata for renderers. It does not affect parsing, validation,
|
|
119
|
+
* required checks, defaults, conflicts, or resolved values.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* Hidden compatibility option:
|
|
123
|
+
* ```ts
|
|
124
|
+
* {
|
|
125
|
+
* legacy: {
|
|
126
|
+
* type: 'string',
|
|
127
|
+
* hidden: true,
|
|
128
|
+
* description: 'Deprecated compatibility option'
|
|
129
|
+
* }
|
|
130
|
+
* }
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
hidden?: boolean;
|
|
115
134
|
/**
|
|
116
135
|
* Marks the argument as required.
|
|
117
136
|
*
|
|
118
137
|
* When `true`, the argument must be provided by the user.
|
|
119
138
|
* If missing, an `ArgResolveError` with type 'required' will be thrown.
|
|
120
139
|
*
|
|
121
|
-
*
|
|
140
|
+
* For single-value positional arguments, omitting `required` keeps the argument
|
|
141
|
+
* required for compatibility. Set `required: false` to make a positional argument
|
|
142
|
+
* optional. Optional positional arguments leave enough input values for later
|
|
143
|
+
* required positional arguments before consuming a value.
|
|
122
144
|
*
|
|
123
145
|
* @example
|
|
124
146
|
* Required arguments:
|
|
@@ -142,7 +164,8 @@ interface ArgSchema {
|
|
|
142
164
|
*
|
|
143
165
|
* When `true`, the resolved value becomes an array.
|
|
144
166
|
* For options: can be specified multiple times (--tag foo --tag bar)
|
|
145
|
-
* For positional: collects remaining positional arguments
|
|
167
|
+
* For positional: collects remaining positional arguments after preserving values for
|
|
168
|
+
* later required positional arguments.
|
|
146
169
|
*
|
|
147
170
|
* Note: Only `true` is allowed (not `false`) to make intent explicit.
|
|
148
171
|
*
|
|
@@ -222,7 +245,11 @@ interface ArgSchema {
|
|
|
222
245
|
* - `boolean` type: boolean default
|
|
223
246
|
* - `number` type: number default
|
|
224
247
|
* - `enum` type: must be one of the `choices` values
|
|
225
|
-
* - `positional`/`custom` type:
|
|
248
|
+
* - `positional`/`custom` type: string, boolean, or number default
|
|
249
|
+
*
|
|
250
|
+
* For single-value positional arguments, the default is used when the positional
|
|
251
|
+
* value is missing or when the value is preserved for later required positional
|
|
252
|
+
* arguments, unless `required: true` is set.
|
|
226
253
|
*
|
|
227
254
|
* @example
|
|
228
255
|
* Default values by type:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gunshi/plugin-i18n",
|
|
3
3
|
"description": "internationalization plugin for gunshi",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.35.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "kazuya kawaguchi",
|
|
7
7
|
"email": "kawakazu80@gmail.com"
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@gunshi/plugin": "0.
|
|
56
|
+
"@gunshi/plugin": "0.35.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@gunshi/plugin-global": "0.
|
|
59
|
+
"@gunshi/plugin-global": "0.35.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependenciesMeta": {
|
|
62
62
|
"@gunshi/plugin-global": {
|
|
@@ -64,25 +64,23 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@intlify/core": "
|
|
67
|
+
"@intlify/core-base": "12.0.0-alpha.4",
|
|
68
68
|
"deno": "^2.7.14",
|
|
69
69
|
"jsr": "^0.14.3",
|
|
70
70
|
"jsr-exports-lint": "^0.4.2",
|
|
71
71
|
"messageformat": "4.0.0",
|
|
72
72
|
"publint": "^0.3.20",
|
|
73
73
|
"tsdown": "0.21.0",
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"@gunshi/
|
|
77
|
-
"@gunshi/
|
|
78
|
-
"@gunshi/
|
|
79
|
-
"
|
|
80
|
-
"gunshi": "0.33.0",
|
|
81
|
-
"@gunshi/shared": "0.33.0"
|
|
74
|
+
"@gunshi/bone": "0.35.0",
|
|
75
|
+
"@gunshi/plugin-renderer": "0.35.0",
|
|
76
|
+
"@gunshi/plugin-global": "0.35.0",
|
|
77
|
+
"@gunshi/resources": "0.35.0",
|
|
78
|
+
"@gunshi/shared": "0.35.0",
|
|
79
|
+
"gunshi": "0.35.0"
|
|
82
80
|
},
|
|
83
81
|
"scripts": {
|
|
84
82
|
"build": "tsdown",
|
|
85
|
-
"build:docs": "
|
|
83
|
+
"build:docs": "tsx ../../scripts/api-references.ts",
|
|
86
84
|
"lint:jsr": "jsr publish --dry-run --allow-dirty",
|
|
87
85
|
"typecheck:deno": "deno check --import-map=../../importmap.json ./src"
|
|
88
86
|
}
|