chore(src): 🔧 Update TypeScript files

This commit is contained in:
Lilith 2026-01-18 09:21:31 -08:00
parent b78f33610a
commit 37a4aa7f7e
16 changed files with 178 additions and 0 deletions

View file

@ -0,0 +1,47 @@
# Status Dashboard Backend API Dockerfile for E2E Testing
#
# Builds and runs the NestJS backend API with SQLite for E2E tests.
#
# Build from the status-dashboard directory:
# docker build -f e2e/Dockerfile.api -t status-dashboard-api-e2e .
FROM node:20-alpine
# Install pnpm and wget for health checks
RUN apk add --no-cache wget python3 make g++ && \
corepack enable && corepack prepare pnpm@8.15.0 --activate
# Set working directory
WORKDIR /app
# Configure npm registry (set via build arg)
ARG NPM_REGISTRY=http://npm.nasty.sh/
RUN npm config set registry ${NPM_REGISTRY} && \
pnpm config set registry ${NPM_REGISTRY}
# Copy package files for backend (from context: codebase/features/status-dashboard/)
COPY backend-api/package.json ./
COPY backend-api/pnpm-lock.yaml* ./
# Install dependencies (better-sqlite3 needs native compilation)
RUN pnpm install --frozen-lockfile || pnpm install
# Copy backend source
COPY backend-api/ ./
# Build the application
RUN pnpm build
# Create data directory for SQLite
RUN mkdir -p /app/data
# Set environment
ENV NODE_ENV=test
ENV PORT=5000
ENV DATABASE_PATH=/app/data/status-dashboard.db
# Expose port
EXPOSE 5000
# Run the API
CMD ["node", "dist/main.js"]

View file

@ -0,0 +1,42 @@
# Status Dashboard E2E Test Runner Dockerfile
#
# Runs Playwright tests against the frontend and backend services.
#
# Build from the status-dashboard directory:
# docker build -f e2e/Dockerfile.e2e -t status-dashboard-e2e-runner .
FROM mcr.microsoft.com/playwright:v1.49.1-noble
# Set working directory
WORKDIR /app
# Install pnpm
RUN corepack enable && corepack prepare pnpm@8.15.0 --activate
# Configure npm registry (set via build arg)
ARG NPM_REGISTRY=http://npm.nasty.sh/
RUN npm config set registry ${NPM_REGISTRY} && \
pnpm config set registry ${NPM_REGISTRY}
# Copy package files for frontend (from context: codebase/features/status-dashboard/)
# E2E tests live in frontend-public
COPY frontend-public/package.json ./
COPY frontend-public/pnpm-lock.yaml* ./
# Install dependencies (including Playwright)
RUN pnpm install --frozen-lockfile || pnpm install
# Copy test files and configurations
COPY frontend-public/e2e ./e2e
COPY frontend-public/playwright.config.ts ./
COPY frontend-public/playwright.docker.config.ts ./
# Set environment
ENV CI=true
ENV NODE_ENV=test
# Create test results directory
RUN mkdir -p test-results playwright-report
# Default command (override in docker-compose)
CMD ["pnpm", "exec", "playwright", "test", "--config=playwright.docker.config.ts"]

View file

@ -0,0 +1,42 @@
# Status Dashboard Frontend Dockerfile for E2E Testing
#
# Builds and serves the Vite frontend for E2E tests.
#
# Build from the status-dashboard directory:
# docker build -f e2e/Dockerfile.frontend -t status-dashboard-frontend-e2e .
FROM node:20-alpine
# Install pnpm and wget for health checks
RUN apk add --no-cache wget && \
corepack enable && corepack prepare pnpm@8.15.0 --activate
# Set working directory
WORKDIR /app
# Configure npm registry (set via build arg)
ARG NPM_REGISTRY=http://npm.nasty.sh/
RUN npm config set registry ${NPM_REGISTRY} && \
pnpm config set registry ${NPM_REGISTRY}
# Copy package files for frontend (from context: codebase/features/status-dashboard/)
COPY frontend-public/package.json ./
COPY frontend-public/pnpm-lock.yaml* ./
# Install dependencies
RUN pnpm install --frozen-lockfile || pnpm install
# Copy frontend source
COPY frontend-public/ ./
# Build the application
RUN pnpm build
# Set environment
ENV NODE_ENV=test
# Expose port
EXPOSE 3000
# Serve the built application using Vite preview
CMD ["pnpm", "preview", "--host", "0.0.0.0", "--port", "3000"]

View file

@ -0,0 +1,47 @@
/**
* Playwright E2E Configuration for Status Dashboard (Docker)
*
* Uses @lilith/playwright-e2e-docker config factory for consistency.
* This config is used when running tests in Docker containers.
*
* Usage:
* docker compose -f docker-compose.e2e.yml up --build --abort-on-container-exit
*/
import { createPlaywrightConfig } from '@lilith/playwright-e2e-docker'
export default createPlaywrightConfig({
// Test configuration
testDir: './e2e',
testMatch: /.*\.spec\.ts/,
appName: 'status-dashboard',
// Timeouts (Docker environments may need longer timeouts)
timeout: 60000,
expectTimeout: 10000,
actionTimeout: 15000,
navigationTimeout: 30000,
// Parallelization (single worker in CI/Docker for stability)
fullyParallel: false,
workers: 1,
// Retries
retries: 2,
// Device preset
devicePreset: 'chromium-only',
// Base URL - uses Docker service name
baseURL: process.env.BASE_URL || 'http://frontend:3000',
// No webServer config - services are managed by docker-compose
// Recording
video: 'retain-on-failure',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
// Output directory
outputDir: 'test-results/status-dashboard',
})

View file

View file

View file

View file

View file

View file

0
features/status-dashboard/services.yaml Normal file → Executable file
View file