Skip to content

feat: enable npx support - no bun installation required#6

Merged
namastex888 merged 5 commits into
mainfrom
feat/npx-support
Dec 8, 2025
Merged

feat: enable npx support - no bun installation required#6
namastex888 merged 5 commits into
mainfrom
feat/npx-support

Conversation

@namastex888

Copy link
Copy Markdown
Contributor

Summary

Users can now run npx pgserve without installing bun globally. Bun is bundled as an npm dependency and automatically downloaded for the user's platform.

Before:

Requires Bun runtime (install from bun.sh)
bunx pgserve

After:

npx pgserve

Changes

  • Add bun as npm dependency (^1.3.4)
  • Add Node.js wrapper (bin/pgserve-wrapper.cjs) that finds and spawns local bun
  • Update README: all bunxnpx, remove bun requirements
  • Update CI: add npx integration test job
  • Rename test-bunx.shtest-npx.sh

Performance

Method Startup Time
Direct bun 42ms
Node wrapper 65ms

~23ms overhead - negligible for a long-running server. Once running, performance is identical because the wrapper just spawns bun with stdio: 'inherit'.

Test plan

  • node bin/pgserve-wrapper.cjs --help works
  • node bin/pgserve-wrapper.cjs --no-cluster --port 15433 starts server
  • Lint passes
  • Dead code check passes
  • CI npx test passes

Users can now run `npx pgserve` without installing bun globally.
Bun is bundled as an npm dependency and automatically downloaded.

Changes:
- Add bun as npm dependency (^1.3.4)
- Add Node.js wrapper (bin/pgserve-wrapper.cjs) that spawns local bun
- Update README: bunx → npx, remove bun requirements
- Update CI: add npx integration test
- Rename test-bunx.sh → test-npx.sh

Performance: ~23ms startup overhead, zero runtime overhead.
The wrapper just spawns bun - all Bun.* APIs run natively.

BREAKING: None. bunx pgserve still works for bun users.
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @namastex888, 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 significantly enhances the user experience by enabling pgserve to be run directly via npx without requiring a global Bun installation. It achieves this by bundling the Bun runtime as an npm dependency and introducing a Node.js wrapper to manage its execution. This change simplifies the initial setup for users and integrates pgserve more seamlessly into the standard Node.js ecosystem, while maintaining the performance benefits of the Bun runtime internally.

Highlights

  • Simplified User Experience: Users can now run npx pgserve without needing to install Bun globally, streamlining the setup process.
  • Bundled Bun Runtime: Bun is now included as an npm dependency, automatically downloaded for the user's platform, eliminating external runtime requirements.
  • Node.js Wrapper: A new Node.js wrapper (bin/pgserve-wrapper.cjs) has been introduced to locate and execute the bundled Bun runtime, ensuring compatibility with npx.
  • Documentation Updates: The README.md has been updated to reflect the new npx usage, remove explicit Bun installation requirements, and clarify internal Bun usage for contributors.
  • CI/Testing Enhancements: The CI pipeline now includes an npx integration test, and the test script has been renamed from test-bunx.sh to test-npx.sh to align with the new usage.
  • Dependency Streamlining: The project's dependency tree has been significantly streamlined by adding bun as a direct dependency and removing many other packages that are now implicitly handled or replaced by Bun.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci.yml
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@namastex888 namastex888 merged commit 98c0593 into main Dec 8, 2025
6 checks passed
@namastex888 namastex888 deleted the feat/npx-support branch December 8, 2025 16:37

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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 is a great enhancement, enabling npx support by bundling bun as a dependency and adding a Node.js wrapper. This significantly improves the user experience by removing the need for a global bun installation. The implementation of the wrapper script is robust, covering multiple platforms and edge cases for locating the bun binary, and includes proper signal forwarding and error handling. The documentation and test scripts have also been updated accordingly. I've found one critical issue in package.json that needs to be addressed.

Comment thread package.json
Comment on lines +58 to +65
"lint-staged": {
"src/**/*.js": [
"eslint --fix"
],
"bin/**/*.js": [
"eslint --fix"
]
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The package.json file contains a syntax error. The lint-staged configuration block is incorrectly indented, which makes the JSON file invalid and will cause package managers to fail. It should be at the same indentation level as other top-level keys like devDependencies.

Suggested change
"lint-staged": {
"src/**/*.js": [
"eslint --fix"
],
"bin/**/*.js": [
"eslint --fix"
]
},
"lint-staged": {
"src/**/*.js": [
"eslint --fix"
],
"bin/**/*.js": [
"eslint --fix"
]
},

namastex888 added a commit that referenced this pull request Dec 8, 2025
Violation: Manually set version to 1.1.0 in package.json during PR,
then manually triggered workflow_dispatch for release. Result:
version jumped from 1.0.9 → 1.1.1-rc.1 (skipped 1.1.0-rc.1).

Correction:
- Never manually bump version in package.json
- Never manually trigger workflow_dispatch for releases
- Always use PR with `rc` or `stable` label
- Version bumping is automated by scripts/release.cjs

Evidence: PR #6 npx support feature, release v1.1.1-rc.1
Net growth: +7 lines (surgical addition to Amendment #3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant