Jennifer Academy

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.j with LIMITS and force and its full docblock ("src/: the part that ships", "The code"; the file is jennifer fmt clean, so its while body takes three lines where the slide has one), src/beaufort_test.j with the four tests ("Tests: an overlay beside every module"), examples/force.j, docs/ (outline, introduction, cheatsheet, design notes), README.md and grimoire.toml ("Docs, design notes, JENNIFER.md"). The shared CI layer is not copied here; make-deck.sh takes 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), lays deck-beaufort/ over it, runs the gate ("The gate: tools/check-all.sh") and commits and tags 0.1.0 in 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). Needs git, bash and jennifer. 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 into dist/ instead of publishing).
  • red-gate.sh: two broken copies of the built deck in a temporary directory: a new export isCalm with no test and no cheatsheet line, and a comment appended to the shared tools/check-src.sh ("What the gate catches", "Never edit a shared file in a deck"). Run, after make-deck.sh: sh red-gate.sh [deck-dir]
  • consumer/deck.toml, consumer/main.j: a project that requires the deck and prints force 6 ("Using it from another project"). [sources] points at ../deck-beaufort-built, the tagged repository make-deck.sh wrote. Run, from consumer/: jvc install (writes vendor/mplx/beaufort/ and camcorder.lock), then jennifer run main.j. Without vendor/ the import fails with "needs a vendor directory". jvc install --run-untrusted-tests also 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.

FileSize
LICENSE899 Braw
README.md2.6 KiBraw
consumer/deck.toml361 Braw
consumer/main.j80 Braw
deck-beaufort/README.md1.4 KiBraw
deck-beaufort/deck.toml442 Braw
deck-beaufort/docs/SUMMARY.md233 Braw
deck-beaufort/docs/cheatsheet.md425 Braw
deck-beaufort/docs/design.md921 Braw
deck-beaufort/docs/index.md485 Braw
deck-beaufort/examples/force.j412 Braw
deck-beaufort/grimoire.toml606 Braw
deck-beaufort/src/beaufort.j877 Braw
deck-beaufort/src/beaufort_test.j639 Braw
make-deck.sh1.3 KiBraw
red-gate.sh943 Braw