Configure cursor

This commit is contained in:
Jarred Sumner
2025-05-28 21:54:27 -07:00
parent 7989352b39
commit 06a40f0b29
3 changed files with 39 additions and 20 deletions

26
.cursor/Dockerfile Normal file
View File

@@ -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

7
.cursor/environment.json Normal file
View File

@@ -0,0 +1,7 @@
{
"build": {
"dockerfile": ".cursor/Dockerfile",
"context": "."
},
"terminals": []
}

View File

@@ -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
```