Skip to content

Commit 23c638b

Browse files
chore: add Cursor cloud agent environment (#49)
* chore: add cursor cloud agent environment * docs: add cloud agent testing guidance
1 parent 92a000a commit 23c638b

3 files changed

Lines changed: 46 additions & 0 deletions

File tree

.cursor/Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM node:24-bookworm-slim
2+
3+
ARG PNPM_VERSION=10.32.1
4+
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
5+
6+
RUN apt-get update \
7+
&& apt-get install -y --no-install-recommends git sudo \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
RUN id -u ubuntu >/dev/null 2>&1 || useradd -m -s /bin/bash ubuntu \
11+
&& usermod -aG sudo ubuntu \
12+
&& echo "ubuntu ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/ubuntu \
13+
&& chmod 0440 /etc/sudoers.d/ubuntu
14+
15+
RUN corepack enable && corepack prepare "pnpm@${PNPM_VERSION}" --activate
16+
17+
WORKDIR /workspace
18+
19+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
20+
COPY packages/cddl/package.json packages/cddl/package.json
21+
COPY packages/cddl2ts/package.json packages/cddl2ts/package.json
22+
COPY packages/cddl2java/package.json packages/cddl2java/package.json
23+
COPY packages/cddl2py/package.json packages/cddl2py/package.json
24+
25+
RUN pnpm install --frozen-lockfile
26+
27+
RUN chown -R ubuntu:ubuntu /workspace
28+
29+
USER ubuntu

.cursor/environment.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "node-24-pnpm-workspace",
3+
"user": "ubuntu",
4+
"build": {
5+
"dockerfile": "Dockerfile",
6+
"context": ".."
7+
}
8+
}

AGENTS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Cursor Cloud specific instructions
2+
3+
- This repository defines a repo-level cloud agent environment in `.cursor/environment.json`.
4+
- The corresponding `.cursor/Dockerfile` pins Node 24 and pnpm 10.32.1, then preinstalls the pnpm workspace dependencies into `/workspace`.
5+
- You can run these commands immediately in a fresh cloud agent without a preliminary `pnpm install`:
6+
- `pnpm compile`
7+
- `pnpm run test:typechecks`
8+
- For focused Vitest runs, disable coverage so single-file or narrow test selections are not blocked by the repo's global coverage thresholds:
9+
- `pnpm exec vitest --config vitest.config.ts --run --coverage.enabled=false packages/cddl/tests/parser.test.ts`

0 commit comments

Comments
 (0)