create-oes
v0.1.0
Published
Scaffold a minimal, valid OES course — one course, one module, one lesson, one practice set, one question — via `npm create oes`.
Readme
create-oes
Scaffolds a minimal, valid OES course — one course, one module, one lesson, one practice set, one question, every level the OCF hierarchy requires and nothing more — so a new author's first five minutes produce something real and lint-clean instead of a blank schema to decode.
Usage
npm create oes my-course
# or
npx create-oes my-coursemy-course/
├── course.json
└── modules/
└── intro/
├── module.json
└── lessons/
└── welcome/
├── lesson.json
└── practice-sets/
└── quiz/
├── set.json
└── questions/
└── example-question.jsonFlags:
npm create oes [target-dir] [--id <id>] [--title <title>] [--author <name>]...
[--license <spdx>] [--force] [--json]target-dir— where to write the scaffold. Defaults to the current directory.--id— the course'sid. Defaults to a kebab-case slug of--title.--title— the course'stitle. Defaults to"My Course".--author— repeatable, appends to the course'sauthors[]. Omitted entirely (not an empty array) when not passed.--license— an SPDX identifier for the course'slicense. Omitted when not passed.--force— write intotarget-direven if it already exists and isn't empty. Without this, generation refuses to touch a non-empty directory, so a mistypedtarget-dircan't silently clobber something else.--json— machine-readable output instead of the human summary.
Every generated document carries a $schema field pointing at its
current JSON Schema, so opening any of them in an editor with JSON Schema
support gets inline validation/autocomplete for free — see
Editor Setup.
After writing files, the CLI runs @inklyre/oes-lint's
lintCourse against the output before reporting success — the same
referential-integrity bar hand-authored content is held to, not just that
each document individually passed schema validation during generation.
Library
The generator is also usable directly, e.g. from a future Studio "new course" flow:
import { generateScaffold } from "create-oes";
const result = await generateScaffold({
outDir: "./my-course",
id: "my-course",
title: "My Course",
});buildScaffold is the pure, filesystem-free half — given the same
options, it returns the file tree as { path, content }[] without
writing anything, useful for previewing or testing.
