platform-codebase/.forgejo/workflows
Lilith cb9519b872 feat(enforcement): Add pre-commit hook and CI verification for styled-components
Completes the 6-layer defense strategy for single styled-components instance:
- Add pre-commit hook blocking direct styled-components imports
- Add CI job verifying single styled-components version
- Configure git to use .githooks/pre-commit
- Update build job dependencies to include verification

Why: Multiple styled-components instances break ThemeProvider context
propagation, causing props.theme to be undefined. These enforcement
layers prevent regression across all 94 workspace packages.

Enforcement mechanisms now active:
1. ESLint (eslint.config.js) - lint-time blocking
2. Pre-commit hook (.githooks/pre-commit) - commit-time blocking
3. CI verification (.forgejo/workflows/ci.yml) - PR-time blocking
4. pnpm override (package.json) - install-time forcing
5. Documentation (docs/architecture/) - knowledge base
6. Wrapper package (@lilith/ui-styled-components) - single source

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-22 15:42:58 -08:00
..
ci.yml feat(enforcement): Add pre-commit hook and CI verification for styled-components 2026-01-22 15:42:58 -08:00
production-deploy.yml
README.md 📝 Add CI/CD workflows documentation 2026-01-03 00:35:27 -08:00
staging-deploy.yml
staging-verify.yml

CI/CD Workflows

Forgejo Actions workflows for the Lilith Platform codebase.

Workflows

ci.yml - Pull Request Validation

Runs on PRs to main. Validates code before merge.

Jobs:

  • detect-changes - Identifies affected features/packages
  • typecheck - TypeScript type checking
  • lint - ESLint
  • test - Node.js tests via turbo
  • build - Verify packages build
  • detect-python-services - Auto-discovers Python services
  • test-python-services - Matrix job testing all changed Python services
  • e2e-landing - Playwright E2E tests (when landing changes)

staging-deploy.yml - Deploy to Staging

Runs on push to main. Builds and deploys to staging environment.

Jobs:

  • check-skip - Skip version bump commits
  • bump-version - Increment VERSION.json
  • detect-changes - Identify changed features
  • build - Build Node.js packages (uses turbo change detection)
  • trigger-reconciliation - Dispatches to infrastructure repo

Build Strategy:

# Uses turbo's built-in change detection
pnpm turbo build --filter="...[$BEFORE]"

This builds only packages that changed since the last push, plus their dependents.

production-deploy.yml - Production Deployment

Manual workflow for production releases.

Change Detection

Node.js Packages

Turbo handles dependency graph automatically:

  • Changed package → rebuilds
  • Dependency changed → dependents rebuild
  • Shared package changed → all dependents rebuild

Python Services

Auto-discovered by scanning for pyproject.toml:

features/*/*/pyproject.toml → detected as Python service

Tested when:

  • Feature directory changes
  • Shared packages (@packages/) change

Adding a New Feature

Node.js (Frontend/Backend)

  1. Create package with package.json and turbo-compatible scripts
  2. Turbo auto-detects and includes in builds
  3. Add to infrastructure reconcile for deployment

Python Service

  1. Create service with pyproject.toml
  2. Add tests/ directory with pytest tests
  3. Auto-discovered by detect-python-services job
  4. Add to infrastructure reconcile for deployment

Environment Variables

Variable Purpose
FORGEJO_TOKEN Registry auth (NPM + PyPI)

Artifacts

Build artifacts uploaded for infrastructure reconciliation:

features/*/frontend-*/dist
features/*/backend-*/dist
features/webmap/router/dist

Flow

PR created
    ↓
ci.yml runs (typecheck, lint, test, build)
    ↓
PR merged to main
    ↓
staging-deploy.yml runs
    ├── bump VERSION.json
    ├── build changed packages
    └── trigger infrastructure reconcile
            ↓
        infrastructure/reconcile.yml
            ├── deploy to staging (black)
            └── health checks