Collections
What a collection is: a folder of pages of one type and a page describing their fields. The kinds of fields on one page and three schema norms with checks: a relation points to a record of the right collection, a value is from the list, a required field is filled.
Collections
The package explains what a collection is and what fields there are, and brings three schema norms; their enforcers are the package checks. A collection schema (properties: in its page) already says which field points to which collection, which values are valid and what is required; the package checks read the schemas and compare the records with them. New collections come under the check by themselves.
The checks do not let a violation pass: they print what they find, one line per record, and finish with an error.
Where the boundary is
- Here: the collection format, the kinds of fields, relations, values, requiredness.
- A field of kind "phase" (the state of a record) is checked by the package
contours. - The norm "One kind of record, one place" is checked by the package
layers. - Which collections a project has is decided by the packages that bring them.
The checks are written in TypeScript and run by Bun from the project root. The shared part is checks/lib/: pages.ts (reading pages, front matter, paths, collection records), speclib.ts (the project, the result of a rule, the run), schemalib.ts (schemas, values, findings) and runner.ts (running one check as an action); the checks of other packages build on it.