@novedu/cli 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/dist/main.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
# @novedu/cli
|
|
2
2
|
|
|
3
3
|
Command-line companion for the Novedu chat app (installed command: `novedu-cli`).
|
|
4
|
-
Today it validates **tutor YAML** definitions
|
|
4
|
+
Today it validates **tutor YAML** definitions and **fragment libraries**; more
|
|
5
|
+
commands will follow. Validating a tutor also fully validates every fragment
|
|
6
|
+
library it references; pass `--kind fragment` to validate a fragment library on
|
|
7
|
+
its own.
|
|
5
8
|
|
|
6
9
|
It reuses the app's exact validation pipeline (`lib/tutors`), so a tutor that
|
|
7
10
|
passes here is the same tutor the app would accept — no separate, drifting rules.
|
|
@@ -15,10 +18,15 @@ npx @novedu/cli validate ./tutors/simple-tutor.yaml
|
|
|
15
18
|
# Validate a published tutor by URL
|
|
16
19
|
npx @novedu/cli validate https://raw.githubusercontent.com/Teaching-HTL-Leonding/novedu-chat-mvp/refs/heads/main/tutors/simple-tutor.yaml
|
|
17
20
|
|
|
21
|
+
# Validate a fragment library on its own
|
|
22
|
+
npx @novedu/cli validate ./tutors/simple-fragments.yaml --kind fragment
|
|
23
|
+
|
|
18
24
|
# Machine-readable output (the raw validation result)
|
|
19
25
|
npx @novedu/cli validate ./tutors/simple-tutor.yaml --json
|
|
20
26
|
```
|
|
21
27
|
|
|
28
|
+
`--kind` defaults to `tutor`; it is caller-declared, not auto-detected.
|
|
29
|
+
|
|
22
30
|
Exit code is `0` when the tutor is valid and `1` when it has errors, so it works
|
|
23
31
|
as a pre-commit / CI gate.
|
|
24
32
|
|
package/dist/main.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
2
3
|
import { Command } from "commander";
|
|
3
4
|
import { resolve } from "node:path";
|
|
4
5
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -780,8 +781,9 @@ Examples:
|
|
|
780
781
|
}
|
|
781
782
|
//#endregion
|
|
782
783
|
//#region src/main.ts
|
|
784
|
+
const { version } = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
783
785
|
const program = new Command();
|
|
784
|
-
program.name("novedu-cli").description("Command-line companion for the Novedu chat app").version(
|
|
786
|
+
program.name("novedu-cli").description("Command-line companion for the Novedu chat app").version(version);
|
|
785
787
|
registerValidate(program);
|
|
786
788
|
program.parseAsync().catch((err) => {
|
|
787
789
|
console.error(err instanceof Error ? err.message : err);
|
package/package.json
CHANGED