refactor: move renderer-independent logic to berhtjan-core (order + lang) #3
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type
docs
type/documentation
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type/refactor
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-modul-berhtjan-core#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Move all UI-renderer-independent logic into
berhtjan-coreso it isshared by cli, web, api and any future renderer without duplication.
Includes subcommand ordering and multilingual label support.
Current problem
adapters/uiis copy-pasted per host program (stapul, steurjan, ...).parse_scan_roots,load_contributions,build_indexlive inberhtjan-cli/dispatch.luabut belong in core since web and api needthe same logic. Language resolution and subcommand ordering are missing.
What moves to berhtjan-core
Contribution scanning:
parse_scan_roots(raw)-- parses cfg.ui.scan string into listload_contributions(roots)-- scans module.conf + contribution.jsonbuild_index(contributions)-- builds command/subcommand indexOrdering:
orderfield added to subcommands in contribution.json (optional int)build_indexsorts subcommands byorder, fallback: alphabeticalLanguage resolution:
resolve_lang(ctx)-- priority chain:resolve_label(label, lang)-- picks correct label string for langWhat stays in berhtjan-cli
dispatch(args, roots, ctx)-- uses berhtjan-corebuild_usage(roots, ctx)-- uses berhtjan-core, respects langprint_subcommands-- respects lang + orderrender,prompt,confirm-- CLI-specificWhat stays in adapters/ui (host)
build_ctx(cfg)-- host-specific: reads registry, paths, project,lang from cfg
contribution.json additions
Acceptance criteria
berhtjan-core: parse_scan_roots, load_contributions, build_index,resolve_lang, resolve_label implemented and tested
berhtjan-core/build_index: subcommands sorted by order fieldberhtjan-cli/dispatch.lua: uses berhtjan-core, respects lang + orderadapters/uiin stapul + steurjan: simplified to build_ctx + callsdaw-module-manager/src/ui/contribution.json: order + en/de labelsReferences