forked from bai/curriculum-project-hub
d5bce1bede
[targets.*] reworked: artifact is now an inline table with a type discriminator
({type="single-file",filepath} / {type="file-tree",root,outputs}) and steps is an
ordered array-of-tables ({type="typst-compile",template} / {type="shell",run}).
numbering removed entirely (presentation lives in the template per ADR-0011).
TargetConfig { name, artifact: Artifact, steps: Vec<Step> }; Artifact and Step
mirror Spec.Courseware.Artifact / Spec.Courseware.Step (doc-cited). Sensible
defaults so a bare [targets.student] still works: single-file build/<name>.pdf +
one typst-compile exports/<name>.typ. Malformed artifact/step type → non-fatal
SchemaViolation with fallback. 8 tests green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
19 lines
590 B
TOML
19 lines
590 B
TOML
[project]
|
|
id = "fixture-bad-target-config"
|
|
name = "bad-target-config"
|
|
|
|
[info]
|
|
title = "测试课:非法导出目标配置"
|
|
|
|
# Invalid artifact `type` → SchemaViolation, falls back to default (single-file).
|
|
[targets.student]
|
|
artifact = { type = "pdf-thing", filepath = "build/student.pdf" }
|
|
|
|
# Invalid step `type` → SchemaViolation; the bad step is skipped and the build
|
|
# falls back to the default step.
|
|
[targets.teacher]
|
|
artifact = { type = "file-tree", root = "build/teacher", outputs = "**/*.html" }
|
|
[[targets.teacher.steps]]
|
|
type = "make-it-nice"
|
|
template = "exports/teacher.typ"
|