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
40 changes: 40 additions & 0 deletions .devcontainer/accessibility-nightmare_expert/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "β™Ώ The Accessibility Nightmare | πŸ”΄ Expert (The Compliance Engine)",
"image": "mcr.microsoft.com/devcontainers/base:bookworm",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/adventures/accessibility-nightmare/expert",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "22"
},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"postCreateCommand": "bash /workspaces/${localWorkspaceFolderBasename}/.devcontainer/accessibility-nightmare_expert/post-create.sh",
"postStartCommand": "bash /workspaces/${localWorkspaceFolderBasename}/.devcontainer/accessibility-nightmare_expert/post-start.sh",
"customizations": {
"vscode": {
"extensions": [
"ms-playwright.playwright"
]
},
"codespaces": {
"openFiles": [
"tests/compliance.spec.js"
],
"permissions": {
"codespaces": "write"
}
}
},
"forwardPorts": [
5173
],
"portsAttributes": {
"5173": {
"label": "ShopSmart",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
}
}
22 changes: 22 additions & 0 deletions .devcontainer/accessibility-nightmare_expert/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" "expert" "" "" ""
track_container_created

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

CHALLENGE_DIR="${REPO_ROOT}/adventures/accessibility-nightmare/expert"

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

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

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

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

echo "✨ Starting The Accessibility Nightmare - Expert 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 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 expert directory to start it manually."
exit 1
fi

echo ""
echo "πŸ›’ Open the Ports tab, click ShopSmart on 5173."
echo " The compliance gate is in tests/compliance.spec.js β€” run it with:"
echo " npm run test:a11y"
echo ""

# shellcheck disable=SC1091
source "${REPO_ROOT}/lib/scripts/tracker.sh"
set_tracking_context "accessibility-nightmare" "expert" "" "" ""
track_container_initialized
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading