fix(config): Revert config file from TypeScript to JSON format#905
fix(config): Revert config file from TypeScript to JSON format#905
Conversation
This change addresses issue #899 where running repomix against its own repository fails when dependencies are not installed. The TypeScript config file required runtime module resolution (including dependencies like picocolors), which caused errors in fresh clones without npm install. The JSON format: - Requires no dependencies or module resolution - Is more stable and universal - Works immediately after git clone without npm install - Maintains all the same configuration options Closes #899
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThe PR replaces the TypeScript configuration file ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes The review requires validation of the new JSON config structure against expected settings, verification of schema comprehensiveness and correctness, and confirmation that removing the TypeScript config file resolves the reported module-loading issue without breaking existing workflows. Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
🔇 Additional comments (2)
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. Comment |
Summary of ChangesHello @yamadashy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements a crucial fix by changing the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Pull Request Overview
Reverts the repository configuration from TypeScript to a pure JSON format to eliminate runtime dependency issues when loading the config without installed packages.
- Removes TypeScript-based config that required module resolution.
- Adds a JSON schema-based config file with equivalent settings.
- Simplifies loading by avoiding imports and runtime dependencies.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| repomix.config.ts | Removed TypeScript config that depended on runtime imports. |
| repomix.config.json | Added JSON config providing equivalent settings without dependencies. |
There was a problem hiding this comment.
Code Review
This pull request reverts the configuration file from TypeScript to JSON format to resolve an issue with dependency resolution when running repomix on its own repository. This is a sensible change that improves the tool's out-of-the-box experience. The new repomix.config.json file correctly mirrors the previous configuration. I have one suggestion to improve the new configuration file by making it strictly compliant with the JSON standard.
Deploying repomix with
|
| Latest commit: |
ccd63ba
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://05259269.repomix.pages.dev |
| Branch Preview URL: | https://fix-js-config.repomix.pages.dev |
PR Review - Config File Format ReversionThank you for addressing issue #899! This is a pragmatic solution to ensure Repomix can analyze its own repository without requiring dependencies. Here's my review: ✅ Strengths
🔍 Issues & Suggestions1. JSON5 Comment Syntax (Major Issue)File: "ignore": {
"useGitignore": true,
"useDefaultPatterns": true,
// ignore is specified in .repomixignore
"customPatterns": []
}Problem: The file uses Why it works now: The code uses JSON5.parse() for all JSON files (configLoad.ts:130), which tolerates comments. Recommendation: Either:
I suggest removing the comment since:
2. Missing Schema File Generation (Minor Issue)File: Observation: The schema file appears to be manually added to the PR, but based on Verification needed:
Recommendation: Document in the PR description or CONTRIBUTING.md that the schema should be generated via the appropriate npm script. 3. Documentation Update ConsiderationWhile the configuration documentation (website/client/src/en/guide/configuration.md) correctly shows JSON as the recommended format for Suggested addition to the Configuration docs: > **Note**: For repositories that may be analyzed without installing dependencies (like via npx),
> JSON format is recommended over TypeScript. TypeScript configs require the `repomix` package
> to be installed for the `defineConfig` import.4. GitHub Action Dependency ConsiderationFile: The action currently runs Current behavior is correct but consider adding a comment explaining this handles both TS and JSON configs in different repositories. 🧪 Testing Recommendations
📋 Checklist Status
SummaryThis is a solid fix for the reported issue. The main action item is addressing the JSON comment syntax to ensure full compatibility. Once that's resolved, this PR will properly solve #899. Recommended action: Remove the comment on line 35 of |
Summary
This PR reverts the repository's config file from TypeScript (
repomix.config.ts) to JSON (repomix.config.json) format to address issue #899.Problem
When running repomix against its own repository without installing dependencies (
npm install), the TypeScript config file fails with:This happens because:
defineConfig,picocolors, etc.)npm install, dependencies are not availableSolution
Switch to JSON format configuration which:
git clonewithoutnpm installChecklist
npm run testnpm run lintCloses #899