l0.DependencyControl.ModuleLoader¶
ModuleLoader ¶
Internal module loading helpers for DependencyControl-managed module dependencies.
Class methods¶
formatVersionErrorTemplate ¶
Formats a single module's version-error line for a load-error summary.
| param | type | description |
|---|---|---|
| name | string |
The module's display name. |
| reqVersion? | string|integer |
The required version, shown in the message when present. |
| url? | string |
The module's feed/download URL, appended when present. |
| reason? | string |
The failure reason shown for the module. |
| ref? | table |
The installed module's version record; when given, formats the outdated template instead of the missing one. |
Returns:
errorLinestring— The formatted one-line error entry.
createDummyRef ¶
Registers a placeholder entry for this module in the global module registry so a circular dependency can resolve this module while it is still loading. No-op for non-module scripts.
Returns:
registeredboolean|nil— True if a dummy was registered, false if one already existed, nil if this isn't a module.
removeDummyRef ¶
Removes this module's placeholder registry entry if it is still a dummy (not yet replaced by the real module). No-op for non-module scripts.
Returns:
removedboolean|nil— True if a dummy entry was removed, false if none was present, nil if this isn't a module.
loadModule ¶
Loads a single required module, storing the result in mdl._ref and running its
DependencyControl initializer. On failure, sets mdl._missing when the module wasn't found or
mdl._error with the load error.
| param | type | description |
|---|---|---|
| mdl | table |
The module descriptor to load; mutated in place with the result and error flags. |
| usePrivate? | boolean |
Load this script's private copy (namespaced under its own name) instead of the shared module. |
| reload? | boolean |
Discard cached references to the module and its submodules and load afresh. |
Returns:
reftable? — The loaded module reference, or nil on failure.
loadModules ¶
Loads required modules, updates missing/outdated ones, and validates version constraints.
| param | type | description |
|---|---|---|
| modules | table[] |
|
| addFeeds? | string[] |
Extra feed URLs to search when fetching missing modules (default: this script's feed). |
| skip? | table<string, boolean> |
Module names to skip, keyed by name (default: this module itself). |
Returns:
successbooleanerrstring— Combined error message (empty on success).
checkOptionalModules ¶
Validates optional module availability for the requested feature set.
| param | type | description |
|---|---|---|
| modules | string|string[] |
Feature name(s) whose optional modules to check. |
Returns:
availablebooleanerrstring? — Error message listing missing modules.