A custom buildpack designed to enable and streamline the use of Bun as the package manager and runtime for applications deployed on Scalingo. This buildpack is particularly optimized for monorepos and supports Bun-specific workflows, including workspace management and caching.
- Installs Bun automatically.
- Executes
bun installto manage dependencies. - Supports monorepos with custom scripts.
- Builds and runs your application using Bun commands.
- Optimized for Scalingo's environment.
-
Add the buildpack to your Scalingo application:
scalingo --app <your-app-name> env-set BUILDPACK_URL=https://github.com/<your-username>/scalingo-bun-buildpack.git
-
Deploy your application as usual:
git push scalingo main
- Detection: The buildpack checks if the
package.jsonfile contains"packageManager": "bun". - Installation:
- Installs Bun via the official Bun installer.
- Adds Bun to the system
PATH. - Installs dependencies with
bun install --cache.
- Build:
- Executes
bun run buildif defined in thepackage.jsonfile. - Runs workspace-specific build scripts if applicable.
- Executes
- Release:
- Configures the startup command for the application (e.g.,
bun run start).
- Configures the startup command for the application (e.g.,
- Node.js version
20(as specified in yourpackage.json). - A
package.jsonfile with"packageManager": "bun". - Properly configured workspace structure (if applicable).
You can modify the following scripts in your package.json to align with the buildpack's default behavior:
build: Define custom build steps for your application.start: Specify the entry point for your app (default:bun run start).
{
"packageManager": "[email protected]",
"workspaces": {
"packages": [
"apps/*",
"packages/*"
]
},
"scripts": {
"build": "bun run --cwd packages/common build && bun run --cwd apps/api build",
"start": "bun run --cwd apps/api start"
},
"engines": {
"node": "20"
}
}Feel free to fork this repository and submit pull requests for improvements or additional features.
This project is licensed under the MIT License.