-
v2.2.0 Stable
released this
2026-10-17 11:35:31 +02:00 | 0 commits to main since this releaseBreaking changes
- Contribution labels are
daw_i18n/v1resource references.label
(a{ de = ..., en = ... }table) is nowlabel_resource_id(a
resource id string) on groups, commands and subcommands -- in the
contribution.jsoninput and in the output ofcomposer.compose()
andscanner.build_index(). Hard cutover, no transition period.
berhtjan-core passes the id through unresolved. See
DAW/daw-modul-berhtjan-core#12. lang.resolve_label()is removed, together with its error code
label_not_found.resolve_resource(resource_id, catalogs, languages)
replaces it and returnsresult, nil | nil, daw_error/v1, the result
being{ text, requested_language, resolved_language, fallback_occurred }.catalogsholds one catalog per language,
catalogs[language][resource_id]. Every language oflanguagesmust
have a catalog (catalog_not_loadedotherwise -- nothing is skipped
silently); an unknown id and a missing translation are both
no_translation_available.lang.resolve_lang()validates its context. A non-tablectxis
invalid_ctx, a non-stringuser_localeorlangis
invalid_ctx_field, andctx.langmust be a language code of
lowercase letters (invalid_language_code) -- any string was
accepted before.scanner.build_index()rejects a command defined by two
contributions withcommand_name_collision(nil, err). It used to
keep the later one and drop the earlier one silently. See
DAW/daw-modul-berhtjan-core#16.- berhtjan-cli 2.1.0 does not work with this release. It calls
core.resolve_label()at several places. A matching berhtjan-cli
release follows.
New
lang.language_chain(ctx)-- the ordered language chain for
resolve_resource(): the resolved user language, then
ctx.default_langunless it is the same language. Exported by the
facade.- Build-time logic for the per-language resource catalogs
(resources.lua, facade exportsparse_resource_source()and
generate_catalogs()): validatedaw_i18n/v1sources, merge them by
priority per (resource id, language), require the default language to
be complete, and write a catalog as a Lua data file. Pure functions;
the host reads the sources and installs the result. See
DAW/daw-modul-berhtjan-core#13. scanner.build_index(): command entries carrymodule, the
contribution's module identity.i18n/en.jsonandi18n/de.json-- 79daw_i18n/v1resources; every
error site now carries aresource_id.
Fixes
lang.resolve_lang(): a malformed context (for example
user_locale = 123) raised a raw Lua error; it now returns
daw_error/v1.lang.lua: the bootstrap fallback was a plain string; it is the
reserveddaw-error-facility-unavailablesentinel now, in all
modules.
Internal
loader.lua: the shared_check_deps()plain-string helper is gone;
the fiveparse_contribution()error sites carry aresource_id.- Test suite: 207 -> 541 tests, Lua 5.1 and 5.4.
Migrating
- In every
contribution.json, replace"label": { ... }with
"label_resource_id": "<uuid>"and ship the text as a
daw_i18n/v1resource (canonical English ini18n/en.json). - Replace
resolve_label(label, lang, default_lang)with
language_chain(ctx)andresolve_resource(id, catalogs, chain). - Pass only language codes of lowercase letters (or nothing) as
ctx.langandctx.default_lang.
Requires daw-lua-common >= 2.1.0.
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
- Contribution labels are
-
v2.1.0 Stable
released this
2026-08-11 17:40:53 +02:00 | 41 commits to main since this releaseBreaking changes
- All public functions across
composer,loader,scanner,types,
langnow returnnil, <daw_error/v1 object>instead of
nil, <string>. The return contract itself (value, nil | nil, err)
is unchanged -- only whaterris. See
MIGRATION-DAW-MODUL-BERHTJAN-CORE-2.1.mdfor the full code
reference and cause-chain examples. M.PRIMITIVES,M.is_primitive(),M.primitives()removed
entirely.types.resolve()is now pure registry lookup -- no field
type name is known in code, not even the six former primitives
(text,textarea,number,boolean,select,date). See
daw_field_type/v1(DAW/daw-contracts#3).loader.parse_types()now structurally validates every type
definition againstdaw_field_type/v1at load time. A malformed
definition is rejected with a specific error code and
data.rulepointing at the exact contract rule violated.loader.merge_types()is now fallible
(registry, nil | nil, err). A field type id defined more than
once across merged tables is an error (duplicate_field_type), not
a silent override.scanner.build_index()is now two-valued
(index, nil | nil, err).lang.resolve_lang()no longer falls back to a hardcoded"en"--
actxwith neitheruser_localenorlangis now a real error
(no_language_resolvable).lang.resolve_label()gained a third parameter,default_lang, and
no longer falls back to"en"or topairs()'s nondeterministic
first match. A label with neither the requestedlangnor
default_langpresent is nowlabel_not_foundinstead of a silent
substitute.composer.compose()'s resolved fields carrytype_def(the full
daw_field_type/v1definition) instead of the oldprimitive
string field, which no longer has a meaningful value under the new
model.init.lua's facade no longer crashes viaerror()at load time if
a submodule is missing -- every export degrades individually via a
missing()stub (nil, daw_error/v1, codesubmodule_unavailable).
Fixes
scanner:project_rootwas silently ignored since commit
25e7557--module.conffor a host program's own contribution was
looked up relative to the scan root instead ofproject_root
(DAW/daw-modul-berhtjan-core#5, regressed during the "canonical
module resolution" refactor). Restored, with a regression test
fixture that deliberately differs scan root and project root.scanner.scan_root(): the recursive branch called
ipairs(scan_dir(subdir))directly, ignoring thatscan_dir()can
returnnil, err--ipairs(nil)raised a raw Lua error instead of
reporting it asdaw_error/v1. Now checked like the non-recursive
call.loader.parse_contribution()/parse_types():json.decode()no
longer throws sincedaw-lua-common2.0, but thepcall-wrapping
around it here was never updated -- it silently stopped catching
anything, and a decode failure crashed downstream onnildata
instead of returning an error. Fixed to readjson.decode()'s own
value, nil | nil, errcontract directly.loader.parse_contribution(): a bare JSON scalar (e.g.42) or a
top-levelnullpreviously crashed ondata.moduleinstead of
being rejected -- nowinvalid_contribution.lang.resolve_label():label[lang] then ...used truthiness,
silently treating a deliberately empty string (label.de = "") as
"missing" and falling through to the next candidate. Now checked via
~= nil, so an intentional""is returned as-is.scanner.sorted_subcommands()(new, DAW/daw-modul-berhtjan-core#4):
hardened beyond the issue's original proposal -- a malformedcmd
now returnsnil, daw_error/v1instead of crashing, since this is a
publicly exported function used bydaw-modul-berhtjan-cli.
Internal
scanner.lua(flat file) split intoscanner/(init.lua,
roots.lua,discover.lua,index.lua) -- exceeded the 250-line
limit.require("daw.berhtjan_core.scanner")unchanged.types.resolve(): reduced to ~40 lines, pure registry lookup.test/dev-module-map.lua: addeddaw.common.errorand the new
scanner.*submodule entries; added the missing
daw.berhtjan_core(facade) entry, previously absent entirely.- New
test/test_berhtjan-core-init.luacovering the root facade
(submodule aggregation,missing()stub behavior) -- didn't exist
before this release. - Test suite: 192 -> 207 tests.
Migration
Two independent things changed at once: the error contract
(daw_error/v1) and the field type contract (daw_field_type/v1,
replacingM.PRIMITIVES). Projects only checkingif err thenare
unaffected by the first; every project composing contributions is
affected by the second, since a registry with the six former
primitives must now be supplied explicitly.
MIGRATION-DAW-MODUL-BERHTJAN-CORE-2.1.mdwalks through both, plus
the full error-code reference.Requires daw-lua-common >= 2.1.0 (for
daw.common.error).There is no separately published 2.0.0 -- this release moves directly
from the 1.1.x line to 2.1.0.Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
- All public functions across