@translatize/cli
Advanced tools
@@ -8,3 +8,3 @@ import type { GlobalOpts } from "./shared.js"; | ||
| } | ||
| /** `translatize init` — scaffold translatize.config.json, validating the token when available. */ | ||
| /** `translatize init` – scaffold translatize.config.json, validating the token when available. */ | ||
| export declare function initCommand(opts: InitOpts): Promise<number>; |
@@ -6,3 +6,3 @@ import { existsSync, writeFileSync } from "node:fs"; | ||
| import { createColors, describeApiError, info } from "../ui.js"; | ||
| /** `translatize init` — scaffold translatize.config.json, validating the token when available. */ | ||
| /** `translatize init` – scaffold translatize.config.json, validating the token when available. */ | ||
| export async function initCommand(opts) { | ||
@@ -70,3 +70,3 @@ const colors = createColors(); | ||
| info(""); | ||
| info(colors.dim('Note: projectId is empty — it will be derived from your token at runtime. ' + | ||
| info(colors.dim('Note: projectId is empty – it will be derived from your token at runtime. ' + | ||
| "Set it in the config to pin the project.")); | ||
@@ -73,0 +73,0 @@ } |
@@ -6,3 +6,3 @@ import { type GlobalOpts } from "./shared.js"; | ||
| } | ||
| /** `translatize pull` — download the branch and write one file per language. */ | ||
| /** `translatize pull` – download the branch and write one file per language. */ | ||
| export declare function pullCommand(opts: PullOpts): Promise<number>; |
@@ -6,3 +6,3 @@ import { assemblePull, computeFilePlan } from "../diff.js"; | ||
| import { buildContext, listOptions, warnOnProjectMismatch } from "./shared.js"; | ||
| /** `translatize pull` — download the branch and write one file per language. */ | ||
| /** `translatize pull` – download the branch and write one file per language. */ | ||
| export async function pullCommand(opts) { | ||
@@ -51,3 +51,3 @@ const colors = createColors(); | ||
| const suffix = dryRun ? colors.dim(" (dry run)") : ""; | ||
| info(`Pulling from "${colors.bold(project)}" (branch ${colors.bold(branch)}) — ` + | ||
| info(`Pulling from "${colors.bold(project)}" (branch ${colors.bold(branch)}) – ` + | ||
| `${results.length} language(s), ${remoteKeys} key(s)${suffix}`); | ||
@@ -68,6 +68,6 @@ if (results.length === 0) { | ||
| const pending = results.filter((result) => result.status !== "unchanged").length; | ||
| info(pending > 0 ? colors.dim(`Dry run — ${pending} file(s) would change, none written.`) : colors.dim("Dry run — everything is up to date.")); | ||
| info(pending > 0 ? colors.dim(`Dry run – ${pending} file(s) would change, none written.`) : colors.dim("Dry run – everything is up to date.")); | ||
| } | ||
| else { | ||
| info(writes > 0 ? colors.green(`Wrote ${writes} file(s).`) : colors.dim("Already up to date — nothing written.")); | ||
| info(writes > 0 ? colors.green(`Wrote ${writes} file(s).`) : colors.dim("Already up to date – nothing written.")); | ||
| } | ||
@@ -74,0 +74,0 @@ } |
@@ -6,3 +6,3 @@ import { type GlobalOpts } from "./shared.js"; | ||
| } | ||
| /** `translatize push` — upload new and changed local keys to the branch (never deletes). */ | ||
| /** `translatize push` – upload new and changed local keys to the branch (never deletes). */ | ||
| export declare function pushCommand(opts: PushOpts): Promise<number>; |
@@ -6,3 +6,3 @@ import { assembleLocal, computePushDiff, filterFilesByNamespace } from "../diff.js"; | ||
| import { buildContext, listOptions, warnOnProjectMismatch } from "./shared.js"; | ||
| /** `translatize push` — upload new and changed local keys to the branch (never deletes). */ | ||
| /** `translatize push` – upload new and changed local keys to the branch (never deletes). */ | ||
| export async function pushCommand(opts) { | ||
@@ -88,5 +88,5 @@ const colors = createColors(); | ||
| const pending = plan.create.length + plan.update.length; | ||
| info(`Push preview (branch ${colors.bold(branch)}) — ${colors.dim("dry run, nothing sent")}`); | ||
| info(`Push preview (branch ${colors.bold(branch)}) – ${colors.dim("dry run, nothing sent")}`); | ||
| if (pending === 0) { | ||
| info(colors.green(" Nothing to push — remote is up to date.")); | ||
| info(colors.green(" Nothing to push – remote is up to date.")); | ||
| } | ||
@@ -93,0 +93,0 @@ else { |
@@ -9,3 +9,3 @@ import { TranslatizeClient, type MeResponse } from "@translatize/core"; | ||
| apiUrl?: string; | ||
| /** `--branch` — only registered on pull/push/status; init ignores it. */ | ||
| /** `--branch` – only registered on pull/push/status; init ignores it. */ | ||
| branch?: string; | ||
@@ -12,0 +12,0 @@ } |
@@ -7,3 +7,3 @@ import { type GlobalOpts } from "./shared.js"; | ||
| } | ||
| /** `translatize status` — compare local files with the branch; the CI gate. */ | ||
| /** `translatize status` – compare local files with the branch; the CI gate. */ | ||
| export declare function statusCommand(opts: StatusOpts): Promise<number>; |
@@ -5,3 +5,3 @@ import { computeStatus, filterFilesByNamespace } from "../diff.js"; | ||
| import { buildContext, listOptions, warnOnProjectMismatch } from "./shared.js"; | ||
| /** `translatize status` — compare local files with the branch; the CI gate. */ | ||
| /** `translatize status` – compare local files with the branch; the CI gate. */ | ||
| export async function statusCommand(opts) { | ||
@@ -51,3 +51,3 @@ const colors = createColors(); | ||
| function renderStatus(colors, project, branch, status) { | ||
| info(`Status of "${colors.bold(project)}" (branch ${colors.bold(branch)}) — ${status.totalRemoteKeys} remote key(s)`); | ||
| info(`Status of "${colors.bold(project)}" (branch ${colors.bold(branch)}) – ${status.totalRemoteKeys} remote key(s)`); | ||
| info(""); | ||
@@ -82,7 +82,7 @@ const rows = status.languages.map((langStat) => [langStat.lang, `${langStat.translated}/${langStat.total}`, `${percent(langStat.translated, langStat.total)}%`]); | ||
| if (status.hasMissing || status.hasDiff) { | ||
| info(colors.yellow("Differences found (no gate enabled — exit 0).")); | ||
| info(colors.yellow("Differences found (no gate enabled – exit 0).")); | ||
| } | ||
| else { | ||
| info(colors.green("In sync — local files match the branch.")); | ||
| info(colors.green("In sync – local files match the branch.")); | ||
| } | ||
| } |
+1
-1
@@ -23,3 +23,3 @@ /** The two on-disk shapes the CLI reads and writes. */ | ||
| /** | ||
| * A problem with the user's input — bad flags, an invalid or missing config, a | ||
| * A problem with the user's input – bad flags, an invalid or missing config, a | ||
| * malformed local file, or a missing token. Maps to process exit code 2. | ||
@@ -26,0 +26,0 @@ */ |
+1
-1
@@ -8,3 +8,3 @@ import { readFileSync } from "node:fs"; | ||
| /** | ||
| * A problem with the user's input — bad flags, an invalid or missing config, a | ||
| * A problem with the user's input – bad flags, an invalid or missing config, a | ||
| * malformed local file, or a missing token. Maps to process exit code 2. | ||
@@ -11,0 +11,0 @@ */ |
+1
-1
@@ -29,3 +29,3 @@ import type { LabelRecord } from "@translatize/core"; | ||
| unchanged: string[]; | ||
| /** Remote keys with no non-empty local value — never deleted by push, only reported. */ | ||
| /** Remote keys with no non-empty local value – never deleted by push, only reported. */ | ||
| remoteOnly: string[]; | ||
@@ -32,0 +32,0 @@ } |
+1
-1
@@ -30,3 +30,3 @@ #!/usr/bin/env node | ||
| .name("translatize") | ||
| .description("Translation management with git-like branching — sync your app's translations from CI.") | ||
| .description("Translation management with git-like branching – sync your app's translations from CI.") | ||
| .version(VERSION, "-v, --version") | ||
@@ -33,0 +33,0 @@ .exitOverride(); |
@@ -16,5 +16,5 @@ import { type TranslationFormat } from "./config.js"; | ||
| * JSON objects (nested objects are flattened; a flat file passes through unchanged). | ||
| * Throws {@link UsageError} — naming `filename` — on invalid JSON, a non-object root, | ||
| * Throws {@link UsageError} – naming `filename` – on invalid JSON, a non-object root, | ||
| * or a non-string leaf value. | ||
| */ | ||
| export declare function parseTranslationFile(text: string, filename: string): FlatMap; |
@@ -35,3 +35,3 @@ import { flatten, unflatten } from "@translatize/core"; | ||
| * JSON objects (nested objects are flattened; a flat file passes through unchanged). | ||
| * Throws {@link UsageError} — naming `filename` — on invalid JSON, a non-object root, | ||
| * Throws {@link UsageError} – naming `filename` – on invalid JSON, a non-object root, | ||
| * or a non-string leaf value. | ||
@@ -45,3 +45,3 @@ */ | ||
| catch (err) { | ||
| throw new UsageError(`${filename}: not valid JSON — ${err.message}`); | ||
| throw new UsageError(`${filename}: not valid JSON – ${err.message}`); | ||
| } | ||
@@ -48,0 +48,0 @@ if (data === null || typeof data !== "object" || Array.isArray(data)) { |
+2
-2
@@ -70,3 +70,3 @@ import pc from "picocolors"; | ||
| "Authentication failed. Check the TRANSLATIZE_API_TOKEN environment variable (or --token) " + | ||
| "— the token may be missing, wrong, or expired."; | ||
| "– the token may be missing, wrong, or expired."; | ||
| break; | ||
@@ -91,3 +91,3 @@ case "token_inactive": | ||
| case "batch_too_large": | ||
| hint = "Too many labels in a single request. This is a CLI bug — please report it."; | ||
| hint = "Too many labels in a single request. This is a CLI bug – please report it."; | ||
| break; | ||
@@ -94,0 +94,0 @@ case "project_not_found": |
+9
-3
| { | ||
| "name": "@translatize/cli", | ||
| "version": "0.1.0", | ||
| "version": "0.1.2", | ||
| "description": "Command-line tool to sync your app's translations with Translatize from CI — pull, push and status with git-like branching.", | ||
@@ -8,3 +8,9 @@ "type": "module", | ||
| "author": "SIA \"MICRON\"", | ||
| "homepage": "https://translatize.com", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/Translatize/integrations.git", | ||
| "directory": "cli" | ||
| }, | ||
| "homepage": "https://translatize.com/docs", | ||
| "bugs": "https://github.com/Translatize/integrations/issues", | ||
| "bin": { | ||
@@ -33,3 +39,3 @@ "translatize": "./dist/index.js" | ||
| "dependencies": { | ||
| "@translatize/core": "^0.1.0", | ||
| "@translatize/core": "^0.1.2", | ||
| "commander": "^12.1.0", | ||
@@ -36,0 +42,0 @@ "picocolors": "^1.1.1" |
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
67189
0.33%7
-12.5%Updated