# pplus-web — every command a person runs, in one place. # # pixi run [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; everything else assumes the # pinned environment below, and the deploy job runs `pixi run ci` in it. Core's own # commands are in core/pixi.toml: `pixi run --manifest-path core/pixi.toml `. [workspace] authors = ["Alex Maldonado "] channels = ["https://conda.modular.com/max/", "conda-forge"] name = "pplus-web" platforms = ["linux-64", "osx-arm64"] license = "Apache-2.0" license-file = "LICENSE.md" version = "0.1.0" [dependencies] mojo = "==1.2.0" # for the Quarto views that run a page's Mojo on a real compiler (core/library/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) pandoc = ">=3.6,<4" # the Quarto extension's tests run its Lua filter in pandoc; without it eleven of them are skipped [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 --test-concurrency=8 tests/*.test.mjs", cwd = "core", depends-on = ["core-build"], description = "Run pplus-core's own tests at the pinned commit, before moving the pointer (the deploy job does not run them; core's gate, its pixi run ci, does)" } core-status = { cmd = "python scripts/mojo/corpus.py status --strict", cwd = "core", description = "Core's mojo-status-strict at the pinned commit: no Mojo program of ours fails, from godbolt's stored answers (offline)" } 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 (quarto/README.md)" } # --- Quarto ------------------------------------------------------------------ quarto-export = { cmd = "node scripts/quarto-export.mjs {{ name }} {{ dir }}", args = ["name", "dir"], depends-on = ["build"], description = "Copy core/library/mojo/local/.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", "core-status"], description = "What the deploy job runs before it publishes: every test of the site, and core's mojo-status-strict at the pinned commit. Core's own tests are core's gate (docs/deploy.md)" } release-check = { cmd = "node scripts/release.mjs check", depends-on = ["build"], description = "Is the chain web -> core -> library consistent: pointers checked out, clean and pushed to their branch, generated files current, Mojo pinned alike (docs/deploy.md); --offline asks no remote" } release-bump = { cmd = "node scripts/release.mjs bump", depends-on = ["build"], description = "After a change in core/library or core: move the pointers bottom up, regenerate, run each gate, print what to push in order; --commit makes the commits, nothing pushes (docs/deploy.md)" } site = { cmd = "scripts/assemble.sh", depends-on = ["test"], description = "Test, then assemble site/ for publishing" } caddy-check = { cmd = "node scripts/caddy-check.mjs", description = "Serve the assembled site/ with a real Caddy under docs/Caddyfile and hold its headers, caching and missing-path answers (needs site/; fetches Caddy with pixi exec the first time)" } 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/, optionally on (user@host) over SSH (docs/deploy.md)" }