Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FROM mcr.microsoft.com/devcontainers/base:debian-12

# ── System dependencies ───────────────────────────────────────────────────────
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
ffmpeg \
chromium \
libgbm1 \
libnss3 \
libatk-bridge2.0-0 \
libdrm2 \
libxcomposite1 \
libxdamage1 \
libxrandr2 \
libcups2 \
libasound2 \
libpangocairo-1.0-0 \
libxshmfence1 \
libgtk-3-0 \
# Font support — matches production rendering environment
fonts-liberation \
fonts-noto-color-emoji \
fonts-noto-cjk \
fonts-noto-core \
fonts-noto-extra \
fonts-noto-ui-core \
fonts-freefont-ttf \
fonts-dejavu-core \
fontconfig \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean \
&& fc-cache -fv

# ── Node.js 22 ────────────────────────────────────────────────────────────────
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*

# ── Bun ──────────────────────────────────────────────────────────────────────
RUN curl -fsSL https://bun.sh/install | bash
ENV PATH="/root/.bun/bin:/home/vscode/.bun/bin:$PATH"

# Install bun for the vscode user as well
RUN su vscode -c "curl -fsSL https://bun.sh/install | bash" \
&& su vscode -c "~/.bun/bin/bun --version" \
&& echo "bun installed for vscode user"
Comment on lines +43 to +49
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Bun install step doesn’t actually enforce a specific Bun version: ~/.bun/bin/bun --version only prints the version, and there’s no pinned version/expected value. For reproducible devcontainers, consider pinning Bun via an env var/arg (or BUN_VERSION) and failing the build if the installed version doesn’t match.

Suggested change
RUN curl -fsSL https://bun.sh/install | bash
ENV PATH="/root/.bun/bin:/home/vscode/.bun/bin:$PATH"
# Install bun for the vscode user as well
RUN su vscode -c "curl -fsSL https://bun.sh/install | bash" \
&& su vscode -c "~/.bun/bin/bun --version" \
&& echo "bun installed for vscode user"
ARG BUN_VERSION=1.1.38
RUN curl -fsSL https://bun.sh/install | bash -s -- bun-v${BUN_VERSION} \
&& test "$(/root/.bun/bin/bun --version)" = "${BUN_VERSION}"
ENV PATH="/root/.bun/bin:/home/vscode/.bun/bin:$PATH"
# Install bun for the vscode user as well
RUN su vscode -c "curl -fsSL https://bun.sh/install | bash -s -- bun-v${BUN_VERSION}" \
&& su vscode -c 'test "$($HOME/.bun/bin/bun --version)" = "'"${BUN_VERSION}"'"' \
&& echo "bun ${BUN_VERSION} installed for vscode user"

Copilot uses AI. Check for mistakes.

# ── Puppeteer / Chromium config ───────────────────────────────────────────────
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
ENV CONTAINER=true
Comment on lines +51 to +54
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This devcontainer sets PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium, but the engine’s deterministic BeginFrame path requires chrome-headless-shell (resolved via PRODUCER_HEADLESS_SHELL_PATH or Puppeteer’s managed cache). Without installing chrome-headless-shell (as done in Dockerfile.test), Linux runs in the container will always fall back to screenshot mode, which is a behavior mismatch with the stated “matches test/prod rendering env”. Consider installing chrome-headless-shell here too, or documenting/setting PRODUCER_HEADLESS_SHELL_PATH appropriately.

Copilot uses AI. Check for mistakes.
94 changes: 94 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"name": "Hyperframes",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},

// ── Container settings ───────────────────────────────────────────────────
"remoteUser": "vscode",
"containerEnv": {
"PUPPETEER_SKIP_CHROMIUM_DOWNLOAD": "true",
"PUPPETEER_EXECUTABLE_PATH": "/usr/bin/chromium",
"CONTAINER": "true"
},

// ── VS Code extensions ───────────────────────────────────────────────────
"customizations": {
"vscode": {
"extensions": [
// Linting & formatting — oxlint + oxfmt (project standard)
"oxc.oxc-vscode",

// Editor experience
"EditorConfig.EditorConfig",
"streetsidesoftware.code-spell-checker",
"usernamehw.errorlens",

// Git
"eamodio.gitlens",
"mhutchie.git-graph",

// HTML / CSS
"bradlc.vscode-tailwindcss",
"formulahendry.auto-close-tag",
"naumovs.color-highlight",

// Markdown & docs
"yzhang.markdown-all-in-one",
"davidanson.vscode-markdownlint",

// Misc tooling
"mikestead.dotenv",
"ms-vscode.live-server"
],
"settings": {
// Use bun as the npm script runner
"npm.packageManager": "bun",

// Format on save
"editor.formatOnSave": true,
"editor.defaultFormatter": "oxc.oxc-vscode",

// TypeScript
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,

// Trim trailing whitespace / insert final newline — matches .editorconfig
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,

// Search exclusions
"search.exclude": {
"**/node_modules": true,
"**/dist": true,
"**/.git": true,
"**/bun.lock": true
}
}
}
},

// ── Lifecycle hooks ──────────────────────────────────────────────────────

// Install dependencies after the container is created
"postCreateCommand": "bun install",

// Build all packages and start the studio after each start
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says this hook will “Build all packages and start the studio after each start”, but the command only runs bun run build (no studio/dev server start). Either update the comment to match the behavior or change the command to actually start the studio.

Suggested change
// Build all packages and start the studio after each start
// Build all packages after each start

Copilot uses AI. Check for mistakes.
"postStartCommand": "bun run build",

// ── Port forwarding ──────────────────────────────────────────────────────
"forwardPorts": [
// Hyperframes Studio dev server (Vite default)
5173,
// Alternative Vite ports
5174,
5175
],
"portsAttributes": {
"5173": {
"label": "Hyperframes Studio",
"onAutoForward": "openBrowser"
}
}
}