Skip to content

Add bso init with a safe, version-matched demo project - #173

Merged
bartvanderwal merged 3 commits into
mainfrom
copilot/bso-init-create-new-bso-project
Oct 27, 2026
Merged

bartvanderwal merged 3 commits into
mainfrom
copilot/bso-init-create-new-bso-project

Conversation

Copilot AI commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Starting a course currently requires hand-written configuration and knowledge of BSO’s file conventions. This adds bso init to scaffold a working example from the installed BSO version.

  • Safe initialization: Lists additions and confirms the absolute target path, defaulting to no. Supports --yes/-y; refuses existing destination files and symlinked parents without overwriting.
  • Standalone course: Generates configuration and copies lessons, quizzes, flashcards, diagrams, readers, slides, and a teacher page. Omits repository-specific settings and Docusaurus/npm scaffolding.
  • Onboarding: Updates README and manual Quickstarts, prints next commands, and links to the separate Docusaurus setup still required for preview.
  • Regression coverage: Adds confirmation, conflict-safety, CLI, inventory-completeness, and generated-course lint/build tests.
bso init       # review additions and confirm
bso lint
bso build
bso pack

Co-authored-by: bartvanderwal <3029472+bartvanderwal@users.noreply.github.com>
Copilot AI changed the title [WIP] Add bso init to create a new BSO project with default config Add bso init with a safe, version-matched demo project Oct 27, 2026
Copilot AI requested a review from bartvanderwal October 27, 2026 21:51
@bartvanderwal

Copy link
Copy Markdown
Owner

@copilot The test init: rule I4 generated demo lints and builds HTML, quizzes and a teacher page in tests/init.test.ts fails, on this branch too (7 pass, 1 fails). The cause is in the test, not in src/init.ts: the check for the quiz files looks for .xml files directly in quiz/, but a build puts them in a folder per module (quiz/week-1/).

Please change the last quiz assertion to look in the module folder:

assertEquals(
  (await entries(join(config.outputDir, "quiz", "week-1"))).some((name) =>
    name.endsWith(".xml")
  ),
  true,
);

I tried this change locally on this branch: all 8 tests of tests/init.test.ts pass with it.

Then, please:

  • run deno task test:fast and say in the PR how many tests pass;
  • keep the PR in draft until that passes;
  • do not add issue numbers to code, comments or test names (AGENTS.md).

Co-authored-by: bartvanderwal <3029472+bartvanderwal@users.noreply.github.com>

Copilot AI commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

@copilot The test init: rule I4 generated demo lints and builds HTML, quizzes and a teacher page in tests/init.test.ts fails, on this branch too (7 pass, 1 fails). The cause is in the test, not in...

Fixed in 33cc4f1: the assertion now checks quiz/week-1/. No production code, comments, or test names changed.

Attempted the 8 init tests and deno task test:fast: 0 tests executed in this runner because fetching the existing JSR dependencies (@std/assert / @std/path) failed before execution. The full suite is similarly blocked. Lint, formatting, and secret scanning passed; CodeQL classified the test-only change as trivial and skipped analysis.

PR #173 remains draft; the fast suite has not been verified passing here.

@bartvanderwal
bartvanderwal merged commit 73be236 into main Oct 27, 2026
@bartvanderwal
bartvanderwal deleted the copilot/bso-init-create-new-bso-project branch October 27, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bso init: create a new BSO project with a default config and the demo course

2 participants