Code: Writing and publishing your first deck
Writing and publishing your first deck: the code
The deck of the talk, @mplx/beaufort, and a project that uses it. Checked with Jennifer 0.27.0, jvc 0.2.0 and deck-template at commit c81632c. Nothing here is published, and nothing needs a registry account: the consumer reads the deck from a local git repository through [sources].
deck-beaufort/: the files the deck author writes, laid over the template:deck.toml("deck.toml: who the deck is"),src/beaufort.jwithLIMITSandforceand its full docblock ("src/: the part that ships", "The code"; the file isjennifer fmtclean, so itswhilebody takes three lines where the slide has one),src/beaufort_test.jwith the four tests ("Tests: an overlay beside every module"),examples/force.j,docs/(outline, introduction, cheatsheet, design notes),README.mdandgrimoire.toml("Docs, design notes, JENNIFER.md"). The shared CI layer is not copied here;make-deck.shtakes it from the template.make-deck.sh: builds the complete deck the way "Start from the template" does (copy,tools/init-deck.sh mplx beaufort "...", remove the three template-only files), laysdeck-beaufort/over it, runs the gate ("The gate: tools/check-all.sh") and commits and tags0.1.0in a local git repository. Nothing is pushed. Run, from this folder:sh make-deck.sh [template-dir] [target-dir](default: clones https://github.com/jennifer-language/deck-template into./deck-beaufort-built). Needsgit,bashandjennifer. Then, in the built deck:jennifer test src/beaufort_test.j,jennifer run examples/force.j,jvc pack(the gate of "jvc publish: nothing is uploaded", writing a tarball intodist/instead of publishing).red-gate.sh: two broken copies of the built deck in a temporary directory: a new exportisCalmwith no test and no cheatsheet line, and a comment appended to the sharedtools/check-src.sh("What the gate catches", "Never edit a shared file in a deck"). Run, aftermake-deck.sh:sh red-gate.sh [deck-dir]consumer/deck.toml,consumer/main.j: a project that requires the deck and printsforce 6("Using it from another project").[sources]points at../deck-beaufort-built, the tagged repositorymake-deck.shwrote. Run, fromconsumer/:jvc install(writesvendor/mplx/beaufort/andcamcorder.lock), thenjennifer run main.j. Withoutvendor/the import fails with "needs a vendor directory".jvc install --run-untrusted-testsalso runs the deck's overlay.
Not run for the talk: jvc login, jvc claim, jvc scopes, jvc publish, jvc yank and the git push of a tag, which need a registry account or a remote repository.
| File | Size | |
|---|---|---|
| LICENSE | 899 B | raw |
| README.md | 2.6 KiB | raw |
| consumer/deck.toml | 361 B | raw |
| consumer/main.j | 80 B | raw |
| deck-beaufort/README.md | 1.4 KiB | raw |
| deck-beaufort/deck.toml | 442 B | raw |
| deck-beaufort/docs/SUMMARY.md | 233 B | raw |
| deck-beaufort/docs/cheatsheet.md | 425 B | raw |
| deck-beaufort/docs/design.md | 921 B | raw |
| deck-beaufort/docs/index.md | 485 B | raw |
| deck-beaufort/examples/force.j | 412 B | raw |
| deck-beaufort/grimoire.toml | 606 B | raw |
| deck-beaufort/src/beaufort.j | 877 B | raw |
| deck-beaufort/src/beaufort_test.j | 639 B | raw |
| make-deck.sh | 1.3 KiB | raw |
| red-gate.sh | 943 B | raw |