From f269988a6a18451bc6e4e2b033d8afb87e0eceba Mon Sep 17 00:00:00 2001 From: line0 Date: Fri, 24 Jul 2026 14:08:08 +0200 Subject: [PATCH] Add a DependencyControl record and feed Yutils has been distributed by bundling it with the Aegisub installer, because no DependencyControl feed offered it. This adds one, so it can be installed and updated like any other managed module. The library registers as `tstools.Yutils` and declares the bare `Yutils` name in `provides`, so scripts that require "Yutils" (ASSFoundation among them) keep working unchanged. The record is built in a `__depCtrlInit` hook, which DependencyControl calls only when it loads the library. Loading Yutils standalone never calls it, so the library behaves exactly as before. Co-Authored-By: Claude Opus 4.8 (1M context) --- DependencyControl.json | 40 ++++++++++++++++++++++++++++++++++++++++ src/Yutils.lua | 18 ++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 DependencyControl.json 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