Skip to content

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Oct 13, 2025

close IDP-1325

Summary by CodeRabbit

  • New Features
    • Added a global CLI option --lang to set the documentation language when starting the dev server.
  • Documentation
    • Updated English and Chinese start guides to include and explain the new --lang option.
    • Refreshed CLI help examples to reflect language selection.
  • Chores
    • Added a changeset entry for a patch release documenting the new CLI language option.

Copilot AI review requested due to automatic review settings October 13, 2025 09:52
@changeset-bot
Copy link

changeset-bot bot commented Oct 13, 2025

🦋 Changeset detected

Latest commit: 53f5d12

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@alauda/doom Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new CLI option to specify the documentation language via the --lang parameter, allowing users to override the language configuration from the command line.

  • Adds a new lang CLI option to specify documentation language
  • Integrates the language parameter through the configuration loading pipeline
  • Updates documentation to reflect the new CLI option

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/doom/src/types.ts Adds lang property to GlobalCliOptions interface
packages/doom/src/cli/load-config.ts Implements language override logic in configuration loading
packages/doom/src/cli/index.ts Adds the --lang CLI option definition
docs/zh/start.mdx Documents the new CLI option in Chinese documentation
docs/en/start.mdx Documents the new CLI option in English documentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@coderabbitai
Copy link

coderabbitai bot commented Oct 13, 2025

Walkthrough

Adds a new global CLI option (--lang) to specify documentation language, threads it through config loading, updates types, and refreshes English/Chinese docs. Introduces a changeset marking @alauda/doom for a patch release.

Changes

Cohort / File(s) Summary of Changes
Release metadata
\.changeset/good-wombats-study.md
Adds changeset: patch release for @alauda/doom; notes feature “specify lang via cli”.
Documentation updates
docs/*/start.mdx (docs/en/start.mdx, docs/zh/start.mdx)
Documents new CLI option --lang <language> in start command help.
CLI wiring
packages/doom/src/cli/index.ts, packages/doom/src/cli/load-config.ts
Introduces --lang option; accepts and propagates lang through loadConfig into common config.
Type definitions
packages/doom/src/types.ts
Adds lang?: string to GlobalCliOptions.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant CLI as Doom CLI
  participant LC as loadConfig
  participant GCC as getCommonConfig
  participant Plugins as Plugins/Transformers

  User->>CLI: doom start --lang en
  CLI->>LC: loadConfig({ lang: "en", ... })
  LC->>GCC: getCommonConfig({ lang: "en", ... })
  note over GCC: Set config.lang if provided<br/>Affects locale resolution and defaults
  GCC-->>LC: merged config (lang respected)
  LC-->>CLI: final config
  CLI->>Plugins: initialize with config.lang
  Plugins-->>CLI: ready
  CLI-->>User: Dev server starts with selected language
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

feature

Poem

I twitch my ears—bonjour, 你好, hello!
A flag of tongues to choose before we go.
Hop, hop, config threads the way,
Leading docs in bright array.
Patch-sized nibble, feature glow—
Carrot-shaped options, onward we go! 🥕🐇

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title “feat: specify lang via cli” succinctly highlights the addition of a new CLI feature for language specification, directly reflecting the main change in the pull request without extraneous detail or noise. It follows conventional commit style, is clear to teammates scanning history, and focuses on the primary enhancement.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/lang

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ef6f3d and 53f5d12.

📒 Files selected for processing (6)
  • .changeset/good-wombats-study.md (1 hunks)
  • docs/en/start.mdx (2 hunks)
  • docs/zh/start.mdx (1 hunks)
  • packages/doom/src/cli/index.ts (1 hunks)
  • packages/doom/src/cli/load-config.ts (4 hunks)
  • packages/doom/src/types.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx,js,jsx,md,yml,yaml,json}

📄 CodeRabbit inference engine (AGENTS.md)

Format code using the repository’s Prettier configuration (yarn format)

Files:

  • packages/doom/src/types.ts
  • packages/doom/src/cli/index.ts
  • packages/doom/src/cli/load-config.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Code must adhere to TypeScript strict-mode rules (no implicit any, strict null checks, etc.)
Maintain strong type coverage; validate with yarn typecov

Files:

  • packages/doom/src/types.ts
  • packages/doom/src/cli/index.ts
  • packages/doom/src/cli/load-config.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Follow ESLint project-specific rules; avoid disabling rules without justification

Files:

  • packages/doom/src/types.ts
  • packages/doom/src/cli/index.ts
  • packages/doom/src/cli/load-config.ts
packages/**

📄 CodeRabbit inference engine (AGENTS.md)

Organize code as a Yarn workspaces monorepo; place package code under packages/

Files:

  • packages/doom/src/types.ts
  • packages/doom/src/cli/index.ts
  • packages/doom/src/cli/load-config.ts
packages/doom/**

📄 CodeRabbit inference engine (AGENTS.md)

Place the main documentation tool and CLI in packages/doom/

Files:

  • packages/doom/src/types.ts
  • packages/doom/src/cli/index.ts
  • packages/doom/src/cli/load-config.ts
docs/**

📄 CodeRabbit inference engine (AGENTS.md)

Keep project documentation in docs/

Files:

  • docs/zh/start.mdx
  • docs/en/start.mdx
🧬 Code graph analysis (1)
packages/doom/src/cli/load-config.ts (1)
packages/doom/src/plugins/replace/index.ts (1)
  • config (45-67)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Build and Lint with Node.js 18 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 24 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 20 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 20 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 24 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 18 on ubuntu-latest
🔇 Additional comments (8)
packages/doom/src/types.ts (1)

35-35: LGTM! Type definition is correct.

The optional lang?: string property appropriately extends GlobalCliOptions to support the new CLI language flag.

packages/doom/src/cli/index.ts (1)

117-117: LGTM! CLI option is correctly defined.

The --lang <language> global option is properly placed and will be accessible to all commands via optsWithGlobals<GlobalCliOptions>().

packages/doom/src/cli/load-config.ts (3)

135-135: LGTM! Parameter additions are correct.

The lang parameter is properly added to getCommonConfig's signature and destructuring, maintaining consistency with other CLI options.

Also applies to: 154-154


156-158: LGTM! Early assignment ensures CLI override precedence.

Setting config.lang when lang != null correctly gives CLI options precedence over configuration file settings, which is the expected behavior for command-line overrides.


419-419: LGTM! Configuration threading is complete.

The lang option is correctly threaded from loadConfig through to getCommonConfig, enabling the CLI flag to influence language resolution throughout the configuration pipeline.

Also applies to: 505-505

docs/en/start.mdx (1)

107-107: LGTM! Documentation accurately reflects the new CLI option.

The --lang <language> option is correctly documented with an appropriate description that matches the implementation.

.changeset/good-wombats-study.md (1)

1-5: LGTM! Changeset is properly formatted.

The patch version bump is appropriate for this backward-compatible feature addition, and the description clearly communicates the new capability.

docs/zh/start.mdx (1)

103-103: LGTM! Chinese documentation accurately reflects the new CLI option.

The --lang <language> option is correctly documented, maintaining consistency with the English documentation.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Signed-off-by: JounQin <admin@1stg.me>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 13, 2025

Open in StackBlitz

yarn add https://pkg.pr.new/@alauda/doom@187.tgz
yarn add https://pkg.pr.new/@alauda/doom-export@187.tgz

commit: 53f5d12

@JounQin JounQin merged commit 2373559 into main Oct 13, 2025
16 checks passed
@JounQin JounQin deleted the feat/lang branch October 13, 2025 10:36
github-actions bot pushed a commit that referenced this pull request Oct 13, 2025
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