Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@ jobs:
- name: Verify solutions
run: REQUIRE_COMPLETE=1 ./scripts/check-solutions.sh

javascript:
name: JavaScript bundles
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install pinned dependencies
run: npm ci --ignore-scripts
- name: Rebuild local CodeMirror and Lezer bundles
run: npm run build:js
- name: Verify generated bundles are current
run: git diff --exit-code -- static/dist

spellcheck:
name: Spell check (typos)
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ course.db
course.db-wal
course.db-shm

# Rust build artifacts
# Build artifacts and local dependencies
/target/
/node_modules/
exercises/*/target
Cargo.lock

Expand Down
1 change: 1 addition & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
extend-exclude = [
# Vendored / minified third-party assets we don't control.
"static/js/htmx.min.js",
"static/dist/",
"*.min.js",
# Lock file: full of base32/hex hashes that look like typos.
"Cargo.lock",
Expand Down
16 changes: 10 additions & 6 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ course/
│ ├── server.rs # Axum web server (default `cargo run`)
│ └── cli.rs # `cargo course …` subcommands
├── templates/ # Askama templates rendered by the server
├── static/ # served at `/static/*` (assets, fonts, quiz.html)
├── static/ # served at `/static/*` (assets, local fonts, JS bundles)
├── package.json # pinned frontend deps + reproducible esbuild command
├── package-lock.json # exact frontend dependency graph
└── target/ # cargo build output (ignored)
```

Expand Down Expand Up @@ -336,24 +338,26 @@ submissions.

Served by `tower-http` `ServeDir` at `/static/*`. Notable:

- `static/quiz.html`: the chapter 18 quiz. Self-contained HTML/JS;
no backend involvement. The chapter's `main.rs` is essentially a
pointer to this file.

- `static/js/inline-editor.js`: shared CodeMirror 6 mount used by
`templates/exercise.html`, `templates/dashboard.html`, and
`templates/playground.html`. Owns Run/Format/Reset/Submit wiring,
draft persistence, vim toggle (global across mounts), test result
rendering, and the textarea fallback. Each call site supplies its
own DOM (per the `data-role` contract documented at the top of the
module) and an optional `onRunSuccess` callback.
module) and an optional `onRunSuccess` callback. Templates load the
generated `static/dist/inline-editor.js`, not this source file directly.
- `static/js/cm-theme.js`: the shared `proseHighlightStyle` /
`proseEditorTheme` CodeMirror exports, read by `inline-editor.js`
and `readonly-rust-editor.js` so all editors stay in sync with the
`--syn-*` CSS variables in `base.html`.
`--syn-*` CSS variables in `static/css/base.css`.
- `static/js/readonly-rust-editor.js`: read-only CodeMirror viewer
for Rust code blocks on admin and team pages, and the per-step
"Reveal the full solution" viewer mounted lazily inside the hints
disclosure on `templates/exercise.html`.
- `static/dist/`: checked-in, minified esbuild output for CodeMirror,
Lezer, Vim mode, and Rust highlighting. Rebuild with `npm run build:js`;
CI verifies the generated chunks match the source modules.
- `static/assets/`: logos, screenshots.
- `static/fonts/`: bundled webfonts.

Expand Down
Loading
Loading