Skip to content

Conversation

@yandadaFreedom
Copy link
Contributor

@yandadaFreedom yandadaFreedom commented Oct 27, 2025

Summary by CodeRabbit

Release Notes

  • New Features
    • Extended platform support to include 'ks' mode as an available option in CLI utilities
    • Added configuration file mapping for the new 'ks' platform mode

@coderabbitai
Copy link

coderabbitai bot commented Oct 27, 2025

Walkthrough

The pull request adds support for a new 'ks' mode across CLI shared utilities. The Mode type union is extended to include 'ks', and the SUPPORT_MODE array and MODE_CONFIG_FILES_MAP are updated to register this new mode with its associated configuration file.

Changes

Cohort / File(s) Summary
New mode 'ks' support
packages/cli-shared-utils/lib/index.js, packages/cli-shared-utils/lib/target.js
Extended Mode typedef to include 'ks' union value; added 'ks' to SUPPORT_MODE array; mapped 'ks' mode to ['project.config.json'] in MODE_CONFIG_FILES_MAP

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Both changes are homogeneous—the same mode string is added consistently across two related configuration locations
  • No complex logic or structural modifications involved

Poem

🐰 A whisper in the mode, a 'ks' appears,
Hopping through configs without any fears,
One string, two places, harmony complete,
Sharing utils made this small feat sweet! ✨

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 pull request title "feat: 支持快手小程序" (which translates to "feat: support Kuaishou mini-program") directly aligns with the primary changes in the pull request. The changeset adds support for a new mini-program platform (Kuaishou, represented by the 'ks' mode) by extending the Mode typedef to include 'ks', adding 'ks' to the SUPPORT_MODE list, and configuring its associated project files. The title is concise, clear, and specific enough that a teammate reviewing the commit history would immediately understand the primary objective: adding support for Kuaishou mini-programs.
✨ 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-convert-ks-v2

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a7a2b28 and f537e9d.

📒 Files selected for processing (2)
  • packages/cli-shared-utils/lib/index.js (1 hunks)
  • packages/cli-shared-utils/lib/target.js (2 hunks)
🔇 Additional comments (1)
packages/cli-shared-utils/lib/target.js (1)

11-11: LGTM – 'ks' mode support correctly added.

The addition of 'ks' (Kuaishou) to SUPPORT_MODE and its configuration file mapping to 'project.config.json' is consistent with other mini-program platforms (wx, qq, tt, dd). The placement maintains logical grouping of platform types.

Also applies to: 23-23


/**
* @typedef { 'wx' | 'ali' | 'swan' | 'qq' | 'tt' | 'dd' | 'web' | 'android' | 'ios' } Mode
* @typedef { 'wx' | 'ali' | 'swan' | 'qq' | 'tt' | 'dd' | 'ks' | 'web' | 'android' | 'ios' } Mode
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Typedef is incomplete – add missing modes for consistency.

While adding 'ks' is correct, the Mode typedef is missing 'tenon' and 'harmony' which are present in SUPPORT_MODE (target.js line 11). This can cause type mismatches in TypeScript-aware tooling.

Apply this diff to complete the typedef:

-/**
- * @typedef { 'wx' | 'ali' | 'swan' | 'qq' | 'tt' | 'dd'  | 'ks' | 'web' | 'android' | 'ios' } Mode
- * @typedef { { mode: Mode, env: 'development' | 'production' } } Target
- */
+/**
+ * @typedef { 'wx' | 'ali' | 'swan' | 'qq' | 'tt' | 'dd' | 'ks' | 'web' | 'tenon' | 'android' | 'ios' | 'harmony' } Mode
+ * @typedef { { mode: Mode, env: 'development' | 'production' } } Target
+ */

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In packages/cli-shared-utils/lib/index.js around line 3, the JSDoc typedef for
Mode is missing the 'tenon' and 'harmony' values that exist in SUPPORT_MODE
(target.js line 11); update the typedef to include 'tenon' and 'harmony' so it
reads with all supported modes (wx, ali, swan, qq, tt, dd, ks, tenon, harmony,
web, android, ios) ensuring TypeScript-aware tooling and type checks see the
full set.

@mater1996 mater1996 merged commit b38cf05 into next Oct 28, 2025
1 check passed
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.

3 participants