• v2.1.0 39c9a70b42

    v2.1.0 Stable

    michael released this 2026-08-11 18:21:23 +02:00 | 2 commits to main since this release

    Breaking changes

    • All public functions (dispatch, build_usage, render_form,
      render_record, render_table, render, prompt, confirm) now
      return nil, <daw_error/v1 object> instead of nil, <string>. See
      MIGRATION-DAW-MODUL-BERHTJAN-CLI-2.1.md for the full code
      reference.
    • render_form() and prompt() gained lang/default_lang
      parameters and no longer fall back to the group id when a label
      can't be resolved -- consistent with
      daw-modul-berhtjan-core's resolve_label() "no silent fallbacks"
      rule.
    • render_form(), render_record(), render_table() now actually
      return true, nil | nil, err on their success/failure paths
      (previously returned nothing at all).
    • init.lua's facade no longer crashes via error() at load time if
      a submodule is missing -- every export degrades individually via a
      missing() stub.

    Fixes

    • render_record() / render_table() / render(): a field value of
      false was rendered as an empty string (x or "" treated it the
      same as a missing value). Now only nil becomes ""; false
      renders as "false".
    • prompt_field() / confirm(): read_line() returning nil (EOF,
      per daw.common.sys's contract) was silently treated as an empty
      answer. Now surfaced as input_ended.
    • Local sorted_subs() in dispatch.lua (a duplicate re-
      implementation of subcommand ordering) removed, replaced by
      daw-modul-berhtjan-core's core.sorted_subcommands()
      (DAW/daw-modul-berhtjan-core#4). Works unchanged at the index level
      despite different field names, since the shared helper only ever
      copies fields generically and sorts by .order.
    • dispatch(): cmd.subcommands[sub_name] could crash on a nil
      cmd.subcommands (a command with no subcommands at all). Now
      guarded.

    Internal

    • dispatch.lua (flat file, 289 lines) split into dispatch/
      (init.lua, args.lua, display.lua) -- exceeded the 250-line
      limit. require("daw.berhtjan_cli.dispatch") unchanged.
    • test/dev-module-map.lua: added daw.common.error and the new
      dispatch.*/scanner.* submodule entries, matching the
      corresponding split in daw-modul-berhtjan-core.
    • New test/test_berhtjan-cli-prompt.lua -- didn't exist before this
      release; covers the group_label_resolve_failed, deps_unavailable
      and input_ended error paths.
    • test/test_berhtjan-cli-dispatch.lua: new fixtures for
      handler_not_found and for proving core.sorted_subcommands() is
      actually wired in (subcommand output order follows .order, not
      declaration order in the fixture's JSON).
    • Test suite: 68 -> 87 tests.

    Migration

    Every dispatching/rendering call site that reads err as a string
    needs updating; code that only checks if err then is unaffected.
    MIGRATION-DAW-MODUL-BERHTJAN-CLI-2.1.md walks through the full
    change set.

    Requires daw-modul-berhtjan-core >= 2.1.0.

    Downloads