diff --git a/DependencyControl.json b/DependencyControl.json new file mode 100644 index 0000000..45ec192 --- /dev/null +++ b/DependencyControl.json @@ -0,0 +1,40 @@ +{ + "dependencyControlFeedFormatVersion": "0.4.0", + "name": "Yutils", + "description": "An ASS typeset utilities library.", + "baseUrl": "https://github.com/TypesettingTools/Yutils", + "url": "@{baseUrl}", + "maintainer": "TypesettingTools", + "modules": { + "tstools.Yutils": { + "name": "Yutils", + "description": "An ASS typeset utilities library.", + "author": "Christoph \"Youka\" Spanknebel", + "url": "@{baseUrl}", + "channels": { + "main": { + "version": "1.0.0", + "released": "2026-07-24", + "default": true, + "files": [ + { + "name": ".lua", + "url": "https://raw.githubusercontent.com/TypesettingTools/Yutils/v@{version}/src/Yutils.lua", + "sha1": "3439D32F109F40EF24EFECE6C2A3C0AB0B314EE0" + } + ], + "provides": [ + { + "name": "Yutils" + } + ] + } + }, + "changelog": { + "1.0.0": [ + "feat: Yutils can now be installed and updated through DependencyControl as `tstools.Yutils`, and provides the bare `Yutils` module name so existing scripts keep working unchanged." + ] + } + } + } +} diff --git a/src/Yutils.lua b/src/Yutils.lua index 96fc31b..20e7e3a 100644 --- a/src/Yutils.lua +++ b/src/Yutils.lua @@ -3530,5 +3530,23 @@ if ({...})[1] then _G.Yutils = Yutils end +-- DependencyControl integration +-- DependencyControl's module loader calls this hook when it loads the library. Constructing the +-- record registers the module under its namespace and registers the bare "Yutils" alias, so scripts +-- can keep requiring "Yutils" although the file installs to tstools/Yutils.lua. Loading the library +-- without DependencyControl never calls this hook and leaves the library unchanged. +function Yutils.__depCtrlInit(DependencyControl) + Yutils.version = DependencyControl({ + name = "Yutils", + version = "1.0.0", + description = "An ASS typeset utilities library.", + author = "Christoph \"Youka\" Spanknebel", + moduleName = "tstools.Yutils", + url = "https://github.com/TypesettingTools/Yutils", + feed = "https://raw.githubusercontent.com/TypesettingTools/Yutils/master/DependencyControl.json", + provides = {"Yutils"} + }) +end + -- Return library to script loader return Yutils