@intlpullhq/cli 0.1.9 → 0.1.10
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 +4 -0
- package/dist/index.js +12 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -193,6 +193,9 @@ npx @intlpullhq/cli download --format json --output ./messages
|
|
|
193
193
|
# Download specific languages
|
|
194
194
|
npx @intlpullhq/cli download --languages en,es,fr
|
|
195
195
|
|
|
196
|
+
# Download specific namespaces
|
|
197
|
+
npx @intlpullhq/cli download --namespace common,auth
|
|
198
|
+
|
|
196
199
|
# Quiet mode for CI
|
|
197
200
|
npx @intlpullhq/cli download --quiet
|
|
198
201
|
|
|
@@ -207,6 +210,7 @@ npx @intlpullhq/cli pull
|
|
|
207
210
|
| `--format <format>` | Output format: `json`, `yaml`, `ts` (default: `json`) |
|
|
208
211
|
| `--output <dir>` | Output directory (auto-detected from framework) |
|
|
209
212
|
| `--languages <langs>` | Languages to download (comma-separated) |
|
|
213
|
+
| `--namespace <namespaces>` | Namespaces to download (comma-separated, defaults to all) |
|
|
210
214
|
| `--branch <branch>` | Translation branch to download from |
|
|
211
215
|
| `--platform <platform>` | Platform variant: `default`, `ios`, `android`, `web` |
|
|
212
216
|
| `--no-parallel` | Disable parallel fetching |
|
package/dist/index.js
CHANGED
|
@@ -1296,7 +1296,14 @@ async function fetchTranslationsParallel(projectId, apiUrl, apiKey, options) {
|
|
|
1296
1296
|
const availableLanguages = projectData.languages?.map((l) => l.code) || ["en"];
|
|
1297
1297
|
const targetLanguages = options?.languages?.length ? options.languages : availableLanguages;
|
|
1298
1298
|
const namespacesResult = await fetchNamespaces(projectId, apiUrl, apiKey);
|
|
1299
|
-
|
|
1299
|
+
let namespaces = namespacesResult.namespaces;
|
|
1300
|
+
if (options?.namespaces?.length) {
|
|
1301
|
+
const requestedNamespaces = new Set(options.namespaces);
|
|
1302
|
+
namespaces = namespaces.filter((ns) => requestedNamespaces.has(ns));
|
|
1303
|
+
const missingNamespaces = options.namespaces.filter((ns) => !namespacesResult.namespaces.includes(ns));
|
|
1304
|
+
if (missingNamespaces.length > 0) {
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1300
1307
|
const taskParams = [];
|
|
1301
1308
|
for (const lang of targetLanguages) {
|
|
1302
1309
|
for (const ns of namespaces) {
|
|
@@ -2599,6 +2606,7 @@ Or use a project-scoped API key for automatic selection.`
|
|
|
2599
2606
|
let version;
|
|
2600
2607
|
let namespaceCount = 0;
|
|
2601
2608
|
let namespaces = [];
|
|
2609
|
+
const targetNamespaces = options.namespaces ? options.namespaces.split(",").map((n) => n.trim()).filter(Boolean) : void 0;
|
|
2602
2610
|
if (useParallel) {
|
|
2603
2611
|
const result = await fetchTranslationsParallel(
|
|
2604
2612
|
projectId,
|
|
@@ -2608,6 +2616,7 @@ Or use a project-scoped API key for automatic selection.`
|
|
|
2608
2616
|
languages: targetLanguages,
|
|
2609
2617
|
platform,
|
|
2610
2618
|
branch,
|
|
2619
|
+
namespaces: targetNamespaces,
|
|
2611
2620
|
onProgress: (completed, total) => {
|
|
2612
2621
|
setState((s) => ({
|
|
2613
2622
|
...s,
|
|
@@ -14318,7 +14327,7 @@ program.command("upload").description("Upload translation keys to IntlPull (auto
|
|
|
14318
14327
|
tmDryRun: options.tmDryRun
|
|
14319
14328
|
});
|
|
14320
14329
|
});
|
|
14321
|
-
program.command("download").description("Download translations from IntlPull (auto-detects project, framework, and languages)").option("--project <id>", "Project ID (auto-detected with project-scoped API key)").option("--format <format>", "Output format (json|yaml|ts)", "json").option("--output <dir>", "Output directory (auto-detected from framework)").option("--languages <langs>", "Languages to download (comma-separated, defaults to all)").option("--branch <branch>", "Translation branch to download from").option("--platform <platform>", "Platform variant (default|ios|android|web)").option("--no-parallel", "Disable parallel fetching (use single request)").option("-i, --interactive", "Run in interactive mode with prompts").option("-q, --quiet", "Suppress output except errors").option("--clean-orphans [mode]", 'Remove orphaned files (files not in remote). Use "dry-run" to preview').option("-f, --force", "Skip confirmation prompts for destructive operations").option("--translation-key-prefix <prefix>", 'Strip this prefix from keys (e.g., "checkout" makes "checkout.submit" \u2192 "submit")').option("--filter-by-prefix <prefix>", "Only download keys starting with this prefix").action((options) => {
|
|
14330
|
+
program.command("download").description("Download translations from IntlPull (auto-detects project, framework, and languages)").option("--project <id>", "Project ID (auto-detected with project-scoped API key)").option("--format <format>", "Output format (json|yaml|ts)", "json").option("--output <dir>", "Output directory (auto-detected from framework)").option("--languages <langs>", "Languages to download (comma-separated, defaults to all)").option("--namespace <namespaces>", "Namespaces to download (comma-separated, defaults to all)").option("--branch <branch>", "Translation branch to download from").option("--platform <platform>", "Platform variant (default|ios|android|web)").option("--no-parallel", "Disable parallel fetching (use single request)").option("-i, --interactive", "Run in interactive mode with prompts").option("-q, --quiet", "Suppress output except errors").option("--clean-orphans [mode]", 'Remove orphaned files (files not in remote). Use "dry-run" to preview').option("-f, --force", "Skip confirmation prompts for destructive operations").option("--translation-key-prefix <prefix>", 'Strip this prefix from keys (e.g., "checkout" makes "checkout.submit" \u2192 "submit")').option("--filter-by-prefix <prefix>", "Only download keys starting with this prefix").action((options) => {
|
|
14322
14331
|
let cleanOrphans;
|
|
14323
14332
|
if (options.cleanOrphans === true || options.cleanOrphans === "") {
|
|
14324
14333
|
cleanOrphans = true;
|
|
@@ -14330,6 +14339,7 @@ program.command("download").description("Download translations from IntlPull (au
|
|
|
14330
14339
|
format: options.format,
|
|
14331
14340
|
output: options.output,
|
|
14332
14341
|
languages: options.languages,
|
|
14342
|
+
namespaces: options.namespace,
|
|
14333
14343
|
branch: options.branch,
|
|
14334
14344
|
platform: options.platform,
|
|
14335
14345
|
parallel: options.parallel,
|
package/package.json
CHANGED