-
Notifications
You must be signed in to change notification settings - Fork 3
ENG-428 Cross-platform build script in packages/database #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Important Review skippedAuto 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 📝 WalkthroughWalkthroughThe build process for the database package was refactored. The npm build script now directly runs a new TypeScript script, 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 (
|
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
packages/database/scripts/build.ts (3)
1-2: Fix import formatting.Missing space after comma in the import statement.
-import {writeFileSync} from "fs" +import { writeFileSync } from "fs"
4-4: Use strict equality comparison.Use
!==instead of!=for strict equality comparison to avoid type coercion issues.-if (process.env.HOME != '/vercel') { +if (process.env.HOME !== '/vercel') {
13-13: Consider using absolute path for output file.The relative path
'types.gen.ts'may write to an unexpected location depending on the current working directory when the script is executed.+import { join } from "path"; +import { dirname } from "path"; +import { fileURLToPath } from "url"; + +const __dirname = dirname(fileURLToPath(import.meta.url)); +const projectRoot = join(__dirname, '..'); - writeFileSync('types.gen.ts', stdout); + writeFileSync(join(projectRoot, 'types.gen.ts'), stdout);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/database/package.json(1 hunks)packages/database/scripts/build.ts(1 hunks)
🔇 Additional comments (1)
packages/database/package.json (1)
17-17: Good refactoring to improve maintainability.Moving the conditional logic from shell script to TypeScript improves readability and maintainability. The change centralizes the build logic in a dedicated script file.
mdroidian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Summary by CodeRabbit