fix(build): capture type aliases in ActualTypes hub export list
Some checks failed
Build and Deploy / build-push-deploy (push) Has been cancelled

IHP entity pattern: data Foo' params = Foo {...} (primed type, unprimed ctor)
                   type Foo = Foo' arg1 arg2    (concrete alias, kind *)

Include type instances use [Foo] — needs the concrete type alias (kind *),
not the primed data type. Previous awk only matched data/newtype, missing
the type alias. Add /^type [A-Z]/ match (no (..) suffix — type aliases are
not ADTs). type instance lines start with lowercase 'i' and don't match.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-01 23:13:26 +02:00
parent e19d7deef4
commit 5382a7672a

View File

@@ -128,15 +128,21 @@
postUnpack = (old.postUnpack or "") + ''
_actual="$sourceRoot/build/Generated/ActualTypes.hs"
# Rewrite hub export list: (module N, ...) (T(..), ...)
# Extract all data/newtype names from inner module files.
# Rewrite hub export list: (module N, ...) explicit names.
# IHP pattern: data Foo' params = Foo {...} (primed type, unprimed ctor)
# type Foo = Foo' arg1 arg2 (concrete alias, kind *)
# ADTs: export T(..) to include type + ctor + fields.
# type aliases: export T (no (..) not an ADT).
# type instance lines start with lowercase 'i', so don't match [A-Z].
_types=$(
{
awk '/^data [A-Z]|^newtype [A-Z]/{print $2"(..)"}' \
awk '/^data [A-Z]|^newtype [A-Z]/{print $2"(..)"}
/^type [A-Z]/{print $2}' \
"$sourceRoot/build/Generated/Enums.hs"
find "$sourceRoot/build/Generated/ActualTypes" -name "*.hs" | \
sort | while IFS= read -r _m; do
awk '/^data [A-Z]|^newtype [A-Z]/{print $2"(..)"}' "$_m"
awk '/^data [A-Z]|^newtype [A-Z]/{print $2"(..)"}
/^type [A-Z]/{print $2}' "$_m"
done
} | sort -u
)