From e3ae139fe323db4497a64992b7059f1659e574eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20Ve=C4=8Derek?= Date: Wed, 6 Nov 2024 15:26:26 +0100 Subject: [PATCH] fix: typecheck namespace examples (#88) --- .changeset/soft-cats-hide.md | 5 +++++ src/Core.ts | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/soft-cats-hide.md diff --git a/.changeset/soft-cats-hide.md b/.changeset/soft-cats-hide.md new file mode 100644 index 0000000..ca312ec --- /dev/null +++ b/.changeset/soft-cats-hide.md @@ -0,0 +1,5 @@ +--- +"@effect/docgen": patch +--- + +Typecheck namespace examples diff --git a/src/Core.ts b/src/Core.ts index 839da59..11a4387 100644 --- a/src/Core.ts +++ b/src/Core.ts @@ -183,6 +183,10 @@ const getExampleFiles = (modules: ReadonlyArray) => module.functions, getFiles("function") ) + const namespacesExamples = Array.flatMap( + module.namespaces, + getFiles("namespace") + ) return Array.flatten([ moduleExamples, @@ -190,7 +194,8 @@ const getExampleFiles = (modules: ReadonlyArray) => interfacesExamples, typeAliasesExamples, constantsExamples, - functionsExamples + functionsExamples, + namespacesExamples ]) }) })