diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2c46a1a..ad33dde 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,11 +12,22 @@ "ghcr.io/devcontainers/features/azure-cli:1": {}, "ghcr.io/devcontainers/features/powershell:2": {}, "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers/features/copilot-cli:1": {} + "ghcr.io/devcontainers/features/copilot-cli:1": {}, + "ghcr.io/devcontainers/features/node:2.0.0": { + "version": "25" + } }, "onCreateCommand": "bash .devcontainer/post-create.sh", + "forwardPorts": [3333], + "portsAttributes": { + "3333": { + "label": "Docs Site", + "onAutoForward": "notify" + } + }, + "customizations": { "vscode": { "extensions": [ @@ -30,7 +41,8 @@ ], "settings": { "azureMcp.serverMode": "namespace", - "azureMcp.readOnly": false + "azureMcp.readOnly": false, + "task.allowAutomaticTasks": "on" } } }, diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index d0d3b5a..7966164 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -5,6 +5,14 @@ set -euo pipefail # Codespaces prebuilds. The three installs below are independent, so we # run them in parallel and skip work that has already been done. +echo "==> Ensuring sandbox dependencies are installed..." +if command -v bwrap >/dev/null 2>&1 && command -v socat >/dev/null 2>&1; then + echo "bubblewrap and socat already installed, skipping" +else + sudo apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends bubblewrap socat +fi + echo "==> Installing IaC security tools (parallel)..." log_dir="$(mktemp -d)" @@ -73,4 +81,13 @@ if [ "$status" -ne 0 ]; then exit "$status" fi +# Install Docusaurus website dependencies +echo "==> Installing website dependencies..." +if [ -f website/package.json ]; then + (cd website && npm install --no-audit --no-fund) + echo "==> Website dependencies installed" +else + echo "==> website/package.json not found, skipping" +fi + echo "==> Dev environment ready" diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..d16d8cc --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,63 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Docs: Install", + "type": "shell", + "command": "npm install", + "options": { "cwd": "${workspaceFolder}/website" }, + "group": "build", + "problemMatcher": [] + }, + { + "label": "Docs: Generate", + "type": "shell", + "command": "node scripts/generate-docs.js", + "options": { "cwd": "${workspaceFolder}" }, + "group": "build", + "problemMatcher": [], + "dependsOn": "Docs: Install" + }, + { + "label": "Docs: Build (local)", + "type": "shell", + "command": "npm run build", + "options": { + "cwd": "${workspaceFolder}/website", + "env": { "DOCUSAURUS_BASE_URL": "/" } + }, + "group": "build", + "problemMatcher": [], + "dependsOn": "Docs: Generate" + }, + { + "label": "Docs: Build (production)", + "type": "shell", + "command": "npm run build", + "options": { "cwd": "${workspaceFolder}/website" }, + "group": "build", + "problemMatcher": [], + "dependsOn": "Docs: Generate" + }, + { + "label": "Docs: Serve", + "type": "shell", + "command": "npm run serve -- --port 3333 --no-open", + "options": { "cwd": "${workspaceFolder}/website" }, + "group": "test", + "isBackground": true, + "problemMatcher": [], + "dependsOn": "Docs: Build (local)" + }, + { + "label": "Docs: Dev Server", + "type": "shell", + "command": "npm start -- --port 3333 --no-open", + "options": { "cwd": "${workspaceFolder}/website" }, + "group": "test", + "isBackground": true, + "problemMatcher": [], + "dependsOn": "Docs: Install" + } + ] +}