create-mendix-widget-gleam 2.0.18 → 2.0.21
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 +1 -1
- package/package.json +1 -1
- package/src/i18n.mjs +394 -334
- package/src/index.mjs +284 -231
- package/src/licenses.mjs +147 -0
- package/src/prompts.mjs +247 -142
- package/src/scaffold.mjs +108 -97
- package/src/templates/claude_md.mjs +3 -3
- package/src/templates/readme_md.mjs +10 -10
- package/template/gleam.toml +2 -2
- package/template/package.json +6 -6
- package/template/src/__WidgetName__.xml +1 -1
- package/template/src/package.xml +2 -2
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@command.cache +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@cursor.cache +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@cursor.cache_meta +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@event.cache +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@internal@consts.cache +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@stdout.cache +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@style.cache +0 -0
- package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@terminal.cache +0 -0
- package/tui/build/dev/javascript/etch/etch/event.mjs +36 -30
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@application.cache +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@atom.cache +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@charlist.cache +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@node.cache +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@port.cache +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@process.cache +0 -0
- package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@reference.cache +0 -0
- package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@array.cache +0 -0
- package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@promise.cache +0 -0
- package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@symbol.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_inline +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache +0 -0
- package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache +0 -0
- package/tui/build/dev/javascript/gleam_version +1 -1
- package/tui/build/dev/javascript/prelude.mjs +10 -26
- package/tui/build/dev/javascript/tui/_gleam_artefacts/tui.cache +0 -0
- package/tui/build/dev/javascript/tui/_gleam_artefacts/tui.cache_meta +0 -0
- package/tui/build/dev/javascript/tui/_gleam_artefacts/tui@prompt.cache +0 -0
- package/tui/build/dev/javascript/tui/_gleam_artefacts/tui@prompt.cache_meta +0 -0
- package/tui/build/dev/javascript/tui/tui/prompt.mjs +713 -52
- package/tui/build/dev/javascript/tui/tui.mjs +438 -51
- package/tui/build/dev/javascript/tui/tui_ffi.mjs +12 -0
- package/template/LICENSE +0 -15
package/src/i18n.mjs
CHANGED
|
@@ -1,334 +1,394 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* i18n — CLI UI strings + template comment translations
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export const LANG_CHOICES = ["en", "ko", "ja"];
|
|
6
|
-
|
|
7
|
-
const LANG_LABELS = {
|
|
8
|
-
en: "English",
|
|
9
|
-
ko: "한국어",
|
|
10
|
-
ja: "日本語",
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export function getLangLabel(lang) {
|
|
14
|
-
return LANG_LABELS[lang] ?? LANG_LABELS["en"];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// ---------------------------------------------------------------------------
|
|
18
|
-
// CLI UI messages
|
|
19
|
-
// ---------------------------------------------------------------------------
|
|
20
|
-
|
|
21
|
-
const messages = {
|
|
22
|
-
en: {
|
|
23
|
-
// index.mjs
|
|
24
|
-
"error.invalidName": "Error: Invalid project name.",
|
|
25
|
-
"summary.title": "Project configuration:",
|
|
26
|
-
"summary.directory": "Directory:",
|
|
27
|
-
"summary.widgetName": "Widget name:",
|
|
28
|
-
"summary.gleamModule": "Gleam module:",
|
|
29
|
-
"summary.packageManager": "Package manager:",
|
|
30
|
-
"summary.language": "Language:",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"progress.
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
"progress.
|
|
41
|
-
"progress.
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
"progress.
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"prompt.
|
|
68
|
-
"prompt.
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
|
|
142
|
-
"
|
|
143
|
-
|
|
144
|
-
"error.
|
|
145
|
-
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
"
|
|
150
|
-
|
|
151
|
-
"
|
|
152
|
-
"
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
"
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
"
|
|
159
|
-
"
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
"
|
|
167
|
-
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
//
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
"//
|
|
255
|
-
|
|
256
|
-
"///
|
|
257
|
-
|
|
258
|
-
//
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
1
|
+
/**
|
|
2
|
+
* i18n — CLI UI strings + template comment translations
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export const LANG_CHOICES = ["en", "ko", "ja"];
|
|
6
|
+
|
|
7
|
+
const LANG_LABELS = {
|
|
8
|
+
en: "English",
|
|
9
|
+
ko: "한국어",
|
|
10
|
+
ja: "日本語",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function getLangLabel(lang) {
|
|
14
|
+
return LANG_LABELS[lang] ?? LANG_LABELS["en"];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
// CLI UI messages
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
|
|
21
|
+
const messages = {
|
|
22
|
+
en: {
|
|
23
|
+
// index.mjs
|
|
24
|
+
"error.invalidName": "Error: Invalid project name.",
|
|
25
|
+
"summary.title": "Project configuration:",
|
|
26
|
+
"summary.directory": "Directory:",
|
|
27
|
+
"summary.widgetName": "Widget name:",
|
|
28
|
+
"summary.gleamModule": "Gleam module:",
|
|
29
|
+
"summary.packageManager": "Package manager:",
|
|
30
|
+
"summary.language": "Language:",
|
|
31
|
+
"summary.organization": "Organization:",
|
|
32
|
+
"summary.copyright": "Copyright:",
|
|
33
|
+
"summary.license": "License:",
|
|
34
|
+
"summary.version": "Version:",
|
|
35
|
+
"summary.author": "Author:",
|
|
36
|
+
"summary.projectPath": "Project path:",
|
|
37
|
+
"progress.generatingFiles": "Generating files...",
|
|
38
|
+
"progress.filesCreated": "{count} files created",
|
|
39
|
+
"progress.claudeMdCreated": "CLAUDE.md created",
|
|
40
|
+
"progress.readmeCreated": "README.md created",
|
|
41
|
+
"progress.licenseCreated": "LICENSE created",
|
|
42
|
+
"progress.gitInit": "Git repository initialized",
|
|
43
|
+
"progress.gleamCompiling": "Compiling Gleam...",
|
|
44
|
+
"progress.gleamCompiled": "Gleam compilation complete",
|
|
45
|
+
"error.gleamCompileFail":
|
|
46
|
+
"⚠ Gleam compilation failed. Run manually in the project directory:",
|
|
47
|
+
"progress.depsInstalling": "Installing dependencies... ({pm})",
|
|
48
|
+
"progress.depsInstalled": "Dependencies installed",
|
|
49
|
+
"error.depsInstallFail":
|
|
50
|
+
"⚠ Dependency installation failed. Run manually in the project directory:",
|
|
51
|
+
"progress.playwrightInstalling": "Installing Playwright Chromium...",
|
|
52
|
+
"progress.playwrightInstalled": "Playwright Chromium installed",
|
|
53
|
+
"progress.playwrightExists": "Playwright Chromium already installed",
|
|
54
|
+
"error.playwrightFail":
|
|
55
|
+
"⚠ Playwright browser installation failed. Run manually in the project directory:",
|
|
56
|
+
"progress.buildingWidget": "Building widget...",
|
|
57
|
+
"progress.widgetBuilt": "Widget build complete",
|
|
58
|
+
"error.buildFail":
|
|
59
|
+
"⚠ Build failed. Run manually in the project directory:",
|
|
60
|
+
"done.title": "Project created successfully!",
|
|
61
|
+
"done.nextSteps": "Next steps:",
|
|
62
|
+
"done.devServer": "# Start dev server",
|
|
63
|
+
"done.prodBuild": "# Production build",
|
|
64
|
+
"done.marketplace": "# Download Marketplace widgets",
|
|
65
|
+
|
|
66
|
+
// prompts.mjs
|
|
67
|
+
"prompt.projectName": "Project name:",
|
|
68
|
+
"prompt.cancelled": "Cancelled.",
|
|
69
|
+
"validate.nameRequired": "Please enter a project name.",
|
|
70
|
+
"validate.needAlpha": "Must contain valid alphabetic characters.",
|
|
71
|
+
"validate.invalidChars":
|
|
72
|
+
"Must start with a letter and contain only letters, numbers, hyphens, or underscores.",
|
|
73
|
+
"error.dirExists": "Error: Directory '{name}' already exists.",
|
|
74
|
+
"prompt.orgName": "Organization:",
|
|
75
|
+
"prompt.copyright": "Copyright:",
|
|
76
|
+
"prompt.licenseSelect": "Select license:",
|
|
77
|
+
"prompt.version": "Version:",
|
|
78
|
+
"prompt.author": "Author:",
|
|
79
|
+
"prompt.projectPath": "Test project path:",
|
|
80
|
+
"validate.orgRequired": "Please enter an organization name.",
|
|
81
|
+
"validate.orgInvalid":
|
|
82
|
+
"Must start with lowercase letter (a-z, 0-9, hyphens only).",
|
|
83
|
+
"validate.copyrightRequired": "Please enter copyright text.",
|
|
84
|
+
"validate.versionInvalid": "Must be semver format (e.g. 0.0.1).",
|
|
85
|
+
"validate.authorRequired": "Please enter author name.",
|
|
86
|
+
"validate.pathRequired": "Please enter project path.",
|
|
87
|
+
"prompt.pmSelect": "Select package manager:",
|
|
88
|
+
"prompt.pmDetected": "detected: {detected}",
|
|
89
|
+
"prompt.pmDetectedMarker": "← detected",
|
|
90
|
+
"prompt.pmChoose": "Choose (1-{count}, default: {default}):",
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
ko: {
|
|
94
|
+
// index.mjs
|
|
95
|
+
"error.invalidName": "오류: 유효하지 않은 프로젝트 이름입니다.",
|
|
96
|
+
"summary.title": "프로젝트 설정:",
|
|
97
|
+
"summary.directory": "디렉토리:",
|
|
98
|
+
"summary.widgetName": "위젯 이름:",
|
|
99
|
+
"summary.gleamModule": "Gleam 모듈:",
|
|
100
|
+
"summary.packageManager": "패키지 매니저:",
|
|
101
|
+
"summary.language": "언어:",
|
|
102
|
+
"summary.organization": "조직:",
|
|
103
|
+
"summary.copyright": "저작권:",
|
|
104
|
+
"summary.license": "라이센스:",
|
|
105
|
+
"summary.version": "버전:",
|
|
106
|
+
"summary.author": "작성자:",
|
|
107
|
+
"summary.projectPath": "프로젝트 경로:",
|
|
108
|
+
"progress.generatingFiles": "파일 생성 중...",
|
|
109
|
+
"progress.filesCreated": "{count}개 파일 생성 완료",
|
|
110
|
+
"progress.claudeMdCreated": "CLAUDE.md 생성 완료",
|
|
111
|
+
"progress.readmeCreated": "README.md 생성 완료",
|
|
112
|
+
"progress.licenseCreated": "LICENSE 생성 완료",
|
|
113
|
+
"progress.gitInit": "git 저장소 초기화 완료",
|
|
114
|
+
"progress.gleamCompiling": "Gleam 컴파일 중...",
|
|
115
|
+
"progress.gleamCompiled": "Gleam 컴파일 완료",
|
|
116
|
+
"error.gleamCompileFail":
|
|
117
|
+
"⚠ Gleam 컴파일 실패. 프로젝트 디렉토리에서 직접 실행하세요:",
|
|
118
|
+
"progress.depsInstalling": "의존성 설치 중... ({pm})",
|
|
119
|
+
"progress.depsInstalled": "의존성 설치 완료",
|
|
120
|
+
"error.depsInstallFail":
|
|
121
|
+
"⚠ 의존성 설치 실패. 프로젝트 디렉토리에서 직접 실행하세요:",
|
|
122
|
+
"progress.playwrightInstalling": "Playwright Chromium 설치 중...",
|
|
123
|
+
"progress.playwrightInstalled": "Playwright Chromium 설치 완료",
|
|
124
|
+
"progress.playwrightExists": "Playwright Chromium 이미 설치됨",
|
|
125
|
+
"error.playwrightFail":
|
|
126
|
+
"⚠ Playwright 브라우저 설치 실패. 프로젝트 디렉토리에서 직접 실행하세요:",
|
|
127
|
+
"progress.buildingWidget": "위젯 빌드 중...",
|
|
128
|
+
"progress.widgetBuilt": "위젯 빌드 완료",
|
|
129
|
+
"error.buildFail":
|
|
130
|
+
"⚠ 빌드 실패. 프로젝트 디렉토리에서 직접 실행하세요:",
|
|
131
|
+
"done.title": "프로젝트가 생성되었습니다!",
|
|
132
|
+
"done.nextSteps": "다음 단계:",
|
|
133
|
+
"done.devServer": "# 개발 서버 시작",
|
|
134
|
+
"done.prodBuild": "# 프로덕션 빌드",
|
|
135
|
+
"done.marketplace": "# Marketplace 위젯 다운로드",
|
|
136
|
+
|
|
137
|
+
// prompts.mjs
|
|
138
|
+
"prompt.projectName": "프로젝트 이름:",
|
|
139
|
+
"prompt.cancelled": "취소되었습니다.",
|
|
140
|
+
"validate.nameRequired": "프로젝트 이름을 입력해주세요.",
|
|
141
|
+
"validate.needAlpha": "유효한 영문자를 포함해야 합니다.",
|
|
142
|
+
"validate.invalidChars":
|
|
143
|
+
"영문자로 시작해야 하며, 영문자/숫자/-/_ 만 사용 가능합니다.",
|
|
144
|
+
"error.dirExists": "오류: '{name}' 디렉토리가 이미 존재합니다.",
|
|
145
|
+
"prompt.orgName": "조직:",
|
|
146
|
+
"prompt.copyright": "저작권:",
|
|
147
|
+
"prompt.licenseSelect": "라이센스 선택:",
|
|
148
|
+
"prompt.version": "버전:",
|
|
149
|
+
"prompt.author": "작성자:",
|
|
150
|
+
"prompt.projectPath": "테스트 프로젝트 경로:",
|
|
151
|
+
"validate.orgRequired": "조직 이름을 입력해주세요.",
|
|
152
|
+
"validate.orgInvalid":
|
|
153
|
+
"소문자로 시작, 소문자/숫자/하이픈만 사용 가능합니다.",
|
|
154
|
+
"validate.copyrightRequired": "저작권 문구를 입력해주세요.",
|
|
155
|
+
"validate.versionInvalid": "semver 형식이어야 합니다 (예: 0.0.1).",
|
|
156
|
+
"validate.authorRequired": "작성자를 입력해주세요.",
|
|
157
|
+
"validate.pathRequired": "프로젝트 경로를 입력해주세요.",
|
|
158
|
+
"prompt.pmSelect": "패키지 매니저 선택:",
|
|
159
|
+
"prompt.pmDetected": "감지: {detected}",
|
|
160
|
+
"prompt.pmDetectedMarker": "← 감지됨",
|
|
161
|
+
"prompt.pmChoose": "선택 (1-{count}, 기본: {default}):",
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
ja: {
|
|
165
|
+
// index.mjs
|
|
166
|
+
"error.invalidName": "エラー: 無効なプロジェクト名です。",
|
|
167
|
+
"summary.title": "プロジェクト設定:",
|
|
168
|
+
"summary.directory": "ディレクトリ:",
|
|
169
|
+
"summary.widgetName": "ウィジェット名:",
|
|
170
|
+
"summary.gleamModule": "Gleamモジュール:",
|
|
171
|
+
"summary.packageManager": "パッケージマネージャー:",
|
|
172
|
+
"summary.language": "言語:",
|
|
173
|
+
"summary.organization": "組織:",
|
|
174
|
+
"summary.copyright": "著作権:",
|
|
175
|
+
"summary.license": "ライセンス:",
|
|
176
|
+
"summary.version": "バージョン:",
|
|
177
|
+
"summary.author": "作者:",
|
|
178
|
+
"summary.projectPath": "プロジェクトパス:",
|
|
179
|
+
"progress.generatingFiles": "ファイル生成中...",
|
|
180
|
+
"progress.filesCreated": "{count}個のファイル生成完了",
|
|
181
|
+
"progress.claudeMdCreated": "CLAUDE.md 生成完了",
|
|
182
|
+
"progress.readmeCreated": "README.md 生成完了",
|
|
183
|
+
"progress.licenseCreated": "LICENSE 生成完了",
|
|
184
|
+
"progress.gitInit": "gitリポジトリ初期化完了",
|
|
185
|
+
"progress.gleamCompiling": "Gleamコンパイル中...",
|
|
186
|
+
"progress.gleamCompiled": "Gleamコンパイル完了",
|
|
187
|
+
"error.gleamCompileFail":
|
|
188
|
+
"⚠ Gleamコンパイル失敗。プロジェクトディレクトリで直接実行してください:",
|
|
189
|
+
"progress.depsInstalling": "依存関係インストール中... ({pm})",
|
|
190
|
+
"progress.depsInstalled": "依存関係インストール完了",
|
|
191
|
+
"error.depsInstallFail":
|
|
192
|
+
"⚠ 依存関係インストール失敗。プロジェクトディレクトリで直接実行してください:",
|
|
193
|
+
"progress.playwrightInstalling": "Playwright Chromiumインストール中...",
|
|
194
|
+
"progress.playwrightInstalled": "Playwright Chromiumインストール完了",
|
|
195
|
+
"progress.playwrightExists": "Playwright Chromiumインストール済み",
|
|
196
|
+
"error.playwrightFail":
|
|
197
|
+
"⚠ Playwrightブラウザインストール失敗。プロジェクトディレクトリで直接実行してください:",
|
|
198
|
+
"progress.buildingWidget": "ウィジェットビルド中...",
|
|
199
|
+
"progress.widgetBuilt": "ウィジェットビルド完了",
|
|
200
|
+
"error.buildFail":
|
|
201
|
+
"⚠ ビルド失敗。プロジェクトディレクトリで直接実行してください:",
|
|
202
|
+
"done.title": "プロジェクトが作成されました!",
|
|
203
|
+
"done.nextSteps": "次のステップ:",
|
|
204
|
+
"done.devServer": "# 開発サーバー起動",
|
|
205
|
+
"done.prodBuild": "# プロダクションビルド",
|
|
206
|
+
"done.marketplace": "# Marketplaceウィジェットダウンロード",
|
|
207
|
+
|
|
208
|
+
// prompts.mjs
|
|
209
|
+
"prompt.projectName": "プロジェクト名:",
|
|
210
|
+
"prompt.cancelled": "キャンセルされました。",
|
|
211
|
+
"validate.nameRequired": "プロジェクト名を入力してください。",
|
|
212
|
+
"validate.needAlpha": "有効なアルファベットを含む必要があります。",
|
|
213
|
+
"validate.invalidChars":
|
|
214
|
+
"英字で始まり、英字/数字/-/_ のみ使用可能です。",
|
|
215
|
+
"error.dirExists": "エラー: '{name}' ディレクトリは既に存在します。",
|
|
216
|
+
"prompt.orgName": "組織:",
|
|
217
|
+
"prompt.copyright": "著作権:",
|
|
218
|
+
"prompt.licenseSelect": "ライセンス選択:",
|
|
219
|
+
"prompt.version": "バージョン:",
|
|
220
|
+
"prompt.author": "作者:",
|
|
221
|
+
"prompt.projectPath": "テストプロジェクトパス:",
|
|
222
|
+
"validate.orgRequired": "組織名を入力してください。",
|
|
223
|
+
"validate.orgInvalid":
|
|
224
|
+
"小文字で始まり、小文字/数字/ハイフンのみ使用可能です。",
|
|
225
|
+
"validate.copyrightRequired": "著作権テキストを入力してください。",
|
|
226
|
+
"validate.versionInvalid": "semver形式でなければなりません(例:0.0.1)。",
|
|
227
|
+
"validate.authorRequired": "作者名を入力してください。",
|
|
228
|
+
"validate.pathRequired": "プロジェクトパスを入力してください。",
|
|
229
|
+
"prompt.pmSelect": "パッケージマネージャー選択:",
|
|
230
|
+
"prompt.pmDetected": "検出: {detected}",
|
|
231
|
+
"prompt.pmDetectedMarker": "← 検出済み",
|
|
232
|
+
"prompt.pmChoose": "選択 (1-{count}, デフォルト: {default}):",
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Translate a CLI message key.
|
|
238
|
+
* Supports {param} interpolation: t("en", "progress.filesCreated", { count: 5 })
|
|
239
|
+
*/
|
|
240
|
+
export function t(lang, key, params = {}) {
|
|
241
|
+
const msg = messages[lang]?.[key] ?? messages["en"][key] ?? key;
|
|
242
|
+
return msg.replace(/\{(\w+)\}/g, (_, k) => params[k] ?? `{${k}}`);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// ---------------------------------------------------------------------------
|
|
246
|
+
// Template file comments (for {{I18N:*}} placeholders)
|
|
247
|
+
// ---------------------------------------------------------------------------
|
|
248
|
+
|
|
249
|
+
const templateComments = {
|
|
250
|
+
en: {
|
|
251
|
+
// __widget_name__.gleam
|
|
252
|
+
widget_main_1: '// Mendix Pluggable Widget - "Hello World"',
|
|
253
|
+
widget_main_2:
|
|
254
|
+
"// React functional component: fn(JsProps) -> ReactElement",
|
|
255
|
+
widget_main_doc:
|
|
256
|
+
"/// Main widget function - called by Mendix runtime as a React component",
|
|
257
|
+
|
|
258
|
+
// editor_config.gleam
|
|
259
|
+
editor_config_1: "// Mendix Studio Pro property panel configuration",
|
|
260
|
+
editor_config_2: "// Defines getProperties, check, getPreview, etc.",
|
|
261
|
+
editor_config_3: "// External types (JS objects passed by Mendix)",
|
|
262
|
+
editor_config_doc:
|
|
263
|
+
"/// Property panel configuration - controls widget property visibility in Studio Pro",
|
|
264
|
+
|
|
265
|
+
// editor_preview.gleam
|
|
266
|
+
editor_preview_1: "// Mendix Studio Pro design view preview",
|
|
267
|
+
editor_preview_2:
|
|
268
|
+
"// Renders the widget's visual preview in Studio Pro",
|
|
269
|
+
editor_preview_doc:
|
|
270
|
+
"/// Studio Pro design view preview - renders the widget's visual representation",
|
|
271
|
+
|
|
272
|
+
// components/hello_world.gleam
|
|
273
|
+
hello_world_1: "// Hello World component",
|
|
274
|
+
hello_world_2:
|
|
275
|
+
"// Shared between widget runtime and Studio Pro preview",
|
|
276
|
+
hello_world_doc: "/// Render Hello World UI",
|
|
277
|
+
|
|
278
|
+
// _gitignore
|
|
279
|
+
gitignore_deps: "# Dependencies",
|
|
280
|
+
gitignore_lockfiles: "# Package manager lock files",
|
|
281
|
+
gitignore_pm_cache: "# Package manager cache/config",
|
|
282
|
+
gitignore_gleam_build: "# Gleam compilation output",
|
|
283
|
+
gitignore_mendix_build: "# Mendix widget build output",
|
|
284
|
+
gitignore_env: "# Environment variables",
|
|
285
|
+
gitignore_logs: "# Logs",
|
|
286
|
+
gitignore_os: "# OS",
|
|
287
|
+
gitignore_ide: "# IDE",
|
|
288
|
+
gitignore_test_project: "# Mendix test project",
|
|
289
|
+
gitignore_test_artifacts: "# Test artifacts",
|
|
290
|
+
gitignore_bridge:
|
|
291
|
+
"# Auto-generated bridge files (created/deleted by glendix at build time)",
|
|
292
|
+
gitignore_ai: "# AI",
|
|
293
|
+
gitignore_marketplace: "# Mendix marketplace cache/config",
|
|
294
|
+
},
|
|
295
|
+
|
|
296
|
+
ko: {
|
|
297
|
+
// __widget_name__.gleam
|
|
298
|
+
widget_main_1: '// Mendix Pluggable Widget - "Hello World"',
|
|
299
|
+
widget_main_2:
|
|
300
|
+
"// React 함수형 컴포넌트: fn(JsProps) -> ReactElement",
|
|
301
|
+
widget_main_doc:
|
|
302
|
+
"/// 위젯 메인 함수 - Mendix 런타임이 React 컴포넌트로 호출",
|
|
303
|
+
|
|
304
|
+
// editor_config.gleam
|
|
305
|
+
editor_config_1: "// Mendix Studio Pro 속성 패널 설정",
|
|
306
|
+
editor_config_2: "// getProperties, check, getPreview 등을 정의",
|
|
307
|
+
editor_config_3: "// 외부 타입 (Mendix가 전달하는 JS 객체)",
|
|
308
|
+
editor_config_doc:
|
|
309
|
+
"/// 속성 패널 설정 - Studio Pro에서 위젯 속성의 가시성을 제어",
|
|
310
|
+
|
|
311
|
+
// editor_preview.gleam
|
|
312
|
+
editor_preview_1: "// Mendix Studio Pro 디자인 뷰 미리보기",
|
|
313
|
+
editor_preview_2:
|
|
314
|
+
"// Studio Pro에서 위젯의 시각적 미리보기를 렌더링",
|
|
315
|
+
editor_preview_doc:
|
|
316
|
+
"/// Studio Pro 디자인 뷰 미리보기 - 위젯의 시각적 표현을 렌더링",
|
|
317
|
+
|
|
318
|
+
// components/hello_world.gleam
|
|
319
|
+
hello_world_1: "// Hello World 컴포넌트",
|
|
320
|
+
hello_world_2: "// 위젯 런타임과 Studio Pro 미리보기에서 공유",
|
|
321
|
+
hello_world_doc: "/// Hello World UI 렌더링",
|
|
322
|
+
|
|
323
|
+
// _gitignore
|
|
324
|
+
gitignore_deps: "# 의존성",
|
|
325
|
+
gitignore_lockfiles: "# 패키지 매니저 lock 파일",
|
|
326
|
+
gitignore_pm_cache: "# 패키지 매니저 캐시/설정",
|
|
327
|
+
gitignore_gleam_build: "# Gleam 컴파일 출력",
|
|
328
|
+
gitignore_mendix_build: "# Mendix 위젯 빌드 출력",
|
|
329
|
+
gitignore_env: "# 환경 변수",
|
|
330
|
+
gitignore_logs: "# 로그",
|
|
331
|
+
gitignore_os: "# OS",
|
|
332
|
+
gitignore_ide: "# IDE",
|
|
333
|
+
gitignore_test_project: "# Mendix 테스트 프로젝트",
|
|
334
|
+
gitignore_test_artifacts: "# 테스트 산출물",
|
|
335
|
+
gitignore_bridge:
|
|
336
|
+
"# 자동 생성 브릿지 파일 (glendix가 빌드 시 생성/삭제)",
|
|
337
|
+
gitignore_ai: "# AI",
|
|
338
|
+
gitignore_marketplace: "# Mendix marketplace 캐시/설정",
|
|
339
|
+
},
|
|
340
|
+
|
|
341
|
+
ja: {
|
|
342
|
+
// __widget_name__.gleam
|
|
343
|
+
widget_main_1: '// Mendix Pluggable Widget - "Hello World"',
|
|
344
|
+
widget_main_2:
|
|
345
|
+
"// React関数コンポーネント: fn(JsProps) -> ReactElement",
|
|
346
|
+
widget_main_doc:
|
|
347
|
+
"/// ウィジェットメイン関数 - MendixランタイムがReactコンポーネントとして呼び出し",
|
|
348
|
+
|
|
349
|
+
// editor_config.gleam
|
|
350
|
+
editor_config_1: "// Mendix Studio Proプロパティパネル設定",
|
|
351
|
+
editor_config_2: "// getProperties、check、getPreview等を定義",
|
|
352
|
+
editor_config_3: "// 外部型(Mendixが渡すJSオブジェクト)",
|
|
353
|
+
editor_config_doc:
|
|
354
|
+
"/// プロパティパネル設定 - Studio Proでウィジェットプロパティの表示/非表示を制御",
|
|
355
|
+
|
|
356
|
+
// editor_preview.gleam
|
|
357
|
+
editor_preview_1: "// Mendix Studio Proデザインビュープレビュー",
|
|
358
|
+
editor_preview_2:
|
|
359
|
+
"// Studio Proでウィジェットのビジュアルプレビューをレンダリング",
|
|
360
|
+
editor_preview_doc:
|
|
361
|
+
"/// Studio Proデザインビュープレビュー - ウィジェットのビジュアル表現をレンダリング",
|
|
362
|
+
|
|
363
|
+
// components/hello_world.gleam
|
|
364
|
+
hello_world_1: "// Hello Worldコンポーネント",
|
|
365
|
+
hello_world_2:
|
|
366
|
+
"// ウィジェットランタイムとStudio Proプレビューで共有",
|
|
367
|
+
hello_world_doc: "/// Hello World UIのレンダリング",
|
|
368
|
+
|
|
369
|
+
// _gitignore
|
|
370
|
+
gitignore_deps: "# 依存関係",
|
|
371
|
+
gitignore_lockfiles: "# パッケージマネージャーlockファイル",
|
|
372
|
+
gitignore_pm_cache: "# パッケージマネージャーキャッシュ/設定",
|
|
373
|
+
gitignore_gleam_build: "# Gleamコンパイル出力",
|
|
374
|
+
gitignore_mendix_build: "# Mendixウィジェットビルド出力",
|
|
375
|
+
gitignore_env: "# 環境変数",
|
|
376
|
+
gitignore_logs: "# ログ",
|
|
377
|
+
gitignore_os: "# OS",
|
|
378
|
+
gitignore_ide: "# IDE",
|
|
379
|
+
gitignore_test_project: "# Mendixテストプロジェクト",
|
|
380
|
+
gitignore_test_artifacts: "# テスト成果物",
|
|
381
|
+
gitignore_bridge:
|
|
382
|
+
"# 自動生成ブリッジファイル(glendixがビルド時に生成/削除)",
|
|
383
|
+
gitignore_ai: "# AI",
|
|
384
|
+
gitignore_marketplace: "# Mendix marketplaceキャッシュ/設定",
|
|
385
|
+
},
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Get template comment translations for the given language.
|
|
390
|
+
* Used for {{I18N:*}} placeholder replacement in template files.
|
|
391
|
+
*/
|
|
392
|
+
export function getTemplateComments(lang) {
|
|
393
|
+
return templateComments[lang] ?? templateComments["en"];
|
|
394
|
+
}
|