@lernapps/tooling 0.1.2 → 0.1.3

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/dist/cli.mjs CHANGED
@@ -1527,7 +1527,7 @@ function contents(dir) {
1527
1527
  if (name === ".git" || name === "skills-lock.json" && skills.size > 0) return [];
1528
1528
  if (name === "node_modules" || name === "package-lock.json") return [];
1529
1529
  if (name === "package.json" && readJson(join(dir, name)).lernapps?.init === true) return [];
1530
- if (name === ".vibe") return within(name, (file) => file === "plan.md" || file === "plans").concat(existsSync(join(dir, ".vibe/plans")) ? within(PLANS, (file) => PLAN_NAME.test(file)) : []);
1530
+ if (name === ".vibe") return existsSync(join(dir, ".vibe/plans")) ? within(PLANS, (file) => PLAN_NAME.test(file)) : [];
1531
1531
  if ((name === ".agents" || name === ".claude") && skills.size > 0) return within(name, (folder) => folder === "skills").concat(existsSync(join(dir, name, "skills")) ? within(`${name}/skills`, (skill) => skills.has(skill)) : []);
1532
1532
  return [name];
1533
1533
  });
@@ -1691,7 +1691,7 @@ function create(args) {
1691
1691
  if (positionals.length > 1) throw new UsageError(`one <dir> at most, not ${positionals.join(" ")}`);
1692
1692
  const dir = resolve(positionals[0] ?? ".");
1693
1693
  const found = contents(dir);
1694
- if (found.length > 0) throw new CreateError(`${dir} is not empty (${found.slice(0, 5).join(", ")}${found.length > 5 ? ", ..." : ""}): create the app in an empty folder; only .git, the first version's plan .vibe/plans/01-<short name>.md and what lernapps init wrote (its skills, package.json, package-lock.json and node_modules) may be there`);
1694
+ if (found.length > 0) throw new CreateError(`${dir} is not empty (${found.slice(0, 5).join(", ")}${found.length > 5 ? ", ..." : ""}): create the app in an empty folder; only .git, .vibe/ (the first version's plan .vibe/plans/01-<short name>.md, and its sketches) and what lernapps init wrote (its skills, package.json, package-lock.json and node_modules) may be there`);
1695
1695
  const plan = confirmedPlan(dir, archetype, values.plan);
1696
1696
  const architecture = ARCHITECTURE_ARCHETYPES.includes(archetype);
1697
1697
  if (!existsSync(join(templates.root, archetype, "package.json"))) throw new CreateError(`${templates.root} has no template ${archetype}/ (version ${templates.version})`);
@@ -7,7 +7,7 @@
7
7
  | `true-false` | `answer` (true or false) |
8
8
  | `number` | `answer`, `tolerance` (0 = exact), `unit` if any; the learner may type a comma or a point |
9
9
  | `ordering` | `items` in the right order; the page mixes them |
10
- | `matching` | `pairs` as they belong; the page mixes the right side. `distractors` (1 to 4): wrong right entries that match no left one. `pairsFrom: material` instead of `pairs` takes them from the `labelled-figure` in `material` (marker left, text right; the figure needs `legend: false`) |
10
+ | `matching` | `pairs` as they belong, each pair an object `{ left, right }`; the page mixes the right side. `distractors` (1 to 4): wrong right entries that match no left one. `pairsFrom: material` instead of `pairs` takes them from the `labelled-figure` in `material` (marker left, text right; the figure needs `legend: false`) |
11
11
 
12
12
  - Every question: `id`, `text`, `explanation`, at least one link in `links`. Optional quiz `sources`.
13
13
  - Types without options carry their background in `explanation`.
@@ -28,6 +28,8 @@ license: MIT
28
28
 
29
29
  - A build problem is one line `file:line: place (language): what to do`. Fix where it points.
30
30
  - Headings are `section` blocks, never Markdown headings.
31
+ - YAML: quote a text that has `: ` in it or looks like a number (`"8."`, `"01000001"`, `"0"`). Unquoted, YAML reads a map or a
32
+ number: the build stops, or the digits change. A table cell, a header cell too, is a text and never empty.
31
33
  - A new chapter: a folder with `chapter.yaml`, listed in `src/app.yaml`, each page listed in `chapter.yaml`.
32
34
  - `selfAssessment` in a `chapter.yaml`: written in Commit, skill
33
35
  `lernapps-explainer-self-assessment`. An exercise it names renamed or moved → change the reference too.
@@ -174,9 +174,9 @@ function contents(dir: string): string[] {
174
174
  if (name === "node_modules" || name === "package-lock.json") return [];
175
175
  if (name === "package.json" && readJson(join(dir, name)).lernapps?.init === true) return [];
176
176
  if (name === ".vibe") {
177
- return within(name, (file) => file === "plan.md" || file === "plans").concat(
178
- existsSync(join(dir, PLANS)) ? within(PLANS, (file) => PLAN_NAME.test(file)) : [],
179
- );
177
+ // the planning folder: the plans are checked (a first version has one), what the planning leaves beside them stays
178
+ // (the sketches of the plan, .vibe/sketches/)
179
+ return existsSync(join(dir, PLANS)) ? within(PLANS, (file) => PLAN_NAME.test(file)) : [];
180
180
  }
181
181
  if ((name === ".agents" || name === ".claude") && skills.size > 0) {
182
182
  return within(name, (folder) => folder === "skills").concat(
@@ -384,7 +384,7 @@ export function create(args: string[]): number {
384
384
  const found = contents(dir);
385
385
  if (found.length > 0) {
386
386
  throw new CreateError(
387
- `${dir} is not empty (${found.slice(0, 5).join(", ")}${found.length > 5 ? ", ..." : ""}): create the app in an empty folder; only .git, the first version's plan .vibe/plans/01-<short name>.md and what lernapps init wrote (its skills, package.json, package-lock.json and node_modules) may be there`,
387
+ `${dir} is not empty (${found.slice(0, 5).join(", ")}${found.length > 5 ? ", ..." : ""}): create the app in an empty folder; only .git, .vibe/ (the first version's plan .vibe/plans/01-<short name>.md, and its sketches) and what lernapps init wrote (its skills, package.json, package-lock.json and node_modules) may be there`,
388
388
  );
389
389
  }
390
390
  const plan = confirmedPlan(dir, archetype, values.plan);
@@ -100,7 +100,7 @@ questions. -->
100
100
  `lernapps-<archetype>-design` says, choose its pattern with skill `lernapps-exercise-patterns` (both loaded
101
101
  in Explore), and say why the guide's patterns do not fit.
102
102
  - [ ] Each new component or interactive exercise: a sketch (static SVG or image, or the steps). Words alone are not
103
- enough.
103
+ enough. Keep sketch files in `.vibe/sketches/`.
104
104
  - [ ] Show the creator, short: goal, new competencies by chapter, slices; in plain words what learners see and do,
105
105
  what is new. At most 2 questions.
106
106
  - [ ] **Checkpoint:** confirm the plan and the content method. Stop and wait for an explicit yes. Changes → change,
@@ -133,7 +133,7 @@ questions. -->
133
133
  - [ ] Write the Code tasks under "Code": pages or screens, their content, what each shows. Each ends in a commit.
134
134
  After the first task that shows real content: the task "Show the creator a first look (`early-preview`)".
135
135
  - [ ] Each screen, component or interactive exercise: a sketch (static SVG or image, or the steps with what
136
- learners see after each). Words alone are not enough.
136
+ learners see after each). Words alone are not enough. Keep sketch files in `.vibe/sketches/`, which `create` leaves alone.
137
137
  - [ ] Show the creator, short: goal, competencies by chapter, entry draft, tasks, sketches; the content method in
138
138
  plain words (what learners see and do, what it cannot do). At most 2 questions.
139
139
  - [ ] **Checkpoint:** confirm the plan and the content method, with the sketches shown. Stop and wait for an
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lernapps/tooling",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Shared tooling of the lernapps.net apps and sites: the CLI lernapps, site actions, Renovate preset, guidance for building apps; documentation at https://lernapps.net/tooling/",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,6 +28,8 @@ license: MIT
28
28
 
29
29
  - A build problem is one line `file:line: place (language): what to do`. Fix where it points.
30
30
  - Headings are `section` blocks, never Markdown headings.
31
+ - YAML: quote a text that has `: ` in it or looks like a number (`"8."`, `"01000001"`, `"0"`). Unquoted, YAML reads a map or a
32
+ number: the build stops, or the digits change. A table cell, a header cell too, is a text and never empty.
31
33
  - A new chapter: a folder with `chapter.yaml`, listed in `src/app.yaml`, each page listed in `chapter.yaml`.
32
34
  - `selfAssessment` in a `chapter.yaml`: written in Commit, skill
33
35
  `lernapps-explainer-self-assessment`. An exercise it names renamed or moved → change the reference too.
@@ -7,7 +7,7 @@
7
7
  | `true-false` | `answer` (true or false) |
8
8
  | `number` | `answer`, `tolerance` (0 = exact), `unit` if any; the learner may type a comma or a point |
9
9
  | `ordering` | `items` in the right order; the page mixes them |
10
- | `matching` | `pairs` as they belong; the page mixes the right side. `distractors` (1 to 4): wrong right entries that match no left one. `pairsFrom: material` instead of `pairs` takes them from the `labelled-figure` in `material` (marker left, text right; the figure needs `legend: false`) |
10
+ | `matching` | `pairs` as they belong, each pair an object `{ left, right }`; the page mixes the right side. `distractors` (1 to 4): wrong right entries that match no left one. `pairsFrom: material` instead of `pairs` takes them from the `labelled-figure` in `material` (marker left, text right; the figure needs `legend: false`) |
11
11
 
12
12
  - Every question: `id`, `text`, `explanation`, at least one link in `links`. Optional quiz `sources`.
13
13
  - Types without options carry their background in `explanation`.