@gunshi/resources 1.0.0-rc.4 → 1.0.0-rc.6
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/README.md +4 -3
- package/lib/index.d.ts +16 -0
- package/lib/index.js +19 -3
- package/locales/en-US.json +11 -3
- package/locales/ja-JP.json +8 -0
- package/package.json +2 -7
package/README.md
CHANGED
|
@@ -16,9 +16,6 @@ pnpm add @gunshi/resources
|
|
|
16
16
|
# yarn
|
|
17
17
|
yarn add @gunshi/resources
|
|
18
18
|
|
|
19
|
-
# deno
|
|
20
|
-
deno add jsr:@gunshi/resources
|
|
21
|
-
|
|
22
19
|
# bun
|
|
23
20
|
bun add @gunshi/resources
|
|
24
21
|
```
|
|
@@ -59,6 +56,10 @@ Keys for built-in functionalities are handled by Gunshi's default locales. The c
|
|
|
59
56
|
- `NEGATABLE` - Prefix for negatable options (e.g., "Negatable of --verbose")
|
|
60
57
|
- `DEFAULT` - Prefix for default values (e.g., "default: 5")
|
|
61
58
|
- `CHOICES` - Prefix for available choices (e.g., "choices: red, green, blue")
|
|
59
|
+
- `CAUSEDBY` - Heading of the lines of the causes of a `CommandError` (e.g., "Caused by: connect ECONNREFUSED 127.0.0.1:5432")
|
|
60
|
+
- `json` - Description for the `--json` option of `jsonArgs` ("Output the result as JSON")
|
|
61
|
+
- `json:invalid-arguments`, `json:next:help`, `json:next:help-placeholder` - Texts that only the JSON errors of `--json` print
|
|
62
|
+
- `err:json:not-supported`, `err:json:invalid-result`, `err:json:unserializable-result` - Messages of the errors of the JSON output
|
|
62
63
|
- `help` - Description for the help option ("Display this help message")
|
|
63
64
|
- `version` - Description for the version option ("Display this version")
|
|
64
65
|
The following keys are provided for each locale:
|
package/lib/index.d.ts
CHANGED
|
@@ -16,8 +16,13 @@ declare const _default: {
|
|
|
16
16
|
NEGATABLE: string;
|
|
17
17
|
DEFAULT: string;
|
|
18
18
|
CHOICES: string;
|
|
19
|
+
CAUSEDBY: string;
|
|
19
20
|
help: string;
|
|
20
21
|
version: string;
|
|
22
|
+
json: string;
|
|
23
|
+
"json:invalid-arguments": string;
|
|
24
|
+
"json:next:help": string;
|
|
25
|
+
"json:next:help-placeholder": string;
|
|
21
26
|
"err:arg:required-option": string;
|
|
22
27
|
"err:arg:required-positional": string;
|
|
23
28
|
"err:arg:invalid-type": string;
|
|
@@ -33,6 +38,9 @@ declare const _default: {
|
|
|
33
38
|
"err:cmd:ambiguous": string;
|
|
34
39
|
"err:cmd:inconsistent-options": string;
|
|
35
40
|
"err:cmd:lazy-schema-mismatch": string;
|
|
41
|
+
"err:json:not-supported": string;
|
|
42
|
+
"err:json:invalid-result": string;
|
|
43
|
+
"err:json:unserializable-result": string;
|
|
36
44
|
"err:suggestion:did-you-mean": string;
|
|
37
45
|
};
|
|
38
46
|
'ja-JP': {
|
|
@@ -47,8 +55,13 @@ declare const _default: {
|
|
|
47
55
|
NEGATABLE: string;
|
|
48
56
|
DEFAULT: string;
|
|
49
57
|
CHOICES: string;
|
|
58
|
+
CAUSEDBY: string;
|
|
50
59
|
help: string;
|
|
51
60
|
version: string;
|
|
61
|
+
json: string;
|
|
62
|
+
"json:invalid-arguments": string;
|
|
63
|
+
"json:next:help": string;
|
|
64
|
+
"json:next:help-placeholder": string;
|
|
52
65
|
"err:arg:required-option": string;
|
|
53
66
|
"err:arg:required-positional": string;
|
|
54
67
|
"err:arg:invalid-type": string;
|
|
@@ -64,6 +77,9 @@ declare const _default: {
|
|
|
64
77
|
"err:cmd:ambiguous": string;
|
|
65
78
|
"err:cmd:inconsistent-options": string;
|
|
66
79
|
"err:cmd:lazy-schema-mismatch": string;
|
|
80
|
+
"err:json:not-supported": string;
|
|
81
|
+
"err:json:invalid-result": string;
|
|
82
|
+
"err:json:unserializable-result": string;
|
|
67
83
|
"err:suggestion:did-you-mean": string;
|
|
68
84
|
};
|
|
69
85
|
};
|
package/lib/index.js
CHANGED
|
@@ -17,16 +17,21 @@ var src_default = {
|
|
|
17
17
|
NEGATABLE: "Negatable of",
|
|
18
18
|
DEFAULT: "default",
|
|
19
19
|
CHOICES: "choices",
|
|
20
|
+
CAUSEDBY: "Caused by",
|
|
20
21
|
help: "Display this help message",
|
|
21
22
|
version: "Display this version",
|
|
22
|
-
|
|
23
|
+
json: "Output the result as JSON",
|
|
24
|
+
"json:invalid-arguments": "{$count} arguments are invalid",
|
|
25
|
+
"json:next:help": "See the arguments of the command",
|
|
26
|
+
"json:next:help-placeholder": "Replace <COMMAND> with how you ran this CLI, to see the arguments of the command",
|
|
27
|
+
"err:arg:required-option": "Option {$displayName} is required",
|
|
23
28
|
"err:arg:required-positional": "Positional argument {$displayName} is required",
|
|
24
29
|
"err:arg:invalid-type": "Invalid value for {$displayName}: expected {$expected}",
|
|
25
30
|
"err:arg:invalid-choice": "Invalid value for {$displayName}: expected one of {$choices}",
|
|
26
31
|
"err:arg:custom-parse": "Invalid value for {$displayName}: {$reason}",
|
|
27
32
|
"err:arg:unknown-option": "Unknown option: {$rawName}",
|
|
28
|
-
"err:arg:unexpected-value": "
|
|
29
|
-
"err:arg:missing-value": "
|
|
33
|
+
"err:arg:unexpected-value": "Option {$displayName} does not take a value",
|
|
34
|
+
"err:arg:missing-value": "Option {$displayName} requires a value",
|
|
30
35
|
"err:arg:missing-value:hint": "(to pass '{$next}' as its value, write '{$suggestion}')",
|
|
31
36
|
"err:arg:conflict": "{$displayName} conflicts with {$conflictDisplayName}",
|
|
32
37
|
"err:arg:invalid-default": "Invalid default for {$displayName}: {$actual} is not one of {$choices}",
|
|
@@ -34,6 +39,9 @@ var src_default = {
|
|
|
34
39
|
"err:cmd:ambiguous": "The command is ambiguous. Move options after the command name: {$candidatePaths}",
|
|
35
40
|
"err:cmd:inconsistent-options": "The options do not identify a consistent command. Move options after the command name.",
|
|
36
41
|
"err:cmd:lazy-schema-mismatch": "The lazy command definition does not match its loaded options. Declare leading options in the lazy definition or move options after the command name: {$commandPath}",
|
|
42
|
+
"err:json:not-supported": "This command does not support --json",
|
|
43
|
+
"err:json:invalid-result": "The command finished, but did not return an object to output as JSON. A plugin that decorates the command may have dropped its result",
|
|
44
|
+
"err:json:unserializable-result": "The command finished, but its result cannot be converted to JSON: {$message}",
|
|
37
45
|
"err:suggestion:did-you-mean": "Did you mean {$name}?"
|
|
38
46
|
},
|
|
39
47
|
"ja-JP": {
|
|
@@ -48,8 +56,13 @@ var src_default = {
|
|
|
48
56
|
NEGATABLE: "否定可能な",
|
|
49
57
|
DEFAULT: "デフォルト",
|
|
50
58
|
CHOICES: "選択肢",
|
|
59
|
+
CAUSEDBY: "原因",
|
|
51
60
|
help: "このヘルプメッセージを表示",
|
|
52
61
|
version: "このバージョンを表示",
|
|
62
|
+
json: "結果を JSON で出力する",
|
|
63
|
+
"json:invalid-arguments": "{$count} 個の引数が不正です",
|
|
64
|
+
"json:next:help": "コマンドの引数を確認する",
|
|
65
|
+
"json:next:help-placeholder": "<COMMAND> を、この CLI を実行したときのコマンドに置き換えて、コマンドの引数を確認する",
|
|
53
66
|
"err:arg:required-option": "オプション {$displayName} は必須です",
|
|
54
67
|
"err:arg:required-positional": "位置引数 {$displayName} は必須です",
|
|
55
68
|
"err:arg:invalid-type": "{$displayName} の値が不正です。期待される型: {$expected}",
|
|
@@ -65,6 +78,9 @@ var src_default = {
|
|
|
65
78
|
"err:cmd:ambiguous": "コマンドを一意に解決できません。オプションをコマンド名の後ろに移してください: {$candidatePaths}",
|
|
66
79
|
"err:cmd:inconsistent-options": "オプションからコマンドを一意に解決できません。オプションをコマンド名の後ろに移してください。",
|
|
67
80
|
"err:cmd:lazy-schema-mismatch": "lazy コマンドの定義とロード後のオプションが一致しません。前置きするオプションを lazy の定義に記載するか、コマンド名の後ろに移してください: {$commandPath}",
|
|
81
|
+
"err:json:not-supported": "このコマンドは --json に対応していません",
|
|
82
|
+
"err:json:invalid-result": "コマンドは終了しましたが、JSON として出力するオブジェクトを返しませんでした。コマンドを包み込む plugin が結果を落とした可能性があります",
|
|
83
|
+
"err:json:unserializable-result": "コマンドは終了しましたが、結果を JSON に変換できません: {$message}",
|
|
68
84
|
"err:suggestion:did-you-mean": "{$name} の指定ミスではありませんか?"
|
|
69
85
|
}
|
|
70
86
|
};
|
package/locales/en-US.json
CHANGED
|
@@ -10,16 +10,21 @@
|
|
|
10
10
|
"NEGATABLE": "Negatable of",
|
|
11
11
|
"DEFAULT": "default",
|
|
12
12
|
"CHOICES": "choices",
|
|
13
|
+
"CAUSEDBY": "Caused by",
|
|
13
14
|
"help": "Display this help message",
|
|
14
15
|
"version": "Display this version",
|
|
15
|
-
"
|
|
16
|
+
"json": "Output the result as JSON",
|
|
17
|
+
"json:invalid-arguments": "{$count} arguments are invalid",
|
|
18
|
+
"json:next:help": "See the arguments of the command",
|
|
19
|
+
"json:next:help-placeholder": "Replace <COMMAND> with how you ran this CLI, to see the arguments of the command",
|
|
20
|
+
"err:arg:required-option": "Option {$displayName} is required",
|
|
16
21
|
"err:arg:required-positional": "Positional argument {$displayName} is required",
|
|
17
22
|
"err:arg:invalid-type": "Invalid value for {$displayName}: expected {$expected}",
|
|
18
23
|
"err:arg:invalid-choice": "Invalid value for {$displayName}: expected one of {$choices}",
|
|
19
24
|
"err:arg:custom-parse": "Invalid value for {$displayName}: {$reason}",
|
|
20
25
|
"err:arg:unknown-option": "Unknown option: {$rawName}",
|
|
21
|
-
"err:arg:unexpected-value": "
|
|
22
|
-
"err:arg:missing-value": "
|
|
26
|
+
"err:arg:unexpected-value": "Option {$displayName} does not take a value",
|
|
27
|
+
"err:arg:missing-value": "Option {$displayName} requires a value",
|
|
23
28
|
"err:arg:missing-value:hint": "(to pass '{$next}' as its value, write '{$suggestion}')",
|
|
24
29
|
"err:arg:conflict": "{$displayName} conflicts with {$conflictDisplayName}",
|
|
25
30
|
"err:arg:invalid-default": "Invalid default for {$displayName}: {$actual} is not one of {$choices}",
|
|
@@ -27,5 +32,8 @@
|
|
|
27
32
|
"err:cmd:ambiguous": "The command is ambiguous. Move options after the command name: {$candidatePaths}",
|
|
28
33
|
"err:cmd:inconsistent-options": "The options do not identify a consistent command. Move options after the command name.",
|
|
29
34
|
"err:cmd:lazy-schema-mismatch": "The lazy command definition does not match its loaded options. Declare leading options in the lazy definition or move options after the command name: {$commandPath}",
|
|
35
|
+
"err:json:not-supported": "This command does not support --json",
|
|
36
|
+
"err:json:invalid-result": "The command finished, but did not return an object to output as JSON. A plugin that decorates the command may have dropped its result",
|
|
37
|
+
"err:json:unserializable-result": "The command finished, but its result cannot be converted to JSON: {$message}",
|
|
30
38
|
"err:suggestion:did-you-mean": "Did you mean {$name}?"
|
|
31
39
|
}
|
package/locales/ja-JP.json
CHANGED
|
@@ -10,8 +10,13 @@
|
|
|
10
10
|
"NEGATABLE": "否定可能な",
|
|
11
11
|
"DEFAULT": "デフォルト",
|
|
12
12
|
"CHOICES": "選択肢",
|
|
13
|
+
"CAUSEDBY": "原因",
|
|
13
14
|
"help": "このヘルプメッセージを表示",
|
|
14
15
|
"version": "このバージョンを表示",
|
|
16
|
+
"json": "結果を JSON で出力する",
|
|
17
|
+
"json:invalid-arguments": "{$count} 個の引数が不正です",
|
|
18
|
+
"json:next:help": "コマンドの引数を確認する",
|
|
19
|
+
"json:next:help-placeholder": "<COMMAND> を、この CLI を実行したときのコマンドに置き換えて、コマンドの引数を確認する",
|
|
15
20
|
"err:arg:required-option": "オプション {$displayName} は必須です",
|
|
16
21
|
"err:arg:required-positional": "位置引数 {$displayName} は必須です",
|
|
17
22
|
"err:arg:invalid-type": "{$displayName} の値が不正です。期待される型: {$expected}",
|
|
@@ -27,5 +32,8 @@
|
|
|
27
32
|
"err:cmd:ambiguous": "コマンドを一意に解決できません。オプションをコマンド名の後ろに移してください: {$candidatePaths}",
|
|
28
33
|
"err:cmd:inconsistent-options": "オプションからコマンドを一意に解決できません。オプションをコマンド名の後ろに移してください。",
|
|
29
34
|
"err:cmd:lazy-schema-mismatch": "lazy コマンドの定義とロード後のオプションが一致しません。前置きするオプションを lazy の定義に記載するか、コマンド名の後ろに移してください: {$commandPath}",
|
|
35
|
+
"err:json:not-supported": "このコマンドは --json に対応していません",
|
|
36
|
+
"err:json:invalid-result": "コマンドは終了しましたが、JSON として出力するオブジェクトを返しませんでした。コマンドを包み込む plugin が結果を落とした可能性があります",
|
|
37
|
+
"err:json:unserializable-result": "コマンドは終了しましたが、結果を JSON に変換できません: {$message}",
|
|
30
38
|
"err:suggestion:did-you-mean": "{$name} の指定ミスではありませんか?"
|
|
31
39
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gunshi/resources",
|
|
3
3
|
"description": "built-in localization resources for gunshi",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.6",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "kazuya kawaguchi",
|
|
7
7
|
"email": "kawakazu80@gmail.com"
|
|
@@ -64,15 +64,10 @@
|
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/node": "^26.0.0",
|
|
67
|
-
"deno": "^2.7.14",
|
|
68
|
-
"jsr": "^0.14.3",
|
|
69
|
-
"jsr-exports-lint": "^0.4.2",
|
|
70
67
|
"publint": "^0.3.20",
|
|
71
68
|
"tsdown": "0.22.14"
|
|
72
69
|
},
|
|
73
70
|
"scripts": {
|
|
74
|
-
"build": "tsdown"
|
|
75
|
-
"lint:jsr": "jsr publish --dry-run --allow-dirty",
|
|
76
|
-
"typecheck:deno": "deno check --import-map=../../importmap.json ./src"
|
|
71
|
+
"build": "tsdown"
|
|
77
72
|
}
|
|
78
73
|
}
|