-
v2.1.0 Stable
released this
2026-08-06 22:25:10 +02:00 | 0 commits to main since this releasedaw-lua-common v2.1.0
Highlights
daw-lua-common now returns a structured
daw_error/v1object from every
public function on failure, instead of a plain error string. This is the
biggest architectural change in this release: every module boundary now
follows the same error contract, the same "no uncaught Lua errors leave
a library module" rule, and the same internal-helper-returns-plain-text
/ public-API-builds-one-error-object pattern.See README.md and
daw-contracts: daw_error/v1
for the full contract.New
daw.common.error-- new public module, thedaw_error/v1
constructor (error.new(),error.is_error()) used by every other
module in this library.fs.copy_preserve(src, dst)-- new function shelling out to
cp -a, preserving symlinks, permissions, timestamps, and ownership.
fs.copy()/fs.copy_dir()remain content-only (read+rewrite, no
metadata preservation) and are now explicitly documented as such.
Closes #40.
Fixed
sys:run_rc(): stderr from the executed command was not actually
being captured, contrary to the documented contract ("stdout and
stderr are both captured"). The trailing2>&1redirect bound only
to the marker-printingprintf, not to the command itself, due to
normal shell parsing ofcmd; printf ... 2>&1. Fixed by wrapping the
whole sequence in a POSIX brace group.fs.write_file(): a failed write could go unnoticed.f:write()
can report success even when the underlying write later fails on
close()(stdio buffering) -- both are now checked.config_parser: section type (the part before the name in
[type "name"]) now follows the same[a-z0-9_-]naming convention
as the section name. Previously[Server "abc"]was silently
accepted despite the uppercase type.decimal.round()/decimal.div():decimals/target_scaleare
now validated as non-negative integers, not just "is a number" --
negative or fractional values previously reached the internal
power-of-ten helper with undefined behavior.
Changed
decimal.luaanddaw.common.errorare now directory modules
(decimal/,error/) split into focused submodules behind a stable
facade -- require paths are unchanged.- Every module's
fail()/err()helper now also guards against
daw.common.error.new()itself raising (not just againstrequire()
failing), consistent with "no module propagates an uncaught Lua
error."
Migration notes
If any consumer code inspects the
errreturn value directly (e.g.
err:match(...), string concatenation, pattern matching on error
text), that code will break --erris now a table
({ schema, id, source, code, message, cause?, data? }), not a string.
Useerr.codefor programmatic checks anderr.messagefor the
human-readable text, ordaw.common.error.is_error(err)to check the
shape.This release only touches
daw-lua-commonitself. Consumer projects
are migrated to the new contract individually and at their own pace;
daw-lua-commonv1.x behavior for callers not yet updated is
unaffected until they upgrade their submodule pin.Downloads
-
Source code (ZIP)
1 download
-
Source code (TAR.GZ)
1 download
-
v2.0.0 Stable
released this
2026-07-20 07:13:22 +02:00 | 4 commits to main since this releasedaw-lua-common 2.0.0
Erstes größeres Major-Release seit Beginn der Bibliothek – durchgängige Umstellung der Fehlerbehandlung auf
nil, err, mehrere Modul-Splits, ein vollständiger Team-Review-Durchlauf über alle Module, und eine repo-weite Vereinheitlichung der Fehlermeldungen.Breaking Changes
uuid.lua:validate()→is_valid(),get_short_code()→short_code(),is_version_4()entfernt (war redundant zuis_valid())config_parser.lua:convert()erkennt keine wissenschaftliche Notation (1e5) oder Hex-Literale (0x10) mehr als Zahlen – bleiben jetzt bewusst Stringyaml.dump(): nicht serialisierbare Typen (Funktionen, Coroutines) liefern jetztnil, errstatt eines Platzhalter-Stringsjson.encode(): NaN/Infinity werden jetzt abgelehnt statt als ungültiges JSON ausgegebencrypto.hmac_*: Keys mit NUL-Bytes oder abschließendem Zeilenumbruch werden jetzt aktiv abgelehnt statt still fehlinterpretiert- Fehlermeldungen: einheitlich
[ERROR] modul.funktion: ...im ganzen Repository (vorher mehrere uneinheitliche Varianten)
Neu
base64.lua: jetzt vollständig ohne externe Abhängigkeit (keinopensslmehr nötig)fs.remove_dir_recursive(),yaml.dump(), vollständigefs/-,json/- undyaml/-Modulaufteilungcrypto/inhash.lua+hmac.lua+ Fassade aufgeteilt (fragjan 250-Zeilen-Limit)
Robustheit
- Kalender- und Zeitzonen-Validierung in
time.lua - Vollständiges RFC-8259-Escaping in
json/encode.lua, passende\uXXXX-Dekodierung injson/decode.lua - Shell-Quoting-Fixes, Typprüfungen an praktisch jeder öffentlichen Funktion
decimal.is_valid()garantiert jetzt, dassparse()danach nicht mehr scheitert
Zahlen
- 391 Tests (vorher ~220), grün unter Lua 5.1 und 5.4
- fragjan: 34 Dateien, 711 Checks, clean
Bekannte offene Punkte (nicht release-blockierend)
Downloads
-
Source code (ZIP)
1 download
-
Source code (TAR.GZ)
1 download