@transi-store/cli
v2.4.1
Published
```bash npm install -g @transi-store/cli ```
Readme
transi-store cli
Installation
npm install -g @transi-store/cliDownload translations
With configuration file
transi-store [options]For more information, run:
transi-store --helpOptions
--config <path>: Path to the configuration file (default:transi-store.config.json).--branch: The branch to download the translations from. Defaults to the current branch in a git environment. Use@allto download all translations across every branch (no branch filtering).
Configuration file example
// transi-store.config.json
{
"$schema": "https://unpkg.com/@transi-store/cli/schema.json",
"org": "my-org",
"projects": [
{
"project": "my-project",
"langs": ["en", "fr", "de"],
"format": "json",
"output": "./locales/<lang>/translations.json",
},
],
}You can define multiple projects in the projects array.
The "$schema" field is optional but recommended for editor autocompletion and validation.
The output must include the <lang> placeholder, which will be replaced by the actual locale code during the download process. It can also include other placeholders like <format> and <project>.
You must also provide the TRANSI_STORE_API_KEY environment variable with your Transi-Store API key to authenticate the requests.
With parameters
If you don't want to use a configuration file, you can provide the necessary parameters directly in the command line:
transi-store download --org <orgSlug> \
--project <projectSlug> \
--locale <locale> \
--output <outputPath> \
--format <format>Upload translations
To upload translations, you can use the following command:
transi-store upload --org <orgSlug> \
--project <projectSlug> \
--locale <locale> \
--input <inputPath> \
--format <format>Optional parameters:
--domain-root: The root directory for the domain. This is used to determine the domain of the translations based on the input file path. Defaults to "https://transi-store.com".--strategy: eiher "overwrite" (default) or "skip". Determines how to handle existing translations. "overwrite" will replace existing translations with the new ones, while "skip" will keep existing translations and only add new ones.--branch: The branch to upload the translations to. Defaults to "main".
You must also provide the TRANSI_STORE_API_KEY environment variable with your Transi-Store API key to authenticate the requests.
Contributing
Publish package
Package publishing must be done from the main branch.
git switch main && git pullWhen you want to prepare a new version for publishing, run:
yarn changeset versionReview and commit the changes. Then publish the packages:
# add modified files
git add ".changeset/*.md" "packages/*/CHANGELOG.md" "packages/*/package.json" "apps/*/package.json"
# commit release metadata
git commit -m "chore: publish packages"
# get version
VERSION=$(node -p "require('./packages/cli/package.json').version")
# tag the release commit (use the same tag for all packages since they are released together)
git tag cli@v$VERSION -m "cli@v$VERSION"
# Then remember to push the git tag created during publishing:
git push --follow-tags