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>
29 lines
891 B
TOML
29 lines
891 B
TOML
[project]
|
|
id = "fixture-target-configs"
|
|
name = "target-configs"
|
|
|
|
[info]
|
|
title = "测试课:导出目标的结构化 build 配置"
|
|
|
|
# Full v2 config: explicit single-file artifact + an ordered typst-compile step.
|
|
[targets.student]
|
|
artifact = { type = "single-file", filepath = "build/student.pdf" }
|
|
[[targets.student.steps]]
|
|
type = "typst-compile"
|
|
template = "exports/student.typ"
|
|
|
|
# file-tree artifact + multiple steps (typst-compile then a shell step),
|
|
# exercising both step types and order preservation.
|
|
[targets.archive]
|
|
artifact = { type = "file-tree", root = "build/archive", outputs = "**/*.{html,js,json}" }
|
|
[[targets.archive.steps]]
|
|
type = "typst-compile"
|
|
template = "exports/archive.typ"
|
|
[[targets.archive.steps]]
|
|
type = "shell"
|
|
run = "npm run build"
|
|
|
|
# Empty body → all defaults (single-file build/teacher.pdf, one typst-compile
|
|
# step exports/teacher.typ).
|
|
[targets.teacher]
|