Skip to content

Conversation

@wangshunnn
Copy link

@wangshunnn wangshunnn commented Sep 17, 2025

Feat

This PR adds support for the Mpx front-end framework, whose syntax is similar to Vue, and its i18n usage is also consistent with Vue.
Since the current plugin does not provide configuration options for such language frameworks, the goal here is to modify the source code to enable support.

Summary by CodeRabbit

  • New Features
    • Added support for the MPX language, enabling it to be recognized alongside Vue-related files.
    • MPX files now benefit from existing Vue framework features, including framework detection and associated tooling where applicable (e.g., code intelligence, parsing, and validations).
    • Improves consistency when working with mixed Vue/MPX codebases by ensuring MPX is treated as a first-class language within the app’s framework-aware functionalities.

@coderabbitai
Copy link

coderabbitai bot commented Sep 17, 2025

Walkthrough

Adds support for the 'mpx' language ID by updating the Vue framework’s recognized language identifiers and registering 'mpx' in the global LanguageId mapping.

Changes

Cohort / File(s) Summary
Vue framework detection
src/frameworks/vue.ts
Extended VueFramework.languageIds to include 'mpx'.
Language ID mapping
src/utils/LanguageId.ts
Added mpx: 'mpx' to LanguageIdExtMap, expanding the LanguageId type and mapping.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "feat: add support for 'mpx' language in Vue framework" is concise and accurately describes the primary change in the diff—adding 'mpx' as a recognized language and updating VueFramework language IDs and LanguageIdExtMap. It is specific, uses a conventional "feat:" prefix, and provides clear scope for reviewers. This matches the provided file summaries and PR objectives.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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: 0

🧹 Nitpick comments (2)
src/utils/LanguageId.ts (1)

24-24: Fix ESLint quote-props violation for 'mpx'.

ESLint reports “Inconsistently quoted property 'mpx'.” Quote the key (or align the rule/project style). Minimal fix:

-  mpx: 'mpx',
+  'mpx': 'mpx',

Please run the linter to confirm. If your config is quote-props: ["error", "consistent-as-needed"], the original form should be valid—adjust the rule or keep the quoted form consistently across this object as per repo conventions.

src/frameworks/vue.ts (1)

30-31: Enable auto‑extraction for .mpx files.

Without updating supportAutoExtraction, auto extraction won’t trigger for Mpx SFCs.

Suggested change (outside this hunk):

supportAutoExtraction = ['vue', 'mpx']

Also consider expanding detection.packageJSON for Mpx projects (e.g., @mpxjs/* packages) so the framework activates even when Vue deps aren’t present. Please verify the exact package names used in typical Mpx setups before adding them.

📜 Review details

Configuration used: Repository: lokalise/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4c504c9 and 962137f.

📒 Files selected for processing (2)
  • src/frameworks/vue.ts (1 hunks)
  • src/utils/LanguageId.ts (1 hunks)
🧰 Additional context used
🪛 ESLint
src/utils/LanguageId.ts

[error] 24-24: Inconsistently quoted property 'mpx' found.

(quote-props)

🔇 Additional comments (1)
src/frameworks/vue.ts (1)

30-31: Great: 'mpx' added to Vue language IDs.

This will enable Vue rules on .mpx files. LGTM.

Confirm the VS Code language id for .mpx files is indeed mpx in your environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant