Conversation
🦋 Changeset detectedLatest commit: 8c092bc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis update modifies the evaluation logic for the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant OpenAI API
User->>CLI: Run translate command
CLI->>OpenAI API: Call chat.completions.parse (stable)
OpenAI API-->>CLI: Return parsed completion
CLI-->>User: Output translation result
Possibly related PRs
Poem
✨ Finishing Touches
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.
Pull Request Overview
This PR corrects the evaluation of the when expression in the new CLI command, updates the OpenAI chat API call to the non-beta endpoint, and bumps related package versions (including adding a release tag).
- Switch
openai.beta.chat.completions.parsetoopenai.chat.completions.parse - Refine
whencheck to skip only explicit string falsy values - Update the
releasescript and bump dependency versions (notablyopenai, linting tools, and TypeScript placements)
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/cli/translate.ts | Updated OpenAI API call from beta to stable chat.completions |
| src/cli/new.ts | Added null check before testing string-falsy when values |
| package.json | Added --tag to release, bumped dozens of package versions |
| .changeset/proud-masks-kiss.md | Added changeset note for the when fix |
Comments suppressed due to low confidence (1)
package.json:98
- TypeScript is a build-time tool and should live under
devDependenciesinstead ofdependenciesto avoid shipping it in production bundles.
+ "typescript": "^5.8.3",
commit: |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
package.json (1)
98-98: Note: TypeScript moved to runtime dependencies.TypeScript has been moved from devDependencies to dependencies, suggesting it's now required at runtime. Ensure this is intentional and necessary for your use case.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (4)
.changeset/proud-masks-kiss.md(1 hunks)package.json(2 hunks)src/cli/new.ts(1 hunks)src/cli/translate.ts(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/cli/new.ts (1)
src/shared/constants.ts (1)
JS_STR_FALSY_VALUES(17-25)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: Build and Lint with Node.js 24 on ubuntu-latest
- GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
- GitHub Check: Build and Lint with Node.js 18 on ubuntu-latest
- GitHub Check: Build and Lint with Node.js 20 on ubuntu-latest
- GitHub Check: Build and Lint with Node.js 18 on ubuntu-latest
- GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
🔇 Additional comments (5)
src/cli/new.ts (1)
224-226: LGTM! Correct handling of null/undefined values.The explicit null check ensures that
whenexpressions are evaluated correctly. Whenwhenisnullorundefined, the layout should be processed (not skipped), which this fix properly implements..changeset/proud-masks-kiss.md (1)
1-6: LGTM! Proper changeset documentation.The changeset correctly documents the patch fix and aligns with the code changes made in
src/cli/new.ts.package.json (2)
51-51: LGTM! Release script updated for proper tagging.The addition of
--tag release-0.xto the changeset publish command provides better release management.
79-79:Details
✅ Verification successful
Verify OpenAI package version and security status.
The upgrade from
^5.0.0-beta.0to^5.1.1aligns with the API change insrc/cli/translate.ts. Please verify this version exists and check for any security advisories.
🏁 Script executed:
#!/bin/bash # Description: Verify OpenAI package version exists and check for security advisories # Check latest version on npm npm view openai version # Check for known vulnerabilities npm audit --audit-level moderate --package-lock-only openaiLength of output: 442
🏁 Script executed:
#!/bin/bash set -e # Create a minimal lockfile for the OpenAI package npm install openai@5.1.1 --package-lock-only # Run an audit at moderate level and output JSON npm audit --audit-level moderate --jsonLength of output: 2973
OpenAI v5.1.1 confirmed – no advisories found
npm view openai versionreturned 5.1.1, matching the upgrade.npm auditshows no vulnerabilities for the OpenAI package itself (all reported issues are in unrelated deps).src/cli/translate.ts (1)
154-154: LGTM! Correct API endpoint update.The change from
openai.beta.chat.completions.parsetoopenai.chat.completions.parseproperly aligns with the OpenAI package upgrade from beta (^5.0.0-beta.0) to stable (^5.1.1) version inpackage.json.
Summary by CodeRabbit
Bug Fixes
whenexpression to handlenullorundefinedvalues correctly.Chores