@kopynator/cli 1.0.14 → 1.1.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/package.json +2 -1
- package/src/commands/sync.ts +10 -3
- package/src/index.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kopynator/cli",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "CLI tool for Kopynator - The i18n management solution",
|
|
5
5
|
"bin": {
|
|
6
6
|
"kopynator": "dist/index.js"
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"author": "Carlos Florio",
|
|
23
23
|
"license": "ISC",
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@kopynator/core": "^1.0.1",
|
|
25
26
|
"chalk": "^4.1.2",
|
|
26
27
|
"commander": "^11.1.0",
|
|
27
28
|
"inquirer": "^8.2.6",
|
package/src/commands/sync.ts
CHANGED
|
@@ -202,8 +202,11 @@ export async function syncCommand() {
|
|
|
202
202
|
// 1. Fetch available languages
|
|
203
203
|
spinner.text = '📡 Fetching available languages...';
|
|
204
204
|
const languagesUrl = `${baseUrl}/languages?token=${token}`;
|
|
205
|
-
const languagesResponse = await fetch(languagesUrl
|
|
206
|
-
|
|
205
|
+
const languagesResponse = await fetch(languagesUrl, {
|
|
206
|
+
headers: {
|
|
207
|
+
'x-kopynator-version': '1.1.0'
|
|
208
|
+
}
|
|
209
|
+
});
|
|
207
210
|
if (!languagesResponse.ok) {
|
|
208
211
|
spinner.fail(`Failed to fetch languages: ${languagesResponse.status} ${languagesResponse.statusText}`);
|
|
209
212
|
return;
|
|
@@ -225,7 +228,11 @@ export async function syncCommand() {
|
|
|
225
228
|
const fetchUrl = `${baseUrl}/fetch?token=${token}&langs=${locale}&nested=${syncConfig.nested}&includeLangKey=${syncConfig.includeLangKey}&pretty=${syncConfig.pretty}&indent=${syncConfig.indent}`;
|
|
226
229
|
|
|
227
230
|
try {
|
|
228
|
-
const translationResponse = await fetch(fetchUrl
|
|
231
|
+
const translationResponse = await fetch(fetchUrl, {
|
|
232
|
+
headers: {
|
|
233
|
+
'x-kopynator-version': '1.1.0'
|
|
234
|
+
}
|
|
235
|
+
});
|
|
229
236
|
|
|
230
237
|
if (!translationResponse.ok) {
|
|
231
238
|
downloadSpinner.warn(`Failed to fetch ${locale}: ${translationResponse.status}`);
|