Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "1.1.2",
"resolved": "ghcr.io/devcontainers/features/github-cli@sha256:7c409bf6316ffd85f04fd92fba85a744282639e603417dd4796409866bdb6805",
"integrity": "sha256:7c409bf6316ffd85f04fd92fba85a744282639e603417dd4796409866bdb6805"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "1.7.1",
"resolved": "ghcr.io/devcontainers/features/node@sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6",
"integrity": "sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "♿ The Accessibility Nightmare | 🟡 Intermediate (The Checkout Trap)",
"image": "mcr.microsoft.com/devcontainers/base:bookworm",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/adventures/accessibility-nightmare/intermediate",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "22"
},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"postCreateCommand": "bash /workspaces/${localWorkspaceFolderBasename}/.devcontainer/accessibility-nightmare_intermediate/post-create.sh",
"postStartCommand": "bash /workspaces/${localWorkspaceFolderBasename}/.devcontainer/accessibility-nightmare_intermediate/post-start.sh",
"customizations": {
"vscode": {
"extensions": [
"ms-playwright.playwright"
]
},
"codespaces": {
"openFiles": [
"src/components/CheckoutForm.jsx",
"src/components/BasketDialog.jsx",
"src/components/SizePicker.jsx"
],
"permissions": {
"codespaces": "write"
}
}
},
"forwardPorts": [
5173
],
"portsAttributes": {
"5173": {
"label": "ShopSmart",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
}
}
22 changes: 22 additions & 0 deletions .devcontainer/accessibility-nightmare_intermediate/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -e

REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"

# shellcheck disable=SC1091
source "$REPO_ROOT/lib/scripts/tracker.sh"
set_tracking_context "accessibility-nightmare" "intermediate" "07" "09" "2026"
track_container_created

"$REPO_ROOT/lib/shared/init.sh" --version v0.17.0

CHALLENGE_DIR="$REPO_ROOT/adventures/accessibility-nightmare/intermediate"

echo "✨ Installing ShopSmart dependencies..."
cd "$CHALLENGE_DIR"
npm ci

echo "✨ Installing Playwright Chromium..."
npx playwright install --with-deps chromium

echo "✅ Post-create complete."
48 changes: 48 additions & 0 deletions .devcontainer/accessibility-nightmare_intermediate/post-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
set -e

REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
CHALLENGE_DIR="$REPO_ROOT/adventures/accessibility-nightmare/intermediate"

echo "✨ Starting The Accessibility Nightmare - Intermediate Level"

cd "$CHALLENGE_DIR"

LOG_FILE="/tmp/accessibility-nightmare-vite.log"

if ! pgrep -f "vite --host 0.0.0.0" >/dev/null 2>&1; then
echo "✨ Starting ShopSmart on port 5173"
# setsid puts the server in its own session. A plain `nohup ... &` is killed
# when the Codespaces lifecycle command's process group is torn down, which
# leaves the port dead a moment after this script reports success.
setsid nohup npm run dev </dev/null >"$LOG_FILE" 2>&1 &
disown 2>/dev/null || true
fi

for _ in {1..30}; do
if curl --fail --silent http://127.0.0.1:5173 >/dev/null; then
echo "✅ ShopSmart is running on port 5173"
break
fi
sleep 1
done

if ! curl --fail --silent http://127.0.0.1:5173 >/dev/null; then
echo "❌ ShopSmart failed to start."
if [[ -f "$LOG_FILE" ]]; then
tail -n 20 "$LOG_FILE"
fi
echo "Run 'npm run dev' from the intermediate directory to start it manually."
exit 1
fi

echo ""
echo "🛒 Open the Ports tab, click ShopSmart on 5173, then add the route:"
echo " /#/product/running-shoes choose a size and add to basket"
echo " /#/checkout place the order"
echo ""

# shellcheck disable=SC1091
source "$REPO_ROOT/lib/scripts/tracker.sh"
set_tracking_context "accessibility-nightmare" "intermediate" "07" "09" "2026"
track_container_initialized
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ venv/
# Maven build artifacts
target/

# OpenTelemetry Java Agent (downloaded per-Codespace by post-create.sh)
tools/
# OpenTelemetry Java Agent (downloaded per-Codespace by post-create.sh).
# Anchored: unanchored "tools/" silently swallowed a tools directory inside a
# challenge level, and `git add -A` skipped it without a word.
/tools/

# Go build artifacts
infra/tracker/tracker
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading