diff --git a/.cursor/Dockerfile b/.cursor/Dockerfile new file mode 100644 index 0000000000..3e2cb19afc --- /dev/null +++ b/.cursor/Dockerfile @@ -0,0 +1,26 @@ +FROM ghcr.io/oven-sh/bun-development-docker-image:prebuilt + +# Create a non-root user for development +RUN useradd -m -s /bin/bash ubuntu + +# Create workspace directory and give ubuntu user access +RUN mkdir -p /workspace && \ + chown -R ubuntu:ubuntu /workspace && \ + # Allow ubuntu user to use sudo without password for development tasks + apt-get update && apt-get install -y sudo && \ + echo "ubuntu ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \ + rm -rf /var/lib/apt/lists/* + +# Set the user and working directory +USER ubuntu +WORKDIR /workspace/bun + +# Configure Git for the ubuntu user (agents often need this) +RUN git config --global user.name "Background Agent" && \ + git config --global user.email "agent@cursor.com" && \ + git config --global init.defaultBranch main + +# Ensure PATH includes Bun binaries for the ubuntu user +ENV PATH="/workspace/bun/build/debug:/workspace/bun/build/release:/usr/local/bin:${PATH}" + +RUN git pull \ No newline at end of file diff --git a/.cursor/environment.json b/.cursor/environment.json new file mode 100644 index 0000000000..fdb9c647cb --- /dev/null +++ b/.cursor/environment.json @@ -0,0 +1,7 @@ +{ + "build": { + "dockerfile": ".cursor/Dockerfile", + "context": "." + }, + "terminals": [] +} diff --git a/.cursor/rules/building-bun.mdc b/.cursor/rules/building-bun.mdc index 28f86a9f17..764e7c64ef 100644 --- a/.cursor/rules/building-bun.mdc +++ b/.cursor/rules/building-bun.mdc @@ -1,27 +1,13 @@ --- description: How to build Bun -globs: +globs: +alwaysApply: false --- + # How to build Bun -## CMake +Run: -Bun is built using CMake, which you can find in `CMakeLists.txt` and in the `cmake/` directory. - -* `CMakeLists.txt` -* `cmake/` - * `Globals.cmake` - macros and functions used by all the other files - * `Options.cmake` - build options for configuring the build (e.g. debug/release mode) - * `CompilerFlags.cmake` - compiler and linker flags used by all the targets - * `tools/` - setup scripts for various build tools (e.g. llvm, zig, webkit, rust, etc.) - * `targets/` - targets for bun and its dependencies (e.g. brotli, boringssl, libuv, etc.) - -## How to - -There are `package.json` scripts that make it easy to build Bun without calling CMake directly, for example: - -```sh -bun run build # builds a debug build: `build/debug/bun-debug` -bun run build:release # builds a release build: `build/release/bun` -bun run build:assert # builds a release build with debug assertions: `build/assert/bun` +```bash +bun bd ```