Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
"description": "Helper functions shared across multiple apps internally",
"license": "AGPL-3.0",
"private": true,
"main": "./src/index.ts",
"module": "./src/index.ts",
"types": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/**"
],
"scripts": {
"build": "tsup ./src/index.ts --format esm,cjs --dts --external react --minify",
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ 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.

Suggested change
"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.

"lint": "eslint src --ext .ts,.tsx",
"lint:errors": "eslint src --ext .ts,.tsx --quiet"
},
Expand All @@ -25,6 +29,7 @@
"@types/node": "^22.5.4",
"@types/react": "^18.3.11",
"@types/zxcvbn": "^4.4.5",
"tsup": "8.4.0",
"typescript": "^5.3.3"
}
}