docs(cli): document non-interactive setup for CI#393
Closed
JoshKappler wants to merge 1 commit into
Closed
Conversation
Contributor
Author
|
Folding this into #391 so the quickstart fixes are one review instead of four. The commit is cherry-picked there unchanged and the write-up moved into that PR's body. |
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.
This PR is two small fixes plus the working-path documentation they point to. The fixes: the step 3 code block was titled
.envthough the wizard writes.env.local, and step 2 presentsnpx gt initas the setup wizard with no note that it is interactive. Those two point at a gap. The page tells readers to rungt translatein their CI pipeline (step 4: "Run this in your CI pipeline before you build for production"), but its own setup step cannot run in CI, so the larger addition here is aNon-interactive setup for CIsection that documents the headless path.gt initonly prompts and has no non-interactive flag: it accepts just--srcand--config, andgt configureruns the same wizard underneath. In a non-interactive shell it cannot prompt, andnpx gt init < /dev/nullexits 0 without creatinggt.config.jsonor writing credentials, so a CI script that checks the exit code sees a false success.These quickstarts were created in the #354 docs refactor merged July 16 and had not been walked end to end yet. The docs bots do mechanical sync and grammar passes (open PR #390 is a grammar-only pass on a sibling quickstart page), so first-run gaps like this survive them.
This documents the headless path that actually works, without changing the interactive flow:
gt.config.json($schema,defaultLocale,locales, and afilesentry sotranslatehas something to work on, the same shape already shown in the Configuring guide), theGT_API_KEYandGT_PROJECT_IDenvironment variables, andnpx gt translate --config gt.config.json..env.local(correct per the CLI source), but the step 3 code block was titled.env. Both now say.env.local.package.jsonand Node.js) and a success line after step 2 (you should now havegt.config.jsonand.env.localwith the two variables).Every flag, filename, and config field was checked against the CLI source in the
gtrepo (packages/cli): the wizard writes.env.local(utils/credentials.ts,cli/base.ts),initandconfigureare prompt-only, andtranslateaccepts-c, --config. The full run-tests gate passes locally: unsafe-html validation, link validation, and the content build.A maintainer might say the wizard is the intended setup path. That is true for local setup, but this page already tells readers to run
gt translatein CI, so it needs a CI-safe setup path to match. If keeping setup wizard-only was deliberate, I'm happy to rescope this to just the interactive-wizard callout.A maintainer might also say CI setup belongs in the Configuring guide, not the quickstart. This page's own step 4 already sends readers to run
gt translatein CI, so the working path lives next to that instruction. If you'd rather keep the quickstart lean, I'm happy to move the section to the Configuring guide and leave a callout and a link here instead.