solid-translate 0.2.0 → 1.1.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.
package/README.md CHANGED
@@ -18,6 +18,7 @@ Write your app in one language. Wrap text in `<T>`. Get translations generated a
18
18
  - **`msg()`** — mark strings for extraction outside of JSX
19
19
  - **CLI Tool** — translate JSON, Markdown, and MDX files from the command line
20
20
  - **Vite Plugin** — build-time translation with smart change detection
21
+ - **GitHub Action** — `omniaura/solid-translate@v1` for CI/CD translation automation
21
22
  - **BYOK** — use any [Vercel AI SDK](https://ai-sdk.dev/) provider (OpenRouter, OpenAI, Anthropic, Google, etc.)
22
23
 
23
24
  ## Install
@@ -376,6 +377,109 @@ const model = google("gemini-2.0-flash");
376
377
 
377
378
  ## CI/CD Integration
378
379
 
380
+ ### GitHub Action
381
+
382
+ Use the official action to keep translations up to date automatically:
383
+
384
+ ```yaml
385
+ # .github/workflows/translate.yml
386
+ name: Translate
387
+
388
+ on:
389
+ push:
390
+ branches: [main]
391
+
392
+ jobs:
393
+ translate:
394
+ runs-on: ubuntu-latest
395
+ permissions:
396
+ contents: write
397
+ steps:
398
+ - uses: actions/checkout@v4
399
+
400
+ - uses: omniaura/solid-translate@v1
401
+ env:
402
+ OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
403
+ with:
404
+ commit: true
405
+ commit-message: "chore: update translations"
406
+ ```
407
+
408
+ #### Action Inputs
409
+
410
+ | Input | Default | Description |
411
+ |-------|---------|-------------|
412
+ | `command` | `both` | `extract`, `translate`, or `both` |
413
+ | `working-directory` | `.` | Working directory |
414
+ | `commit` | `false` | Auto-commit updated translation files |
415
+ | `commit-message` | `chore: update translations` | Commit message |
416
+ | `node-version` | `22` | Node.js version |
417
+ | `package-manager` | `npm` | `npm`, `bun`, `pnpm`, or `yarn` |
418
+
419
+ #### Action Outputs
420
+
421
+ | Output | Description |
422
+ |--------|-------------|
423
+ | `changed` | `true` if translation files were updated |
424
+ | `files` | Newline-separated list of changed translation files |
425
+
426
+ The action reports and commits changes for JSON, Markdown, MDX, and `.solid-translate.lock` files only. Package manifests and package manager lockfiles are intentionally excluded.
427
+
428
+ #### Examples
429
+
430
+ **Translate on push and commit back:**
431
+
432
+ Use auto-commit only on trusted refs where `GITHUB_TOKEN` can push to the checked-out branch, such as `push` events on your own repository. For pull requests, leave `commit` disabled and use the `changed`/`files` outputs to decide whether to fail CI or open a separate update PR.
433
+
434
+ ```yaml
435
+ name: Translate
436
+
437
+ on:
438
+ push:
439
+ branches: [main]
440
+
441
+ jobs:
442
+ translate:
443
+ runs-on: ubuntu-latest
444
+ permissions:
445
+ contents: write
446
+ steps:
447
+ - uses: actions/checkout@v4
448
+
449
+ - uses: omniaura/solid-translate@v1
450
+ env:
451
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
452
+ with:
453
+ commit: true
454
+ package-manager: bun
455
+ ```
456
+
457
+ **Extract only (no AI calls):**
458
+
459
+ ```yaml
460
+ - uses: omniaura/solid-translate@v1
461
+ with:
462
+ command: extract
463
+ ```
464
+
465
+ **Use output in subsequent steps:**
466
+
467
+ ```yaml
468
+ - uses: omniaura/solid-translate@v1
469
+ id: translate
470
+ env:
471
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
472
+
473
+ - name: Create PR with translations
474
+ if: steps.translate.outputs.changed == 'true'
475
+ env:
476
+ TRANSLATION_FILES: ${{ steps.translate.outputs.files }}
477
+ run: |
478
+ printf 'Updated files:\n%s\n' "$TRANSLATION_FILES"
479
+ ```
480
+
481
+ ### Manual CI Setup
482
+
379
483
  Add to your build script for automatic translations on every deploy:
380
484
 
381
485
  ```json
@@ -387,7 +491,7 @@ Add to your build script for automatic translations on every deploy:
387
491
  }
388
492
  ```
389
493
 
390
- Or in GitHub Actions:
494
+ Or directly in a workflow:
391
495
 
392
496
  ```yaml
393
497
  - name: Translate
@@ -439,6 +543,7 @@ declare module "virtual:solid-translate" {
439
543
  | Shared strings (`msg()`) | ✅ | ✅ |
440
544
  | CLI for JSON/MD/MDX | ✅ | ✅ |
441
545
  | CI/CD integration | ✅ | ✅ |
546
+ | Official GitHub Action | ❌ | ✅ |
442
547
  | Zero refactoring | ✅ | ✅ |
443
548
  | BYOK (bring your own key) | ❌ (SaaS) | ✅ |
444
549
  | No vendor lock-in | ❌ | ✅ |