From 196e6e9130ce3a89350a512504da19585e384b7d Mon Sep 17 00:00:00 2001 From: Jacob Alford Date: Fri, 25 Aug 2023 14:24:12 -0600 Subject: [PATCH 1/2] fix: recursive export --- docs/schemata/index.md | 30 +++++++++++++++--------------- scripts/generate-schemata.ts | 13 +++++++++++-- src/schemata/index.ts | 1 - 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/docs/schemata/index.md b/docs/schemata/index.md index c8a3da0a..1d9375cf 100644 --- a/docs/schemata/index.md +++ b/docs/schemata/index.md @@ -81,23 +81,23 @@ has_children: true ### String (17) -* Ascii ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Ascii.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Ascii.ts)) (e.g: `N>]G3"_eRiH`, `}LFB4`, `-NK (contents: string) => Build = // #endregion /** Extracts module name, e.g. ASCII.ts -> ASCII */ -const getModuleName: (file: string) => string = flow(Str.split('.'), RNEA.head) +const getModuleName: (file: string) => O.Option = flow( + Str.split('.'), + RNEA.head, + O.fromPredicate(Pred.not(Str.includes('index'))), +) const getSchemata: Build> = C => - pipe(C.readFiles('./src/schemata'), TE.map(RA.map(flow(getModuleName, tuple)))) + pipe( + C.readFiles('./src/schemata'), + TE.map(RA.filterMap(flow(getModuleName, O.map(tuple)))), + ) const format: Build = C => C.exec('yarn format') diff --git a/src/schemata/index.ts b/src/schemata/index.ts index 5e250a25..848fedef 100644 --- a/src/schemata/index.ts +++ b/src/schemata/index.ts @@ -35,7 +35,6 @@ export * from 'schemata-ts/schemata/Hexadecimal' export * from 'schemata-ts/schemata/HexColor' export * from 'schemata-ts/schemata/HslColor' export * from 'schemata-ts/schemata/Imap' -export * from 'schemata-ts/schemata/index' export * from 'schemata-ts/schemata/Int' export * from 'schemata-ts/schemata/Intersect' export * from 'schemata-ts/schemata/IntFromString' From 7fa6563ff4c2f5f9bc86dd4c4c7c78b56ff5f2db Mon Sep 17 00:00:00 2001 From: Jacob Alford Date: Fri, 25 Aug 2023 14:24:55 -0600 Subject: [PATCH 2/2] chore: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 777de6b9..ed445e2f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "schemata-ts", - "version": "2.0.5", + "version": "2.0.6", "description": "An all-inclusive schema engine featuring schemata inspired by io-ts and validators.js. Written for TypeScript with fp-ts", "homepage": "https://jacob-alford.github.io/schemata-ts/", "repository": {