feat(cli): add compile command to emit GitHub/GitLab CI YAML from a single TS plan
Merged
TH
3mo ago+267+267+012345678901234567890123456789-3-3-0123456789
Summary
Adds sverka compile --target github|gitlab so the same sverka.config.ts can be turned into either GitHub Actions or GitLab CI YAML through the existing canonical Plan IR.
What changed
@sverka/sdknow builds the canonicalPlanIR during planning:PlanResultgainsplan: Plan- new
Sverka.toPlan()and top-leveltoPlan()return the validatedPlanIR directly
@sverka/clidepends on@sverka/compiler-githuband@sverka/compiler-gitlab- new
sverka compilecommand:--target github|gitlab(required)--output <path>/-o <path>to write the YAML to a file- defaults to YAML on stdout
- supports
--format jsonfor tool integration
- tests added in
packages/cli/src/__tests__/compile.test.tsfor both targets and--output
Example
sverka compile --target github --output .github/workflows/sverka.yml
sverka compile --target gitlab --output .gitlab-ci.yml
This keeps the thin-wrapper compiler design from ADR-004: the generated CI config runs sverka execute inside the CI runner, using the same Plan derivation as local runs.
Verification
bunx nx run-many --target=typecheck --allpassesbunx nx run-many --target=lint --allpassesbunx nx run-many --target=test --allpasses