Skip to content

fix(cli): add dev.usePseudotranslator to config schema (v1.14)#2019

Merged
cherkanovart merged 2 commits intomainfrom
fix/pseudo-config-schema
Feb 27, 2026
Merged

fix(cli): add dev.usePseudotranslator to config schema (v1.14)#2019
cherkanovart merged 2 commits intomainfrom
fix/pseudo-config-schema

Conversation

@cherkanovart
Copy link
Contributor

@cherkanovart cherkanovart commented Feb 26, 2026

Summary

  • Extends I18nConfig schema to v1.14 with a dev.usePseudotranslator optional field
  • Updates CLI setup to check both --pseudo flag and dev.usePseudotranslator config for provider selection and auth skipping
  • Addresses the review feedback on fix(cli): respect dev.usePseudotranslator config to skip API validation #1984: the setup.ts changes are correct but have no effect without the schema update, since Zod strips unknown keys during parsing

Context

PR #1984 correctly modified setup.ts to check ctx.config?.dev?.usePseudotranslator, but the I18nConfig schema (v1.13) has no dev field — Zod's safeParse() strips it during parsing, so the value is always undefined at runtime.

This PR adds the missing schema definition so the config value actually reaches the CLI.

Test plan

  • Existing config spec tests pass (v0 through v1.13 upgrade paths unaffected)
  • New tests for parsing config with and without dev field
  • TypeScript compiles cleanly after spec package build

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added dev.usePseudotranslator configuration option to enable pseudo translator mode directly from your config file, complementing existing CLI flags.
    • CLI now recognizes and applies the pseudo translator setting from configuration files.
  • Tests

    • Extended test coverage to verify configuration schema updates and dev settings field parsing.

cherkanovart and others added 2 commits February 26, 2026 15:15
… in setup

The setup.ts changes from PR #1984 correctly check dev.usePseudotranslator,
but the I18nConfig schema (v1.13) has no dev field — Zod strips it during
parsing, making the check always undefined. This extends the schema to v1.14
with a dev.usePseudotranslator option so the config value actually reaches
the CLI runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f0d52f and d96871a.

📒 Files selected for processing (4)
  • .changeset/pseudo-config-schema.md
  • packages/cli/src/cli/cmd/run/setup.ts
  • packages/spec/src/config.spec.ts
  • packages/spec/src/config.ts

📝 Walkthrough

Walkthrough

Introduces configuration version 1.14 with a new dev.usePseudotranslator flag, updates CLI setup to recognize this config field for pseudo-translation mode, extends the config schema with devSettingsSchema, and adds public parsing utilities to the spec module.

Changes

Cohort / File(s) Summary
Changeset Documentation
.changeset/pseudo-config-schema.md
Changelog entry documenting patch updates to @lingo.dev/_spec and lingo.dev packages, noting CLI setup fix for dev.usePseudotranslator schema support.
Config Schema & Definitions
packages/spec/src/config.ts
Introduces v1.14 config definition with optional dev field containing usePseudotranslator flag; updates LATEST_CONFIG_DEFINITION reference; exports new parseI18nConfig() function and defaultConfig constant.
Config Tests
packages/spec/src/config.spec.ts
Adds tests verifying dev.usePseudotranslator config parsing and version field preservation; includes test for absent dev field resulting in undefined.
CLI Setup Logic
packages/cli/src/cli/cmd/run/setup.ts
Extends localization provider selection to treat ctx.config.dev.usePseudotranslator equivalent to ctx.flags.pseudo; tightens authentication condition to skip when pseudo mode or dev.usePseudotranslator is active.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • AndreyHirsa
  • vrcprl

Poem

🐰 A config field hops into v1.14,
Dev.usePseudotranslator, oh how quite neat!
No flags needed when config's in place,
Pseudo-mode now runs at its own pace,
The schema's updated, the CLI's aware—
All set! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding dev.usePseudotranslator to the config schema with the version bump to v1.14.
Description check ✅ Passed The description covers the summary, changes, and testing plan thoroughly. All required template sections are present and appropriately filled with relevant details about the schema extension and CLI updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/pseudo-config-schema

Comment @coderabbitai help to get the list of available commands and usage tips.

@cherkanovart cherkanovart merged commit e0a1bb3 into main Feb 27, 2026
10 checks passed
@cherkanovart cherkanovart deleted the fix/pseudo-config-schema branch February 27, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants