langctl 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +158 -1188
  3. package/dist/commands/auth.js +85 -19
  4. package/dist/commands/config.js +36 -26
  5. package/dist/commands/export.js +11 -122
  6. package/dist/commands/import.js +32 -143
  7. package/dist/commands/init.js +61 -72
  8. package/dist/commands/keys.js +145 -279
  9. package/dist/commands/org.js +45 -111
  10. package/dist/commands/projects.js +124 -312
  11. package/dist/commands/pull.js +86 -129
  12. package/dist/commands/push.js +125 -0
  13. package/dist/commands/review.js +65 -0
  14. package/dist/commands/team.js +68 -257
  15. package/dist/commands/translate.js +99 -0
  16. package/dist/core/cache.js +48 -0
  17. package/dist/core/config.js +130 -0
  18. package/dist/core/errors.js +67 -0
  19. package/dist/core/files.js +38 -0
  20. package/dist/core/http.js +156 -0
  21. package/dist/core/output.js +96 -0
  22. package/dist/core/project.js +58 -0
  23. package/dist/core/prompts.js +56 -0
  24. package/dist/formats/index.js +285 -0
  25. package/dist/index.js +277 -508
  26. package/dist/version.js +4 -0
  27. package/package.json +22 -15
  28. package/.gitattributes +0 -2
  29. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -26
  30. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -19
  31. package/CONTRIBUTING.md +0 -33
  32. package/dist/api.d.ts +0 -20
  33. package/dist/api.js +0 -75
  34. package/dist/auth.d.ts +0 -38
  35. package/dist/auth.js +0 -106
  36. package/dist/commands/auth.d.ts +0 -3
  37. package/dist/commands/config.d.ts +0 -2
  38. package/dist/commands/debug.d.ts +0 -3
  39. package/dist/commands/debug.js +0 -61
  40. package/dist/commands/export.d.ts +0 -13
  41. package/dist/commands/import.d.ts +0 -12
  42. package/dist/commands/init.d.ts +0 -2
  43. package/dist/commands/keys.d.ts +0 -25
  44. package/dist/commands/org.d.ts +0 -13
  45. package/dist/commands/projects.d.ts +0 -33
  46. package/dist/commands/pull.d.ts +0 -9
  47. package/dist/commands/team.d.ts +0 -29
  48. package/dist/config.d.ts +0 -48
  49. package/dist/config.js +0 -69
  50. package/dist/exporters/index.d.ts +0 -36
  51. package/dist/exporters/index.js +0 -214
  52. package/dist/index.d.ts +0 -3
  53. package/dist/utils/banner.d.ts +0 -9
  54. package/dist/utils/banner.js +0 -24
  55. package/translations/en.json +0 -5
  56. package/translations/en.xml +0 -9
  57. package/translations/fr.json +0 -4
  58. package/translations/fr.xml +0 -7
  59. package/translations/hi.json +0 -4
  60. package/translations/hi.xml +0 -7
  61. package/translations/ios/en.strings +0 -9
  62. package/translations/ios/fr.strings +0 -6
  63. package/translations/ios/hi.strings +0 -6
  64. package/translations/ios/ja.strings +0 -6
  65. package/translations/ja.json +0 -4
  66. package/translations/ja.xml +0 -7
package/CHANGELOG.md ADDED
@@ -0,0 +1,53 @@
1
+ # Changelog
2
+
3
+ ## 0.4.0 — 2026-10-08
4
+
5
+ ### Added
6
+ - `langctl translate [project]`: fill missing translations with AI (DeepL) from the default language. `--to`, `--keys`, `--module`, `--overwrite`, `--dry-run` (uses no quota). Placeholders such as `{{name}}`, `{count}`, `%1$s` are preserved.
7
+ - `langctl review [project]`: list AI translations awaiting review; `--approve` (narrow with `--keys` / `--languages`).
8
+ - `pull --include-unreviewed`.
9
+ - `pull` caches exports by ETag in `~/.langctl/cache`: when nothing changed on the server, the API answers `304 Not Modified` and the saved snapshot is reused. Set `LANGCTL_NO_CACHE=1` to disable. In CI, cache `~/.langctl/cache` (e.g. `actions/cache`) to benefit across runs.
10
+
11
+ ### Changed
12
+ - `pull` leaves out AI translations nobody has reviewed yet (your app falls back to the default language for them) and warns how many were held back.
13
+
14
+ ## 0.3.0 — 2026-10-08
15
+
16
+ A rewrite focused on reliability in real projects and CI.
17
+
18
+ ### Added
19
+ - `langctl.json` project config and `langctl init` repo setup — `pull`/`push` need no arguments.
20
+ - `push`: upload translation files (source language by default), with `--dry-run`, `--overwrite`, `--publish`.
21
+ - `pull --check` (exit 7 when committed files are out of date), `--dry-run`, `--require-complete`.
22
+ - `LANGCTL_API_KEY` / `LANGCTL_API_URL` / `LANGCTL_TIMEOUT` / `LANGCTL_CONFIG_DIR`: CI needs no config file.
23
+ - `--json` on every command (errors too), `--quiet`, `--verbose` (HTTP trace), `--yes`, `--timeout`, `--no-color`.
24
+ - `whoami` (org, key source, scopes, latency), `formats`, `keys update`, `keys unpublish`, `publish --all/--module`.
25
+ - `projects stats` shows translation coverage per language.
26
+ - Import/push read every format pull writes (JSON, nested JSON, Android XML, iOS .strings, ARB).
27
+ - Documented exit codes (0–7).
28
+ - Retries with backoff for idempotent requests (network errors, 429, 5xx); clear network/TLS/proxy errors.
29
+
30
+ ### Fixed
31
+ - `init` could hang forever after entering the API key.
32
+ - Spinners froze the CLI under emulated terminals (`script`, `docker -t`); spinners are now off in CI/pipes.
33
+ - Exporting all languages to Android/iOS wrote every language to the same file (only the last survived).
34
+ - `-o file` with several languages overwrote the same file for each language.
35
+ - Android: keys with dots produced invalid resource names; apostrophes were escaped as `'` (Android needs `\'`).
36
+ - ARB: keys with dots were invalid message ids; a timestamp made every pull a git diff.
37
+ - Repeated placeholders got different positions (`{{name}} … {{name}}` → `%1$s … %2$s`).
38
+ - Nested JSON silently dropped keys that were both a string and a parent.
39
+ - Unknown language/format, missing keys and empty imports exited 0 — CI passed on failures.
40
+ - Key lookups used a substring search limited to 100 results; `keys publish` silently skipped keys beyond 100.
41
+ - Files over ~1 MB failed to import (uploads are now chunked).
42
+ - The API key was stored world-readable; the config file is now mode 600 and written atomically.
43
+ - The API key had to be passed as an argument (shell history); use `auth --stdin` or the hidden prompt.
44
+
45
+ ### Changed
46
+ - Requires Node.js 20+ (the dependencies already did).
47
+ - Dependencies cut from 5 to 2 (`commander`, `chalk`).
48
+ - Default file paths follow platform conventions; see "Upgrading from 0.2" in the README.
49
+ - Destructive commands confirm, and require `--yes` when non-interactive.
50
+ - `keys translate` uses `-t/--text`; `debug` was replaced by `whoami`.
51
+
52
+ ## 0.2.0 — 2026-03-03
53
+ - Initial public release.