chore(build): Remove source maps from npm package#1092
Conversation
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 significantly optimizes the npm package size by eliminating unnecessary build artifacts. It focuses on removing source maps that were not functional in the current build setup and further reduces the footprint by stripping comments from the compiled JavaScript, resulting in a substantial decrease in the distributed package's size. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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
|
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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. 📝 WalkthroughWalkthroughConfiguration updates to TypeScript compiler options in build files and addition of a new JSON schema file documenting Repomix configuration structure at version 1.11.1. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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 |
Deploying repomix with
|
| Latest commit: |
84a6f51
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://770b31df.repomix.pages.dev |
| Branch Preview URL: | https://chore-remove-source-maps-fro.repomix.pages.dev |
There was a problem hiding this comment.
Code Review
This pull request is a great optimization, removing source maps from the npm package to significantly reduce its size. The changes in package.json and tsconfig.build.json correctly disable the generation of .js.map and .d.ts.map files and also remove comments from the output JavaScript. I have one suggestion to make the build configuration more robust by explicitly enabling declaration file generation in tsconfig.build.json to prevent accidental breakage in the future.
Code ReviewReviewer: Claude (AI) SummaryThis is a clean, well-structured PR that achieves a significant package size optimization (~50% reduction) by removing unused build artifacts. Assessment: ✅ ApproveThe changes are minimal, focused, and achieve the stated goal effectively. Detailed AnalysisCode Quality
Build Configuration ReviewThe TypeScript configuration changes are correct:
These settings properly override the base CorrectnessThe PR author's reasoning is sound:
Premortem Analysis - Potential Failure Scenarios
Minor Observations
Checklist
Verdict: Ready to merge. Great optimization with minimal risk. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@website/client/src/public/schemas/1.11.1/schema.json`:
- Around line 1-168: The generated schema lacks a trailing newline and some
integer-like fields in the source Zod schema are using floating number types;
update generateSchema.ts to append '\n' to the JSON.stringify(...) write so
output ends with a newline, and in configSchema.ts change the Zod definitions
for maxFileSize, topFilesLength, sortByChangesMaxCommits, and includeLogsCount
from z.number() to z.number().int() (splitOutput already uses .int() and should
remain unchanged) so the generated JSON schema marks those fields as integers.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
package.jsontsconfig.build.jsonwebsite/client/src/public/schemas/1.11.1/schema.json
⏰ 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). (1)
- GitHub Check: Cloudflare Pages
🔇 Additional comments (2)
package.json (1)
23-23: LGTM! Clean consolidation of build configuration.Moving source map and declaration handling from CLI flags to
tsconfig.build.jsonimproves maintainability by keeping all compiler options in one place.tsconfig.build.json (1)
3-8: LGTM! Configuration changes align well with the package size reduction goal.The combination of
sourceMap: false,declarationMap: false, andremoveComments: trueeffectively reduces the build output size while maintaining the essential.d.tsdeclaration files (inherited from base config) needed for TypeScript consumers.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
d9b5492 to
e04aee4
Compare
Source maps (.js.map, .d.ts.map) were included in the npm package but served no purpose since the original TypeScript source files are not published. Without sourcesContent or the actual .ts files, these maps cannot be used for debugging or "Go to Definition" functionality. Changes: - Disable sourceMap and declarationMap in tsconfig.build.json - Enable removeComments to further reduce package size - Explicitly set declaration: true for clarity - Remove --sourceMap flag from build script (now handled by tsconfig) This reduces the lib/ directory size from 2.4MB to 1.2MB (~50% reduction).
e04aee4 to
0fd09f1
Compare
Code Review (Update)Reviewer: Claude (AI) AI Bot Comment EvaluationI reviewed the AI bot feedback on this PR: Gemini Code Assist - Suggestion to explicitly add `declaration: true`Priority: Not needed The CodeRabbit - Missing trailing newline & integer type suggestions for schemaPriority: Not needed (for this PR)
These are valid improvement suggestions but should be tracked as separate issues rather than blocking this PR. Updated AssessmentMy previous review stands: ✅ Ready to merge The PR achieves its stated goal (50% package size reduction) with minimal, focused changes. The AI bot suggestions are either incorrect (Gemini) or out of scope (CodeRabbit). Note: I could not access the inline review comment API directly, so I evaluated the bot comments based on their summary descriptions in the review bodies. |
Follow-up ReviewReviewer: Claude (AI) Previous Review StatusI previously reviewed this PR and approved it. Looking at the current state, my assessment remains unchanged - this is a clean PR ready for merge. AI Bot Feedback EvaluationCodeRabbit's Feedback on Schema FileCodeRabbit flagged that the generated schema file (
Verdict: This is a valid observation but should be addressed in a separate PR if desired. Gemini's Suggestion on Explicit DeclarationGemini suggested explicitly enabling declaration file generation. Looking at the current {
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"declaration": true, // ✅ Already added in this PR
"sourceMap": false,
"declarationMap": false,
"removeComments": true
}
}The author has already addressed this by adding Verdict: Already resolved. SummaryNo new issues found. The PR achieves its goal of ~50% package size reduction with minimal risk. Recommendation: ✅ Ready to merge |
Summary
.js.map,.d.ts.map) from the npm package.tssource files are not included in the packageremoveComments: trueto further reduce package sizeResult:
lib/size reduced from 2.4MB to 1.2MB (~50% reduction)Background
Source maps only work when:
sourcesContentis embedded in the map (like minimatch does), OR.tsfiles are included in the packageSince Repomix does neither, the maps served no purpose and only increased package size.
Checklist
npm run testnpm run lint