lism-cli 0.0.1 → 0.3.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/LICENSE +21 -0
- package/README.md +16 -16
- package/dist/chunk-5ULZ7QME.js +616 -0
- package/dist/index.js +91 -81
- package/dist/lib.d.ts +430 -1
- package/dist/lib.js +9 -3
- package/package.json +28 -10
- package/dist/chunk-4TQG5MGT.js +0 -137
|
@@ -0,0 +1,616 @@
|
|
|
1
|
+
// src/messages.ts
|
|
2
|
+
var messages = {
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// Commander description / arguments / options
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
"cli.description": {
|
|
7
|
+
ja: "Lism CSS / UI \u5411\u3051 CLI",
|
|
8
|
+
en: "CLI for Lism CSS / UI"
|
|
9
|
+
},
|
|
10
|
+
"cli.opt.lang": {
|
|
11
|
+
ja: "CLI \u306E\u8868\u793A\u8A00\u8A9E\u3092\u6307\u5B9A\uFF08ja | en\uFF09",
|
|
12
|
+
en: "Display language for the CLI (ja | en)"
|
|
13
|
+
},
|
|
14
|
+
// create
|
|
15
|
+
"cli.create.description": {
|
|
16
|
+
ja: "examples \u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304B\u3089\u65B0\u898F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u751F\u6210\u3059\u308B",
|
|
17
|
+
en: "Create a new project from an examples template"
|
|
18
|
+
},
|
|
19
|
+
"cli.create.arg.targetDir": {
|
|
20
|
+
ja: "\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA",
|
|
21
|
+
en: "Target directory"
|
|
22
|
+
},
|
|
23
|
+
"cli.create.opt.template": {
|
|
24
|
+
ja: "\u4F7F\u7528\u3059\u308B\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u540D\uFF08\u4F8B: astro-minimal\uFF09",
|
|
25
|
+
en: "Template name to use (e.g. astro-minimal)"
|
|
26
|
+
},
|
|
27
|
+
"cli.create.opt.force": {
|
|
28
|
+
ja: "\u65E2\u5B58\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u5F37\u5236\u4E0A\u66F8\u304D",
|
|
29
|
+
en: "Overwrite existing directory"
|
|
30
|
+
},
|
|
31
|
+
// ui
|
|
32
|
+
"cli.ui.description": {
|
|
33
|
+
ja: "Lism UI \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u8FFD\u52A0\u30FB\u7BA1\u7406",
|
|
34
|
+
en: "Manage Lism UI components"
|
|
35
|
+
},
|
|
36
|
+
"cli.ui.init.description": {
|
|
37
|
+
ja: "lism.config.js \u306E cli \u30BB\u30AF\u30B7\u30E7\u30F3\u3092\u751F\u6210\u3059\u308B",
|
|
38
|
+
en: "Generate the cli section of lism.config.js"
|
|
39
|
+
},
|
|
40
|
+
"cli.ui.init.opt.framework": {
|
|
41
|
+
ja: "\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF",
|
|
42
|
+
en: "Framework"
|
|
43
|
+
},
|
|
44
|
+
"cli.ui.init.opt.componentsDir": {
|
|
45
|
+
ja: "\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA",
|
|
46
|
+
en: "Output directory for components"
|
|
47
|
+
},
|
|
48
|
+
"cli.ui.init.opt.helperDir": {
|
|
49
|
+
ja: "helper \u306E\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA",
|
|
50
|
+
en: "Output directory for helpers"
|
|
51
|
+
},
|
|
52
|
+
"cli.ui.init.opt.force": {
|
|
53
|
+
ja: "\u65E2\u5B58\u306E cli \u30BB\u30AF\u30B7\u30E7\u30F3\u3092\u4E0A\u66F8\u304D",
|
|
54
|
+
en: "Overwrite the existing cli section"
|
|
55
|
+
},
|
|
56
|
+
"cli.ui.add.description": {
|
|
57
|
+
ja: "\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u8FFD\u52A0\u3059\u308B",
|
|
58
|
+
en: "Add components"
|
|
59
|
+
},
|
|
60
|
+
"cli.ui.add.arg.names": {
|
|
61
|
+
ja: "\u8FFD\u52A0\u3059\u308B\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u540D",
|
|
62
|
+
en: "Component names to add"
|
|
63
|
+
},
|
|
64
|
+
"cli.ui.add.opt.overwrite": {
|
|
65
|
+
ja: "\u65E2\u5B58\u30D5\u30A1\u30A4\u30EB\u3092\u78BA\u8A8D\u306A\u3057\u3067\u4E0A\u66F8\u304D",
|
|
66
|
+
en: "Overwrite existing files without confirmation"
|
|
67
|
+
},
|
|
68
|
+
"cli.ui.add.opt.all": {
|
|
69
|
+
ja: "\u5168\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u8FFD\u52A0",
|
|
70
|
+
en: "Add all components"
|
|
71
|
+
},
|
|
72
|
+
"cli.ui.list.description": {
|
|
73
|
+
ja: "\u5229\u7528\u53EF\u80FD\u306A\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u4E00\u89A7\u3092\u8868\u793A\u3059\u308B",
|
|
74
|
+
en: "List available components"
|
|
75
|
+
},
|
|
76
|
+
"cli.ui.opt.ref": {
|
|
77
|
+
ja: "\u53D6\u5F97\u5143\u306E Git ref\uFF08\u30D6\u30E9\u30F3\u30C1 / \u30BF\u30B0 / \u30B3\u30DF\u30C3\u30C8\uFF09",
|
|
78
|
+
en: "Git ref to fetch from (branch / tag / commit)"
|
|
79
|
+
},
|
|
80
|
+
// skill
|
|
81
|
+
"cli.skill.description": {
|
|
82
|
+
ja: "AI \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u5411\u3051\u30B9\u30AD\u30EB\uFF08SKILL.md\uFF09\u306E\u914D\u7F6E\u3068\u7BA1\u7406",
|
|
83
|
+
en: "Manage SKILL.md files for AI agents"
|
|
84
|
+
},
|
|
85
|
+
"cli.skill.add.description": {
|
|
86
|
+
ja: "\u30B9\u30AD\u30EB\u3092\u914D\u7F6E\u3059\u308B",
|
|
87
|
+
en: "Deploy skills"
|
|
88
|
+
},
|
|
89
|
+
"cli.skill.add.opt.overwrite": {
|
|
90
|
+
ja: "\u78BA\u8A8D\u306A\u3057\u3067\u4E0A\u66F8\u304D",
|
|
91
|
+
en: "Overwrite without confirmation"
|
|
92
|
+
},
|
|
93
|
+
"cli.skill.check.description": {
|
|
94
|
+
ja: "\u914D\u7F6E\u6E08\u307F\u30B9\u30AD\u30EB\u3068\u30EA\u30E2\u30FC\u30C8\u306E\u5DEE\u5206\u3092\u78BA\u8A8D\u3059\u308B",
|
|
95
|
+
en: "Show the diff between installed skills and the remote"
|
|
96
|
+
},
|
|
97
|
+
"cli.skill.check.opt.verbose": {
|
|
98
|
+
ja: "\u30D5\u30A1\u30A4\u30EB\u5358\u4F4D\u306E\u5DEE\u5206\u3092\u8868\u793A",
|
|
99
|
+
en: "Show per-file diffs"
|
|
100
|
+
},
|
|
101
|
+
"cli.skill.update.description": {
|
|
102
|
+
ja: "\u914D\u7F6E\u6E08\u307F\u30B9\u30AD\u30EB\u3092\u6700\u65B0\u7248\u3067\u4E0A\u66F8\u304D\u3059\u308B\uFF08--overwrite \u540C\u7B49\uFF09",
|
|
103
|
+
en: "Overwrite installed skills with the latest version (same as --overwrite)"
|
|
104
|
+
},
|
|
105
|
+
"cli.skill.opt.ref": {
|
|
106
|
+
ja: "GitHub \u306E\u53D6\u5F97\u5143 ref\uFF08\u30D6\u30E9\u30F3\u30C1\uFF0F\u30BF\u30B0\uFF0F\u30B3\u30DF\u30C3\u30C8\uFF09",
|
|
107
|
+
en: "Git ref to fetch from on GitHub (branch / tag / commit)"
|
|
108
|
+
},
|
|
109
|
+
"cli.skill.opt.all": {
|
|
110
|
+
ja: "\u5168\u30C4\u30FC\u30EB\u306B\u914D\u7F6E",
|
|
111
|
+
en: "Deploy to all tools"
|
|
112
|
+
},
|
|
113
|
+
"cli.skill.opt.toolPath": {
|
|
114
|
+
ja: "{path} \u306B\u914D\u7F6E",
|
|
115
|
+
en: "Deploy to {path}"
|
|
116
|
+
},
|
|
117
|
+
// ---------------------------------------------------------------------------
|
|
118
|
+
// create
|
|
119
|
+
// ---------------------------------------------------------------------------
|
|
120
|
+
"create.templateNotFound": {
|
|
121
|
+
ja: '\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 "{name}" \u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u5229\u7528\u53EF\u80FD: {list}',
|
|
122
|
+
en: 'Template "{name}" not found. Available: {list}'
|
|
123
|
+
},
|
|
124
|
+
"create.promptSelectTemplate": {
|
|
125
|
+
ja: "\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044:",
|
|
126
|
+
en: "Select a template:"
|
|
127
|
+
},
|
|
128
|
+
"create.promptTargetDir": {
|
|
129
|
+
ja: "\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA:",
|
|
130
|
+
en: "Target directory:"
|
|
131
|
+
},
|
|
132
|
+
"create.confirmOverwrite": {
|
|
133
|
+
ja: "{dir} \u306F\u65E2\u306B\u5B58\u5728\u3057\u3001\u7A7A\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B\uFF1F",
|
|
134
|
+
en: "{dir} already exists and is not empty. Overwrite?"
|
|
135
|
+
},
|
|
136
|
+
"create.aborted": {
|
|
137
|
+
ja: "\u4E2D\u65AD\u3057\u307E\u3057\u305F\u3002",
|
|
138
|
+
en: "Aborted."
|
|
139
|
+
},
|
|
140
|
+
"create.fetching": {
|
|
141
|
+
ja: '\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 "{name}" \u3092\u53D6\u5F97\u4E2D\uFF08ref: {ref}\uFF09...',
|
|
142
|
+
en: 'Fetching template "{name}" (ref: {ref})...'
|
|
143
|
+
},
|
|
144
|
+
"create.created": {
|
|
145
|
+
ja: "{dir} \u306B\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u751F\u6210\u3057\u307E\u3057\u305F\u3002",
|
|
146
|
+
en: "Generated project at {dir}."
|
|
147
|
+
},
|
|
148
|
+
"create.nextSteps": {
|
|
149
|
+
ja: "\u6B21\u306E\u30B3\u30DE\u30F3\u30C9\u3067\u958B\u767A\u3092\u958B\u59CB\u3067\u304D\u307E\u3059:",
|
|
150
|
+
en: "Next steps:"
|
|
151
|
+
},
|
|
152
|
+
"create.workspaceReplaced": {
|
|
153
|
+
ja: " package.json \u306E workspace:* \u3092 ^{version} \u306B\u7F6E\u63DB\u3057\u307E\u3057\u305F\u3002",
|
|
154
|
+
en: " Replaced workspace:* in package.json with ^{version}."
|
|
155
|
+
},
|
|
156
|
+
"create.workspaceFailed": {
|
|
157
|
+
ja: "package.json \u306E\u66F8\u304D\u63DB\u3048\u306B\u5931\u6557\u3057\u307E\u3057\u305F: {reason}",
|
|
158
|
+
en: "Failed to rewrite package.json: {reason}"
|
|
159
|
+
},
|
|
160
|
+
// ---------------------------------------------------------------------------
|
|
161
|
+
// ui
|
|
162
|
+
// ---------------------------------------------------------------------------
|
|
163
|
+
// ui 共通(add / list で共有)
|
|
164
|
+
"ui.catalogFailed": {
|
|
165
|
+
ja: "\u30AB\u30BF\u30ED\u30B0\u306E\u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F{refInfo}: {reason}",
|
|
166
|
+
en: "Failed to fetch catalog{refInfo}: {reason}"
|
|
167
|
+
},
|
|
168
|
+
// ui add
|
|
169
|
+
"ui.add.noConfig": {
|
|
170
|
+
ja: "lism.config.js \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u958B\u59CB\u3057\u307E\u3059...\n",
|
|
171
|
+
en: "lism.config.js not found. Starting setup...\n"
|
|
172
|
+
},
|
|
173
|
+
"ui.add.addingAll": {
|
|
174
|
+
ja: "\u5168 {count} \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u8FFD\u52A0\u3057\u307E\u3059...",
|
|
175
|
+
en: "Adding all {count} components..."
|
|
176
|
+
},
|
|
177
|
+
"ui.add.specifyName": {
|
|
178
|
+
ja: "\u8FFD\u52A0\u3059\u308B\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u540D\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
179
|
+
en: "Specify component names to add."
|
|
180
|
+
},
|
|
181
|
+
"ui.add.notFound": {
|
|
182
|
+
ja: "\u898B\u3064\u304B\u3089\u306A\u3044\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8: {list}",
|
|
183
|
+
en: "Components not found: {list}"
|
|
184
|
+
},
|
|
185
|
+
"ui.add.componentFetchFailed": {
|
|
186
|
+
ja: '"{name}" \u306E\u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F: {reason}',
|
|
187
|
+
en: 'Failed to fetch "{name}": {reason}'
|
|
188
|
+
},
|
|
189
|
+
"ui.add.someFailed": {
|
|
190
|
+
ja: "\u4E00\u90E8\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8 / helper \u306E\u8FFD\u52A0\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002",
|
|
191
|
+
en: "Some components / helpers failed to be added."
|
|
192
|
+
},
|
|
193
|
+
"ui.add.promptOverwritePolicy": {
|
|
194
|
+
ja: "\u65E2\u5B58\u30D5\u30A1\u30A4\u30EB\u306E\u4E0A\u66F8\u304D\u65B9\u91DD\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044:",
|
|
195
|
+
en: "Select overwrite policy for existing files:"
|
|
196
|
+
},
|
|
197
|
+
"ui.add.policyAll": {
|
|
198
|
+
ja: "\u5168\u3066\u4E0A\u66F8\u304D",
|
|
199
|
+
en: "Overwrite all"
|
|
200
|
+
},
|
|
201
|
+
"ui.add.policyNone": {
|
|
202
|
+
ja: "\u5168\u3066\u30B9\u30AD\u30C3\u30D7",
|
|
203
|
+
en: "Skip all"
|
|
204
|
+
},
|
|
205
|
+
"ui.add.policyPerComponent": {
|
|
206
|
+
ja: "\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3054\u3068\u306B\u78BA\u8A8D",
|
|
207
|
+
en: "Ask per component"
|
|
208
|
+
},
|
|
209
|
+
"ui.add.created": {
|
|
210
|
+
ja: " \u4F5C\u6210: {path}",
|
|
211
|
+
en: " Created: {path}"
|
|
212
|
+
},
|
|
213
|
+
"ui.add.deploying": {
|
|
214
|
+
ja: "{name} \u3092\u5C55\u958B\u4E2D...",
|
|
215
|
+
en: "Deploying {name}..."
|
|
216
|
+
},
|
|
217
|
+
"ui.add.confirmOverwriteComponent": {
|
|
218
|
+
ja: "{name} \u306F\u65E2\u306B\u5B58\u5728\u3057\u307E\u3059\u3002\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B\uFF1F",
|
|
219
|
+
en: "{name} already exists. Overwrite?"
|
|
220
|
+
},
|
|
221
|
+
"ui.add.skippedComponent": {
|
|
222
|
+
ja: " \u30B9\u30AD\u30C3\u30D7: {name}",
|
|
223
|
+
en: " Skipped: {name}"
|
|
224
|
+
},
|
|
225
|
+
"ui.add.helperFetchFailed": {
|
|
226
|
+
ja: ' helper "{name}" \u306E\u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F: {reason}',
|
|
227
|
+
en: ' Failed to fetch helper "{name}": {reason}'
|
|
228
|
+
},
|
|
229
|
+
"ui.add.confirmOverwriteFile": {
|
|
230
|
+
ja: "{path} \u306F\u65E2\u306B\u5B58\u5728\u3057\u307E\u3059\u3002\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B\uFF1F",
|
|
231
|
+
en: "{path} already exists. Overwrite?"
|
|
232
|
+
},
|
|
233
|
+
"ui.add.skippedFile": {
|
|
234
|
+
ja: " \u30B9\u30AD\u30C3\u30D7: {path}",
|
|
235
|
+
en: " Skipped: {path}"
|
|
236
|
+
},
|
|
237
|
+
// ui init
|
|
238
|
+
"ui.init.promptFramework": {
|
|
239
|
+
ja: "\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044:",
|
|
240
|
+
en: "Select a framework:"
|
|
241
|
+
},
|
|
242
|
+
"ui.init.promptComponentsDir": {
|
|
243
|
+
ja: "\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA:",
|
|
244
|
+
en: "Output directory for components:"
|
|
245
|
+
},
|
|
246
|
+
"ui.init.promptHelperDir": {
|
|
247
|
+
ja: "helper \u306E\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA:",
|
|
248
|
+
en: "Output directory for helpers:"
|
|
249
|
+
},
|
|
250
|
+
"ui.init.patchedUpdate": {
|
|
251
|
+
ja: "{path} \u306B cli \u30BB\u30AF\u30B7\u30E7\u30F3\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F\u3002",
|
|
252
|
+
en: "Updated the cli section in {path}."
|
|
253
|
+
},
|
|
254
|
+
"ui.init.patchedAdd": {
|
|
255
|
+
ja: "{path} \u306B cli \u30BB\u30AF\u30B7\u30E7\u30F3\u3092\u8FFD\u8A18\u3057\u307E\u3057\u305F\u3002",
|
|
256
|
+
en: "Added the cli section to {path}."
|
|
257
|
+
},
|
|
258
|
+
"ui.init.notPatched": {
|
|
259
|
+
ja: "{path} \u306B\u65E2\u306B cli \u30BB\u30AF\u30B7\u30E7\u30F3\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u304B\u3001export default \u304C\u691C\u51FA\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u624B\u52D5\u3067\u8FFD\u8A18\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
260
|
+
en: "Either {path} already contains a cli section or no export default was detected. Please add it manually."
|
|
261
|
+
},
|
|
262
|
+
"ui.init.created": {
|
|
263
|
+
ja: "{path} \u3092\u4F5C\u6210\u3057\u307E\u3057\u305F\u3002",
|
|
264
|
+
en: "Created {path}."
|
|
265
|
+
},
|
|
266
|
+
"ui.init.legacyDetected": {
|
|
267
|
+
ja: "{filename} \u3092\u691C\u51FA\u3057\u307E\u3057\u305F\u3002lism.config.js \u3078\u79FB\u884C\u3057\u307E\u3059\u3002\u53E4\u3044\u30D5\u30A1\u30A4\u30EB\u306F\u5F8C\u3067\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
268
|
+
en: "Detected {filename}. Migrating to lism.config.js. Please remove the old file afterwards."
|
|
269
|
+
},
|
|
270
|
+
"ui.init.alreadyExists": {
|
|
271
|
+
ja: "{filename} \u306B\u306F\u65E2\u306B cli \u30BB\u30AF\u30B7\u30E7\u30F3\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u4E0A\u66F8\u304D\u3059\u308B\u306B\u306F --force \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
272
|
+
en: "{filename} already has a cli section. Use --force to overwrite."
|
|
273
|
+
},
|
|
274
|
+
"ui.init.willOverwrite": {
|
|
275
|
+
ja: "{filename} \u306E\u65E2\u5B58\u306E cli \u30BB\u30AF\u30B7\u30E7\u30F3\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059\u3002",
|
|
276
|
+
en: "Overwriting the existing cli section in {filename}."
|
|
277
|
+
},
|
|
278
|
+
// ui list
|
|
279
|
+
"ui.list.fetching": {
|
|
280
|
+
ja: "\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u4E2D...",
|
|
281
|
+
en: "Fetching components list..."
|
|
282
|
+
},
|
|
283
|
+
"ui.list.header": {
|
|
284
|
+
ja: "\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8:",
|
|
285
|
+
en: "Components:"
|
|
286
|
+
},
|
|
287
|
+
"ui.list.total": {
|
|
288
|
+
ja: "\u5408\u8A08: {count} \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8",
|
|
289
|
+
en: "Total: {count} components"
|
|
290
|
+
},
|
|
291
|
+
// ---------------------------------------------------------------------------
|
|
292
|
+
// skill
|
|
293
|
+
// ---------------------------------------------------------------------------
|
|
294
|
+
// skill add
|
|
295
|
+
"skill.add.detected": {
|
|
296
|
+
ja: "\u691C\u51FA\u3057\u305F AI \u30C4\u30FC\u30EB: {list}",
|
|
297
|
+
en: "Detected AI tools: {list}"
|
|
298
|
+
},
|
|
299
|
+
"skill.add.promptTools": {
|
|
300
|
+
ja: "\u914D\u7F6E\u5148\u306E\u30C4\u30FC\u30EB\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u30B9\u30DA\u30FC\u30B9\u3067\u9078\u629E\u3001Enter \u3067\u78BA\u5B9A\uFF09:",
|
|
301
|
+
en: "Select target tools (Space to select, Enter to confirm):"
|
|
302
|
+
},
|
|
303
|
+
"skill.add.noTargets": {
|
|
304
|
+
ja: "\u914D\u7F6E\u5148\u304C\u9078\u629E\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",
|
|
305
|
+
en: "No target tools were selected."
|
|
306
|
+
},
|
|
307
|
+
"skill.add.fetching": {
|
|
308
|
+
ja: "\u30B9\u30AD\u30EB\u3092\u53D6\u5F97\u4E2D\uFF08ref: {ref}\uFF09...",
|
|
309
|
+
en: "Fetching skills (ref: {ref})..."
|
|
310
|
+
},
|
|
311
|
+
"skill.add.skippedSame": {
|
|
312
|
+
ja: " \u30B9\u30AD\u30C3\u30D7\uFF08\u5DEE\u5206\u306A\u3057\uFF09: {label}",
|
|
313
|
+
en: " Skipped (no changes): {label}"
|
|
314
|
+
},
|
|
315
|
+
"skill.add.hasDiff": {
|
|
316
|
+
ja: " {label} \u306B\u5DEE\u5206\u304C\u3042\u308A\u307E\u3059:",
|
|
317
|
+
en: " {label} has changes:"
|
|
318
|
+
},
|
|
319
|
+
"skill.add.modifiedFiles": {
|
|
320
|
+
ja: " \u5909\u66F4: {count} \u30D5\u30A1\u30A4\u30EB",
|
|
321
|
+
en: " Modified: {count} files"
|
|
322
|
+
},
|
|
323
|
+
"skill.add.addedFiles": {
|
|
324
|
+
ja: " \u8FFD\u52A0: {count} \u30D5\u30A1\u30A4\u30EB",
|
|
325
|
+
en: " Added: {count} files"
|
|
326
|
+
},
|
|
327
|
+
"skill.add.localOnlyFiles": {
|
|
328
|
+
ja: " \u524A\u9664: {count} \u30D5\u30A1\u30A4\u30EB\uFF08\u30ED\u30FC\u30AB\u30EB\u306E\u307F\u306B\u5B58\u5728\u3001\u4E0A\u66F8\u304D\u6642\u306B\u524A\u9664\u3055\u308C\u307E\u3059\uFF09",
|
|
329
|
+
en: " Deleted: {count} files (local-only, will be removed on overwrite)"
|
|
330
|
+
},
|
|
331
|
+
"skill.add.confirmOverwrite": {
|
|
332
|
+
ja: "{path} \u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B\uFF1F",
|
|
333
|
+
en: "Overwrite {path}?"
|
|
334
|
+
},
|
|
335
|
+
"skill.add.skippedTool": {
|
|
336
|
+
ja: " \u30B9\u30AD\u30C3\u30D7: {tool}",
|
|
337
|
+
en: " Skipped: {tool}"
|
|
338
|
+
},
|
|
339
|
+
"skill.add.deployed": {
|
|
340
|
+
ja: " \u914D\u7F6E: {tool} \u2192 {path}",
|
|
341
|
+
en: " Deployed: {tool} \u2192 {path}"
|
|
342
|
+
},
|
|
343
|
+
// skill check
|
|
344
|
+
"skill.check.noneInstalled": {
|
|
345
|
+
ja: "\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u6E08\u307F\u306E\u30B9\u30AD\u30EB\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002`lism skill add` \u3067\u914D\u7F6E\u3067\u304D\u307E\u3059\u3002",
|
|
346
|
+
en: "No installed skills found. Run `lism skill add` to deploy them."
|
|
347
|
+
},
|
|
348
|
+
"skill.check.fetching": {
|
|
349
|
+
ja: "\u30EA\u30E2\u30FC\u30C8\u30B9\u30AD\u30EB\u3092\u53D6\u5F97\u4E2D\uFF08ref: {ref}\uFF09...",
|
|
350
|
+
en: "Fetching remote skills (ref: {ref})..."
|
|
351
|
+
},
|
|
352
|
+
"skill.check.upToDate": {
|
|
353
|
+
ja: " \u2713 {label} (\u6700\u65B0)",
|
|
354
|
+
en: " \u2713 {label} (up to date)"
|
|
355
|
+
},
|
|
356
|
+
"skill.check.allLatest": {
|
|
357
|
+
ja: "\u3059\u3079\u3066\u306E\u30B9\u30AD\u30EB\u304C\u6700\u65B0\u3067\u3059\u3002",
|
|
358
|
+
en: "All skills are up to date."
|
|
359
|
+
},
|
|
360
|
+
"skill.check.outdated": {
|
|
361
|
+
ja: "{count} \u4EF6\u306E\u30C4\u30FC\u30EB\u306B\u5DEE\u5206\u304C\u3042\u308A\u307E\u3059\u3002`lism skill update` \u3067\u6700\u65B0\u306B\u66F4\u65B0\u3067\u304D\u307E\u3059\u3002",
|
|
362
|
+
en: "{count} tools have changes. Run `lism skill update` to update them."
|
|
363
|
+
},
|
|
364
|
+
"skill.check.diffModified": {
|
|
365
|
+
ja: "\u5909\u66F4 {count}",
|
|
366
|
+
en: "modified {count}"
|
|
367
|
+
},
|
|
368
|
+
"skill.check.diffAdded": {
|
|
369
|
+
ja: "\u8FFD\u52A0 {count}",
|
|
370
|
+
en: "added {count}"
|
|
371
|
+
},
|
|
372
|
+
"skill.check.diffDeleted": {
|
|
373
|
+
ja: "\u524A\u9664 {count}",
|
|
374
|
+
en: "deleted {count}"
|
|
375
|
+
},
|
|
376
|
+
// ---------------------------------------------------------------------------
|
|
377
|
+
// config
|
|
378
|
+
// ---------------------------------------------------------------------------
|
|
379
|
+
"config.legacyWarning": {
|
|
380
|
+
ja: '[deprecated] {filename} \u306F\u5EC3\u6B62\u4E88\u5B9A\u3067\u3059\u3002"lism ui init" \u3067 lism.config.js \u3078\u79FB\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002',
|
|
381
|
+
en: '[deprecated] {filename} is deprecated. Run "lism ui init" to migrate to lism.config.js.'
|
|
382
|
+
},
|
|
383
|
+
"config.notFound": {
|
|
384
|
+
ja: "lism.config.js / lism.config.mjs / lism-ui.json \u306E\u3044\u305A\u308C\u3082\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002",
|
|
385
|
+
en: "None of lism.config.js / lism.config.mjs / lism-ui.json were found."
|
|
386
|
+
},
|
|
387
|
+
"config.cliSectionMissing": {
|
|
388
|
+
ja: "{filename} \u304B\u3089 CLI \u8A2D\u5B9A\uFF08cli \u30AD\u30FC\uFF09\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\u3002",
|
|
389
|
+
en: "Failed to read the CLI config (cli key) from {filename}."
|
|
390
|
+
},
|
|
391
|
+
"config.invalidFramework": {
|
|
392
|
+
ja: 'cli.framework \u306F "react" \u307E\u305F\u306F "astro" \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002',
|
|
393
|
+
en: 'cli.framework must be "react" or "astro".'
|
|
394
|
+
},
|
|
395
|
+
"config.invalidComponentsDir": {
|
|
396
|
+
ja: "cli.componentsDir \u306F\u6587\u5B57\u5217\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
397
|
+
en: "cli.componentsDir must be a string."
|
|
398
|
+
},
|
|
399
|
+
"config.invalidHelperDir": {
|
|
400
|
+
ja: "cli.helperDir \u306F\u6587\u5B57\u5217\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
401
|
+
en: "cli.helperDir must be a string."
|
|
402
|
+
},
|
|
403
|
+
"config.loadFailed": {
|
|
404
|
+
ja: "{path} \u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u69CB\u6587\u30A8\u30E9\u30FC\u7B49\uFF09\u3002\u4FEE\u6B63\u3057\u3066\u304B\u3089\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044: {reason}",
|
|
405
|
+
en: "Failed to load {path} (syntax error, etc). Please fix it and retry: {reason}"
|
|
406
|
+
},
|
|
407
|
+
// ---------------------------------------------------------------------------
|
|
408
|
+
// common
|
|
409
|
+
// ---------------------------------------------------------------------------
|
|
410
|
+
"common.done": {
|
|
411
|
+
ja: "\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002",
|
|
412
|
+
en: "Done."
|
|
413
|
+
},
|
|
414
|
+
"common.help": {
|
|
415
|
+
ja: "\u30D8\u30EB\u30D7\u3092\u8868\u793A",
|
|
416
|
+
en: "Show help"
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
// src/i18n.ts
|
|
421
|
+
function detectLang(override) {
|
|
422
|
+
if (override === "ja" || override === "en") return override;
|
|
423
|
+
const raw = (process.env.LC_ALL || process.env.LANG || "").toLowerCase();
|
|
424
|
+
if (raw.startsWith("ja")) return "ja";
|
|
425
|
+
try {
|
|
426
|
+
const locale = Intl.DateTimeFormat().resolvedOptions().locale.toLowerCase();
|
|
427
|
+
if (locale.startsWith("ja")) return "ja";
|
|
428
|
+
} catch {
|
|
429
|
+
}
|
|
430
|
+
return "en";
|
|
431
|
+
}
|
|
432
|
+
var currentLang = detectLang();
|
|
433
|
+
function setLang(lang) {
|
|
434
|
+
if (lang === "ja" || lang === "en") {
|
|
435
|
+
currentLang = lang;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
function preScanLang(argv) {
|
|
439
|
+
for (let i = 0; i < argv.length; i++) {
|
|
440
|
+
const a = argv[i];
|
|
441
|
+
if (a === "--lang") {
|
|
442
|
+
const next = argv[i + 1];
|
|
443
|
+
if (next !== void 0 && !next.startsWith("-")) {
|
|
444
|
+
setLang(next);
|
|
445
|
+
}
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
if (a.startsWith("--lang=")) {
|
|
449
|
+
setLang(a.slice("--lang=".length));
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
function t(key, vars) {
|
|
455
|
+
const entry = messages[key];
|
|
456
|
+
if (!entry) return key;
|
|
457
|
+
const template = entry[currentLang] ?? entry.en;
|
|
458
|
+
return vars ? interpolate(template, vars) : template;
|
|
459
|
+
}
|
|
460
|
+
function tOf(pair) {
|
|
461
|
+
return pair[currentLang];
|
|
462
|
+
}
|
|
463
|
+
function interpolate(template, vars) {
|
|
464
|
+
return template.replace(/\{(\w+)\}/g, (_, name) => {
|
|
465
|
+
const v = vars[name];
|
|
466
|
+
return v === void 0 ? `{${name}}` : String(v);
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// src/commands/create.ts
|
|
471
|
+
import fs from "fs";
|
|
472
|
+
import path from "path";
|
|
473
|
+
import { downloadTemplate } from "giget";
|
|
474
|
+
import { select, input, confirm } from "@inquirer/prompts";
|
|
475
|
+
|
|
476
|
+
// src/logger.ts
|
|
477
|
+
import pc from "picocolors";
|
|
478
|
+
var logger = {
|
|
479
|
+
info(msg) {
|
|
480
|
+
console.log(pc.cyan(msg));
|
|
481
|
+
},
|
|
482
|
+
success(msg) {
|
|
483
|
+
console.log(pc.green(msg));
|
|
484
|
+
},
|
|
485
|
+
warn(msg) {
|
|
486
|
+
console.log(pc.yellow(`WARN: ${msg}`));
|
|
487
|
+
},
|
|
488
|
+
error(msg) {
|
|
489
|
+
console.error(pc.red(`ERROR: ${msg}`));
|
|
490
|
+
},
|
|
491
|
+
log(msg) {
|
|
492
|
+
console.log(msg);
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
// src/version.ts
|
|
497
|
+
var LISM_CSS_VERSION = "0.14.0" ? "0.14.0" : "unknown";
|
|
498
|
+
var CLI_VERSION = "0.3.0" ? "0.3.0" : "unknown";
|
|
499
|
+
|
|
500
|
+
// src/constants.ts
|
|
501
|
+
var SOURCE_REPO = "lism-css/lism-css";
|
|
502
|
+
var RAW_GITHUB_BASE = "https://raw.githubusercontent.com";
|
|
503
|
+
var DEFAULT_UI_REF = "main";
|
|
504
|
+
var DEFAULT_SKILL_REF = "main";
|
|
505
|
+
var DEFAULT_TEMPLATES_REF = "main";
|
|
506
|
+
var UI_COMPONENTS_PATH = "packages/lism-ui/src/components";
|
|
507
|
+
var UI_HELPER_PATH = "packages/lism-ui/src/helper";
|
|
508
|
+
var UI_REGISTRY_INDEX_PATH = "packages/lism-ui/registry-index.json";
|
|
509
|
+
var SKILL_SOURCE_PATH = "skills/lism-css-guide";
|
|
510
|
+
var EXAMPLES_PATH = "examples";
|
|
511
|
+
|
|
512
|
+
// src/commands/create.ts
|
|
513
|
+
var TEMPLATES = [
|
|
514
|
+
{
|
|
515
|
+
name: "astro-minimal",
|
|
516
|
+
label: { ja: "Astro (\u6700\u5C0F\u69CB\u6210)", en: "Astro (minimal)" },
|
|
517
|
+
description: { ja: "Astro \u30D9\u30FC\u30B9\u306E\u6700\u5C0F\u69CB\u6210", en: "Minimal Astro setup" }
|
|
518
|
+
}
|
|
519
|
+
];
|
|
520
|
+
async function runCreate({ template, targetDir, force = false }) {
|
|
521
|
+
const tpl = await resolveTemplate(template);
|
|
522
|
+
const outDir = path.resolve(process.cwd(), await resolveTargetDir(targetDir, tpl.name));
|
|
523
|
+
if (fs.existsSync(outDir) && fs.readdirSync(outDir).length > 0 && !force) {
|
|
524
|
+
const ok = await confirm({
|
|
525
|
+
message: t("create.confirmOverwrite", { dir: outDir }),
|
|
526
|
+
default: false
|
|
527
|
+
});
|
|
528
|
+
if (!ok) {
|
|
529
|
+
logger.warn(t("create.aborted"));
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
const ref = DEFAULT_TEMPLATES_REF;
|
|
534
|
+
logger.info(t("create.fetching", { name: tpl.name, ref }));
|
|
535
|
+
await downloadTemplate(`github:${SOURCE_REPO}/${EXAMPLES_PATH}/${tpl.name}#${ref}`, {
|
|
536
|
+
dir: outDir,
|
|
537
|
+
force: true,
|
|
538
|
+
forceClean: force
|
|
539
|
+
});
|
|
540
|
+
rewriteWorkspaceDeps(outDir);
|
|
541
|
+
logger.success(t("create.created", { dir: outDir }));
|
|
542
|
+
logger.log("");
|
|
543
|
+
logger.log(t("create.nextSteps"));
|
|
544
|
+
const rel = path.relative(process.cwd(), outDir) || ".";
|
|
545
|
+
logger.log(` cd ${rel}`);
|
|
546
|
+
logger.log(" npm install # or pnpm install / yarn");
|
|
547
|
+
logger.log(" npm run dev");
|
|
548
|
+
}
|
|
549
|
+
async function createCommand(targetDir, options) {
|
|
550
|
+
await runCreate({ template: options.template, targetDir, force: options.force });
|
|
551
|
+
}
|
|
552
|
+
async function resolveTemplate(requested) {
|
|
553
|
+
if (requested) {
|
|
554
|
+
const found = TEMPLATES.find((t2) => t2.name === requested);
|
|
555
|
+
if (!found) {
|
|
556
|
+
throw new Error(t("create.templateNotFound", { name: requested, list: TEMPLATES.map((x) => x.name).join(", ") }));
|
|
557
|
+
}
|
|
558
|
+
return found;
|
|
559
|
+
}
|
|
560
|
+
const picked = await select({
|
|
561
|
+
message: t("create.promptSelectTemplate"),
|
|
562
|
+
choices: TEMPLATES.map((tpl) => ({ name: `${tOf(tpl.label)} \u2014 ${tOf(tpl.description)}`, value: tpl.name }))
|
|
563
|
+
});
|
|
564
|
+
return TEMPLATES.find((x) => x.name === picked);
|
|
565
|
+
}
|
|
566
|
+
async function resolveTargetDir(provided, templateName) {
|
|
567
|
+
if (provided) return provided;
|
|
568
|
+
return input({
|
|
569
|
+
message: t("create.promptTargetDir"),
|
|
570
|
+
default: `./${templateName}`
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
function rewriteWorkspaceDeps(projectDir) {
|
|
574
|
+
const pkgPath = path.join(projectDir, "package.json");
|
|
575
|
+
if (!fs.existsSync(pkgPath)) return;
|
|
576
|
+
try {
|
|
577
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
578
|
+
let touched = false;
|
|
579
|
+
for (const key of ["dependencies", "devDependencies", "peerDependencies"]) {
|
|
580
|
+
const deps = pkg[key];
|
|
581
|
+
if (!deps) continue;
|
|
582
|
+
for (const [name, value] of Object.entries(deps)) {
|
|
583
|
+
if (typeof value !== "string") continue;
|
|
584
|
+
if (value.startsWith("workspace:")) {
|
|
585
|
+
deps[name] = `^${LISM_CSS_VERSION}`;
|
|
586
|
+
touched = true;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
if (touched) {
|
|
591
|
+
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
592
|
+
logger.log(t("create.workspaceReplaced", { version: LISM_CSS_VERSION }));
|
|
593
|
+
}
|
|
594
|
+
} catch (err) {
|
|
595
|
+
logger.warn(t("create.workspaceFailed", { reason: String(err) }));
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
export {
|
|
600
|
+
logger,
|
|
601
|
+
setLang,
|
|
602
|
+
preScanLang,
|
|
603
|
+
t,
|
|
604
|
+
tOf,
|
|
605
|
+
SOURCE_REPO,
|
|
606
|
+
RAW_GITHUB_BASE,
|
|
607
|
+
DEFAULT_UI_REF,
|
|
608
|
+
DEFAULT_SKILL_REF,
|
|
609
|
+
UI_COMPONENTS_PATH,
|
|
610
|
+
UI_HELPER_PATH,
|
|
611
|
+
UI_REGISTRY_INDEX_PATH,
|
|
612
|
+
SKILL_SOURCE_PATH,
|
|
613
|
+
CLI_VERSION,
|
|
614
|
+
runCreate,
|
|
615
|
+
createCommand
|
|
616
|
+
};
|