@radicalstorage-lingo/cli 0.3.0 → 0.3.1
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/dist/cli.cjs +63 -5
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -26581,11 +26581,12 @@ async function runInitWizard(opts) {
|
|
|
26581
26581
|
return;
|
|
26582
26582
|
}
|
|
26583
26583
|
}
|
|
26584
|
+
const apiUrlDefault = opts.apiUrl ?? "http://localhost:3000";
|
|
26584
26585
|
const apiUrl = orExit(
|
|
26585
26586
|
await text({
|
|
26586
26587
|
message: "API URL",
|
|
26587
|
-
|
|
26588
|
-
|
|
26588
|
+
placeholder: apiUrlDefault,
|
|
26589
|
+
defaultValue: apiUrlDefault
|
|
26589
26590
|
})
|
|
26590
26591
|
).trim();
|
|
26591
26592
|
const existingKey = resolveApiKey();
|
|
@@ -26633,9 +26634,10 @@ async function runInitWizard(opts) {
|
|
|
26633
26634
|
})
|
|
26634
26635
|
).trim();
|
|
26635
26636
|
}
|
|
26637
|
+
const outDefault = opts.out ?? "messages";
|
|
26636
26638
|
const outDir = orExit(
|
|
26637
|
-
await text({ message: "Output directory for bundles",
|
|
26638
|
-
).trim()
|
|
26639
|
+
await text({ message: "Output directory for bundles", placeholder: outDefault, defaultValue: outDefault })
|
|
26640
|
+
).trim();
|
|
26639
26641
|
const format = orExit(
|
|
26640
26642
|
await select({
|
|
26641
26643
|
message: "Bundle format",
|
|
@@ -26886,6 +26888,62 @@ async function pushCommand(opts) {
|
|
|
26886
26888
|
}
|
|
26887
26889
|
}
|
|
26888
26890
|
|
|
26891
|
+
// package.json
|
|
26892
|
+
var package_default = {
|
|
26893
|
+
name: "@radicalstorage-lingo/cli",
|
|
26894
|
+
version: "0.3.1",
|
|
26895
|
+
type: "module",
|
|
26896
|
+
description: "Lingo CLI \u2014 pull/push translations as JSON at build time.",
|
|
26897
|
+
license: "MIT",
|
|
26898
|
+
author: "Amin Ahrabian",
|
|
26899
|
+
homepage: "https://lingo-app-amin.fly.dev",
|
|
26900
|
+
keywords: [
|
|
26901
|
+
"i18n",
|
|
26902
|
+
"internationalization",
|
|
26903
|
+
"localization",
|
|
26904
|
+
"translations",
|
|
26905
|
+
"cli",
|
|
26906
|
+
"deepl",
|
|
26907
|
+
"icu"
|
|
26908
|
+
],
|
|
26909
|
+
engines: {
|
|
26910
|
+
node: ">=20.12"
|
|
26911
|
+
},
|
|
26912
|
+
bin: {
|
|
26913
|
+
lingo: "./dist/cli.cjs"
|
|
26914
|
+
},
|
|
26915
|
+
files: [
|
|
26916
|
+
"dist"
|
|
26917
|
+
],
|
|
26918
|
+
publishConfig: {
|
|
26919
|
+
access: "public"
|
|
26920
|
+
},
|
|
26921
|
+
scripts: {
|
|
26922
|
+
build: "tsup",
|
|
26923
|
+
lint: "eslint .",
|
|
26924
|
+
typecheck: "tsc --noEmit",
|
|
26925
|
+
test: "vitest run",
|
|
26926
|
+
prepublishOnly: "pnpm build"
|
|
26927
|
+
},
|
|
26928
|
+
dependencies: {
|
|
26929
|
+
"@clack/prompts": "^1.7.0",
|
|
26930
|
+
commander: "^12.1.0",
|
|
26931
|
+
picocolors: "^1.1.1",
|
|
26932
|
+
zod: "^3.24.1"
|
|
26933
|
+
},
|
|
26934
|
+
devDependencies: {
|
|
26935
|
+
"@eslint/js": "^9.18.0",
|
|
26936
|
+
"@lingo/formats": "workspace:*",
|
|
26937
|
+
"@types/node": "^22.10.5",
|
|
26938
|
+
eslint: "^9.18.0",
|
|
26939
|
+
globals: "^15.14.0",
|
|
26940
|
+
tsup: "^8.3.5",
|
|
26941
|
+
typescript: "^5.6.3",
|
|
26942
|
+
"typescript-eslint": "^8.20.0",
|
|
26943
|
+
vitest: "^2.1.8"
|
|
26944
|
+
}
|
|
26945
|
+
};
|
|
26946
|
+
|
|
26889
26947
|
// src/cli.ts
|
|
26890
26948
|
async function run(fn) {
|
|
26891
26949
|
try {
|
|
@@ -26896,7 +26954,7 @@ async function run(fn) {
|
|
|
26896
26954
|
}
|
|
26897
26955
|
}
|
|
26898
26956
|
var program2 = new Command();
|
|
26899
|
-
program2.name("lingo").description("Pull/push Lingo translations as JSON at build time.").version(
|
|
26957
|
+
program2.name("lingo").description("Pull/push Lingo translations as JSON at build time.").version(package_default.version);
|
|
26900
26958
|
program2.command("init").description("Create a lingo.config.json (interactive wizard, or --yes for defaults)").option("--project <id>", "project id or slug").option("--api-url <url>", "API base URL").option("--out <dir>", "output directory for pulled bundles").option("-y, --yes", "skip the wizard; write config from flags + defaults").action(
|
|
26901
26959
|
(opts) => run(() => initCommand({ project: opts.project, apiUrl: opts.apiUrl, out: opts.out, yes: opts.yes }))
|
|
26902
26960
|
);
|