@intlpullhq/cli 0.1.2 → 0.1.4
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 +50 -32
- package/dist/index.js +584 -537
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -124,7 +124,7 @@ function Header({ compact = false }) {
|
|
|
124
124
|
if (compact) {
|
|
125
125
|
return /* @__PURE__ */ jsxs(Box, { marginBottom: 1, children: [
|
|
126
126
|
/* @__PURE__ */ jsx(Text, { bold: true, color: colors.primary, children: "\u25C6 IntlPull" }),
|
|
127
|
-
/* @__PURE__ */ jsx(Text, { color: colors.textDim, children: " v0.1.
|
|
127
|
+
/* @__PURE__ */ jsx(Text, { color: colors.textDim, children: " v0.1.4" })
|
|
128
128
|
] });
|
|
129
129
|
}
|
|
130
130
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
@@ -456,7 +456,7 @@ function InitCommand({ options }) {
|
|
|
456
456
|
] });
|
|
457
457
|
}
|
|
458
458
|
function runInit(options) {
|
|
459
|
-
const isNonInteractive = options?.yes || options?.framework && options?.library;
|
|
459
|
+
const isNonInteractive = options?.yes || options?.framework && options?.library || !process.stdin.isTTY;
|
|
460
460
|
if (isNonInteractive) {
|
|
461
461
|
render(/* @__PURE__ */ jsx3(NonInteractiveInitCommand, { options }));
|
|
462
462
|
} else {
|
|
@@ -972,8 +972,10 @@ function getFileExtension(format) {
|
|
|
972
972
|
import { useState as useState4 } from "react";
|
|
973
973
|
import { Box as Box7, Text as Text8, useInput as useInput2 } from "ink";
|
|
974
974
|
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
975
|
-
|
|
975
|
+
var isInteractiveTerminal = process.stdin.isTTY && process.stdout.isTTY;
|
|
976
|
+
function MultiSelect({ items, selected, onToggle, onSubmit, isActive = true }) {
|
|
976
977
|
const [cursor, setCursor] = useState4(0);
|
|
978
|
+
const inputActive = isActive && isInteractiveTerminal;
|
|
977
979
|
useInput2((input, key) => {
|
|
978
980
|
if (key.upArrow) {
|
|
979
981
|
setCursor((c) => c > 0 ? c - 1 : items.length - 1);
|
|
@@ -988,7 +990,7 @@ function MultiSelect({ items, selected, onToggle, onSubmit }) {
|
|
|
988
990
|
if (!selected.has(item)) onToggle(item);
|
|
989
991
|
});
|
|
990
992
|
}
|
|
991
|
-
});
|
|
993
|
+
}, { isActive: inputActive });
|
|
992
994
|
return /* @__PURE__ */ jsxs8(Box7, { flexDirection: "column", children: [
|
|
993
995
|
items.map((item, i) => /* @__PURE__ */ jsxs8(Text8, { children: [
|
|
994
996
|
i === cursor ? "> " : " ",
|
|
@@ -2361,6 +2363,17 @@ function readAllTranslationsByLanguage(projectRoot = process.cwd()) {
|
|
|
2361
2363
|
|
|
2362
2364
|
// src/commands/push.tsx
|
|
2363
2365
|
import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2366
|
+
var isInteractiveTerminal2 = process.stdin.isTTY && process.stdout.isTTY;
|
|
2367
|
+
function ConfirmationInputHandler({ onConfirm, onCancel }) {
|
|
2368
|
+
useInput3((input, key) => {
|
|
2369
|
+
if (input.toLowerCase() === "y") {
|
|
2370
|
+
onConfirm();
|
|
2371
|
+
} else if (input.toLowerCase() === "n" || key.escape) {
|
|
2372
|
+
onCancel();
|
|
2373
|
+
}
|
|
2374
|
+
});
|
|
2375
|
+
return null;
|
|
2376
|
+
}
|
|
2364
2377
|
function PushComponent({ options }) {
|
|
2365
2378
|
const [state, setState] = React7.useState({
|
|
2366
2379
|
status: "checking",
|
|
@@ -3020,19 +3033,11 @@ To create this branch, go to the IntlPull dashboard or use: npx @intlpullhq/cli
|
|
|
3020
3033
|
{ keys: 0, inserted: 0, updated: 0, skipped: 0, languages: 1 }
|
|
3021
3034
|
);
|
|
3022
3035
|
const hasResults = state.allLanguages ? (state.languageResults?.length ?? 0) > 0 : state.namespaceResults.length > 0;
|
|
3023
|
-
|
|
3024
|
-
if (state.status === "waiting_confirmation") {
|
|
3025
|
-
|
|
3026
|
-
setState((prev) => ({ ...prev, userConfirmed: true }));
|
|
3027
|
-
} else if (input.toLowerCase() === "n" || key.escape) {
|
|
3028
|
-
setState((prev) => ({
|
|
3029
|
-
...prev,
|
|
3030
|
-
status: "error",
|
|
3031
|
-
error: "Upload cancelled by user. Upgrade your plan to upload all keys."
|
|
3032
|
-
}));
|
|
3033
|
-
}
|
|
3036
|
+
React7.useEffect(() => {
|
|
3037
|
+
if (!isInteractiveTerminal2 && state.status === "waiting_confirmation" && !state.userConfirmed) {
|
|
3038
|
+
setState((prev) => ({ ...prev, userConfirmed: true }));
|
|
3034
3039
|
}
|
|
3035
|
-
});
|
|
3040
|
+
}, [state.status, state.userConfirmed]);
|
|
3036
3041
|
React7.useEffect(() => {
|
|
3037
3042
|
if (state.status === "waiting_confirmation" && state.userConfirmed && state.limitExceeded && state.pushContext) {
|
|
3038
3043
|
const availableSlots = state.limitExceeded.availableSlots;
|
|
@@ -3217,8 +3222,19 @@ To create this branch, go to the IntlPull dashboard or use: npx @intlpullhq/cli
|
|
|
3217
3222
|
performLimitedPush();
|
|
3218
3223
|
}
|
|
3219
3224
|
}, [state.status, state.userConfirmed, state.limitExceeded, state.pushContext]);
|
|
3220
|
-
if (state.status === "waiting_confirmation" && state.limitExceeded) {
|
|
3225
|
+
if (state.status === "waiting_confirmation" && state.limitExceeded && isInteractiveTerminal2) {
|
|
3221
3226
|
return /* @__PURE__ */ jsxs11(Box10, { flexDirection: "column", children: [
|
|
3227
|
+
/* @__PURE__ */ jsx12(
|
|
3228
|
+
ConfirmationInputHandler,
|
|
3229
|
+
{
|
|
3230
|
+
onConfirm: () => setState((prev) => ({ ...prev, userConfirmed: true })),
|
|
3231
|
+
onCancel: () => setState((prev) => ({
|
|
3232
|
+
...prev,
|
|
3233
|
+
status: "error",
|
|
3234
|
+
error: "Upload cancelled by user. Upgrade your plan to upload all keys."
|
|
3235
|
+
}))
|
|
3236
|
+
}
|
|
3237
|
+
),
|
|
3222
3238
|
/* @__PURE__ */ jsx12(Box10, { marginBottom: 1, children: /* @__PURE__ */ jsx12(Text11, { color: "yellow", children: "\u26A0 Plan Limit Warning" }) }),
|
|
3223
3239
|
/* @__PURE__ */ jsxs11(Box10, { flexDirection: "column", marginLeft: 2, marginBottom: 1, children: [
|
|
3224
3240
|
/* @__PURE__ */ jsx12(Text11, { children: "Your upload would exceed your plan limit:" }),
|
|
@@ -3741,8 +3757,10 @@ async function resolveBranchId(apiUrl, apiKey, projectId, branchNameOrId) {
|
|
|
3741
3757
|
import React9, { useState as useState7 } from "react";
|
|
3742
3758
|
import { Box as Box12, Text as Text13, useInput as useInput4 } from "ink";
|
|
3743
3759
|
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3744
|
-
|
|
3760
|
+
var isInteractiveTerminal3 = process.stdin.isTTY && process.stdout.isTTY;
|
|
3761
|
+
function OptionToggle({ options, onToggle, onSubmit, isActive = true }) {
|
|
3745
3762
|
const [cursor, setCursor] = useState7(0);
|
|
3763
|
+
const inputActive = isActive && isInteractiveTerminal3;
|
|
3746
3764
|
useInput4((input, key) => {
|
|
3747
3765
|
if (key.upArrow) {
|
|
3748
3766
|
setCursor((c) => c > 0 ? c - 1 : options.length - 1);
|
|
@@ -3753,7 +3771,7 @@ function OptionToggle({ options, onToggle, onSubmit }) {
|
|
|
3753
3771
|
} else if (key.return) {
|
|
3754
3772
|
onSubmit();
|
|
3755
3773
|
}
|
|
3756
|
-
});
|
|
3774
|
+
}, { isActive: inputActive });
|
|
3757
3775
|
return /* @__PURE__ */ jsxs13(Box12, { flexDirection: "column", children: [
|
|
3758
3776
|
options.map((opt, i) => /* @__PURE__ */ jsxs13(Box12, { flexDirection: "column", children: [
|
|
3759
3777
|
/* @__PURE__ */ jsxs13(Text13, { children: [
|
|
@@ -4536,10 +4554,10 @@ function runImport(options) {
|
|
|
4536
4554
|
}
|
|
4537
4555
|
|
|
4538
4556
|
// src/commands/migrate.tsx
|
|
4539
|
-
import { render as render7 } from "ink";
|
|
4557
|
+
import { render as render7, Box as Box20, Text as Text21 } from "ink";
|
|
4540
4558
|
|
|
4541
4559
|
// src/commands/migrate/InteractiveMigrate.tsx
|
|
4542
|
-
import { useState as useState11 } from "react";
|
|
4560
|
+
import { useState as useState11, useEffect as useEffect8 } from "react";
|
|
4543
4561
|
import { Box as Box19, Text as Text20, useApp as useApp4 } from "ink";
|
|
4544
4562
|
|
|
4545
4563
|
// src/migrations/types.ts
|
|
@@ -5953,6 +5971,7 @@ var MIGRATION_OPTIONS_LIST = [
|
|
|
5953
5971
|
|
|
5954
5972
|
// src/commands/migrate/InputComponents.tsx
|
|
5955
5973
|
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5974
|
+
var isInteractiveTerminal4 = process.stdin.isTTY && process.stdout.isTTY;
|
|
5956
5975
|
function ProviderSelector({ onSelect }) {
|
|
5957
5976
|
const providers = getSupportedProviders();
|
|
5958
5977
|
return /* @__PURE__ */ jsxs17(Box16, { flexDirection: "column", children: [
|
|
@@ -6000,8 +6019,9 @@ function CredentialsInput({ provider, value, onChange, onSubmit }) {
|
|
|
6000
6019
|
/* @__PURE__ */ jsx19(Text17, { dimColor: true, children: "Press Enter to continue" })
|
|
6001
6020
|
] });
|
|
6002
6021
|
}
|
|
6003
|
-
function ProjectSelector({ projects: projects2, selected, onToggle, onSubmit }) {
|
|
6022
|
+
function ProjectSelector({ projects: projects2, selected, onToggle, onSubmit, isActive = true }) {
|
|
6004
6023
|
const [cursor, setCursor] = useState10(0);
|
|
6024
|
+
const inputActive = isActive && isInteractiveTerminal4;
|
|
6005
6025
|
useInput5((input, key) => {
|
|
6006
6026
|
if (key.upArrow) {
|
|
6007
6027
|
setCursor((c) => c > 0 ? c - 1 : projects2.length - 1);
|
|
@@ -6018,7 +6038,7 @@ function ProjectSelector({ projects: projects2, selected, onToggle, onSubmit })
|
|
|
6018
6038
|
onSubmit();
|
|
6019
6039
|
}
|
|
6020
6040
|
}
|
|
6021
|
-
});
|
|
6041
|
+
}, { isActive: inputActive });
|
|
6022
6042
|
return /* @__PURE__ */ jsxs17(Box16, { flexDirection: "column", children: [
|
|
6023
6043
|
/* @__PURE__ */ jsx19(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsxs17(Text17, { bold: true, children: [
|
|
6024
6044
|
"Select projects to migrate (",
|
|
@@ -6042,8 +6062,9 @@ function ProjectSelector({ projects: projects2, selected, onToggle, onSubmit })
|
|
|
6042
6062
|
/* @__PURE__ */ jsx19(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx19(Text17, { dimColor: true, children: "up/down navigate - space select - a all - enter confirm" }) })
|
|
6043
6063
|
] });
|
|
6044
6064
|
}
|
|
6045
|
-
function OptionsSelector({ options, onToggle, onSubmit }) {
|
|
6065
|
+
function OptionsSelector({ options, onToggle, onSubmit, isActive = true }) {
|
|
6046
6066
|
const [cursor, setCursor] = useState10(0);
|
|
6067
|
+
const inputActive = isActive && isInteractiveTerminal4;
|
|
6047
6068
|
useInput5((input, key) => {
|
|
6048
6069
|
if (key.upArrow) {
|
|
6049
6070
|
setCursor((c) => c > 0 ? c - 1 : MIGRATION_OPTIONS_LIST.length - 1);
|
|
@@ -6054,7 +6075,7 @@ function OptionsSelector({ options, onToggle, onSubmit }) {
|
|
|
6054
6075
|
} else if (key.return) {
|
|
6055
6076
|
onSubmit();
|
|
6056
6077
|
}
|
|
6057
|
-
});
|
|
6078
|
+
}, { isActive: inputActive });
|
|
6058
6079
|
return /* @__PURE__ */ jsxs17(Box16, { flexDirection: "column", children: [
|
|
6059
6080
|
/* @__PURE__ */ jsx19(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsx19(Text17, { bold: true, children: "Migration options:" }) }),
|
|
6060
6081
|
MIGRATION_OPTIONS_LIST.map((opt, i) => /* @__PURE__ */ jsxs17(Box16, { flexDirection: "column", children: [
|
|
@@ -6269,10 +6290,12 @@ function ConfirmStep({
|
|
|
6269
6290
|
|
|
6270
6291
|
// src/commands/migrate/InteractiveMigrate.tsx
|
|
6271
6292
|
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
6293
|
+
var isInteractiveTerminal5 = process.stdin.isTTY && process.stdout.isTTY;
|
|
6272
6294
|
function InteractiveMigrate({ initialOptions }) {
|
|
6273
6295
|
const { exit } = useApp4();
|
|
6296
|
+
const initialStep = initialOptions.from ? initialOptions.apiKey ? "validating" : "credentials" : "provider";
|
|
6274
6297
|
const [state, setState] = useState11({
|
|
6275
|
-
step:
|
|
6298
|
+
step: initialStep,
|
|
6276
6299
|
provider: initialOptions.from || null,
|
|
6277
6300
|
migrator: initialOptions.from ? createMigrator(initialOptions.from) : null,
|
|
6278
6301
|
credentials: null,
|
|
@@ -6286,6 +6309,11 @@ function InteractiveMigrate({ initialOptions }) {
|
|
|
6286
6309
|
error: null,
|
|
6287
6310
|
apiKey: initialOptions.apiKey || ""
|
|
6288
6311
|
});
|
|
6312
|
+
useEffect8(() => {
|
|
6313
|
+
if (initialStep === "validating" && state.migrator && state.apiKey) {
|
|
6314
|
+
validateCredentials(state.migrator, state.provider, state.apiKey, setState);
|
|
6315
|
+
}
|
|
6316
|
+
}, []);
|
|
6289
6317
|
const handleProviderSelect = (provider) => {
|
|
6290
6318
|
const migrator = createMigrator(provider);
|
|
6291
6319
|
setState((s) => ({
|
|
@@ -6379,20 +6407,39 @@ function InteractiveMigrate({ initialOptions }) {
|
|
|
6379
6407
|
}
|
|
6380
6408
|
|
|
6381
6409
|
// src/commands/migrate.tsx
|
|
6382
|
-
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
6410
|
+
import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
6411
|
+
var isInteractiveTerminal6 = process.stdin.isTTY && process.stdout.isTTY;
|
|
6412
|
+
function NonInteractiveError({ provider }) {
|
|
6413
|
+
return /* @__PURE__ */ jsxs21(Box20, { flexDirection: "column", padding: 1, children: [
|
|
6414
|
+
/* @__PURE__ */ jsx23(Text21, { color: "red", bold: true, children: "Error: Non-interactive mode requires --api-key" }),
|
|
6415
|
+
/* @__PURE__ */ jsx23(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx23(Text21, { children: "The migrate command requires interactive input for credentials." }) }),
|
|
6416
|
+
/* @__PURE__ */ jsxs21(Box20, { marginTop: 1, flexDirection: "column", children: [
|
|
6417
|
+
/* @__PURE__ */ jsx23(Text21, { children: "In CI/CD or non-interactive environments, provide the API key:" }),
|
|
6418
|
+
/* @__PURE__ */ jsxs21(Text21, { color: "cyan", children: [
|
|
6419
|
+
" npx @intlpullhq/cli migrate from ",
|
|
6420
|
+
provider || "<provider>",
|
|
6421
|
+
" --api-key YOUR_API_KEY"
|
|
6422
|
+
] })
|
|
6423
|
+
] })
|
|
6424
|
+
] });
|
|
6425
|
+
}
|
|
6383
6426
|
function runMigrate(options) {
|
|
6427
|
+
if (!isInteractiveTerminal6 && options.from && !options.apiKey) {
|
|
6428
|
+
render7(/* @__PURE__ */ jsx23(NonInteractiveError, { provider: options.from }));
|
|
6429
|
+
return;
|
|
6430
|
+
}
|
|
6384
6431
|
render7(/* @__PURE__ */ jsx23(InteractiveMigrate, { initialOptions: options }));
|
|
6385
6432
|
}
|
|
6386
6433
|
|
|
6387
6434
|
// src/commands/migrate-files.tsx
|
|
6388
|
-
import { useState as useState12, useEffect as
|
|
6389
|
-
import { render as render8, Box as
|
|
6435
|
+
import { useState as useState12, useEffect as useEffect9, useRef, useMemo } from "react";
|
|
6436
|
+
import { render as render8, Box as Box21, Text as Text22, useApp as useApp5, useInput as useInput6 } from "ink";
|
|
6390
6437
|
import TextInput2 from "ink-text-input";
|
|
6391
6438
|
import SelectInput6 from "ink-select-input";
|
|
6392
6439
|
import Spinner10 from "ink-spinner";
|
|
6393
6440
|
import { readFileSync as readFileSync5, existsSync as existsSync5, statSync as statSync3, readdirSync as readdirSync3 } from "fs";
|
|
6394
6441
|
import { join as join6, basename as basename5, extname as extname4, relative as relative2 } from "path";
|
|
6395
|
-
import { jsx as jsx24, jsxs as
|
|
6442
|
+
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
6396
6443
|
function countKeys2(content) {
|
|
6397
6444
|
try {
|
|
6398
6445
|
const data = JSON.parse(content);
|
|
@@ -6467,10 +6514,10 @@ function scanTranslationFiles(dir, pattern) {
|
|
|
6467
6514
|
function ProgressBar2({ progress, width = 20 }) {
|
|
6468
6515
|
const filled = Math.round(progress / 100 * width);
|
|
6469
6516
|
const empty = width - filled;
|
|
6470
|
-
return /* @__PURE__ */
|
|
6471
|
-
/* @__PURE__ */ jsx24(
|
|
6472
|
-
/* @__PURE__ */ jsx24(
|
|
6473
|
-
/* @__PURE__ */
|
|
6517
|
+
return /* @__PURE__ */ jsxs22(Text22, { children: [
|
|
6518
|
+
/* @__PURE__ */ jsx24(Text22, { color: "green", children: "\u2588".repeat(filled) }),
|
|
6519
|
+
/* @__PURE__ */ jsx24(Text22, { color: "gray", children: "\u2591".repeat(empty) }),
|
|
6520
|
+
/* @__PURE__ */ jsxs22(Text22, { color: "gray", children: [
|
|
6474
6521
|
" ",
|
|
6475
6522
|
progress,
|
|
6476
6523
|
"%"
|
|
@@ -6484,7 +6531,7 @@ function FileStatus({ status }) {
|
|
|
6484
6531
|
let details;
|
|
6485
6532
|
switch (uploadStatus) {
|
|
6486
6533
|
case "pending":
|
|
6487
|
-
icon = /* @__PURE__ */ jsx24(
|
|
6534
|
+
icon = /* @__PURE__ */ jsx24(Text22, { color: "gray", children: "\u25CB" });
|
|
6488
6535
|
color = "gray";
|
|
6489
6536
|
details = "waiting...";
|
|
6490
6537
|
break;
|
|
@@ -6494,25 +6541,25 @@ function FileStatus({ status }) {
|
|
|
6494
6541
|
details = "uploading...";
|
|
6495
6542
|
break;
|
|
6496
6543
|
case "success":
|
|
6497
|
-
icon = /* @__PURE__ */ jsx24(
|
|
6544
|
+
icon = /* @__PURE__ */ jsx24(Text22, { color: "green", children: "\u2713" });
|
|
6498
6545
|
color = "green";
|
|
6499
6546
|
details = result ? `${result.keys_inserted} new, ${result.keys_updated} updated` : "done";
|
|
6500
6547
|
break;
|
|
6501
6548
|
case "error":
|
|
6502
|
-
icon = /* @__PURE__ */ jsx24(
|
|
6549
|
+
icon = /* @__PURE__ */ jsx24(Text22, { color: "red", children: "\u2717" });
|
|
6503
6550
|
color = "red";
|
|
6504
6551
|
details = error || "failed";
|
|
6505
6552
|
break;
|
|
6506
6553
|
}
|
|
6507
|
-
return /* @__PURE__ */
|
|
6508
|
-
/* @__PURE__ */ jsx24(
|
|
6509
|
-
/* @__PURE__ */ jsx24(
|
|
6510
|
-
/* @__PURE__ */ jsx24(
|
|
6511
|
-
/* @__PURE__ */ jsx24(
|
|
6554
|
+
return /* @__PURE__ */ jsxs22(Box21, { children: [
|
|
6555
|
+
/* @__PURE__ */ jsx24(Box21, { width: 3, children: icon }),
|
|
6556
|
+
/* @__PURE__ */ jsx24(Box21, { width: 20, children: /* @__PURE__ */ jsx24(Text22, { color, children: file.filename }) }),
|
|
6557
|
+
/* @__PURE__ */ jsx24(Box21, { width: 8, children: /* @__PURE__ */ jsx24(Text22, { color: "cyan", children: file.language }) }),
|
|
6558
|
+
/* @__PURE__ */ jsx24(Box21, { width: 12, children: /* @__PURE__ */ jsxs22(Text22, { color: "gray", children: [
|
|
6512
6559
|
file.keyCount,
|
|
6513
6560
|
" keys"
|
|
6514
6561
|
] }) }),
|
|
6515
|
-
/* @__PURE__ */ jsx24(
|
|
6562
|
+
/* @__PURE__ */ jsx24(Text22, { color, children: details })
|
|
6516
6563
|
] });
|
|
6517
6564
|
}
|
|
6518
6565
|
function MigrationUI({
|
|
@@ -6537,7 +6584,7 @@ function MigrationUI({
|
|
|
6537
6584
|
const optionsConcurrency = options.concurrency || 5;
|
|
6538
6585
|
const isInteractive = !optionsYes && process.stdin.isTTY;
|
|
6539
6586
|
const api = useMemo(() => createApiClient(), []);
|
|
6540
|
-
|
|
6587
|
+
useEffect9(() => {
|
|
6541
6588
|
if (step !== "scanning" || hasScanned.current) return;
|
|
6542
6589
|
hasScanned.current = true;
|
|
6543
6590
|
const detected = scanTranslationFiles(path4, optionsPattern);
|
|
@@ -6581,7 +6628,7 @@ Make sure your files follow naming conventions like:
|
|
|
6581
6628
|
setStep("confirm-project");
|
|
6582
6629
|
}
|
|
6583
6630
|
}, [step, path4, optionsPattern, optionsYes, options.source, options.project]);
|
|
6584
|
-
|
|
6631
|
+
useEffect9(() => {
|
|
6585
6632
|
if (step !== "creating-project") return;
|
|
6586
6633
|
const createProjectAndLanguages = async () => {
|
|
6587
6634
|
try {
|
|
@@ -6620,7 +6667,7 @@ Make sure your files follow naming conventions like:
|
|
|
6620
6667
|
};
|
|
6621
6668
|
createProjectAndLanguages();
|
|
6622
6669
|
}, [step, api, files, projectName, sourceLanguage]);
|
|
6623
|
-
|
|
6670
|
+
useEffect9(() => {
|
|
6624
6671
|
if (step !== "uploading" || !project || hasStartedUpload.current) return;
|
|
6625
6672
|
hasStartedUpload.current = true;
|
|
6626
6673
|
const uploadFile = async (index) => {
|
|
@@ -6715,7 +6762,7 @@ Make sure your files follow naming conventions like:
|
|
|
6715
6762
|
}
|
|
6716
6763
|
}
|
|
6717
6764
|
}, { isActive: isInteractive });
|
|
6718
|
-
|
|
6765
|
+
useEffect9(() => {
|
|
6719
6766
|
if (!isInteractive && (step === "complete" || step === "error") && !hasExited.current) {
|
|
6720
6767
|
hasExited.current = true;
|
|
6721
6768
|
const timer = setTimeout(() => {
|
|
@@ -6728,16 +6775,16 @@ Make sure your files follow naming conventions like:
|
|
|
6728
6775
|
setStep("creating-project");
|
|
6729
6776
|
};
|
|
6730
6777
|
if (step === "error") {
|
|
6731
|
-
return /* @__PURE__ */
|
|
6732
|
-
/* @__PURE__ */ jsx24(
|
|
6733
|
-
/* @__PURE__ */ jsx24(
|
|
6734
|
-
isInteractive && /* @__PURE__ */ jsx24(
|
|
6778
|
+
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", padding: 1, children: [
|
|
6779
|
+
/* @__PURE__ */ jsx24(Text22, { color: "red", bold: true, children: "\u2717 Migration failed" }),
|
|
6780
|
+
/* @__PURE__ */ jsx24(Box21, { marginTop: 1, children: /* @__PURE__ */ jsx24(Text22, { color: "red", children: error }) }),
|
|
6781
|
+
isInteractive && /* @__PURE__ */ jsx24(Box21, { marginTop: 1, children: /* @__PURE__ */ jsx24(Text22, { color: "gray", dimColor: true, children: "Press Enter to exit" }) })
|
|
6735
6782
|
] });
|
|
6736
6783
|
}
|
|
6737
6784
|
if (step === "scanning") {
|
|
6738
|
-
return /* @__PURE__ */
|
|
6785
|
+
return /* @__PURE__ */ jsxs22(Box21, { padding: 1, children: [
|
|
6739
6786
|
/* @__PURE__ */ jsx24(Spinner10, { type: "dots" }),
|
|
6740
|
-
/* @__PURE__ */
|
|
6787
|
+
/* @__PURE__ */ jsxs22(Text22, { children: [
|
|
6741
6788
|
" Scanning for translation files in ",
|
|
6742
6789
|
path4,
|
|
6743
6790
|
"..."
|
|
@@ -6745,47 +6792,47 @@ Make sure your files follow naming conventions like:
|
|
|
6745
6792
|
] });
|
|
6746
6793
|
}
|
|
6747
6794
|
if (step === "confirm-project") {
|
|
6748
|
-
return /* @__PURE__ */
|
|
6749
|
-
/* @__PURE__ */
|
|
6750
|
-
/* @__PURE__ */ jsx24(
|
|
6751
|
-
optionsDryRun && /* @__PURE__ */ jsx24(
|
|
6795
|
+
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", padding: 1, children: [
|
|
6796
|
+
/* @__PURE__ */ jsxs22(Box21, { marginBottom: 1, children: [
|
|
6797
|
+
/* @__PURE__ */ jsx24(Text22, { bold: true, color: "cyan", children: "IntlPull Migration" }),
|
|
6798
|
+
optionsDryRun && /* @__PURE__ */ jsx24(Text22, { color: "yellow", children: " (dry run)" })
|
|
6752
6799
|
] }),
|
|
6753
|
-
/* @__PURE__ */ jsx24(
|
|
6800
|
+
/* @__PURE__ */ jsx24(Box21, { marginBottom: 1, children: /* @__PURE__ */ jsxs22(Text22, { color: "green", children: [
|
|
6754
6801
|
"Found ",
|
|
6755
6802
|
files.length,
|
|
6756
6803
|
" translation files:"
|
|
6757
6804
|
] }) }),
|
|
6758
|
-
/* @__PURE__ */
|
|
6759
|
-
files.slice(0, 8).map((f) => /* @__PURE__ */
|
|
6805
|
+
/* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", marginLeft: 2, marginBottom: 1, children: [
|
|
6806
|
+
files.slice(0, 8).map((f) => /* @__PURE__ */ jsxs22(Text22, { color: "gray", children: [
|
|
6760
6807
|
getLanguageFlag(f.language),
|
|
6761
6808
|
" ",
|
|
6762
6809
|
f.relativePath,
|
|
6763
6810
|
" ",
|
|
6764
|
-
/* @__PURE__ */
|
|
6811
|
+
/* @__PURE__ */ jsxs22(Text22, { dimColor: true, children: [
|
|
6765
6812
|
"(",
|
|
6766
6813
|
f.keyCount,
|
|
6767
6814
|
" keys)"
|
|
6768
6815
|
] })
|
|
6769
6816
|
] }, f.path)),
|
|
6770
|
-
files.length > 8 && /* @__PURE__ */
|
|
6817
|
+
files.length > 8 && /* @__PURE__ */ jsxs22(Text22, { color: "gray", dimColor: true, children: [
|
|
6771
6818
|
"...and ",
|
|
6772
6819
|
files.length - 8,
|
|
6773
6820
|
" more"
|
|
6774
6821
|
] })
|
|
6775
6822
|
] }),
|
|
6776
|
-
/* @__PURE__ */
|
|
6777
|
-
/* @__PURE__ */ jsx24(
|
|
6778
|
-
[...new Set(files.map((f) => f.language))].map((lang, i, arr) => /* @__PURE__ */
|
|
6779
|
-
/* @__PURE__ */
|
|
6823
|
+
/* @__PURE__ */ jsxs22(Box21, { marginBottom: 1, children: [
|
|
6824
|
+
/* @__PURE__ */ jsx24(Text22, { color: "yellow", children: "Languages: " }),
|
|
6825
|
+
[...new Set(files.map((f) => f.language))].map((lang, i, arr) => /* @__PURE__ */ jsxs22(Text22, { children: [
|
|
6826
|
+
/* @__PURE__ */ jsxs22(Text22, { color: "cyan", children: [
|
|
6780
6827
|
getLanguageFlag(lang),
|
|
6781
6828
|
" ",
|
|
6782
6829
|
lang
|
|
6783
6830
|
] }),
|
|
6784
|
-
i < arr.length - 1 && /* @__PURE__ */ jsx24(
|
|
6831
|
+
i < arr.length - 1 && /* @__PURE__ */ jsx24(Text22, { children: ", " })
|
|
6785
6832
|
] }, lang))
|
|
6786
6833
|
] }),
|
|
6787
|
-
/* @__PURE__ */
|
|
6788
|
-
/* @__PURE__ */ jsx24(
|
|
6834
|
+
/* @__PURE__ */ jsxs22(Box21, { marginTop: 1, marginBottom: 1, children: [
|
|
6835
|
+
/* @__PURE__ */ jsx24(Text22, { bold: true, children: "Project name: " }),
|
|
6789
6836
|
/* @__PURE__ */ jsx24(
|
|
6790
6837
|
TextInput2,
|
|
6791
6838
|
{
|
|
@@ -6796,7 +6843,7 @@ Make sure your files follow naming conventions like:
|
|
|
6796
6843
|
}
|
|
6797
6844
|
)
|
|
6798
6845
|
] }),
|
|
6799
|
-
/* @__PURE__ */ jsx24(
|
|
6846
|
+
/* @__PURE__ */ jsx24(Text22, { color: "gray", dimColor: true, children: "Press Enter to continue" })
|
|
6800
6847
|
] });
|
|
6801
6848
|
}
|
|
6802
6849
|
if (step === "confirm-source") {
|
|
@@ -6805,13 +6852,13 @@ Make sure your files follow naming conventions like:
|
|
|
6805
6852
|
label: formatLanguageDisplay(code, true),
|
|
6806
6853
|
value: code
|
|
6807
6854
|
}));
|
|
6808
|
-
return /* @__PURE__ */
|
|
6809
|
-
/* @__PURE__ */ jsx24(
|
|
6810
|
-
/* @__PURE__ */
|
|
6811
|
-
/* @__PURE__ */ jsx24(
|
|
6812
|
-
/* @__PURE__ */ jsx24(
|
|
6855
|
+
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", padding: 1, children: [
|
|
6856
|
+
/* @__PURE__ */ jsx24(Box21, { marginBottom: 1, children: /* @__PURE__ */ jsx24(Text22, { bold: true, color: "cyan", children: "IntlPull Migration" }) }),
|
|
6857
|
+
/* @__PURE__ */ jsxs22(Box21, { marginBottom: 1, children: [
|
|
6858
|
+
/* @__PURE__ */ jsx24(Text22, { children: "Project: " }),
|
|
6859
|
+
/* @__PURE__ */ jsx24(Text22, { bold: true, color: "white", children: projectName })
|
|
6813
6860
|
] }),
|
|
6814
|
-
/* @__PURE__ */ jsx24(
|
|
6861
|
+
/* @__PURE__ */ jsx24(Box21, { marginBottom: 1, children: /* @__PURE__ */ jsx24(Text22, { bold: true, children: "Select source/base language:" }) }),
|
|
6815
6862
|
/* @__PURE__ */ jsx24(
|
|
6816
6863
|
SelectInput6,
|
|
6817
6864
|
{
|
|
@@ -6826,9 +6873,9 @@ Make sure your files follow naming conventions like:
|
|
|
6826
6873
|
] });
|
|
6827
6874
|
}
|
|
6828
6875
|
if (step === "creating-project") {
|
|
6829
|
-
return /* @__PURE__ */
|
|
6876
|
+
return /* @__PURE__ */ jsxs22(Box21, { padding: 1, children: [
|
|
6830
6877
|
/* @__PURE__ */ jsx24(Spinner10, { type: "dots" }),
|
|
6831
|
-
/* @__PURE__ */
|
|
6878
|
+
/* @__PURE__ */ jsxs22(Text22, { children: [
|
|
6832
6879
|
' Creating project "',
|
|
6833
6880
|
projectName,
|
|
6834
6881
|
'"...'
|
|
@@ -6836,16 +6883,16 @@ Make sure your files follow naming conventions like:
|
|
|
6836
6883
|
] });
|
|
6837
6884
|
}
|
|
6838
6885
|
if (step === "creating-languages") {
|
|
6839
|
-
return /* @__PURE__ */
|
|
6886
|
+
return /* @__PURE__ */ jsxs22(Box21, { padding: 1, children: [
|
|
6840
6887
|
/* @__PURE__ */ jsx24(Spinner10, { type: "dots" }),
|
|
6841
|
-
/* @__PURE__ */ jsx24(
|
|
6888
|
+
/* @__PURE__ */ jsx24(Text22, { children: " Adding languages..." })
|
|
6842
6889
|
] });
|
|
6843
6890
|
}
|
|
6844
6891
|
if (step === "uploading" || step === "complete") {
|
|
6845
6892
|
if (uploadStatuses.length === 0) {
|
|
6846
|
-
return /* @__PURE__ */
|
|
6893
|
+
return /* @__PURE__ */ jsxs22(Box21, { padding: 1, children: [
|
|
6847
6894
|
/* @__PURE__ */ jsx24(Spinner10, { type: "dots" }),
|
|
6848
|
-
/* @__PURE__ */ jsx24(
|
|
6895
|
+
/* @__PURE__ */ jsx24(Text22, { children: " Preparing files for upload..." })
|
|
6849
6896
|
] });
|
|
6850
6897
|
}
|
|
6851
6898
|
const completed = uploadStatuses.filter(
|
|
@@ -6855,26 +6902,26 @@ Make sure your files follow naming conventions like:
|
|
|
6855
6902
|
const failed = uploadStatuses.filter((s) => s.status === "error").length;
|
|
6856
6903
|
const overallProgress = files.length > 0 ? Math.round(completed / files.length * 100) : 0;
|
|
6857
6904
|
const totalKeysImported = uploadStatuses.filter((s) => s.result).reduce((sum, s) => sum + (s.result?.keys_inserted || 0) + (s.result?.keys_updated || 0), 0);
|
|
6858
|
-
return /* @__PURE__ */
|
|
6859
|
-
/* @__PURE__ */
|
|
6860
|
-
/* @__PURE__ */ jsx24(
|
|
6861
|
-
optionsDryRun && /* @__PURE__ */ jsx24(
|
|
6905
|
+
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", padding: 1, children: [
|
|
6906
|
+
/* @__PURE__ */ jsxs22(Box21, { marginBottom: 1, children: [
|
|
6907
|
+
/* @__PURE__ */ jsx24(Text22, { bold: true, color: "cyan", children: "IntlPull Migration" }),
|
|
6908
|
+
optionsDryRun && /* @__PURE__ */ jsx24(Text22, { color: "yellow", children: " (dry run)" })
|
|
6862
6909
|
] }),
|
|
6863
|
-
/* @__PURE__ */
|
|
6864
|
-
/* @__PURE__ */ jsx24(
|
|
6865
|
-
/* @__PURE__ */ jsx24(
|
|
6866
|
-
/* @__PURE__ */
|
|
6910
|
+
/* @__PURE__ */ jsxs22(Box21, { marginBottom: 1, children: [
|
|
6911
|
+
/* @__PURE__ */ jsx24(Text22, { children: "Project: " }),
|
|
6912
|
+
/* @__PURE__ */ jsx24(Text22, { bold: true, color: "white", children: projectName }),
|
|
6913
|
+
/* @__PURE__ */ jsxs22(Text22, { color: "gray", children: [
|
|
6867
6914
|
" (source: ",
|
|
6868
6915
|
sourceLanguage,
|
|
6869
6916
|
")"
|
|
6870
6917
|
] })
|
|
6871
6918
|
] }),
|
|
6872
|
-
/* @__PURE__ */ jsx24(
|
|
6873
|
-
/* @__PURE__ */ jsx24(
|
|
6874
|
-
/* @__PURE__ */
|
|
6875
|
-
/* @__PURE__ */ jsx24(
|
|
6919
|
+
/* @__PURE__ */ jsx24(Box21, { marginBottom: 1, children: /* @__PURE__ */ jsx24(Text22, { bold: true, children: "Uploading translations:" }) }),
|
|
6920
|
+
/* @__PURE__ */ jsx24(Box21, { flexDirection: "column", marginLeft: 2, children: uploadStatuses.map((status, index) => status.file ? /* @__PURE__ */ jsx24(FileStatus, { status }, status.file.path) : /* @__PURE__ */ jsx24(Text22, { color: "gray", children: "Preparing..." }, index)) }),
|
|
6921
|
+
/* @__PURE__ */ jsxs22(Box21, { marginTop: 1, children: [
|
|
6922
|
+
/* @__PURE__ */ jsx24(Text22, { bold: true, children: "Overall: " }),
|
|
6876
6923
|
/* @__PURE__ */ jsx24(ProgressBar2, { progress: overallProgress }),
|
|
6877
|
-
/* @__PURE__ */
|
|
6924
|
+
/* @__PURE__ */ jsxs22(Text22, { color: "gray", children: [
|
|
6878
6925
|
" ",
|
|
6879
6926
|
"(",
|
|
6880
6927
|
completed,
|
|
@@ -6883,25 +6930,25 @@ Make sure your files follow naming conventions like:
|
|
|
6883
6930
|
" files)"
|
|
6884
6931
|
] })
|
|
6885
6932
|
] }),
|
|
6886
|
-
step === "complete" && /* @__PURE__ */
|
|
6887
|
-
/* @__PURE__ */ jsx24(
|
|
6888
|
-
/* @__PURE__ */
|
|
6889
|
-
/* @__PURE__ */
|
|
6933
|
+
step === "complete" && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", marginTop: 1, children: [
|
|
6934
|
+
/* @__PURE__ */ jsx24(Box21, { marginTop: 1, children: /* @__PURE__ */ jsx24(Text22, { color: "green", bold: true, children: "\u2713 Migration complete!" }) }),
|
|
6935
|
+
/* @__PURE__ */ jsxs22(Box21, { marginLeft: 2, flexDirection: "column", children: [
|
|
6936
|
+
/* @__PURE__ */ jsxs22(Text22, { color: "gray", children: [
|
|
6890
6937
|
successful,
|
|
6891
6938
|
" files uploaded, ",
|
|
6892
6939
|
totalKeysImported,
|
|
6893
6940
|
" keys imported"
|
|
6894
6941
|
] }),
|
|
6895
|
-
failed > 0 && /* @__PURE__ */
|
|
6942
|
+
failed > 0 && /* @__PURE__ */ jsxs22(Text22, { color: "red", children: [
|
|
6896
6943
|
failed,
|
|
6897
6944
|
" files failed"
|
|
6898
6945
|
] })
|
|
6899
6946
|
] }),
|
|
6900
|
-
!optionsDryRun && /* @__PURE__ */
|
|
6901
|
-
/* @__PURE__ */ jsx24(
|
|
6902
|
-
/* @__PURE__ */ jsx24(
|
|
6947
|
+
!optionsDryRun && /* @__PURE__ */ jsxs22(Box21, { marginTop: 1, children: [
|
|
6948
|
+
/* @__PURE__ */ jsx24(Text22, { color: "gray", children: "View your project at " }),
|
|
6949
|
+
/* @__PURE__ */ jsx24(Text22, { color: "cyan", children: "https://intlpull.com/dashboard" })
|
|
6903
6950
|
] }),
|
|
6904
|
-
isInteractive && /* @__PURE__ */ jsx24(
|
|
6951
|
+
isInteractive && /* @__PURE__ */ jsx24(Box21, { marginTop: 1, children: /* @__PURE__ */ jsx24(Text22, { color: "gray", dimColor: true, children: "Press Enter to exit" }) })
|
|
6905
6952
|
] })
|
|
6906
6953
|
] });
|
|
6907
6954
|
}
|
|
@@ -6922,10 +6969,10 @@ function runMigrateFiles(path4, options) {
|
|
|
6922
6969
|
}
|
|
6923
6970
|
|
|
6924
6971
|
// src/commands/compare.tsx
|
|
6925
|
-
import { useState as useState13, useEffect as
|
|
6926
|
-
import { render as render9, Box as
|
|
6972
|
+
import { useState as useState13, useEffect as useEffect10 } from "react";
|
|
6973
|
+
import { render as render9, Box as Box22, Text as Text23 } from "ink";
|
|
6927
6974
|
import Spinner11 from "ink-spinner";
|
|
6928
|
-
import { jsx as jsx25, jsxs as
|
|
6975
|
+
import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6929
6976
|
var COMPETITOR_PRICING = {
|
|
6930
6977
|
lokalise: {
|
|
6931
6978
|
name: "Lokalise",
|
|
@@ -7022,7 +7069,7 @@ function CompareDisplay({ options }) {
|
|
|
7022
7069
|
const [loading, setLoading] = useState13(true);
|
|
7023
7070
|
const [result, setResult] = useState13(null);
|
|
7024
7071
|
const [projectStats, setProjectStats] = useState13(null);
|
|
7025
|
-
|
|
7072
|
+
useEffect10(() => {
|
|
7026
7073
|
async function loadData() {
|
|
7027
7074
|
const config = getProjectConfig();
|
|
7028
7075
|
const resolved = getResolvedApiKey();
|
|
@@ -7071,103 +7118,103 @@ function CompareDisplay({ options }) {
|
|
|
7071
7118
|
loadData();
|
|
7072
7119
|
}, [options]);
|
|
7073
7120
|
if (loading) {
|
|
7074
|
-
return /* @__PURE__ */
|
|
7075
|
-
/* @__PURE__ */ jsx25(
|
|
7076
|
-
/* @__PURE__ */ jsx25(
|
|
7121
|
+
return /* @__PURE__ */ jsxs23(Box22, { children: [
|
|
7122
|
+
/* @__PURE__ */ jsx25(Text23, { color: "cyan", children: /* @__PURE__ */ jsx25(Spinner11, { type: "dots" }) }),
|
|
7123
|
+
/* @__PURE__ */ jsx25(Text23, { children: " Calculating cost comparison..." })
|
|
7077
7124
|
] });
|
|
7078
7125
|
}
|
|
7079
7126
|
if (!result) {
|
|
7080
|
-
return /* @__PURE__ */ jsx25(
|
|
7127
|
+
return /* @__PURE__ */ jsx25(Box22, { children: /* @__PURE__ */ jsx25(Text23, { color: "red", children: "Failed to calculate comparison" }) });
|
|
7081
7128
|
}
|
|
7082
7129
|
if (options.json) {
|
|
7083
|
-
return /* @__PURE__ */ jsx25(
|
|
7130
|
+
return /* @__PURE__ */ jsx25(Text23, { children: JSON.stringify(result, null, 2) });
|
|
7084
7131
|
}
|
|
7085
|
-
return /* @__PURE__ */
|
|
7086
|
-
/* @__PURE__ */
|
|
7087
|
-
/* @__PURE__ */ jsx25(
|
|
7088
|
-
/* @__PURE__ */ jsx25(
|
|
7132
|
+
return /* @__PURE__ */ jsxs23(Box22, { flexDirection: "column", paddingX: 1, children: [
|
|
7133
|
+
/* @__PURE__ */ jsxs23(Box22, { marginBottom: 1, children: [
|
|
7134
|
+
/* @__PURE__ */ jsx25(Text23, { bold: true, color: "cyan", children: "IntlPull" }),
|
|
7135
|
+
/* @__PURE__ */ jsx25(Text23, { children: " \u2022 Cost Comparison" })
|
|
7089
7136
|
] }),
|
|
7090
|
-
/* @__PURE__ */
|
|
7091
|
-
/* @__PURE__ */ jsx25(
|
|
7092
|
-
/* @__PURE__ */
|
|
7093
|
-
/* @__PURE__ */ jsx25(
|
|
7094
|
-
/* @__PURE__ */ jsx25(
|
|
7095
|
-
projectStats && /* @__PURE__ */ jsx25(
|
|
7137
|
+
/* @__PURE__ */ jsxs23(Box22, { marginBottom: 1, flexDirection: "column", children: [
|
|
7138
|
+
/* @__PURE__ */ jsx25(Text23, { bold: true, children: "Your Usage:" }),
|
|
7139
|
+
/* @__PURE__ */ jsxs23(Box22, { paddingLeft: 2, children: [
|
|
7140
|
+
/* @__PURE__ */ jsx25(Text23, { dimColor: true, children: "Keys: " }),
|
|
7141
|
+
/* @__PURE__ */ jsx25(Text23, { children: result.inputs.keys.toLocaleString() }),
|
|
7142
|
+
projectStats && /* @__PURE__ */ jsx25(Text23, { color: "green", children: " (from project)" })
|
|
7096
7143
|
] }),
|
|
7097
|
-
/* @__PURE__ */
|
|
7098
|
-
/* @__PURE__ */ jsx25(
|
|
7099
|
-
/* @__PURE__ */ jsx25(
|
|
7144
|
+
/* @__PURE__ */ jsxs23(Box22, { paddingLeft: 2, children: [
|
|
7145
|
+
/* @__PURE__ */ jsx25(Text23, { dimColor: true, children: "Languages: " }),
|
|
7146
|
+
/* @__PURE__ */ jsx25(Text23, { children: result.inputs.languages })
|
|
7100
7147
|
] }),
|
|
7101
|
-
/* @__PURE__ */
|
|
7102
|
-
/* @__PURE__ */ jsx25(
|
|
7103
|
-
/* @__PURE__ */ jsx25(
|
|
7148
|
+
/* @__PURE__ */ jsxs23(Box22, { paddingLeft: 2, children: [
|
|
7149
|
+
/* @__PURE__ */ jsx25(Text23, { dimColor: true, children: "Users: " }),
|
|
7150
|
+
/* @__PURE__ */ jsx25(Text23, { children: result.inputs.users })
|
|
7104
7151
|
] })
|
|
7105
7152
|
] }),
|
|
7106
|
-
/* @__PURE__ */ jsx25(
|
|
7107
|
-
/* @__PURE__ */
|
|
7108
|
-
/* @__PURE__ */ jsx25(
|
|
7109
|
-
/* @__PURE__ */
|
|
7153
|
+
/* @__PURE__ */ jsx25(Box22, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs23(Box22, { borderStyle: "single", flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
7154
|
+
/* @__PURE__ */ jsxs23(Box22, { marginBottom: 1, children: [
|
|
7155
|
+
/* @__PURE__ */ jsx25(Text23, { bold: true, color: "red", children: result.competitor.name }),
|
|
7156
|
+
/* @__PURE__ */ jsxs23(Text23, { children: [
|
|
7110
7157
|
" (",
|
|
7111
7158
|
result.competitor.tier,
|
|
7112
7159
|
" plan)"
|
|
7113
7160
|
] })
|
|
7114
7161
|
] }),
|
|
7115
|
-
/* @__PURE__ */
|
|
7116
|
-
/* @__PURE__ */ jsx25(
|
|
7117
|
-
/* @__PURE__ */ jsx25(
|
|
7162
|
+
/* @__PURE__ */ jsxs23(Box22, { paddingLeft: 2, children: [
|
|
7163
|
+
/* @__PURE__ */ jsx25(Text23, { dimColor: true, children: "Monthly: " }),
|
|
7164
|
+
/* @__PURE__ */ jsx25(Text23, { children: formatCurrency(result.competitor.monthly) })
|
|
7118
7165
|
] }),
|
|
7119
|
-
/* @__PURE__ */
|
|
7120
|
-
/* @__PURE__ */ jsx25(
|
|
7121
|
-
/* @__PURE__ */ jsx25(
|
|
7166
|
+
/* @__PURE__ */ jsxs23(Box22, { paddingLeft: 2, children: [
|
|
7167
|
+
/* @__PURE__ */ jsx25(Text23, { dimColor: true, children: "Annual: " }),
|
|
7168
|
+
/* @__PURE__ */ jsx25(Text23, { children: formatCurrency(result.competitor.annual) })
|
|
7122
7169
|
] }),
|
|
7123
|
-
/* @__PURE__ */ jsx25(
|
|
7124
|
-
/* @__PURE__ */
|
|
7125
|
-
/* @__PURE__ */ jsx25(
|
|
7126
|
-
/* @__PURE__ */
|
|
7170
|
+
/* @__PURE__ */ jsx25(Box22, { marginY: 1, children: /* @__PURE__ */ jsx25(Text23, { dimColor: true, children: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" }) }),
|
|
7171
|
+
/* @__PURE__ */ jsxs23(Box22, { marginBottom: 1, children: [
|
|
7172
|
+
/* @__PURE__ */ jsx25(Text23, { bold: true, color: "green", children: "IntlPull" }),
|
|
7173
|
+
/* @__PURE__ */ jsxs23(Text23, { children: [
|
|
7127
7174
|
" (",
|
|
7128
7175
|
result.intlpull.tier,
|
|
7129
7176
|
" plan)"
|
|
7130
7177
|
] })
|
|
7131
7178
|
] }),
|
|
7132
|
-
/* @__PURE__ */
|
|
7133
|
-
/* @__PURE__ */ jsx25(
|
|
7134
|
-
/* @__PURE__ */ jsx25(
|
|
7179
|
+
/* @__PURE__ */ jsxs23(Box22, { paddingLeft: 2, children: [
|
|
7180
|
+
/* @__PURE__ */ jsx25(Text23, { dimColor: true, children: "Monthly: " }),
|
|
7181
|
+
/* @__PURE__ */ jsx25(Text23, { color: "green", children: formatCurrency(result.intlpull.monthly) })
|
|
7135
7182
|
] }),
|
|
7136
|
-
/* @__PURE__ */
|
|
7137
|
-
/* @__PURE__ */ jsx25(
|
|
7138
|
-
/* @__PURE__ */ jsx25(
|
|
7183
|
+
/* @__PURE__ */ jsxs23(Box22, { paddingLeft: 2, children: [
|
|
7184
|
+
/* @__PURE__ */ jsx25(Text23, { dimColor: true, children: "Annual: " }),
|
|
7185
|
+
/* @__PURE__ */ jsx25(Text23, { color: "green", children: formatCurrency(result.intlpull.annual) })
|
|
7139
7186
|
] })
|
|
7140
7187
|
] }) }),
|
|
7141
|
-
result.savings.monthly > 0 && /* @__PURE__ */
|
|
7142
|
-
/* @__PURE__ */ jsx25(
|
|
7143
|
-
/* @__PURE__ */
|
|
7144
|
-
/* @__PURE__ */ jsx25(
|
|
7145
|
-
/* @__PURE__ */ jsx25(
|
|
7146
|
-
/* @__PURE__ */
|
|
7188
|
+
result.savings.monthly > 0 && /* @__PURE__ */ jsxs23(Box22, { marginBottom: 1, flexDirection: "column", children: [
|
|
7189
|
+
/* @__PURE__ */ jsx25(Text23, { bold: true, color: "green", children: "\u{1F4B0} Your Savings with IntlPull:" }),
|
|
7190
|
+
/* @__PURE__ */ jsxs23(Box22, { paddingLeft: 2, children: [
|
|
7191
|
+
/* @__PURE__ */ jsx25(Text23, { dimColor: true, children: "Monthly: " }),
|
|
7192
|
+
/* @__PURE__ */ jsx25(Text23, { color: "green", bold: true, children: formatCurrency(result.savings.monthly) }),
|
|
7193
|
+
/* @__PURE__ */ jsxs23(Text23, { dimColor: true, children: [
|
|
7147
7194
|
" (",
|
|
7148
7195
|
formatPercent(result.savings.percent),
|
|
7149
7196
|
" less)"
|
|
7150
7197
|
] })
|
|
7151
7198
|
] }),
|
|
7152
|
-
/* @__PURE__ */
|
|
7153
|
-
/* @__PURE__ */ jsx25(
|
|
7154
|
-
/* @__PURE__ */ jsx25(
|
|
7199
|
+
/* @__PURE__ */ jsxs23(Box22, { paddingLeft: 2, children: [
|
|
7200
|
+
/* @__PURE__ */ jsx25(Text23, { dimColor: true, children: "Annual: " }),
|
|
7201
|
+
/* @__PURE__ */ jsx25(Text23, { color: "green", bold: true, children: formatCurrency(result.savings.annual) })
|
|
7155
7202
|
] })
|
|
7156
7203
|
] }),
|
|
7157
|
-
/* @__PURE__ */
|
|
7158
|
-
/* @__PURE__ */ jsx25(
|
|
7159
|
-
/* @__PURE__ */
|
|
7160
|
-
/* @__PURE__ */ jsx25(
|
|
7161
|
-
/* @__PURE__ */ jsx25(
|
|
7162
|
-
/* @__PURE__ */ jsx25(
|
|
7163
|
-
/* @__PURE__ */ jsx25(
|
|
7164
|
-
/* @__PURE__ */ jsx25(
|
|
7165
|
-
/* @__PURE__ */ jsx25(
|
|
7204
|
+
/* @__PURE__ */ jsxs23(Box22, { marginBottom: 1, flexDirection: "column", children: [
|
|
7205
|
+
/* @__PURE__ */ jsx25(Text23, { bold: true, children: "What you get with IntlPull:" }),
|
|
7206
|
+
/* @__PURE__ */ jsxs23(Box22, { paddingLeft: 2, flexDirection: "column", children: [
|
|
7207
|
+
/* @__PURE__ */ jsx25(Text23, { color: "green", children: "\u2713 In-context editing (Chrome extension)" }),
|
|
7208
|
+
/* @__PURE__ */ jsx25(Text23, { color: "green", children: "\u2713 CLI with smart auto-detection" }),
|
|
7209
|
+
/* @__PURE__ */ jsx25(Text23, { color: "green", children: "\u2713 OTA updates for mobile apps" }),
|
|
7210
|
+
/* @__PURE__ */ jsx25(Text23, { color: "green", children: "\u2713 Git branch integration" }),
|
|
7211
|
+
/* @__PURE__ */ jsx25(Text23, { color: "green", children: "\u2713 AI-powered translation" }),
|
|
7212
|
+
/* @__PURE__ */ jsx25(Text23, { color: "green", children: "\u2713 No per-key overage charges" })
|
|
7166
7213
|
] })
|
|
7167
7214
|
] }),
|
|
7168
|
-
/* @__PURE__ */
|
|
7169
|
-
/* @__PURE__ */ jsx25(
|
|
7170
|
-
/* @__PURE__ */
|
|
7215
|
+
/* @__PURE__ */ jsxs23(Box22, { marginTop: 1, children: [
|
|
7216
|
+
/* @__PURE__ */ jsx25(Text23, { dimColor: true, children: "Ready to switch? Run: " }),
|
|
7217
|
+
/* @__PURE__ */ jsxs23(Text23, { color: "cyan", children: [
|
|
7171
7218
|
"npx @intlpullhq/cli migrate from ",
|
|
7172
7219
|
options.from || "lokalise"
|
|
7173
7220
|
] })
|
|
@@ -7177,7 +7224,7 @@ function CompareDisplay({ options }) {
|
|
|
7177
7224
|
function CompareAllProviders({ options }) {
|
|
7178
7225
|
const [loading, setLoading] = useState13(true);
|
|
7179
7226
|
const [results, setResults] = useState13([]);
|
|
7180
|
-
|
|
7227
|
+
useEffect10(() => {
|
|
7181
7228
|
const keys = options.keys || 5e3;
|
|
7182
7229
|
const users = options.users || 5;
|
|
7183
7230
|
const languages = options.languages || 3;
|
|
@@ -7209,74 +7256,74 @@ function CompareAllProviders({ options }) {
|
|
|
7209
7256
|
setLoading(false);
|
|
7210
7257
|
}, [options]);
|
|
7211
7258
|
if (loading) {
|
|
7212
|
-
return /* @__PURE__ */
|
|
7213
|
-
/* @__PURE__ */ jsx25(
|
|
7214
|
-
/* @__PURE__ */ jsx25(
|
|
7259
|
+
return /* @__PURE__ */ jsxs23(Box22, { children: [
|
|
7260
|
+
/* @__PURE__ */ jsx25(Text23, { color: "cyan", children: /* @__PURE__ */ jsx25(Spinner11, { type: "dots" }) }),
|
|
7261
|
+
/* @__PURE__ */ jsx25(Text23, { children: " Calculating cost comparison..." })
|
|
7215
7262
|
] });
|
|
7216
7263
|
}
|
|
7217
7264
|
if (options.json) {
|
|
7218
|
-
return /* @__PURE__ */ jsx25(
|
|
7265
|
+
return /* @__PURE__ */ jsx25(Text23, { children: JSON.stringify(results, null, 2) });
|
|
7219
7266
|
}
|
|
7220
7267
|
const intlpullCost = results[0]?.intlpull;
|
|
7221
|
-
return /* @__PURE__ */
|
|
7222
|
-
/* @__PURE__ */
|
|
7223
|
-
/* @__PURE__ */ jsx25(
|
|
7224
|
-
/* @__PURE__ */ jsx25(
|
|
7268
|
+
return /* @__PURE__ */ jsxs23(Box22, { flexDirection: "column", paddingX: 1, children: [
|
|
7269
|
+
/* @__PURE__ */ jsxs23(Box22, { marginBottom: 1, children: [
|
|
7270
|
+
/* @__PURE__ */ jsx25(Text23, { bold: true, color: "cyan", children: "IntlPull" }),
|
|
7271
|
+
/* @__PURE__ */ jsx25(Text23, { children: " \u2022 Cost Comparison" })
|
|
7225
7272
|
] }),
|
|
7226
|
-
/* @__PURE__ */
|
|
7227
|
-
/* @__PURE__ */ jsx25(
|
|
7228
|
-
/* @__PURE__ */
|
|
7273
|
+
/* @__PURE__ */ jsxs23(Box22, { marginBottom: 1, children: [
|
|
7274
|
+
/* @__PURE__ */ jsx25(Text23, { dimColor: true, children: "Comparing for: " }),
|
|
7275
|
+
/* @__PURE__ */ jsxs23(Text23, { children: [
|
|
7229
7276
|
results[0]?.inputs.keys.toLocaleString(),
|
|
7230
7277
|
" keys, "
|
|
7231
7278
|
] }),
|
|
7232
|
-
/* @__PURE__ */
|
|
7279
|
+
/* @__PURE__ */ jsxs23(Text23, { children: [
|
|
7233
7280
|
results[0]?.inputs.users,
|
|
7234
7281
|
" users, "
|
|
7235
7282
|
] }),
|
|
7236
|
-
/* @__PURE__ */
|
|
7283
|
+
/* @__PURE__ */ jsxs23(Text23, { children: [
|
|
7237
7284
|
results[0]?.inputs.languages,
|
|
7238
7285
|
" languages"
|
|
7239
7286
|
] })
|
|
7240
7287
|
] }),
|
|
7241
|
-
/* @__PURE__ */ jsx25(
|
|
7242
|
-
/* @__PURE__ */
|
|
7243
|
-
/* @__PURE__ */ jsx25(
|
|
7244
|
-
/* @__PURE__ */ jsx25(
|
|
7245
|
-
/* @__PURE__ */ jsx25(
|
|
7246
|
-
/* @__PURE__ */ jsx25(
|
|
7247
|
-
/* @__PURE__ */ jsx25(
|
|
7288
|
+
/* @__PURE__ */ jsx25(Box22, { marginBottom: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs23(Box22, { borderStyle: "single", flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
7289
|
+
/* @__PURE__ */ jsxs23(Box22, { marginBottom: 1, children: [
|
|
7290
|
+
/* @__PURE__ */ jsx25(Box22, { width: 15, children: /* @__PURE__ */ jsx25(Text23, { bold: true, children: "Provider" }) }),
|
|
7291
|
+
/* @__PURE__ */ jsx25(Box22, { width: 10, children: /* @__PURE__ */ jsx25(Text23, { bold: true, children: "Plan" }) }),
|
|
7292
|
+
/* @__PURE__ */ jsx25(Box22, { width: 12, children: /* @__PURE__ */ jsx25(Text23, { bold: true, children: "Monthly" }) }),
|
|
7293
|
+
/* @__PURE__ */ jsx25(Box22, { width: 12, children: /* @__PURE__ */ jsx25(Text23, { bold: true, children: "Annual" }) }),
|
|
7294
|
+
/* @__PURE__ */ jsx25(Box22, { width: 12, children: /* @__PURE__ */ jsx25(Text23, { bold: true, children: "Savings" }) })
|
|
7248
7295
|
] }),
|
|
7249
|
-
results.map((r, i) => /* @__PURE__ */
|
|
7250
|
-
/* @__PURE__ */ jsx25(
|
|
7251
|
-
/* @__PURE__ */ jsx25(
|
|
7252
|
-
/* @__PURE__ */ jsx25(
|
|
7253
|
-
/* @__PURE__ */ jsx25(
|
|
7254
|
-
/* @__PURE__ */ jsx25(
|
|
7296
|
+
results.map((r, i) => /* @__PURE__ */ jsxs23(Box22, { children: [
|
|
7297
|
+
/* @__PURE__ */ jsx25(Box22, { width: 15, children: /* @__PURE__ */ jsx25(Text23, { color: "red", children: r.competitor.name }) }),
|
|
7298
|
+
/* @__PURE__ */ jsx25(Box22, { width: 10, children: /* @__PURE__ */ jsx25(Text23, { children: r.competitor.tier }) }),
|
|
7299
|
+
/* @__PURE__ */ jsx25(Box22, { width: 12, children: /* @__PURE__ */ jsx25(Text23, { children: formatCurrency(r.competitor.monthly) }) }),
|
|
7300
|
+
/* @__PURE__ */ jsx25(Box22, { width: 12, children: /* @__PURE__ */ jsx25(Text23, { children: formatCurrency(r.competitor.annual) }) }),
|
|
7301
|
+
/* @__PURE__ */ jsx25(Box22, { width: 12, children: /* @__PURE__ */ jsx25(Text23, { color: "green", children: r.savings.monthly > 0 ? formatPercent(r.savings.percent) : "-" }) })
|
|
7255
7302
|
] }, i)),
|
|
7256
|
-
/* @__PURE__ */ jsx25(
|
|
7257
|
-
/* @__PURE__ */
|
|
7258
|
-
/* @__PURE__ */ jsx25(
|
|
7259
|
-
/* @__PURE__ */ jsx25(
|
|
7260
|
-
/* @__PURE__ */ jsx25(
|
|
7261
|
-
/* @__PURE__ */ jsx25(
|
|
7262
|
-
/* @__PURE__ */ jsx25(
|
|
7303
|
+
/* @__PURE__ */ jsx25(Box22, { marginY: 1, children: /* @__PURE__ */ jsx25(Text23, { dimColor: true, children: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" }) }),
|
|
7304
|
+
/* @__PURE__ */ jsxs23(Box22, { children: [
|
|
7305
|
+
/* @__PURE__ */ jsx25(Box22, { width: 15, children: /* @__PURE__ */ jsx25(Text23, { color: "green", bold: true, children: "IntlPull" }) }),
|
|
7306
|
+
/* @__PURE__ */ jsx25(Box22, { width: 10, children: /* @__PURE__ */ jsx25(Text23, { children: intlpullCost?.tier }) }),
|
|
7307
|
+
/* @__PURE__ */ jsx25(Box22, { width: 12, children: /* @__PURE__ */ jsx25(Text23, { color: "green", bold: true, children: formatCurrency(intlpullCost?.monthly || 0) }) }),
|
|
7308
|
+
/* @__PURE__ */ jsx25(Box22, { width: 12, children: /* @__PURE__ */ jsx25(Text23, { color: "green", bold: true, children: formatCurrency(intlpullCost?.annual || 0) }) }),
|
|
7309
|
+
/* @__PURE__ */ jsx25(Box22, { width: 12, children: /* @__PURE__ */ jsx25(Text23, { color: "green", bold: true, children: "Best" }) })
|
|
7263
7310
|
] })
|
|
7264
7311
|
] }) }),
|
|
7265
|
-
/* @__PURE__ */
|
|
7266
|
-
/* @__PURE__ */ jsx25(
|
|
7267
|
-
/* @__PURE__ */
|
|
7312
|
+
/* @__PURE__ */ jsxs23(Box22, { marginBottom: 1, children: [
|
|
7313
|
+
/* @__PURE__ */ jsx25(Text23, { children: "\u{1F4B0} Save up to " }),
|
|
7314
|
+
/* @__PURE__ */ jsxs23(Text23, { color: "green", bold: true, children: [
|
|
7268
7315
|
formatCurrency(Math.max(...results.map((r) => r.savings.annual))),
|
|
7269
7316
|
"/year"
|
|
7270
7317
|
] }),
|
|
7271
|
-
/* @__PURE__ */ jsx25(
|
|
7318
|
+
/* @__PURE__ */ jsx25(Text23, { children: " by switching to IntlPull" })
|
|
7272
7319
|
] }),
|
|
7273
|
-
/* @__PURE__ */
|
|
7274
|
-
/* @__PURE__ */ jsx25(
|
|
7275
|
-
/* @__PURE__ */ jsx25(
|
|
7320
|
+
/* @__PURE__ */ jsxs23(Box22, { marginTop: 1, children: [
|
|
7321
|
+
/* @__PURE__ */ jsx25(Text23, { dimColor: true, children: "Ready to switch? Run: " }),
|
|
7322
|
+
/* @__PURE__ */ jsx25(Text23, { color: "cyan", children: "npx @intlpullhq/cli migrate from <provider>" })
|
|
7276
7323
|
] }),
|
|
7277
|
-
/* @__PURE__ */
|
|
7278
|
-
/* @__PURE__ */ jsx25(
|
|
7279
|
-
/* @__PURE__ */ jsx25(
|
|
7324
|
+
/* @__PURE__ */ jsxs23(Box22, { marginTop: 1, children: [
|
|
7325
|
+
/* @__PURE__ */ jsx25(Text23, { dimColor: true, children: "Compare with your usage: " }),
|
|
7326
|
+
/* @__PURE__ */ jsx25(Text23, { color: "cyan", children: "npx @intlpullhq/cli compare --keys 10000 --users 10" })
|
|
7280
7327
|
] })
|
|
7281
7328
|
] });
|
|
7282
7329
|
}
|
|
@@ -7289,28 +7336,28 @@ function runCompare(options) {
|
|
|
7289
7336
|
}
|
|
7290
7337
|
|
|
7291
7338
|
// src/commands/check.tsx
|
|
7292
|
-
import { useState as useState14, useEffect as
|
|
7293
|
-
import { render as render10, Box as
|
|
7339
|
+
import { useState as useState14, useEffect as useEffect11 } from "react";
|
|
7340
|
+
import { render as render10, Box as Box24, Text as Text25 } from "ink";
|
|
7294
7341
|
import { glob } from "glob";
|
|
7295
7342
|
import { readFileSync as readFileSync6 } from "fs";
|
|
7296
7343
|
|
|
7297
7344
|
// src/components/TaskList.tsx
|
|
7298
|
-
import { Box as
|
|
7299
|
-
import { jsx as jsx26, jsxs as
|
|
7345
|
+
import { Box as Box23, Text as Text24 } from "ink";
|
|
7346
|
+
import { jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
7300
7347
|
function getStatusIcon(status) {
|
|
7301
7348
|
switch (status) {
|
|
7302
7349
|
case "pending":
|
|
7303
|
-
return /* @__PURE__ */ jsx26(
|
|
7350
|
+
return /* @__PURE__ */ jsx26(Text24, { color: colors.textDim, children: icons.pending });
|
|
7304
7351
|
case "running":
|
|
7305
7352
|
return /* @__PURE__ */ jsx26(Spinner, { type: "dots", color: colors.primary });
|
|
7306
7353
|
case "success":
|
|
7307
|
-
return /* @__PURE__ */ jsx26(
|
|
7354
|
+
return /* @__PURE__ */ jsx26(Text24, { color: colors.success, children: icons.success });
|
|
7308
7355
|
case "error":
|
|
7309
|
-
return /* @__PURE__ */ jsx26(
|
|
7356
|
+
return /* @__PURE__ */ jsx26(Text24, { color: colors.error, children: icons.error });
|
|
7310
7357
|
case "warning":
|
|
7311
|
-
return /* @__PURE__ */ jsx26(
|
|
7358
|
+
return /* @__PURE__ */ jsx26(Text24, { color: colors.warning, children: icons.warning });
|
|
7312
7359
|
case "skipped":
|
|
7313
|
-
return /* @__PURE__ */ jsx26(
|
|
7360
|
+
return /* @__PURE__ */ jsx26(Text24, { color: colors.textDim, children: icons.skipped });
|
|
7314
7361
|
}
|
|
7315
7362
|
}
|
|
7316
7363
|
function getStatusColor(status) {
|
|
@@ -7330,20 +7377,20 @@ function getStatusColor(status) {
|
|
|
7330
7377
|
}
|
|
7331
7378
|
}
|
|
7332
7379
|
function TaskList({ tasks, title }) {
|
|
7333
|
-
return /* @__PURE__ */
|
|
7334
|
-
title && /* @__PURE__ */ jsx26(
|
|
7335
|
-
tasks.map((task) => /* @__PURE__ */
|
|
7336
|
-
/* @__PURE__ */ jsx26(
|
|
7337
|
-
/* @__PURE__ */
|
|
7338
|
-
/* @__PURE__ */ jsx26(
|
|
7339
|
-
task.output && task.status !== "pending" && /* @__PURE__ */ jsx26(
|
|
7380
|
+
return /* @__PURE__ */ jsxs24(Box23, { flexDirection: "column", marginY: 1, children: [
|
|
7381
|
+
title && /* @__PURE__ */ jsx26(Box23, { marginBottom: 1, children: /* @__PURE__ */ jsx26(Text24, { bold: true, color: colors.text, children: title }) }),
|
|
7382
|
+
tasks.map((task) => /* @__PURE__ */ jsxs24(Box23, { marginLeft: 1, children: [
|
|
7383
|
+
/* @__PURE__ */ jsx26(Box23, { width: 3, children: getStatusIcon(task.status) }),
|
|
7384
|
+
/* @__PURE__ */ jsxs24(Box23, { flexDirection: "column", children: [
|
|
7385
|
+
/* @__PURE__ */ jsx26(Text24, { color: getStatusColor(task.status), children: task.label }),
|
|
7386
|
+
task.output && task.status !== "pending" && /* @__PURE__ */ jsx26(Text24, { color: colors.textDim, dimColor: true, children: task.output })
|
|
7340
7387
|
] })
|
|
7341
7388
|
] }, task.id))
|
|
7342
7389
|
] });
|
|
7343
7390
|
}
|
|
7344
7391
|
|
|
7345
7392
|
// src/commands/check.tsx
|
|
7346
|
-
import { jsx as jsx27, jsxs as
|
|
7393
|
+
import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
7347
7394
|
function CheckCommand({ options }) {
|
|
7348
7395
|
const [tasks, setTasks] = useState14([
|
|
7349
7396
|
{ id: "config", label: "Loading configuration", status: "pending" },
|
|
@@ -7359,7 +7406,7 @@ function CheckCommand({ options }) {
|
|
|
7359
7406
|
(prev) => prev.map((t) => t.id === id ? { ...t, ...update } : t)
|
|
7360
7407
|
);
|
|
7361
7408
|
};
|
|
7362
|
-
|
|
7409
|
+
useEffect11(() => {
|
|
7363
7410
|
async function run() {
|
|
7364
7411
|
try {
|
|
7365
7412
|
updateTask("config", { status: "running" });
|
|
@@ -7508,51 +7555,51 @@ ${parseErrors.join("\n")}`);
|
|
|
7508
7555
|
}
|
|
7509
7556
|
run();
|
|
7510
7557
|
}, [options]);
|
|
7511
|
-
return /* @__PURE__ */
|
|
7558
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", children: [
|
|
7512
7559
|
/* @__PURE__ */ jsx27(Header, { compact: true }),
|
|
7513
7560
|
/* @__PURE__ */ jsx27(TaskList, { tasks, title: "Checking translations" }),
|
|
7514
7561
|
error && /* @__PURE__ */ jsx27(Alert, { type: "error", title: "Error", children: error }),
|
|
7515
|
-
done && result && /* @__PURE__ */
|
|
7516
|
-
result.missingKeys.length === 0 ? /* @__PURE__ */
|
|
7562
|
+
done && result && /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", marginTop: 1, children: [
|
|
7563
|
+
result.missingKeys.length === 0 ? /* @__PURE__ */ jsxs25(Alert, { type: "success", title: "All translations complete", children: [
|
|
7517
7564
|
result.totalKeys,
|
|
7518
7565
|
" keys are translated in all ",
|
|
7519
7566
|
result.targetLanguages.length,
|
|
7520
7567
|
" language(s)"
|
|
7521
|
-
] }) : /* @__PURE__ */
|
|
7568
|
+
] }) : /* @__PURE__ */ jsxs25(Alert, { type: "warning", title: "Missing translations found", children: [
|
|
7522
7569
|
result.missingKeys.length,
|
|
7523
7570
|
" key(s) missing across target languages"
|
|
7524
7571
|
] }),
|
|
7525
|
-
/* @__PURE__ */
|
|
7526
|
-
/* @__PURE__ */ jsx27(
|
|
7527
|
-
Object.entries(result.coveragePercentage).map(([lang, pct]) => /* @__PURE__ */
|
|
7528
|
-
/* @__PURE__ */ jsx27(
|
|
7529
|
-
/* @__PURE__ */
|
|
7572
|
+
/* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", marginTop: 1, children: [
|
|
7573
|
+
/* @__PURE__ */ jsx27(Text25, { bold: true, color: colors.text, children: "Coverage:" }),
|
|
7574
|
+
Object.entries(result.coveragePercentage).map(([lang, pct]) => /* @__PURE__ */ jsxs25(Box24, { marginLeft: 2, children: [
|
|
7575
|
+
/* @__PURE__ */ jsx27(Text25, { color: pct === 100 ? colors.success : pct >= 80 ? colors.warning : colors.error, children: pct === 100 ? icons.success : icons.warning }),
|
|
7576
|
+
/* @__PURE__ */ jsxs25(Text25, { color: colors.textMuted, children: [
|
|
7530
7577
|
" ",
|
|
7531
7578
|
lang,
|
|
7532
7579
|
": ",
|
|
7533
|
-
/* @__PURE__ */
|
|
7580
|
+
/* @__PURE__ */ jsxs25(Text25, { color: pct === 100 ? colors.success : colors.text, children: [
|
|
7534
7581
|
pct,
|
|
7535
7582
|
"%"
|
|
7536
7583
|
] })
|
|
7537
7584
|
] })
|
|
7538
7585
|
] }, lang))
|
|
7539
7586
|
] }),
|
|
7540
|
-
result.missingKeys.length > 0 && /* @__PURE__ */
|
|
7541
|
-
/* @__PURE__ */ jsx27(
|
|
7542
|
-
result.missingKeys.map((mk, i) => /* @__PURE__ */
|
|
7543
|
-
/* @__PURE__ */
|
|
7587
|
+
result.missingKeys.length > 0 && /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", marginTop: 1, children: [
|
|
7588
|
+
/* @__PURE__ */ jsx27(Text25, { bold: true, color: colors.text, children: "Missing keys (first 10):" }),
|
|
7589
|
+
result.missingKeys.map((mk, i) => /* @__PURE__ */ jsxs25(Box24, { marginLeft: 2, flexDirection: "column", children: [
|
|
7590
|
+
/* @__PURE__ */ jsxs25(Text25, { color: colors.error, children: [
|
|
7544
7591
|
"\u2022 ",
|
|
7545
7592
|
mk.key
|
|
7546
7593
|
] }),
|
|
7547
|
-
/* @__PURE__ */ jsx27(
|
|
7594
|
+
/* @__PURE__ */ jsx27(Box24, { marginLeft: 2, children: /* @__PURE__ */ jsxs25(Text25, { color: colors.textMuted, children: [
|
|
7548
7595
|
"Missing in: ",
|
|
7549
7596
|
mk.missingIn.join(", ")
|
|
7550
7597
|
] }) })
|
|
7551
7598
|
] }, i))
|
|
7552
7599
|
] }),
|
|
7553
|
-
/* @__PURE__ */ jsx27(
|
|
7600
|
+
/* @__PURE__ */ jsx27(Box24, { marginTop: 1, children: /* @__PURE__ */ jsxs25(Text25, { color: colors.textMuted, children: [
|
|
7554
7601
|
"Run ",
|
|
7555
|
-
/* @__PURE__ */ jsx27(
|
|
7602
|
+
/* @__PURE__ */ jsx27(Text25, { color: colors.primary, children: "npx @intlpullhq/cli fix" }),
|
|
7556
7603
|
" to auto-generate missing translations"
|
|
7557
7604
|
] }) })
|
|
7558
7605
|
] })
|
|
@@ -7573,10 +7620,10 @@ function runCheck(options) {
|
|
|
7573
7620
|
}
|
|
7574
7621
|
|
|
7575
7622
|
// src/commands/diff.tsx
|
|
7576
|
-
import { useState as useState15, useEffect as
|
|
7577
|
-
import { render as render11, Box as
|
|
7623
|
+
import { useState as useState15, useEffect as useEffect12 } from "react";
|
|
7624
|
+
import { render as render11, Box as Box25, Text as Text26 } from "ink";
|
|
7578
7625
|
import { readFileSync as readFileSync7, existsSync as existsSync7 } from "fs";
|
|
7579
|
-
import { jsx as jsx28, jsxs as
|
|
7626
|
+
import { jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
7580
7627
|
async function fetchProjects5(apiUrl, apiKey) {
|
|
7581
7628
|
const response = await fetch(`${apiUrl}/api/v1/projects`, {
|
|
7582
7629
|
headers: { Accept: "application/json", "X-API-Key": apiKey }
|
|
@@ -7607,7 +7654,7 @@ function DiffCommand({ options }) {
|
|
|
7607
7654
|
(prev) => prev.map((t) => t.id === id ? { ...t, ...update } : t)
|
|
7608
7655
|
);
|
|
7609
7656
|
};
|
|
7610
|
-
|
|
7657
|
+
useEffect12(() => {
|
|
7611
7658
|
async function run() {
|
|
7612
7659
|
try {
|
|
7613
7660
|
updateTask("config", { status: "running" });
|
|
@@ -7728,12 +7775,12 @@ Or use a project-scoped API key for automatic selection.`
|
|
|
7728
7775
|
}
|
|
7729
7776
|
run();
|
|
7730
7777
|
}, [options.source, options.target]);
|
|
7731
|
-
return /* @__PURE__ */
|
|
7778
|
+
return /* @__PURE__ */ jsxs26(Box25, { flexDirection: "column", children: [
|
|
7732
7779
|
/* @__PURE__ */ jsx28(Header, { compact: true }),
|
|
7733
7780
|
/* @__PURE__ */ jsx28(TaskList, { tasks, title: "Computing diff" }),
|
|
7734
7781
|
error && /* @__PURE__ */ jsx28(Alert, { type: "error", title: "Error", children: error }),
|
|
7735
|
-
done && result && /* @__PURE__ */
|
|
7736
|
-
result.total === 0 ? /* @__PURE__ */ jsx28(Alert, { type: "success", title: "No changes", children: "Local files match IntlPull" }) : /* @__PURE__ */
|
|
7782
|
+
done && result && /* @__PURE__ */ jsxs26(Box25, { flexDirection: "column", marginTop: 1, children: [
|
|
7783
|
+
result.total === 0 ? /* @__PURE__ */ jsx28(Alert, { type: "success", title: "No changes", children: "Local files match IntlPull" }) : /* @__PURE__ */ jsxs26(Alert, { type: "info", title: "Changes detected", children: [
|
|
7737
7784
|
result.added.length,
|
|
7738
7785
|
" new locally, ",
|
|
7739
7786
|
result.removed.length,
|
|
@@ -7741,79 +7788,79 @@ Or use a project-scoped API key for automatic selection.`
|
|
|
7741
7788
|
result.changed.length,
|
|
7742
7789
|
" modified"
|
|
7743
7790
|
] }),
|
|
7744
|
-
result.added.length > 0 && /* @__PURE__ */
|
|
7745
|
-
/* @__PURE__ */
|
|
7791
|
+
result.added.length > 0 && /* @__PURE__ */ jsxs26(Box25, { flexDirection: "column", marginTop: 1, children: [
|
|
7792
|
+
/* @__PURE__ */ jsxs26(Text26, { bold: true, color: colors.success, children: [
|
|
7746
7793
|
"+ New in local (",
|
|
7747
7794
|
result.added.length,
|
|
7748
7795
|
"):"
|
|
7749
7796
|
] }),
|
|
7750
|
-
result.added.slice(0, 5).map((entry, i) => /* @__PURE__ */
|
|
7751
|
-
/* @__PURE__ */ jsx28(
|
|
7752
|
-
/* @__PURE__ */ jsx28(
|
|
7753
|
-
/* @__PURE__ */
|
|
7797
|
+
result.added.slice(0, 5).map((entry, i) => /* @__PURE__ */ jsxs26(Box25, { marginLeft: 2, children: [
|
|
7798
|
+
/* @__PURE__ */ jsx28(Text26, { color: colors.success, children: "+ " }),
|
|
7799
|
+
/* @__PURE__ */ jsx28(Text26, { color: colors.text, children: entry.key }),
|
|
7800
|
+
/* @__PURE__ */ jsxs26(Text26, { color: colors.textDim, children: [
|
|
7754
7801
|
' = "',
|
|
7755
7802
|
truncate(entry.newValue || "", 40),
|
|
7756
7803
|
'"'
|
|
7757
7804
|
] })
|
|
7758
7805
|
] }, i)),
|
|
7759
|
-
result.added.length > 5 && /* @__PURE__ */ jsx28(
|
|
7806
|
+
result.added.length > 5 && /* @__PURE__ */ jsx28(Box25, { marginLeft: 2, children: /* @__PURE__ */ jsxs26(Text26, { color: colors.textMuted, children: [
|
|
7760
7807
|
"... and ",
|
|
7761
7808
|
result.added.length - 5,
|
|
7762
7809
|
" more"
|
|
7763
7810
|
] }) })
|
|
7764
7811
|
] }),
|
|
7765
|
-
result.removed.length > 0 && /* @__PURE__ */
|
|
7766
|
-
/* @__PURE__ */
|
|
7812
|
+
result.removed.length > 0 && /* @__PURE__ */ jsxs26(Box25, { flexDirection: "column", marginTop: 1, children: [
|
|
7813
|
+
/* @__PURE__ */ jsxs26(Text26, { bold: true, color: colors.error, children: [
|
|
7767
7814
|
"- Missing locally (",
|
|
7768
7815
|
result.removed.length,
|
|
7769
7816
|
"):"
|
|
7770
7817
|
] }),
|
|
7771
|
-
result.removed.slice(0, 5).map((entry, i) => /* @__PURE__ */
|
|
7772
|
-
/* @__PURE__ */ jsx28(
|
|
7773
|
-
/* @__PURE__ */ jsx28(
|
|
7818
|
+
result.removed.slice(0, 5).map((entry, i) => /* @__PURE__ */ jsxs26(Box25, { marginLeft: 2, children: [
|
|
7819
|
+
/* @__PURE__ */ jsx28(Text26, { color: colors.error, children: "- " }),
|
|
7820
|
+
/* @__PURE__ */ jsx28(Text26, { color: colors.text, children: entry.key })
|
|
7774
7821
|
] }, i)),
|
|
7775
|
-
result.removed.length > 5 && /* @__PURE__ */ jsx28(
|
|
7822
|
+
result.removed.length > 5 && /* @__PURE__ */ jsx28(Box25, { marginLeft: 2, children: /* @__PURE__ */ jsxs26(Text26, { color: colors.textMuted, children: [
|
|
7776
7823
|
"... and ",
|
|
7777
7824
|
result.removed.length - 5,
|
|
7778
7825
|
" more"
|
|
7779
7826
|
] }) })
|
|
7780
7827
|
] }),
|
|
7781
|
-
result.changed.length > 0 && /* @__PURE__ */
|
|
7782
|
-
/* @__PURE__ */
|
|
7828
|
+
result.changed.length > 0 && /* @__PURE__ */ jsxs26(Box25, { flexDirection: "column", marginTop: 1, children: [
|
|
7829
|
+
/* @__PURE__ */ jsxs26(Text26, { bold: true, color: colors.warning, children: [
|
|
7783
7830
|
"~ Modified (",
|
|
7784
7831
|
result.changed.length,
|
|
7785
7832
|
"):"
|
|
7786
7833
|
] }),
|
|
7787
|
-
result.changed.slice(0, 5).map((entry, i) => /* @__PURE__ */
|
|
7788
|
-
/* @__PURE__ */
|
|
7789
|
-
/* @__PURE__ */ jsx28(
|
|
7790
|
-
/* @__PURE__ */ jsx28(
|
|
7834
|
+
result.changed.slice(0, 5).map((entry, i) => /* @__PURE__ */ jsxs26(Box25, { marginLeft: 2, flexDirection: "column", children: [
|
|
7835
|
+
/* @__PURE__ */ jsxs26(Box25, { children: [
|
|
7836
|
+
/* @__PURE__ */ jsx28(Text26, { color: colors.warning, children: "~ " }),
|
|
7837
|
+
/* @__PURE__ */ jsx28(Text26, { color: colors.text, children: entry.key })
|
|
7791
7838
|
] }),
|
|
7792
|
-
/* @__PURE__ */ jsx28(
|
|
7839
|
+
/* @__PURE__ */ jsx28(Box25, { marginLeft: 4, children: /* @__PURE__ */ jsxs26(Text26, { color: colors.textDim, children: [
|
|
7793
7840
|
'remote: "',
|
|
7794
7841
|
truncate(entry.oldValue || "", 30),
|
|
7795
7842
|
'"'
|
|
7796
7843
|
] }) }),
|
|
7797
|
-
/* @__PURE__ */ jsx28(
|
|
7844
|
+
/* @__PURE__ */ jsx28(Box25, { marginLeft: 4, children: /* @__PURE__ */ jsxs26(Text26, { color: colors.textDim, children: [
|
|
7798
7845
|
'local: "',
|
|
7799
7846
|
truncate(entry.newValue || "", 30),
|
|
7800
7847
|
'"'
|
|
7801
7848
|
] }) })
|
|
7802
7849
|
] }, i)),
|
|
7803
|
-
result.changed.length > 5 && /* @__PURE__ */ jsx28(
|
|
7850
|
+
result.changed.length > 5 && /* @__PURE__ */ jsx28(Box25, { marginLeft: 2, children: /* @__PURE__ */ jsxs26(Text26, { color: colors.textMuted, children: [
|
|
7804
7851
|
"... and ",
|
|
7805
7852
|
result.changed.length - 5,
|
|
7806
7853
|
" more"
|
|
7807
7854
|
] }) })
|
|
7808
7855
|
] }),
|
|
7809
|
-
result.added.length > 0 && /* @__PURE__ */ jsx28(
|
|
7856
|
+
result.added.length > 0 && /* @__PURE__ */ jsx28(Box25, { marginTop: 1, children: /* @__PURE__ */ jsxs26(Text26, { color: colors.textMuted, children: [
|
|
7810
7857
|
"Run ",
|
|
7811
|
-
/* @__PURE__ */ jsx28(
|
|
7858
|
+
/* @__PURE__ */ jsx28(Text26, { color: colors.primary, children: "npx @intlpullhq/cli upload" }),
|
|
7812
7859
|
" to upload new keys to IntlPull"
|
|
7813
7860
|
] }) }),
|
|
7814
|
-
result.removed.length > 0 && /* @__PURE__ */ jsx28(
|
|
7861
|
+
result.removed.length > 0 && /* @__PURE__ */ jsx28(Box25, { marginTop: 1, children: /* @__PURE__ */ jsxs26(Text26, { color: colors.textMuted, children: [
|
|
7815
7862
|
"Run ",
|
|
7816
|
-
/* @__PURE__ */ jsx28(
|
|
7863
|
+
/* @__PURE__ */ jsx28(Text26, { color: colors.primary, children: "npx @intlpullhq/cli download" }),
|
|
7817
7864
|
" to download missing keys from IntlPull"
|
|
7818
7865
|
] }) })
|
|
7819
7866
|
] })
|
|
@@ -7837,11 +7884,11 @@ function runDiff(options) {
|
|
|
7837
7884
|
}
|
|
7838
7885
|
|
|
7839
7886
|
// src/commands/fix.tsx
|
|
7840
|
-
import { useState as useState16, useEffect as
|
|
7841
|
-
import { render as render12, Box as
|
|
7887
|
+
import { useState as useState16, useEffect as useEffect13 } from "react";
|
|
7888
|
+
import { render as render12, Box as Box26, Text as Text27 } from "ink";
|
|
7842
7889
|
import { readFileSync as readFileSync8, writeFileSync as writeFileSync4 } from "fs";
|
|
7843
7890
|
import { glob as glob2 } from "glob";
|
|
7844
|
-
import { jsx as jsx29, jsxs as
|
|
7891
|
+
import { jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
7845
7892
|
function FixCommand({ options }) {
|
|
7846
7893
|
const [tasks, setTasks] = useState16([
|
|
7847
7894
|
{ id: "config", label: "Loading configuration", status: "pending" },
|
|
@@ -7856,7 +7903,7 @@ function FixCommand({ options }) {
|
|
|
7856
7903
|
(prev) => prev.map((t) => t.id === id ? { ...t, ...update } : t)
|
|
7857
7904
|
);
|
|
7858
7905
|
};
|
|
7859
|
-
|
|
7906
|
+
useEffect13(() => {
|
|
7860
7907
|
async function run() {
|
|
7861
7908
|
try {
|
|
7862
7909
|
updateTask("config", { status: "running" });
|
|
@@ -7975,44 +8022,44 @@ ${parseErrors.join("\n")}`);
|
|
|
7975
8022
|
}
|
|
7976
8023
|
run();
|
|
7977
8024
|
}, [options]);
|
|
7978
|
-
return /* @__PURE__ */
|
|
8025
|
+
return /* @__PURE__ */ jsxs27(Box26, { flexDirection: "column", children: [
|
|
7979
8026
|
/* @__PURE__ */ jsx29(Header, { compact: true }),
|
|
7980
8027
|
/* @__PURE__ */ jsx29(TaskList, { tasks, title: "Fixing missing translations" }),
|
|
7981
8028
|
error && /* @__PURE__ */ jsx29(Alert, { type: "error", title: "Error", children: error }),
|
|
7982
|
-
done && result && /* @__PURE__ */
|
|
7983
|
-
result.keysAdded === 0 ? /* @__PURE__ */ jsx29(Alert, { type: "success", title: "No fixes needed", children: "All translations are complete" }) : options.dryRun ? /* @__PURE__ */
|
|
8029
|
+
done && result && /* @__PURE__ */ jsxs27(Box26, { flexDirection: "column", marginTop: 1, children: [
|
|
8030
|
+
result.keysAdded === 0 ? /* @__PURE__ */ jsx29(Alert, { type: "success", title: "No fixes needed", children: "All translations are complete" }) : options.dryRun ? /* @__PURE__ */ jsxs27(Alert, { type: "warning", title: "Dry run complete", children: [
|
|
7984
8031
|
"Would add ",
|
|
7985
8032
|
result.keysAdded,
|
|
7986
8033
|
" missing key(s) to ",
|
|
7987
8034
|
result.filesModified,
|
|
7988
8035
|
" file(s)"
|
|
7989
|
-
] }) : /* @__PURE__ */
|
|
8036
|
+
] }) : /* @__PURE__ */ jsxs27(Alert, { type: "success", title: "Fix complete", children: [
|
|
7990
8037
|
"Added ",
|
|
7991
8038
|
result.keysAdded,
|
|
7992
8039
|
" missing key(s) to ",
|
|
7993
8040
|
result.filesModified,
|
|
7994
8041
|
" file(s)"
|
|
7995
8042
|
] }),
|
|
7996
|
-
result.keysAdded > 0 && /* @__PURE__ */
|
|
7997
|
-
/* @__PURE__ */ jsx29(
|
|
7998
|
-
result.languages.map((lang) => /* @__PURE__ */
|
|
7999
|
-
/* @__PURE__ */
|
|
8043
|
+
result.keysAdded > 0 && /* @__PURE__ */ jsxs27(Box26, { flexDirection: "column", marginTop: 1, children: [
|
|
8044
|
+
/* @__PURE__ */ jsx29(Text27, { bold: true, color: colors.text, children: "Languages fixed:" }),
|
|
8045
|
+
result.languages.map((lang) => /* @__PURE__ */ jsxs27(Box26, { marginLeft: 2, children: [
|
|
8046
|
+
/* @__PURE__ */ jsxs27(Text27, { color: colors.success, children: [
|
|
8000
8047
|
icons.success,
|
|
8001
8048
|
" "
|
|
8002
8049
|
] }),
|
|
8003
|
-
/* @__PURE__ */ jsx29(
|
|
8050
|
+
/* @__PURE__ */ jsx29(Text27, { color: colors.text, children: lang })
|
|
8004
8051
|
] }, lang))
|
|
8005
8052
|
] }),
|
|
8006
|
-
result.keysAdded > 0 && !options.dryRun && /* @__PURE__ */
|
|
8007
|
-
/* @__PURE__ */
|
|
8053
|
+
result.keysAdded > 0 && !options.dryRun && /* @__PURE__ */ jsxs27(Box26, { marginTop: 1, children: [
|
|
8054
|
+
/* @__PURE__ */ jsxs27(Text27, { color: colors.warning, children: [
|
|
8008
8055
|
icons.warning,
|
|
8009
8056
|
" "
|
|
8010
8057
|
] }),
|
|
8011
|
-
/* @__PURE__ */ jsx29(
|
|
8058
|
+
/* @__PURE__ */ jsx29(Text27, { color: colors.textMuted, children: "Missing keys have been added with [LANG] prefix. Review and translate them." })
|
|
8012
8059
|
] }),
|
|
8013
|
-
options.dryRun && result.keysAdded > 0 && /* @__PURE__ */ jsx29(
|
|
8060
|
+
options.dryRun && result.keysAdded > 0 && /* @__PURE__ */ jsx29(Box26, { marginTop: 1, children: /* @__PURE__ */ jsxs27(Text27, { color: colors.textMuted, children: [
|
|
8014
8061
|
"Run without ",
|
|
8015
|
-
/* @__PURE__ */ jsx29(
|
|
8062
|
+
/* @__PURE__ */ jsx29(Text27, { color: colors.primary, children: "--dry-run" }),
|
|
8016
8063
|
" to apply fixes"
|
|
8017
8064
|
] }) })
|
|
8018
8065
|
] })
|
|
@@ -8046,12 +8093,12 @@ function runFix(options) {
|
|
|
8046
8093
|
}
|
|
8047
8094
|
|
|
8048
8095
|
// src/commands/listen.tsx
|
|
8049
|
-
import { useState as useState17, useEffect as
|
|
8050
|
-
import { render as render13, Box as
|
|
8096
|
+
import { useState as useState17, useEffect as useEffect14, useCallback, useRef as useRef2 } from "react";
|
|
8097
|
+
import { render as render13, Box as Box27, Text as Text28, useApp as useApp6, useInput as useInput7 } from "ink";
|
|
8051
8098
|
import Spinner12 from "ink-spinner";
|
|
8052
8099
|
import { writeFileSync as writeFileSync5, mkdirSync as mkdirSync3, existsSync as existsSync9 } from "fs";
|
|
8053
8100
|
import { join as join7 } from "path";
|
|
8054
|
-
import { jsx as jsx30, jsxs as
|
|
8101
|
+
import { jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
8055
8102
|
async function fetchProjects6(apiUrl, apiKey) {
|
|
8056
8103
|
const response = await fetch(`${apiUrl}/api/v1/projects`, {
|
|
8057
8104
|
headers: { Accept: "application/json", "X-API-Key": apiKey }
|
|
@@ -8060,7 +8107,7 @@ async function fetchProjects6(apiUrl, apiKey) {
|
|
|
8060
8107
|
const data = await response.json();
|
|
8061
8108
|
return data.projects || [];
|
|
8062
8109
|
}
|
|
8063
|
-
var
|
|
8110
|
+
var isInteractiveTerminal7 = process.stdin.isTTY && process.stdout.isTTY;
|
|
8064
8111
|
async function fetchTranslationsFromExport(projectId, apiUrl, apiKey, options) {
|
|
8065
8112
|
const params = new URLSearchParams();
|
|
8066
8113
|
params.set("format", "json");
|
|
@@ -8248,7 +8295,7 @@ function ListenComponent({ options }) {
|
|
|
8248
8295
|
const statusRef = useRef2(state.status);
|
|
8249
8296
|
statusRef.current = state.status;
|
|
8250
8297
|
const intervalMs = (options.interval || 5) * 1e3;
|
|
8251
|
-
const isInteractive =
|
|
8298
|
+
const isInteractive = isInteractiveTerminal7 && !options.once && !options.quiet;
|
|
8252
8299
|
useInput7(
|
|
8253
8300
|
(input, key) => {
|
|
8254
8301
|
if (input === "q" || key.ctrl && input === "c") {
|
|
@@ -8357,7 +8404,7 @@ function ListenComponent({ options }) {
|
|
|
8357
8404
|
}));
|
|
8358
8405
|
}
|
|
8359
8406
|
}, [options, state.version, state.syncCount]);
|
|
8360
|
-
|
|
8407
|
+
useEffect14(() => {
|
|
8361
8408
|
sync();
|
|
8362
8409
|
if (options.once) {
|
|
8363
8410
|
return;
|
|
@@ -8369,7 +8416,7 @@ function ListenComponent({ options }) {
|
|
|
8369
8416
|
}, intervalMs);
|
|
8370
8417
|
return () => clearInterval(interval);
|
|
8371
8418
|
}, [sync, intervalMs, options.once]);
|
|
8372
|
-
|
|
8419
|
+
useEffect14(() => {
|
|
8373
8420
|
if (!options.timeout || options.once) return;
|
|
8374
8421
|
const timeoutMs = options.timeout * 1e3;
|
|
8375
8422
|
const timer = setTimeout(() => {
|
|
@@ -8382,7 +8429,7 @@ function ListenComponent({ options }) {
|
|
|
8382
8429
|
}, timeoutMs);
|
|
8383
8430
|
return () => clearTimeout(timer);
|
|
8384
8431
|
}, [options.timeout, options.once, exit]);
|
|
8385
|
-
|
|
8432
|
+
useEffect14(() => {
|
|
8386
8433
|
if (options.once && state.status === "watching") {
|
|
8387
8434
|
setTimeout(() => exit(), 100);
|
|
8388
8435
|
}
|
|
@@ -8401,57 +8448,57 @@ function ListenComponent({ options }) {
|
|
|
8401
8448
|
error: "\u2717",
|
|
8402
8449
|
stopped: "\u25FB"
|
|
8403
8450
|
}[state.status];
|
|
8404
|
-
return /* @__PURE__ */
|
|
8405
|
-
/* @__PURE__ */
|
|
8406
|
-
/* @__PURE__ */ jsx30(
|
|
8407
|
-
/* @__PURE__ */ jsx30(
|
|
8408
|
-
isInteractive && /* @__PURE__ */ jsx30(
|
|
8451
|
+
return /* @__PURE__ */ jsxs28(Box27, { flexDirection: "column", paddingX: 1, children: [
|
|
8452
|
+
/* @__PURE__ */ jsxs28(Box27, { marginBottom: 1, children: [
|
|
8453
|
+
/* @__PURE__ */ jsx30(Text28, { bold: true, color: "cyan", children: "IntlPull" }),
|
|
8454
|
+
/* @__PURE__ */ jsx30(Text28, { children: " \u2022 Live Sync" }),
|
|
8455
|
+
isInteractive && /* @__PURE__ */ jsx30(Text28, { dimColor: true, children: " (press q to quit)" })
|
|
8409
8456
|
] }),
|
|
8410
|
-
/* @__PURE__ */
|
|
8411
|
-
state.status === "syncing" ? /* @__PURE__ */ jsx30(
|
|
8412
|
-
/* @__PURE__ */ jsx30(
|
|
8413
|
-
/* @__PURE__ */ jsx30(
|
|
8457
|
+
/* @__PURE__ */ jsxs28(Box27, { children: [
|
|
8458
|
+
state.status === "syncing" ? /* @__PURE__ */ jsx30(Text28, { color: "cyan", children: /* @__PURE__ */ jsx30(Spinner12, { type: "dots" }) }) : /* @__PURE__ */ jsx30(Text28, { color: statusColor, children: statusIcon }),
|
|
8459
|
+
/* @__PURE__ */ jsx30(Text28, { children: " " }),
|
|
8460
|
+
/* @__PURE__ */ jsx30(Text28, { color: statusColor, children: state.message })
|
|
8414
8461
|
] }),
|
|
8415
|
-
state.error && /* @__PURE__ */
|
|
8416
|
-
/* @__PURE__ */ jsx30(
|
|
8417
|
-
/* @__PURE__ */
|
|
8462
|
+
state.error && /* @__PURE__ */ jsxs28(Box27, { marginTop: 1, flexDirection: "column", children: [
|
|
8463
|
+
/* @__PURE__ */ jsx30(Text28, { color: "red", children: state.error }),
|
|
8464
|
+
/* @__PURE__ */ jsxs28(Text28, { dimColor: true, children: [
|
|
8418
8465
|
"Retrying in ",
|
|
8419
8466
|
intervalMs / 1e3,
|
|
8420
8467
|
"s..."
|
|
8421
8468
|
] })
|
|
8422
8469
|
] }),
|
|
8423
|
-
state.lastSync && !options.quiet && /* @__PURE__ */
|
|
8424
|
-
/* @__PURE__ */
|
|
8425
|
-
/* @__PURE__ */ jsx30(
|
|
8426
|
-
/* @__PURE__ */ jsx30(
|
|
8470
|
+
state.lastSync && !options.quiet && /* @__PURE__ */ jsxs28(Box27, { marginTop: 1, flexDirection: "column", children: [
|
|
8471
|
+
/* @__PURE__ */ jsxs28(Box27, { children: [
|
|
8472
|
+
/* @__PURE__ */ jsx30(Text28, { dimColor: true, children: "Output: " }),
|
|
8473
|
+
/* @__PURE__ */ jsx30(Text28, { children: state.outputDir })
|
|
8427
8474
|
] }),
|
|
8428
|
-
/* @__PURE__ */
|
|
8429
|
-
/* @__PURE__ */ jsx30(
|
|
8430
|
-
/* @__PURE__ */ jsx30(
|
|
8475
|
+
/* @__PURE__ */ jsxs28(Box27, { children: [
|
|
8476
|
+
/* @__PURE__ */ jsx30(Text28, { dimColor: true, children: "Version: " }),
|
|
8477
|
+
/* @__PURE__ */ jsx30(Text28, { children: state.version })
|
|
8431
8478
|
] }),
|
|
8432
|
-
/* @__PURE__ */
|
|
8433
|
-
/* @__PURE__ */ jsx30(
|
|
8434
|
-
/* @__PURE__ */ jsx30(
|
|
8479
|
+
/* @__PURE__ */ jsxs28(Box27, { children: [
|
|
8480
|
+
/* @__PURE__ */ jsx30(Text28, { dimColor: true, children: "Languages: " }),
|
|
8481
|
+
/* @__PURE__ */ jsx30(Text28, { children: state.languages.join(", ") })
|
|
8435
8482
|
] }),
|
|
8436
|
-
/* @__PURE__ */
|
|
8437
|
-
/* @__PURE__ */ jsx30(
|
|
8438
|
-
/* @__PURE__ */ jsx30(
|
|
8483
|
+
/* @__PURE__ */ jsxs28(Box27, { children: [
|
|
8484
|
+
/* @__PURE__ */ jsx30(Text28, { dimColor: true, children: "Keys: " }),
|
|
8485
|
+
/* @__PURE__ */ jsx30(Text28, { children: state.keyCount })
|
|
8439
8486
|
] }),
|
|
8440
|
-
/* @__PURE__ */
|
|
8441
|
-
/* @__PURE__ */ jsx30(
|
|
8442
|
-
/* @__PURE__ */
|
|
8487
|
+
/* @__PURE__ */ jsxs28(Box27, { children: [
|
|
8488
|
+
/* @__PURE__ */ jsx30(Text28, { dimColor: true, children: "Last sync: " }),
|
|
8489
|
+
/* @__PURE__ */ jsxs28(Text28, { children: [
|
|
8443
8490
|
formatTime(state.lastSync),
|
|
8444
8491
|
" (",
|
|
8445
8492
|
formatRelativeTime(state.lastSync),
|
|
8446
8493
|
")"
|
|
8447
8494
|
] })
|
|
8448
8495
|
] }),
|
|
8449
|
-
/* @__PURE__ */
|
|
8450
|
-
/* @__PURE__ */ jsx30(
|
|
8451
|
-
/* @__PURE__ */ jsx30(
|
|
8496
|
+
/* @__PURE__ */ jsxs28(Box27, { children: [
|
|
8497
|
+
/* @__PURE__ */ jsx30(Text28, { dimColor: true, children: "Syncs: " }),
|
|
8498
|
+
/* @__PURE__ */ jsx30(Text28, { children: state.syncCount })
|
|
8452
8499
|
] })
|
|
8453
8500
|
] }),
|
|
8454
|
-
state.status === "watching" && !options.once && !options.quiet && /* @__PURE__ */ jsx30(
|
|
8501
|
+
state.status === "watching" && !options.once && !options.quiet && /* @__PURE__ */ jsx30(Box27, { marginTop: 1, children: /* @__PURE__ */ jsxs28(Text28, { dimColor: true, children: [
|
|
8455
8502
|
"Polling every ",
|
|
8456
8503
|
intervalMs / 1e3,
|
|
8457
8504
|
"s for changes..."
|
|
@@ -8570,7 +8617,7 @@ function runListen(options) {
|
|
|
8570
8617
|
console.error("Error: Interval must be at least 1 second");
|
|
8571
8618
|
process.exit(1);
|
|
8572
8619
|
}
|
|
8573
|
-
if (options.once || !
|
|
8620
|
+
if (options.once || !isInteractiveTerminal7) {
|
|
8574
8621
|
runOnceSync(options);
|
|
8575
8622
|
return;
|
|
8576
8623
|
}
|
|
@@ -8578,10 +8625,10 @@ function runListen(options) {
|
|
|
8578
8625
|
}
|
|
8579
8626
|
|
|
8580
8627
|
// src/commands/publish.tsx
|
|
8581
|
-
import { useState as useState18, useEffect as
|
|
8582
|
-
import { render as render14, Box as
|
|
8628
|
+
import { useState as useState18, useEffect as useEffect15 } from "react";
|
|
8629
|
+
import { render as render14, Box as Box28, Text as Text29 } from "ink";
|
|
8583
8630
|
import Spinner13 from "ink-spinner";
|
|
8584
|
-
import { jsx as jsx31, jsxs as
|
|
8631
|
+
import { jsx as jsx31, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
8585
8632
|
async function fetchProjects7(apiUrl, apiKey) {
|
|
8586
8633
|
const response = await fetch(`${apiUrl}/api/v1/projects`, {
|
|
8587
8634
|
headers: { Accept: "application/json", "X-API-Key": apiKey }
|
|
@@ -8755,7 +8802,7 @@ function PublishComponent({ options }) {
|
|
|
8755
8802
|
status: "detecting",
|
|
8756
8803
|
message: "Detecting project..."
|
|
8757
8804
|
});
|
|
8758
|
-
|
|
8805
|
+
useEffect15(() => {
|
|
8759
8806
|
async function run() {
|
|
8760
8807
|
try {
|
|
8761
8808
|
const resolved = getResolvedApiKey();
|
|
@@ -8839,83 +8886,83 @@ function PublishComponent({ options }) {
|
|
|
8839
8886
|
}
|
|
8840
8887
|
return null;
|
|
8841
8888
|
}
|
|
8842
|
-
return /* @__PURE__ */
|
|
8843
|
-
/* @__PURE__ */
|
|
8844
|
-
/* @__PURE__ */ jsx31(
|
|
8845
|
-
/* @__PURE__ */ jsx31(
|
|
8846
|
-
options.dryRun && /* @__PURE__ */ jsx31(
|
|
8889
|
+
return /* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", paddingX: 1, children: [
|
|
8890
|
+
/* @__PURE__ */ jsxs29(Box28, { marginBottom: 1, children: [
|
|
8891
|
+
/* @__PURE__ */ jsx31(Text29, { bold: true, color: "cyan", children: "IntlPull" }),
|
|
8892
|
+
/* @__PURE__ */ jsx31(Text29, { children: " Publish OTA Release" }),
|
|
8893
|
+
options.dryRun && /* @__PURE__ */ jsx31(Text29, { color: "yellow", children: " (dry run)" })
|
|
8847
8894
|
] }),
|
|
8848
|
-
(state.status === "detecting" || state.status === "publishing") && /* @__PURE__ */
|
|
8849
|
-
/* @__PURE__ */ jsx31(
|
|
8850
|
-
/* @__PURE__ */
|
|
8895
|
+
(state.status === "detecting" || state.status === "publishing") && /* @__PURE__ */ jsxs29(Box28, { children: [
|
|
8896
|
+
/* @__PURE__ */ jsx31(Text29, { color: "cyan", children: /* @__PURE__ */ jsx31(Spinner13, { type: "dots" }) }),
|
|
8897
|
+
/* @__PURE__ */ jsxs29(Text29, { children: [
|
|
8851
8898
|
" ",
|
|
8852
8899
|
state.message
|
|
8853
8900
|
] })
|
|
8854
8901
|
] }),
|
|
8855
|
-
state.status === "success" && /* @__PURE__ */
|
|
8856
|
-
/* @__PURE__ */
|
|
8902
|
+
state.status === "success" && /* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", children: [
|
|
8903
|
+
/* @__PURE__ */ jsxs29(Text29, { color: "green", children: [
|
|
8857
8904
|
"\u2713 ",
|
|
8858
8905
|
state.message
|
|
8859
8906
|
] }),
|
|
8860
|
-
state.projectName && /* @__PURE__ */ jsx31(
|
|
8907
|
+
state.projectName && /* @__PURE__ */ jsx31(Box28, { marginTop: 1, children: /* @__PURE__ */ jsxs29(Text29, { dimColor: true, children: [
|
|
8861
8908
|
"Project: ",
|
|
8862
|
-
/* @__PURE__ */ jsx31(
|
|
8909
|
+
/* @__PURE__ */ jsx31(Text29, { color: "white", children: state.projectName })
|
|
8863
8910
|
] }) }),
|
|
8864
|
-
state.branch && /* @__PURE__ */
|
|
8911
|
+
state.branch && /* @__PURE__ */ jsxs29(Text29, { dimColor: true, children: [
|
|
8865
8912
|
"Branch: ",
|
|
8866
|
-
/* @__PURE__ */ jsx31(
|
|
8913
|
+
/* @__PURE__ */ jsx31(Text29, { color: "white", children: state.branch })
|
|
8867
8914
|
] }),
|
|
8868
|
-
state.release && /* @__PURE__ */
|
|
8869
|
-
/* @__PURE__ */
|
|
8915
|
+
state.release && /* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", marginTop: 1, children: [
|
|
8916
|
+
/* @__PURE__ */ jsxs29(Text29, { dimColor: true, children: [
|
|
8870
8917
|
"Version: ",
|
|
8871
|
-
/* @__PURE__ */ jsx31(
|
|
8918
|
+
/* @__PURE__ */ jsx31(Text29, { color: "green", bold: true, children: state.release.version })
|
|
8872
8919
|
] }),
|
|
8873
|
-
/* @__PURE__ */
|
|
8920
|
+
/* @__PURE__ */ jsxs29(Text29, { dimColor: true, children: [
|
|
8874
8921
|
"Languages: ",
|
|
8875
8922
|
state.release.languages.join(", ")
|
|
8876
8923
|
] }),
|
|
8877
|
-
/* @__PURE__ */
|
|
8924
|
+
/* @__PURE__ */ jsxs29(Text29, { dimColor: true, children: [
|
|
8878
8925
|
"Keys: ",
|
|
8879
8926
|
state.release.keyCount
|
|
8880
8927
|
] }),
|
|
8881
|
-
/* @__PURE__ */
|
|
8928
|
+
/* @__PURE__ */ jsxs29(Text29, { dimColor: true, children: [
|
|
8882
8929
|
"Bundle size: ",
|
|
8883
8930
|
formatBytes(state.release.bundleSize)
|
|
8884
8931
|
] }),
|
|
8885
|
-
/* @__PURE__ */
|
|
8886
|
-
/* @__PURE__ */ jsx31(
|
|
8887
|
-
/* @__PURE__ */
|
|
8932
|
+
/* @__PURE__ */ jsxs29(Box28, { marginTop: 1, flexDirection: "column", children: [
|
|
8933
|
+
/* @__PURE__ */ jsx31(Text29, { dimColor: true, children: "SDK Manifest URL:" }),
|
|
8934
|
+
/* @__PURE__ */ jsxs29(Text29, { color: "cyan", children: [
|
|
8888
8935
|
" ",
|
|
8889
8936
|
state.release.bundleUrl.replace(/\/[^/]+\.json$/, "/manifest")
|
|
8890
8937
|
] })
|
|
8891
8938
|
] })
|
|
8892
8939
|
] }),
|
|
8893
|
-
!state.release && state.summary && /* @__PURE__ */
|
|
8894
|
-
/* @__PURE__ */ jsx31(
|
|
8895
|
-
/* @__PURE__ */
|
|
8940
|
+
!state.release && state.summary && /* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", marginTop: 1, children: [
|
|
8941
|
+
/* @__PURE__ */ jsx31(Text29, { dimColor: true, children: "Would publish:" }),
|
|
8942
|
+
/* @__PURE__ */ jsxs29(Text29, { dimColor: true, children: [
|
|
8896
8943
|
" Languages: ",
|
|
8897
8944
|
state.summary.languages.join(", ")
|
|
8898
8945
|
] }),
|
|
8899
|
-
/* @__PURE__ */
|
|
8946
|
+
/* @__PURE__ */ jsxs29(Text29, { dimColor: true, children: [
|
|
8900
8947
|
" Keys: ",
|
|
8901
8948
|
state.summary.keyCount
|
|
8902
8949
|
] }),
|
|
8903
|
-
/* @__PURE__ */
|
|
8950
|
+
/* @__PURE__ */ jsxs29(Text29, { dimColor: true, children: [
|
|
8904
8951
|
" Estimated size: ",
|
|
8905
8952
|
formatBytes(state.summary.estimatedSize)
|
|
8906
8953
|
] })
|
|
8907
8954
|
] })
|
|
8908
8955
|
] }),
|
|
8909
|
-
state.status === "error" && /* @__PURE__ */
|
|
8910
|
-
/* @__PURE__ */
|
|
8956
|
+
state.status === "error" && /* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", children: [
|
|
8957
|
+
/* @__PURE__ */ jsxs29(Text29, { color: "red", children: [
|
|
8911
8958
|
"\u2717 ",
|
|
8912
8959
|
state.message
|
|
8913
8960
|
] }),
|
|
8914
|
-
/* @__PURE__ */
|
|
8915
|
-
/* @__PURE__ */ jsx31(
|
|
8916
|
-
/* @__PURE__ */ jsx31(
|
|
8917
|
-
/* @__PURE__ */ jsx31(
|
|
8918
|
-
/* @__PURE__ */ jsx31(
|
|
8961
|
+
/* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", marginTop: 1, children: [
|
|
8962
|
+
/* @__PURE__ */ jsx31(Text29, { dimColor: true, children: "Tips:" }),
|
|
8963
|
+
/* @__PURE__ */ jsx31(Text29, { color: "gray", children: " \u2022 Run `npx @intlpullhq/cli upload` to upload translations first" }),
|
|
8964
|
+
/* @__PURE__ */ jsx31(Text29, { color: "gray", children: " \u2022 Use `npx @intlpullhq/cli publish 1.0.0` to specify a version" }),
|
|
8965
|
+
/* @__PURE__ */ jsx31(Text29, { color: "gray", children: " \u2022 Use `npx @intlpullhq/cli publish --dry-run` to preview" })
|
|
8919
8966
|
] })
|
|
8920
8967
|
] })
|
|
8921
8968
|
] });
|
|
@@ -8925,10 +8972,10 @@ function runPublish(options) {
|
|
|
8925
8972
|
}
|
|
8926
8973
|
|
|
8927
8974
|
// src/commands/releases.tsx
|
|
8928
|
-
import { useState as useState19, useEffect as
|
|
8929
|
-
import { render as render15, Box as
|
|
8975
|
+
import { useState as useState19, useEffect as useEffect16 } from "react";
|
|
8976
|
+
import { render as render15, Box as Box29, Text as Text30 } from "ink";
|
|
8930
8977
|
import Spinner14 from "ink-spinner";
|
|
8931
|
-
import { jsx as jsx32, jsxs as
|
|
8978
|
+
import { jsx as jsx32, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
8932
8979
|
async function fetchProjects8(apiUrl, apiKey) {
|
|
8933
8980
|
const response = await fetch(`${apiUrl}/api/v1/projects`, {
|
|
8934
8981
|
headers: { Accept: "application/json", "X-API-Key": apiKey }
|
|
@@ -9006,7 +9053,7 @@ function ReleasesComponent({ options }) {
|
|
|
9006
9053
|
status: "loading",
|
|
9007
9054
|
message: "Loading releases..."
|
|
9008
9055
|
});
|
|
9009
|
-
|
|
9056
|
+
useEffect16(() => {
|
|
9010
9057
|
async function run() {
|
|
9011
9058
|
try {
|
|
9012
9059
|
const resolved = getResolvedApiKey();
|
|
@@ -9071,41 +9118,41 @@ function ReleasesComponent({ options }) {
|
|
|
9071
9118
|
}
|
|
9072
9119
|
return null;
|
|
9073
9120
|
}
|
|
9074
|
-
return /* @__PURE__ */
|
|
9075
|
-
/* @__PURE__ */
|
|
9076
|
-
/* @__PURE__ */ jsx32(
|
|
9077
|
-
/* @__PURE__ */ jsx32(
|
|
9121
|
+
return /* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", paddingX: 1, children: [
|
|
9122
|
+
/* @__PURE__ */ jsxs30(Box29, { marginBottom: 1, children: [
|
|
9123
|
+
/* @__PURE__ */ jsx32(Text30, { bold: true, color: "cyan", children: "IntlPull" }),
|
|
9124
|
+
/* @__PURE__ */ jsx32(Text30, { children: " OTA Releases" })
|
|
9078
9125
|
] }),
|
|
9079
|
-
state.status === "loading" && /* @__PURE__ */
|
|
9080
|
-
/* @__PURE__ */ jsx32(
|
|
9081
|
-
/* @__PURE__ */
|
|
9126
|
+
state.status === "loading" && /* @__PURE__ */ jsxs30(Box29, { children: [
|
|
9127
|
+
/* @__PURE__ */ jsx32(Text30, { color: "cyan", children: /* @__PURE__ */ jsx32(Spinner14, { type: "dots" }) }),
|
|
9128
|
+
/* @__PURE__ */ jsxs30(Text30, { children: [
|
|
9082
9129
|
" ",
|
|
9083
9130
|
state.message
|
|
9084
9131
|
] })
|
|
9085
9132
|
] }),
|
|
9086
|
-
state.status === "success" && state.deleted && /* @__PURE__ */
|
|
9133
|
+
state.status === "success" && state.deleted && /* @__PURE__ */ jsxs30(Text30, { color: "green", children: [
|
|
9087
9134
|
"\u2713 ",
|
|
9088
9135
|
state.message
|
|
9089
9136
|
] }),
|
|
9090
|
-
state.status === "success" && state.releases && /* @__PURE__ */
|
|
9091
|
-
state.projectName && /* @__PURE__ */ jsx32(
|
|
9137
|
+
state.status === "success" && state.releases && /* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", children: [
|
|
9138
|
+
state.projectName && /* @__PURE__ */ jsx32(Box29, { marginBottom: 1, children: /* @__PURE__ */ jsxs30(Text30, { dimColor: true, children: [
|
|
9092
9139
|
"Project: ",
|
|
9093
|
-
/* @__PURE__ */ jsx32(
|
|
9140
|
+
/* @__PURE__ */ jsx32(Text30, { color: "white", children: state.projectName })
|
|
9094
9141
|
] }) }),
|
|
9095
|
-
state.releases.length === 0 ? /* @__PURE__ */
|
|
9096
|
-
/* @__PURE__ */ jsx32(
|
|
9097
|
-
/* @__PURE__ */ jsx32(
|
|
9098
|
-
] }) : /* @__PURE__ */
|
|
9099
|
-
state.releases.map((release, i) => /* @__PURE__ */
|
|
9100
|
-
/* @__PURE__ */
|
|
9101
|
-
/* @__PURE__ */ jsx32(
|
|
9102
|
-
/* @__PURE__ */
|
|
9142
|
+
state.releases.length === 0 ? /* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", children: [
|
|
9143
|
+
/* @__PURE__ */ jsx32(Text30, { color: "yellow", children: "No releases found" }),
|
|
9144
|
+
/* @__PURE__ */ jsx32(Box29, { marginTop: 1, children: /* @__PURE__ */ jsx32(Text30, { dimColor: true, children: "Run `npx @intlpullhq/cli publish [version]` to create your first OTA release." }) })
|
|
9145
|
+
] }) : /* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", children: [
|
|
9146
|
+
state.releases.map((release, i) => /* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", marginBottom: i < state.releases.length - 1 ? 1 : 0, children: [
|
|
9147
|
+
/* @__PURE__ */ jsxs30(Box29, { children: [
|
|
9148
|
+
/* @__PURE__ */ jsx32(Text30, { color: "green", bold: true, children: release.version }),
|
|
9149
|
+
/* @__PURE__ */ jsxs30(Text30, { dimColor: true, children: [
|
|
9103
9150
|
" \u2022 ",
|
|
9104
9151
|
formatDate(release.publishedAt)
|
|
9105
9152
|
] }),
|
|
9106
|
-
i === 0 && /* @__PURE__ */ jsx32(
|
|
9153
|
+
i === 0 && /* @__PURE__ */ jsx32(Text30, { color: "cyan", children: " (latest)" })
|
|
9107
9154
|
] }),
|
|
9108
|
-
/* @__PURE__ */ jsx32(
|
|
9155
|
+
/* @__PURE__ */ jsx32(Box29, { paddingLeft: 2, children: /* @__PURE__ */ jsxs30(Text30, { dimColor: true, children: [
|
|
9109
9156
|
release.keyCount,
|
|
9110
9157
|
" keys \u2022 ",
|
|
9111
9158
|
release.languages.length,
|
|
@@ -9113,23 +9160,23 @@ function ReleasesComponent({ options }) {
|
|
|
9113
9160
|
formatBytes2(release.bundleSize),
|
|
9114
9161
|
release.downloadCount > 0 && ` \u2022 ${release.downloadCount} downloads`
|
|
9115
9162
|
] }) }),
|
|
9116
|
-
/* @__PURE__ */ jsx32(
|
|
9163
|
+
/* @__PURE__ */ jsx32(Box29, { paddingLeft: 2, children: /* @__PURE__ */ jsxs30(Text30, { color: "gray", children: [
|
|
9117
9164
|
"ID: ",
|
|
9118
9165
|
release.id
|
|
9119
9166
|
] }) })
|
|
9120
9167
|
] }, release.id)),
|
|
9121
|
-
/* @__PURE__ */ jsx32(
|
|
9168
|
+
/* @__PURE__ */ jsx32(Box29, { marginTop: 1, children: /* @__PURE__ */ jsx32(Text30, { dimColor: true, children: "Use `npx @intlpullhq/cli releases delete <id>` to delete a release." }) })
|
|
9122
9169
|
] })
|
|
9123
9170
|
] }),
|
|
9124
|
-
state.status === "error" && /* @__PURE__ */
|
|
9125
|
-
/* @__PURE__ */
|
|
9171
|
+
state.status === "error" && /* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", children: [
|
|
9172
|
+
/* @__PURE__ */ jsxs30(Text30, { color: "red", children: [
|
|
9126
9173
|
"\u2717 ",
|
|
9127
9174
|
state.message
|
|
9128
9175
|
] }),
|
|
9129
|
-
/* @__PURE__ */
|
|
9130
|
-
/* @__PURE__ */ jsx32(
|
|
9131
|
-
/* @__PURE__ */ jsx32(
|
|
9132
|
-
/* @__PURE__ */ jsx32(
|
|
9176
|
+
/* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", marginTop: 1, children: [
|
|
9177
|
+
/* @__PURE__ */ jsx32(Text30, { dimColor: true, children: "Tips:" }),
|
|
9178
|
+
/* @__PURE__ */ jsx32(Text30, { color: "gray", children: " \u2022 Run `npx @intlpullhq/cli publish` to create a release first" }),
|
|
9179
|
+
/* @__PURE__ */ jsx32(Text30, { color: "gray", children: " \u2022 OTA requires Professional or Enterprise plan" })
|
|
9133
9180
|
] })
|
|
9134
9181
|
] })
|
|
9135
9182
|
] });
|
|
@@ -9139,9 +9186,9 @@ function runReleases(options) {
|
|
|
9139
9186
|
}
|
|
9140
9187
|
|
|
9141
9188
|
// src/commands/workflow.tsx
|
|
9142
|
-
import { useState as useState20, useEffect as
|
|
9143
|
-
import { render as render16, Box as
|
|
9144
|
-
import { Fragment as Fragment5, jsx as jsx33, jsxs as
|
|
9189
|
+
import { useState as useState20, useEffect as useEffect17 } from "react";
|
|
9190
|
+
import { render as render16, Box as Box30, Text as Text31 } from "ink";
|
|
9191
|
+
import { Fragment as Fragment5, jsx as jsx33, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
9145
9192
|
function WorkflowStatusCommand({ projectId }) {
|
|
9146
9193
|
const [loading, setLoading] = useState20(true);
|
|
9147
9194
|
const [error, setError] = useState20(null);
|
|
@@ -9150,7 +9197,7 @@ function WorkflowStatusCommand({ projectId }) {
|
|
|
9150
9197
|
const [workflows, setWorkflows] = useState20([]);
|
|
9151
9198
|
const [pending, setPending] = useState20([]);
|
|
9152
9199
|
const [locked, setLocked] = useState20([]);
|
|
9153
|
-
|
|
9200
|
+
useEffect17(() => {
|
|
9154
9201
|
async function fetchData() {
|
|
9155
9202
|
const resolved = getResolvedApiKey();
|
|
9156
9203
|
if (!resolved?.key) {
|
|
@@ -9190,36 +9237,36 @@ function WorkflowStatusCommand({ projectId }) {
|
|
|
9190
9237
|
}
|
|
9191
9238
|
fetchData();
|
|
9192
9239
|
}, [projectId]);
|
|
9193
|
-
return /* @__PURE__ */
|
|
9240
|
+
return /* @__PURE__ */ jsxs31(Box30, { flexDirection: "column", children: [
|
|
9194
9241
|
/* @__PURE__ */ jsx33(Header, { compact: true }),
|
|
9195
|
-
loading && /* @__PURE__ */ jsx33(
|
|
9242
|
+
loading && /* @__PURE__ */ jsx33(Box30, { marginY: 1, children: /* @__PURE__ */ jsx33(Spinner, { label: "Fetching workflow status..." }) }),
|
|
9196
9243
|
error && /* @__PURE__ */ jsx33(Alert, { type: "error", title: "Error", children: error }),
|
|
9197
|
-
!loading && !error && !workflowsEnabled && /* @__PURE__ */
|
|
9244
|
+
!loading && !error && !workflowsEnabled && /* @__PURE__ */ jsxs31(Alert, { type: "warning", title: "Workflows Not Enabled", children: [
|
|
9198
9245
|
'Workflows are not enabled for project "',
|
|
9199
9246
|
projectName,
|
|
9200
9247
|
'".',
|
|
9201
9248
|
"\n",
|
|
9202
9249
|
"Enable them in the project settings at app.intlpull.com"
|
|
9203
9250
|
] }),
|
|
9204
|
-
!loading && !error && workflowsEnabled && /* @__PURE__ */
|
|
9251
|
+
!loading && !error && workflowsEnabled && /* @__PURE__ */ jsxs31(Box30, { flexDirection: "column", children: [
|
|
9205
9252
|
/* @__PURE__ */ jsx33(
|
|
9206
|
-
|
|
9253
|
+
Box30,
|
|
9207
9254
|
{
|
|
9208
9255
|
borderStyle: "round",
|
|
9209
9256
|
borderColor: colors.primary,
|
|
9210
9257
|
paddingX: 2,
|
|
9211
9258
|
paddingY: 1,
|
|
9212
9259
|
marginY: 1,
|
|
9213
|
-
children: /* @__PURE__ */
|
|
9214
|
-
/* @__PURE__ */
|
|
9215
|
-
/* @__PURE__ */ jsx33(
|
|
9216
|
-
/* @__PURE__ */
|
|
9260
|
+
children: /* @__PURE__ */ jsxs31(Box30, { flexDirection: "column", children: [
|
|
9261
|
+
/* @__PURE__ */ jsxs31(Box30, { children: [
|
|
9262
|
+
/* @__PURE__ */ jsx33(Text31, { bold: true, color: colors.text, children: projectName }),
|
|
9263
|
+
/* @__PURE__ */ jsxs31(Text31, { color: colors.success, children: [
|
|
9217
9264
|
" ",
|
|
9218
9265
|
icons.check,
|
|
9219
9266
|
" Workflows Enabled"
|
|
9220
9267
|
] })
|
|
9221
9268
|
] }),
|
|
9222
|
-
/* @__PURE__ */ jsx33(
|
|
9269
|
+
/* @__PURE__ */ jsx33(Box30, { marginTop: 1, children: /* @__PURE__ */ jsxs31(Text31, { color: colors.textMuted, children: [
|
|
9223
9270
|
icons.bullet,
|
|
9224
9271
|
" ",
|
|
9225
9272
|
workflows.length,
|
|
@@ -9227,14 +9274,14 @@ function WorkflowStatusCommand({ projectId }) {
|
|
|
9227
9274
|
workflows.length !== 1 ? "s" : "",
|
|
9228
9275
|
" configured"
|
|
9229
9276
|
] }) }),
|
|
9230
|
-
/* @__PURE__ */ jsx33(
|
|
9277
|
+
/* @__PURE__ */ jsx33(Box30, { children: /* @__PURE__ */ jsxs31(Text31, { color: pending.length > 0 ? colors.warning : colors.textMuted, children: [
|
|
9231
9278
|
icons.bullet,
|
|
9232
9279
|
" ",
|
|
9233
9280
|
pending.length,
|
|
9234
9281
|
" pending approval",
|
|
9235
9282
|
pending.length !== 1 ? "s" : ""
|
|
9236
9283
|
] }) }),
|
|
9237
|
-
/* @__PURE__ */ jsx33(
|
|
9284
|
+
/* @__PURE__ */ jsx33(Box30, { children: /* @__PURE__ */ jsxs31(Text31, { color: locked.length > 0 ? colors.info : colors.textMuted, children: [
|
|
9238
9285
|
icons.bullet,
|
|
9239
9286
|
" ",
|
|
9240
9287
|
locked.length,
|
|
@@ -9244,15 +9291,15 @@ function WorkflowStatusCommand({ projectId }) {
|
|
|
9244
9291
|
] })
|
|
9245
9292
|
}
|
|
9246
9293
|
),
|
|
9247
|
-
workflows.filter((w) => w.is_active).length > 0 && /* @__PURE__ */
|
|
9248
|
-
/* @__PURE__ */ jsx33(
|
|
9249
|
-
workflows.filter((w) => w.is_active).map((w) => /* @__PURE__ */
|
|
9250
|
-
/* @__PURE__ */ jsx33(
|
|
9251
|
-
/* @__PURE__ */ jsx33(
|
|
9294
|
+
workflows.filter((w) => w.is_active).length > 0 && /* @__PURE__ */ jsxs31(Box30, { flexDirection: "column", marginTop: 1, children: [
|
|
9295
|
+
/* @__PURE__ */ jsx33(Text31, { bold: true, color: colors.text, children: "Active Workflow" }),
|
|
9296
|
+
workflows.filter((w) => w.is_active).map((w) => /* @__PURE__ */ jsxs31(Box30, { marginTop: 1, flexDirection: "column", children: [
|
|
9297
|
+
/* @__PURE__ */ jsx33(Text31, { color: colors.primary, children: w.name }),
|
|
9298
|
+
/* @__PURE__ */ jsx33(Box30, { marginLeft: 2, flexDirection: "column", children: w.stages.map((stage, i) => /* @__PURE__ */ jsx33(Box30, { children: /* @__PURE__ */ jsxs31(Text31, { color: colors.textMuted, children: [
|
|
9252
9299
|
i + 1,
|
|
9253
9300
|
". ",
|
|
9254
9301
|
stage.name,
|
|
9255
|
-
stage.required_role && /* @__PURE__ */
|
|
9302
|
+
stage.required_role && /* @__PURE__ */ jsxs31(Text31, { dimColor: true, children: [
|
|
9256
9303
|
" (requires: ",
|
|
9257
9304
|
stage.required_role,
|
|
9258
9305
|
")"
|
|
@@ -9260,46 +9307,46 @@ function WorkflowStatusCommand({ projectId }) {
|
|
|
9260
9307
|
] }) }, stage.id)) })
|
|
9261
9308
|
] }, w.id))
|
|
9262
9309
|
] }),
|
|
9263
|
-
pending.length > 0 && /* @__PURE__ */
|
|
9264
|
-
/* @__PURE__ */
|
|
9310
|
+
pending.length > 0 && /* @__PURE__ */ jsxs31(Box30, { flexDirection: "column", marginTop: 2, children: [
|
|
9311
|
+
/* @__PURE__ */ jsxs31(Text31, { bold: true, color: colors.warning, children: [
|
|
9265
9312
|
"Pending Approvals (",
|
|
9266
9313
|
pending.length,
|
|
9267
9314
|
")"
|
|
9268
9315
|
] }),
|
|
9269
|
-
pending.slice(0, 10).map((p) => /* @__PURE__ */
|
|
9270
|
-
/* @__PURE__ */
|
|
9271
|
-
/* @__PURE__ */ jsx33(
|
|
9272
|
-
/* @__PURE__ */
|
|
9316
|
+
pending.slice(0, 10).map((p) => /* @__PURE__ */ jsxs31(Box30, { marginTop: 1, flexDirection: "column", children: [
|
|
9317
|
+
/* @__PURE__ */ jsxs31(Box30, { children: [
|
|
9318
|
+
/* @__PURE__ */ jsx33(Text31, { color: colors.text, children: p.key }),
|
|
9319
|
+
/* @__PURE__ */ jsxs31(Text31, { color: colors.textDim, children: [
|
|
9273
9320
|
" [",
|
|
9274
9321
|
p.language,
|
|
9275
9322
|
"]"
|
|
9276
9323
|
] })
|
|
9277
9324
|
] }),
|
|
9278
|
-
/* @__PURE__ */ jsx33(
|
|
9325
|
+
/* @__PURE__ */ jsx33(Box30, { marginLeft: 2, children: /* @__PURE__ */ jsxs31(Text31, { color: colors.textMuted, children: [
|
|
9279
9326
|
"Stage: ",
|
|
9280
9327
|
p.stage_name,
|
|
9281
9328
|
p.required_role && ` (requires: ${p.required_role})`
|
|
9282
9329
|
] }) }),
|
|
9283
|
-
/* @__PURE__ */ jsx33(
|
|
9330
|
+
/* @__PURE__ */ jsx33(Box30, { marginLeft: 2, children: /* @__PURE__ */ jsxs31(Text31, { dimColor: true, children: [
|
|
9284
9331
|
"ID: ",
|
|
9285
9332
|
p.translation_id
|
|
9286
9333
|
] }) })
|
|
9287
9334
|
] }, p.id)),
|
|
9288
|
-
pending.length > 10 && /* @__PURE__ */ jsx33(
|
|
9335
|
+
pending.length > 10 && /* @__PURE__ */ jsx33(Box30, { marginTop: 1, children: /* @__PURE__ */ jsxs31(Text31, { color: colors.textMuted, children: [
|
|
9289
9336
|
"... and ",
|
|
9290
9337
|
pending.length - 10,
|
|
9291
9338
|
" more"
|
|
9292
9339
|
] }) })
|
|
9293
9340
|
] }),
|
|
9294
|
-
pending.length === 0 && /* @__PURE__ */ jsx33(
|
|
9341
|
+
pending.length === 0 && /* @__PURE__ */ jsx33(Box30, { marginTop: 2, children: /* @__PURE__ */ jsxs31(Text31, { color: colors.success, children: [
|
|
9295
9342
|
icons.check,
|
|
9296
9343
|
" No pending approvals"
|
|
9297
9344
|
] }) }),
|
|
9298
|
-
/* @__PURE__ */ jsx33(
|
|
9345
|
+
/* @__PURE__ */ jsx33(Box30, { marginTop: 2, children: /* @__PURE__ */ jsxs31(Text31, { color: colors.textMuted, children: [
|
|
9299
9346
|
icons.info,
|
|
9300
9347
|
" Use",
|
|
9301
9348
|
" ",
|
|
9302
|
-
/* @__PURE__ */ jsx33(
|
|
9349
|
+
/* @__PURE__ */ jsx33(Text31, { color: colors.primary, children: "npx @intlpullhq/cli workflow approve <id>" }),
|
|
9303
9350
|
" to approve"
|
|
9304
9351
|
] }) })
|
|
9305
9352
|
] })
|
|
@@ -9309,7 +9356,7 @@ function WorkflowPendingCommand({ projectId }) {
|
|
|
9309
9356
|
const [loading, setLoading] = useState20(true);
|
|
9310
9357
|
const [error, setError] = useState20(null);
|
|
9311
9358
|
const [pending, setPending] = useState20([]);
|
|
9312
|
-
|
|
9359
|
+
useEffect17(() => {
|
|
9313
9360
|
async function fetchData() {
|
|
9314
9361
|
const resolved = getResolvedApiKey();
|
|
9315
9362
|
if (!resolved?.key) {
|
|
@@ -9336,19 +9383,19 @@ function WorkflowPendingCommand({ projectId }) {
|
|
|
9336
9383
|
}
|
|
9337
9384
|
fetchData();
|
|
9338
9385
|
}, [projectId]);
|
|
9339
|
-
return /* @__PURE__ */
|
|
9386
|
+
return /* @__PURE__ */ jsxs31(Box30, { flexDirection: "column", children: [
|
|
9340
9387
|
/* @__PURE__ */ jsx33(Header, { compact: true }),
|
|
9341
|
-
loading && /* @__PURE__ */ jsx33(
|
|
9388
|
+
loading && /* @__PURE__ */ jsx33(Box30, { marginY: 1, children: /* @__PURE__ */ jsx33(Spinner, { label: "Fetching pending approvals..." }) }),
|
|
9342
9389
|
error && /* @__PURE__ */ jsx33(Alert, { type: "error", title: "Error", children: error }),
|
|
9343
9390
|
!loading && !error && pending.length === 0 && /* @__PURE__ */ jsx33(Alert, { type: "success", title: "All Clear", children: "No pending approvals" }),
|
|
9344
|
-
!loading && !error && pending.length > 0 && /* @__PURE__ */
|
|
9345
|
-
/* @__PURE__ */ jsx33(
|
|
9391
|
+
!loading && !error && pending.length > 0 && /* @__PURE__ */ jsxs31(Box30, { flexDirection: "column", children: [
|
|
9392
|
+
/* @__PURE__ */ jsx33(Box30, { marginY: 1, children: /* @__PURE__ */ jsxs31(Text31, { bold: true, color: colors.warning, children: [
|
|
9346
9393
|
pending.length,
|
|
9347
9394
|
" Pending Approval",
|
|
9348
9395
|
pending.length !== 1 ? "s" : ""
|
|
9349
9396
|
] }) }),
|
|
9350
|
-
pending.map((p) => /* @__PURE__ */
|
|
9351
|
-
|
|
9397
|
+
pending.map((p) => /* @__PURE__ */ jsxs31(
|
|
9398
|
+
Box30,
|
|
9352
9399
|
{
|
|
9353
9400
|
borderStyle: "single",
|
|
9354
9401
|
borderColor: colors.textDim,
|
|
@@ -9357,33 +9404,33 @@ function WorkflowPendingCommand({ projectId }) {
|
|
|
9357
9404
|
marginBottom: 1,
|
|
9358
9405
|
flexDirection: "column",
|
|
9359
9406
|
children: [
|
|
9360
|
-
/* @__PURE__ */ jsx33(
|
|
9361
|
-
/* @__PURE__ */ jsx33(
|
|
9407
|
+
/* @__PURE__ */ jsx33(Box30, { children: /* @__PURE__ */ jsx33(Text31, { bold: true, color: colors.text, children: p.key }) }),
|
|
9408
|
+
/* @__PURE__ */ jsx33(Box30, { children: /* @__PURE__ */ jsxs31(Text31, { color: colors.textMuted, children: [
|
|
9362
9409
|
"Language: ",
|
|
9363
|
-
/* @__PURE__ */ jsx33(
|
|
9410
|
+
/* @__PURE__ */ jsx33(Text31, { color: colors.info, children: p.language }),
|
|
9364
9411
|
" | ",
|
|
9365
9412
|
"Namespace: ",
|
|
9366
|
-
/* @__PURE__ */ jsx33(
|
|
9413
|
+
/* @__PURE__ */ jsx33(Text31, { color: colors.info, children: p.namespace })
|
|
9367
9414
|
] }) }),
|
|
9368
|
-
/* @__PURE__ */ jsx33(
|
|
9415
|
+
/* @__PURE__ */ jsx33(Box30, { children: /* @__PURE__ */ jsxs31(Text31, { color: colors.textMuted, children: [
|
|
9369
9416
|
"Stage: ",
|
|
9370
|
-
/* @__PURE__ */ jsx33(
|
|
9371
|
-
p.required_role && /* @__PURE__ */
|
|
9417
|
+
/* @__PURE__ */ jsx33(Text31, { color: colors.warning, children: p.stage_name }),
|
|
9418
|
+
p.required_role && /* @__PURE__ */ jsxs31(Text31, { dimColor: true, children: [
|
|
9372
9419
|
" (requires: ",
|
|
9373
9420
|
p.required_role,
|
|
9374
9421
|
")"
|
|
9375
9422
|
] })
|
|
9376
9423
|
] }) }),
|
|
9377
|
-
/* @__PURE__ */ jsx33(
|
|
9424
|
+
/* @__PURE__ */ jsx33(Box30, { children: /* @__PURE__ */ jsxs31(Text31, { color: colors.textMuted, children: [
|
|
9378
9425
|
"Value: ",
|
|
9379
|
-
/* @__PURE__ */
|
|
9426
|
+
/* @__PURE__ */ jsxs31(Text31, { color: colors.text, children: [
|
|
9380
9427
|
'"',
|
|
9381
9428
|
p.value.substring(0, 50),
|
|
9382
9429
|
p.value.length > 50 ? "..." : "",
|
|
9383
9430
|
'"'
|
|
9384
9431
|
] })
|
|
9385
9432
|
] }) }),
|
|
9386
|
-
/* @__PURE__ */ jsx33(
|
|
9433
|
+
/* @__PURE__ */ jsx33(Box30, { marginTop: 1, children: /* @__PURE__ */ jsxs31(Text31, { dimColor: true, children: [
|
|
9387
9434
|
"ID: ",
|
|
9388
9435
|
p.translation_id
|
|
9389
9436
|
] }) })
|
|
@@ -9418,7 +9465,7 @@ function ApproveCommand({ projectId, translationId, comment }) {
|
|
|
9418
9465
|
const [error, setError] = useState20(null);
|
|
9419
9466
|
const [success, setSuccess] = useState20(false);
|
|
9420
9467
|
const [stageName, setStageName] = useState20("");
|
|
9421
|
-
|
|
9468
|
+
useEffect17(() => {
|
|
9422
9469
|
async function approve() {
|
|
9423
9470
|
const resolved = getResolvedApiKey();
|
|
9424
9471
|
if (!resolved?.key) {
|
|
@@ -9447,15 +9494,15 @@ function ApproveCommand({ projectId, translationId, comment }) {
|
|
|
9447
9494
|
}
|
|
9448
9495
|
approve();
|
|
9449
9496
|
}, [projectId, translationId, comment]);
|
|
9450
|
-
return /* @__PURE__ */
|
|
9497
|
+
return /* @__PURE__ */ jsxs31(Box30, { flexDirection: "column", children: [
|
|
9451
9498
|
/* @__PURE__ */ jsx33(Header, { compact: true }),
|
|
9452
|
-
loading && /* @__PURE__ */ jsx33(
|
|
9499
|
+
loading && /* @__PURE__ */ jsx33(Box30, { marginY: 1, children: /* @__PURE__ */ jsx33(Spinner, { label: "Approving translation..." }) }),
|
|
9453
9500
|
error && /* @__PURE__ */ jsx33(Alert, { type: "error", title: "Approval Failed", children: error }),
|
|
9454
|
-
success && /* @__PURE__ */
|
|
9501
|
+
success && /* @__PURE__ */ jsxs31(Alert, { type: "success", title: "Approved", children: [
|
|
9455
9502
|
'Translation approved at stage "',
|
|
9456
9503
|
stageName,
|
|
9457
9504
|
'"',
|
|
9458
|
-
comment && /* @__PURE__ */
|
|
9505
|
+
comment && /* @__PURE__ */ jsxs31(Fragment5, { children: [
|
|
9459
9506
|
"\n",
|
|
9460
9507
|
"Comment: ",
|
|
9461
9508
|
comment
|
|
@@ -9467,7 +9514,7 @@ function RejectCommand({ projectId, translationId, reason }) {
|
|
|
9467
9514
|
const [loading, setLoading] = useState20(true);
|
|
9468
9515
|
const [error, setError] = useState20(null);
|
|
9469
9516
|
const [success, setSuccess] = useState20(false);
|
|
9470
|
-
|
|
9517
|
+
useEffect17(() => {
|
|
9471
9518
|
async function reject() {
|
|
9472
9519
|
const resolved = getResolvedApiKey();
|
|
9473
9520
|
if (!resolved?.key) {
|
|
@@ -9495,11 +9542,11 @@ function RejectCommand({ projectId, translationId, reason }) {
|
|
|
9495
9542
|
}
|
|
9496
9543
|
reject();
|
|
9497
9544
|
}, [projectId, translationId, reason]);
|
|
9498
|
-
return /* @__PURE__ */
|
|
9545
|
+
return /* @__PURE__ */ jsxs31(Box30, { flexDirection: "column", children: [
|
|
9499
9546
|
/* @__PURE__ */ jsx33(Header, { compact: true }),
|
|
9500
|
-
loading && /* @__PURE__ */ jsx33(
|
|
9547
|
+
loading && /* @__PURE__ */ jsx33(Box30, { marginY: 1, children: /* @__PURE__ */ jsx33(Spinner, { label: "Rejecting translation..." }) }),
|
|
9501
9548
|
error && /* @__PURE__ */ jsx33(Alert, { type: "error", title: "Rejection Failed", children: error }),
|
|
9502
|
-
success && /* @__PURE__ */
|
|
9549
|
+
success && /* @__PURE__ */ jsxs31(Alert, { type: "warning", title: "Rejected", children: [
|
|
9503
9550
|
'Translation rejected with reason: "',
|
|
9504
9551
|
reason,
|
|
9505
9552
|
'"'
|
|
@@ -9775,9 +9822,9 @@ async function runEmailsStatus(options) {
|
|
|
9775
9822
|
}
|
|
9776
9823
|
|
|
9777
9824
|
// src/commands/zendesk.tsx
|
|
9778
|
-
import { useState as useState21, useEffect as
|
|
9779
|
-
import { render as render17, Box as
|
|
9780
|
-
import { Fragment as Fragment6, jsx as jsx34, jsxs as
|
|
9825
|
+
import { useState as useState21, useEffect as useEffect18 } from "react";
|
|
9826
|
+
import { render as render17, Box as Box31, Text as Text32 } from "ink";
|
|
9827
|
+
import { Fragment as Fragment6, jsx as jsx34, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
9781
9828
|
async function fetchZendeskIntegration(apiUrl, apiKey, projectId) {
|
|
9782
9829
|
const response = await fetch(`${apiUrl}/api/v1/projects/${projectId}/integrations/zendesk`, {
|
|
9783
9830
|
headers: { Accept: "application/json", "X-API-Key": apiKey }
|
|
@@ -9852,7 +9899,7 @@ function ZendeskStatusCommand() {
|
|
|
9852
9899
|
const [integration, setIntegration] = useState21(null);
|
|
9853
9900
|
const [status, setStatus] = useState21(null);
|
|
9854
9901
|
const [error, setError] = useState21(null);
|
|
9855
|
-
|
|
9902
|
+
useEffect18(() => {
|
|
9856
9903
|
async function fetch2() {
|
|
9857
9904
|
const resolved = getResolvedApiKey();
|
|
9858
9905
|
if (!resolved?.key) {
|
|
@@ -9884,54 +9931,54 @@ function ZendeskStatusCommand() {
|
|
|
9884
9931
|
}
|
|
9885
9932
|
fetch2();
|
|
9886
9933
|
}, []);
|
|
9887
|
-
return /* @__PURE__ */
|
|
9934
|
+
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", children: [
|
|
9888
9935
|
/* @__PURE__ */ jsx34(Header, { compact: true }),
|
|
9889
9936
|
loading && /* @__PURE__ */ jsx34(Spinner, { label: "Fetching Zendesk status..." }),
|
|
9890
9937
|
error && /* @__PURE__ */ jsx34(Alert, { type: "error", title: "Error", children: error }),
|
|
9891
9938
|
integration && !integration.connected && /* @__PURE__ */ jsx34(Alert, { type: "warning", title: "Not Connected", children: "Zendesk is not connected. Run: npx @intlpullhq/cli zendesk connect --subdomain YOUR_SUBDOMAIN --email YOUR_EMAIL --token YOUR_TOKEN" }),
|
|
9892
|
-
integration?.connected && integration.integration && /* @__PURE__ */
|
|
9893
|
-
/* @__PURE__ */ jsx34(
|
|
9894
|
-
/* @__PURE__ */
|
|
9939
|
+
integration?.connected && integration.integration && /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", marginY: 1, children: [
|
|
9940
|
+
/* @__PURE__ */ jsx34(Box31, { borderStyle: "round", borderColor: colors.success, paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", children: [
|
|
9941
|
+
/* @__PURE__ */ jsxs32(Text32, { bold: true, color: colors.success, children: [
|
|
9895
9942
|
icons.success,
|
|
9896
9943
|
" Connected to Zendesk"
|
|
9897
9944
|
] }),
|
|
9898
|
-
/* @__PURE__ */
|
|
9945
|
+
/* @__PURE__ */ jsxs32(Text32, { color: colors.textMuted, children: [
|
|
9899
9946
|
"Subdomain: ",
|
|
9900
9947
|
integration.integration.subdomain,
|
|
9901
9948
|
".zendesk.com"
|
|
9902
9949
|
] }),
|
|
9903
|
-
/* @__PURE__ */
|
|
9950
|
+
/* @__PURE__ */ jsxs32(Text32, { color: colors.textMuted, children: [
|
|
9904
9951
|
"Source Locale: ",
|
|
9905
9952
|
integration.integration.source_locale
|
|
9906
9953
|
] }),
|
|
9907
|
-
integration.integration.last_sync_at && /* @__PURE__ */
|
|
9954
|
+
integration.integration.last_sync_at && /* @__PURE__ */ jsxs32(Text32, { color: colors.textMuted, children: [
|
|
9908
9955
|
"Last Sync: ",
|
|
9909
9956
|
new Date(integration.integration.last_sync_at).toLocaleString()
|
|
9910
9957
|
] })
|
|
9911
9958
|
] }) }),
|
|
9912
|
-
status && /* @__PURE__ */
|
|
9913
|
-
/* @__PURE__ */ jsx34(
|
|
9914
|
-
/* @__PURE__ */
|
|
9959
|
+
status && /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", marginTop: 1, children: [
|
|
9960
|
+
/* @__PURE__ */ jsx34(Text32, { bold: true, children: "Content Summary" }),
|
|
9961
|
+
/* @__PURE__ */ jsxs32(Text32, { color: colors.textMuted, children: [
|
|
9915
9962
|
icons.bullet,
|
|
9916
9963
|
" ",
|
|
9917
9964
|
status.total_articles,
|
|
9918
9965
|
" articles"
|
|
9919
9966
|
] }),
|
|
9920
|
-
/* @__PURE__ */
|
|
9967
|
+
/* @__PURE__ */ jsxs32(Text32, { color: colors.textMuted, children: [
|
|
9921
9968
|
icons.bullet,
|
|
9922
9969
|
" ",
|
|
9923
9970
|
status.total_categories,
|
|
9924
9971
|
" categories"
|
|
9925
9972
|
] }),
|
|
9926
|
-
/* @__PURE__ */
|
|
9973
|
+
/* @__PURE__ */ jsxs32(Text32, { color: colors.textMuted, children: [
|
|
9927
9974
|
icons.bullet,
|
|
9928
9975
|
" ",
|
|
9929
9976
|
status.total_sections,
|
|
9930
9977
|
" sections"
|
|
9931
9978
|
] }),
|
|
9932
|
-
status.target_locales.length > 0 && /* @__PURE__ */
|
|
9933
|
-
/* @__PURE__ */ jsx34(
|
|
9934
|
-
status.target_locales.map((locale) => /* @__PURE__ */
|
|
9979
|
+
status.target_locales.length > 0 && /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", marginTop: 1, children: [
|
|
9980
|
+
/* @__PURE__ */ jsx34(Text32, { bold: true, children: "Translation Progress" }),
|
|
9981
|
+
status.target_locales.map((locale) => /* @__PURE__ */ jsxs32(Text32, { color: colors.textMuted, children: [
|
|
9935
9982
|
icons.bullet,
|
|
9936
9983
|
" ",
|
|
9937
9984
|
locale,
|
|
@@ -9950,7 +9997,7 @@ function ZendeskConnectCommand({ subdomain, email, token }) {
|
|
|
9950
9997
|
const [loading, setLoading] = useState21(true);
|
|
9951
9998
|
const [result, setResult] = useState21(null);
|
|
9952
9999
|
const [error, setError] = useState21(null);
|
|
9953
|
-
|
|
10000
|
+
useEffect18(() => {
|
|
9954
10001
|
async function connect() {
|
|
9955
10002
|
const resolved = getResolvedApiKey();
|
|
9956
10003
|
if (!resolved?.key) {
|
|
@@ -9978,11 +10025,11 @@ function ZendeskConnectCommand({ subdomain, email, token }) {
|
|
|
9978
10025
|
}
|
|
9979
10026
|
connect();
|
|
9980
10027
|
}, [subdomain, email, token]);
|
|
9981
|
-
return /* @__PURE__ */
|
|
10028
|
+
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", children: [
|
|
9982
10029
|
/* @__PURE__ */ jsx34(Header, { compact: true }),
|
|
9983
10030
|
loading && /* @__PURE__ */ jsx34(Spinner, { label: "Connecting to Zendesk..." }),
|
|
9984
10031
|
error && /* @__PURE__ */ jsx34(Alert, { type: "error", title: "Connection Failed", children: error }),
|
|
9985
|
-
result?.connected && /* @__PURE__ */
|
|
10032
|
+
result?.connected && /* @__PURE__ */ jsxs32(Alert, { type: "success", title: "Connected!", children: [
|
|
9986
10033
|
"Successfully connected to ",
|
|
9987
10034
|
subdomain,
|
|
9988
10035
|
".zendesk.com",
|
|
@@ -9995,7 +10042,7 @@ function ZendeskSyncCommand({ direction, locale, excludeDrafts, autoTranslate, t
|
|
|
9995
10042
|
const [loading, setLoading] = useState21(true);
|
|
9996
10043
|
const [result, setResult] = useState21(null);
|
|
9997
10044
|
const [error, setError] = useState21(null);
|
|
9998
|
-
|
|
10045
|
+
useEffect18(() => {
|
|
9999
10046
|
async function sync() {
|
|
10000
10047
|
const resolved = getResolvedApiKey();
|
|
10001
10048
|
if (!resolved?.key) {
|
|
@@ -10037,11 +10084,11 @@ function ZendeskSyncCommand({ direction, locale, excludeDrafts, autoTranslate, t
|
|
|
10037
10084
|
}
|
|
10038
10085
|
sync();
|
|
10039
10086
|
}, [direction, locale, excludeDrafts, autoTranslate, translateProvider]);
|
|
10040
|
-
return /* @__PURE__ */
|
|
10087
|
+
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", children: [
|
|
10041
10088
|
/* @__PURE__ */ jsx34(Header, { compact: true }),
|
|
10042
10089
|
loading && /* @__PURE__ */ jsx34(Spinner, { label: `${direction === "pull" ? "Pulling from" : "Pushing to"} Zendesk...${autoTranslate ? " (with auto-translation)" : ""}` }),
|
|
10043
10090
|
error && /* @__PURE__ */ jsx34(Alert, { type: "error", title: "Sync Failed", children: error }),
|
|
10044
|
-
result?.success && /* @__PURE__ */ jsx34(Alert, { type: "success", title: "Sync Complete", children: direction === "pull" ? /* @__PURE__ */
|
|
10091
|
+
result?.success && /* @__PURE__ */ jsx34(Alert, { type: "success", title: "Sync Complete", children: direction === "pull" ? /* @__PURE__ */ jsxs32(Fragment6, { children: [
|
|
10045
10092
|
"Imported ",
|
|
10046
10093
|
result.articles_synced,
|
|
10047
10094
|
" articles, ",
|
|
@@ -10054,12 +10101,12 @@ function ZendeskSyncCommand({ direction, locale, excludeDrafts, autoTranslate, t
|
|
|
10054
10101
|
result.keys_created,
|
|
10055
10102
|
", updated: ",
|
|
10056
10103
|
result.keys_updated,
|
|
10057
|
-
result.auto_translate_job && /* @__PURE__ */
|
|
10104
|
+
result.auto_translate_job && /* @__PURE__ */ jsxs32(Fragment6, { children: [
|
|
10058
10105
|
"\n",
|
|
10059
10106
|
"Auto-translation started: ",
|
|
10060
10107
|
result.auto_translate_job
|
|
10061
10108
|
] })
|
|
10062
|
-
] }) : /* @__PURE__ */
|
|
10109
|
+
] }) : /* @__PURE__ */ jsxs32(Fragment6, { children: [
|
|
10063
10110
|
"Pushed translations for ",
|
|
10064
10111
|
result.articles_synced,
|
|
10065
10112
|
" articles to Zendesk"
|
|
@@ -10071,7 +10118,7 @@ function ZendeskDisconnectCommand() {
|
|
|
10071
10118
|
const [loading, setLoading] = useState21(true);
|
|
10072
10119
|
const [success, setSuccess] = useState21(false);
|
|
10073
10120
|
const [error, setError] = useState21(null);
|
|
10074
|
-
|
|
10121
|
+
useEffect18(() => {
|
|
10075
10122
|
async function disconnect() {
|
|
10076
10123
|
const resolved = getResolvedApiKey();
|
|
10077
10124
|
if (!resolved?.key) {
|
|
@@ -10099,7 +10146,7 @@ function ZendeskDisconnectCommand() {
|
|
|
10099
10146
|
}
|
|
10100
10147
|
disconnect();
|
|
10101
10148
|
}, []);
|
|
10102
|
-
return /* @__PURE__ */
|
|
10149
|
+
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", children: [
|
|
10103
10150
|
/* @__PURE__ */ jsx34(Header, { compact: true }),
|
|
10104
10151
|
loading && /* @__PURE__ */ jsx34(Spinner, { label: "Disconnecting..." }),
|
|
10105
10152
|
error && /* @__PURE__ */ jsx34(Alert, { type: "error", title: "Error", children: error }),
|
|
@@ -10112,9 +10159,9 @@ function runZendeskStatus() {
|
|
|
10112
10159
|
function runZendeskConnect(options) {
|
|
10113
10160
|
if (!options.subdomain || !options.email || !options.token) {
|
|
10114
10161
|
render17(
|
|
10115
|
-
/* @__PURE__ */
|
|
10162
|
+
/* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", children: [
|
|
10116
10163
|
/* @__PURE__ */ jsx34(Header, { compact: true }),
|
|
10117
|
-
/* @__PURE__ */
|
|
10164
|
+
/* @__PURE__ */ jsxs32(Alert, { type: "error", title: "Missing Options", children: [
|
|
10118
10165
|
"Required: --subdomain, --email, --token",
|
|
10119
10166
|
"\n",
|
|
10120
10167
|
"Example: npx @intlpullhq/cli zendesk connect --subdomain mycompany --email admin@example.com --token YOUR_API_TOKEN"
|
|
@@ -10148,10 +10195,10 @@ function runZendeskDisconnect() {
|
|
|
10148
10195
|
import { Command } from "commander";
|
|
10149
10196
|
|
|
10150
10197
|
// src/commands/documents/list.tsx
|
|
10151
|
-
import { useState as useState22, useEffect as
|
|
10152
|
-
import { render as render18, Box as
|
|
10198
|
+
import { useState as useState22, useEffect as useEffect19 } from "react";
|
|
10199
|
+
import { render as render18, Box as Box32, Text as Text33, Newline } from "ink";
|
|
10153
10200
|
import Spinner15 from "ink-spinner";
|
|
10154
|
-
import { jsx as jsx35, jsxs as
|
|
10201
|
+
import { jsx as jsx35, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
10155
10202
|
function SimpleTable({ data }) {
|
|
10156
10203
|
if (data.length === 0) return null;
|
|
10157
10204
|
const headers = Object.keys(data[0]);
|
|
@@ -10159,27 +10206,27 @@ function SimpleTable({ data }) {
|
|
|
10159
10206
|
(h) => Math.max(h.length, ...data.map((row) => String(row[h] || "").length))
|
|
10160
10207
|
);
|
|
10161
10208
|
const separator = "\u2500".repeat(colWidths.reduce((a, b) => a + b + 3, 1));
|
|
10162
|
-
return /* @__PURE__ */
|
|
10163
|
-
/* @__PURE__ */ jsx35(
|
|
10164
|
-
/* @__PURE__ */
|
|
10209
|
+
return /* @__PURE__ */ jsxs33(Box32, { flexDirection: "column", children: [
|
|
10210
|
+
/* @__PURE__ */ jsx35(Text33, { children: separator }),
|
|
10211
|
+
/* @__PURE__ */ jsxs33(Text33, { children: [
|
|
10165
10212
|
"\u2502 ",
|
|
10166
10213
|
headers.map((h, i) => h.padEnd(colWidths[i])).join(" \u2502 "),
|
|
10167
10214
|
" \u2502"
|
|
10168
10215
|
] }),
|
|
10169
|
-
/* @__PURE__ */ jsx35(
|
|
10170
|
-
data.map((row, rowIdx) => /* @__PURE__ */
|
|
10216
|
+
/* @__PURE__ */ jsx35(Text33, { children: separator }),
|
|
10217
|
+
data.map((row, rowIdx) => /* @__PURE__ */ jsxs33(Text33, { children: [
|
|
10171
10218
|
"\u2502 ",
|
|
10172
10219
|
headers.map((h, i) => String(row[h] || "").padEnd(colWidths[i])).join(" \u2502 "),
|
|
10173
10220
|
" \u2502"
|
|
10174
10221
|
] }, rowIdx)),
|
|
10175
|
-
/* @__PURE__ */ jsx35(
|
|
10222
|
+
/* @__PURE__ */ jsx35(Text33, { children: separator })
|
|
10176
10223
|
] });
|
|
10177
10224
|
}
|
|
10178
10225
|
var DocumentsList = ({ project }) => {
|
|
10179
10226
|
const [documents, setDocuments] = useState22([]);
|
|
10180
10227
|
const [isLoading, setIsLoading] = useState22(true);
|
|
10181
10228
|
const [error, setError] = useState22(null);
|
|
10182
|
-
|
|
10229
|
+
useEffect19(() => {
|
|
10183
10230
|
const fetchDocuments = async () => {
|
|
10184
10231
|
try {
|
|
10185
10232
|
const config = getProjectConfig();
|
|
@@ -10201,19 +10248,19 @@ var DocumentsList = ({ project }) => {
|
|
|
10201
10248
|
fetchDocuments();
|
|
10202
10249
|
}, [project]);
|
|
10203
10250
|
if (error) {
|
|
10204
|
-
return /* @__PURE__ */
|
|
10251
|
+
return /* @__PURE__ */ jsxs33(Text33, { color: "red", children: [
|
|
10205
10252
|
"Error: ",
|
|
10206
10253
|
error
|
|
10207
10254
|
] });
|
|
10208
10255
|
}
|
|
10209
10256
|
if (isLoading) {
|
|
10210
|
-
return /* @__PURE__ */
|
|
10211
|
-
/* @__PURE__ */ jsx35(
|
|
10257
|
+
return /* @__PURE__ */ jsxs33(Text33, { children: [
|
|
10258
|
+
/* @__PURE__ */ jsx35(Text33, { color: "green", children: /* @__PURE__ */ jsx35(Spinner15, { type: "dots" }) }),
|
|
10212
10259
|
" Loading documents..."
|
|
10213
10260
|
] });
|
|
10214
10261
|
}
|
|
10215
10262
|
if (documents.length === 0) {
|
|
10216
|
-
return /* @__PURE__ */ jsx35(
|
|
10263
|
+
return /* @__PURE__ */ jsx35(Text33, { children: "No documents found." });
|
|
10217
10264
|
}
|
|
10218
10265
|
const data = documents.map((doc) => ({
|
|
10219
10266
|
ID: doc.id.substring(0, 8) + "...",
|
|
@@ -10221,8 +10268,8 @@ var DocumentsList = ({ project }) => {
|
|
|
10221
10268
|
Status: doc.status,
|
|
10222
10269
|
Created: new Date(doc.created_at).toLocaleDateString()
|
|
10223
10270
|
}));
|
|
10224
|
-
return /* @__PURE__ */
|
|
10225
|
-
/* @__PURE__ */
|
|
10271
|
+
return /* @__PURE__ */ jsxs33(Box32, { flexDirection: "column", children: [
|
|
10272
|
+
/* @__PURE__ */ jsxs33(Text33, { children: [
|
|
10226
10273
|
"Target Project: ",
|
|
10227
10274
|
project || "Current"
|
|
10228
10275
|
] }),
|
|
@@ -10235,16 +10282,16 @@ function runDocumentsList(options) {
|
|
|
10235
10282
|
}
|
|
10236
10283
|
|
|
10237
10284
|
// src/commands/documents/upload.tsx
|
|
10238
|
-
import { useState as useState23, useEffect as
|
|
10239
|
-
import { render as render19, Text as
|
|
10285
|
+
import { useState as useState23, useEffect as useEffect20 } from "react";
|
|
10286
|
+
import { render as render19, Text as Text34 } from "ink";
|
|
10240
10287
|
import Spinner16 from "ink-spinner";
|
|
10241
10288
|
import fs2 from "fs";
|
|
10242
10289
|
import path2 from "path";
|
|
10243
|
-
import { jsx as jsx36, jsxs as
|
|
10290
|
+
import { jsx as jsx36, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
10244
10291
|
var DocumentsUpload = ({ file, project, source, target }) => {
|
|
10245
10292
|
const [status, setStatus] = useState23("uploading");
|
|
10246
10293
|
const [message, setMessage] = useState23("Uploading document...");
|
|
10247
|
-
|
|
10294
|
+
useEffect20(() => {
|
|
10248
10295
|
const upload = async () => {
|
|
10249
10296
|
try {
|
|
10250
10297
|
const config = getProjectConfig();
|
|
@@ -10275,19 +10322,19 @@ var DocumentsUpload = ({ file, project, source, target }) => {
|
|
|
10275
10322
|
upload();
|
|
10276
10323
|
}, [file, project, source, target]);
|
|
10277
10324
|
if (status === "error") {
|
|
10278
|
-
return /* @__PURE__ */
|
|
10325
|
+
return /* @__PURE__ */ jsxs34(Text34, { color: "red", children: [
|
|
10279
10326
|
"Error: ",
|
|
10280
10327
|
message
|
|
10281
10328
|
] });
|
|
10282
10329
|
}
|
|
10283
10330
|
if (status === "success") {
|
|
10284
|
-
return /* @__PURE__ */
|
|
10331
|
+
return /* @__PURE__ */ jsxs34(Text34, { color: "green", children: [
|
|
10285
10332
|
"\u2713 ",
|
|
10286
10333
|
message
|
|
10287
10334
|
] });
|
|
10288
10335
|
}
|
|
10289
|
-
return /* @__PURE__ */
|
|
10290
|
-
/* @__PURE__ */ jsx36(
|
|
10336
|
+
return /* @__PURE__ */ jsxs34(Text34, { children: [
|
|
10337
|
+
/* @__PURE__ */ jsx36(Text34, { color: "green", children: /* @__PURE__ */ jsx36(Spinner16, { type: "dots" }) }),
|
|
10291
10338
|
" ",
|
|
10292
10339
|
message
|
|
10293
10340
|
] });
|
|
@@ -10297,16 +10344,16 @@ function runDocumentsUpload(options) {
|
|
|
10297
10344
|
}
|
|
10298
10345
|
|
|
10299
10346
|
// src/commands/documents/download.tsx
|
|
10300
|
-
import { useState as useState24, useEffect as
|
|
10301
|
-
import { render as render20, Text as
|
|
10347
|
+
import { useState as useState24, useEffect as useEffect21 } from "react";
|
|
10348
|
+
import { render as render20, Text as Text35 } from "ink";
|
|
10302
10349
|
import Spinner17 from "ink-spinner";
|
|
10303
10350
|
import fs3 from "fs";
|
|
10304
10351
|
import path3 from "path";
|
|
10305
|
-
import { jsx as jsx37, jsxs as
|
|
10352
|
+
import { jsx as jsx37, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
10306
10353
|
var DocumentsDownload = ({ documentId, language, project, output }) => {
|
|
10307
10354
|
const [status, setStatus] = useState24("downloading");
|
|
10308
10355
|
const [message, setMessage] = useState24("Downloading document...");
|
|
10309
|
-
|
|
10356
|
+
useEffect21(() => {
|
|
10310
10357
|
const download = async () => {
|
|
10311
10358
|
try {
|
|
10312
10359
|
const config = getProjectConfig();
|
|
@@ -10336,19 +10383,19 @@ var DocumentsDownload = ({ documentId, language, project, output }) => {
|
|
|
10336
10383
|
download();
|
|
10337
10384
|
}, [documentId, language, project, output]);
|
|
10338
10385
|
if (status === "error") {
|
|
10339
|
-
return /* @__PURE__ */
|
|
10386
|
+
return /* @__PURE__ */ jsxs35(Text35, { color: "red", children: [
|
|
10340
10387
|
"Error: ",
|
|
10341
10388
|
message
|
|
10342
10389
|
] });
|
|
10343
10390
|
}
|
|
10344
10391
|
if (status === "success") {
|
|
10345
|
-
return /* @__PURE__ */
|
|
10392
|
+
return /* @__PURE__ */ jsxs35(Text35, { color: "green", children: [
|
|
10346
10393
|
"\u2713 ",
|
|
10347
10394
|
message
|
|
10348
10395
|
] });
|
|
10349
10396
|
}
|
|
10350
|
-
return /* @__PURE__ */
|
|
10351
|
-
/* @__PURE__ */ jsx37(
|
|
10397
|
+
return /* @__PURE__ */ jsxs35(Text35, { children: [
|
|
10398
|
+
/* @__PURE__ */ jsx37(Text35, { color: "green", children: /* @__PURE__ */ jsx37(Spinner17, { type: "dots" }) }),
|
|
10352
10399
|
" ",
|
|
10353
10400
|
message
|
|
10354
10401
|
] });
|
|
@@ -10383,7 +10430,7 @@ documentsCommand.command("download").description("Download a translated document
|
|
|
10383
10430
|
|
|
10384
10431
|
// src/index.tsx
|
|
10385
10432
|
var program = new Command2();
|
|
10386
|
-
program.name("intlpull").description("Intelligent i18n CLI for modern apps").version("0.1.
|
|
10433
|
+
program.name("intlpull").description("Intelligent i18n CLI for modern apps").version("0.1.4").option("--env-file <path>", "Path to custom env file (e.g., .env.production)").hook("preAction", (thisCommand) => {
|
|
10387
10434
|
const envFile = thisCommand.opts().envFile;
|
|
10388
10435
|
if (envFile) {
|
|
10389
10436
|
setCustomEnvFile(envFile);
|