Skip to content

v0.3.0

Choose a tag to compare

@Ikepeeee Ikepeeee released this 06 Sep 14:30
· 165 commits to main since this release
6cf6499

A module can now carry the toolchain it needs, and a task can explain itself.

Until now a module could publish functions and types but not the environment they run in, so a module driving Terraform against AWS was unusable without an image nobody could ship. And finding out what a task took as arguments meant reading its source. v0.3.0 closes both.

Distributable modules

  • Environments travel with the module. #docker gains a recipe form — #docker(dockerfile = "infra/Dockerfile", context = ".") — so a module ships the Dockerfile for its toolchain inside its own hash-pinned tree. Registry references now require a tag or digest.
  • Nothing is built implicitly. Images are content-addressed by recipe hash and materialized only by lask deps sync or lask env build. A RUN line is arbitrary code, so no implicit path may reach one.
  • Intent and resolution are separate files. dependencies.lask.json becomes lask.json and records only where a dependency comes from; lask.lock.json records the resolved graph, transitive dependencies included, and is now required. What a project executes can be read from the project.
  • References are pinned and checked. Tags resolve to commit SHAs, a repointed tag is E-MODULE-REV-MOVED, and a project file that disagrees with the lock is E-MODULE-LOCK-STALE.
  • Dependencies live in the project. The cache moves to .lask/deps, so a copied project works offline.
  • New commands. lask deps sync|add|diff|why, --frozen, and lask env build|list.
  • Visibility. export / internal mark declarations, with omission meaning export. export { a } from "path" re-exports declarations rather than values, so keyword arguments survive. An external import reaches only a tree's entry module, so a public API spanning files is re-exported from main.lask.

Help and documentation comments

  • A documentation comment above a declaration supplies a summary, a description, and @param / @return / @example / @hidden.
  • lask run <function> --help prints the signature, the doc comment, each default value, and the environments the function reaches. With no function name it lists everything the module offers, so a repository's tasks are discoverable without reading the source.
  • Default values are shown as source text and never evaluated; the default of a !! parameter is shown as <secret>.
  • lask envs <function> is now limited to that function's call graph instead of enumerating the whole module.

Breaking changes

  • remote, #env, environments.lask.json, --env-file and --ssh-* are removed. A host cannot be pinned, carries state between runs, and admits no boundary; reach one with ssh inside a pinned image instead.
  • dependencies.lask.json is renamed to lask.json, and a committed lask.lock.json is required. A hash key left in an existing project file is accepted and ignored, so nothing has to be edited by hand.
  • An external import naming a path inside a dependency tree is rejected.
  • Registry image references without a tag or digest are rejected.
  • lask infer is removed. run / eval help is where a user reaches for a type now; type inference itself is untouched.

Fixes

  • The lock was only required to cover the project file, not to agree with it, so a reference edited in place left the pinned content behind unnoticed. check now compares both.
  • deps sync short-circuited on a cache hit keyed by content hash, so a changed rev over an unchanged hash never re-fetched. A reference differing from the locked one now forces a fetch, surfacing the drift as E-MODULE-HASH-MISMATCH.

Full Changelog: v0.2.0...v0.3.0