-
Notifications
You must be signed in to change notification settings - Fork 0
Set up Cloud Agent dev environment (Node 26) #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
e34a0d7
e1a3e60
b600d1a
4fd41fd
5302d9f
b3c33eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| FROM node:26-bookworm-slim | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get install -y --no-install-recommends git curl build-essential python3 \ | ||
| && rm -rf /var/lib/apt/lists/* \ | ||
| && corepack enable \ | ||
| && corepack prepare pnpm@11.1.3 --activate | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- .cursor/Dockerfile ---'
cat -n .cursor/Dockerfile
printf '%s\n' '--- Node/Corepack references ---'
rg -n --hidden -S 'node:26|corepack|pnpm@11\.1\.3|USER ' .cursor package.json pnpm-lock.yaml 2>/dev/null || trueRepository: ruszabarov/open-watch-party Length of output: 729 🌐 Web query:
💡 Result: Corepack is not bundled with Node.js 26 or Node.js 25 [1][2]. Its removal from official Node.js distributions began with the release of Node.js 25.0.0 [2][3]. As a result, Corepack is not present in the official Node.js 26 Docker images (including bookworm-slim) [4][5]. To use Corepack with these versions, you must install it manually as a global package using npm: npm install -g corepack [6] After installation, you can proceed to enable it as usual with: corepack enable [6][7] This change was a strategic decision by the Node.js Technical Steering Committee to stop distributing the Corepack executable within the Node.js binary release lines starting with version 25 [1][8]. The documentation for Corepack in Node.js core has also been removed as of Node.js 26 [9]. Citations:
Install Corepack before invoking it.
🤖 Prompt for AI AgentsSource: MCP tools
cursor[bot] marked this conversation as resolved.
Outdated
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "name": "Open Watch Party", | ||
| "build": { | ||
| "dockerfile": "Dockerfile", | ||
| "context": ".." | ||
| }, | ||
| "install": "pnpm install" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 26 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # AGENTS.md | ||
|
|
||
| ## Cursor Cloud specific instructions | ||
|
|
||
| Open Watch Party is a pnpm workspace (Node 26, pnpm 11 pinned via `packageManager`; `.nvmrc` pins Node 26). | ||
| The Cloud Agent base image is defined in `.cursor/environment.json` (`node:26-bookworm-slim` Dockerfile). | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Point the base-image reference to
🤖 Prompt for AI Agents |
||
| Dependencies are refreshed automatically on startup by the update script (`pnpm install`), | ||
| whose `postinstall` runs `wxt prepare` to generate extension types. Standard commands | ||
| live in the root `package.json` and `README.md`; prefer those over duplicating them. | ||
|
|
||
| Services / packages: | ||
| - `apps/server`: PartyServer realtime backend on Cloudflare Workers. Run with `pnpm dev:server` | ||
| (`wrangler dev`). Non-obvious: `wrangler dev` serves on `http://localhost:8787` by default, | ||
| NOT the `localhost:1999` mentioned in `apps/extension/.env.example` (that default only matters | ||
| for how the packaged extension addresses a deployed host). It runs fully local with a local | ||
| Durable Object; no Cloudflare account/login is needed for local dev. | ||
| - `apps/extension`: WXT + Svelte browser extension. Run with `pnpm dev:extension`; the WXT dev | ||
| server listens on `localhost:3000` and writes an unpacked build to | ||
| `apps/extension/.output/chrome-mv3-dev`. In this headless VM the auto-launched browser has no | ||
| display, so drive/load the unpacked extension manually if GUI testing is needed. | ||
|
|
||
| Checks (from repo root): `pnpm lint`, `pnpm format:check`, `pnpm typecheck`, `pnpm build` | ||
| (chrome production build), and per-package tests via `pnpm --filter <pkg> test`. `pnpm check` | ||
| runs the full lint + format + typecheck + all tests gauntlet. | ||
|
|
||
| Testing the realtime protocol end-to-end without a browser: connect with the `partysocket` | ||
| client (Node provides a global `WebSocket`) to `localhost:8787` and exchange the JSON | ||
| envelope messages defined in `packages/shared/src/protocol.ts` (`room:create`, `room:join`, | ||
| `playback:update`), asserting `playback:state` broadcasts propagate between clients. | ||
|
|
||
| Note: `wrangler dev` writes local state to `apps/server/.wrangler/` (untracked, safe to delete). | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Run the development environment as a non-root user.
The image has no
USERdirective, so the startuppnpm installand agent commands run as root. Add a non-root user transition after system provisioning, and ensure the workspace and package-manager cache are writable by that user.🧰 Tools
🪛 Trivy (0.73.0)
[error] 1-1: Image user should not be 'root'
Specify at least 1 USER command in Dockerfile with non-root user as argument
Rule: DS-0002
Learn more
(IaC/Dockerfile)
🤖 Prompt for AI Agents
Source: Linters/SAST tools