regression: building utils back to run live server#7149
regression: building utils back to run live server#7149sriramveeraghanta merged 1 commit intopreviewfrom
Conversation
WalkthroughThe package configuration was updated to use compiled JavaScript files as entry points instead of TypeScript sources. A build script utilizing Changes
Poem
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
packages/utils/package.json (2)
7-9: Add conditional exports for dual package support
It's recommended to explicitly define theexportsfield to guide Node and bundlers to the right entry points and type definitions, reducing accidental deep imports.Apply this diff:
--- a/packages/utils/package.json +++ b/packages/utils/package.json @@ lines 7-9 "main": "./dist/index.js", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + } + },
10-12: Review thefilesinclusion pattern
The glob"dist/**"will include all files underdist, but it's more common to whitelist the directory itself (e.g."dist") and include other assets (README, LICENSE) explicitly. If this package remains private, this has no effect on publishing.Optionally adjust to:
--- a/packages/utils/package.json +++ b/packages/utils/package.json @@ lines 10-12 - "files": [ - "dist/**" - ], + "files": [ + "dist", + "README.md", + "LICENSE" + ],
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/utils/package.json(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Analyze (javascript)
- GitHub Check: Analyze (python)
🔇 Additional comments (1)
packages/utils/package.json (1)
32-32:Details
✅ Verification successful
Verify TSUP version compatibility
Pinningtsup@8.4.0is fine, but ensure this version supports all used flags (--dts,--external,--minify, etc.) and is in sync with the rest of the monorepo.Run:
🏁 Script executed:
#!/bin/bash # Verify tsup version and flag support npx tsup --version npx tsup --help | grep -- '--dts\|--external\|--minify'Length of output: 701
🏁 Script executed:
#!/bin/bash # Verify tsup@8.4.0 version and flag support npx tsup@8.4.0 --version npx tsup@8.4.0 --help | grep -- '--dts\|--external\|--minify'Length of output: 713
TSUP v8.4.0 supports all required flags
I’ve confirmed that tsup@8.4.0 correctly provides--dts,--external, and--minify(along with related sub-flags). No further action needed here.
| "dist/**" | ||
| ], | ||
| "scripts": { | ||
| "build": "tsup ./src/index.ts --format esm,cjs --dts --external react --minify", |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Enhance the build script for a cleaner output
Adding a clean step and source maps can improve developer experience and ensure stale files don't linger in dist.
Consider updating to:
--- a/packages/utils/package.json
+++ b/packages/utils/package.json
@@ line 14
- "build": "tsup ./src/index.ts --format esm,cjs --dts --external react --minify",
+ "build": "tsup src/index.ts --clean --sourcemap --format esm,cjs --dts --external react --minify",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "build": "tsup ./src/index.ts --format esm,cjs --dts --external react --minify", | |
| "build": "tsup src/index.ts --clean --sourcemap --format esm,cjs --dts --external react --minify", |
🤖 Prompt for AI Agents
In packages/utils/package.json at line 14, the build script should be enhanced
by adding a clean step to remove old build files before building and enabling
source maps for better debugging. Modify the build script to first clean the
dist directory and then run tsup with source maps enabled, ensuring a cleaner
output and improved developer experience.
Description
Building utils back to run live server, until we figure out a way to transpile external deps in rebuild
Summary by CodeRabbit