-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Convert from npm to bun #1
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
base: main
Are you sure you want to change the base?
Conversation
## Overview Converted gemini-cli package manager from npm to bun on branch gemini-cli-bun. ## Changes ### Package Management - Replaced all `npm run` commands with `bun run` - Replaced `npx` with `bunx` - Replaced `npm ci` with `bun install --frozen-lockfile` - Updated workspace commands to use bun - Removed package-lock.json - Added bun.lock ### Documentation Updates - **README.md**: Updated installation instructions to prioritize bun - **docs/get-started/installation.md**: Updated all installation examples - **docs/local-development.md**: Updated telemetry commands - **CONTRIBUTING.md**: Updated all development workflow commands ### Script Updates - **packages/vscode-ide-companion/package.json**: Updated all scripts to use bun - **packages/vscode-ide-companion/scripts/generate-notices.js**: Added support for bun.lock ## Files Modified - package.json - README.md - CONTRIBUTING.md - docs/get-started/installation.md - docs/local-development.md - packages/vscode-ide-companion/package.json - packages/vscode-ide-companion/scripts/generate-notices.js ## Files Removed - package-lock.json ## Files Added - bun.lock
Summary of ChangesHello @principle-lgtm, 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 aims to enhance the Highlights
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
|
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.
Code Review
This pull request successfully converts the project from npm to bun as the package manager. The changes are comprehensive, covering package management commands, documentation, and scripts. The update to generate-notices.js to handle bun.lock is a good temporary solution. I've found one area for improvement in generate-notices.js regarding the mixed use of synchronous and asynchronous file system operations, for which I've provided suggestions to improve consistency and adhere to best practices.
| */ | ||
|
|
||
| import fs from 'node:fs/promises'; | ||
| import fsSync from 'node:fs'; |
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.
| if (fsSync.existsSync(bunLockPath) || fsSync.existsSync(bunLockPathAlt)) { | ||
| // bun.lockb/bun.lock is binary/text, skip parsing for now | ||
| // TODO: Implement bun.lock parsing or use bun's API | ||
| console.warn('Warning: bun.lock detected but not yet supported. Skipping dependency analysis.'); | ||
| packageLockJson = {}; // Empty object to prevent errors | ||
| } else if (fsSync.existsSync(packageLockJsonPath)) { | ||
| const packageLockJsonContent = await fs.readFile( | ||
| packageLockJsonPath, | ||
| 'utf-8', | ||
| ); | ||
| packageLockJson = JSON.parse(packageLockJsonContent); | ||
| } else { | ||
| throw new Error('Neither bun.lock/bun.lockb nor package-lock.json found. Please run "bun install" or "npm install" first.'); | ||
| } |
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.
Using synchronous file system calls like fsSync.existsSync in an async function can block the event loop and is generally not recommended. Let's refactor this to use asynchronous checks for better consistency and to follow best practices. We can perform the file existence checks in parallel for better performance.
| if (fsSync.existsSync(bunLockPath) || fsSync.existsSync(bunLockPathAlt)) { | |
| // bun.lockb/bun.lock is binary/text, skip parsing for now | |
| // TODO: Implement bun.lock parsing or use bun's API | |
| console.warn('Warning: bun.lock detected but not yet supported. Skipping dependency analysis.'); | |
| packageLockJson = {}; // Empty object to prevent errors | |
| } else if (fsSync.existsSync(packageLockJsonPath)) { | |
| const packageLockJsonContent = await fs.readFile( | |
| packageLockJsonPath, | |
| 'utf-8', | |
| ); | |
| packageLockJson = JSON.parse(packageLockJsonContent); | |
| } else { | |
| throw new Error('Neither bun.lock/bun.lockb nor package-lock.json found. Please run "bun install" or "npm install" first.'); | |
| } | |
| const [bunLockExists, bunLockAltExists, packageLockExists] = await Promise.all([ | |
| fs.stat(bunLockPath).then(() => true, () => false), | |
| fs.stat(bunLockPathAlt).then(() => true, () => false), | |
| fs.stat(packageLockJsonPath).then(() => true, () => false), | |
| ]); | |
| if (bunLockExists || bunLockAltExists) { | |
| // bun.lockb/bun.lock is binary/text, skip parsing for now | |
| // TODO: Implement bun.lock parsing or use bun's API | |
| console.warn('Warning: bun.lock detected but not yet supported. Skipping dependency analysis.'); | |
| packageLockJson = {}; // Empty object to prevent errors | |
| } else if (packageLockExists) { | |
| const packageLockJsonContent = await fs.readFile( | |
| packageLockJsonPath, | |
| 'utf-8', | |
| ); | |
| packageLockJson = JSON.parse(packageLockJsonContent); | |
| } else { | |
| throw new Error('Neither bun.lock/bun.lockb nor package-lock.json found. Please run "bun install" or "npm install" first.'); | |
| } |
Overview
This PR converts gemini-cli from npm to bun as the primary package manager on the
gemini-cli-bunbranch.Changes
Package Management
npm runcommands withbun runnpxwithbunxnpm ciwithbun install --frozen-lockfilepackage-lock.jsonbun.lockDocumentation Updates
bunxas primary execution methodbun installas primary global install methodScript Updates
Files Modified
package.jsonREADME.mdCONTRIBUTING.mddocs/get-started/installation.mddocs/local-development.mdpackages/vscode-ide-companion/package.jsonpackages/vscode-ide-companion/scripts/generate-notices.jsFiles Removed
package-lock.jsonFiles Added
bun.lockTesting
generate-notices.jshas limited bun.lock support (uses direct dependencies only when bun.lock is detected)Benefits
Next Steps