@cocreate/cli 1.59.0 → 1.60.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/CHANGELOG.md +1 -1
- package/CoCreate.config.js +384 -379
- package/package.json +5 -5
- package/src/commands/acme.js +1 -1
- package/src/commands/other/translate.js +126 -128
package/CHANGELOG.md
CHANGED
|
@@ -248,7 +248,7 @@
|
|
|
248
248
|
|
|
249
249
|
### Features
|
|
250
250
|
|
|
251
|
-
* add '@cocreate/
|
|
251
|
+
* add '@cocreate/certificates' and '@cocreate/nginx' ([0eb81e8](https://github.com/CoCreate-app/CoCreate-cli/commit/0eb81e88a54931bc2fc78663393b15338a62740f))
|
|
252
252
|
* coc acme to manage certs ([13049fa](https://github.com/CoCreate-app/CoCreate-cli/commit/13049fa7316269d1fc64b0f9c378b10937c0e7b7))
|
|
253
253
|
|
|
254
254
|
## [1.45.3](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.45.2...v1.45.3) (2023-12-18)
|
package/CoCreate.config.js
CHANGED
|
@@ -20,522 +20,527 @@ module.exports = {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
],
|
|
23
|
-
|
|
24
|
-
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
modules: {
|
|
24
|
+
cocreatejs: {
|
|
25
|
+
path: "../../CoCreateJS",
|
|
26
|
+
repo: "github.com/CoCreate-app/CoCreateJS.git",
|
|
27
|
+
exclude: [
|
|
28
28
|
"fs/webpack"
|
|
29
29
|
]
|
|
30
30
|
},
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
admin: {
|
|
32
|
+
path: "../../CoCreate-admin",
|
|
33
|
+
repo: "github.com/CoCreate-app/CoCreate-admin.git",
|
|
34
|
+
exclude: [
|
|
35
35
|
"fs/webpack"
|
|
36
36
|
]
|
|
37
37
|
},
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
website: {
|
|
39
|
+
path: "../../CoCreate-website",
|
|
40
|
+
repo: "github.com/CoCreate-app/CoCreate-website.git",
|
|
41
|
+
exclude: [
|
|
42
42
|
"fs/webpack"
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
|
|
46
|
+
actions: {
|
|
47
|
+
path: "../CoCreate-actions",
|
|
48
|
+
repo: "github.com/CoCreate-app/CoCreate-actions.git"
|
|
48
49
|
},
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
api: {
|
|
51
|
+
path: "../CoCreate-api",
|
|
52
|
+
repo: "github.com/CoCreate-app/CoCreate-api.git"
|
|
52
53
|
},
|
|
53
|
-
{
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
attributes: {
|
|
55
|
+
path: "../CoCreate-attributes",
|
|
56
|
+
repo: "github.com/CoCreate-app/CoCreate-attributes.git"
|
|
56
57
|
},
|
|
57
|
-
{
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
cache: {
|
|
59
|
+
path: "../CoCreate-cache",
|
|
60
|
+
repo: "github.com/CoCreate-app/CoCreate-cache.git"
|
|
60
61
|
},
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
calculate: {
|
|
63
|
+
path: "../CoCreate-calculate",
|
|
64
|
+
repo: "github.com/CoCreate-app/CoCreate-calculation.git"
|
|
64
65
|
},
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
cli: {
|
|
67
|
+
path: "../CoCreate-cli",
|
|
68
|
+
repo: "github.com/CoCreate-app/CoCreate-cli.git",
|
|
69
|
+
exclude: [
|
|
69
70
|
"fs/webpack"
|
|
70
71
|
]
|
|
71
72
|
},
|
|
72
|
-
{
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
clipboard: {
|
|
74
|
+
path: "../CoCreate-clipboard",
|
|
75
|
+
repo: "github.com/CoCreate-app/CoCreate-clipboard.git"
|
|
75
76
|
},
|
|
76
|
-
{
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
clone: {
|
|
78
|
+
path: "../CoCreate-clone",
|
|
79
|
+
repo: "github.com/CoCreate-app/CoCreate-clone.git"
|
|
79
80
|
},
|
|
80
|
-
{
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
codearea: {
|
|
82
|
+
path: "../CoCreate-codearea",
|
|
83
|
+
repo: "github.com/CoCreate-app/CoCreate-codearea.git"
|
|
83
84
|
},
|
|
84
|
-
{
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
"conditional-logic": {
|
|
86
|
+
path: "../CoCreate-conditional-logic",
|
|
87
|
+
repo: "github.com/CoCreate-app/CoCreate-conditional-logic.git"
|
|
87
88
|
},
|
|
88
|
-
{
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
config: {
|
|
90
|
+
path: "../CoCreate-config",
|
|
91
|
+
repo: "github.com/CoCreate-app/CoCreate-config.git"
|
|
91
92
|
},
|
|
92
|
-
{
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
crdt: {
|
|
94
|
+
path: "../CoCreate-crdt",
|
|
95
|
+
repo: "github.com/CoCreate-app/CoCreate-crdt.git"
|
|
95
96
|
},
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
|
|
98
|
+
"crud-client": {
|
|
99
|
+
path: "../CoCreate-crud-client",
|
|
100
|
+
repo: "github.com/CoCreate-app/CoCreate-crud-client.git"
|
|
99
101
|
},
|
|
100
|
-
{
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
"css-parser": {
|
|
103
|
+
path: "../CoCreate-css-parser",
|
|
104
|
+
repo: "github.com/CoCreate-app/CoCreate-css-parser.git"
|
|
103
105
|
},
|
|
104
|
-
{
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
cursors: {
|
|
107
|
+
path: "../CoCreate-cursors",
|
|
108
|
+
repo: "github.com/CoCreate-app/CoCreate-cursors.git"
|
|
107
109
|
},
|
|
108
|
-
{
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
dnd: {
|
|
111
|
+
path: "../CoCreate-dnd",
|
|
112
|
+
repo: "github.com/CoCreate-app/CoCreate-dnd.git"
|
|
111
113
|
},
|
|
112
|
-
{
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
docs: {
|
|
115
|
+
path: "../CoCreate-docs",
|
|
116
|
+
repo: "github.com/CoCreate-app/CoCreate-docs.git",
|
|
117
|
+
exclude: [
|
|
116
118
|
"fs/webpack"
|
|
117
119
|
]
|
|
118
120
|
},
|
|
119
|
-
{
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
"element-config": {
|
|
122
|
+
path: "../CoCreate-element-config",
|
|
123
|
+
repo: "github.com/CoCreate-app/CoCreate-element-config.git"
|
|
122
124
|
},
|
|
123
|
-
{
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
"element-prototype": {
|
|
126
|
+
path: "../CoCreate-element-prototype",
|
|
127
|
+
repo: "github.com/CoCreate-app/CoCreate-element-prototype.git"
|
|
126
128
|
},
|
|
127
|
-
{
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
elements: {
|
|
130
|
+
path: "../CoCreate-elements",
|
|
131
|
+
repo: "github.com/CoCreate-app/CoCreate-elements.git"
|
|
130
132
|
},
|
|
131
|
-
{
|
|
132
|
-
|
|
133
|
-
|
|
133
|
+
events: {
|
|
134
|
+
path: "../CoCreate-events",
|
|
135
|
+
repo: "github.com/CoCreate-app/CoCreate-events.git"
|
|
134
136
|
},
|
|
135
|
-
{
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
file: {
|
|
138
|
+
path: "../CoCreate-file",
|
|
139
|
+
repo: "github.com/CoCreate-app/CoCreate-file.git"
|
|
138
140
|
},
|
|
139
|
-
{
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
filter: {
|
|
142
|
+
path: "../CoCreate-filter",
|
|
143
|
+
repo: "github.com/CoCreate-app/CoCreate-filter.git"
|
|
142
144
|
},
|
|
143
|
-
{
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
"floating-label": {
|
|
146
|
+
path: "../CoCreate-floating-label",
|
|
147
|
+
repo: "github.com/CoCreate-app/CoCreate-floating-label.git"
|
|
146
148
|
},
|
|
147
|
-
{
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
fullscreen: {
|
|
150
|
+
path: "../CoCreate-fullscreen",
|
|
151
|
+
repo: "github.com/CoCreate-app/CoCreate-fullscreen.git"
|
|
150
152
|
},
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
|
|
154
|
+
indexeddb: {
|
|
155
|
+
path: "../CoCreate-indexeddb",
|
|
156
|
+
repo: "github.com/CoCreate-app/CoCreate-indexeddb.git"
|
|
154
157
|
},
|
|
155
|
-
{
|
|
156
|
-
|
|
157
|
-
|
|
158
|
+
industry: {
|
|
159
|
+
path: "../CoCreate-industry",
|
|
160
|
+
repo: "github.com/CoCreate-app/CoCreate-industry.git"
|
|
158
161
|
},
|
|
159
|
-
{
|
|
160
|
-
|
|
161
|
-
|
|
162
|
+
"lazy-loader": {
|
|
163
|
+
path: "../CoCreate-lazy-loader",
|
|
164
|
+
repo: "github.com/CoCreate-app/CoCreate-lazy-loader.git"
|
|
162
165
|
},
|
|
163
|
-
{
|
|
164
|
-
|
|
165
|
-
|
|
166
|
+
"local-storage": {
|
|
167
|
+
path: "../CoCreate-local-storage",
|
|
168
|
+
repo: "github.com/CoCreate-app/CoCreate-local-storage.git"
|
|
166
169
|
},
|
|
167
|
-
{
|
|
168
|
-
|
|
169
|
-
|
|
170
|
+
link: {
|
|
171
|
+
path: "../CoCreate-link",
|
|
172
|
+
repo: "github.com/CoCreate-app/CoCreate-link.git"
|
|
170
173
|
},
|
|
171
|
-
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
+
modal: {
|
|
175
|
+
path: "../CoCreate-modal",
|
|
176
|
+
repo: "github.com/CoCreate-app/CoCreate-modal.git"
|
|
174
177
|
},
|
|
175
|
-
{
|
|
176
|
-
|
|
177
|
-
|
|
178
|
+
notification: {
|
|
179
|
+
path: "../CoCreate-notification",
|
|
180
|
+
repo: "github.com/CoCreate-app/CoCreate-notification.git"
|
|
178
181
|
},
|
|
179
|
-
{
|
|
180
|
-
|
|
181
|
-
|
|
182
|
+
observer: {
|
|
183
|
+
path: "../CoCreate-observer",
|
|
184
|
+
repo: "github.com/CoCreate-app/CoCreate-observer.git"
|
|
182
185
|
},
|
|
183
|
-
{
|
|
184
|
-
|
|
185
|
-
|
|
186
|
+
organizations: {
|
|
187
|
+
path: "../CoCreate-organizations",
|
|
188
|
+
repo: "github.com/CoCreate-app/CoCreate-organizations.git"
|
|
186
189
|
},
|
|
187
|
-
{
|
|
188
|
-
|
|
189
|
-
|
|
190
|
+
"overlay-scroll": {
|
|
191
|
+
path: "../CoCreate-overlay-scroll",
|
|
192
|
+
repo: "github.com/CoCreate-app/CoCreate-overlay-scroll.git"
|
|
190
193
|
},
|
|
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
|
-
"
|
|
194
|
+
parallax: {
|
|
195
|
+
path: "../CoCreate-parallax",
|
|
196
|
+
repo: "github.com/CoCreate-app/CoCreate-parallax.git"
|
|
197
|
+
},
|
|
198
|
+
state: {
|
|
199
|
+
path: "../CoCreate-state",
|
|
200
|
+
repo: "github.com/CoCreate-app/CoCreate-state.git"
|
|
201
|
+
},
|
|
202
|
+
position: {
|
|
203
|
+
path: "../CoCreate-position",
|
|
204
|
+
repo: "github.com/CoCreate-app/CoCreate-position.git"
|
|
205
|
+
},
|
|
206
|
+
print: {
|
|
207
|
+
path: "../CoCreate-print",
|
|
208
|
+
repo: "github.com/CoCreate-app/CoCreate-print.git"
|
|
209
|
+
},
|
|
210
|
+
progress: {
|
|
211
|
+
path: "../CoCreate-progress",
|
|
212
|
+
repo: "github.com/CoCreate-app/CoCreate-progress.git"
|
|
213
|
+
},
|
|
214
|
+
pwa: {
|
|
215
|
+
path: "../CoCreate-pwa",
|
|
216
|
+
repo: "github.com/CoCreate-app/CoCreate-pwa.git"
|
|
217
|
+
},
|
|
218
|
+
"random-color": {
|
|
219
|
+
path: "../CoCreate-random-color",
|
|
220
|
+
repo: "github.com/CoCreate-app/CoCreate-random-color.git"
|
|
221
|
+
},
|
|
222
|
+
remove: {
|
|
223
|
+
path: "../CoCreate-remove",
|
|
224
|
+
repo: "github.com/CoCreate-app/CoCreate-remove.git"
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
render: {
|
|
228
|
+
path: "../CoCreate-render",
|
|
229
|
+
repo: "github.com/CoCreate-app/CoCreate-render.git"
|
|
230
|
+
},
|
|
231
|
+
resize: {
|
|
232
|
+
path: "../CoCreate-resize",
|
|
233
|
+
repo: "github.com/CoCreate-app/CoCreate-resize.git"
|
|
234
|
+
},
|
|
235
|
+
"rich-text": {
|
|
236
|
+
path: "../CoCreate-rich-text",
|
|
237
|
+
repo: "github.com/CoCreate-app/CoCreate-rich-text.git"
|
|
238
|
+
},
|
|
239
|
+
scroll: {
|
|
240
|
+
path: "../CoCreate-scroll",
|
|
241
|
+
repo: "github.com/CoCreate-app/CoCreate-scroll.git"
|
|
242
|
+
},
|
|
243
|
+
search: {
|
|
244
|
+
path: "../CoCreate-search",
|
|
245
|
+
repo: "github.com/CoCreate-app/CoCreate-search.git"
|
|
246
|
+
},
|
|
247
|
+
select: {
|
|
248
|
+
path: "../CoCreate-select",
|
|
249
|
+
repo: "github.com/CoCreate-app/CoCreate-select.git"
|
|
250
|
+
},
|
|
251
|
+
selection: {
|
|
252
|
+
path: "../CoCreate-selection",
|
|
253
|
+
repo: "github.com/CoCreate-app/CoCreate-selection.git"
|
|
254
|
+
},
|
|
255
|
+
"socket-client": {
|
|
256
|
+
path: "../CoCreate-socket-client",
|
|
257
|
+
repo: "github.com/CoCreate-app/CoCreate-socket-client.git"
|
|
258
|
+
},
|
|
259
|
+
"social-share": {
|
|
260
|
+
path: "../CoCreate-social-share",
|
|
261
|
+
repo: "github.com/CoCreate-app/CoCreate-social-share.git"
|
|
262
|
+
},
|
|
263
|
+
text: {
|
|
264
|
+
path: "../CoCreate-text",
|
|
265
|
+
repo: "github.com/CoCreate-app/CoCreate-text.git"
|
|
266
|
+
},
|
|
267
|
+
toolbar: {
|
|
268
|
+
path: "../CoCreate-toolbar",
|
|
269
|
+
repo: "github.com/CoCreate-app/CoCreate-toolbar.git"
|
|
270
|
+
},
|
|
271
|
+
unique: {
|
|
272
|
+
path: "../CoCreate-unique",
|
|
273
|
+
repo: "github.com/CoCreate-app/CoCreate-unique.git"
|
|
274
|
+
},
|
|
275
|
+
users: {
|
|
276
|
+
path: "../CoCreate-users",
|
|
277
|
+
repo: "github.com/CoCreate-app/CoCreate-users.git"
|
|
278
|
+
},
|
|
279
|
+
utils: {
|
|
280
|
+
path: "../CoCreate-utils",
|
|
281
|
+
repo: "github.com/CoCreate-app/CoCreate-utils.git"
|
|
282
|
+
},
|
|
283
|
+
validation: {
|
|
284
|
+
path: "../CoCreate-validation",
|
|
285
|
+
repo: "github.com/CoCreate-app/CoCreate-validation.git"
|
|
286
|
+
},
|
|
287
|
+
vdom: {
|
|
288
|
+
path: "../CoCreate-vdom",
|
|
289
|
+
repo: "github.com/CoCreate-app/CoCreate-vdom.git"
|
|
290
|
+
},
|
|
291
|
+
|
|
292
|
+
builder: {
|
|
293
|
+
path: "../../CoCreate-apps/CoCreate-builder",
|
|
294
|
+
repo: "github.com/CoCreate-app/CoCreate-builder.git",
|
|
295
|
+
exclude: [
|
|
291
296
|
"fs/webpack"
|
|
292
297
|
]
|
|
293
298
|
},
|
|
294
|
-
{
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
299
|
+
dashboard: {
|
|
300
|
+
path: "../../CoCreate-apps/CoCreate-dashboard",
|
|
301
|
+
repo: "github.com/CoCreate-app/CoCreate-dashboard.git",
|
|
302
|
+
exclude: [
|
|
298
303
|
"fs/webpack"
|
|
299
304
|
]
|
|
300
305
|
},
|
|
301
|
-
{
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
306
|
+
datatable: {
|
|
307
|
+
path: "../../CoCreate-apps/CoCreate-datatable",
|
|
308
|
+
repo: "github.com/CoCreate-app/CoCreate-datatable.git",
|
|
309
|
+
exclude: [
|
|
305
310
|
"fs/webpack"
|
|
306
311
|
]
|
|
307
312
|
},
|
|
308
|
-
{
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
313
|
+
kanban: {
|
|
314
|
+
path: "../../CoCreate-apps/CoCreate-kanban",
|
|
315
|
+
repo: "github.com/CoCreate-app/CoCreate-kanban.git",
|
|
316
|
+
exclude: [
|
|
312
317
|
"fs/webpack"
|
|
313
318
|
]
|
|
314
319
|
},
|
|
315
|
-
{
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
320
|
+
sandbox: {
|
|
321
|
+
path: "../../CoCreate-apps/CoCreate-sandbox",
|
|
322
|
+
repo: "github.com/CoCreate-app/CoCreate-sandbox.git",
|
|
323
|
+
exclude: [
|
|
319
324
|
"fs/webpack"
|
|
320
325
|
]
|
|
321
326
|
},
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
327
|
+
|
|
328
|
+
charts: {
|
|
329
|
+
path: "../../CoCreate-plugins/CoCreate-charts",
|
|
330
|
+
repo: "github.com/CoCreate-app/CoCreate-charts.git"
|
|
325
331
|
},
|
|
326
|
-
{
|
|
327
|
-
|
|
328
|
-
|
|
332
|
+
"alpha-vantage": {
|
|
333
|
+
path: "../../CoCreate-plugins/CoCreate-alpha-vantage",
|
|
334
|
+
repo: "github.com/CoCreate-app/CoCreate-alpha-vantage.git"
|
|
329
335
|
},
|
|
330
|
-
{
|
|
331
|
-
|
|
332
|
-
|
|
336
|
+
aos: {
|
|
337
|
+
path: "../../CoCreate-plugins/CoCreate-aos",
|
|
338
|
+
repo: "github.com/CoCreate-app/CoCreate-aos.git"
|
|
333
339
|
},
|
|
334
|
-
{
|
|
335
|
-
|
|
336
|
-
|
|
340
|
+
croppie: {
|
|
341
|
+
path: "../../CoCreate-plugins/CoCreate-croppie",
|
|
342
|
+
repo: "github.com/CoCreate-app/CoCreate-croppie.git"
|
|
337
343
|
},
|
|
338
|
-
{
|
|
339
|
-
|
|
340
|
-
|
|
344
|
+
domain: {
|
|
345
|
+
path: "../../CoCreate-plugins/CoCreate-domain",
|
|
346
|
+
repo: "github.com/CoCreate-app/CoCreate-domain.git"
|
|
341
347
|
},
|
|
342
|
-
{
|
|
343
|
-
|
|
344
|
-
|
|
348
|
+
fabric: {
|
|
349
|
+
path: "../../CoCreate-plugins/CoCreate-fabric",
|
|
350
|
+
repo: "github.com/CoCreate-app/CoCreate-fabric.git"
|
|
345
351
|
},
|
|
346
|
-
{
|
|
347
|
-
|
|
348
|
-
|
|
352
|
+
facebook: {
|
|
353
|
+
path: "../../CoCreate-plugins/CoCreate-facebook",
|
|
354
|
+
repo: "github.com/CoCreate-app/CoCreate-facebook.git"
|
|
349
355
|
},
|
|
350
|
-
{
|
|
351
|
-
|
|
352
|
-
|
|
356
|
+
fullcalendar: {
|
|
357
|
+
path: "../../CoCreate-plugins/CoCreate-fullcalendar",
|
|
358
|
+
repo: "github.com/CoCreate-app/CoCreate-fullcalendar.git"
|
|
353
359
|
},
|
|
354
|
-
{
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
360
|
+
ffmpeg: {
|
|
361
|
+
path: "../../CoCreate-plugins/CoCreate-ffmpeg",
|
|
362
|
+
repo: "github.com/CoCreate-app/CoCreate-ffmpeg.git",
|
|
363
|
+
exclude: [
|
|
358
364
|
"fs/webpack"
|
|
359
365
|
]
|
|
360
366
|
},
|
|
361
|
-
{
|
|
362
|
-
|
|
363
|
-
|
|
367
|
+
"google-maps": {
|
|
368
|
+
path: "../../CoCreate-plugins/CoCreate-google-maps",
|
|
369
|
+
repo: "github.com/CoCreate-app/CoCreate-google-maps.git"
|
|
364
370
|
},
|
|
365
|
-
{
|
|
366
|
-
|
|
367
|
-
|
|
371
|
+
"google-auth": {
|
|
372
|
+
path: "../../CoCreate-plugins/CoCreate-google-auth",
|
|
373
|
+
repo: "github.com/CoCreate-app/CoCreate-google-auth.git"
|
|
368
374
|
},
|
|
369
|
-
{
|
|
370
|
-
|
|
371
|
-
|
|
375
|
+
instagram: {
|
|
376
|
+
path: "../../CoCreate-plugins/CoCreate-instagram",
|
|
377
|
+
repo: "github.com/CoCreate-app/CoCreate-instagram.git"
|
|
372
378
|
},
|
|
373
|
-
{
|
|
374
|
-
|
|
375
|
-
|
|
379
|
+
lighthouse: {
|
|
380
|
+
path: "../../CoCreate-plugins/CoCreate-lighthouse",
|
|
381
|
+
repo: "github.com/CoCreate-app/CoCreate-lighthouse.git"
|
|
376
382
|
},
|
|
377
|
-
{
|
|
378
|
-
|
|
379
|
-
|
|
383
|
+
linkedin: {
|
|
384
|
+
path: "../../CoCreate-plugins/CoCreate-linkedin",
|
|
385
|
+
repo: "github.com/CoCreate-app/CoCreate-linkedin.git"
|
|
380
386
|
},
|
|
381
|
-
{
|
|
382
|
-
|
|
383
|
-
|
|
387
|
+
marked: {
|
|
388
|
+
path: "../../CoCreate-plugins/CoCreate-marked",
|
|
389
|
+
repo: "github.com/CoCreate-app/CoCreate-marked.git"
|
|
384
390
|
},
|
|
385
|
-
{
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
391
|
+
mongodb: {
|
|
392
|
+
path: "../../CoCreate-plugins/CoCreate-mongodb",
|
|
393
|
+
repo: "github.com/CoCreate-app/CoCreate-mongodb.git",
|
|
394
|
+
exclude: [
|
|
389
395
|
"fs/webpack"
|
|
390
396
|
]
|
|
391
397
|
},
|
|
392
|
-
{
|
|
393
|
-
|
|
394
|
-
|
|
398
|
+
openai: {
|
|
399
|
+
path: "../../CoCreate-plugins/CoCreate-openai",
|
|
400
|
+
repo: "github.com/CoCreate-app/CoCreate-openai.git"
|
|
395
401
|
},
|
|
396
|
-
{
|
|
397
|
-
|
|
398
|
-
|
|
402
|
+
pickr: {
|
|
403
|
+
path: "../../CoCreate-plugins/CoCreate-pickr",
|
|
404
|
+
repo: "github.com/CoCreate-app/CoCreate-pickr.git"
|
|
399
405
|
},
|
|
400
|
-
{
|
|
401
|
-
|
|
402
|
-
|
|
406
|
+
pinterest: {
|
|
407
|
+
path: "../../CoCreate-plugins/CoCreate-pinterest",
|
|
408
|
+
repo: "github.com/CoCreate-app/CoCreate-pinterest.git"
|
|
403
409
|
},
|
|
404
|
-
{
|
|
405
|
-
|
|
406
|
-
|
|
410
|
+
plaid: {
|
|
411
|
+
path: "../../CoCreate-plugins/CoCreate-plaid",
|
|
412
|
+
repo: "github.com/CoCreate-app/CoCreate-plaid.git"
|
|
407
413
|
},
|
|
408
|
-
{
|
|
409
|
-
|
|
410
|
-
|
|
414
|
+
prism: {
|
|
415
|
+
path: "../../CoCreate-plugins/CoCreate-prism",
|
|
416
|
+
repo: "github.com/CoCreate-app/CoCreate-prism.git"
|
|
411
417
|
},
|
|
412
|
-
{
|
|
413
|
-
|
|
414
|
-
|
|
418
|
+
sendgrid: {
|
|
419
|
+
path: "../../CoCreate-plugins/CoCreate-sendgrid",
|
|
420
|
+
repo: "github.com/CoCreate-app/CoCreate-sendgrid.git"
|
|
415
421
|
},
|
|
416
|
-
{
|
|
417
|
-
|
|
418
|
-
|
|
422
|
+
shipengine: {
|
|
423
|
+
path: "../../CoCreate-plugins/CoCreate-shipengine",
|
|
424
|
+
repo: "github.com/CoCreate-app/CoCreate-shipengine.git"
|
|
419
425
|
},
|
|
420
|
-
{
|
|
421
|
-
|
|
422
|
-
|
|
426
|
+
stripe: {
|
|
427
|
+
path: "../../CoCreate-plugins/CoCreate-stripe",
|
|
428
|
+
repo: "github.com/CoCreate-app/CoCreate-stripe.git"
|
|
423
429
|
},
|
|
424
|
-
{
|
|
425
|
-
|
|
426
|
-
|
|
430
|
+
twilio: {
|
|
431
|
+
path: "../../CoCreate-plugins/CoCreate-twilio",
|
|
432
|
+
repo: "github.com/CoCreate-app/CoCreate-twilio.git"
|
|
427
433
|
},
|
|
428
|
-
{
|
|
429
|
-
|
|
430
|
-
|
|
434
|
+
twitter: {
|
|
435
|
+
path: "../../CoCreate-plugins/CoCreate-twitter",
|
|
436
|
+
repo: "github.com/CoCreate-app/CoCreate-twitter.git"
|
|
431
437
|
},
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
"
|
|
438
|
+
|
|
439
|
+
cocreatews: {
|
|
440
|
+
path: "../../CoCreateWS",
|
|
441
|
+
repo: "github.com/CoCreate-app/CoCreateWS.git",
|
|
442
|
+
exclude: [
|
|
436
443
|
"fs/webpack"
|
|
437
444
|
]
|
|
438
445
|
},
|
|
439
|
-
{
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
446
|
+
certificates: {
|
|
447
|
+
path: "../CoCreate-certificates",
|
|
448
|
+
repo: "github.com/CoCreate-app/CoCreate-certificates.git",
|
|
449
|
+
exclude: [
|
|
443
450
|
"fs/webpack"
|
|
444
451
|
]
|
|
445
452
|
},
|
|
446
|
-
{
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
453
|
+
authenticate: {
|
|
454
|
+
path: "../CoCreate-authenticate",
|
|
455
|
+
repo: "github.com/CoCreate-app/CoCreate-authenticate.git",
|
|
456
|
+
exclude: [
|
|
450
457
|
"fs/webpack"
|
|
451
458
|
]
|
|
452
459
|
},
|
|
453
|
-
{
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
460
|
+
authorize: {
|
|
461
|
+
path: "../CoCreate-authorize",
|
|
462
|
+
repo: "github.com/CoCreate-app/CoCreate-authorize.git",
|
|
463
|
+
exclude: [
|
|
457
464
|
"fs/webpack"
|
|
458
465
|
]
|
|
459
466
|
},
|
|
460
|
-
{
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
467
|
+
"cron-jobs": {
|
|
468
|
+
path: "../CoCreate-cron-jobs",
|
|
469
|
+
repo: "github.com/CoCreate-app/CoCreate-cron-jobs.git",
|
|
470
|
+
exclude: [
|
|
464
471
|
"fs/webpack"
|
|
465
472
|
]
|
|
466
473
|
},
|
|
467
|
-
{
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
474
|
+
"crud-server": {
|
|
475
|
+
path: "../CoCreate-crud-server",
|
|
476
|
+
repo: "github.com/CoCreate-app/CoCreate-crud-server.git",
|
|
477
|
+
exclude: [
|
|
471
478
|
"fs/webpack"
|
|
472
479
|
]
|
|
473
480
|
},
|
|
474
|
-
{
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
481
|
+
"file-server": {
|
|
482
|
+
path: "../CoCreate-file-server",
|
|
483
|
+
repo: "github.com/CoCreate-app/CoCreate-file-server.git",
|
|
484
|
+
exclude: [
|
|
478
485
|
"fs/webpack"
|
|
479
486
|
]
|
|
480
487
|
},
|
|
481
|
-
{
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
488
|
+
metrics: {
|
|
489
|
+
path: "../CoCreate-metrics",
|
|
490
|
+
repo: "github.com/CoCreate-app/CoCreate-metrics.git",
|
|
491
|
+
exclude: [
|
|
485
492
|
"fs/webpack"
|
|
486
493
|
]
|
|
487
494
|
},
|
|
488
|
-
{
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
495
|
+
server: {
|
|
496
|
+
path: "../CoCreate-server",
|
|
497
|
+
repo: "github.com/CoCreate-app/CoCreate-server.git",
|
|
498
|
+
exclude: [
|
|
492
499
|
"fs/webpack"
|
|
493
500
|
]
|
|
494
501
|
},
|
|
495
|
-
{
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
502
|
+
"server-side-render": {
|
|
503
|
+
path: "../CoCreate-server-side-render",
|
|
504
|
+
repo: "github.com/CoCreate-app/CoCreate-server-side-render.git",
|
|
505
|
+
exclude: [
|
|
499
506
|
"fs/webpack"
|
|
500
507
|
]
|
|
501
508
|
},
|
|
502
|
-
{
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
509
|
+
"socket-server": {
|
|
510
|
+
path: "../CoCreate-socket-server",
|
|
511
|
+
repo: "github.com/CoCreate-app/CoCreate-socket-server.git",
|
|
512
|
+
exclude: [
|
|
506
513
|
"fs/webpack"
|
|
507
514
|
]
|
|
508
515
|
},
|
|
509
|
-
{
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
516
|
+
sitemap: {
|
|
517
|
+
path: "../CoCreate-sitemap",
|
|
518
|
+
repo: "github.com/CoCreate-app/CoCreate-sitemap.git",
|
|
519
|
+
exclude: [
|
|
513
520
|
"fs/webpack"
|
|
514
521
|
]
|
|
515
522
|
},
|
|
516
|
-
{
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
523
|
+
"url-uploader": {
|
|
524
|
+
path: "../CoCreate-url-uploader",
|
|
525
|
+
repo: "github.com/CoCreate-app/CoCreate-url-uploader.git",
|
|
526
|
+
exclude: [
|
|
520
527
|
"fs/webpack"
|
|
521
528
|
]
|
|
522
529
|
},
|
|
523
|
-
{
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
530
|
+
usage: {
|
|
531
|
+
path: "../CoCreate-usage",
|
|
532
|
+
repo: "github.com/CoCreate-app/CoCreate-usage.git",
|
|
533
|
+
exclude: [
|
|
527
534
|
"fs/webpack"
|
|
528
535
|
]
|
|
529
536
|
},
|
|
530
|
-
{
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
537
|
+
webpack: {
|
|
538
|
+
path: "../../CoCreate-plugins/CoCreate-webpack",
|
|
539
|
+
repo: "github.com/CoCreate-app/CoCreate-webpack.git",
|
|
540
|
+
exclude: [
|
|
534
541
|
"fs/webpack"
|
|
535
542
|
]
|
|
536
543
|
}
|
|
537
|
-
|
|
538
|
-
"configPath": "/home/cocreate/CoCreate/CoCreate-modules/CoCreate-cli/CoCreate.config.js",
|
|
539
|
-
"filePath": "/home/cocreate/CoCreate/CoCreate-modules/CoCreate-cli/CoCreate.config.js",
|
|
544
|
+
},
|
|
540
545
|
"hideMessage": false
|
|
541
546
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.60.0",
|
|
4
4
|
"description": "Polyrepo management bash CLI tool. Run all git commands and yarn commands on multiple repositories. Also includes a few custom macros for cloning, installing, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
"coc": "src/coc.js"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@cocreate/
|
|
52
|
-
"@cocreate/config": "^1.
|
|
51
|
+
"@cocreate/certificates": "^1.7.0",
|
|
52
|
+
"@cocreate/config": "^1.17.0",
|
|
53
53
|
"@cocreate/file": "^1.23.0",
|
|
54
|
-
"@google/
|
|
54
|
+
"@google/genai": "2.15.0"
|
|
55
55
|
},
|
|
56
56
|
"allowScripts": {
|
|
57
|
-
"@cocreate/
|
|
57
|
+
"@cocreate/certificates@1.3.2": true,
|
|
58
58
|
"@cocreate/actions@1.21.4": true,
|
|
59
59
|
"@cocreate/api@1.22.5": true,
|
|
60
60
|
"@cocreate/config@1.13.4": true,
|
package/src/commands/acme.js
CHANGED
|
@@ -1,147 +1,145 @@
|
|
|
1
|
+
const { GoogleGenAI, Type } = require("@google/genai");
|
|
2
|
+
const Config = require("@cocreate/config");
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* It uses the Gemini API to translate and generate content based on the provided HTML and languages.
|
|
5
|
-
*
|
|
6
|
-
* Prerequisites:
|
|
7
|
-
* - Node.js installed on your system.
|
|
8
|
-
* - The Google Generative AI library installed:
|
|
9
|
-
* `npm install @google/generative-ai`
|
|
10
|
-
* - A valid Gemini API key.
|
|
11
|
-
*
|
|
12
|
-
* Usage:
|
|
13
|
-
* Import and call the `translateHtml` function with the HTML source, languages array, and options.
|
|
5
|
+
* Default Gemini model identifier used for language translation tasks.
|
|
6
|
+
* @type {string}
|
|
14
7
|
*/
|
|
8
|
+
const DEFAULT_MODEL = "gemini-2.5-flash-lite";
|
|
15
9
|
|
|
16
10
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* {
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* "name": "Basketball Betting Sportsbook | NBA, EuroLeague, NCAA & Global Leagues",
|
|
26
|
-
* "description": "Unlock premier basketball betting at Amapola Sportsbook. Get competitive odds for NBA, EuroLeague, NCAA, and global basketball. Enjoy live betting, swift payouts, and insightful picks for an unmatched wagering experience.",
|
|
27
|
-
* "url": "https://amapolacasino.com/sportsbook/basketball/",
|
|
28
|
-
* "image": "https://amapolacasino.com/assets/basketball-og.jpg",
|
|
29
|
-
* "author": {
|
|
30
|
-
* "@type": "Organization",
|
|
31
|
-
* "name": "AmapolaCasino"
|
|
32
|
-
* }
|
|
33
|
-
* },
|
|
34
|
-
* "es": { ... },
|
|
35
|
-
* "fr": { ... },
|
|
36
|
-
* "pt": { ... },
|
|
37
|
-
* "ht": { ... },
|
|
38
|
-
* "nl": { ... },
|
|
39
|
-
* "gn": { ... }
|
|
40
|
-
* }
|
|
41
|
-
* }
|
|
11
|
+
* Translation mapping for a single element's attributes and inner content.
|
|
12
|
+
* @typedef {Object} ElementTranslations
|
|
13
|
+
* @property {string|null} [text] - Inner text content or script payload.
|
|
14
|
+
* @property {string|null} [placeholder] - Input placeholder text.
|
|
15
|
+
* @property {string|null} [title] - Element title attribute.
|
|
16
|
+
* @property {string|null} [alt] - Image alternate text.
|
|
17
|
+
* @property {string|null} ["aria-label"] - ARIA accessibility label.
|
|
18
|
+
* @property {Record<string, string>} [additionalProperties] - Dynamic attributes (e.g., `aria-description`).
|
|
42
19
|
*/
|
|
43
20
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Key-value mapping of `i18n` keys to element translations for a specific language.
|
|
23
|
+
* @typedef {Record<string, ElementTranslations>} LanguageTranslations
|
|
24
|
+
*/
|
|
47
25
|
|
|
48
|
-
|
|
49
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Language-First dictionary structure mapping language codes (e.g., "en", "es") to their translations.
|
|
28
|
+
* @typedef {Record<string, LanguageTranslations>} LanguageFirstTranslationMap
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Configuration options for the HTML translation process.
|
|
33
|
+
* @typedef {Object} TranslateOptions
|
|
34
|
+
* @property {string} [apiKey] - Google GenAI API key. If omitted, attempts lookup via configuration service.
|
|
35
|
+
* @property {string} [model] - Gemini model name override (defaults to "gemini-2.5-flash-lite").
|
|
36
|
+
* @property {number} [temperature] - Model sampling temperature (defaults to 0.2).
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Resolves the Google GenAI API key from explicit options or global configuration.
|
|
41
|
+
*
|
|
42
|
+
* @async
|
|
43
|
+
* @param {TranslateOptions} options - Configuration options passed to the translator.
|
|
44
|
+
* @returns {Promise<string|undefined>} Resolved API key string or undefined if not found.
|
|
45
|
+
*/
|
|
50
46
|
async function getApiKey(options) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
});
|
|
57
|
-
return config.GoogleGenerativeAIApiKey;
|
|
47
|
+
if (options?.apiKey) return options.apiKey;
|
|
48
|
+
if (typeof Config?.get === "function") {
|
|
49
|
+
return await Config.get("GEMINI_API_KEY") || process.env.GEMINI_API_KEY;
|
|
50
|
+
}
|
|
51
|
+
return process.env.GEMINI_API_KEY;
|
|
58
52
|
}
|
|
59
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Analyzes HTML source code, extracts `i18n` elements and `<script type="application/ld+json">` data,
|
|
56
|
+
* and uses Google GenAI to synthesize a Language-First JSON translation dictionary.
|
|
57
|
+
*
|
|
58
|
+
* @async
|
|
59
|
+
* @param {string} html - Raw HTML source code string containing elements with `i18n` attributes.
|
|
60
|
+
* @param {string[]} languages - Array of target language codes (e.g., `["en", "es", "fr"]`).
|
|
61
|
+
* @param {TranslateOptions} [options={}] - Optional configuration parameters for model and authentication.
|
|
62
|
+
* @returns {Promise<LanguageFirstTranslationMap|null>} Language-First translation map, or `null` if generation fails.
|
|
63
|
+
* @throws {Error} Throws an error if no API key is provided or resolved.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* const translations = await translateHtml(
|
|
67
|
+
* '<h1 i18n="heading">Hello</h1><input i18n="search" placeholder="Search...">',
|
|
68
|
+
* ["es", "fr"]
|
|
69
|
+
* );
|
|
70
|
+
*/
|
|
60
71
|
module.exports = async function translateHtml(html, languages, options = {}) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
);
|
|
66
|
-
const genAI = new GoogleGenerativeAI(apiKey);
|
|
67
|
-
const model =
|
|
68
|
-
options.model || genAI.getGenerativeModel({ model: MODEL_NAME });
|
|
69
|
-
const translationObj = await generateTranslationObject(
|
|
70
|
-
html,
|
|
71
|
-
model,
|
|
72
|
-
languages
|
|
73
|
-
);
|
|
74
|
-
return translationObj;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
// Update generateTranslationObject to accept only html, model, languages
|
|
78
|
-
async function generateTranslationObject(html, model, languages) {
|
|
79
|
-
const langList = languages.map((l) => `"${l}"`).join(", ");
|
|
80
|
-
const prompt = `
|
|
81
|
-
You are an expert web localization AI. Given the following HTML file, extract all translatable content (titles, meta tags, headers, buttons, video/image alt/title, labels, aria-label, all aria-* attributes, and placeholders) and generate a JSON object in the following format:
|
|
72
|
+
const apiKey = await getApiKey(options);
|
|
73
|
+
if (!apiKey) {
|
|
74
|
+
throw new Error("Google GenAI API key is required for translateHtml.");
|
|
75
|
+
}
|
|
82
76
|
|
|
83
|
-
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"selector": "<css selector>",
|
|
87
|
-
"innerHTML": {
|
|
88
|
-
${languages
|
|
89
|
-
.map((l) => `\"${l}\"`)
|
|
90
|
-
.join(
|
|
91
|
-
", \
|
|
92
|
-
"
|
|
93
|
-
)}
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"selector": "<css selector>",
|
|
98
|
-
"attributes": {
|
|
99
|
-
"alt": { ${langList} },
|
|
100
|
-
"label": { ${langList} },
|
|
101
|
-
"aria-label": { ${langList} },
|
|
102
|
-
"aria-*": { ${langList} },
|
|
103
|
-
"title": { ${langList} },
|
|
104
|
-
"placeholder": { ${langList} }
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
// Example for structured data translation:
|
|
108
|
-
{
|
|
109
|
-
"selector": "script[type='application/ld+json']",
|
|
110
|
-
"innerHTML": {
|
|
111
|
-
"en": { "@context": "http://schema.org", "@type": "WebPage", "name": "English name", "description": "English description" },
|
|
112
|
-
"es": { "@context": "http://schema.org", "@type": "WebPage", "name": "Spanish name", "description": "Spanish description" },
|
|
113
|
-
"fr": { "@context": "http://schema.org", "@type": "WebPage", "name": "French name", "description": "French description" }
|
|
114
|
-
// ...other languages
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
// ...more selectors as needed
|
|
118
|
-
]
|
|
119
|
-
}
|
|
77
|
+
const ai = new GoogleGenAI({ apiKey });
|
|
78
|
+
const modelName = options.model || DEFAULT_MODEL;
|
|
79
|
+
const langList = Array.isArray(languages) ? languages.join(", ") : String(languages);
|
|
120
80
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
81
|
+
const prompt = `
|
|
82
|
+
You are an expert web localization AI.
|
|
83
|
+
Analyze the provided HTML and find all elements containing an "i18n" attribute, as well as any <script type="application/ld+json"> tags.
|
|
124
84
|
|
|
125
|
-
|
|
126
|
-
", "
|
|
127
|
-
)}. Do not leave any language blank. For Guarani (\"gn\"), always translate to Guarani and never leave it in English.
|
|
85
|
+
Target Languages: ${langList}
|
|
128
86
|
|
|
129
|
-
|
|
87
|
+
Instructions:
|
|
88
|
+
1. Extract translatable content for each "i18n" key (inner text, alt, title, placeholder, label, aria-label, and aria-* attributes).
|
|
89
|
+
2. For script[type='application/ld+json'], use the key "ld+json" or the element's "i18n" attribute, and translate string fields (like name, description) while keeping schema keywords (@context, @type, url) intact.
|
|
90
|
+
3. Organize the translations into a LANGUAGE-FIRST structure where top-level keys are the target language codes (${langList}).
|
|
91
|
+
4. Inside each language code object, map each "i18n" key to its translated properties (e.g., "text", "placeholder", "alt", "title", "aria-label").
|
|
92
|
+
5. Provide a full translation for EVERY target language requested. Never leave a requested language empty.
|
|
130
93
|
|
|
131
|
-
HTML:
|
|
94
|
+
HTML Source:
|
|
132
95
|
${html}
|
|
133
96
|
`;
|
|
134
97
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
98
|
+
/**
|
|
99
|
+
* JSON Schema enforcing structured Language-First output from Gemini.
|
|
100
|
+
* @type {import("@google/genai").Schema}
|
|
101
|
+
*/
|
|
102
|
+
const responseSchema = {
|
|
103
|
+
type: Type.OBJECT,
|
|
104
|
+
properties: {
|
|
105
|
+
translations: {
|
|
106
|
+
type: Type.OBJECT,
|
|
107
|
+
description: "Map of language codes (e.g., 'en', 'es') to key-value translation objects",
|
|
108
|
+
additionalProperties: {
|
|
109
|
+
type: Type.OBJECT,
|
|
110
|
+
description: "Map of i18n keys to element translation properties",
|
|
111
|
+
additionalProperties: {
|
|
112
|
+
type: Type.OBJECT,
|
|
113
|
+
properties: {
|
|
114
|
+
text: { type: Type.STRING, nullable: true },
|
|
115
|
+
placeholder: { type: Type.STRING, nullable: true },
|
|
116
|
+
title: { type: Type.STRING, nullable: true },
|
|
117
|
+
alt: { type: Type.STRING, nullable: true },
|
|
118
|
+
"aria-label": { type: Type.STRING, nullable: true }
|
|
119
|
+
},
|
|
120
|
+
additionalProperties: true
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
required: ["translations"]
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
try {
|
|
129
|
+
const response = await ai.models.generateContent({
|
|
130
|
+
model: modelName,
|
|
131
|
+
contents: prompt,
|
|
132
|
+
config: {
|
|
133
|
+
responseMimeType: "application/json",
|
|
134
|
+
responseSchema: responseSchema,
|
|
135
|
+
temperature: options.temperature ?? 0.2
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
const parsed = JSON.parse(response.text);
|
|
140
|
+
return parsed.translations;
|
|
141
|
+
} catch (err) {
|
|
142
|
+
console.error("Gemini Translation Error:", err);
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
};
|