Repository navigation
Add source config support for source-all-translations command - #149
Open
KallynGowdy wants to merge 2 commits into
Open
KallynGowdy wants to merge 2 commits into
KallynGowdy wants to merge 2 commits into
Conversation
Like sync, source-all-translations can now take a JSON config (--config <path>, or ./source.config.json when no directory is given) that sets the database used to track downloads and lists the sources to download from (ebible, fetch-bible, osis, bsb) with the directory for each. Sources left out of the config are skipped, which needed a new includeFetchBible option on sourceAllTranslations(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LsUS11s2PUsH7KW9gaLiP
The source config's bibleMultiConverterPath is now in the example config and README. A BibleMultiConverter path that is given explicitly (in a config or with --bible-multi-converter-path) but doesn't exist is now an error instead of silently falling back to searching for another copy and prompting, which would stall unattended runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LsUS11s2PUsH7KW9gaLiP
This branch has not been deployed
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.
Summary
This PR adds configuration file support to the
source-all-translationscommand, allowing users to define translation sources and their download directories in a JSON config file instead of passing them as command-line arguments.Key Changes
New
source-config.tsmodule: Provides types and functions for loading and validating source configuration filesSourceConfiginterface defines the structure of the config file with sources, database path, ignorelist, and conversion settingsloadSourceConfig()loads and validates a JSON config file using Zod schema validationgetSourceAllTranslationsOptions()converts config into options for thesourceAllTranslations()functionsourceAllTranslationsFromConfig()is the main entry point that orchestrates config loading and translation sourcingUpdated
source-all-translationscommand:<dir>argument optional (defaults to reading from./source.config.json)--configoption to specify a custom config file path--fetch-bible-dir) when using a config fileEnhanced
sourceAllTranslations()function:includeFetchBibleoption to make fetch.bible sourcing optionalImproved
findBibleMultiConverterJar()function:providedPathparameterAdded example config file (
source.config.example.json) showing the expected format with all source typesNotable Implementation Details
Config validation uses Zod with custom refinements to ensure:
manifestUrl,repo,ref) are only allowed on fetch-bible sourcesPaths in the config are resolved relative to the config file's directory
Command-line options override config file settings where applicable
Ignorelists from config and command-line options are merged