Open
Conversation
- Replace project and token checks with direct property comparisons - Remove redundant methods for getting project and token - Update command signature and handle method for improved error handling - Enhance tests to reflect changes in method calls and command execution
…ration during setup
… with Linguist API
…tive setup and configuration management
There was a problem hiding this comment.
Pull request overview
Dieses PR modernisiert das Linguist-Connector-Package durch eine neue Action-/DTO-basierte Architektur und erweitert die DX um einen interaktiven Setup-Flow sowie ein überarbeitetes linguist:sync-Command.
Changes:
- Einführung eines
LinguistApiClientplus Actions fürpull,pushundsyncinkl. Orchestrierung (SetupOrchestrator) und Setup-Wizard (linguist:setup). - Neue DTOs (
SetupInput,SyncResult) und Anpassungen an Service Provider/Facade/Legacy-API. - Dokumentation und umfangreiche Test-Suite-Erweiterungen rund um die neuen Flows.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/Services/LinguistApiClientTest.php | Unit-Tests für Key-Counting/Fallback-Logik des API-Clients |
| tests/Unit/DTO/SyncResultTest.php | Unit-Tests für Ergebnis-/Summary-Logik des SyncResult DTO |
| tests/Unit/DTO/SetupInputTest.php | Unit-Tests für SetupInput DTO (Helper/Defaults/Serialisierung) |
| tests/Unit/Actions/PushTranslationsTest.php | Unit-Tests für Push-Action (Batching/Progress/Mapping) |
| tests/Unit/Actions/PullTranslationsTest.php | Unit-Tests für Pull-Action (Key-Counting/Files) |
| tests/Unit/Actions/PersistLinguistConfigTest.php | Unit-Tests für .env-Persistierung/Masking |
| tests/Unit/Actions/CollectLocalTranslationsTest.php | Unit-Tests für lokale Translation-Discovery/Flattening/Writing |
| tests/Pest.php | Pest-Setup + Test-Helper für HTTP/Filesystem |
| tests/LinguistTest.php | Anpassung Legacy-Tests auf neue Facade-Nutzung + Artisan-Tests |
| src/Services/SetupOrchestrator.php | Orchestriert Setup: persist config, resolve project, run sync, auto-translate |
| src/Services/LinguistApiClient.php | Neuer HTTP-Client für Linguist API inkl. Helper/Count/Mapping |
| src/LinguistServiceProvider.php | Registriert neue Commands/Services/Actions im Container |
| src/Linguist.php | Legacy-Klasse refaktoriert (Pooling, vereinfachte Config-Nutzung) |
| src/Facades/Linguist.php | Facade-Docblock an neue/entfernte Methoden angepasst |
| src/DTO/SyncResult.php | Neuer Ergebnis-DTO für Sync-/Pull-/Push-Flows |
| src/DTO/SetupInput.php | Neuer Eingabe-DTO für Setup-Wizard/Orchestrierung |
| src/Commands/LinguistSetupCommand.php | Neues interaktives Setup-Command (Prompts, Setup-Ausführung, Reporting) |
| src/Commands/LinguistCommand.php | Neues linguist:sync Command mit Modi/Optionen/Progress |
| src/Actions/SyncTranslations.php | Sync-Action (remote exports laden + local merge + write) |
| src/Actions/PushTranslations.php | Push-Action (batch store + fallback per key, Progress-Callback) |
| src/Actions/PullTranslations.php | Pull-Action (download exports, write linguist.json, key counts) |
| src/Actions/PersistLinguistConfig.php | Persistiert Token/URL/Project in .env + runtime config |
| src/Actions/CollectLocalTranslations.php | Discover/Parse/Flatten/Write lokaler Translation-Files |
| composer.json | Dependencies erweitert (laravel-actions) |
| README.md | Dokumentation für Setup-Wizard, Commands, Modes und Usage erweitert/aktualisiert |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
… SetupOrchestrator
…ty methods for project slug filtering
…ing and nested file support
… formatting commit
e4c9405 to
c6f65e0
Compare
…and utility methods
…tus for Linguist commands
…rror reporting for missing search roots
63d872b to
1352c5b
Compare
3cc0825 to
e86fdcf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Beschreibung:
Dieser PR aktualisiert das Linguist Connector Package auf ein moderneres Level.
Was wurde gemacht?
Das Packet an sich wurde aktualisiert (Dependencies). Zudem wurde die Projektstruktur aufgeräumt, sauber in Services und Actions unterteilt und anschließend erweitert.
Das aufsetzen des Paketes ist nun via einem einzigen Command möglich (
linguist:setup). Dabei werden alle nötigen Informationen abgefragt (API Key, zugehöriges Projekt, usw.). Zudem wurde ein Sprachdatei-Import Feature hinzugefügt. Bei Ersteinrichtungen kann das Package jetzt die bestehenden Sprachdateien Scannen und die Übersetzungs-Keys automatisch in Linguist anlegen. Man muss also nicht mehr manuell eine Datei nach der anderen hochladen.Der
syncCommand wurde ebenfalls erweitert. Entwickler müssen sich jetzt nicht mehr darum kümmern einen eigenen Command anzulegen sondern können einfach mitlinguist:syncdie Sprachdateien aktualisieren. Hier gibt es nun 3 Modi.sync: Es werden sowohl neue Sprachdateien hochgeladen als auch aktuelle Übersetzungen runtergeladenpull: Es werden aktuelle Übersetzungen runtergeladenpush: Es werden sowohl neue Sprachdateien hochgeladenWarum wurde es gemacht?
Bisher war die Integration von Linguist in Projekten sehr unregelmäßig. Entwickler mussten viele Schritte selbst machen wie einen Sync-Command anlegen. Das hat dazu geführt das bspw. jedes Projekt eine eigene Sync-Command-Signatur hat, was immer wieder zu Verwirrung führt.
Umgebung & Voraussetzungen:
Eine eingerichtete Projekt Entwicklungsumgebung.
Ablauf der Nachprüfung:
[Optional] Screenshots/Videos
[Optional] Weitere Hinweise:
[Optional] Sind nach dem Deployment Tasks auszuführen?