@novedu/cli 0.5.0 → 0.5.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 +8 -8
- package/dist/main.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,21 +14,21 @@ the same one the app would accept — no separate, drifting rules.
|
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
# Validate a local file (relative fragment_files resolve from the same folder)
|
|
17
|
-
npx @novedu/cli validate ./tutors/simple-tutor.yaml
|
|
17
|
+
npx @novedu/cli validate ./activities/tutors/simple-tutor.yaml
|
|
18
18
|
|
|
19
19
|
# Validate a published tutor by URL
|
|
20
|
-
npx @novedu/cli validate https://raw.githubusercontent.com/Teaching-HTL-Leonding/novedu-chat-mvp/refs/heads/main/tutors/simple-tutor.yaml
|
|
20
|
+
npx @novedu/cli validate https://raw.githubusercontent.com/Teaching-HTL-Leonding/novedu-chat-mvp/refs/heads/main/activities/tutors/simple-tutor.yaml
|
|
21
21
|
|
|
22
22
|
# Validate a fragment library on its own
|
|
23
|
-
npx @novedu/cli validate ./tutors/simple-fragments.yaml --kind fragment
|
|
23
|
+
npx @novedu/cli validate ./activities/tutors/simple-fragments.yaml --kind fragment
|
|
24
24
|
|
|
25
25
|
# Validate a quiz, a writing activity, or a coding activity
|
|
26
|
-
npx @novedu/cli validate ./quizzes/sample-quiz.yaml --kind quiz
|
|
27
|
-
npx @novedu/cli validate ./writings/human-animal-short-story.yaml --kind writing
|
|
28
|
-
npx @novedu/cli validate ./coding/beginner-typescript.yaml --kind coding
|
|
26
|
+
npx @novedu/cli validate ./activities/quizzes/sample-quiz.yaml --kind quiz
|
|
27
|
+
npx @novedu/cli validate ./activities/writings/human-animal-short-story.yaml --kind writing
|
|
28
|
+
npx @novedu/cli validate ./activities/coding/beginner-typescript.yaml --kind coding
|
|
29
29
|
|
|
30
30
|
# Machine-readable output (the raw validation result)
|
|
31
|
-
npx @novedu/cli validate ./tutors/simple-tutor.yaml --json
|
|
31
|
+
npx @novedu/cli validate ./activities/tutors/simple-tutor.yaml --json
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
`--kind` accepts `tutor` (default), `fragment`, `quiz`, `writing`, or `coding`; it
|
|
@@ -42,7 +42,7 @@ as a pre-commit / CI gate.
|
|
|
42
42
|
The CLI lives in the app repo as an npm workspace.
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
|
-
npm run cli -- validate ./tutors/simple-tutor.yaml # run from source via tsx
|
|
45
|
+
npm run cli -- validate ./activities/tutors/simple-tutor.yaml # run from source via tsx
|
|
46
46
|
npm run cli:build # bundle to cli/dist via tsdown
|
|
47
47
|
npm run test:cli # build + integration tests (local & live URLs)
|
|
48
48
|
```
|
package/dist/main.js
CHANGED
|
@@ -446,7 +446,7 @@ function resolveRelativeUrl(ref, baseUrl) {
|
|
|
446
446
|
* Resolve a fragment-file reference to an absolute URL. An absolute http(s) ref is used
|
|
447
447
|
* as-is; anything else is treated as relative to the tutor URL — standard URL resolution
|
|
448
448
|
* drops the tutor's filename and appends the relative path (so `general-fragments.yaml`
|
|
449
|
-
* next to `.../tutors/linked-list-tutor.yaml` becomes `.../tutors/general-fragments.yaml`,
|
|
449
|
+
* next to `.../activities/tutors/linked-list-tutor.yaml` becomes `.../activities/tutors/general-fragments.yaml`,
|
|
450
450
|
* and `./` / `../` segments work too). Throws if a relative ref is unparseable; the schema
|
|
451
451
|
* already guarantees the only inputs here are http(s) URLs or relative paths.
|
|
452
452
|
*/
|
|
@@ -1047,15 +1047,15 @@ function registerValidate(program) {
|
|
|
1047
1047
|
program.command("validate").description("Validate a tutor (default), fragment library, quiz, writing or coding YAML by local path or public http(s) URL").argument("<pathOrUrl>", "path to a tutor, fragment, quiz, writing or coding YAML file, or a public http(s) URL").option("--kind <kind>", `what the file is: ${VALIDATE_KINDS.map((k) => `'${k}'`).join(", ")} ('tutor' is the default)`, "tutor").option("--json", "print the raw validation result as JSON").addHelpText("after", `
|
|
1048
1048
|
Examples:
|
|
1049
1049
|
# Validate a tutor (also strict-renders every fragment in every referenced library)
|
|
1050
|
-
$ novedu-cli validate ./tutors/my-tutor.yaml
|
|
1050
|
+
$ novedu-cli validate ./activities/tutors/my-tutor.yaml
|
|
1051
1051
|
|
|
1052
1052
|
# Validate a fragment library on its own
|
|
1053
|
-
$ novedu-cli validate ./tutors/my-fragments.yaml --kind fragment
|
|
1053
|
+
$ novedu-cli validate ./activities/tutors/my-fragments.yaml --kind fragment
|
|
1054
1054
|
|
|
1055
1055
|
# Validate a quiz, a writing activity, or a coding activity
|
|
1056
|
-
$ novedu-cli validate ./quizzes/my-quiz.yaml --kind quiz
|
|
1057
|
-
$ novedu-cli validate ./writings/my-writing.yaml --kind writing
|
|
1058
|
-
$ novedu-cli validate ./coding/my-coding.yaml --kind coding
|
|
1056
|
+
$ novedu-cli validate ./activities/quizzes/my-quiz.yaml --kind quiz
|
|
1057
|
+
$ novedu-cli validate ./activities/writings/my-writing.yaml --kind writing
|
|
1058
|
+
$ novedu-cli validate ./activities/coding/my-coding.yaml --kind coding
|
|
1059
1059
|
|
|
1060
1060
|
# Machine-readable output for CI
|
|
1061
1061
|
$ novedu-cli validate https://example.com/tutor.yaml --json`).action(async (pathOrUrl, options) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novedu/cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Command-line companion for the Novedu chat app. Validates tutor, fragment, quiz, writing and coding YAML definitions (more commands to follow).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|