What programs mean (the languages, translators, Mojo checker and
interpreter, prover, fuzzer, machine model, catalog problems and the Mojo
corpus with godbolt's stored answers) was mixed into the site's tree, so a
change to the prover and a change to a button went through the same gate
and the same docs. This moves all of it under core/, laid out as its own
repository, ready to be extracted with its history and pinned here as a
git submodule.
- core/: src/{engines,services,sync,mojo,exercises,curriculum,common},
mojo/, syntax/mojo.xml, its tests (with Workspace and workForProblem in
place of the site's Session), scripts (corpus pipeline, play, the
exercise and probe starters, engines export/diff), and its docs
(engines, trust, mojo-corpus, exercises, coverage). Its own pixi.toml,
package.json, README, AGENTS.md and CI workflow.
- core/tests/boundary.test.mjs: library modules use no DOM, import no
page widget, and import nothing outside src/.
- core/scripts/cli.mjs: pixi run cli check|run|prove|fuzz|translate.
- core/scripts/dafny.py: Dafny 4.11.0 pinned by version and SHA-256 per
platform, fetched into .tools/ (pixi run dafny-fetch, pixi run dafny).
- The site imports core only as #core/<path>.js: an import map in
index.html, "imports" in package.json for node, core's declarations for
tsc. The site's TypeScript builds core first (npm run build).
- assemble.sh, the Quarto engine copy, the render cache key, check-pages,
quarto-export and quarto-css read core/dist and core/mojo; quarto-css
copies core's syntax/mojo.xml into the extension.
- Site tests that covered engines moved to core; the rest keep Session.
- README, AGENTS.md, docs/app.md, docs/deploy.md and the CI workflow
describe the split (checkout with submodules; core's tests and corpus
status run against the pinned commit).
Gate: site 110 pass; core 307 pass; corpus status --strict passes.
Manual check: the assembled site opens Bridge (count-base-proved),
Developer and Hardware (count-base) with the editor, the stepper and the
board, and no module errors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FgvbRdoEheAHqsRmr2WuKZ
47 lines
4.2 KiB
TOML
47 lines
4.2 KiB
TOML
# pplus-web — every command a person runs, in one place.
|
|
#
|
|
# pixi run <task> [args] list them all: `pixi task list`
|
|
#
|
|
# The README's "Commands" table lists every task here; tests/tasks.test.mjs
|
|
# keeps the two in step. Without pixi, `npm install && npm test` builds core
|
|
# (core/, the pplus-core submodule) and the site, and tests the site, with
|
|
# whatever node and python3 are on the PATH (that is what CI does); everything
|
|
# else assumes the pinned environment below. Core's own commands are in
|
|
# core/pixi.toml: `pixi run --manifest-path core/pixi.toml <task>`.
|
|
|
|
[workspace]
|
|
authors = ["Alex Maldonado <alex@scient.ing>"]
|
|
channels = ["https://conda.modular.com/max/", "conda-forge"]
|
|
name = "pplus-web"
|
|
platforms = ["linux-64", "osx-arm64"]
|
|
version = "0.1.0"
|
|
|
|
[dependencies]
|
|
mojo = "==1.1.0" # for the Quarto views that run a page's Mojo on a real compiler (core/mojo/pin.json)
|
|
nodejs = ">=26.10.0,<26.11" # building core and the site, and the tests
|
|
python = ">=3.14.7,<3.15" # the dev server and the package script (standard library only)
|
|
|
|
[tasks]
|
|
# --- build and test the site -----------------------------------------------
|
|
install = { cmd = "npm install", inputs = ["package.json"], outputs = ["node_modules/.package-lock.json"], description = "Install TypeScript (the only npm dependency)" }
|
|
core-build = { cmd = "npx tsc -p core/tsconfig.json", depends-on = ["install"], description = "Build pplus-core (core/, a git submodule) into core/dist/ with the site's TypeScript; the site imports it as #core/" }
|
|
core-test = { cmd = "node --test tests/*.test.mjs", cwd = "core", depends-on = ["core-build"], description = "Run pplus-core's own tests (its gate is core's pixi run ci)" }
|
|
build = { cmd = "npx tsc -p tsconfig.json", depends-on = ["install", "core-build"], description = "Build core, then compile src/ to dist/" }
|
|
watch = { cmd = "npx tsc -p tsconfig.json --watch", depends-on = ["install", "core-build"], description = "Rebuild dist/ on every change (core is built once first)" }
|
|
check = { cmd = "npx tsc -p tsconfig.json --noEmit", depends-on = ["install", "core-build"], description = "Type-check only" }
|
|
dev = { cmd = "python -m http.server 4173", depends-on = ["build"], description = "Build, then serve the app on http://localhost:4173" }
|
|
test = { cmd = "node --test tests/*.test.mjs", depends-on = ["build"], description = "Build, then run every test of the site" }
|
|
check-pages = { cmd = "node scripts/check-pages.mjs {{ dir }}", args = ["dir"], depends-on = ["build"], description = "Run every program embedded in the Quarto pages under <dir> (quarto/README.md)" }
|
|
|
|
# --- Quarto ------------------------------------------------------------------
|
|
quarto-export = { cmd = "node scripts/quarto-export.mjs {{ name }} {{ dir }}", args = ["name", "dir"], depends-on = ["build"], description = "Copy core/mojo/local/<name>.mojo, its x86-64 and setup beside a Quarto page, and print the shortcode" }
|
|
quarto-css = { cmd = "node scripts/quarto-css.mjs", depends-on = ["build"], description = "Regenerate the extension's generated files: pplus-views.css, pplus-hw.css, course/*.css and syntax/mojo.xml (from core)" }
|
|
quarto-engine = { cmd = "node scripts/quarto-engine.mjs {{ dir }}", args = ["dir"], depends-on = ["build"], description = "Copy a built Programming+ (and core) into a site's _extensions/pplus/engine, for the rendered views (quarto/README.md)" }
|
|
quarto-example = { cmd = "quarto render quarto", depends-on = ["build"], description = "Render the example site in quarto/example with every shortcode (needs Quarto on the PATH)" }
|
|
|
|
# --- ship ------------------------------------------------------------------
|
|
ci = { depends-on = ["test"], description = "What CI runs: every test of the site, against the pinned core" }
|
|
site = { cmd = "scripts/assemble.sh", depends-on = ["test"], description = "Test, then assemble site/ for publishing" }
|
|
package = { cmd = "python scripts/package.py", description = "Zip the files git tracks (and new ones it does not ignore) into package/ for sharing" }
|
|
deploy = { cmd = "scripts/deploy.sh {{ slug }} {{ target }}", args = [{ arg = "slug", default = "pplus" }, { arg = "target", default = "" }], depends-on = ["site"], description = "Publish site/ to /srv/www/<slug>, optionally on <target> (user@host) over SSH (docs/deploy.md)" }
|